fix: clean input value in modals - fixed #1662
This commit is contained in:
@@ -43,16 +43,17 @@ export default {
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
name: undefined,
|
||||
name: null,
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
addNewCollection() {
|
||||
this.$emit("submit", this.name)
|
||||
this.hideModal()
|
||||
},
|
||||
hideModal() {
|
||||
this.name = null
|
||||
this.$emit("hide-modal")
|
||||
this.$data.name = undefined
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
@@ -46,7 +46,7 @@ export default {
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
name: undefined,
|
||||
name: null,
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
@@ -56,8 +56,10 @@ export default {
|
||||
folder: this.folder,
|
||||
path: this.folderPath || `${this.collectionIndex}`,
|
||||
})
|
||||
this.hideModal()
|
||||
},
|
||||
hideModal() {
|
||||
this.name = null
|
||||
this.$emit("hide-modal")
|
||||
},
|
||||
},
|
||||
|
||||
@@ -44,16 +44,17 @@ export default {
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
name: undefined,
|
||||
name: null,
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
saveCollection() {
|
||||
this.$emit("submit", this.name)
|
||||
this.hideModal()
|
||||
},
|
||||
hideModal() {
|
||||
this.name = null
|
||||
this.$emit("hide-modal")
|
||||
this.$data.name = undefined
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
@@ -42,14 +42,16 @@ export default {
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
name: undefined,
|
||||
name: null,
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
editFolder() {
|
||||
this.$emit("submit", this.name)
|
||||
this.hideModal()
|
||||
},
|
||||
hideModal() {
|
||||
this.name = null
|
||||
this.$emit("hide-modal")
|
||||
},
|
||||
},
|
||||
|
||||
@@ -45,15 +45,17 @@ export default {
|
||||
data() {
|
||||
return {
|
||||
requestUpdateData: {
|
||||
name: undefined,
|
||||
name: null,
|
||||
},
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
saveRequest() {
|
||||
this.$emit("submit", this.requestUpdateData)
|
||||
this.hideModal()
|
||||
},
|
||||
hideModal() {
|
||||
this.requestUpdateData = { name: null }
|
||||
this.$emit("hide-modal")
|
||||
},
|
||||
},
|
||||
|
||||
@@ -45,7 +45,7 @@ export default {
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
name: undefined,
|
||||
name: null,
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
@@ -70,12 +70,12 @@ export default {
|
||||
name: this.$data.name,
|
||||
flag: "graphql",
|
||||
})
|
||||
this.$emit("hide-modal")
|
||||
this.syncCollections()
|
||||
this.hideModal()
|
||||
},
|
||||
hideModal() {
|
||||
this.name = null
|
||||
this.$emit("hide-modal")
|
||||
this.$data.name = undefined
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
@@ -37,6 +37,8 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { fb } from "~/helpers/fb"
|
||||
|
||||
export default {
|
||||
props: {
|
||||
show: Boolean,
|
||||
@@ -46,18 +48,33 @@ export default {
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
name: undefined,
|
||||
name: null,
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
syncCollections() {
|
||||
if (fb.currentUser !== null && fb.currentSettings[0]) {
|
||||
if (fb.currentSettings[0].value) {
|
||||
fb.writeCollections(
|
||||
JSON.parse(
|
||||
JSON.stringify(this.$store.state.postwoman.collectionsGraphql)
|
||||
),
|
||||
"collectionsGraphql"
|
||||
)
|
||||
}
|
||||
}
|
||||
},
|
||||
addFolder() {
|
||||
this.$emit("add-folder", {
|
||||
name: this.name,
|
||||
folder: this.folder,
|
||||
path: this.folderPath || `${this.collectionIndex}`,
|
||||
})
|
||||
this.syncCollections()
|
||||
this.hideModal()
|
||||
},
|
||||
hideModal() {
|
||||
this.name = null
|
||||
this.$emit("hide-modal")
|
||||
},
|
||||
},
|
||||
|
||||
@@ -47,7 +47,7 @@ export default {
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
name: undefined,
|
||||
name: null,
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
@@ -77,10 +77,11 @@ export default {
|
||||
collectionIndex: this.$props.editingCollectionIndex,
|
||||
flag: "graphql",
|
||||
})
|
||||
this.$emit("hide-modal")
|
||||
this.syncCollections()
|
||||
this.hideModal()
|
||||
},
|
||||
hideModal() {
|
||||
this.name = null
|
||||
this.$emit("hide-modal")
|
||||
},
|
||||
},
|
||||
|
||||
@@ -48,7 +48,7 @@ export default {
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
name: undefined,
|
||||
name: null,
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
@@ -72,10 +72,11 @@ export default {
|
||||
folderName: this.$props.folder.name,
|
||||
flag: "graphql",
|
||||
})
|
||||
this.hideModal()
|
||||
this.syncCollections()
|
||||
this.hideModal()
|
||||
},
|
||||
hideModal() {
|
||||
this.name = null
|
||||
this.$emit("hide-modal")
|
||||
},
|
||||
},
|
||||
|
||||
@@ -51,7 +51,7 @@ export default {
|
||||
data() {
|
||||
return {
|
||||
requestUpdateData: {
|
||||
name: undefined,
|
||||
name: null,
|
||||
},
|
||||
}
|
||||
},
|
||||
@@ -82,11 +82,11 @@ export default {
|
||||
requestIndex: this.$props.requestIndex,
|
||||
flag: "graphql",
|
||||
})
|
||||
|
||||
this.hideModal()
|
||||
this.syncCollections()
|
||||
this.hideModal()
|
||||
},
|
||||
hideModal() {
|
||||
this.requestUpdateData = { name: null }
|
||||
this.$emit("hide-modal")
|
||||
},
|
||||
},
|
||||
|
||||
@@ -46,7 +46,7 @@ export default {
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
name: undefined,
|
||||
name: null,
|
||||
}
|
||||
},
|
||||
subscriptions() {
|
||||
@@ -77,12 +77,12 @@ export default {
|
||||
environments: newEnvironment,
|
||||
confirmation: "Environment added",
|
||||
})
|
||||
this.$emit("hide-modal")
|
||||
this.syncEnvironments()
|
||||
this.hideModal()
|
||||
},
|
||||
hideModal() {
|
||||
this.name = null
|
||||
this.$emit("hide-modal")
|
||||
this.$data.name = undefined
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
@@ -125,7 +125,7 @@ export default {
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
name: undefined,
|
||||
name: null,
|
||||
doneButton: '<i class="material-icons">done</i>',
|
||||
}
|
||||
},
|
||||
@@ -212,12 +212,12 @@ export default {
|
||||
environment: environmentUpdated,
|
||||
environmentIndex: this.$props.editingEnvironmentIndex,
|
||||
})
|
||||
this.$emit("hide-modal")
|
||||
this.syncEnvironments()
|
||||
this.hideModal()
|
||||
},
|
||||
hideModal() {
|
||||
this.name = null
|
||||
this.$emit("hide-modal")
|
||||
this.$data.name = undefined
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
@@ -51,7 +51,7 @@ export default {
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
name: undefined,
|
||||
name: null,
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
@@ -79,9 +79,10 @@ export default {
|
||||
// We restore the initial user input
|
||||
this.name = name
|
||||
})
|
||||
this.hideModal()
|
||||
},
|
||||
hideModal() {
|
||||
this.$data.name = undefined
|
||||
this.name = null
|
||||
this.$emit("hide-modal")
|
||||
},
|
||||
},
|
||||
|
||||
@@ -398,8 +398,8 @@ export default {
|
||||
this.newMembers = []
|
||||
},
|
||||
hideModal() {
|
||||
this.rename = null
|
||||
this.$emit("hide-modal")
|
||||
this.$data.name = undefined
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user