diff --git a/package.json b/package.json index 758039519f..9bff579c99 100644 --- a/package.json +++ b/package.json @@ -32,7 +32,7 @@ "@formkit/themes": "^1.0.0-beta.11", "@formkit/vue": "^1.0.0-beta.11", "@formkit/utils": "^1.0.0-beta.11", - "@halo-dev/api-client": "^0.0.50", + "@halo-dev/api-client": "^0.0.51", "@halo-dev/components": "workspace:*", "@halo-dev/console-shared": "workspace:*", "@halo-dev/richtext-editor": "^0.0.0-alpha.11", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index e3161a7b5f..d5944e255e 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -12,7 +12,7 @@ importers: '@formkit/themes': ^1.0.0-beta.11 '@formkit/utils': ^1.0.0-beta.11 '@formkit/vue': ^1.0.0-beta.11 - '@halo-dev/api-client': ^0.0.50 + '@halo-dev/api-client': ^0.0.51 '@halo-dev/components': workspace:* '@halo-dev/console-shared': workspace:* '@halo-dev/richtext-editor': ^0.0.0-alpha.11 @@ -104,7 +104,7 @@ importers: '@formkit/themes': 1.0.0-beta.12-e579559_tailwindcss@3.2.4 '@formkit/utils': 1.0.0-beta.12-e579559 '@formkit/vue': 1.0.0-beta.12-e579559_ior6jr3fpijijuwpr34w2i25va - '@halo-dev/api-client': 0.0.50 + '@halo-dev/api-client': 0.0.51 '@halo-dev/components': link:packages/components '@halo-dev/console-shared': link:packages/shared '@halo-dev/richtext-editor': 0.0.0-alpha.11_vue@3.2.45 @@ -1970,8 +1970,8 @@ packages: - windicss dev: false - /@halo-dev/api-client/0.0.50: - resolution: {integrity: sha512-/bf/zv/27Pk2dpyozKeEjFkNy5P5ecGX2064WA2oQVHV8sK0UeCRrzDKQ/bIHrHJWaP9aBAN29fE9ocBXoJMeg==} + /@halo-dev/api-client/0.0.51: + resolution: {integrity: sha512-kvwhTogmVVLNwfbAVSNUC+pYt7YXn+eaOD0/5N11BmJ+2pHQUSUKjtPwOF+U+KkQ8hRGmFxHD2XvnrcCOr4XHQ==} dev: false /@halo-dev/richtext-editor/0.0.0-alpha.11_vue@3.2.45: diff --git a/src/modules/contents/attachments/AttachmentList.vue b/src/modules/contents/attachments/AttachmentList.vue index 05a047a396..71ce03d2e8 100644 --- a/src/modules/contents/attachments/AttachmentList.vue +++ b/src/modules/contents/attachments/AttachmentList.vue @@ -208,12 +208,16 @@ const onDetailModalClose = () => { selectedAttachment.value = undefined; nameQuery.value = undefined; nameQueryAttachment.value = undefined; - handleFetchAttachments(); + setTimeout(() => { + handleFetchAttachments(); + }, 200); }; const onUploadModalClose = () => { routeQueryAction.value = undefined; - handleFetchAttachments(); + setTimeout(() => { + handleFetchAttachments(); + }, 200); }; const onGroupChange = () => { diff --git a/src/modules/contents/attachments/components/AttachmentGroupList.vue b/src/modules/contents/attachments/components/AttachmentGroupList.vue index b7957ba9e8..8f78feee22 100644 --- a/src/modules/contents/attachments/components/AttachmentGroupList.vue +++ b/src/modules/contents/attachments/components/AttachmentGroupList.vue @@ -57,7 +57,7 @@ const defaultGroups: Group[] = [ apiVersion: "", kind: "", metadata: { - name: "none", + name: "ungrouped", }, }, ]; @@ -68,7 +68,7 @@ const groupToUpdate = ref(null); const loading = ref(false); const editingModal = ref(false); -const routeQuery = useRouteQuery("group"); +const routeQuery = useRouteQuery("group"); const handleSelectGroup = (group: Group) => { emit("update:selectedGroup", group); @@ -166,7 +166,8 @@ const handleDeleteWithAttachments = (group: Group) => { watch( () => groups.value.length, () => { - const groupIndex = groups.value.findIndex( + const allGroups = [...defaultGroups, ...groups.value]; + const groupIndex = allGroups.findIndex( (group) => group.metadata.name === routeQuery.value ); @@ -186,8 +187,8 @@ onMounted(async () => { ); if (group) { handleSelectGroup(group); + return; } - return; } handleSelectGroup(defaultGroups[0]); diff --git a/src/modules/contents/attachments/composables/use-attachment.ts b/src/modules/contents/attachments/composables/use-attachment.ts index 33792bde5b..a3e479c1cd 100644 --- a/src/modules/contents/attachments/composables/use-attachment.ts +++ b/src/modules/contents/attachments/composables/use-attachment.ts @@ -82,6 +82,7 @@ export function useAttachmentControl(filterOptions?: { policy: policy?.value?.metadata.name, displayName: keyword?.value, group: group?.value?.metadata.name, + ungrouped: group?.value?.metadata.name === "ungrouped", uploadedBy: user?.value?.metadata.name, page: attachments.value.page, size: attachments.value.size,