diff --git a/packages/hoppscotch-common/locales/en.json b/packages/hoppscotch-common/locales/en.json index a8b48ca9e..f28b644c1 100644 --- a/packages/hoppscotch-common/locales/en.json +++ b/packages/hoppscotch-common/locales/en.json @@ -391,6 +391,7 @@ "copy_link": "Copy link", "duration": "Duration", "enter_curl": "Enter cURL command", + "duplicated": "Request duplicated", "generate_code": "Generate code", "generated_code": "Generated code", "header_list": "Header List", diff --git a/packages/hoppscotch-common/src/components.d.ts b/packages/hoppscotch-common/src/components.d.ts index 710cbd7d8..3b7ae649d 100644 --- a/packages/hoppscotch-common/src/components.d.ts +++ b/packages/hoppscotch-common/src/components.d.ts @@ -32,7 +32,7 @@ declare module '@vue/runtime-core' { CollectionsAdd: typeof import('./components/collections/Add.vue')['default'] CollectionsAddFolder: typeof import('./components/collections/AddFolder.vue')['default'] CollectionsAddRequest: typeof import('./components/collections/AddRequest.vue')['default'] - CollectionsChooseType: typeof import('./components/collections/ChooseType.vue')['default'] + CollectionsCollection: typeof import('./components/collections/Collection.vue')['default'] CollectionsEdit: typeof import('./components/collections/Edit.vue')['default'] CollectionsEditFolder: typeof import('./components/collections/EditFolder.vue')['default'] CollectionsEditRequest: typeof import('./components/collections/EditRequest.vue')['default'] @@ -48,13 +48,11 @@ declare module '@vue/runtime-core' { CollectionsGraphqlImportExport: typeof import('./components/collections/graphql/ImportExport.vue')['default'] CollectionsGraphqlRequest: typeof import('./components/collections/graphql/Request.vue')['default'] CollectionsImportExport: typeof import('./components/collections/ImportExport.vue')['default'] - CollectionsMyCollection: typeof import('./components/collections/my/Collection.vue')['default'] - CollectionsMyFolder: typeof import('./components/collections/my/Folder.vue')['default'] - CollectionsMyRequest: typeof import('./components/collections/my/Request.vue')['default'] + CollectionsMyCollections: typeof import('./components/collections/MyCollections.vue')['default'] + CollectionsRequest: typeof import('./components/collections/Request.vue')['default'] CollectionsSaveRequest: typeof import('./components/collections/SaveRequest.vue')['default'] - CollectionsTeamsCollection: typeof import('./components/collections/teams/Collection.vue')['default'] - CollectionsTeamsFolder: typeof import('./components/collections/teams/Folder.vue')['default'] - CollectionsTeamsRequest: typeof import('./components/collections/teams/Request.vue')['default'] + CollectionsTeamCollections: typeof import('./components/collections/TeamCollections.vue')['default'] + CollectionsTeamSelect: typeof import('./components/collections/TeamSelect.vue')['default'] Environments: typeof import('./components/environments/index.vue')['default'] EnvironmentsChooseType: typeof import('./components/environments/ChooseType.vue')['default'] EnvironmentsImportExport: typeof import('./components/environments/ImportExport.vue')['default'] @@ -152,6 +150,8 @@ declare module '@vue/runtime-core' { SmartTab: typeof import('./../../hoppscotch-ui/src/components/smart/Tab.vue')['default'] SmartTabs: typeof import('./../../hoppscotch-ui/src/components/smart/Tabs.vue')['default'] SmartToggle: typeof import('./../../hoppscotch-ui/src/components/smart/Toggle.vue')['default'] + SmartTree: typeof import('./components/smart/Tree.vue')['default'] + SmartTreeBranch: typeof import('./components/smart/TreeBranch.vue')['default'] SmartWindow: typeof import('./../../hoppscotch-ui/src/components/smart/Window.vue')['default'] SmartWindows: typeof import('./../../hoppscotch-ui/src/components/smart/Windows.vue')['default'] TabPrimary: typeof import('./components/tab/Primary.vue')['default'] diff --git a/packages/hoppscotch-common/src/components/collections/Add.vue b/packages/hoppscotch-common/src/components/collections/Add.vue index d11d0fdc0..a2f0575c0 100644 --- a/packages/hoppscotch-common/src/components/collections/Add.vue +++ b/packages/hoppscotch-common/src/components/collections/Add.vue @@ -41,47 +41,52 @@ - diff --git a/packages/hoppscotch-common/src/components/collections/AddFolder.vue b/packages/hoppscotch-common/src/components/collections/AddFolder.vue index 0a1c7f797..ba0d56fb4 100644 --- a/packages/hoppscotch-common/src/components/collections/AddFolder.vue +++ b/packages/hoppscotch-common/src/components/collections/AddFolder.vue @@ -3,7 +3,7 @@ v-if="show" dialog :title="t('folder.new')" - @close="$emit('hide-modal')" + @close="emit('hide-modal')" > - diff --git a/packages/hoppscotch-common/src/components/collections/AddRequest.vue b/packages/hoppscotch-common/src/components/collections/AddRequest.vue index 68f76c892..fba4fe5d9 100644 --- a/packages/hoppscotch-common/src/components/collections/AddRequest.vue +++ b/packages/hoppscotch-common/src/components/collections/AddRequest.vue @@ -48,23 +48,20 @@ import { getRESTRequest } from "~/newstore/RESTSession" const toast = useToast() const t = useI18n() -const props = defineProps<{ - show: boolean - loadingState: boolean - folder?: object - folderPath?: string -}>() +const props = withDefaults( + defineProps<{ + show: boolean + loadingState: boolean + }>(), + { + show: false, + loadingState: false, + } +) const emit = defineEmits<{ - (e: "hide-modal"): void - ( - e: "add-request", - v: { - name: string - folder: object | undefined - path: string | undefined - } - ): void + (event: "hide-modal"): void + (event: "add-request", name: string): void }>() const name = ref("") @@ -79,15 +76,11 @@ watch( ) const addRequest = () => { - if (!name.value) { + if (name.value.trim() === "") { toast.error(`${t("error.empty_req_name")}`) return } - emit("add-request", { - name: name.value, - folder: props.folder, - path: props.folderPath, - }) + emit("add-request", name.value) } const hideModal = () => { diff --git a/packages/hoppscotch-common/src/components/collections/ChooseType.vue b/packages/hoppscotch-common/src/components/collections/ChooseType.vue deleted file mode 100644 index 52974141a..000000000 --- a/packages/hoppscotch-common/src/components/collections/ChooseType.vue +++ /dev/null @@ -1,162 +0,0 @@ - - - diff --git a/packages/hoppscotch-common/src/components/collections/Collection.vue b/packages/hoppscotch-common/src/components/collections/Collection.vue new file mode 100644 index 000000000..7a96c7387 --- /dev/null +++ b/packages/hoppscotch-common/src/components/collections/Collection.vue @@ -0,0 +1,252 @@ + + + diff --git a/packages/hoppscotch-common/src/components/collections/Edit.vue b/packages/hoppscotch-common/src/components/collections/Edit.vue index 803838281..65b348977 100644 --- a/packages/hoppscotch-common/src/components/collections/Edit.vue +++ b/packages/hoppscotch-common/src/components/collections/Edit.vue @@ -41,46 +41,52 @@ - diff --git a/packages/hoppscotch-common/src/components/collections/EditFolder.vue b/packages/hoppscotch-common/src/components/collections/EditFolder.vue index 659986fc3..58ec7549c 100644 --- a/packages/hoppscotch-common/src/components/collections/EditFolder.vue +++ b/packages/hoppscotch-common/src/components/collections/EditFolder.vue @@ -3,7 +3,7 @@ v-if="show" dialog :title="t('folder.edit')" - @close="$emit('hide-modal')" + @close="emit('hide-modal')" > - diff --git a/packages/hoppscotch-common/src/components/collections/EditRequest.vue b/packages/hoppscotch-common/src/components/collections/EditRequest.vue index 22ab6df3b..f08e8fbf1 100644 --- a/packages/hoppscotch-common/src/components/collections/EditRequest.vue +++ b/packages/hoppscotch-common/src/components/collections/EditRequest.vue @@ -9,13 +9,13 @@