From 32d2def93cba74c44dc76b8dcaa1b9df7510de04 Mon Sep 17 00:00:00 2001 From: BugKing Date: Mon, 11 Sep 2023 13:52:03 +0800 Subject: [PATCH 01/10] ci: push image to GHCR for pull_request event --- .github/workflows/halo.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/halo.yaml b/.github/workflows/halo.yaml index 430c8dbb17..3c61b76506 100644 --- a/.github/workflows/halo.yaml +++ b/.github/workflows/halo.yaml @@ -60,5 +60,5 @@ jobs: ghcr-token: ${{ secrets.GHCR_TOKEN }} dockerhub-user: ${{ secrets.DOCKER_USERNAME }} dockerhub-token: ${{ secrets.DOCKER_TOKEN }} - push: ${{ github.event_name == 'push' || github.event_name == 'release' }} # we only push to GHCR if the push is to the next branch + push: ${{ github.event_name == 'pull_request' || github.event_name == 'push' || github.event_name == 'release' }} console-ref: ${{ github.event_name == 'release' && github.ref || 'main' }} From c48c5f94a7940bb3ed915c526cdf2a221ee748b5 Mon Sep 17 00:00:00 2001 From: Ryan Wang Date: Fri, 22 Sep 2023 13:06:23 +0800 Subject: [PATCH 02/10] chore: update issue templates (#4641) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit #### What type of PR is this? None #### What this PR does / why we need it: 更新 issue 模板。 #### Does this PR introduce a user-facing change? ```release-note None ``` --- .github/ISSUE_TEMPLATE/bug_report.en.yml | 7 ++++--- .github/ISSUE_TEMPLATE/bug_report.zh.yml | 7 ++++--- .github/ISSUE_TEMPLATE/feature_request.en.yml | 1 + .github/ISSUE_TEMPLATE/feature_request.zh.yml | 1 + 4 files changed, 10 insertions(+), 6 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/bug_report.en.yml b/.github/ISSUE_TEMPLATE/bug_report.en.yml index c61c0bd69f..d9655561ce 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.en.yml +++ b/.github/ISSUE_TEMPLATE/bug_report.en.yml @@ -30,15 +30,16 @@ body: - MariaDB - Other - type: dropdown - id: deployment-method + id: operation-method validations: required: true attributes: - label: "What is your deployment method?" + label: "What is the project operation method?" options: - Docker - Docker Compose - Fat Jar + - Source Code - type: input id: site-url attributes: @@ -55,7 +56,7 @@ body: id: what-happened attributes: label: "What happened?" - description: "Also tell us, what did you expect to happen?" + description: "For ease of management, please do not report multiple unrelated issues under the same issue." validations: required: true - type: textarea diff --git a/.github/ISSUE_TEMPLATE/bug_report.zh.yml b/.github/ISSUE_TEMPLATE/bug_report.zh.yml index a960a1c680..cc1b5f04fb 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.zh.yml +++ b/.github/ISSUE_TEMPLATE/bug_report.zh.yml @@ -31,15 +31,16 @@ body: - MariaDB - Other - type: dropdown - id: deployment-method + id: operation-method validations: required: true attributes: - label: "使用的哪种方式部署?" + label: "使用的哪种方式运行?" options: - Docker - Docker Compose - Fat Jar + - Source Code - type: input id: site-url attributes: @@ -56,7 +57,7 @@ body: id: what-happened attributes: label: "发生了什么?" - description: "最好还告诉我们,你预计会发生什么。" + description: "为了方便我们管理,请不要在同一个 issue 下报告多个不相关的问题。" validations: required: true - type: textarea diff --git a/.github/ISSUE_TEMPLATE/feature_request.en.yml b/.github/ISSUE_TEMPLATE/feature_request.en.yml index 132fb2a0a6..fa8d5d13ad 100644 --- a/.github/ISSUE_TEMPLATE/feature_request.en.yml +++ b/.github/ISSUE_TEMPLATE/feature_request.en.yml @@ -21,6 +21,7 @@ body: id: description attributes: label: "Describe this feature" + description: "For ease of management, please do not submit multiple unrelated features under the same issue." validations: required: true - type: textarea diff --git a/.github/ISSUE_TEMPLATE/feature_request.zh.yml b/.github/ISSUE_TEMPLATE/feature_request.zh.yml index f3ea93eeed..9926581125 100644 --- a/.github/ISSUE_TEMPLATE/feature_request.zh.yml +++ b/.github/ISSUE_TEMPLATE/feature_request.zh.yml @@ -21,6 +21,7 @@ body: id: description attributes: label: "描述一下此特性" + description: "为了方便我们管理,请不要在同一个 issue 下提交多个没有相关性的特性。" validations: required: true - type: textarea From d3e296d782366af9232f08ccc9951c4ad04995f2 Mon Sep 17 00:00:00 2001 From: Ryan Wang Date: Fri, 22 Sep 2023 15:42:24 +0800 Subject: [PATCH 03/10] chore: bump formkit version to 1.1.0 (#4642) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit #### What type of PR is this? /area console /kind improvement /milestone 2.10.x #### What this PR does / why we need it: 升级 FormKit 版本至 1.1.0 正式版。 see https://formkit.com/changelog #### Special notes for your reviewer: 测试 Console 的各个表单是否正常工作即可。 #### Does this PR introduce a user-facing change? ```release-note 升级 FormKit 版本至 1.1.0 正式版。 ``` --- console/package.json | 14 ++--- console/pnpm-lock.yaml | 120 ++++++++++++++++++++--------------------- 2 files changed, 67 insertions(+), 67 deletions(-) diff --git a/console/package.json b/console/package.json index ef3f951b39..99110c524e 100644 --- a/console/package.json +++ b/console/package.json @@ -44,13 +44,13 @@ "@codemirror/state": "^6.1.4", "@codemirror/view": "^6.5.1", "@emoji-mart/data": "^1.0.8", - "@formkit/core": "^0.18.1", - "@formkit/i18n": "^0.18.1", - "@formkit/inputs": "^0.18.1", - "@formkit/themes": "^0.18.1", - "@formkit/utils": "^0.18.1", - "@formkit/validation": "0.18.1", - "@formkit/vue": "^0.18.1", + "@formkit/core": "^1.1.0", + "@formkit/i18n": "^1.1.0", + "@formkit/inputs": "^1.1.0", + "@formkit/themes": "^1.1.0", + "@formkit/utils": "^1.1.0", + "@formkit/validation": "1.1.0", + "@formkit/vue": "^1.1.0", "@halo-dev/api-client": "workspace:*", "@halo-dev/components": "workspace:*", "@halo-dev/console-shared": "workspace:*", diff --git a/console/pnpm-lock.yaml b/console/pnpm-lock.yaml index a1218c4585..bb7404bf1a 100644 --- a/console/pnpm-lock.yaml +++ b/console/pnpm-lock.yaml @@ -39,26 +39,26 @@ importers: specifier: ^1.0.8 version: 1.0.8 '@formkit/core': - specifier: ^0.18.1 - version: 0.18.1 + specifier: ^1.1.0 + version: 1.1.0 '@formkit/i18n': - specifier: ^0.18.1 - version: 0.18.1 + specifier: ^1.1.0 + version: 1.1.0 '@formkit/inputs': - specifier: ^0.18.1 - version: 0.18.1 + specifier: ^1.1.0 + version: 1.1.0 '@formkit/themes': - specifier: ^0.18.1 - version: 0.18.1(tailwindcss@3.3.0) + specifier: ^1.1.0 + version: 1.1.0(tailwindcss@3.3.0) '@formkit/utils': - specifier: ^0.18.1 - version: 0.18.1 + specifier: ^1.1.0 + version: 1.1.0 '@formkit/validation': - specifier: 0.18.1 - version: 0.18.1 + specifier: 1.1.0 + version: 1.1.0 '@formkit/vue': - specifier: ^0.18.1 - version: 0.18.1(tailwindcss@3.3.0) + specifier: ^1.1.0 + version: 1.1.0(tailwindcss@3.3.0) '@halo-dev/api-client': specifier: workspace:* version: link:packages/api-client @@ -2313,51 +2313,51 @@ packages: resolution: {integrity: sha512-m0G6wlnhm/AX0H12IOWtK8gASEMffnX08RtKkCgTdHb9JpHKGloI7icFfLg9ZmQeavcvR0PKmzxClyuFPSjKWw==} dev: false - /@formkit/core@0.18.1: - resolution: {integrity: sha512-qoVpV5gF7k7WtVdJB85pT59AxzEVDefGna6q1zfODhoJ+VtrjhGnFtHUENRahLTB1fz5iknFDG8fCN/uG5wBMw==} + /@formkit/core@1.1.0: + resolution: {integrity: sha512-p3fbSVYI/93mndlIKU+Rc/ZqR9mzQ55B8HLvDAj53Aooo5GVDGeRYI78+rbB0Uy4nuu/Drivr8+x1+uiWTuOdw==} dependencies: - '@formkit/utils': 0.18.1 + '@formkit/utils': 1.1.0 dev: false - /@formkit/dev@0.18.1: - resolution: {integrity: sha512-iDwRKUvR4edlTikijn6NmNdBYEC+Iz7INGdvDflvckZAWYNaqm21T5Gf7aXLjqrzhr5kB2yijcCct+zojkkaAg==} + /@formkit/dev@1.1.0: + resolution: {integrity: sha512-9HOALk5mHEpw8YE2mYGQwL8dompKT02t8NijzIaNmh9+a7P4xcQoK2ty6dQFSt4MS21nNDun7R2eCF/TXtDo6g==} dependencies: - '@formkit/core': 0.18.1 - '@formkit/utils': 0.18.1 + '@formkit/core': 1.1.0 + '@formkit/utils': 1.1.0 dev: false - /@formkit/i18n@0.18.1: - resolution: {integrity: sha512-7TPLd+l3enVKwmCOK7r+5NBObvvFPtKvyxz31kvQenXEk9rPUzmj4VpMzxMBDhJ9B19LiH/Kwn5m20rwdu9z4w==} + /@formkit/i18n@1.1.0: + resolution: {integrity: sha512-CtljGO5Ee9JZStM42lIFilsbur2lZVJsVLnWZNqL6MDaBW4W4huTuMYaz1qOoNV2xXdiHHO88F6MQARzeY8yUw==} dependencies: - '@formkit/core': 0.18.1 - '@formkit/utils': 0.18.1 - '@formkit/validation': 0.18.1 + '@formkit/core': 1.1.0 + '@formkit/utils': 1.1.0 + '@formkit/validation': 1.1.0 dev: false - /@formkit/inputs@0.18.1: - resolution: {integrity: sha512-nTcidV7O16wHIz4Jy/YqRJf/gCSLijfC404rCIe9mTtvmvj3+wnpErYfjNnWUmIPTQEjdHSriv6zOl0MDcVARA==} + /@formkit/inputs@1.1.0: + resolution: {integrity: sha512-R55gIS0dATpL6q1mAN5egXU1hruPADWunwfR9Ff42p/iMLEoKg/UxeUP6Lm8rUiZmqa5b6DD3deo6l68afNDAQ==} dependencies: - '@formkit/core': 0.18.1 - '@formkit/utils': 0.18.1 + '@formkit/core': 1.1.0 + '@formkit/utils': 1.1.0 dev: false - /@formkit/observer@0.18.1: - resolution: {integrity: sha512-3AFfkg5+4DRICG10pW2nWEk0xOthi+MjUamfKan4317VSG3Hku4nTp2w4vAhfocoIWv4Y57DwLS3Q79BDyLY6w==} + /@formkit/observer@1.1.0: + resolution: {integrity: sha512-lOVwCXUw1PBDl6ZNBC1TeJYTUEPKhOHhAgUkH++tjjGOcALvZBGKFRhMblGPkoxHeGZaujSB+ADOpOQ6KX2i+w==} dependencies: - '@formkit/core': 0.18.1 - '@formkit/utils': 0.18.1 + '@formkit/core': 1.1.0 + '@formkit/utils': 1.1.0 dev: false - /@formkit/rules@0.18.1: - resolution: {integrity: sha512-DVL8tU0y2yhvu73BKHNjQgSkZlutXTcJlDtWq7FKh8Omooi6qFmHpl0ihk8Lk0NaU7ulXK54lZEn7P61c2vJpQ==} + /@formkit/rules@1.1.0: + resolution: {integrity: sha512-EZYmwRF8pAa7BRhKptCW10RgJU5O57JA6F0RDCcrEIAuzQVa/Ha3fnG2O+CX4ZPehM7H5U1vZkMOtI0sWxsVCw==} dependencies: - '@formkit/core': 0.18.1 - '@formkit/utils': 0.18.1 - '@formkit/validation': 0.18.1 + '@formkit/core': 1.1.0 + '@formkit/utils': 1.1.0 + '@formkit/validation': 1.1.0 dev: false - /@formkit/themes@0.18.1(tailwindcss@3.3.0): - resolution: {integrity: sha512-K7Q2z0f4TUXPgLuqamrTxXE32EO6g0In4rznG60cafbZj+JkhtsA+b0qzvRLq5Fu0FZrczqwgAX+loWpVid3bw==} + /@formkit/themes@1.1.0(tailwindcss@3.3.0): + resolution: {integrity: sha512-ZpJhXh1q7kc3MCJqkQBap/bmsMU312G/TbOlfk3sLpZJmGXdLa6RwP3S9Z4VdUcS9HDwzJj+YGTPDEfR4sTwsA==} peerDependencies: tailwindcss: ^3.2.0 unocss: ^0.31.0 @@ -2370,34 +2370,34 @@ packages: windicss: optional: true dependencies: - '@formkit/core': 0.18.1 + '@formkit/core': 1.1.0 tailwindcss: 3.3.0(postcss@8.4.21) dev: false - /@formkit/utils@0.18.1: - resolution: {integrity: sha512-a4Ls7evdXxB3vYVOmtYBsA7lEKvKDqYrpfNpcTu0tqMN1Zb8ThMt7sB/zD673m9MdVO/p6nOb59UfDKGbaqGkw==} + /@formkit/utils@1.1.0: + resolution: {integrity: sha512-pxYqS+50yGj2NuUZtuayRP8CFKslzd+fbM/PaS5I3UmhQ8oJcj651KNLN2k5XGXSLYIll+VlaCCr4ny0HOd2Mw==} dev: false - /@formkit/validation@0.18.1: - resolution: {integrity: sha512-nVOO0rbQ+j+0nmOxR3SUlHq8bGSzkx2SQgYdkG7ad6gXjWxTAvoddqepyvnSl5q8ZX0oK2ldZH1cMMlObFi2eQ==} + /@formkit/validation@1.1.0: + resolution: {integrity: sha512-09HajJ0sONNuUmkomugrqpMnEcPWT2mWB+UeDTZOa70/YI36QGOGrC5l5lLwqNygYqbwQG1r8XporafDnAJU+g==} dependencies: - '@formkit/core': 0.18.1 - '@formkit/observer': 0.18.1 - '@formkit/utils': 0.18.1 + '@formkit/core': 1.1.0 + '@formkit/observer': 1.1.0 + '@formkit/utils': 1.1.0 dev: false - /@formkit/vue@0.18.1(tailwindcss@3.3.0): - resolution: {integrity: sha512-XV44zm+cwQJA0UqRYhyUMEcH2HNT6IamUio364K7FJdrwxYnKXlGl5Tld1B90DlvIlWZgVdLCAA/26vn1yAwkQ==} + /@formkit/vue@1.1.0(tailwindcss@3.3.0): + resolution: {integrity: sha512-hFlTiIpqmXG1k2jhJvM4zRhHSHdKPGlXN+bLlGEig5s/jLCeX3RvjCbRsydmvGddBvx6PXH9IxycAQMPRBaJvg==} dependencies: - '@formkit/core': 0.18.1 - '@formkit/dev': 0.18.1 - '@formkit/i18n': 0.18.1 - '@formkit/inputs': 0.18.1 - '@formkit/observer': 0.18.1 - '@formkit/rules': 0.18.1 - '@formkit/themes': 0.18.1(tailwindcss@3.3.0) - '@formkit/utils': 0.18.1 - '@formkit/validation': 0.18.1 + '@formkit/core': 1.1.0 + '@formkit/dev': 1.1.0 + '@formkit/i18n': 1.1.0 + '@formkit/inputs': 1.1.0 + '@formkit/observer': 1.1.0 + '@formkit/rules': 1.1.0 + '@formkit/themes': 1.1.0(tailwindcss@3.3.0) + '@formkit/utils': 1.1.0 + '@formkit/validation': 1.1.0 vue: 3.3.4 transitivePeerDependencies: - tailwindcss From f953201307b9be457d190858c76e7eff4d8bd078 Mon Sep 17 00:00:00 2001 From: Ryan Wang Date: Fri, 22 Sep 2023 16:11:53 +0800 Subject: [PATCH 04/10] fix: missing ui permission condition about users (#4619) Signed-off-by: Ryan Wang --- .../components/permission/HasPermission.vue | 16 ++++++++ .../contents/_components/ContributorList.vue | 39 +++++++++++++++++++ .../contents/attachments/AttachmentList.vue | 15 +++++-- .../modules/contents/comments/CommentList.vue | 10 +++-- .../contents/pages/DeletedSinglePageList.vue | 23 +---------- .../modules/contents/pages/SinglePageList.vue | 10 +++-- .../pages/components/SinglePageListItem.vue | 20 +--------- .../contents/posts/DeletedPostList.vue | 22 +---------- .../src/modules/contents/posts/PostList.vue | 10 +++-- .../entity-fields/ContributorsField.vue | 21 ++-------- console/src/setup/setupComponents.ts | 2 + 11 files changed, 95 insertions(+), 93 deletions(-) create mode 100644 console/src/components/permission/HasPermission.vue create mode 100644 console/src/modules/contents/_components/ContributorList.vue diff --git a/console/src/components/permission/HasPermission.vue b/console/src/components/permission/HasPermission.vue new file mode 100644 index 0000000000..ee871618be --- /dev/null +++ b/console/src/components/permission/HasPermission.vue @@ -0,0 +1,16 @@ + + + diff --git a/console/src/modules/contents/_components/ContributorList.vue b/console/src/modules/contents/_components/ContributorList.vue new file mode 100644 index 0000000000..67dd027691 --- /dev/null +++ b/console/src/modules/contents/_components/ContributorList.vue @@ -0,0 +1,39 @@ + + + diff --git a/console/src/modules/contents/attachments/AttachmentList.vue b/console/src/modules/contents/attachments/AttachmentList.vue index 0295226d8d..47f2a5f00a 100644 --- a/console/src/modules/contents/attachments/AttachmentList.vue +++ b/console/src/modules/contents/attachments/AttachmentList.vue @@ -356,10 +356,12 @@ onMounted(() => { }) || []), ]" /> - + + + { }, }" class="text-xs text-gray-500" + :class="{ + 'pointer-events-none': !currentUserHasPermission([ + 'system:users:view', + ]), + }" > {{ attachment.spec.ownerName }} diff --git a/console/src/modules/contents/comments/CommentList.vue b/console/src/modules/contents/comments/CommentList.vue index 37797c0426..80a2301108 100644 --- a/console/src/modules/contents/comments/CommentList.vue +++ b/console/src/modules/contents/comments/CommentList.vue @@ -283,10 +283,12 @@ const handleApproveInBatch = async () => { }, ]" /> - + + + diff --git a/console/src/modules/contents/pages/SinglePageList.vue b/console/src/modules/contents/pages/SinglePageList.vue index 2566f77f0d..80be4af5ec 100644 --- a/console/src/modules/contents/pages/SinglePageList.vue +++ b/console/src/modules/contents/pages/SinglePageList.vue @@ -379,10 +379,12 @@ watch(selectedPageNames, (newValue) => { }, ]" /> - + + + {