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: add reset config API for theme and plugin #2964

Merged
merged 6 commits into from
Dec 19, 2022

Conversation

guqing
Copy link
Member

@guqing guqing commented Dec 15, 2022

What type of PR is this?

/kind feature
/kind api-change
/area core

What this PR does / why we need it:

为主题和插件提供重置设置项 API

此 PR 会重新读取配置对应的 Setting 资源,从其中读取默认值后更新到现有的 ConfigMap 中替换其 data
see #2789 for more details

Which issue(s) this PR fixes:

Fixes #2789

Special notes for your reviewer:

how to test it?

  1. 在主题设置或插件设置配置一些设置项后保存
  2. 执行重置配置
  3. 配置恢复为了 Setting 中指定的默认值

/cc @halo-dev/sig-halo

Does this PR introduce a user-facing change?

为主题和插件提供重置设置项 API

@f2c-ci-robot f2c-ci-robot bot added release-note Denotes a PR that will be considered when it comes time to generate release notes. kind/feature Categorizes issue or PR as related to a new feature. kind/api-change Categorizes issue or PR as related to adding, removing, or otherwise changing an API area/core Issues or PRs related to the Halo Core labels Dec 15, 2022
@ruibaby
Copy link
Member

ruibaby commented Dec 15, 2022

@guqing 建议在 PR 描述中也简单描述一下重置 ConfigMap 的流程。

@ruibaby
Copy link
Member

ruibaby commented Dec 15, 2022

@guqing

生成 api-client 时,出现了重命名的问题:

image

@guqing
Copy link
Member Author

guqing commented Dec 16, 2022

@guqing

生成 api-client 时,出现了重命名的问题:

重新生成一下,我改了个名

@guqing
Copy link
Member Author

guqing commented Dec 16, 2022

@guqing 建议在 PR 描述中也简单描述一下重置 ConfigMap 的流程。

Done

@ruibaby
Copy link
Member

ruibaby commented Dec 16, 2022

@guqing
生成 api-client 时,出现了重命名的问题:

重新生成一下,我改了个名

Okay

@ruibaby ruibaby changed the title feat: add reset config API for theme feat: add reset config API for theme and plugin Dec 16, 2022
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.

/approve

@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 Dec 16, 2022
@guqing guqing requested a review from JohnNiang December 19, 2022 02:21
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.

/lgtm

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

f2c-ci-robot bot commented Dec 19, 2022

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: JohnNiang, ruibaby

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 merged commit 27775c9 into halo-dev:main Dec 19, 2022
@guqing guqing deleted the feature/2789 branch December 19, 2022 02:28
f2c-ci-robot bot pushed a commit to halo-dev/console that referenced this pull request Dec 19, 2022
#### What type of PR is this?

/kind feature

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

支持重置主题和插件的设置选项。适配 halo-dev/halo#2964

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

Fixes halo-dev/halo#2789

#### Screenshots:

<img width="366" alt="image" src="https://user-images.githubusercontent.com/21301288/208022668-288fb8c5-ddd1-456c-9633-ec8865f3b1ba.png">

#### Special notes for your reviewer:

测试方式:

1. 安装若干带有设置选项主题和插件。
2. 进入主题和插件设置,改变部分设置并保存。
3. 重置主题和插件的设置,然后进入设置表单,检查是否已经恢复为了默认。

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

```release-note
支持重置主题和插件的设置选项。
```
JohnNiang pushed a commit to JohnNiang/halo that referenced this pull request Mar 2, 2023
…ev/console#777)

#### What type of PR is this?

/kind feature

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

支持重置主题和插件的设置选项。适配 halo-dev#2964

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

Fixes halo-dev#2789

#### Screenshots:

<img width="366" alt="image" src="https://user-images.githubusercontent.com/21301288/208022668-288fb8c5-ddd1-456c-9633-ec8865f3b1ba.png">

#### Special notes for your reviewer:

测试方式:

1. 安装若干带有设置选项主题和插件。
2. 进入主题和插件设置,改变部分设置并保存。
3. 重置主题和插件的设置,然后进入设置表单,检查是否已经恢复为了默认。

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

```release-note
支持重置主题和插件的设置选项。
```
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/api-change Categorizes issue or PR as related to adding, removing, or otherwise changing an API kind/feature Categorizes issue or PR as related to a new feature. lgtm Indicates that a PR is ready to be merged. release-note Denotes a PR that will be considered when it comes time to generate release notes.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

为主题和插件提供重置设置项(ConfigMap)的功能。
3 participants