feat: show existing name while renaming collections/folders/requests - resolved #2006
This commit is contained in:
@@ -38,13 +38,18 @@ import { defineComponent } from "@nuxtjs/composition-api"
|
|||||||
export default defineComponent({
|
export default defineComponent({
|
||||||
props: {
|
props: {
|
||||||
show: Boolean,
|
show: Boolean,
|
||||||
placeholderCollName: { type: String, default: null },
|
editingCollectionName: { type: String, default: null },
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
name: null,
|
name: null,
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
watch: {
|
||||||
|
editingCollectionName(val) {
|
||||||
|
this.name = val
|
||||||
|
},
|
||||||
|
},
|
||||||
methods: {
|
methods: {
|
||||||
saveCollection() {
|
saveCollection() {
|
||||||
if (!this.name) {
|
if (!this.name) {
|
||||||
|
|||||||
@@ -39,12 +39,18 @@ import { defineComponent } from "@nuxtjs/composition-api"
|
|||||||
export default defineComponent({
|
export default defineComponent({
|
||||||
props: {
|
props: {
|
||||||
show: Boolean,
|
show: Boolean,
|
||||||
|
editingFolderName: { type: String, default: null },
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
name: null,
|
name: null,
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
watch: {
|
||||||
|
editingFolderName(val) {
|
||||||
|
this.name = val
|
||||||
|
},
|
||||||
|
},
|
||||||
methods: {
|
methods: {
|
||||||
editFolder() {
|
editFolder() {
|
||||||
if (!this.name) {
|
if (!this.name) {
|
||||||
|
|||||||
@@ -35,7 +35,7 @@ import { defineComponent } from "@nuxtjs/composition-api"
|
|||||||
export default defineComponent({
|
export default defineComponent({
|
||||||
props: {
|
props: {
|
||||||
show: Boolean,
|
show: Boolean,
|
||||||
placeholderReqName: { type: String, default: null },
|
editingRequestName: { type: String, default: null },
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
@@ -44,6 +44,11 @@ export default defineComponent({
|
|||||||
},
|
},
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
watch: {
|
||||||
|
editingRequestName(val) {
|
||||||
|
this.requestUpdateData.name = val
|
||||||
|
},
|
||||||
|
},
|
||||||
methods: {
|
methods: {
|
||||||
saveRequest() {
|
saveRequest() {
|
||||||
if (!this.requestUpdateData.name) {
|
if (!this.requestUpdateData.name) {
|
||||||
|
|||||||
@@ -45,12 +45,18 @@ export default defineComponent({
|
|||||||
show: Boolean,
|
show: Boolean,
|
||||||
editingCollection: { type: Object, default: () => {} },
|
editingCollection: { type: Object, default: () => {} },
|
||||||
editingCollectionIndex: { type: Number, default: null },
|
editingCollectionIndex: { type: Number, default: null },
|
||||||
|
editingCollectionName: { type: String, default: null },
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
name: null as string | null,
|
name: null as string | null,
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
watch: {
|
||||||
|
editingCollectionName(val) {
|
||||||
|
this.name = val
|
||||||
|
},
|
||||||
|
},
|
||||||
methods: {
|
methods: {
|
||||||
saveCollection() {
|
saveCollection() {
|
||||||
if (!this.name) {
|
if (!this.name) {
|
||||||
|
|||||||
@@ -45,12 +45,18 @@ export default defineComponent({
|
|||||||
show: Boolean,
|
show: Boolean,
|
||||||
folder: { type: Object, default: () => {} },
|
folder: { type: Object, default: () => {} },
|
||||||
folderPath: { type: String, default: null },
|
folderPath: { type: String, default: null },
|
||||||
|
editingFolderName: { type: String, default: null },
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
name: "",
|
name: "",
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
watch: {
|
||||||
|
editingFolderName(val) {
|
||||||
|
this.name = val
|
||||||
|
},
|
||||||
|
},
|
||||||
methods: {
|
methods: {
|
||||||
editFolder() {
|
editFolder() {
|
||||||
if (!this.name) {
|
if (!this.name) {
|
||||||
|
|||||||
@@ -47,6 +47,7 @@ export default defineComponent({
|
|||||||
folderPath: { type: String, default: null },
|
folderPath: { type: String, default: null },
|
||||||
request: { type: Object as PropType<HoppGQLRequest>, default: () => {} },
|
request: { type: Object as PropType<HoppGQLRequest>, default: () => {} },
|
||||||
requestIndex: { type: Number, default: null },
|
requestIndex: { type: Number, default: null },
|
||||||
|
editingRequestName: { type: String, default: null },
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
@@ -55,6 +56,11 @@ export default defineComponent({
|
|||||||
},
|
},
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
watch: {
|
||||||
|
editingRequestName(val) {
|
||||||
|
this.requestUpdateData.name = val
|
||||||
|
},
|
||||||
|
},
|
||||||
methods: {
|
methods: {
|
||||||
saveRequest() {
|
saveRequest() {
|
||||||
if (!this.requestUpdateData.name) {
|
if (!this.requestUpdateData.name) {
|
||||||
|
|||||||
@@ -96,6 +96,7 @@
|
|||||||
:show="showModalEdit"
|
:show="showModalEdit"
|
||||||
:editing-collection="editingCollection"
|
:editing-collection="editingCollection"
|
||||||
:editing-collection-index="editingCollectionIndex"
|
:editing-collection-index="editingCollectionIndex"
|
||||||
|
:editing-collection-name="editingCollection ? editingCollection.name : ''"
|
||||||
@hide-modal="displayModalEdit(false)"
|
@hide-modal="displayModalEdit(false)"
|
||||||
/>
|
/>
|
||||||
<CollectionsGraphqlAddFolder
|
<CollectionsGraphqlAddFolder
|
||||||
@@ -110,6 +111,7 @@
|
|||||||
:folder="editingFolder"
|
:folder="editingFolder"
|
||||||
:folder-index="editingFolderIndex"
|
:folder-index="editingFolderIndex"
|
||||||
:folder-path="editingFolderPath"
|
:folder-path="editingFolderPath"
|
||||||
|
:editing-folder-name="editingFolder ? editingFolder.name : ''"
|
||||||
@hide-modal="displayModalEditFolder(false)"
|
@hide-modal="displayModalEditFolder(false)"
|
||||||
/>
|
/>
|
||||||
<CollectionsGraphqlEditRequest
|
<CollectionsGraphqlEditRequest
|
||||||
@@ -117,6 +119,7 @@
|
|||||||
:folder-path="editingFolderPath"
|
:folder-path="editingFolderPath"
|
||||||
:request="editingRequest"
|
:request="editingRequest"
|
||||||
:request-index="editingRequestIndex"
|
:request-index="editingRequestIndex"
|
||||||
|
:editing-request-name="editingRequest ? editingRequest.name : ''"
|
||||||
@hide-modal="displayModalEditRequest(false)"
|
@hide-modal="displayModalEditRequest(false)"
|
||||||
/>
|
/>
|
||||||
<CollectionsGraphqlImportExport
|
<CollectionsGraphqlImportExport
|
||||||
|
|||||||
@@ -146,8 +146,11 @@
|
|||||||
/>
|
/>
|
||||||
<CollectionsEdit
|
<CollectionsEdit
|
||||||
:show="showModalEdit"
|
:show="showModalEdit"
|
||||||
:editing-coll-name="editingCollection ? editingCollection.name : ''"
|
:editing-collection-name="
|
||||||
:placeholder-coll-name="editingCollection ? editingCollection.name : ''"
|
editingCollection
|
||||||
|
? editingCollection.name || editingCollection.title
|
||||||
|
: ''
|
||||||
|
"
|
||||||
@hide-modal="displayModalEdit(false)"
|
@hide-modal="displayModalEdit(false)"
|
||||||
@submit="updateEditingCollection"
|
@submit="updateEditingCollection"
|
||||||
/>
|
/>
|
||||||
@@ -160,12 +163,15 @@
|
|||||||
/>
|
/>
|
||||||
<CollectionsEditFolder
|
<CollectionsEditFolder
|
||||||
:show="showModalEditFolder"
|
:show="showModalEditFolder"
|
||||||
|
:editing-folder-name="
|
||||||
|
editingFolder ? editingFolder.name || editingFolder.title : ''
|
||||||
|
"
|
||||||
@submit="updateEditingFolder"
|
@submit="updateEditingFolder"
|
||||||
@hide-modal="displayModalEditFolder(false)"
|
@hide-modal="displayModalEditFolder(false)"
|
||||||
/>
|
/>
|
||||||
<CollectionsEditRequest
|
<CollectionsEditRequest
|
||||||
:show="showModalEditRequest"
|
:show="showModalEditRequest"
|
||||||
:placeholder-req-name="editingRequest ? editingRequest.name : ''"
|
:editing-request-name="editingRequest ? editingRequest.name : ''"
|
||||||
@submit="updateEditingRequest"
|
@submit="updateEditingRequest"
|
||||||
@hide-modal="displayModalEditRequest(false)"
|
@hide-modal="displayModalEditRequest(false)"
|
||||||
/>
|
/>
|
||||||
|
|||||||
@@ -186,7 +186,12 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { ref, useMeta, defineComponent } from "@nuxtjs/composition-api"
|
import {
|
||||||
|
ref,
|
||||||
|
useMeta,
|
||||||
|
defineComponent,
|
||||||
|
watchEffect,
|
||||||
|
} from "@nuxtjs/composition-api"
|
||||||
import {
|
import {
|
||||||
currentUser$,
|
currentUser$,
|
||||||
setDisplayName,
|
setDisplayName,
|
||||||
@@ -210,8 +215,9 @@ const SYNC_ENVIRONMENTS = useSetting("syncEnvironments")
|
|||||||
const SYNC_HISTORY = useSetting("syncHistory")
|
const SYNC_HISTORY = useSetting("syncHistory")
|
||||||
const currentUser = useReadonlyStream(currentUser$, null)
|
const currentUser = useReadonlyStream(currentUser$, null)
|
||||||
|
|
||||||
const displayName = ref(currentUser$.value?.displayName)
|
const displayName = ref(currentUser.value?.displayName)
|
||||||
const updatingDisplayName = ref(false)
|
const updatingDisplayName = ref(false)
|
||||||
|
watchEffect(() => (displayName.value = currentUser.value?.displayName))
|
||||||
|
|
||||||
const updateDisplayName = () => {
|
const updateDisplayName = () => {
|
||||||
updatingDisplayName.value = true
|
updatingDisplayName.value = true
|
||||||
@@ -227,8 +233,9 @@ const updateDisplayName = () => {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
const emailAddress = ref(currentUser$.value?.email)
|
const emailAddress = ref(currentUser.value?.email)
|
||||||
const updatingEmailAddress = ref(false)
|
const updatingEmailAddress = ref(false)
|
||||||
|
watchEffect(() => (emailAddress.value = currentUser.value?.email))
|
||||||
|
|
||||||
const updateEmailAddress = () => {
|
const updateEmailAddress = () => {
|
||||||
updatingEmailAddress.value = true
|
updatingEmailAddress.value = true
|
||||||
|
|||||||
Reference in New Issue
Block a user