Skip to content

Commit

Permalink
fix: 10795 10736 project and initiative creation rules updates (#1562)
Browse files Browse the repository at this point in the history
  • Loading branch information
vivzhang committed Jun 28, 2024
1 parent 2f7a787 commit 409edc5
Show file tree
Hide file tree
Showing 4 changed files with 266 additions and 62 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -109,13 +109,33 @@ export const buildUiSchema = async (
options: {
section: "step",
},
rule: {
effect: UiSchemaRuleEffects.DISABLE,
condition: {
scope: "/properties/name",
schema: { const: "" },
rules: [
{
effect: UiSchemaRuleEffects.DISABLE,
conditions: [
{
scope: "/properties/name",
schema: { const: "" },
},
],
},
},
{
effect: UiSchemaRuleEffects.DISABLE,
conditions: [
{
scope: "/properties/name",
schema: { minLength: 251 },
},
],
},
{
effect: UiSchemaRuleEffects.DISABLE,
condition: {
scope: "/properties/summary",
schema: { minLength: 2049 },
},
},
],
elements: [
{
type: "Section",
Expand Down Expand Up @@ -206,13 +226,33 @@ export const buildUiSchema = async (
options: {
section: "step",
},
rule: {
effect: UiSchemaRuleEffects.DISABLE,
condition: {
scope: "/properties/name",
schema: { const: "" },
rules: [
{
effect: UiSchemaRuleEffects.DISABLE,
conditions: [
{
scope: "/properties/name",
schema: { const: "" },
},
],
},
},
{
effect: UiSchemaRuleEffects.DISABLE,
conditions: [
{
scope: "/properties/name",
schema: { minLength: 251 },
},
],
},
{
effect: UiSchemaRuleEffects.DISABLE,
condition: {
scope: "/properties/summary",
schema: { minLength: 2049 },
},
},
],
elements: [
{
scope: "/properties/access",
Expand Down
64 changes: 52 additions & 12 deletions packages/common/src/projects/_internal/ProjectUiSchemaCreate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -98,13 +98,33 @@ export const buildUiSchema = async (
options: {
section: "step",
},
rule: {
effect: UiSchemaRuleEffects.DISABLE,
condition: {
scope: "/properties/name",
schema: { const: "" },
rules: [
{
effect: UiSchemaRuleEffects.DISABLE,
conditions: [
{
scope: "/properties/name",
schema: { const: "" },
},
],
},
},
{
effect: UiSchemaRuleEffects.DISABLE,
conditions: [
{
scope: "/properties/name",
schema: { minLength: 251 },
},
],
},
{
effect: UiSchemaRuleEffects.DISABLE,
condition: {
scope: "/properties/summary",
schema: { minLength: 2049 },
},
},
],
elements: [
{
type: "Section",
Expand Down Expand Up @@ -143,13 +163,33 @@ export const buildUiSchema = async (
options: {
section: "step",
},
rule: {
effect: UiSchemaRuleEffects.DISABLE,
condition: {
scope: "/properties/name",
schema: { const: "" },
rules: [
{
effect: UiSchemaRuleEffects.DISABLE,
conditions: [
{
scope: "/properties/name",
schema: { const: "" },
},
],
},
},
{
effect: UiSchemaRuleEffects.DISABLE,
conditions: [
{
scope: "/properties/name",
schema: { minLength: 251 },
},
],
},
{
effect: UiSchemaRuleEffects.DISABLE,
condition: {
scope: "/properties/summary",
schema: { minLength: 2049 },
},
},
],
elements: [
{
scope: "/properties/access",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,13 +116,33 @@ describe("buildUiSchema: initiative create", () => {
options: {
section: "step",
},
rule: {
effect: UiSchemaRuleEffects.DISABLE,
condition: {
scope: "/properties/name",
schema: { const: "" },
rules: [
{
effect: UiSchemaRuleEffects.DISABLE,
conditions: [
{
scope: "/properties/name",
schema: { const: "" },
},
],
},
},
{
effect: UiSchemaRuleEffects.DISABLE,
conditions: [
{
scope: "/properties/name",
schema: { minLength: 251 },
},
],
},
{
effect: UiSchemaRuleEffects.DISABLE,
condition: {
scope: "/properties/summary",
schema: { minLength: 2049 },
},
},
],
elements: [
{
type: "Section",
Expand All @@ -131,7 +151,9 @@ describe("buildUiSchema: initiative create", () => {
effect: UiSchemaRuleEffects.HIDE,
condition: {
scope: "/properties/view/properties/hero",
schema: { const: "image" },
schema: {
const: "image",
},
},
},
options: {
Expand Down Expand Up @@ -203,13 +225,33 @@ describe("buildUiSchema: initiative create", () => {
options: {
section: "step",
},
rule: {
effect: UiSchemaRuleEffects.DISABLE,
condition: {
scope: "/properties/name",
schema: { const: "" },
rules: [
{
effect: UiSchemaRuleEffects.DISABLE,
conditions: [
{
scope: "/properties/name",
schema: { const: "" },
},
],
},
},
{
effect: UiSchemaRuleEffects.DISABLE,
conditions: [
{
scope: "/properties/name",
schema: { minLength: 251 },
},
],
},
{
effect: UiSchemaRuleEffects.DISABLE,
condition: {
scope: "/properties/summary",
schema: { minLength: 2049 },
},
},
],
elements: [
{
scope: "/properties/access",
Expand Down Expand Up @@ -355,13 +397,33 @@ describe("buildUiSchema: initiative create", () => {
options: {
section: "step",
},
rule: {
effect: UiSchemaRuleEffects.DISABLE,
condition: {
scope: "/properties/name",
schema: { const: "" },
rules: [
{
effect: UiSchemaRuleEffects.DISABLE,
conditions: [
{
scope: "/properties/name",
schema: { const: "" },
},
],
},
},
{
effect: UiSchemaRuleEffects.DISABLE,
conditions: [
{
scope: "/properties/name",
schema: { minLength: 251 },
},
],
},
{
effect: UiSchemaRuleEffects.DISABLE,
condition: {
scope: "/properties/summary",
schema: { minLength: 2049 },
},
},
],
elements: [
{
type: "Section",
Expand All @@ -370,7 +432,9 @@ describe("buildUiSchema: initiative create", () => {
effect: UiSchemaRuleEffects.HIDE,
condition: {
scope: "/properties/view/properties/hero",
schema: { const: "image" },
schema: {
const: "image",
},
},
},
options: {
Expand Down Expand Up @@ -442,13 +506,33 @@ describe("buildUiSchema: initiative create", () => {
options: {
section: "step",
},
rule: {
effect: UiSchemaRuleEffects.DISABLE,
condition: {
scope: "/properties/name",
schema: { const: "" },
rules: [
{
effect: UiSchemaRuleEffects.DISABLE,
conditions: [
{
scope: "/properties/name",
schema: { const: "" },
},
],
},
},
{
effect: UiSchemaRuleEffects.DISABLE,
conditions: [
{
scope: "/properties/name",
schema: { minLength: 251 },
},
],
},
{
effect: UiSchemaRuleEffects.DISABLE,
condition: {
scope: "/properties/summary",
schema: { minLength: 2049 },
},
},
],
elements: [
{
scope: "/properties/access",
Expand Down
Loading

0 comments on commit 409edc5

Please sign in to comment.