-
-
Notifications
You must be signed in to change notification settings - Fork 9.8k
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
关于主题配置项默认值问题 #2414
Comments
FormKit 中定义的默认值和系统(default ConfigMap)提供的默认配置是两种不同维度的默认值。一个是面向表单,一个是面向系统。各自有各自的默认值即可。当然系统提供的默认值优先级更高。 |
主题刚安装的时候 formkit中定义的默认值是没有同步到 ConfigMap 的,而 ConfigMap 也没有关于此主题的默认值 |
#### 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 ```
…ing a theme (#2440) #### 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 嵌套),配置示例如下: ```yaml 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? ```release-note None ```
@ruibaby: Closing this issue. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
#### 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 ```
Your current Halo version
2.0.0
Describe this feature
目前主题安装后基本都有 settings.yaml 并且其中配置了设置的默认值
如上所示,group=basic的 item 的 formSchema 是表单 schema,如果有默认值会在其中又一个
value
属性,例如40%
但是主题首次安装需要在主题设置点击保存才能将默认值同步到 ConfigMap 中。
这显得很繁琐,而且不开箱即用,需要对此进行优化:
实现方式:
formSchema[index].value
即为默认值根据@halo-dev/sig-halo 你们怎么看
Additional information
/kind improvement
/area core
/milestone 2.0
The text was updated successfully, but these errors were encountered: