Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: create a configmap based on the setting definition when installing a theme #2440

Merged
merged 2 commits into from
Sep 22, 2022

Conversation

guqing
Copy link
Member

@guqing guqing commented Sep 21, 2022

What type of PR is this?

/kind improvement
/area core
/milestone 2.0

What this PR does / why we need it:

  • 安装主题后通过读取主题 Setting 模型中的默认值初始化一个 ConfigMap
  • 修改了 Setting 模型的 spec 结构(多了一层 forms 嵌套),配置示例如下:
apiVersion: v1alpha1
kind: Setting
metadata:
  name: theme-anatole-setting
spec:
  forms:
    - group: basic
      label: 基本设置
      formSchema:
        - $formkit: select
          name: sidebar_width
          label: 侧边栏宽度
          options:
            "20%": 20%
            "30%": 30%
            "40%": 40%
            "50%": 50%
          value: "40%"

Which issue(s) this PR fixes:

Fixes #2414

Special notes for your reviewer:

/cc @halo-dev/sig-halo

Does this PR introduce a user-facing change?

None

@f2c-ci-robot f2c-ci-robot bot added release-note-none Denotes a PR that doesn't merit a release note. kind/improvement Categorizes issue or PR as related to a improvement. labels Sep 21, 2022
@f2c-ci-robot f2c-ci-robot bot added this to the 2.0 milestone Sep 21, 2022
@f2c-ci-robot f2c-ci-robot bot added the area/core Issues or PRs related to the Halo Core label Sep 21, 2022
@ruibaby
Copy link
Member

ruibaby commented Sep 21, 2022

需要注意,这个 PR 合并的同时。涉及到的主题和插件都需要修改 settings.yaml。

Copy link
Member

@ruibaby ruibaby left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm

/cc @halo-dev/sig-halo

@f2c-ci-robot f2c-ci-robot bot added the lgtm Indicates that a PR is ready to be merged. label Sep 21, 2022
@ruibaby
Copy link
Member

ruibaby commented Sep 21, 2022

/retitle feat: create a configmap based on the setting definition when installing a theme

@f2c-ci-robot f2c-ci-robot bot changed the title feat: Parse the default value from the theme setting and store it into configMap feat: create a configmap based on the setting definition when installing a theme Sep 21, 2022
Copy link
Member

@JohnNiang JohnNiang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/approve

@f2c-ci-robot
Copy link

f2c-ci-robot bot commented Sep 22, 2022

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: JohnNiang

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@f2c-ci-robot f2c-ci-robot bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Sep 22, 2022
@f2c-ci-robot f2c-ci-robot bot merged commit 95b7a27 into halo-dev:next Sep 22, 2022
f2c-ci-robot bot pushed a commit to halo-dev/console that referenced this pull request Sep 22, 2022
#### What type of PR is this?

/kind improvement
/milestone 2.0
/kind api-change

#### What this PR does / why we need it:

重构 Setting 模型的结构,适配 halo-dev/halo#2440

todo list:

- [x] 更新 `@halo-dev/api-client`

#### Which issue(s) this PR fixes:

Fixes halo-dev/halo#2414

#### Special notes for your reviewer:

测试方式:

1. 本地 admin 仓库切换到当前 PR 的分支,halo 仓库切换到 halo-dev/halo#2440 PR 的分支。
2. 测试后台各个表单功能是否正常。
3. 主题设置表单可使用 halo-sigs/theme-anatole#2 PR 的分支进行测试。

#### Does this PR introduce a user-facing change?

```release-note
None
```
@guqing guqing deleted the feature/2414 branch September 22, 2022 08:26
JohnNiang pushed a commit to JohnNiang/halo that referenced this pull request Mar 2, 2023
#### What type of PR is this?

/kind improvement
/milestone 2.0
/kind api-change

#### What this PR does / why we need it:

重构 Setting 模型的结构,适配 halo-dev#2440

todo list:

- [x] 更新 `@halo-dev/api-client`

#### Which issue(s) this PR fixes:

Fixes halo-dev#2414

#### Special notes for your reviewer:

测试方式:

1. 本地 admin 仓库切换到当前 PR 的分支,halo 仓库切换到 halo-dev#2440 PR 的分支。
2. 测试后台各个表单功能是否正常。
3. 主题设置表单可使用 halo-sigs/theme-anatole#2 PR 的分支进行测试。

#### Does this PR introduce a user-facing change?

```release-note
None
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. area/core Issues or PRs related to the Halo Core kind/improvement Categorizes issue or PR as related to a improvement. lgtm Indicates that a PR is ready to be merged. release-note-none Denotes a PR that doesn't merit a release note.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants