✏️ Better Save request modal

This commit is contained in:
Liyas Thomas
2019-10-25 14:49:47 +05:30
parent a09d7d76d3
commit 27d3e9e6b7
2 changed files with 17 additions and 13 deletions

View File

@@ -20,8 +20,8 @@
<div slot="footer"> <div slot="footer">
<ul> <ul>
<li> <li>
<button class="icon" @click="openDialogChooseFileToReplaceWith"> <button class="icon" @click="openDialogChooseFileToReplaceWith" v-tooltip="'Replace current'">
<i class="material-icons">get_app</i> <i class="material-icons">create_new_folder</i>
<span>Replace with JSON</span> <span>Replace with JSON</span>
<input <input
type="file" type="file"
@@ -32,8 +32,8 @@
</button> </button>
</li> </li>
<li> <li>
<button class="icon" @click="openDialogChooseFileToImportFrom"> <button class="icon" @click="openDialogChooseFileToImportFrom" v-tooltip="'Preserve current'">
<i class="material-icons">get_app</i> <i class="material-icons">folder_shared</i>
<span>Import from JSON</span> <span>Import from JSON</span>
<input <input
type="file" type="file"
@@ -44,9 +44,9 @@
</button> </button>
</li> </li>
<li> <li>
<button class="icon" @click="exportJSON"> <button class="icon" @click="exportJSON" v-tooltip="'Download file'">
<i class="material-icons">get_app</i> <i class="material-icons">get_app</i>
<span>Export JSON</span> <span>Export to JSON</span>
</button> </button>
</li> </li>
</ul> </ul>

View File

@@ -17,20 +17,24 @@
<div slot="body"> <div slot="body">
<ul> <ul>
<li> <li>
<input type="text" v-model="requestData.name" v-bind:placeholder="defaultRequestName" /> <label for="selectLabel">Label</label>
<select type="text" v-model="requestData.collectionIndex"> <input type="text" id="selectLabel" v-model="requestData.name" v-bind:placeholder="defaultRequestName" />
<label for="selectCollection">Collection</label>
<select type="text" id="selectCollection" v-model="requestData.collectionIndex">
<option <option
v-for="(collection, index) in $store.state.postwoman.collections" v-for="(collection, index) in $store.state.postwoman.collections"
:key="index" :key="index"
:value="index" :value="index"
>{{ collection.name }}</option> >{{ collection.name }}</option>
</select> </select>
<select type="text" v-model="requestData.folderIndex"> <label for="selectFolder">Folder</label>
<option :key="undefined" :value="undefined"></option> <select type="text" id="selectFolder" v-model="requestData.folderIndex">
<option :key="undefined" :value="undefined">/</option>
<option v-for="(folder, index) in folders" :key="index" :value="index">{{ folder.name }}</option> <option v-for="(folder, index) in folders" :key="index" :value="index">{{ folder.name }}</option>
</select> </select>
<select type="text" v-model="requestData.requestIndex"> <label for="selectRequest">Request</label>
<option :key="undefined" :value="undefined"></option> <select type="text" id="selectRequest" v-model="requestData.requestIndex">
<option :key="undefined" :value="undefined">/</option>
<option <option
v-for="(folder, index) in requests" v-for="(folder, index) in requests"
:key="index" :key="index"
@@ -124,7 +128,7 @@
const userDidntSpecifyCollection = const userDidntSpecifyCollection =
this.$data.requestData.collectionIndex === undefined; this.$data.requestData.collectionIndex === undefined;
if (userDidntSpecifyCollection) { if (userDidntSpecifyCollection) {
this.$toast.error("please, specify collection first", { this.$toast.error("Select a Collection", {
icon: "error" icon: "error"
}); });
return; return;