fix: indicate selected location on save request

This commit is contained in:
Liyas Thomas
2021-05-13 04:26:33 +00:00
committed by GitHub
parent 2ff0f97295
commit c1f083d19f
7 changed files with 38 additions and 23 deletions

View File

@@ -12,7 +12,8 @@
<button class="icon" @click="toggleShowChildren">
<i class="material-icons" v-show="!showChildren && !isFiltered">arrow_right</i>
<i class="material-icons" v-show="showChildren || isFiltered">arrow_drop_down</i>
<i class="material-icons">folder</i>
<i v-if="picked === collectionIndex" class="text-green-400 material-icons">check_circle</i>
<i v-else class="material-icons">folder</i>
<span>{{ collection.name }}</span>
</button>
<div>
@@ -87,9 +88,11 @@
name: folder.name + '/' + $event.name,
id: $event.id,
reqIdx: $event.reqIdx,
folderPath: $event.folderPath,
})
"
@remove-request="removeRequest"
:picked="picked"
/>
</li>
</ul>
@@ -157,6 +160,7 @@ export default {
selected: Boolean,
saveRequest: Boolean,
collectionsType: Object,
picked: { default: "", type: String },
},
data() {
return {

View File

@@ -13,7 +13,8 @@
<button class="icon" @click="toggleShowChildren">
<i class="material-icons" v-show="!showChildren && !isFiltered">arrow_right</i>
<i class="material-icons" v-show="showChildren || isFiltered">arrow_drop_down</i>
<i class="material-icons">folder_open</i>
<i v-if="picked === folderPath" class="text-green-400 material-icons">check_circle</i>
<i v-else class="material-icons">folder_open</i>
<span>{{ folder.name ? folder.name : folder.title }}</span>
</button>
</div>
@@ -75,6 +76,7 @@
name: subFolder.name + '/' + $event.name,
id: subFolder.id,
reqIdx: $event.reqIdx,
folderPath: $event.folderPath,
})
"
@remove-request="removeRequest"
@@ -147,6 +149,7 @@ export default {
saveRequest: Boolean,
isFiltered: Boolean,
collectionsType: Object,
picked: { default: "", type: String },
},
data() {
return {
@@ -173,7 +176,12 @@ export default {
},
toggleShowChildren() {
if (this.$props.saveRequest)
this.$emit("select-folder", { name: "", id: this.$props.folder.id, reqIdx: "" })
this.$emit("select-folder", {
name: "",
id: this.$props.folder.id,
reqIdx: "",
folderPath: this.$props.folderPath,
})
this.showChildren = !this.showChildren
},
removeFolder() {