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

fix: config editor cleanup - update schemas #1377

Merged
merged 5 commits into from
Jan 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ export const buildUiSchema = (
scope: "/properties/allowUnitFormatting",
options: {
section: "subblock",
scale: "m",
toggleDisplay: "switch",
scope: "/properties/unit",
},
Expand Down Expand Up @@ -94,6 +95,7 @@ export const buildUiSchema = (
labelKey: `advancedConfig.label`,
options: {
section: "subblock",
scale: "m",
},
rule: SHOW_FOR_DYNAMIC_RULE,
elements: [
Expand Down Expand Up @@ -163,6 +165,7 @@ export const buildUiSchema = (
scope: "/properties/allowLink",
options: {
section: "subblock",
scale: "m",
toggleDisplay: "switch",
},
rule: SHOW_FOR_STATIC_RULE,
Expand Down
4 changes: 2 additions & 2 deletions packages/common/src/core/schemas/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,18 +65,18 @@ export enum UiSchemaRuleEffects {
}

export enum UiSchemaElementTypes {
accordionItem = "AccordionItem",
section = "Section",
step = "Step",
control = "Control",
layout = "Layout",
slot = "Slot",
}

export enum UiSchemaSectionTypes {
accordion = "accordion",
accordionItem = "accordionItem",
block = "block",
stepper = "stepper",
step = "step",
subblock = "subblock",
card = "card",
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,11 @@ export const buildUiSchema = async (
options: { section: "stepper", scale: "l" },
elements: [
{
type: "Step",
type: "Section",
labelKey: `${i18nScope}.sections.details.label`,
options: {
section: "step",
},
elements: [
{
labelKey: `${i18nScope}.fields.name.label`,
Expand Down Expand Up @@ -66,8 +69,11 @@ export const buildUiSchema = async (
],
},
{
type: "Step",
type: "Section",
labelKey: `${i18nScope}.sections.membershipAccess.label`,
options: {
section: "step",
},
rule: {
effect: UiSchemaRuleEffects.DISABLE,
condition: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,11 @@ export const buildUiSchema = async (
options: { section: "stepper", scale: "l" },
elements: [
{
type: "Step",
type: "Section",
labelKey: `${i18nScope}.sections.details.label`,
options: {
section: "step",
},
elements: [
{
type: "Section",
Expand Down Expand Up @@ -101,8 +104,11 @@ export const buildUiSchema = async (
],
},
{
type: "Step",
type: "Section",
labelKey: `${i18nScope}.sections.hero.label`,
options: {
section: "step",
},
rule: {
effect: UiSchemaRuleEffects.DISABLE,
condition: {
Expand Down Expand Up @@ -190,8 +196,11 @@ export const buildUiSchema = async (
],
},
{
type: "Step",
type: "Section",
labelKey: `${i18nScope}.sections.sharing.label`,
options: {
section: "step",
},
rule: {
effect: UiSchemaRuleEffects.DISABLE,
condition: {
Expand Down
15 changes: 12 additions & 3 deletions packages/common/src/projects/_internal/ProjectUiSchemaCreate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,11 @@ export const buildUiSchema = async (
options: { section: "stepper", scale: "l" },
elements: [
{
type: "Step",
type: "Section",
labelKey: `${i18nScope}.sections.details.label`,
options: {
section: "step",
},
elements: [
{
type: "Section",
Expand Down Expand Up @@ -90,8 +93,11 @@ export const buildUiSchema = async (
],
},
{
type: "Step",
type: "Section",
labelKey: `${i18nScope}.sections.location.label`,
options: {
section: "step",
},
rule: {
effect: UiSchemaRuleEffects.DISABLE,
condition: {
Expand Down Expand Up @@ -132,8 +138,11 @@ export const buildUiSchema = async (
],
},
{
type: "Step",
type: "Section",
labelKey: `${i18nScope}.sections.sharing.label`,
options: {
section: "step",
},
rule: {
effect: UiSchemaRuleEffects.DISABLE,
condition: {
Expand Down
15 changes: 12 additions & 3 deletions packages/common/src/sites/_internal/SiteUiSchemaCreate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,11 @@ export const buildUiSchema = async (
options: { section: "stepper", scale: "l" },
elements: [
{
type: "Step",
type: "Section",
labelKey: `${i18nScope}.sections.details.label`,
options: {
section: "step",
},
elements: [
{
type: "Section",
Expand Down Expand Up @@ -82,8 +85,11 @@ export const buildUiSchema = async (
],
},
{
type: "Step",
type: "Section",
labelKey: `${i18nScope}.sections.location.label`,
options: {
section: "step",
},
rule: {
effect: UiSchemaRuleEffects.DISABLE,
condition: {
Expand Down Expand Up @@ -124,8 +130,11 @@ export const buildUiSchema = async (
],
},
{
type: "Step",
type: "Section",
labelKey: `${i18nScope}.sections.sharing.label`,
options: {
section: "step",
},
rule: {
effect: UiSchemaRuleEffects.DISABLE,
condition: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,7 @@ describe("filterSchemaToUiSchema util:", () => {
type: "Section",
labelKey: "section1.label.key",
options: {
section: "stepper",
open: true,
section: "stepper"
},
juliannemarik marked this conversation as resolved.
Show resolved Hide resolved
elements: [
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -129,8 +129,11 @@ const SteppedUiSchema: IUiSchema = {
},
elements: [
{
type: "Step",
type: "Section",
labelKey: "step1.label.key",
options: {
section: "step",
},
elements: [
{
labelKey: "property1.label.key",
Expand All @@ -145,8 +148,11 @@ const SteppedUiSchema: IUiSchema = {
],
},
{
type: "Step",
type: "Section",
labelKey: "step2.label.key",
options: {
section: "step",
},
elements: [
{
labelKey: "property3.label.key",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ describe("buildUiSchema: stat", () => {
scope: "/properties/allowUnitFormatting",
options: {
section: "subblock",
scale: "m",
toggleDisplay: "switch",
scope: "/properties/unit",
},
Expand Down Expand Up @@ -115,6 +116,7 @@ describe("buildUiSchema: stat", () => {
labelKey: `advancedConfig.label`,
options: {
section: "subblock",
scale: "m",
},
rule: {
condition: {
Expand Down Expand Up @@ -196,6 +198,7 @@ describe("buildUiSchema: stat", () => {
scope: "/properties/allowLink",
options: {
section: "subblock",
scale: "m",
toggleDisplay: "switch",
},
rule: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,11 @@ const SteppedUiSchema: IUiSchema = {
},
elements: [
{
type: "Step",
type: "Section",
labelKey: "step1.label.key",
options: {
section: "step",
},
elements: [
{
labelKey: "property1.label.key",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,11 @@ describe("buildUiSchema: create followers group", () => {
options: { section: "stepper", scale: "l" },
elements: [
{
type: "Step",
type: "Section",
labelKey: "some.scope.sections.details.label",
options: {
section: "step",
},
elements: [
{
labelKey: "some.scope.fields.name.label",
Expand Down Expand Up @@ -62,8 +65,11 @@ describe("buildUiSchema: create followers group", () => {
],
},
{
type: "Step",
type: "Section",
labelKey: "some.scope.sections.membershipAccess.label",
options: {
section: "step",
},
rule: {
effect: UiSchemaRuleEffects.DISABLE,
condition: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,11 @@ describe("buildUiSchema: initiative create", () => {
options: { section: "stepper", scale: "l" },
elements: [
{
type: "Step",
type: "Section",
labelKey: "some.scope.sections.details.label",
options: {
section: "step",
},
elements: [
{
type: "Section",
Expand Down Expand Up @@ -108,8 +111,11 @@ describe("buildUiSchema: initiative create", () => {
],
},
{
type: "Step",
type: "Section",
labelKey: "some.scope.sections.hero.label",
options: {
section: "step",
},
rule: {
effect: UiSchemaRuleEffects.DISABLE,
condition: {
Expand Down Expand Up @@ -187,8 +193,11 @@ describe("buildUiSchema: initiative create", () => {
],
},
{
type: "Step",
type: "Section",
labelKey: "some.scope.sections.sharing.label",
options: {
section: "step",
},
rule: {
effect: UiSchemaRuleEffects.DISABLE,
condition: {
Expand Down Expand Up @@ -258,8 +267,11 @@ describe("buildUiSchema: initiative create", () => {
options: { section: "stepper", scale: "l" },
elements: [
{
type: "Step",
type: "Section",
labelKey: "some.scope.sections.details.label",
options: {
section: "step",
},
elements: [
{
type: "Section",
Expand Down Expand Up @@ -333,8 +345,11 @@ describe("buildUiSchema: initiative create", () => {
],
},
{
type: "Step",
type: "Section",
labelKey: "some.scope.sections.hero.label",
options: {
section: "step",
},
rule: {
effect: UiSchemaRuleEffects.DISABLE,
condition: {
Expand Down Expand Up @@ -412,8 +427,11 @@ describe("buildUiSchema: initiative create", () => {
],
},
{
type: "Step",
type: "Section",
labelKey: "some.scope.sections.sharing.label",
options: {
section: "step",
},
rule: {
effect: UiSchemaRuleEffects.DISABLE,
condition: {
Expand Down
Loading