From c21b0fdfe83706f8e6bd73c91c58e658326b19d9 Mon Sep 17 00:00:00 2001 From: Ryan Wang Date: Mon, 28 Nov 2022 10:50:17 +0800 Subject: [PATCH] chore: bump @halo-dev/api-client for reload theme api (halo-dev/console#711) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit #### What type of PR is this? /kind api-change /milestone 2.0 #### What this PR does / why we need it: 升级 `@halo-dev/api-client` 以适配 https://github.com/halo-dev/halo/pull/2745 #### Which issue(s) this PR fixes: Fixes https://github.com/halo-dev/halo/issues/2735 #### Special notes for your reviewer: /cc @halo-dev/sig-halo-console 测试方式: 1. Halo 需要切换到 https://github.com/halo-dev/halo/issues/2735 分支。 2. Console 需要 `pnpm install` 3. 安装一个主题,并尝试修改 `theme.yaml` 和 `settings.yaml`,然后再主题详情页面点击 `刷新设置表单` 的按钮,检查改动是否被更新。 #### Does this PR introduce a user-facing change? ```release-note None ``` --- package.json | 2 +- pnpm-lock.yaml | 8 ++++---- src/modules/interface/themes/ThemeDetail.vue | 12 ++++++------ .../interface/themes/components/ThemeListModal.vue | 2 +- 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/package.json b/package.json index ebcabad4d..67e158fa7 100644 --- a/package.json +++ b/package.json @@ -32,7 +32,7 @@ "@formkit/themes": "^1.0.0-beta.12", "@formkit/utils": "^1.0.0-beta.12", "@formkit/vue": "^1.0.0-beta.12", - "@halo-dev/api-client": "^0.0.51", + "@halo-dev/api-client": "^0.0.53", "@halo-dev/components": "workspace:*", "@halo-dev/console-shared": "workspace:*", "@halo-dev/richtext-editor": "^0.0.0-alpha.14", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 4334f79ba..55ff88c2e 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -12,7 +12,7 @@ importers: '@formkit/themes': ^1.0.0-beta.12 '@formkit/utils': ^1.0.0-beta.12 '@formkit/vue': ^1.0.0-beta.12 - '@halo-dev/api-client': ^0.0.51 + '@halo-dev/api-client': ^0.0.53 '@halo-dev/components': workspace:* '@halo-dev/console-shared': workspace:* '@halo-dev/richtext-editor': ^0.0.0-alpha.14 @@ -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.51 + '@halo-dev/api-client': 0.0.53 '@halo-dev/components': link:packages/components '@halo-dev/console-shared': link:packages/shared '@halo-dev/richtext-editor': 0.0.0-alpha.14_vue@3.2.45 @@ -1962,8 +1962,8 @@ packages: - windicss dev: false - /@halo-dev/api-client/0.0.51: - resolution: {integrity: sha512-kvwhTogmVVLNwfbAVSNUC+pYt7YXn+eaOD0/5N11BmJ+2pHQUSUKjtPwOF+U+KkQ8hRGmFxHD2XvnrcCOr4XHQ==} + /@halo-dev/api-client/0.0.53: + resolution: {integrity: sha512-B3njjXFqTi28FfDhZ9VAVlv6mMQxLgIsBUqTPmMQF/IxWWtfN6cxYi7is+zmw+chFFe38UVaEAPSHORLMxnJ6A==} dev: false /@halo-dev/richtext-editor/0.0.0-alpha.14_vue@3.2.45: diff --git a/src/modules/interface/themes/ThemeDetail.vue b/src/modules/interface/themes/ThemeDetail.vue index 234f952c6..e0a8b7ff1 100644 --- a/src/modules/interface/themes/ThemeDetail.vue +++ b/src/modules/interface/themes/ThemeDetail.vue @@ -25,17 +25,17 @@ const selectedTheme = inject>("selectedTheme"); const isActivated = inject>("isActivated"); const upgradeModal = ref(false); -const handleReloadThemeSetting = async () => { +const handleReloadTheme = async () => { Dialog.warning({ - title: "是否确认刷新主题的设置表单?", - description: "此操作仅会刷新主题的设置表单,不会删除已有的配置。", + title: "是否确认重载主题的所有配置?", + description: "此操作仅会重载主题配置和设置表单定义,不会删除已保存的配置。", onConfirm: async () => { try { if (!selectedTheme?.value) { return; } - await apiClient.theme.reloadThemeSetting({ + await apiClient.theme.reload({ name: selectedTheme.value.metadata.name as string, }); @@ -101,9 +101,9 @@ const onUpgradeModalClose = () => { v-close-popper block type="default" - @click="handleReloadThemeSetting" + @click="handleReloadTheme" > - 刷新设置表单 + 重载主题配置 diff --git a/src/modules/interface/themes/components/ThemeListModal.vue b/src/modules/interface/themes/components/ThemeListModal.vue index 7d0e8f5a5..ea0a2d2c5 100644 --- a/src/modules/interface/themes/components/ThemeListModal.vue +++ b/src/modules/interface/themes/components/ThemeListModal.vue @@ -155,7 +155,7 @@ const handleCreateTheme = async (theme: Theme) => { }); // create theme settings - apiClient.theme.reloadThemeSetting({ name: data.metadata.name }); + apiClient.theme.reload({ name: data.metadata.name }); activeTab.value = "installed"; } catch (error) {