From 656843e04e5667ae03350f8dbd1a0b444990fb2f Mon Sep 17 00:00:00 2001 From: Erling Hauan Date: Thu, 3 Oct 2024 14:59:05 +0200 Subject: [PATCH 1/7] Refactor script and check if enum content is number --- .../scripts/componentSchemas/fileUtils.ts | 17 ++ .../scripts/componentSchemas/languageUtils.ts | 47 +++++- frontend/scripts/componentSchemas/run.ts | 107 ++---------- .../scripts/componentSchemas/schemaUtils.ts | 157 ++++++++++++++---- frontend/scripts/componentSchemas/version.ts | 5 +- 5 files changed, 198 insertions(+), 135 deletions(-) create mode 100644 frontend/scripts/componentSchemas/fileUtils.ts diff --git a/frontend/scripts/componentSchemas/fileUtils.ts b/frontend/scripts/componentSchemas/fileUtils.ts new file mode 100644 index 00000000000..ac70f8e2e26 --- /dev/null +++ b/frontend/scripts/componentSchemas/fileUtils.ts @@ -0,0 +1,17 @@ +import type { AppFrontendVersion } from './version'; +import { versionSettings } from './version'; +import path from 'path'; +import fs from 'fs'; + +export const writeToFile = (name: string, data: any, version: AppFrontendVersion) => { + const dirPath = path.resolve(__dirname, versionSettings[version].componentSchemaPath); + const fileName = `${dirPath}/${name}.schema.v1.json`; + + fs.writeFile(fileName, JSON.stringify(data), (err: any) => { + if (err) { + console.log(err); + return; + } + console.log(`Wrote ${fileName}`); + }); +}; diff --git a/frontend/scripts/componentSchemas/languageUtils.ts b/frontend/scripts/componentSchemas/languageUtils.ts index a137777ac1d..d70d978559b 100644 --- a/frontend/scripts/componentSchemas/languageUtils.ts +++ b/frontend/scripts/componentSchemas/languageUtils.ts @@ -1,7 +1,43 @@ import nb from '../../language/src/nb.json'; -// Logs language keys and values related to the "Tekst" accordion in the component configuration. -// Use it to find missing entries in the language file(s). +export const allTextResourceBindingKeys = []; + +/** + * Adds text resource binding keys from a schema to the global list. + * @param schema The schema to extract keys from. + */ +export const addTextResourceBindingKeys = (schema: any) => { + if (schema.properties?.textResourceBindings) { + const textResourceBindingKeys = Object.keys(schema.properties.textResourceBindings.properties); + allTextResourceBindingKeys.push(...textResourceBindingKeys); + } +}; + +/** + * Sorts text resource bindings, placing 'title', 'description', and 'help' first. + * @param textResourceBindings The text resource bindings to sort. + * @returns The sorted text resource bindings. + */ +export const sortTextResourceBindings = (textResourceBindings: any) => { + const { title, description, help, ...rest } = textResourceBindings; + const sorted: any = {}; + if (title) { + sorted.title = title; + } + if (description) { + sorted.description = description; + } + if (help) { + sorted.help = help; + } + return { ...sorted, ...rest }; +}; + +/** + * Logs language keys and values displayed in the "Tekst" accordion in the component configuration column. + * Use it to find missing entries in the language file. + * @param textResourceBindingKeys Array of text resource binding keys. + */ export const logTextResourceLabels = (textResourceBindingKeys: string[]) => { textResourceBindingKeys.sort().forEach((key) => { console.log( @@ -13,8 +49,11 @@ export const logTextResourceLabels = (textResourceBindingKeys: string[]) => { }); }; -// Logs various language keys and values related to the component configuration. -// Use it to find missing entries in the language file(s). +/** + * Logs all language keys and values in the component configuration column, except for those in the "Tekst" accordion. + * Use it to find missing entries in the language file. + * @param componentPropertyKeys Array of component property keys. + */ export const logComponentPropertyLabels = (componentPropertyKeys: string[]) => { componentPropertyKeys.sort().forEach((key) => { console.log( diff --git a/frontend/scripts/componentSchemas/run.ts b/frontend/scripts/componentSchemas/run.ts index e6fd14cc3b4..ae66d962d53 100644 --- a/frontend/scripts/componentSchemas/run.ts +++ b/frontend/scripts/componentSchemas/run.ts @@ -1,98 +1,19 @@ -import { expandAllOf, expandAnyOf, expandRefsInProperties, verifySchema } from './schemaUtils'; +import { allPropertyKeys, generateComponentSchema } from './schemaUtils'; import type { AppFrontendVersion } from './version'; -import { isValidVersion, versionSettings } from './version'; +import { isValidVersion } from './version'; import { getLayoutSchema } from './api'; -import { logComponentPropertyLabels, logTextResourceLabels } from './languageUtils'; - -const allTextResourceBindingKeys = []; -const allPropertyKeys = []; - -const writeToFile = (name: string, data: any, version: AppFrontendVersion) => { - const path = require('path'); - const fs = require('fs'); - - const dirPath = path.resolve(__dirname, versionSettings[version].componentSchemaPath); - const fileName = `${dirPath}/${name}.schema.v1.json`; - - fs.writeFile(fileName, JSON.stringify(data), function (err: any) { - if (err) return console.log(err); - console.log(`Wrote ${fileName}`); - }); -}; - -const addTextResourceBindingKeys = (schema: any) => { - if (schema.properties?.textResourceBindings) { - const textResourceBindingKeys = Object.keys(schema.properties.textResourceBindings.properties); - allTextResourceBindingKeys.push(...textResourceBindingKeys); - } -}; - -const addProperties = (propertyKeys: string[]) => { - allPropertyKeys.push(...propertyKeys); -}; - -const generateComponentSchema = (name: string, layoutSchema: any, version: string) => { - const definitionName = `Comp${name}`; - console.log('definitionName: ', definitionName); - const componentSchema = layoutSchema.definitions[definitionName]; - let schema: any = { - $id: `https://altinncdn.no/schemas/json/component/${name}.schema.v1.json`, - $schema: layoutSchema.$schema, - }; - - // The v4 schema has external definitions. This code block is needed to fetch v4 properties correctly. - const externalDefinitionName = definitionName + 'External'; - if (version == 'v4' && layoutSchema.definitions[externalDefinitionName]?.allOf) { - componentSchema.allOf = layoutSchema.definitions[externalDefinitionName].allOf; - } - - if (componentSchema.allOf) { - schema = { ...schema, ...expandAllOf(componentSchema, layoutSchema) }; - const expectedProperties = Object.keys( - componentSchema.allOf[componentSchema.allOf.length - 1].properties, - ); - addProperties(expectedProperties); - - if ( - !verifySchema( - schema, - Object.keys(componentSchema.allOf[componentSchema.allOf.length - 1].properties), - ) - ) { - return null; - } - } else if (componentSchema.anyOf) { - schema.anyOf = expandAnyOf(componentSchema, layoutSchema); - } - - // Expand all refs in properties - schema.properties = expandRefsInProperties(schema.properties, layoutSchema); - - // Sort text resource binding keys - if (schema.properties?.textResourceBindings) { - schema.properties.textResourceBindings.properties = sortTextResourceBindings( - schema.properties.textResourceBindings.properties, - ); - } - schema.title = `${name} component schema`; - return schema; -}; - -const sortTextResourceBindings = (textResourceBindings: any) => { - const { title, description, help, ...rest } = textResourceBindings; - const sorted: any = {}; - if (title) { - sorted.title = title; - } - if (description) { - sorted.description = description; - } - if (help) { - sorted.help = help; - } - return { ...sorted, ...rest }; -}; - +import { + addTextResourceBindingKeys, + allTextResourceBindingKeys, + logComponentPropertyLabels, + logTextResourceLabels, +} from './languageUtils'; +import { writeToFile } from './fileUtils'; + +/** + * Main function that runs the script. + * Fetches the layout schema, generates component schemas, and logs language keys. + */ const run = async () => { let version: string = process.argv.length > 2 ? process.argv[2] : ''; if (!isValidVersion(version)) { diff --git a/frontend/scripts/componentSchemas/schemaUtils.ts b/frontend/scripts/componentSchemas/schemaUtils.ts index 3b1e29922c3..31b7c545f8e 100644 --- a/frontend/scripts/componentSchemas/schemaUtils.ts +++ b/frontend/scripts/componentSchemas/schemaUtils.ts @@ -1,4 +1,17 @@ import jsonpointer from 'jsonpointer'; +import { sortTextResourceBindings } from './languageUtils'; + +export const allPropertyKeys = []; + +/** + * Expands a ref in a schema from a reference to the actual schema + * @param ref The ref to expand + * @param layoutSchema The full layout schema + * @returns The expanded schema + */ +export const expandRef = (ref: string, layoutSchema: any) => { + return jsonpointer.get(layoutSchema, ref.replace('#/', '/')); +}; /** * Expands allOf node in schema by combining all properties together in one object. @@ -52,24 +65,55 @@ export const expandAnyOf = (schema: any, layoutSchema: any) => { }; /** - * Expands a ref in a schema from a reference to the actual schema - * @param ref The ref to expand + * Expands all refs in properties in a schema + * @param properties The properties to expand * @param layoutSchema The full layout schema - * @returns The expanded schema + * @returns The expanded properties */ -export const expandRef = (ref: string, layoutSchema: any) => { - return jsonpointer.get(layoutSchema, ref.replace('#/', '/')); +export const expandRefsInProperties = (properties: any, layoutSchema: any) => { + const expandedProperties = { ...properties }; + for (const property in properties) { + if (expandedProperties[property].$ref && expandedProperties[property].$ref.startsWith('#/')) { + expandedProperties[property] = expandRef(expandedProperties[property].$ref, layoutSchema); + } + if (expandedProperties[property].items?.$ref) { + expandedProperties[property].items = expandRef( + expandedProperties[property].items.$ref, + layoutSchema, + ); + } + if (expandedProperties[property].allOf) { + expandedProperties[property] = expandAllOf(expandedProperties[property], layoutSchema); + } + + if (expandedProperties[property].anyOf) { + expandedProperties[property].anyOf = expandAnyOf(expandedProperties[property], layoutSchema); + } + ensureTypeWithEnums(expandedProperties[property]); + } + + return expandedProperties; }; /** - * Ensures that a schema with enum values has type string - * @param schema The schema to ensure string type for + * Ensures that a schema with enum values has correct type (string or number) + * @param schema The schema to ensure type for */ -export const ensureStringTypeWithEnums = (schema: any) => { - if (schema.enum) { - schema.type = 'string'; - } else if (schema.items?.enum) { - schema.items.type = 'string'; +export const ensureTypeWithEnums = (schema: any) => { + if (schema.enum && schema.enum.length > 0) { + const firstEnumValue = schema.enum[0]; + if (typeof firstEnumValue === 'string') { + schema.type = 'string'; + } else if (typeof firstEnumValue === 'number') { + schema.type = 'number'; + } + } else if (schema.items?.enum && schema.items.enum.length > 0) { + const firstEnumValue = schema.items.enum[0]; + if (typeof firstEnumValue === 'string') { + schema.items.type = 'string'; + } else if (typeof firstEnumValue === 'number') { + schema.items.type = 'number'; + } } }; @@ -88,37 +132,78 @@ export const verifySchema = (schema: any, expectedProperties: string[]) => { console.log(`Missing properties: ${missingProperties.join(', ')}`); return false; } - return true; }; /** - * Expands all refs in properties in a schema - * @param properties The properties to expand - * @param layoutSchema The full layout schema - * @returns The expanded properties + * Adds property keys to the global list. + * @param propertyKeys Array of property keys to add. */ -export const expandRefsInProperties = (properties: any, layoutSchema: any) => { - const expandedProperties = { ...properties }; - for (const property in properties) { - if (expandedProperties[property].$ref && expandedProperties[property].$ref.startsWith('#/')) { - expandedProperties[property] = expandRef(expandedProperties[property].$ref, layoutSchema); - } - if (expandedProperties[property].items?.$ref) { - expandedProperties[property].items = expandRef( - expandedProperties[property].items.$ref, - layoutSchema, - ); - } - if (expandedProperties[property].allOf) { - expandedProperties[property] = expandAllOf(expandedProperties[property], layoutSchema); - } +const addProperties = (propertyKeys: string[]) => { + allPropertyKeys.push(...propertyKeys); +}; - if (expandedProperties[property].anyOf) { - expandedProperties[property].anyOf = expandAnyOf(expandedProperties[property], layoutSchema); +/** + * Retrieves the component schema based on the version (the v4 schema has an external reference) + * @param definitionName The name of the component definition. + * @param layoutSchema The full layout schema. + * @param version The app frontend version. + * @returns The component schema. + */ + +const getComponentSchema = (definitionName: string, layoutSchema: any, version: string) => { + if (version === 'v4') { + console.log('definitionName: ', definitionName + 'External'); + return expandRef(layoutSchema.definitions[definitionName].$ref, layoutSchema); + } + console.log('definitionName: ', definitionName); + return layoutSchema.definitions[definitionName]; +}; + +/** + * Generates a component schema by expanding definitions and resolving references. + * @param componentName The name of the component. + * @param layoutSchema The full layout schema. + * @param version The app frontend version. + * @returns The generated component schema. + */ +export const generateComponentSchema = ( + componentName: string, + layoutSchema: any, + version: string, +) => { + const definitionName = `Comp${componentName}`; + const componentSchema = getComponentSchema(definitionName, layoutSchema, version); + + let schema: any = { + $id: `https://altinncdn.no/schemas/json/component/${componentName}.schema.v1.json`, + $schema: layoutSchema.$schema, + }; + + if (componentSchema.allOf) { + schema = { ...schema, ...expandAllOf(componentSchema, layoutSchema) }; + const expectedProperties = Object.keys( + componentSchema.allOf[componentSchema.allOf.length - 1].properties, + ); + addProperties(expectedProperties); + + if (!verifySchema(schema, expectedProperties)) { + return null; } - ensureStringTypeWithEnums(expandedProperties[property]); + } else if (componentSchema.anyOf) { + schema.anyOf = expandAnyOf(componentSchema, layoutSchema); } - return expandedProperties; + // Expand all refs in properties + schema.properties = expandRefsInProperties(schema.properties, layoutSchema); + + // Sort text resource binding keys + if (schema.properties?.textResourceBindings) { + schema.properties.textResourceBindings.properties = sortTextResourceBindings( + schema.properties.textResourceBindings.properties, + ); + } + + schema.title = `${componentName} component schema`; + return schema; }; diff --git a/frontend/scripts/componentSchemas/version.ts b/frontend/scripts/componentSchemas/version.ts index dc10b28c7cf..971da9f065e 100644 --- a/frontend/scripts/componentSchemas/version.ts +++ b/frontend/scripts/componentSchemas/version.ts @@ -12,7 +12,8 @@ export const versionSettings = { componentSchemaPath: '../../packages/ux-editor/src/testing/schemas/json/component', }, }; -export const isValidVersion = (version: string) => - validVersions.includes(version as AppFrontendVersion); + export const validVersions = ['v3', 'v4'] as const; export type AppFrontendVersion = (typeof validVersions)[number]; +export const isValidVersion = (version: string) => + validVersions.includes(version as AppFrontendVersion); From f7921231fb6521d3a212e75e1c57d68c2333eb7b Mon Sep 17 00:00:00 2001 From: Erling Hauan Date: Fri, 4 Oct 2024 13:38:50 +0200 Subject: [PATCH 2/7] Add test for ensureTypeWithEnums --- .../componentSchemas/schemaUtils.test.ts | 65 +++++++ .../scripts/componentSchemas/schemaUtils.ts | 183 +++++++++--------- 2 files changed, 156 insertions(+), 92 deletions(-) create mode 100644 frontend/scripts/componentSchemas/schemaUtils.test.ts diff --git a/frontend/scripts/componentSchemas/schemaUtils.test.ts b/frontend/scripts/componentSchemas/schemaUtils.test.ts new file mode 100644 index 00000000000..80f84d807cb --- /dev/null +++ b/frontend/scripts/componentSchemas/schemaUtils.test.ts @@ -0,0 +1,65 @@ +import { ensureTypeWithEnums } from './schemaUtils'; + +describe('ensureTypeWithEnums', () => { + it('should set schema.type to "string" when schema.enum contains a string', () => { + const schema: any = { + enum: ['value1', 'value2'], + }; + ensureTypeWithEnums(schema); + expect(schema.type).toBe('string'); + }); + + it('should set schema.type to "number" when schema.enum contains a number', () => { + const schema: any = { + enum: [1, 2, 3], + }; + ensureTypeWithEnums(schema); + expect(schema.type).toBe('number'); + }); + + it('should set schema.items.type to "string" when schema.items.enum contains a string', () => { + const schema: any = { + items: { + enum: ['item1', 'item2'], + }, + }; + ensureTypeWithEnums(schema); + expect(schema.items.type).toBe('string'); + }); + + it('should set schema.items.type to "number" when schema.items.enum contains a number', () => { + const schema: any = { + items: { + enum: [10, 20, 30], + }, + }; + ensureTypeWithEnums(schema); + expect(schema.items.type).toBe('number'); + }); + + it('should not set schema.type when schema.enum is empty', () => { + const schema: any = { + enum: [], + }; + ensureTypeWithEnums(schema); + expect(schema.type).toBeUndefined(); + }); + + it('should not set schema.items.type when schema.items.enum is empty', () => { + const schema: any = { + items: { + enum: [], + }, + }; + ensureTypeWithEnums(schema); + expect(schema.items.type).toBeUndefined(); + }); + + it('should not modify schema if there is no enum or items.enum', () => { + const schema: any = { + type: 'object', + }; + ensureTypeWithEnums(schema); + expect(schema).toEqual({ type: 'object' }); + }); +}); diff --git a/frontend/scripts/componentSchemas/schemaUtils.ts b/frontend/scripts/componentSchemas/schemaUtils.ts index 31b7c545f8e..c10c4b6359a 100644 --- a/frontend/scripts/componentSchemas/schemaUtils.ts +++ b/frontend/scripts/componentSchemas/schemaUtils.ts @@ -1,16 +1,68 @@ import jsonpointer from 'jsonpointer'; import { sortTextResourceBindings } from './languageUtils'; -export const allPropertyKeys = []; +/** + * Generates a component schema by expanding definitions and resolving references. + * @param componentName The name of the component. + * @param layoutSchema The full layout schema. + * @param version The app frontend version. + * @returns The generated component schema. + */ +export const generateComponentSchema = ( + componentName: string, + layoutSchema: any, + version: string, +) => { + const definitionName = `Comp${componentName}`; + const componentSchema = getComponentSchema(definitionName, layoutSchema, version); + + let schema: any = { + $id: `https://altinncdn.no/schemas/json/component/${componentName}.schema.v1.json`, + $schema: layoutSchema.$schema, + }; + + if (componentSchema.allOf) { + schema = { ...schema, ...expandAllOf(componentSchema, layoutSchema) }; + const expectedProperties = Object.keys( + componentSchema.allOf[componentSchema.allOf.length - 1].properties, + ); + addProperties(expectedProperties); + + if (!verifySchema(schema, expectedProperties)) { + return null; + } + } else if (componentSchema.anyOf) { + schema.anyOf = expandAnyOf(componentSchema, layoutSchema); + } + + // Expand all refs in properties + schema.properties = expandRefsInProperties(schema.properties, layoutSchema); + + // Sort text resource binding keys + if (schema.properties?.textResourceBindings) { + schema.properties.textResourceBindings.properties = sortTextResourceBindings( + schema.properties.textResourceBindings.properties, + ); + } + + schema.title = `${componentName} component schema`; + return schema; +}; /** - * Expands a ref in a schema from a reference to the actual schema - * @param ref The ref to expand - * @param layoutSchema The full layout schema - * @returns The expanded schema + * Retrieves the component schema based on the version (the v4 schema has an external reference) + * @param definitionName The name of the component definition. + * @param layoutSchema The full layout schema. + * @param version The app frontend version. + * @returns The component schema. */ -export const expandRef = (ref: string, layoutSchema: any) => { - return jsonpointer.get(layoutSchema, ref.replace('#/', '/')); +export const getComponentSchema = (definitionName: string, layoutSchema: any, version: string) => { + if (version === 'v4') { + console.log('definitionName: ', definitionName + 'External'); + return expandRef(layoutSchema.definitions[definitionName].$ref, layoutSchema); + } + console.log('definitionName: ', definitionName); + return layoutSchema.definitions[definitionName]; }; /** @@ -42,6 +94,16 @@ export const expandAllOf = (schema: any, layoutSchema: any, componentNode: boole return expandedSchema; }; +/** + * Expands a ref in a schema from a reference to the actual schema + * @param ref The ref to expand + * @param layoutSchema The full layout schema + * @returns The expanded schema + */ +export const expandRef = (ref: string, layoutSchema: any) => { + return jsonpointer.get(layoutSchema, ref.replace('#/', '/')); +}; + /** * Expands anyOf node in schema by expanding all $refs and/or allOf nodes within the anyOf node. * @param schema The schema to expand @@ -95,26 +157,14 @@ export const expandRefsInProperties = (properties: any, layoutSchema: any) => { return expandedProperties; }; +export const allPropertyKeys = []; + /** - * Ensures that a schema with enum values has correct type (string or number) - * @param schema The schema to ensure type for + * Adds property keys to the global list. + * @param propertyKeys Array of property keys to add. */ -export const ensureTypeWithEnums = (schema: any) => { - if (schema.enum && schema.enum.length > 0) { - const firstEnumValue = schema.enum[0]; - if (typeof firstEnumValue === 'string') { - schema.type = 'string'; - } else if (typeof firstEnumValue === 'number') { - schema.type = 'number'; - } - } else if (schema.items?.enum && schema.items.enum.length > 0) { - const firstEnumValue = schema.items.enum[0]; - if (typeof firstEnumValue === 'string') { - schema.items.type = 'string'; - } else if (typeof firstEnumValue === 'number') { - schema.items.type = 'number'; - } - } +const addProperties = (propertyKeys: string[]) => { + allPropertyKeys.push(...propertyKeys); }; /** @@ -136,74 +186,23 @@ export const verifySchema = (schema: any, expectedProperties: string[]) => { }; /** - * Adds property keys to the global list. - * @param propertyKeys Array of property keys to add. - */ -const addProperties = (propertyKeys: string[]) => { - allPropertyKeys.push(...propertyKeys); -}; - -/** - * Retrieves the component schema based on the version (the v4 schema has an external reference) - * @param definitionName The name of the component definition. - * @param layoutSchema The full layout schema. - * @param version The app frontend version. - * @returns The component schema. - */ - -const getComponentSchema = (definitionName: string, layoutSchema: any, version: string) => { - if (version === 'v4') { - console.log('definitionName: ', definitionName + 'External'); - return expandRef(layoutSchema.definitions[definitionName].$ref, layoutSchema); - } - console.log('definitionName: ', definitionName); - return layoutSchema.definitions[definitionName]; -}; - -/** - * Generates a component schema by expanding definitions and resolving references. - * @param componentName The name of the component. - * @param layoutSchema The full layout schema. - * @param version The app frontend version. - * @returns The generated component schema. + * Ensures that a schema with enum values has correct type (string or number) + * @param schema The schema to ensure type for */ -export const generateComponentSchema = ( - componentName: string, - layoutSchema: any, - version: string, -) => { - const definitionName = `Comp${componentName}`; - const componentSchema = getComponentSchema(definitionName, layoutSchema, version); - - let schema: any = { - $id: `https://altinncdn.no/schemas/json/component/${componentName}.schema.v1.json`, - $schema: layoutSchema.$schema, - }; - - if (componentSchema.allOf) { - schema = { ...schema, ...expandAllOf(componentSchema, layoutSchema) }; - const expectedProperties = Object.keys( - componentSchema.allOf[componentSchema.allOf.length - 1].properties, - ); - addProperties(expectedProperties); - - if (!verifySchema(schema, expectedProperties)) { - return null; +export const ensureTypeWithEnums = (schema: any) => { + if (schema.enum && schema.enum.length > 0) { + const firstEnumValue = schema.enum[0]; + if (typeof firstEnumValue === 'string') { + schema.type = 'string'; + } else if (typeof firstEnumValue === 'number') { + schema.type = 'number'; + } + } else if (schema.items?.enum && schema.items.enum.length > 0) { + const firstEnumValue = schema.items.enum[0]; + if (typeof firstEnumValue === 'string') { + schema.items.type = 'string'; + } else if (typeof firstEnumValue === 'number') { + schema.items.type = 'number'; } - } else if (componentSchema.anyOf) { - schema.anyOf = expandAnyOf(componentSchema, layoutSchema); - } - - // Expand all refs in properties - schema.properties = expandRefsInProperties(schema.properties, layoutSchema); - - // Sort text resource binding keys - if (schema.properties?.textResourceBindings) { - schema.properties.textResourceBindings.properties = sortTextResourceBindings( - schema.properties.textResourceBindings.properties, - ); } - - schema.title = `${componentName} component schema`; - return schema; }; From 04453a3244554f3cb65f1c47223ec447a8a85a01 Mon Sep 17 00:00:00 2001 From: Erling Hauan Date: Fri, 4 Oct 2024 13:49:09 +0200 Subject: [PATCH 3/7] Small fixes --- frontend/scripts/componentSchemas/schemaUtils.test.ts | 4 ++-- frontend/scripts/componentSchemas/version.ts | 5 ++--- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/frontend/scripts/componentSchemas/schemaUtils.test.ts b/frontend/scripts/componentSchemas/schemaUtils.test.ts index 80f84d807cb..b8c56215e3b 100644 --- a/frontend/scripts/componentSchemas/schemaUtils.test.ts +++ b/frontend/scripts/componentSchemas/schemaUtils.test.ts @@ -57,9 +57,9 @@ describe('ensureTypeWithEnums', () => { it('should not modify schema if there is no enum or items.enum', () => { const schema: any = { - type: 'object', + type: 'array', }; ensureTypeWithEnums(schema); - expect(schema).toEqual({ type: 'object' }); + expect(schema).toEqual({ type: 'array' }); }); }); diff --git a/frontend/scripts/componentSchemas/version.ts b/frontend/scripts/componentSchemas/version.ts index 971da9f065e..dc10b28c7cf 100644 --- a/frontend/scripts/componentSchemas/version.ts +++ b/frontend/scripts/componentSchemas/version.ts @@ -12,8 +12,7 @@ export const versionSettings = { componentSchemaPath: '../../packages/ux-editor/src/testing/schemas/json/component', }, }; - -export const validVersions = ['v3', 'v4'] as const; -export type AppFrontendVersion = (typeof validVersions)[number]; export const isValidVersion = (version: string) => validVersions.includes(version as AppFrontendVersion); +export const validVersions = ['v3', 'v4'] as const; +export type AppFrontendVersion = (typeof validVersions)[number]; From 89a7b36423b92af0590cc3a7b3c35e71687efbf3 Mon Sep 17 00:00:00 2001 From: Erling Hauan Date: Fri, 4 Oct 2024 14:12:35 +0200 Subject: [PATCH 4/7] Small fixes --- .../scripts/componentSchemas/languageUtils.ts | 11 +--------- frontend/scripts/componentSchemas/run.ts | 8 ++----- .../scripts/componentSchemas/schemaUtils.ts | 22 ++----------------- 3 files changed, 5 insertions(+), 36 deletions(-) diff --git a/frontend/scripts/componentSchemas/languageUtils.ts b/frontend/scripts/componentSchemas/languageUtils.ts index d70d978559b..9b37933950d 100644 --- a/frontend/scripts/componentSchemas/languageUtils.ts +++ b/frontend/scripts/componentSchemas/languageUtils.ts @@ -2,22 +2,13 @@ import nb from '../../language/src/nb.json'; export const allTextResourceBindingKeys = []; -/** - * Adds text resource binding keys from a schema to the global list. - * @param schema The schema to extract keys from. - */ -export const addTextResourceBindingKeys = (schema: any) => { +export const pushTextResourceBindingKeys = (schema: any) => { if (schema.properties?.textResourceBindings) { const textResourceBindingKeys = Object.keys(schema.properties.textResourceBindings.properties); allTextResourceBindingKeys.push(...textResourceBindingKeys); } }; -/** - * Sorts text resource bindings, placing 'title', 'description', and 'help' first. - * @param textResourceBindings The text resource bindings to sort. - * @returns The sorted text resource bindings. - */ export const sortTextResourceBindings = (textResourceBindings: any) => { const { title, description, help, ...rest } = textResourceBindings; const sorted: any = {}; diff --git a/frontend/scripts/componentSchemas/run.ts b/frontend/scripts/componentSchemas/run.ts index ae66d962d53..087fe312a7b 100644 --- a/frontend/scripts/componentSchemas/run.ts +++ b/frontend/scripts/componentSchemas/run.ts @@ -3,17 +3,13 @@ import type { AppFrontendVersion } from './version'; import { isValidVersion } from './version'; import { getLayoutSchema } from './api'; import { - addTextResourceBindingKeys, + pushTextResourceBindingKeys, allTextResourceBindingKeys, logComponentPropertyLabels, logTextResourceLabels, } from './languageUtils'; import { writeToFile } from './fileUtils'; -/** - * Main function that runs the script. - * Fetches the layout schema, generates component schemas, and logs language keys. - */ const run = async () => { let version: string = process.argv.length > 2 ? process.argv[2] : ''; if (!isValidVersion(version)) { @@ -30,7 +26,7 @@ const run = async () => { componentName = componentName === 'AddressComponent' ? 'Address' : componentName; const schema = generateComponentSchema(componentName, layoutSchema, version); - addTextResourceBindingKeys(schema); + pushTextResourceBindingKeys(schema); writeToFile(componentName, schema, version as AppFrontendVersion); }); diff --git a/frontend/scripts/componentSchemas/schemaUtils.ts b/frontend/scripts/componentSchemas/schemaUtils.ts index c10c4b6359a..e18fd028675 100644 --- a/frontend/scripts/componentSchemas/schemaUtils.ts +++ b/frontend/scripts/componentSchemas/schemaUtils.ts @@ -1,13 +1,6 @@ import jsonpointer from 'jsonpointer'; import { sortTextResourceBindings } from './languageUtils'; -/** - * Generates a component schema by expanding definitions and resolving references. - * @param componentName The name of the component. - * @param layoutSchema The full layout schema. - * @param version The app frontend version. - * @returns The generated component schema. - */ export const generateComponentSchema = ( componentName: string, layoutSchema: any, @@ -26,7 +19,7 @@ export const generateComponentSchema = ( const expectedProperties = Object.keys( componentSchema.allOf[componentSchema.allOf.length - 1].properties, ); - addProperties(expectedProperties); + pushPropertyKeys(expectedProperties); if (!verifySchema(schema, expectedProperties)) { return null; @@ -49,13 +42,6 @@ export const generateComponentSchema = ( return schema; }; -/** - * Retrieves the component schema based on the version (the v4 schema has an external reference) - * @param definitionName The name of the component definition. - * @param layoutSchema The full layout schema. - * @param version The app frontend version. - * @returns The component schema. - */ export const getComponentSchema = (definitionName: string, layoutSchema: any, version: string) => { if (version === 'v4') { console.log('definitionName: ', definitionName + 'External'); @@ -159,11 +145,7 @@ export const expandRefsInProperties = (properties: any, layoutSchema: any) => { export const allPropertyKeys = []; -/** - * Adds property keys to the global list. - * @param propertyKeys Array of property keys to add. - */ -const addProperties = (propertyKeys: string[]) => { +const pushPropertyKeys = (propertyKeys: string[]) => { allPropertyKeys.push(...propertyKeys); }; From 2758805afcc4af11382e39088549dfd39db31d8e Mon Sep 17 00:00:00 2001 From: Erling Hauan Date: Fri, 4 Oct 2024 14:19:11 +0200 Subject: [PATCH 5/7] Small fixes --- .../json/component/Accordion.schema.v1.json | 99 +--- .../component/AccordionGroup.schema.v1.json | 92 +--- .../component/ActionButton.schema.v1.json | 78 +-- .../json/component/Address.schema.v1.json | 187 +------ .../json/component/Alert.schema.v1.json | 77 +-- .../component/AttachmentList.schema.v1.json | 72 +-- .../json/component/Audio.schema.v1.json | 73 +-- .../json/component/Button.schema.v1.json | 80 +-- .../json/component/ButtonGroup.schema.v1.json | 114 +---- .../json/component/Cards.schema.v1.json | 143 +----- .../json/component/Checkboxes.schema.v1.json | 284 +--------- .../json/component/Custom.schema.v1.json | 141 +---- .../component/CustomButton.schema.v1.json | 82 +-- .../json/component/Datepicker.schema.v1.json | 185 +------ .../json/component/Dropdown.schema.v1.json | 272 +--------- .../json/component/FileUpload.schema.v1.json | 213 +------- .../FileUploadWithTag.schema.v1.json | 312 +---------- .../json/component/Grid.schema.v1.json | 139 +---- .../json/component/Group.schema.v1.json | 109 +--- .../json/component/Header.schema.v1.json | 77 +-- .../json/component/IFrame.schema.v1.json | 85 +-- .../json/component/Image.schema.v1.json | 82 +-- .../json/component/Input.schema.v1.json | 483 +----------------- .../InstanceInformation.schema.v1.json | 100 +--- .../InstantiationButton.schema.v1.json | 73 +-- .../json/component/Likert.schema.v1.json | 282 +--------- .../json/component/LikertItem.schema.v1.json | 266 +--------- .../json/component/Link.schema.v1.json | 82 +-- .../json/component/List.schema.v1.json | 221 +------- .../schemas/json/component/Map.schema.v1.json | 206 +------- .../component/MultipleSelect.schema.v1.json | 272 +--------- .../component/NavigationBar.schema.v1.json | 88 +--- .../NavigationButtons.schema.v1.json | 105 +--- .../json/component/Number.schema.v1.json | 313 +----------- .../json/component/Panel.schema.v1.json | 83 +-- .../json/component/Paragraph.schema.v1.json | 71 +-- .../json/component/Payment.schema.v1.json | 83 +-- .../component/PaymentDetails.schema.v1.json | 78 +-- .../json/component/PrintButton.schema.v1.json | 66 +-- .../component/RadioButtons.schema.v1.json | 289 +---------- .../component/RepeatingGroup.schema.v1.json | 368 +------------ .../json/component/Summary.schema.v1.json | 121 +---- .../json/component/Summary2.schema.v1.json | 96 +--- .../json/component/Tabs.schema.v1.json | 105 +--- .../json/component/Text.schema.v1.json | 79 +-- .../json/component/TextArea.schema.v1.json | 232 +-------- .../json/component/Video.schema.v1.json | 73 +-- .../scripts/componentSchemas/schemaUtils.ts | 10 +- 48 files changed, 50 insertions(+), 7191 deletions(-) diff --git a/frontend/packages/ux-editor/src/testing/schemas/json/component/Accordion.schema.v1.json b/frontend/packages/ux-editor/src/testing/schemas/json/component/Accordion.schema.v1.json index 5b94321f856..97bb1ec3a1e 100644 --- a/frontend/packages/ux-editor/src/testing/schemas/json/component/Accordion.schema.v1.json +++ b/frontend/packages/ux-editor/src/testing/schemas/json/component/Accordion.schema.v1.json @@ -1,98 +1 @@ -{ - "$id": "https://altinncdn.no/schemas/json/component/Accordion.schema.v1.json", - "$schema": "http://json-schema.org/draft-07/schema#", - "properties": { - "id": { - "title": "ID", - "description": "The component ID. Must be unique within all layouts/pages in a layout-set. Cannot end with .", - "type": "string", - "pattern": "^[0-9a-zA-Z][0-9a-zA-Z-]*(-?[a-zA-Z]+|[a-zA-Z][0-9]+|-[0-9]{6,})$" - }, - "hidden": { - "title": "Hidden", - "description": "Boolean value or expression indicating if the component should be hidden. Defaults to false.", - "default": false, - "$ref": "expression.schema.v1.json#/definitions/boolean" - }, - "grid": { - "properties": { - "xs": { "$ref": "#/definitions/IGridSize" }, - "sm": { "$ref": "#/definitions/IGridSize" }, - "md": { "$ref": "#/definitions/IGridSize" }, - "lg": { "$ref": "#/definitions/IGridSize" }, - "xl": { "$ref": "#/definitions/IGridSize" }, - "labelGrid": { "$ref": "#/definitions/IGridStyling" }, - "innerGrid": { "$ref": "#/definitions/IGridStyling" } - } - }, - "pageBreak": { - "title": "Page break", - "description": "Optionally insert page-break before/after component when rendered in PDF", - "type": "object", - "properties": { - "breakBefore": { - "title": "Page break before", - "description": "PDF only: Value or expression indicating whether a page break should be added before the component. Can be either: 'auto' (default), 'always', or 'avoid'.", - "examples": ["auto", "always", "avoid"], - "default": "auto", - "$ref": "expression.schema.v1.json#/definitions/string" - }, - "breakAfter": { - "title": "Page break after", - "description": "PDF only: Value or expression indicating whether a page break should be added after the component. Can be either: 'auto' (default), 'always', or 'avoid'.", - "examples": ["auto", "always", "avoid"], - "default": "auto", - "$ref": "expression.schema.v1.json#/definitions/string" - } - }, - "additionalProperties": false - }, - "renderAsSummary": { - "title": "Render as summary", - "description": "Boolean value indicating if the component should be rendered as a summary. Defaults to false.", - "default": false, - "type": "boolean" - }, - "forceShowInSummary": { - "title": "Force show in summary", - "description": "Will force show the component in a summary even if hideEmptyFields is set to true in the summary component.", - "default": false, - "$ref": "expression.schema.v1.json#/definitions/boolean" - }, - "type": { "const": "Accordion" }, - "textResourceBindings": { - "properties": { - "title": { - "title": "Title", - "description": "The title of the accordion", - "$ref": "expression.schema.v1.json#/definitions/string" - }, - "summaryTitle": { - "title": "Summary title", - "description": "Title used in the summary view (overrides the default title)", - "$ref": "expression.schema.v1.json#/definitions/string" - }, - "summaryAccessibleTitle": { - "title": "Accessible summary title", - "description": "Title used for aria-label on the edit button in the summary view (overrides the default and summary title)", - "$ref": "expression.schema.v1.json#/definitions/string" - } - } - }, - "children": { - "title": "Children", - "description": "List of child component IDs to show inside the Accordion (limited to a few component types)", - "type": "array", - "items": { "type": "string" } - }, - "openByDefault": { - "title": "Open by default", - "description": "Boolean value indicating if the accordion should be open by default", - "default": false, - "$ref": "expression.schema.v1.json#/definitions/boolean" - }, - "headingLevel": { "title": "HeadingLevel", "enum": [2, 3, 4, 5, 6], "type": "string" } - }, - "required": ["id", "type", "children"], - "title": "Accordion component schema" -} +{"$id":"https://altinncdn.no/schemas/json/component/Accordion.schema.v1.json","$schema":"http://json-schema.org/draft-07/schema#","properties":{"id":{"title":"ID","description":"The component ID. Must be unique within all layouts/pages in a layout-set. Cannot end with .","type":"string","pattern":"^[0-9a-zA-Z][0-9a-zA-Z-]*(-?[a-zA-Z]+|[a-zA-Z][0-9]+|-[0-9]{6,})$"},"hidden":{"title":"Hidden","description":"Boolean value or expression indicating if the component should be hidden. Defaults to false.","default":false,"$ref":"expression.schema.v1.json#/definitions/boolean"},"grid":{"properties":{"xs":{"$ref":"#/definitions/IGridSize"},"sm":{"$ref":"#/definitions/IGridSize"},"md":{"$ref":"#/definitions/IGridSize"},"lg":{"$ref":"#/definitions/IGridSize"},"xl":{"$ref":"#/definitions/IGridSize"},"labelGrid":{"$ref":"#/definitions/IGridStyling"},"innerGrid":{"$ref":"#/definitions/IGridStyling"}}},"pageBreak":{"title":"Page break","description":"Optionally insert page-break before/after component when rendered in PDF","type":"object","properties":{"breakBefore":{"title":"Page break before","description":"PDF only: Value or expression indicating whether a page break should be added before the component. Can be either: 'auto' (default), 'always', or 'avoid'.","examples":["auto","always","avoid"],"default":"auto","$ref":"expression.schema.v1.json#/definitions/string"},"breakAfter":{"title":"Page break after","description":"PDF only: Value or expression indicating whether a page break should be added after the component. Can be either: 'auto' (default), 'always', or 'avoid'.","examples":["auto","always","avoid"],"default":"auto","$ref":"expression.schema.v1.json#/definitions/string"}},"additionalProperties":false},"renderAsSummary":{"title":"Render as summary","description":"Boolean value indicating if the component should be rendered as a summary. Defaults to false.","default":false,"type":"boolean"},"forceShowInSummary":{"title":"Force show in summary","description":"Will force show the component in a summary even if hideEmptyFields is set to true in the summary component.","default":false,"$ref":"expression.schema.v1.json#/definitions/boolean"},"type":{"const":"Accordion"},"textResourceBindings":{"properties":{"title":{"title":"Title","description":"The title of the accordion","$ref":"expression.schema.v1.json#/definitions/string"},"summaryTitle":{"title":"Summary title","description":"Title used in the summary view (overrides the default title)","$ref":"expression.schema.v1.json#/definitions/string"},"summaryAccessibleTitle":{"title":"Accessible summary title","description":"Title used for aria-label on the edit button in the summary view (overrides the default and summary title)","$ref":"expression.schema.v1.json#/definitions/string"}}},"children":{"title":"Children","description":"List of child component IDs to show inside the Accordion (limited to a few component types)","type":"array","items":{"type":"string"}},"openByDefault":{"title":"Open by default","description":"Boolean value indicating if the accordion should be open by default","default":false,"$ref":"expression.schema.v1.json#/definitions/boolean"},"headingLevel":{"title":"HeadingLevel","enum":[2,3,4,5,6],"type":"number"}},"required":["id","type","children"],"title":"Accordion component schema"} \ No newline at end of file diff --git a/frontend/packages/ux-editor/src/testing/schemas/json/component/AccordionGroup.schema.v1.json b/frontend/packages/ux-editor/src/testing/schemas/json/component/AccordionGroup.schema.v1.json index 9cbe0ff7d88..876223e55f0 100644 --- a/frontend/packages/ux-editor/src/testing/schemas/json/component/AccordionGroup.schema.v1.json +++ b/frontend/packages/ux-editor/src/testing/schemas/json/component/AccordionGroup.schema.v1.json @@ -1,91 +1 @@ -{ - "$id": "https://altinncdn.no/schemas/json/component/AccordionGroup.schema.v1.json", - "$schema": "http://json-schema.org/draft-07/schema#", - "properties": { - "id": { - "title": "ID", - "description": "The component ID. Must be unique within all layouts/pages in a layout-set. Cannot end with .", - "type": "string", - "pattern": "^[0-9a-zA-Z][0-9a-zA-Z-]*(-?[a-zA-Z]+|[a-zA-Z][0-9]+|-[0-9]{6,})$" - }, - "hidden": { - "title": "Hidden", - "description": "Boolean value or expression indicating if the component should be hidden. Defaults to false.", - "default": false, - "$ref": "expression.schema.v1.json#/definitions/boolean" - }, - "grid": { - "properties": { - "xs": { "$ref": "#/definitions/IGridSize" }, - "sm": { "$ref": "#/definitions/IGridSize" }, - "md": { "$ref": "#/definitions/IGridSize" }, - "lg": { "$ref": "#/definitions/IGridSize" }, - "xl": { "$ref": "#/definitions/IGridSize" }, - "labelGrid": { "$ref": "#/definitions/IGridStyling" }, - "innerGrid": { "$ref": "#/definitions/IGridStyling" } - } - }, - "pageBreak": { - "title": "Page break", - "description": "Optionally insert page-break before/after component when rendered in PDF", - "type": "object", - "properties": { - "breakBefore": { - "title": "Page break before", - "description": "PDF only: Value or expression indicating whether a page break should be added before the component. Can be either: 'auto' (default), 'always', or 'avoid'.", - "examples": ["auto", "always", "avoid"], - "default": "auto", - "$ref": "expression.schema.v1.json#/definitions/string" - }, - "breakAfter": { - "title": "Page break after", - "description": "PDF only: Value or expression indicating whether a page break should be added after the component. Can be either: 'auto' (default), 'always', or 'avoid'.", - "examples": ["auto", "always", "avoid"], - "default": "auto", - "$ref": "expression.schema.v1.json#/definitions/string" - } - }, - "additionalProperties": false - }, - "renderAsSummary": { - "title": "Render as summary", - "description": "Boolean value indicating if the component should be rendered as a summary. Defaults to false.", - "default": false, - "type": "boolean" - }, - "forceShowInSummary": { - "title": "Force show in summary", - "description": "Will force show the component in a summary even if hideEmptyFields is set to true in the summary component.", - "default": false, - "$ref": "expression.schema.v1.json#/definitions/boolean" - }, - "type": { "const": "AccordionGroup" }, - "textResourceBindings": { - "properties": { - "title": { - "title": "Title", - "description": "The title of the accordion group", - "$ref": "expression.schema.v1.json#/definitions/string" - }, - "summaryTitle": { - "title": "Summary title", - "description": "Title used in the summary view (overrides the default title)", - "$ref": "expression.schema.v1.json#/definitions/string" - }, - "summaryAccessibleTitle": { - "title": "Accessible summary title", - "description": "Title used for aria-label on the edit button in the summary view (overrides the default and summary title)", - "$ref": "expression.schema.v1.json#/definitions/string" - } - } - }, - "children": { - "title": "Children", - "description": "List of child component IDs to show inside the Accordion (limited to a few component types)", - "type": "array", - "items": { "type": "string" } - } - }, - "required": ["id", "type", "children"], - "title": "AccordionGroup component schema" -} +{"$id":"https://altinncdn.no/schemas/json/component/AccordionGroup.schema.v1.json","$schema":"http://json-schema.org/draft-07/schema#","properties":{"id":{"title":"ID","description":"The component ID. Must be unique within all layouts/pages in a layout-set. Cannot end with .","type":"string","pattern":"^[0-9a-zA-Z][0-9a-zA-Z-]*(-?[a-zA-Z]+|[a-zA-Z][0-9]+|-[0-9]{6,})$"},"hidden":{"title":"Hidden","description":"Boolean value or expression indicating if the component should be hidden. Defaults to false.","default":false,"$ref":"expression.schema.v1.json#/definitions/boolean"},"grid":{"properties":{"xs":{"$ref":"#/definitions/IGridSize"},"sm":{"$ref":"#/definitions/IGridSize"},"md":{"$ref":"#/definitions/IGridSize"},"lg":{"$ref":"#/definitions/IGridSize"},"xl":{"$ref":"#/definitions/IGridSize"},"labelGrid":{"$ref":"#/definitions/IGridStyling"},"innerGrid":{"$ref":"#/definitions/IGridStyling"}}},"pageBreak":{"title":"Page break","description":"Optionally insert page-break before/after component when rendered in PDF","type":"object","properties":{"breakBefore":{"title":"Page break before","description":"PDF only: Value or expression indicating whether a page break should be added before the component. Can be either: 'auto' (default), 'always', or 'avoid'.","examples":["auto","always","avoid"],"default":"auto","$ref":"expression.schema.v1.json#/definitions/string"},"breakAfter":{"title":"Page break after","description":"PDF only: Value or expression indicating whether a page break should be added after the component. Can be either: 'auto' (default), 'always', or 'avoid'.","examples":["auto","always","avoid"],"default":"auto","$ref":"expression.schema.v1.json#/definitions/string"}},"additionalProperties":false},"renderAsSummary":{"title":"Render as summary","description":"Boolean value indicating if the component should be rendered as a summary. Defaults to false.","default":false,"type":"boolean"},"forceShowInSummary":{"title":"Force show in summary","description":"Will force show the component in a summary even if hideEmptyFields is set to true in the summary component.","default":false,"$ref":"expression.schema.v1.json#/definitions/boolean"},"type":{"const":"AccordionGroup"},"textResourceBindings":{"properties":{"title":{"title":"Title","description":"The title of the accordion group","$ref":"expression.schema.v1.json#/definitions/string"},"summaryTitle":{"title":"Summary title","description":"Title used in the summary view (overrides the default title)","$ref":"expression.schema.v1.json#/definitions/string"},"summaryAccessibleTitle":{"title":"Accessible summary title","description":"Title used for aria-label on the edit button in the summary view (overrides the default and summary title)","$ref":"expression.schema.v1.json#/definitions/string"}}},"children":{"title":"Children","description":"List of child component IDs to show inside the Accordion (limited to a few component types)","type":"array","items":{"type":"string"}}},"required":["id","type","children"],"title":"AccordionGroup component schema"} \ No newline at end of file diff --git a/frontend/packages/ux-editor/src/testing/schemas/json/component/ActionButton.schema.v1.json b/frontend/packages/ux-editor/src/testing/schemas/json/component/ActionButton.schema.v1.json index 5821edef4f3..7c96220eae4 100644 --- a/frontend/packages/ux-editor/src/testing/schemas/json/component/ActionButton.schema.v1.json +++ b/frontend/packages/ux-editor/src/testing/schemas/json/component/ActionButton.schema.v1.json @@ -1,77 +1 @@ -{ - "$id": "https://altinncdn.no/schemas/json/component/ActionButton.schema.v1.json", - "$schema": "http://json-schema.org/draft-07/schema#", - "properties": { - "id": { - "title": "ID", - "description": "The component ID. Must be unique within all layouts/pages in a layout-set. Cannot end with .", - "type": "string", - "pattern": "^[0-9a-zA-Z][0-9a-zA-Z-]*(-?[a-zA-Z]+|[a-zA-Z][0-9]+|-[0-9]{6,})$" - }, - "hidden": { - "title": "Hidden", - "description": "Boolean value or expression indicating if the component should be hidden. Defaults to false.", - "default": false, - "$ref": "expression.schema.v1.json#/definitions/boolean" - }, - "grid": { - "properties": { - "xs": { "$ref": "#/definitions/IGridSize" }, - "sm": { "$ref": "#/definitions/IGridSize" }, - "md": { "$ref": "#/definitions/IGridSize" }, - "lg": { "$ref": "#/definitions/IGridSize" }, - "xl": { "$ref": "#/definitions/IGridSize" }, - "labelGrid": { "$ref": "#/definitions/IGridStyling" }, - "innerGrid": { "$ref": "#/definitions/IGridStyling" } - } - }, - "pageBreak": { - "title": "Page break", - "description": "Optionally insert page-break before/after component when rendered in PDF", - "type": "object", - "properties": { - "breakBefore": { - "title": "Page break before", - "description": "PDF only: Value or expression indicating whether a page break should be added before the component. Can be either: 'auto' (default), 'always', or 'avoid'.", - "examples": ["auto", "always", "avoid"], - "default": "auto", - "$ref": "expression.schema.v1.json#/definitions/string" - }, - "breakAfter": { - "title": "Page break after", - "description": "PDF only: Value or expression indicating whether a page break should be added after the component. Can be either: 'auto' (default), 'always', or 'avoid'.", - "examples": ["auto", "always", "avoid"], - "default": "auto", - "$ref": "expression.schema.v1.json#/definitions/string" - } - }, - "additionalProperties": false - }, - "type": { "const": "ActionButton" }, - "textResourceBindings": { - "type": "object", - "properties": { - "title": { - "title": "Button title/text", - "description": "The text to display on the button.", - "$ref": "expression.schema.v1.json#/definitions/string" - } - }, - "additionalProperties": false - }, - "action": { - "title": "Action", - "description": "The action to perform when the button is clicked.", - "enum": ["instantiate", "confirm", "sign", "reject"], - "type": "string" - }, - "buttonStyle": { - "title": "Button style", - "description": "The style/color scheme of the button.", - "enum": ["primary", "secondary"], - "type": "string" - } - }, - "required": ["id", "type", "action", "buttonStyle"], - "title": "ActionButton component schema" -} +{"$id":"https://altinncdn.no/schemas/json/component/ActionButton.schema.v1.json","$schema":"http://json-schema.org/draft-07/schema#","properties":{"id":{"title":"ID","description":"The component ID. Must be unique within all layouts/pages in a layout-set. Cannot end with .","type":"string","pattern":"^[0-9a-zA-Z][0-9a-zA-Z-]*(-?[a-zA-Z]+|[a-zA-Z][0-9]+|-[0-9]{6,})$"},"hidden":{"title":"Hidden","description":"Boolean value or expression indicating if the component should be hidden. Defaults to false.","default":false,"$ref":"expression.schema.v1.json#/definitions/boolean"},"grid":{"properties":{"xs":{"$ref":"#/definitions/IGridSize"},"sm":{"$ref":"#/definitions/IGridSize"},"md":{"$ref":"#/definitions/IGridSize"},"lg":{"$ref":"#/definitions/IGridSize"},"xl":{"$ref":"#/definitions/IGridSize"},"labelGrid":{"$ref":"#/definitions/IGridStyling"},"innerGrid":{"$ref":"#/definitions/IGridStyling"}}},"pageBreak":{"title":"Page break","description":"Optionally insert page-break before/after component when rendered in PDF","type":"object","properties":{"breakBefore":{"title":"Page break before","description":"PDF only: Value or expression indicating whether a page break should be added before the component. Can be either: 'auto' (default), 'always', or 'avoid'.","examples":["auto","always","avoid"],"default":"auto","$ref":"expression.schema.v1.json#/definitions/string"},"breakAfter":{"title":"Page break after","description":"PDF only: Value or expression indicating whether a page break should be added after the component. Can be either: 'auto' (default), 'always', or 'avoid'.","examples":["auto","always","avoid"],"default":"auto","$ref":"expression.schema.v1.json#/definitions/string"}},"additionalProperties":false},"type":{"const":"ActionButton"},"textResourceBindings":{"type":"object","properties":{"title":{"title":"Button title/text","description":"The text to display on the button.","$ref":"expression.schema.v1.json#/definitions/string"}},"additionalProperties":false},"action":{"title":"Action","description":"The action to perform when the button is clicked.","enum":["instantiate","confirm","sign","reject"],"type":"string"},"buttonStyle":{"title":"Button style","description":"The style/color scheme of the button.","enum":["primary","secondary"],"type":"string"}},"required":["id","type","action","buttonStyle"],"title":"ActionButton component schema"} \ No newline at end of file diff --git a/frontend/packages/ux-editor/src/testing/schemas/json/component/Address.schema.v1.json b/frontend/packages/ux-editor/src/testing/schemas/json/component/Address.schema.v1.json index 56453ff3bc5..85c2dc36246 100644 --- a/frontend/packages/ux-editor/src/testing/schemas/json/component/Address.schema.v1.json +++ b/frontend/packages/ux-editor/src/testing/schemas/json/component/Address.schema.v1.json @@ -1,186 +1 @@ -{ - "$id": "https://altinncdn.no/schemas/json/component/Address.schema.v1.json", - "$schema": "http://json-schema.org/draft-07/schema#", - "properties": { - "id": { - "title": "ID", - "description": "The component ID. Must be unique within all layouts/pages in a layout-set. Cannot end with .", - "type": "string", - "pattern": "^[0-9a-zA-Z][0-9a-zA-Z-]*(-?[a-zA-Z]+|[a-zA-Z][0-9]+|-[0-9]{6,})$" - }, - "hidden": { - "title": "Hidden", - "description": "Boolean value or expression indicating if the component should be hidden. Defaults to false.", - "default": false, - "$ref": "expression.schema.v1.json#/definitions/boolean" - }, - "grid": { - "properties": { - "xs": { "$ref": "#/definitions/IGridSize" }, - "sm": { "$ref": "#/definitions/IGridSize" }, - "md": { "$ref": "#/definitions/IGridSize" }, - "lg": { "$ref": "#/definitions/IGridSize" }, - "xl": { "$ref": "#/definitions/IGridSize" }, - "labelGrid": { "$ref": "#/definitions/IGridStyling" }, - "innerGrid": { "$ref": "#/definitions/IGridStyling" } - } - }, - "pageBreak": { - "title": "Page break", - "description": "Optionally insert page-break before/after component when rendered in PDF", - "type": "object", - "properties": { - "breakBefore": { - "title": "Page break before", - "description": "PDF only: Value or expression indicating whether a page break should be added before the component. Can be either: 'auto' (default), 'always', or 'avoid'.", - "examples": ["auto", "always", "avoid"], - "default": "auto", - "$ref": "expression.schema.v1.json#/definitions/string" - }, - "breakAfter": { - "title": "Page break after", - "description": "PDF only: Value or expression indicating whether a page break should be added after the component. Can be either: 'auto' (default), 'always', or 'avoid'.", - "examples": ["auto", "always", "avoid"], - "default": "auto", - "$ref": "expression.schema.v1.json#/definitions/string" - } - }, - "additionalProperties": false - }, - "readOnly": { - "title": "Read only/disabled?", - "description": "Boolean value or expression indicating if the component should be read only/disabled. Defaults to false.
Please note that even with read-only fields in components, it may currently be possible to update the field by modifying the request sent to the API or through a direct API call.", - "default": false, - "$ref": "expression.schema.v1.json#/definitions/boolean" - }, - "required": { - "title": "Required?", - "description": "Boolean value or expression indicating if the component should be required. Defaults to false.", - "default": false, - "$ref": "expression.schema.v1.json#/definitions/boolean" - }, - "showValidations": { - "title": "Validation types", - "description": "List of validation types to show", - "type": "array", - "items": { - "enum": [ - "Schema", - "Component", - "Expression", - "CustomBackend", - "Required", - "AllExceptRequired", - "All" - ], - "type": "string" - } - }, - "renderAsSummary": { - "title": "Render as summary", - "description": "Boolean value indicating if the component should be rendered as a summary. Defaults to false.", - "default": false, - "type": "boolean" - }, - "forceShowInSummary": { - "title": "Force show in summary", - "description": "Will force show the component in a summary even if hideEmptyFields is set to true in the summary component.", - "default": false, - "$ref": "expression.schema.v1.json#/definitions/boolean" - }, - "labelSettings": { - "title": "ILabelSettings", - "type": "object", - "properties": { - "optionalIndicator": { - "title": "Optional indicator", - "description": "Show optional indicator on label", - "type": "boolean" - } - }, - "additionalProperties": false - }, - "type": { "const": "Address" }, - "textResourceBindings": { - "properties": { - "title": { - "title": "Title", - "description": "Title of the component", - "$ref": "expression.schema.v1.json#/definitions/string" - }, - "tableTitle": { - "title": "Table title", - "description": "Title used in the table view (overrides the default title)", - "$ref": "expression.schema.v1.json#/definitions/string" - }, - "shortName": { - "title": "Short name (for validation)", - "description": "Alternative name used for required validation messages (overrides the default title)", - "$ref": "expression.schema.v1.json#/definitions/string" - }, - "requiredValidation": { - "title": "Required validation message", - "description": "Full validation message shown when the component is required and no value has been entered (overrides both the default and shortName)", - "$ref": "expression.schema.v1.json#/definitions/string" - }, - "summaryTitle": { - "title": "Summary title", - "description": "Title used in the summary view (overrides the default title)", - "$ref": "expression.schema.v1.json#/definitions/string" - }, - "summaryAccessibleTitle": { - "title": "Accessible summary title", - "description": "Title used for aria-label on the edit button in the summary view (overrides the default and summary title)", - "$ref": "expression.schema.v1.json#/definitions/string" - }, - "careOfTitle": { - "title": "Care Of Title", - "description": "Title for care-of", - "$ref": "expression.schema.v1.json#/definitions/string" - }, - "zipCodeTitle": { - "title": "Zip Code Title", - "description": "Title for the zip code", - "$ref": "expression.schema.v1.json#/definitions/string" - }, - "postPlaceTitle": { - "title": "Post place Title", - "description": "Title for post place", - "$ref": "expression.schema.v1.json#/definitions/string" - }, - "houseNumberTitle": { - "title": "House number Title", - "description": "Title for house number", - "$ref": "expression.schema.v1.json#/definitions/string" - } - } - }, - "dataModelBindings": { - "title": "IDataModelBindingsForAddress", - "type": "object", - "properties": { - "address": { "type": "string" }, - "zipCode": { "type": "string" }, - "postPlace": { "type": "string" }, - "careOf": { "type": "string" }, - "houseNumber": { "type": "string" } - }, - "required": ["address", "zipCode", "postPlace"], - "additionalProperties": false - }, - "saveWhileTyping": { - "title": "Automatic saving while typing", - "description": "Lets you control how long we wait before saving the value locally while typing. This value is usually also used to determine how long we wait before saving the value to the server. The default value is 400 milliseconds.", - "default": 400, - "type": "number" - }, - "simplified": { - "title": "Simplified", - "description": "Whether to use the simplified address input or not", - "default": true, - "type": "boolean" - } - }, - "required": ["id", "type", "dataModelBindings"], - "title": "Address component schema" -} +{"$id":"https://altinncdn.no/schemas/json/component/Address.schema.v1.json","$schema":"http://json-schema.org/draft-07/schema#","properties":{"id":{"title":"ID","description":"The component ID. Must be unique within all layouts/pages in a layout-set. Cannot end with .","type":"string","pattern":"^[0-9a-zA-Z][0-9a-zA-Z-]*(-?[a-zA-Z]+|[a-zA-Z][0-9]+|-[0-9]{6,})$"},"hidden":{"title":"Hidden","description":"Boolean value or expression indicating if the component should be hidden. Defaults to false.","default":false,"$ref":"expression.schema.v1.json#/definitions/boolean"},"grid":{"properties":{"xs":{"$ref":"#/definitions/IGridSize"},"sm":{"$ref":"#/definitions/IGridSize"},"md":{"$ref":"#/definitions/IGridSize"},"lg":{"$ref":"#/definitions/IGridSize"},"xl":{"$ref":"#/definitions/IGridSize"},"labelGrid":{"$ref":"#/definitions/IGridStyling"},"innerGrid":{"$ref":"#/definitions/IGridStyling"}}},"pageBreak":{"title":"Page break","description":"Optionally insert page-break before/after component when rendered in PDF","type":"object","properties":{"breakBefore":{"title":"Page break before","description":"PDF only: Value or expression indicating whether a page break should be added before the component. Can be either: 'auto' (default), 'always', or 'avoid'.","examples":["auto","always","avoid"],"default":"auto","$ref":"expression.schema.v1.json#/definitions/string"},"breakAfter":{"title":"Page break after","description":"PDF only: Value or expression indicating whether a page break should be added after the component. Can be either: 'auto' (default), 'always', or 'avoid'.","examples":["auto","always","avoid"],"default":"auto","$ref":"expression.schema.v1.json#/definitions/string"}},"additionalProperties":false},"readOnly":{"title":"Read only/disabled?","description":"Boolean value or expression indicating if the component should be read only/disabled. Defaults to false.
Please note that even with read-only fields in components, it may currently be possible to update the field by modifying the request sent to the API or through a direct API call.","default":false,"$ref":"expression.schema.v1.json#/definitions/boolean"},"required":{"title":"Required?","description":"Boolean value or expression indicating if the component should be required. Defaults to false.","default":false,"$ref":"expression.schema.v1.json#/definitions/boolean"},"showValidations":{"title":"Validation types","description":"List of validation types to show","type":"array","items":{"enum":["Schema","Component","Expression","CustomBackend","Required","AllExceptRequired","All"],"type":"string"}},"renderAsSummary":{"title":"Render as summary","description":"Boolean value indicating if the component should be rendered as a summary. Defaults to false.","default":false,"type":"boolean"},"forceShowInSummary":{"title":"Force show in summary","description":"Will force show the component in a summary even if hideEmptyFields is set to true in the summary component.","default":false,"$ref":"expression.schema.v1.json#/definitions/boolean"},"labelSettings":{"title":"ILabelSettings","type":"object","properties":{"optionalIndicator":{"title":"Optional indicator","description":"Show optional indicator on label","type":"boolean"}},"additionalProperties":false},"type":{"const":"Address"},"textResourceBindings":{"properties":{"title":{"title":"Title","description":"Title of the component","$ref":"expression.schema.v1.json#/definitions/string"},"tableTitle":{"title":"Table title","description":"Title used in the table view (overrides the default title)","$ref":"expression.schema.v1.json#/definitions/string"},"shortName":{"title":"Short name (for validation)","description":"Alternative name used for required validation messages (overrides the default title)","$ref":"expression.schema.v1.json#/definitions/string"},"requiredValidation":{"title":"Required validation message","description":"Full validation message shown when the component is required and no value has been entered (overrides both the default and shortName)","$ref":"expression.schema.v1.json#/definitions/string"},"summaryTitle":{"title":"Summary title","description":"Title used in the summary view (overrides the default title)","$ref":"expression.schema.v1.json#/definitions/string"},"summaryAccessibleTitle":{"title":"Accessible summary title","description":"Title used for aria-label on the edit button in the summary view (overrides the default and summary title)","$ref":"expression.schema.v1.json#/definitions/string"},"careOfTitle":{"title":"Care Of Title","description":"Title for care-of","$ref":"expression.schema.v1.json#/definitions/string"},"zipCodeTitle":{"title":"Zip Code Title","description":"Title for the zip code","$ref":"expression.schema.v1.json#/definitions/string"},"postPlaceTitle":{"title":"Post place Title","description":"Title for post place","$ref":"expression.schema.v1.json#/definitions/string"},"houseNumberTitle":{"title":"House number Title","description":"Title for house number","$ref":"expression.schema.v1.json#/definitions/string"}}},"dataModelBindings":{"title":"IDataModelBindingsForAddress","type":"object","properties":{"address":{"type":"string"},"zipCode":{"type":"string"},"postPlace":{"type":"string"},"careOf":{"type":"string"},"houseNumber":{"type":"string"}},"required":["address","zipCode","postPlace"],"additionalProperties":false},"saveWhileTyping":{"title":"Automatic saving while typing","description":"Lets you control how long we wait before saving the value locally while typing. This value is usually also used to determine how long we wait before saving the value to the server. The default value is 400 milliseconds.","default":400,"type":"number"},"simplified":{"title":"Simplified","description":"Whether to use the simplified address input or not","default":true,"type":"boolean"}},"required":["id","type","dataModelBindings"],"title":"Address component schema"} \ No newline at end of file diff --git a/frontend/packages/ux-editor/src/testing/schemas/json/component/Alert.schema.v1.json b/frontend/packages/ux-editor/src/testing/schemas/json/component/Alert.schema.v1.json index 7b30e018ef7..8efd084e7e5 100644 --- a/frontend/packages/ux-editor/src/testing/schemas/json/component/Alert.schema.v1.json +++ b/frontend/packages/ux-editor/src/testing/schemas/json/component/Alert.schema.v1.json @@ -1,76 +1 @@ -{ - "$id": "https://altinncdn.no/schemas/json/component/Alert.schema.v1.json", - "$schema": "http://json-schema.org/draft-07/schema#", - "properties": { - "id": { - "title": "ID", - "description": "The component ID. Must be unique within all layouts/pages in a layout-set. Cannot end with .", - "type": "string", - "pattern": "^[0-9a-zA-Z][0-9a-zA-Z-]*(-?[a-zA-Z]+|[a-zA-Z][0-9]+|-[0-9]{6,})$" - }, - "hidden": { - "title": "Hidden", - "description": "Boolean value or expression indicating if the component should be hidden. Defaults to false.", - "default": false, - "$ref": "expression.schema.v1.json#/definitions/boolean" - }, - "grid": { - "properties": { - "xs": { "$ref": "#/definitions/IGridSize" }, - "sm": { "$ref": "#/definitions/IGridSize" }, - "md": { "$ref": "#/definitions/IGridSize" }, - "lg": { "$ref": "#/definitions/IGridSize" }, - "xl": { "$ref": "#/definitions/IGridSize" }, - "labelGrid": { "$ref": "#/definitions/IGridStyling" }, - "innerGrid": { "$ref": "#/definitions/IGridStyling" } - } - }, - "pageBreak": { - "title": "Page break", - "description": "Optionally insert page-break before/after component when rendered in PDF", - "type": "object", - "properties": { - "breakBefore": { - "title": "Page break before", - "description": "PDF only: Value or expression indicating whether a page break should be added before the component. Can be either: 'auto' (default), 'always', or 'avoid'.", - "examples": ["auto", "always", "avoid"], - "default": "auto", - "$ref": "expression.schema.v1.json#/definitions/string" - }, - "breakAfter": { - "title": "Page break after", - "description": "PDF only: Value or expression indicating whether a page break should be added after the component. Can be either: 'auto' (default), 'always', or 'avoid'.", - "examples": ["auto", "always", "avoid"], - "default": "auto", - "$ref": "expression.schema.v1.json#/definitions/string" - } - }, - "additionalProperties": false - }, - "type": { "const": "Alert" }, - "textResourceBindings": { - "type": "object", - "properties": { - "title": { - "title": "Title", - "description": "The title of the alert", - "$ref": "expression.schema.v1.json#/definitions/string" - }, - "body": { - "title": "Body", - "description": "The body text of the alert", - "$ref": "expression.schema.v1.json#/definitions/string" - } - }, - "additionalProperties": false - }, - "severity": { - "title": "Alert severity", - "description": "The severity of the alert", - "enum": ["success", "warning", "danger", "info"], - "type": "string" - } - }, - "required": ["id", "type", "severity"], - "title": "Alert component schema" -} +{"$id":"https://altinncdn.no/schemas/json/component/Alert.schema.v1.json","$schema":"http://json-schema.org/draft-07/schema#","properties":{"id":{"title":"ID","description":"The component ID. Must be unique within all layouts/pages in a layout-set. Cannot end with .","type":"string","pattern":"^[0-9a-zA-Z][0-9a-zA-Z-]*(-?[a-zA-Z]+|[a-zA-Z][0-9]+|-[0-9]{6,})$"},"hidden":{"title":"Hidden","description":"Boolean value or expression indicating if the component should be hidden. Defaults to false.","default":false,"$ref":"expression.schema.v1.json#/definitions/boolean"},"grid":{"properties":{"xs":{"$ref":"#/definitions/IGridSize"},"sm":{"$ref":"#/definitions/IGridSize"},"md":{"$ref":"#/definitions/IGridSize"},"lg":{"$ref":"#/definitions/IGridSize"},"xl":{"$ref":"#/definitions/IGridSize"},"labelGrid":{"$ref":"#/definitions/IGridStyling"},"innerGrid":{"$ref":"#/definitions/IGridStyling"}}},"pageBreak":{"title":"Page break","description":"Optionally insert page-break before/after component when rendered in PDF","type":"object","properties":{"breakBefore":{"title":"Page break before","description":"PDF only: Value or expression indicating whether a page break should be added before the component. Can be either: 'auto' (default), 'always', or 'avoid'.","examples":["auto","always","avoid"],"default":"auto","$ref":"expression.schema.v1.json#/definitions/string"},"breakAfter":{"title":"Page break after","description":"PDF only: Value or expression indicating whether a page break should be added after the component. Can be either: 'auto' (default), 'always', or 'avoid'.","examples":["auto","always","avoid"],"default":"auto","$ref":"expression.schema.v1.json#/definitions/string"}},"additionalProperties":false},"type":{"const":"Alert"},"textResourceBindings":{"type":"object","properties":{"title":{"title":"Title","description":"The title of the alert","$ref":"expression.schema.v1.json#/definitions/string"},"body":{"title":"Body","description":"The body text of the alert","$ref":"expression.schema.v1.json#/definitions/string"}},"additionalProperties":false},"severity":{"title":"Alert severity","description":"The severity of the alert","enum":["success","warning","danger","info"],"type":"string"}},"required":["id","type","severity"],"title":"Alert component schema"} \ No newline at end of file diff --git a/frontend/packages/ux-editor/src/testing/schemas/json/component/AttachmentList.schema.v1.json b/frontend/packages/ux-editor/src/testing/schemas/json/component/AttachmentList.schema.v1.json index f98e09d8834..85958543256 100644 --- a/frontend/packages/ux-editor/src/testing/schemas/json/component/AttachmentList.schema.v1.json +++ b/frontend/packages/ux-editor/src/testing/schemas/json/component/AttachmentList.schema.v1.json @@ -1,71 +1 @@ -{ - "$id": "https://altinncdn.no/schemas/json/component/AttachmentList.schema.v1.json", - "$schema": "http://json-schema.org/draft-07/schema#", - "properties": { - "id": { - "title": "ID", - "description": "The component ID. Must be unique within all layouts/pages in a layout-set. Cannot end with .", - "type": "string", - "pattern": "^[0-9a-zA-Z][0-9a-zA-Z-]*(-?[a-zA-Z]+|[a-zA-Z][0-9]+|-[0-9]{6,})$" - }, - "hidden": { - "title": "Hidden", - "description": "Boolean value or expression indicating if the component should be hidden. Defaults to false.", - "default": false, - "$ref": "expression.schema.v1.json#/definitions/boolean" - }, - "grid": { - "properties": { - "xs": { "$ref": "#/definitions/IGridSize" }, - "sm": { "$ref": "#/definitions/IGridSize" }, - "md": { "$ref": "#/definitions/IGridSize" }, - "lg": { "$ref": "#/definitions/IGridSize" }, - "xl": { "$ref": "#/definitions/IGridSize" }, - "labelGrid": { "$ref": "#/definitions/IGridStyling" }, - "innerGrid": { "$ref": "#/definitions/IGridStyling" } - } - }, - "pageBreak": { - "title": "Page break", - "description": "Optionally insert page-break before/after component when rendered in PDF", - "type": "object", - "properties": { - "breakBefore": { - "title": "Page break before", - "description": "PDF only: Value or expression indicating whether a page break should be added before the component. Can be either: 'auto' (default), 'always', or 'avoid'.", - "examples": ["auto", "always", "avoid"], - "default": "auto", - "$ref": "expression.schema.v1.json#/definitions/string" - }, - "breakAfter": { - "title": "Page break after", - "description": "PDF only: Value or expression indicating whether a page break should be added after the component. Can be either: 'auto' (default), 'always', or 'avoid'.", - "examples": ["auto", "always", "avoid"], - "default": "auto", - "$ref": "expression.schema.v1.json#/definitions/string" - } - }, - "additionalProperties": false - }, - "type": { "const": "AttachmentList" }, - "textResourceBindings": { - "type": "object", - "properties": { - "title": { - "title": "Title", - "description": "Title shown above the attachment list", - "$ref": "expression.schema.v1.json#/definitions/string" - } - }, - "additionalProperties": false - }, - "dataTypeIds": { - "title": "Data type IDs", - "description": "List of data type IDs for the attachment list to show", - "type": "array", - "items": { "type": "string" } - } - }, - "required": ["id", "type"], - "title": "AttachmentList component schema" -} +{"$id":"https://altinncdn.no/schemas/json/component/AttachmentList.schema.v1.json","$schema":"http://json-schema.org/draft-07/schema#","properties":{"id":{"title":"ID","description":"The component ID. Must be unique within all layouts/pages in a layout-set. Cannot end with .","type":"string","pattern":"^[0-9a-zA-Z][0-9a-zA-Z-]*(-?[a-zA-Z]+|[a-zA-Z][0-9]+|-[0-9]{6,})$"},"hidden":{"title":"Hidden","description":"Boolean value or expression indicating if the component should be hidden. Defaults to false.","default":false,"$ref":"expression.schema.v1.json#/definitions/boolean"},"grid":{"properties":{"xs":{"$ref":"#/definitions/IGridSize"},"sm":{"$ref":"#/definitions/IGridSize"},"md":{"$ref":"#/definitions/IGridSize"},"lg":{"$ref":"#/definitions/IGridSize"},"xl":{"$ref":"#/definitions/IGridSize"},"labelGrid":{"$ref":"#/definitions/IGridStyling"},"innerGrid":{"$ref":"#/definitions/IGridStyling"}}},"pageBreak":{"title":"Page break","description":"Optionally insert page-break before/after component when rendered in PDF","type":"object","properties":{"breakBefore":{"title":"Page break before","description":"PDF only: Value or expression indicating whether a page break should be added before the component. Can be either: 'auto' (default), 'always', or 'avoid'.","examples":["auto","always","avoid"],"default":"auto","$ref":"expression.schema.v1.json#/definitions/string"},"breakAfter":{"title":"Page break after","description":"PDF only: Value or expression indicating whether a page break should be added after the component. Can be either: 'auto' (default), 'always', or 'avoid'.","examples":["auto","always","avoid"],"default":"auto","$ref":"expression.schema.v1.json#/definitions/string"}},"additionalProperties":false},"type":{"const":"AttachmentList"},"textResourceBindings":{"type":"object","properties":{"title":{"title":"Title","description":"Title shown above the attachment list","$ref":"expression.schema.v1.json#/definitions/string"}},"additionalProperties":false},"dataTypeIds":{"title":"Data type IDs","description":"List of data type IDs for the attachment list to show","type":"array","items":{"type":"string"}}},"required":["id","type"],"title":"AttachmentList component schema"} \ No newline at end of file diff --git a/frontend/packages/ux-editor/src/testing/schemas/json/component/Audio.schema.v1.json b/frontend/packages/ux-editor/src/testing/schemas/json/component/Audio.schema.v1.json index 96ce7ee32ff..404f47fdb08 100644 --- a/frontend/packages/ux-editor/src/testing/schemas/json/component/Audio.schema.v1.json +++ b/frontend/packages/ux-editor/src/testing/schemas/json/component/Audio.schema.v1.json @@ -1,72 +1 @@ -{ - "$id": "https://altinncdn.no/schemas/json/component/Audio.schema.v1.json", - "$schema": "http://json-schema.org/draft-07/schema#", - "properties": { - "id": { - "title": "ID", - "description": "The component ID. Must be unique within all layouts/pages in a layout-set. Cannot end with .", - "type": "string", - "pattern": "^[0-9a-zA-Z][0-9a-zA-Z-]*(-?[a-zA-Z]+|[a-zA-Z][0-9]+|-[0-9]{6,})$" - }, - "hidden": { - "title": "Hidden", - "description": "Boolean value or expression indicating if the component should be hidden. Defaults to false.", - "default": false, - "$ref": "expression.schema.v1.json#/definitions/boolean" - }, - "grid": { - "properties": { - "xs": { "$ref": "#/definitions/IGridSize" }, - "sm": { "$ref": "#/definitions/IGridSize" }, - "md": { "$ref": "#/definitions/IGridSize" }, - "lg": { "$ref": "#/definitions/IGridSize" }, - "xl": { "$ref": "#/definitions/IGridSize" }, - "labelGrid": { "$ref": "#/definitions/IGridStyling" }, - "innerGrid": { "$ref": "#/definitions/IGridStyling" } - } - }, - "pageBreak": { - "title": "Page break", - "description": "Optionally insert page-break before/after component when rendered in PDF", - "type": "object", - "properties": { - "breakBefore": { - "title": "Page break before", - "description": "PDF only: Value or expression indicating whether a page break should be added before the component. Can be either: 'auto' (default), 'always', or 'avoid'.", - "examples": ["auto", "always", "avoid"], - "default": "auto", - "$ref": "expression.schema.v1.json#/definitions/string" - }, - "breakAfter": { - "title": "Page break after", - "description": "PDF only: Value or expression indicating whether a page break should be added after the component. Can be either: 'auto' (default), 'always', or 'avoid'.", - "examples": ["auto", "always", "avoid"], - "default": "auto", - "$ref": "expression.schema.v1.json#/definitions/string" - } - }, - "additionalProperties": false - }, - "type": { "const": "Audio" }, - "textResourceBindings": { - "type": "object", - "properties": { - "altText": { - "title": "Alt text", - "description": "Alternative text for the audio (for screen readers).", - "$ref": "expression.schema.v1.json#/definitions/string" - } - }, - "additionalProperties": false - }, - "audio": { - "title": "IAudio", - "type": "object", - "properties": { "src": { "$ref": "#/definitions/AudioSrc" } }, - "required": ["src"], - "additionalProperties": false - } - }, - "required": ["id", "type"], - "title": "Audio component schema" -} +{"$id":"https://altinncdn.no/schemas/json/component/Audio.schema.v1.json","$schema":"http://json-schema.org/draft-07/schema#","properties":{"id":{"title":"ID","description":"The component ID. Must be unique within all layouts/pages in a layout-set. Cannot end with .","type":"string","pattern":"^[0-9a-zA-Z][0-9a-zA-Z-]*(-?[a-zA-Z]+|[a-zA-Z][0-9]+|-[0-9]{6,})$"},"hidden":{"title":"Hidden","description":"Boolean value or expression indicating if the component should be hidden. Defaults to false.","default":false,"$ref":"expression.schema.v1.json#/definitions/boolean"},"grid":{"properties":{"xs":{"$ref":"#/definitions/IGridSize"},"sm":{"$ref":"#/definitions/IGridSize"},"md":{"$ref":"#/definitions/IGridSize"},"lg":{"$ref":"#/definitions/IGridSize"},"xl":{"$ref":"#/definitions/IGridSize"},"labelGrid":{"$ref":"#/definitions/IGridStyling"},"innerGrid":{"$ref":"#/definitions/IGridStyling"}}},"pageBreak":{"title":"Page break","description":"Optionally insert page-break before/after component when rendered in PDF","type":"object","properties":{"breakBefore":{"title":"Page break before","description":"PDF only: Value or expression indicating whether a page break should be added before the component. Can be either: 'auto' (default), 'always', or 'avoid'.","examples":["auto","always","avoid"],"default":"auto","$ref":"expression.schema.v1.json#/definitions/string"},"breakAfter":{"title":"Page break after","description":"PDF only: Value or expression indicating whether a page break should be added after the component. Can be either: 'auto' (default), 'always', or 'avoid'.","examples":["auto","always","avoid"],"default":"auto","$ref":"expression.schema.v1.json#/definitions/string"}},"additionalProperties":false},"type":{"const":"Audio"},"textResourceBindings":{"type":"object","properties":{"altText":{"title":"Alt text","description":"Alternative text for the audio (for screen readers).","$ref":"expression.schema.v1.json#/definitions/string"}},"additionalProperties":false},"audio":{"title":"IAudio","type":"object","properties":{"src":{"$ref":"#/definitions/AudioSrc"}},"required":["src"],"additionalProperties":false}},"required":["id","type"],"title":"Audio component schema"} \ No newline at end of file diff --git a/frontend/packages/ux-editor/src/testing/schemas/json/component/Button.schema.v1.json b/frontend/packages/ux-editor/src/testing/schemas/json/component/Button.schema.v1.json index da68744a360..6d954d7ca2f 100644 --- a/frontend/packages/ux-editor/src/testing/schemas/json/component/Button.schema.v1.json +++ b/frontend/packages/ux-editor/src/testing/schemas/json/component/Button.schema.v1.json @@ -1,79 +1 @@ -{ - "$id": "https://altinncdn.no/schemas/json/component/Button.schema.v1.json", - "$schema": "http://json-schema.org/draft-07/schema#", - "properties": { - "id": { - "title": "ID", - "description": "The component ID. Must be unique within all layouts/pages in a layout-set. Cannot end with .", - "type": "string", - "pattern": "^[0-9a-zA-Z][0-9a-zA-Z-]*(-?[a-zA-Z]+|[a-zA-Z][0-9]+|-[0-9]{6,})$" - }, - "hidden": { - "title": "Hidden", - "description": "Boolean value or expression indicating if the component should be hidden. Defaults to false.", - "default": false, - "$ref": "expression.schema.v1.json#/definitions/boolean" - }, - "grid": { - "properties": { - "xs": { "$ref": "#/definitions/IGridSize" }, - "sm": { "$ref": "#/definitions/IGridSize" }, - "md": { "$ref": "#/definitions/IGridSize" }, - "lg": { "$ref": "#/definitions/IGridSize" }, - "xl": { "$ref": "#/definitions/IGridSize" }, - "labelGrid": { "$ref": "#/definitions/IGridStyling" }, - "innerGrid": { "$ref": "#/definitions/IGridStyling" } - } - }, - "pageBreak": { - "title": "Page break", - "description": "Optionally insert page-break before/after component when rendered in PDF", - "type": "object", - "properties": { - "breakBefore": { - "title": "Page break before", - "description": "PDF only: Value or expression indicating whether a page break should be added before the component. Can be either: 'auto' (default), 'always', or 'avoid'.", - "examples": ["auto", "always", "avoid"], - "default": "auto", - "$ref": "expression.schema.v1.json#/definitions/string" - }, - "breakAfter": { - "title": "Page break after", - "description": "PDF only: Value or expression indicating whether a page break should be added after the component. Can be either: 'auto' (default), 'always', or 'avoid'.", - "examples": ["auto", "always", "avoid"], - "default": "auto", - "$ref": "expression.schema.v1.json#/definitions/string" - } - }, - "additionalProperties": false - }, - "type": { "const": "Button" }, - "textResourceBindings": { - "type": "object", - "properties": { - "title": { - "title": "Title", - "description": "The title/text on the button", - "$ref": "expression.schema.v1.json#/definitions/string" - } - }, - "additionalProperties": false - }, - "mode": { - "title": "Mode", - "description": "The mode of the button", - "default": "submit", - "enum": ["submit", "save", "instantiate"], - "type": "string" - }, - "mapping": { - "title": "Mapping", - "description": "A mapping of key-value pairs (usually used for mapping a path in the data model to a query string parameter).", - "type": "object", - "properties": {}, - "additionalProperties": { "type": "string" } - } - }, - "required": ["id", "type"], - "title": "Button component schema" -} +{"$id":"https://altinncdn.no/schemas/json/component/Button.schema.v1.json","$schema":"http://json-schema.org/draft-07/schema#","properties":{"id":{"title":"ID","description":"The component ID. Must be unique within all layouts/pages in a layout-set. Cannot end with .","type":"string","pattern":"^[0-9a-zA-Z][0-9a-zA-Z-]*(-?[a-zA-Z]+|[a-zA-Z][0-9]+|-[0-9]{6,})$"},"hidden":{"title":"Hidden","description":"Boolean value or expression indicating if the component should be hidden. Defaults to false.","default":false,"$ref":"expression.schema.v1.json#/definitions/boolean"},"grid":{"properties":{"xs":{"$ref":"#/definitions/IGridSize"},"sm":{"$ref":"#/definitions/IGridSize"},"md":{"$ref":"#/definitions/IGridSize"},"lg":{"$ref":"#/definitions/IGridSize"},"xl":{"$ref":"#/definitions/IGridSize"},"labelGrid":{"$ref":"#/definitions/IGridStyling"},"innerGrid":{"$ref":"#/definitions/IGridStyling"}}},"pageBreak":{"title":"Page break","description":"Optionally insert page-break before/after component when rendered in PDF","type":"object","properties":{"breakBefore":{"title":"Page break before","description":"PDF only: Value or expression indicating whether a page break should be added before the component. Can be either: 'auto' (default), 'always', or 'avoid'.","examples":["auto","always","avoid"],"default":"auto","$ref":"expression.schema.v1.json#/definitions/string"},"breakAfter":{"title":"Page break after","description":"PDF only: Value or expression indicating whether a page break should be added after the component. Can be either: 'auto' (default), 'always', or 'avoid'.","examples":["auto","always","avoid"],"default":"auto","$ref":"expression.schema.v1.json#/definitions/string"}},"additionalProperties":false},"type":{"const":"Button"},"textResourceBindings":{"type":"object","properties":{"title":{"title":"Title","description":"The title/text on the button","$ref":"expression.schema.v1.json#/definitions/string"}},"additionalProperties":false},"mode":{"title":"Mode","description":"The mode of the button","default":"submit","enum":["submit","save","instantiate"],"type":"string"},"mapping":{"title":"Mapping","description":"A mapping of key-value pairs (usually used for mapping a path in the data model to a query string parameter).","type":"object","properties":{},"additionalProperties":{"type":"string"}}},"required":["id","type"],"title":"Button component schema"} \ No newline at end of file diff --git a/frontend/packages/ux-editor/src/testing/schemas/json/component/ButtonGroup.schema.v1.json b/frontend/packages/ux-editor/src/testing/schemas/json/component/ButtonGroup.schema.v1.json index f84b2537b94..0ecb90014c9 100644 --- a/frontend/packages/ux-editor/src/testing/schemas/json/component/ButtonGroup.schema.v1.json +++ b/frontend/packages/ux-editor/src/testing/schemas/json/component/ButtonGroup.schema.v1.json @@ -1,113 +1 @@ -{ - "$id": "https://altinncdn.no/schemas/json/component/ButtonGroup.schema.v1.json", - "$schema": "http://json-schema.org/draft-07/schema#", - "properties": { - "id": { - "title": "ID", - "description": "The component ID. Must be unique within all layouts/pages in a layout-set. Cannot end with .", - "type": "string", - "pattern": "^[0-9a-zA-Z][0-9a-zA-Z-]*(-?[a-zA-Z]+|[a-zA-Z][0-9]+|-[0-9]{6,})$" - }, - "hidden": { - "title": "Hidden", - "description": "Boolean value or expression indicating if the component should be hidden. Defaults to false.", - "default": false, - "$ref": "expression.schema.v1.json#/definitions/boolean" - }, - "grid": { - "properties": { - "xs": { "$ref": "#/definitions/IGridSize" }, - "sm": { "$ref": "#/definitions/IGridSize" }, - "md": { "$ref": "#/definitions/IGridSize" }, - "lg": { "$ref": "#/definitions/IGridSize" }, - "xl": { "$ref": "#/definitions/IGridSize" }, - "labelGrid": { "$ref": "#/definitions/IGridStyling" }, - "innerGrid": { "$ref": "#/definitions/IGridStyling" } - } - }, - "pageBreak": { - "title": "Page break", - "description": "Optionally insert page-break before/after component when rendered in PDF", - "type": "object", - "properties": { - "breakBefore": { - "title": "Page break before", - "description": "PDF only: Value or expression indicating whether a page break should be added before the component. Can be either: 'auto' (default), 'always', or 'avoid'.", - "examples": ["auto", "always", "avoid"], - "default": "auto", - "$ref": "expression.schema.v1.json#/definitions/string" - }, - "breakAfter": { - "title": "Page break after", - "description": "PDF only: Value or expression indicating whether a page break should be added after the component. Can be either: 'auto' (default), 'always', or 'avoid'.", - "examples": ["auto", "always", "avoid"], - "default": "auto", - "$ref": "expression.schema.v1.json#/definitions/string" - } - }, - "additionalProperties": false - }, - "renderAsSummary": { - "title": "Render as summary", - "description": "Boolean value indicating if the component should be rendered as a summary. Defaults to false.", - "default": false, - "type": "boolean" - }, - "forceShowInSummary": { - "title": "Force show in summary", - "description": "Will force show the component in a summary even if hideEmptyFields is set to true in the summary component.", - "default": false, - "$ref": "expression.schema.v1.json#/definitions/boolean" - }, - "labelSettings": { - "title": "ILabelSettings", - "type": "object", - "properties": { - "optionalIndicator": { - "title": "Optional indicator", - "description": "Show optional indicator on label", - "type": "boolean" - } - }, - "additionalProperties": false - }, - "type": { "const": "ButtonGroup" }, - "textResourceBindings": { - "properties": { - "title": { - "title": "Title", - "description": "Label text/title shown above the component", - "$ref": "expression.schema.v1.json#/definitions/string" - }, - "description": { - "title": "Description", - "description": "Label description shown above the component, below the title", - "$ref": "expression.schema.v1.json#/definitions/string" - }, - "help": { - "title": "Help text", - "description": "Help text shown in a tooltip when clicking the help button", - "$ref": "expression.schema.v1.json#/definitions/string" - }, - "summaryTitle": { - "title": "Summary title", - "description": "Title used in the summary view (overrides the default title)", - "$ref": "expression.schema.v1.json#/definitions/string" - }, - "summaryAccessibleTitle": { - "title": "Accessible summary title", - "description": "Title used for aria-label on the edit button in the summary view (overrides the default and summary title)", - "$ref": "expression.schema.v1.json#/definitions/string" - } - } - }, - "children": { - "title": "Children", - "description": "Child component IDs of button-like components to be rendered in this group", - "type": "array", - "items": { "type": "string" } - } - }, - "required": ["id", "type", "children"], - "title": "ButtonGroup component schema" -} +{"$id":"https://altinncdn.no/schemas/json/component/ButtonGroup.schema.v1.json","$schema":"http://json-schema.org/draft-07/schema#","properties":{"id":{"title":"ID","description":"The component ID. Must be unique within all layouts/pages in a layout-set. Cannot end with .","type":"string","pattern":"^[0-9a-zA-Z][0-9a-zA-Z-]*(-?[a-zA-Z]+|[a-zA-Z][0-9]+|-[0-9]{6,})$"},"hidden":{"title":"Hidden","description":"Boolean value or expression indicating if the component should be hidden. Defaults to false.","default":false,"$ref":"expression.schema.v1.json#/definitions/boolean"},"grid":{"properties":{"xs":{"$ref":"#/definitions/IGridSize"},"sm":{"$ref":"#/definitions/IGridSize"},"md":{"$ref":"#/definitions/IGridSize"},"lg":{"$ref":"#/definitions/IGridSize"},"xl":{"$ref":"#/definitions/IGridSize"},"labelGrid":{"$ref":"#/definitions/IGridStyling"},"innerGrid":{"$ref":"#/definitions/IGridStyling"}}},"pageBreak":{"title":"Page break","description":"Optionally insert page-break before/after component when rendered in PDF","type":"object","properties":{"breakBefore":{"title":"Page break before","description":"PDF only: Value or expression indicating whether a page break should be added before the component. Can be either: 'auto' (default), 'always', or 'avoid'.","examples":["auto","always","avoid"],"default":"auto","$ref":"expression.schema.v1.json#/definitions/string"},"breakAfter":{"title":"Page break after","description":"PDF only: Value or expression indicating whether a page break should be added after the component. Can be either: 'auto' (default), 'always', or 'avoid'.","examples":["auto","always","avoid"],"default":"auto","$ref":"expression.schema.v1.json#/definitions/string"}},"additionalProperties":false},"renderAsSummary":{"title":"Render as summary","description":"Boolean value indicating if the component should be rendered as a summary. Defaults to false.","default":false,"type":"boolean"},"forceShowInSummary":{"title":"Force show in summary","description":"Will force show the component in a summary even if hideEmptyFields is set to true in the summary component.","default":false,"$ref":"expression.schema.v1.json#/definitions/boolean"},"labelSettings":{"title":"ILabelSettings","type":"object","properties":{"optionalIndicator":{"title":"Optional indicator","description":"Show optional indicator on label","type":"boolean"}},"additionalProperties":false},"type":{"const":"ButtonGroup"},"textResourceBindings":{"properties":{"title":{"title":"Title","description":"Label text/title shown above the component","$ref":"expression.schema.v1.json#/definitions/string"},"description":{"title":"Description","description":"Label description shown above the component, below the title","$ref":"expression.schema.v1.json#/definitions/string"},"help":{"title":"Help text","description":"Help text shown in a tooltip when clicking the help button","$ref":"expression.schema.v1.json#/definitions/string"},"summaryTitle":{"title":"Summary title","description":"Title used in the summary view (overrides the default title)","$ref":"expression.schema.v1.json#/definitions/string"},"summaryAccessibleTitle":{"title":"Accessible summary title","description":"Title used for aria-label on the edit button in the summary view (overrides the default and summary title)","$ref":"expression.schema.v1.json#/definitions/string"}}},"children":{"title":"Children","description":"Child component IDs of button-like components to be rendered in this group","type":"array","items":{"type":"string"}}},"required":["id","type","children"],"title":"ButtonGroup component schema"} \ No newline at end of file diff --git a/frontend/packages/ux-editor/src/testing/schemas/json/component/Cards.schema.v1.json b/frontend/packages/ux-editor/src/testing/schemas/json/component/Cards.schema.v1.json index 3b89dc79b26..44558d642c0 100644 --- a/frontend/packages/ux-editor/src/testing/schemas/json/component/Cards.schema.v1.json +++ b/frontend/packages/ux-editor/src/testing/schemas/json/component/Cards.schema.v1.json @@ -1,142 +1 @@ -{ - "$id": "https://altinncdn.no/schemas/json/component/Cards.schema.v1.json", - "$schema": "http://json-schema.org/draft-07/schema#", - "properties": { - "id": { - "title": "ID", - "description": "The component ID. Must be unique within all layouts/pages in a layout-set. Cannot end with .", - "type": "string", - "pattern": "^[0-9a-zA-Z][0-9a-zA-Z-]*(-?[a-zA-Z]+|[a-zA-Z][0-9]+|-[0-9]{6,})$" - }, - "hidden": { - "title": "Hidden", - "description": "Boolean value or expression indicating if the component should be hidden. Defaults to false.", - "default": false, - "$ref": "expression.schema.v1.json#/definitions/boolean" - }, - "grid": { - "properties": { - "xs": { "$ref": "#/definitions/IGridSize" }, - "sm": { "$ref": "#/definitions/IGridSize" }, - "md": { "$ref": "#/definitions/IGridSize" }, - "lg": { "$ref": "#/definitions/IGridSize" }, - "xl": { "$ref": "#/definitions/IGridSize" }, - "labelGrid": { "$ref": "#/definitions/IGridStyling" }, - "innerGrid": { "$ref": "#/definitions/IGridStyling" } - } - }, - "pageBreak": { - "title": "Page break", - "description": "Optionally insert page-break before/after component when rendered in PDF", - "type": "object", - "properties": { - "breakBefore": { - "title": "Page break before", - "description": "PDF only: Value or expression indicating whether a page break should be added before the component. Can be either: 'auto' (default), 'always', or 'avoid'.", - "examples": ["auto", "always", "avoid"], - "default": "auto", - "$ref": "expression.schema.v1.json#/definitions/string" - }, - "breakAfter": { - "title": "Page break after", - "description": "PDF only: Value or expression indicating whether a page break should be added after the component. Can be either: 'auto' (default), 'always', or 'avoid'.", - "examples": ["auto", "always", "avoid"], - "default": "auto", - "$ref": "expression.schema.v1.json#/definitions/string" - } - }, - "additionalProperties": false - }, - "renderAsSummary": { - "title": "Render as summary", - "description": "Boolean value indicating if the component should be rendered as a summary. Defaults to false.", - "default": false, - "type": "boolean" - }, - "forceShowInSummary": { - "title": "Force show in summary", - "description": "Will force show the component in a summary even if hideEmptyFields is set to true in the summary component.", - "default": false, - "$ref": "expression.schema.v1.json#/definitions/boolean" - }, - "type": { "const": "Cards" }, - "textResourceBindings": { - "title": "TRBSummarizable", - "type": "object", - "properties": { - "summaryTitle": { - "title": "Summary title", - "description": "Title used in the summary view (overrides the default title)", - "$ref": "expression.schema.v1.json#/definitions/string" - }, - "summaryAccessibleTitle": { - "title": "Accessible summary title", - "description": "Title used for aria-label on the edit button in the summary view (overrides the default and summary title)", - "$ref": "expression.schema.v1.json#/definitions/string" - } - } - }, - "mediaPosition": { - "title": "ImagePosition", - "description": "Position of the media (image/video/audio) in each card", - "default": "top", - "enum": ["top", "bottom"], - "type": "string" - }, - "minMediaHeight": { - "title": "minMediaHeight", - "description": "Fixed minimum height of media (if media is present)", - "examples": ["100px", "100%", "100rem"], - "default": "150px", - "type": "string" - }, - "minWidth": { - "title": "minWidth", - "description": "Fixed minimum width of the card", - "examples": ["100", "100px", "100%", "100rem"], - "default": "250px", - "type": "string", - "pattern": "^[0-9]+(px|rem|%)?$" - }, - "color": { - "title": "Card color", - "description": "The color style for these cards", - "enum": ["neutral", "subtle"], - "type": "string" - }, - "cards": { - "type": "array", - "items": { - "title": "CardConfigExternal", - "type": "object", - "properties": { - "media": { - "title": "Media", - "description": "Media to display on the top/bottom of the card (must reference an Image, Audio or Video component", - "type": "string" - }, - "title": { "title": "Title", "description": "Title of the card", "type": "string" }, - "description": { - "title": "Description/body text", - "description": "Full text displayed underneath the title, above any component children", - "type": "string" - }, - "footer": { - "title": "Footer", - "description": "Footer text of the card", - "type": "string" - }, - "children": { - "title": "Children", - "description": "Child component IDs to show inside the card", - "type": "array", - "items": { "type": "string" } - } - }, - "additionalProperties": false - } - } - }, - "required": ["id", "type", "color", "cards"], - "title": "Cards component schema" -} +{"$id":"https://altinncdn.no/schemas/json/component/Cards.schema.v1.json","$schema":"http://json-schema.org/draft-07/schema#","properties":{"id":{"title":"ID","description":"The component ID. Must be unique within all layouts/pages in a layout-set. Cannot end with .","type":"string","pattern":"^[0-9a-zA-Z][0-9a-zA-Z-]*(-?[a-zA-Z]+|[a-zA-Z][0-9]+|-[0-9]{6,})$"},"hidden":{"title":"Hidden","description":"Boolean value or expression indicating if the component should be hidden. Defaults to false.","default":false,"$ref":"expression.schema.v1.json#/definitions/boolean"},"grid":{"properties":{"xs":{"$ref":"#/definitions/IGridSize"},"sm":{"$ref":"#/definitions/IGridSize"},"md":{"$ref":"#/definitions/IGridSize"},"lg":{"$ref":"#/definitions/IGridSize"},"xl":{"$ref":"#/definitions/IGridSize"},"labelGrid":{"$ref":"#/definitions/IGridStyling"},"innerGrid":{"$ref":"#/definitions/IGridStyling"}}},"pageBreak":{"title":"Page break","description":"Optionally insert page-break before/after component when rendered in PDF","type":"object","properties":{"breakBefore":{"title":"Page break before","description":"PDF only: Value or expression indicating whether a page break should be added before the component. Can be either: 'auto' (default), 'always', or 'avoid'.","examples":["auto","always","avoid"],"default":"auto","$ref":"expression.schema.v1.json#/definitions/string"},"breakAfter":{"title":"Page break after","description":"PDF only: Value or expression indicating whether a page break should be added after the component. Can be either: 'auto' (default), 'always', or 'avoid'.","examples":["auto","always","avoid"],"default":"auto","$ref":"expression.schema.v1.json#/definitions/string"}},"additionalProperties":false},"renderAsSummary":{"title":"Render as summary","description":"Boolean value indicating if the component should be rendered as a summary. Defaults to false.","default":false,"type":"boolean"},"forceShowInSummary":{"title":"Force show in summary","description":"Will force show the component in a summary even if hideEmptyFields is set to true in the summary component.","default":false,"$ref":"expression.schema.v1.json#/definitions/boolean"},"type":{"const":"Cards"},"textResourceBindings":{"title":"TRBSummarizable","type":"object","properties":{"summaryTitle":{"title":"Summary title","description":"Title used in the summary view (overrides the default title)","$ref":"expression.schema.v1.json#/definitions/string"},"summaryAccessibleTitle":{"title":"Accessible summary title","description":"Title used for aria-label on the edit button in the summary view (overrides the default and summary title)","$ref":"expression.schema.v1.json#/definitions/string"}}},"mediaPosition":{"title":"ImagePosition","description":"Position of the media (image/video/audio) in each card","default":"top","enum":["top","bottom"],"type":"string"},"minMediaHeight":{"title":"minMediaHeight","description":"Fixed minimum height of media (if media is present)","examples":["100px","100%","100rem"],"default":"150px","type":"string"},"minWidth":{"title":"minWidth","description":"Fixed minimum width of the card","examples":["100","100px","100%","100rem"],"default":"250px","type":"string","pattern":"^[0-9]+(px|rem|%)?$"},"color":{"title":"Card color","description":"The color style for these cards","enum":["neutral","subtle"],"type":"string"},"cards":{"type":"array","items":{"title":"CardConfigExternal","type":"object","properties":{"media":{"title":"Media","description":"Media to display on the top/bottom of the card (must reference an Image, Audio or Video component","type":"string"},"title":{"title":"Title","description":"Title of the card","type":"string"},"description":{"title":"Description/body text","description":"Full text displayed underneath the title, above any component children","type":"string"},"footer":{"title":"Footer","description":"Footer text of the card","type":"string"},"children":{"title":"Children","description":"Child component IDs to show inside the card","type":"array","items":{"type":"string"}}},"additionalProperties":false}}},"required":["id","type","color","cards"],"title":"Cards component schema"} \ No newline at end of file diff --git a/frontend/packages/ux-editor/src/testing/schemas/json/component/Checkboxes.schema.v1.json b/frontend/packages/ux-editor/src/testing/schemas/json/component/Checkboxes.schema.v1.json index c508fbc884a..c6f7a2db104 100644 --- a/frontend/packages/ux-editor/src/testing/schemas/json/component/Checkboxes.schema.v1.json +++ b/frontend/packages/ux-editor/src/testing/schemas/json/component/Checkboxes.schema.v1.json @@ -1,283 +1 @@ -{ - "$id": "https://altinncdn.no/schemas/json/component/Checkboxes.schema.v1.json", - "$schema": "http://json-schema.org/draft-07/schema#", - "properties": { - "id": { - "title": "ID", - "description": "The component ID. Must be unique within all layouts/pages in a layout-set. Cannot end with .", - "type": "string", - "pattern": "^[0-9a-zA-Z][0-9a-zA-Z-]*(-?[a-zA-Z]+|[a-zA-Z][0-9]+|-[0-9]{6,})$" - }, - "hidden": { - "title": "Hidden", - "description": "Boolean value or expression indicating if the component should be hidden. Defaults to false.", - "default": false, - "$ref": "expression.schema.v1.json#/definitions/boolean" - }, - "grid": { - "properties": { - "xs": { "$ref": "#/definitions/IGridSize" }, - "sm": { "$ref": "#/definitions/IGridSize" }, - "md": { "$ref": "#/definitions/IGridSize" }, - "lg": { "$ref": "#/definitions/IGridSize" }, - "xl": { "$ref": "#/definitions/IGridSize" }, - "labelGrid": { "$ref": "#/definitions/IGridStyling" }, - "innerGrid": { "$ref": "#/definitions/IGridStyling" } - } - }, - "pageBreak": { - "title": "Page break", - "description": "Optionally insert page-break before/after component when rendered in PDF", - "type": "object", - "properties": { - "breakBefore": { - "title": "Page break before", - "description": "PDF only: Value or expression indicating whether a page break should be added before the component. Can be either: 'auto' (default), 'always', or 'avoid'.", - "examples": ["auto", "always", "avoid"], - "default": "auto", - "$ref": "expression.schema.v1.json#/definitions/string" - }, - "breakAfter": { - "title": "Page break after", - "description": "PDF only: Value or expression indicating whether a page break should be added after the component. Can be either: 'auto' (default), 'always', or 'avoid'.", - "examples": ["auto", "always", "avoid"], - "default": "auto", - "$ref": "expression.schema.v1.json#/definitions/string" - } - }, - "additionalProperties": false - }, - "readOnly": { - "title": "Read only/disabled?", - "description": "Boolean value or expression indicating if the component should be read only/disabled. Defaults to false.
Please note that even with read-only fields in components, it may currently be possible to update the field by modifying the request sent to the API or through a direct API call.", - "default": false, - "$ref": "expression.schema.v1.json#/definitions/boolean" - }, - "required": { - "title": "Required?", - "description": "Boolean value or expression indicating if the component should be required. Defaults to false.", - "default": false, - "$ref": "expression.schema.v1.json#/definitions/boolean" - }, - "showValidations": { - "title": "Validation types", - "description": "List of validation types to show", - "type": "array", - "items": { - "enum": [ - "Schema", - "Component", - "Expression", - "CustomBackend", - "Required", - "AllExceptRequired", - "All" - ], - "type": "string" - } - }, - "renderAsSummary": { - "title": "Render as summary", - "description": "Boolean value indicating if the component should be rendered as a summary. Defaults to false.", - "default": false, - "type": "boolean" - }, - "forceShowInSummary": { - "title": "Force show in summary", - "description": "Will force show the component in a summary even if hideEmptyFields is set to true in the summary component.", - "default": false, - "$ref": "expression.schema.v1.json#/definitions/boolean" - }, - "optionsId": { - "title": "Dynamic options (fetched from server)", - "description": "ID of the option list to fetch from the server", - "type": "string" - }, - "mapping": { - "title": "Mapping", - "description": "A mapping of key-value pairs (usually used for mapping a path in the data model to a query string parameter).", - "type": "object", - "properties": {}, - "additionalProperties": { "type": "string" } - }, - "queryParameters": { - "title": "Query parameters", - "description": "A mapping of query string parameters to values. Will be appended to the URL when fetching options.", - "type": "object", - "properties": {}, - "additionalProperties": { "type": "string" } - }, - "options": { - "title": "Static options", - "description": "List of static options", - "type": "array", - "items": { - "title": "IRawOption", - "examples": [{ "label": "", "value": "" }], - "type": "object", - "properties": { - "label": { "type": "string" }, - "value": { - "anyOf": [ - { "type": "string" }, - { "type": "number" }, - { "type": "boolean" }, - { "const": null } - ] - }, - "description": { "type": "string" }, - "helpText": { "type": "string" } - }, - "required": ["label", "value"], - "additionalProperties": false - } - }, - "secure": { - "title": "Secure options (when using optionsId)", - "description": "Whether to call the secure API endpoint when fetching options from the server (allows for user/instance-specific options)", - "default": false, - "type": "boolean" - }, - "sortOrder": { - "description": "Sorts the code list in either ascending or descending order by label.", - "enum": ["asc", "desc"], - "type": "string" - }, - "source": { - "title": "Option source", - "description": "Allows for fetching options from the data model, pointing to a repeating group structure", - "type": "object", - "properties": { - "group": { - "title": "Group", - "description": "The repeating group to base options on.", - "examples": ["model.some.group"], - "type": "string" - }, - "label": { - "title": "Label", - "description": "A label of the option displayed in Radio- and Checkbox groups. Can be plain text, a text resource binding, or a dynamic expression.", - "examples": ["some.text.key"], - "$ref": "expression.schema.v1.json#/definitions/string" - }, - "value": { - "title": "Value", - "description": "Field in the group that should be used as value", - "examples": ["model.some.group[{0}].someField"], - "type": "string" - }, - "description": { - "title": "Description", - "description": "A description of the option displayed in Radio- and Checkbox groups. Can be plain text, a text resource binding, or a dynamic expression.", - "examples": ["some.text.key", "My Description"], - "$ref": "expression.schema.v1.json#/definitions/string" - }, - "helpText": { - "title": "Help Text", - "description": "A help text for the option displayed in Radio- and Checkbox groups. Can be plain text, a text resource binding, or a dynamic expression.", - "examples": ["some.text.key", "My Help Text"], - "$ref": "expression.schema.v1.json#/definitions/string" - } - }, - "required": ["group", "label", "value"], - "additionalProperties": false - }, - "preselectedOptionIndex": { - "title": "Preselected option index", - "description": "Index of the option to preselect (if no option has been selected yet)", - "type": "integer" - }, - "labelSettings": { - "title": "ILabelSettings", - "type": "object", - "properties": { - "optionalIndicator": { - "title": "Optional indicator", - "description": "Show optional indicator on label", - "type": "boolean" - } - }, - "additionalProperties": false - }, - "type": { "const": "Checkboxes" }, - "textResourceBindings": { - "properties": { - "title": { - "title": "Title", - "description": "Label text/title shown above the component", - "$ref": "expression.schema.v1.json#/definitions/string" - }, - "description": { - "title": "Description", - "description": "Label description shown above the component, below the title", - "$ref": "expression.schema.v1.json#/definitions/string" - }, - "help": { - "title": "Help text", - "description": "Help text shown in a tooltip when clicking the help button", - "$ref": "expression.schema.v1.json#/definitions/string" - }, - "tableTitle": { - "title": "Table title", - "description": "Title used in the table view (overrides the default title)", - "$ref": "expression.schema.v1.json#/definitions/string" - }, - "shortName": { - "title": "Short name (for validation)", - "description": "Alternative name used for required validation messages (overrides the default title)", - "$ref": "expression.schema.v1.json#/definitions/string" - }, - "requiredValidation": { - "title": "Required validation message", - "description": "Full validation message shown when the component is required and no value has been entered (overrides both the default and shortName)", - "$ref": "expression.schema.v1.json#/definitions/string" - }, - "summaryTitle": { - "title": "Summary title", - "description": "Title used in the summary view (overrides the default title)", - "$ref": "expression.schema.v1.json#/definitions/string" - }, - "summaryAccessibleTitle": { - "title": "Accessible summary title", - "description": "Title used for aria-label on the edit button in the summary view (overrides the default and summary title)", - "$ref": "expression.schema.v1.json#/definitions/string" - } - } - }, - "dataModelBindings": { - "title": "Data model binding", - "description": "Describes the location in the data model where the component should store its value(s). A simple binding is used for components that only store a single value, usually a string.", - "type": "object", - "properties": { - "simpleBinding": { "type": "string" }, - "label": { "type": "string" }, - "metadata": { - "description": "Describes the location where metadata for the option based component should be stored in the datamodel.", - "type": "string" - } - }, - "required": ["simpleBinding"], - "additionalProperties": false - }, - "layout": { - "title": "Layout", - "description": "Define the layout style for the options", - "enum": ["column", "row", "table"], - "type": "string" - }, - "showLabelsInTable": { - "title": "Show label when single option in table", - "description": "Boolean value indicating if the label should be visible when only one option exists in table", - "default": false, - "type": "boolean" - }, - "alertOnChange": { - "title": "Alert on change", - "description": "Boolean value indicating if the component should alert on change", - "default": false, - "$ref": "expression.schema.v1.json#/definitions/boolean" - } - }, - "required": ["id", "type", "dataModelBindings"], - "title": "Checkboxes component schema" -} +{"$id":"https://altinncdn.no/schemas/json/component/Checkboxes.schema.v1.json","$schema":"http://json-schema.org/draft-07/schema#","properties":{"id":{"title":"ID","description":"The component ID. Must be unique within all layouts/pages in a layout-set. Cannot end with .","type":"string","pattern":"^[0-9a-zA-Z][0-9a-zA-Z-]*(-?[a-zA-Z]+|[a-zA-Z][0-9]+|-[0-9]{6,})$"},"hidden":{"title":"Hidden","description":"Boolean value or expression indicating if the component should be hidden. Defaults to false.","default":false,"$ref":"expression.schema.v1.json#/definitions/boolean"},"grid":{"properties":{"xs":{"$ref":"#/definitions/IGridSize"},"sm":{"$ref":"#/definitions/IGridSize"},"md":{"$ref":"#/definitions/IGridSize"},"lg":{"$ref":"#/definitions/IGridSize"},"xl":{"$ref":"#/definitions/IGridSize"},"labelGrid":{"$ref":"#/definitions/IGridStyling"},"innerGrid":{"$ref":"#/definitions/IGridStyling"}}},"pageBreak":{"title":"Page break","description":"Optionally insert page-break before/after component when rendered in PDF","type":"object","properties":{"breakBefore":{"title":"Page break before","description":"PDF only: Value or expression indicating whether a page break should be added before the component. Can be either: 'auto' (default), 'always', or 'avoid'.","examples":["auto","always","avoid"],"default":"auto","$ref":"expression.schema.v1.json#/definitions/string"},"breakAfter":{"title":"Page break after","description":"PDF only: Value or expression indicating whether a page break should be added after the component. Can be either: 'auto' (default), 'always', or 'avoid'.","examples":["auto","always","avoid"],"default":"auto","$ref":"expression.schema.v1.json#/definitions/string"}},"additionalProperties":false},"readOnly":{"title":"Read only/disabled?","description":"Boolean value or expression indicating if the component should be read only/disabled. Defaults to false.
Please note that even with read-only fields in components, it may currently be possible to update the field by modifying the request sent to the API or through a direct API call.","default":false,"$ref":"expression.schema.v1.json#/definitions/boolean"},"required":{"title":"Required?","description":"Boolean value or expression indicating if the component should be required. Defaults to false.","default":false,"$ref":"expression.schema.v1.json#/definitions/boolean"},"showValidations":{"title":"Validation types","description":"List of validation types to show","type":"array","items":{"enum":["Schema","Component","Expression","CustomBackend","Required","AllExceptRequired","All"],"type":"string"}},"renderAsSummary":{"title":"Render as summary","description":"Boolean value indicating if the component should be rendered as a summary. Defaults to false.","default":false,"type":"boolean"},"forceShowInSummary":{"title":"Force show in summary","description":"Will force show the component in a summary even if hideEmptyFields is set to true in the summary component.","default":false,"$ref":"expression.schema.v1.json#/definitions/boolean"},"optionsId":{"title":"Dynamic options (fetched from server)","description":"ID of the option list to fetch from the server","type":"string"},"mapping":{"title":"Mapping","description":"A mapping of key-value pairs (usually used for mapping a path in the data model to a query string parameter).","type":"object","properties":{},"additionalProperties":{"type":"string"}},"queryParameters":{"title":"Query parameters","description":"A mapping of query string parameters to values. Will be appended to the URL when fetching options.","type":"object","properties":{},"additionalProperties":{"type":"string"}},"options":{"title":"Static options","description":"List of static options","type":"array","items":{"title":"IRawOption","examples":[{"label":"","value":""}],"type":"object","properties":{"label":{"type":"string"},"value":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"const":null}]},"description":{"type":"string"},"helpText":{"type":"string"}},"required":["label","value"],"additionalProperties":false}},"secure":{"title":"Secure options (when using optionsId)","description":"Whether to call the secure API endpoint when fetching options from the server (allows for user/instance-specific options)","default":false,"type":"boolean"},"sortOrder":{"description":"Sorts the code list in either ascending or descending order by label.","enum":["asc","desc"],"type":"string"},"source":{"title":"Option source","description":"Allows for fetching options from the data model, pointing to a repeating group structure","type":"object","properties":{"group":{"title":"Group","description":"The repeating group to base options on.","examples":["model.some.group"],"type":"string"},"label":{"title":"Label","description":"A label of the option displayed in Radio- and Checkbox groups. Can be plain text, a text resource binding, or a dynamic expression.","examples":["some.text.key"],"$ref":"expression.schema.v1.json#/definitions/string"},"value":{"title":"Value","description":"Field in the group that should be used as value","examples":["model.some.group[{0}].someField"],"type":"string"},"description":{"title":"Description","description":"A description of the option displayed in Radio- and Checkbox groups. Can be plain text, a text resource binding, or a dynamic expression.","examples":["some.text.key","My Description"],"$ref":"expression.schema.v1.json#/definitions/string"},"helpText":{"title":"Help Text","description":"A help text for the option displayed in Radio- and Checkbox groups. Can be plain text, a text resource binding, or a dynamic expression.","examples":["some.text.key","My Help Text"],"$ref":"expression.schema.v1.json#/definitions/string"}},"required":["group","label","value"],"additionalProperties":false},"preselectedOptionIndex":{"title":"Preselected option index","description":"Index of the option to preselect (if no option has been selected yet)","type":"integer"},"labelSettings":{"title":"ILabelSettings","type":"object","properties":{"optionalIndicator":{"title":"Optional indicator","description":"Show optional indicator on label","type":"boolean"}},"additionalProperties":false},"type":{"const":"Checkboxes"},"textResourceBindings":{"properties":{"title":{"title":"Title","description":"Label text/title shown above the component","$ref":"expression.schema.v1.json#/definitions/string"},"description":{"title":"Description","description":"Label description shown above the component, below the title","$ref":"expression.schema.v1.json#/definitions/string"},"help":{"title":"Help text","description":"Help text shown in a tooltip when clicking the help button","$ref":"expression.schema.v1.json#/definitions/string"},"tableTitle":{"title":"Table title","description":"Title used in the table view (overrides the default title)","$ref":"expression.schema.v1.json#/definitions/string"},"shortName":{"title":"Short name (for validation)","description":"Alternative name used for required validation messages (overrides the default title)","$ref":"expression.schema.v1.json#/definitions/string"},"requiredValidation":{"title":"Required validation message","description":"Full validation message shown when the component is required and no value has been entered (overrides both the default and shortName)","$ref":"expression.schema.v1.json#/definitions/string"},"summaryTitle":{"title":"Summary title","description":"Title used in the summary view (overrides the default title)","$ref":"expression.schema.v1.json#/definitions/string"},"summaryAccessibleTitle":{"title":"Accessible summary title","description":"Title used for aria-label on the edit button in the summary view (overrides the default and summary title)","$ref":"expression.schema.v1.json#/definitions/string"}}},"dataModelBindings":{"title":"Data model binding","description":"Describes the location in the data model where the component should store its value(s). A simple binding is used for components that only store a single value, usually a string.","type":"object","properties":{"simpleBinding":{"type":"string"},"label":{"type":"string"},"metadata":{"description":"Describes the location where metadata for the option based component should be stored in the datamodel.","type":"string"}},"required":["simpleBinding"],"additionalProperties":false},"layout":{"title":"Layout","description":"Define the layout style for the options","enum":["column","row","table"],"type":"string"},"showLabelsInTable":{"title":"Show label when single option in table","description":"Boolean value indicating if the label should be visible when only one option exists in table","default":false,"type":"boolean"},"alertOnChange":{"title":"Alert on change","description":"Boolean value indicating if the component should alert on change","default":false,"$ref":"expression.schema.v1.json#/definitions/boolean"}},"required":["id","type","dataModelBindings"],"title":"Checkboxes component schema"} \ No newline at end of file diff --git a/frontend/packages/ux-editor/src/testing/schemas/json/component/Custom.schema.v1.json b/frontend/packages/ux-editor/src/testing/schemas/json/component/Custom.schema.v1.json index 9abe46fab49..cb4df54f850 100644 --- a/frontend/packages/ux-editor/src/testing/schemas/json/component/Custom.schema.v1.json +++ b/frontend/packages/ux-editor/src/testing/schemas/json/component/Custom.schema.v1.json @@ -1,140 +1 @@ -{ - "$id": "https://altinncdn.no/schemas/json/component/Custom.schema.v1.json", - "$schema": "http://json-schema.org/draft-07/schema#", - "properties": { - "id": { - "title": "ID", - "description": "The component ID. Must be unique within all layouts/pages in a layout-set. Cannot end with .", - "type": "string", - "pattern": "^[0-9a-zA-Z][0-9a-zA-Z-]*(-?[a-zA-Z]+|[a-zA-Z][0-9]+|-[0-9]{6,})$" - }, - "hidden": { - "title": "Hidden", - "description": "Boolean value or expression indicating if the component should be hidden. Defaults to false.", - "default": false, - "$ref": "expression.schema.v1.json#/definitions/boolean" - }, - "grid": { - "properties": { - "xs": { "$ref": "#/definitions/IGridSize" }, - "sm": { "$ref": "#/definitions/IGridSize" }, - "md": { "$ref": "#/definitions/IGridSize" }, - "lg": { "$ref": "#/definitions/IGridSize" }, - "xl": { "$ref": "#/definitions/IGridSize" }, - "labelGrid": { "$ref": "#/definitions/IGridStyling" }, - "innerGrid": { "$ref": "#/definitions/IGridStyling" } - } - }, - "pageBreak": { - "title": "Page break", - "description": "Optionally insert page-break before/after component when rendered in PDF", - "type": "object", - "properties": { - "breakBefore": { - "title": "Page break before", - "description": "PDF only: Value or expression indicating whether a page break should be added before the component. Can be either: 'auto' (default), 'always', or 'avoid'.", - "examples": ["auto", "always", "avoid"], - "default": "auto", - "$ref": "expression.schema.v1.json#/definitions/string" - }, - "breakAfter": { - "title": "Page break after", - "description": "PDF only: Value or expression indicating whether a page break should be added after the component. Can be either: 'auto' (default), 'always', or 'avoid'.", - "examples": ["auto", "always", "avoid"], - "default": "auto", - "$ref": "expression.schema.v1.json#/definitions/string" - } - }, - "additionalProperties": false - }, - "readOnly": { - "title": "Read only/disabled?", - "description": "Boolean value or expression indicating if the component should be read only/disabled. Defaults to false.
Please note that even with read-only fields in components, it may currently be possible to update the field by modifying the request sent to the API or through a direct API call.", - "default": false, - "$ref": "expression.schema.v1.json#/definitions/boolean" - }, - "required": { - "title": "Required?", - "description": "Boolean value or expression indicating if the component should be required. Defaults to false.", - "default": false, - "$ref": "expression.schema.v1.json#/definitions/boolean" - }, - "showValidations": { - "title": "Validation types", - "description": "List of validation types to show", - "type": "array", - "items": { - "enum": [ - "Schema", - "Component", - "Expression", - "CustomBackend", - "Required", - "AllExceptRequired", - "All" - ], - "type": "string" - } - }, - "renderAsSummary": { - "title": "Render as summary", - "description": "Boolean value indicating if the component should be rendered as a summary. Defaults to false.", - "default": false, - "type": "boolean" - }, - "forceShowInSummary": { - "title": "Force show in summary", - "description": "Will force show the component in a summary even if hideEmptyFields is set to true in the summary component.", - "default": false, - "$ref": "expression.schema.v1.json#/definitions/boolean" - }, - "type": { "const": "Custom" }, - "textResourceBindings": { - "properties": { - "title": { - "title": "Title", - "description": "Title (passed on as the \"text\" property to the component)", - "$ref": "expression.schema.v1.json#/definitions/string" - }, - "tableTitle": { - "title": "Table title", - "description": "Title used in the table view (overrides the default title)", - "$ref": "expression.schema.v1.json#/definitions/string" - }, - "shortName": { - "title": "Short name (for validation)", - "description": "Alternative name used for required validation messages (overrides the default title)", - "$ref": "expression.schema.v1.json#/definitions/string" - }, - "requiredValidation": { - "title": "Required validation message", - "description": "Full validation message shown when the component is required and no value has been entered (overrides both the default and shortName)", - "$ref": "expression.schema.v1.json#/definitions/string" - }, - "summaryTitle": { - "title": "Summary title", - "description": "Title used in the summary view (overrides the default title)", - "$ref": "expression.schema.v1.json#/definitions/string" - }, - "summaryAccessibleTitle": { - "title": "Accessible summary title", - "description": "Title used for aria-label on the edit button in the summary view (overrides the default and summary title)", - "$ref": "expression.schema.v1.json#/definitions/string" - } - } - }, - "dataModelBindings": { - "title": "IDataModelBindingsForCustom", - "type": "object", - "properties": {}, - "additionalProperties": { "type": "string" } - }, - "tagName": { - "title": "Tag name", - "description": "Web component tag name to use", - "type": "string" - } - }, - "required": ["id", "type", "tagName"], - "title": "Custom component schema" -} +{"$id":"https://altinncdn.no/schemas/json/component/Custom.schema.v1.json","$schema":"http://json-schema.org/draft-07/schema#","properties":{"id":{"title":"ID","description":"The component ID. Must be unique within all layouts/pages in a layout-set. Cannot end with .","type":"string","pattern":"^[0-9a-zA-Z][0-9a-zA-Z-]*(-?[a-zA-Z]+|[a-zA-Z][0-9]+|-[0-9]{6,})$"},"hidden":{"title":"Hidden","description":"Boolean value or expression indicating if the component should be hidden. Defaults to false.","default":false,"$ref":"expression.schema.v1.json#/definitions/boolean"},"grid":{"properties":{"xs":{"$ref":"#/definitions/IGridSize"},"sm":{"$ref":"#/definitions/IGridSize"},"md":{"$ref":"#/definitions/IGridSize"},"lg":{"$ref":"#/definitions/IGridSize"},"xl":{"$ref":"#/definitions/IGridSize"},"labelGrid":{"$ref":"#/definitions/IGridStyling"},"innerGrid":{"$ref":"#/definitions/IGridStyling"}}},"pageBreak":{"title":"Page break","description":"Optionally insert page-break before/after component when rendered in PDF","type":"object","properties":{"breakBefore":{"title":"Page break before","description":"PDF only: Value or expression indicating whether a page break should be added before the component. Can be either: 'auto' (default), 'always', or 'avoid'.","examples":["auto","always","avoid"],"default":"auto","$ref":"expression.schema.v1.json#/definitions/string"},"breakAfter":{"title":"Page break after","description":"PDF only: Value or expression indicating whether a page break should be added after the component. Can be either: 'auto' (default), 'always', or 'avoid'.","examples":["auto","always","avoid"],"default":"auto","$ref":"expression.schema.v1.json#/definitions/string"}},"additionalProperties":false},"readOnly":{"title":"Read only/disabled?","description":"Boolean value or expression indicating if the component should be read only/disabled. Defaults to false.
Please note that even with read-only fields in components, it may currently be possible to update the field by modifying the request sent to the API or through a direct API call.","default":false,"$ref":"expression.schema.v1.json#/definitions/boolean"},"required":{"title":"Required?","description":"Boolean value or expression indicating if the component should be required. Defaults to false.","default":false,"$ref":"expression.schema.v1.json#/definitions/boolean"},"showValidations":{"title":"Validation types","description":"List of validation types to show","type":"array","items":{"enum":["Schema","Component","Expression","CustomBackend","Required","AllExceptRequired","All"],"type":"string"}},"renderAsSummary":{"title":"Render as summary","description":"Boolean value indicating if the component should be rendered as a summary. Defaults to false.","default":false,"type":"boolean"},"forceShowInSummary":{"title":"Force show in summary","description":"Will force show the component in a summary even if hideEmptyFields is set to true in the summary component.","default":false,"$ref":"expression.schema.v1.json#/definitions/boolean"},"type":{"const":"Custom"},"textResourceBindings":{"properties":{"title":{"title":"Title","description":"Title (passed on as the \"text\" property to the component)","$ref":"expression.schema.v1.json#/definitions/string"},"tableTitle":{"title":"Table title","description":"Title used in the table view (overrides the default title)","$ref":"expression.schema.v1.json#/definitions/string"},"shortName":{"title":"Short name (for validation)","description":"Alternative name used for required validation messages (overrides the default title)","$ref":"expression.schema.v1.json#/definitions/string"},"requiredValidation":{"title":"Required validation message","description":"Full validation message shown when the component is required and no value has been entered (overrides both the default and shortName)","$ref":"expression.schema.v1.json#/definitions/string"},"summaryTitle":{"title":"Summary title","description":"Title used in the summary view (overrides the default title)","$ref":"expression.schema.v1.json#/definitions/string"},"summaryAccessibleTitle":{"title":"Accessible summary title","description":"Title used for aria-label on the edit button in the summary view (overrides the default and summary title)","$ref":"expression.schema.v1.json#/definitions/string"}}},"dataModelBindings":{"title":"IDataModelBindingsForCustom","type":"object","properties":{},"additionalProperties":{"type":"string"}},"tagName":{"title":"Tag name","description":"Web component tag name to use","type":"string"}},"required":["id","type","tagName"],"title":"Custom component schema"} \ No newline at end of file diff --git a/frontend/packages/ux-editor/src/testing/schemas/json/component/CustomButton.schema.v1.json b/frontend/packages/ux-editor/src/testing/schemas/json/component/CustomButton.schema.v1.json index 00975f900e9..c553d9670d4 100644 --- a/frontend/packages/ux-editor/src/testing/schemas/json/component/CustomButton.schema.v1.json +++ b/frontend/packages/ux-editor/src/testing/schemas/json/component/CustomButton.schema.v1.json @@ -1,81 +1 @@ -{ - "$id": "https://altinncdn.no/schemas/json/component/CustomButton.schema.v1.json", - "$schema": "http://json-schema.org/draft-07/schema#", - "properties": { - "id": { - "title": "ID", - "description": "The component ID. Must be unique within all layouts/pages in a layout-set. Cannot end with .", - "type": "string", - "pattern": "^[0-9a-zA-Z][0-9a-zA-Z-]*(-?[a-zA-Z]+|[a-zA-Z][0-9]+|-[0-9]{6,})$" - }, - "hidden": { - "title": "Hidden", - "description": "Boolean value or expression indicating if the component should be hidden. Defaults to false.", - "default": false, - "$ref": "expression.schema.v1.json#/definitions/boolean" - }, - "grid": { - "properties": { - "xs": { "$ref": "#/definitions/IGridSize" }, - "sm": { "$ref": "#/definitions/IGridSize" }, - "md": { "$ref": "#/definitions/IGridSize" }, - "lg": { "$ref": "#/definitions/IGridSize" }, - "xl": { "$ref": "#/definitions/IGridSize" }, - "labelGrid": { "$ref": "#/definitions/IGridStyling" }, - "innerGrid": { "$ref": "#/definitions/IGridStyling" } - } - }, - "pageBreak": { - "title": "Page break", - "description": "Optionally insert page-break before/after component when rendered in PDF", - "type": "object", - "properties": { - "breakBefore": { - "title": "Page break before", - "description": "PDF only: Value or expression indicating whether a page break should be added before the component. Can be either: 'auto' (default), 'always', or 'avoid'.", - "examples": ["auto", "always", "avoid"], - "default": "auto", - "$ref": "expression.schema.v1.json#/definitions/string" - }, - "breakAfter": { - "title": "Page break after", - "description": "PDF only: Value or expression indicating whether a page break should be added after the component. Can be either: 'auto' (default), 'always', or 'avoid'.", - "examples": ["auto", "always", "avoid"], - "default": "auto", - "$ref": "expression.schema.v1.json#/definitions/string" - } - }, - "additionalProperties": false - }, - "type": { "const": "CustomButton" }, - "actions": { - "type": "array", - "items": { - "title": "CustomAction", - "anyOf": [ - { "$ref": "#/definitions/ClientAction" }, - { "$ref": "#/definitions/ServerAction" } - ] - } - }, - "buttonStyle": { - "title": "Button style", - "description": "The style/color scheme of the button.", - "enum": ["primary", "secondary"], - "type": "string" - }, - "textResourceBindings": { - "type": "object", - "properties": { - "title": { - "title": "Title", - "description": "The title/text on the button", - "$ref": "expression.schema.v1.json#/definitions/string" - } - }, - "additionalProperties": false - } - }, - "required": ["id", "type", "actions", "buttonStyle"], - "title": "CustomButton component schema" -} +{"$id":"https://altinncdn.no/schemas/json/component/CustomButton.schema.v1.json","$schema":"http://json-schema.org/draft-07/schema#","properties":{"id":{"title":"ID","description":"The component ID. Must be unique within all layouts/pages in a layout-set. Cannot end with .","type":"string","pattern":"^[0-9a-zA-Z][0-9a-zA-Z-]*(-?[a-zA-Z]+|[a-zA-Z][0-9]+|-[0-9]{6,})$"},"hidden":{"title":"Hidden","description":"Boolean value or expression indicating if the component should be hidden. Defaults to false.","default":false,"$ref":"expression.schema.v1.json#/definitions/boolean"},"grid":{"properties":{"xs":{"$ref":"#/definitions/IGridSize"},"sm":{"$ref":"#/definitions/IGridSize"},"md":{"$ref":"#/definitions/IGridSize"},"lg":{"$ref":"#/definitions/IGridSize"},"xl":{"$ref":"#/definitions/IGridSize"},"labelGrid":{"$ref":"#/definitions/IGridStyling"},"innerGrid":{"$ref":"#/definitions/IGridStyling"}}},"pageBreak":{"title":"Page break","description":"Optionally insert page-break before/after component when rendered in PDF","type":"object","properties":{"breakBefore":{"title":"Page break before","description":"PDF only: Value or expression indicating whether a page break should be added before the component. Can be either: 'auto' (default), 'always', or 'avoid'.","examples":["auto","always","avoid"],"default":"auto","$ref":"expression.schema.v1.json#/definitions/string"},"breakAfter":{"title":"Page break after","description":"PDF only: Value or expression indicating whether a page break should be added after the component. Can be either: 'auto' (default), 'always', or 'avoid'.","examples":["auto","always","avoid"],"default":"auto","$ref":"expression.schema.v1.json#/definitions/string"}},"additionalProperties":false},"type":{"const":"CustomButton"},"actions":{"type":"array","items":{"title":"CustomAction","anyOf":[{"$ref":"#/definitions/ClientAction"},{"$ref":"#/definitions/ServerAction"}]}},"buttonStyle":{"title":"Button style","description":"The style/color scheme of the button.","enum":["primary","secondary"],"type":"string"},"textResourceBindings":{"type":"object","properties":{"title":{"title":"Title","description":"The title/text on the button","$ref":"expression.schema.v1.json#/definitions/string"}},"additionalProperties":false}},"required":["id","type","actions","buttonStyle"],"title":"CustomButton component schema"} \ No newline at end of file diff --git a/frontend/packages/ux-editor/src/testing/schemas/json/component/Datepicker.schema.v1.json b/frontend/packages/ux-editor/src/testing/schemas/json/component/Datepicker.schema.v1.json index c1559ae50ae..c760622e181 100644 --- a/frontend/packages/ux-editor/src/testing/schemas/json/component/Datepicker.schema.v1.json +++ b/frontend/packages/ux-editor/src/testing/schemas/json/component/Datepicker.schema.v1.json @@ -1,184 +1 @@ -{ - "$id": "https://altinncdn.no/schemas/json/component/Datepicker.schema.v1.json", - "$schema": "http://json-schema.org/draft-07/schema#", - "properties": { - "id": { - "title": "ID", - "description": "The component ID. Must be unique within all layouts/pages in a layout-set. Cannot end with .", - "type": "string", - "pattern": "^[0-9a-zA-Z][0-9a-zA-Z-]*(-?[a-zA-Z]+|[a-zA-Z][0-9]+|-[0-9]{6,})$" - }, - "hidden": { - "title": "Hidden", - "description": "Boolean value or expression indicating if the component should be hidden. Defaults to false.", - "default": false, - "$ref": "expression.schema.v1.json#/definitions/boolean" - }, - "grid": { - "properties": { - "xs": { "$ref": "#/definitions/IGridSize" }, - "sm": { "$ref": "#/definitions/IGridSize" }, - "md": { "$ref": "#/definitions/IGridSize" }, - "lg": { "$ref": "#/definitions/IGridSize" }, - "xl": { "$ref": "#/definitions/IGridSize" }, - "labelGrid": { "$ref": "#/definitions/IGridStyling" }, - "innerGrid": { "$ref": "#/definitions/IGridStyling" } - } - }, - "pageBreak": { - "title": "Page break", - "description": "Optionally insert page-break before/after component when rendered in PDF", - "type": "object", - "properties": { - "breakBefore": { - "title": "Page break before", - "description": "PDF only: Value or expression indicating whether a page break should be added before the component. Can be either: 'auto' (default), 'always', or 'avoid'.", - "examples": ["auto", "always", "avoid"], - "default": "auto", - "$ref": "expression.schema.v1.json#/definitions/string" - }, - "breakAfter": { - "title": "Page break after", - "description": "PDF only: Value or expression indicating whether a page break should be added after the component. Can be either: 'auto' (default), 'always', or 'avoid'.", - "examples": ["auto", "always", "avoid"], - "default": "auto", - "$ref": "expression.schema.v1.json#/definitions/string" - } - }, - "additionalProperties": false - }, - "readOnly": { - "title": "Read only/disabled?", - "description": "Boolean value or expression indicating if the component should be read only/disabled. Defaults to false.
Please note that even with read-only fields in components, it may currently be possible to update the field by modifying the request sent to the API or through a direct API call.", - "default": false, - "$ref": "expression.schema.v1.json#/definitions/boolean" - }, - "required": { - "title": "Required?", - "description": "Boolean value or expression indicating if the component should be required. Defaults to false.", - "default": false, - "$ref": "expression.schema.v1.json#/definitions/boolean" - }, - "showValidations": { - "title": "Validation types", - "description": "List of validation types to show", - "type": "array", - "items": { - "enum": [ - "Schema", - "Component", - "Expression", - "CustomBackend", - "Required", - "AllExceptRequired", - "All" - ], - "type": "string" - } - }, - "renderAsSummary": { - "title": "Render as summary", - "description": "Boolean value indicating if the component should be rendered as a summary. Defaults to false.", - "default": false, - "type": "boolean" - }, - "forceShowInSummary": { - "title": "Force show in summary", - "description": "Will force show the component in a summary even if hideEmptyFields is set to true in the summary component.", - "default": false, - "$ref": "expression.schema.v1.json#/definitions/boolean" - }, - "labelSettings": { - "title": "ILabelSettings", - "type": "object", - "properties": { - "optionalIndicator": { - "title": "Optional indicator", - "description": "Show optional indicator on label", - "type": "boolean" - } - }, - "additionalProperties": false - }, - "type": { "const": "Datepicker" }, - "textResourceBindings": { - "properties": { - "title": { - "title": "Title", - "description": "Label text/title shown above the component", - "$ref": "expression.schema.v1.json#/definitions/string" - }, - "description": { - "title": "Description", - "description": "Label description shown above the component, below the title", - "$ref": "expression.schema.v1.json#/definitions/string" - }, - "help": { - "title": "Help text", - "description": "Help text shown in a tooltip when clicking the help button", - "$ref": "expression.schema.v1.json#/definitions/string" - }, - "tableTitle": { - "title": "Table title", - "description": "Title used in the table view (overrides the default title)", - "$ref": "expression.schema.v1.json#/definitions/string" - }, - "shortName": { - "title": "Short name (for validation)", - "description": "Alternative name used for required validation messages (overrides the default title)", - "$ref": "expression.schema.v1.json#/definitions/string" - }, - "requiredValidation": { - "title": "Required validation message", - "description": "Full validation message shown when the component is required and no value has been entered (overrides both the default and shortName)", - "$ref": "expression.schema.v1.json#/definitions/string" - }, - "summaryTitle": { - "title": "Summary title", - "description": "Title used in the summary view (overrides the default title)", - "$ref": "expression.schema.v1.json#/definitions/string" - }, - "summaryAccessibleTitle": { - "title": "Accessible summary title", - "description": "Title used for aria-label on the edit button in the summary view (overrides the default and summary title)", - "$ref": "expression.schema.v1.json#/definitions/string" - } - } - }, - "dataModelBindings": { - "title": "Data model binding", - "description": "Describes the location in the data model where the component should store its value(s). A simple binding is used for components that only store a single value, usually a string.", - "type": "object", - "properties": { "simpleBinding": { "type": "string" } }, - "required": ["simpleBinding"], - "additionalProperties": false - }, - "minDate": { - "title": "Earliest date", - "description": "Sets the earliest allowed date. Can also use keyword 'today' to disable all past dates dynamically based on the current date. Defaults to 1900-01-01T12:00:00.000Z.", - "default": "1900-01-01T12:00:00.000Z", - "anyOf": [{ "type": "string" }, { "const": "today" }] - }, - "maxDate": { - "title": "Latest date", - "description": "Sets the latest allowed date. Can also use keyword 'today' to disable all future dates dynamically based on the current date. Defaults to 2100-01-01T12:00:00.000Z.", - "default": "2100-01-01T12:00:00.000Z", - "anyOf": [{ "type": "string" }, { "const": "today" }] - }, - "timeStamp": { - "title": "Include time", - "description": "Boolean value indicating if the date time should be stored as a timeStamp. Defaults to true. If true: 'YYYY-MM-DDThh:mm:ss.sssZ', if false 'YYYY-MM-DD';", - "default": true, - "type": "boolean" - }, - "format": { - "title": "Date format", - "description": "Date format used when displaying the date to the user. The user date format from the locale will be prioritized over this setting.", - "examples": ["DD/MM/YYYY", "MM/DD/YYYY", "YYYY-MM-DD"], - "default": "DD.MM.YYYY", - "type": "string" - } - }, - "required": ["id", "type", "dataModelBindings"], - "title": "Datepicker component schema" -} +{"$id":"https://altinncdn.no/schemas/json/component/Datepicker.schema.v1.json","$schema":"http://json-schema.org/draft-07/schema#","properties":{"id":{"title":"ID","description":"The component ID. Must be unique within all layouts/pages in a layout-set. Cannot end with .","type":"string","pattern":"^[0-9a-zA-Z][0-9a-zA-Z-]*(-?[a-zA-Z]+|[a-zA-Z][0-9]+|-[0-9]{6,})$"},"hidden":{"title":"Hidden","description":"Boolean value or expression indicating if the component should be hidden. Defaults to false.","default":false,"$ref":"expression.schema.v1.json#/definitions/boolean"},"grid":{"properties":{"xs":{"$ref":"#/definitions/IGridSize"},"sm":{"$ref":"#/definitions/IGridSize"},"md":{"$ref":"#/definitions/IGridSize"},"lg":{"$ref":"#/definitions/IGridSize"},"xl":{"$ref":"#/definitions/IGridSize"},"labelGrid":{"$ref":"#/definitions/IGridStyling"},"innerGrid":{"$ref":"#/definitions/IGridStyling"}}},"pageBreak":{"title":"Page break","description":"Optionally insert page-break before/after component when rendered in PDF","type":"object","properties":{"breakBefore":{"title":"Page break before","description":"PDF only: Value or expression indicating whether a page break should be added before the component. Can be either: 'auto' (default), 'always', or 'avoid'.","examples":["auto","always","avoid"],"default":"auto","$ref":"expression.schema.v1.json#/definitions/string"},"breakAfter":{"title":"Page break after","description":"PDF only: Value or expression indicating whether a page break should be added after the component. Can be either: 'auto' (default), 'always', or 'avoid'.","examples":["auto","always","avoid"],"default":"auto","$ref":"expression.schema.v1.json#/definitions/string"}},"additionalProperties":false},"readOnly":{"title":"Read only/disabled?","description":"Boolean value or expression indicating if the component should be read only/disabled. Defaults to false.
Please note that even with read-only fields in components, it may currently be possible to update the field by modifying the request sent to the API or through a direct API call.","default":false,"$ref":"expression.schema.v1.json#/definitions/boolean"},"required":{"title":"Required?","description":"Boolean value or expression indicating if the component should be required. Defaults to false.","default":false,"$ref":"expression.schema.v1.json#/definitions/boolean"},"showValidations":{"title":"Validation types","description":"List of validation types to show","type":"array","items":{"enum":["Schema","Component","Expression","CustomBackend","Required","AllExceptRequired","All"],"type":"string"}},"renderAsSummary":{"title":"Render as summary","description":"Boolean value indicating if the component should be rendered as a summary. Defaults to false.","default":false,"type":"boolean"},"forceShowInSummary":{"title":"Force show in summary","description":"Will force show the component in a summary even if hideEmptyFields is set to true in the summary component.","default":false,"$ref":"expression.schema.v1.json#/definitions/boolean"},"labelSettings":{"title":"ILabelSettings","type":"object","properties":{"optionalIndicator":{"title":"Optional indicator","description":"Show optional indicator on label","type":"boolean"}},"additionalProperties":false},"type":{"const":"Datepicker"},"textResourceBindings":{"properties":{"title":{"title":"Title","description":"Label text/title shown above the component","$ref":"expression.schema.v1.json#/definitions/string"},"description":{"title":"Description","description":"Label description shown above the component, below the title","$ref":"expression.schema.v1.json#/definitions/string"},"help":{"title":"Help text","description":"Help text shown in a tooltip when clicking the help button","$ref":"expression.schema.v1.json#/definitions/string"},"tableTitle":{"title":"Table title","description":"Title used in the table view (overrides the default title)","$ref":"expression.schema.v1.json#/definitions/string"},"shortName":{"title":"Short name (for validation)","description":"Alternative name used for required validation messages (overrides the default title)","$ref":"expression.schema.v1.json#/definitions/string"},"requiredValidation":{"title":"Required validation message","description":"Full validation message shown when the component is required and no value has been entered (overrides both the default and shortName)","$ref":"expression.schema.v1.json#/definitions/string"},"summaryTitle":{"title":"Summary title","description":"Title used in the summary view (overrides the default title)","$ref":"expression.schema.v1.json#/definitions/string"},"summaryAccessibleTitle":{"title":"Accessible summary title","description":"Title used for aria-label on the edit button in the summary view (overrides the default and summary title)","$ref":"expression.schema.v1.json#/definitions/string"}}},"dataModelBindings":{"title":"Data model binding","description":"Describes the location in the data model where the component should store its value(s). A simple binding is used for components that only store a single value, usually a string.","type":"object","properties":{"simpleBinding":{"type":"string"}},"required":["simpleBinding"],"additionalProperties":false},"minDate":{"title":"Earliest date","description":"Sets the earliest allowed date. Can also use keyword 'today' to disable all past dates dynamically based on the current date. Defaults to 1900-01-01T12:00:00.000Z.","default":"1900-01-01T12:00:00.000Z","anyOf":[{"type":"string"},{"const":"today"}]},"maxDate":{"title":"Latest date","description":"Sets the latest allowed date. Can also use keyword 'today' to disable all future dates dynamically based on the current date. Defaults to 2100-01-01T12:00:00.000Z.","default":"2100-01-01T12:00:00.000Z","anyOf":[{"type":"string"},{"const":"today"}]},"timeStamp":{"title":"Include time","description":"Boolean value indicating if the date time should be stored as a timeStamp. Defaults to true. If true: 'YYYY-MM-DDThh:mm:ss.sssZ', if false 'YYYY-MM-DD';","default":true,"type":"boolean"},"format":{"title":"Date format","description":"Date format used when displaying the date to the user. The user date format from the locale will be prioritized over this setting.","examples":["DD/MM/YYYY","MM/DD/YYYY","YYYY-MM-DD"],"default":"DD.MM.YYYY","type":"string"}},"required":["id","type","dataModelBindings"],"title":"Datepicker component schema"} \ No newline at end of file diff --git a/frontend/packages/ux-editor/src/testing/schemas/json/component/Dropdown.schema.v1.json b/frontend/packages/ux-editor/src/testing/schemas/json/component/Dropdown.schema.v1.json index 73c8d188a63..ac1518e1840 100644 --- a/frontend/packages/ux-editor/src/testing/schemas/json/component/Dropdown.schema.v1.json +++ b/frontend/packages/ux-editor/src/testing/schemas/json/component/Dropdown.schema.v1.json @@ -1,271 +1 @@ -{ - "$id": "https://altinncdn.no/schemas/json/component/Dropdown.schema.v1.json", - "$schema": "http://json-schema.org/draft-07/schema#", - "properties": { - "id": { - "title": "ID", - "description": "The component ID. Must be unique within all layouts/pages in a layout-set. Cannot end with .", - "type": "string", - "pattern": "^[0-9a-zA-Z][0-9a-zA-Z-]*(-?[a-zA-Z]+|[a-zA-Z][0-9]+|-[0-9]{6,})$" - }, - "hidden": { - "title": "Hidden", - "description": "Boolean value or expression indicating if the component should be hidden. Defaults to false.", - "default": false, - "$ref": "expression.schema.v1.json#/definitions/boolean" - }, - "grid": { - "properties": { - "xs": { "$ref": "#/definitions/IGridSize" }, - "sm": { "$ref": "#/definitions/IGridSize" }, - "md": { "$ref": "#/definitions/IGridSize" }, - "lg": { "$ref": "#/definitions/IGridSize" }, - "xl": { "$ref": "#/definitions/IGridSize" }, - "labelGrid": { "$ref": "#/definitions/IGridStyling" }, - "innerGrid": { "$ref": "#/definitions/IGridStyling" } - } - }, - "pageBreak": { - "title": "Page break", - "description": "Optionally insert page-break before/after component when rendered in PDF", - "type": "object", - "properties": { - "breakBefore": { - "title": "Page break before", - "description": "PDF only: Value or expression indicating whether a page break should be added before the component. Can be either: 'auto' (default), 'always', or 'avoid'.", - "examples": ["auto", "always", "avoid"], - "default": "auto", - "$ref": "expression.schema.v1.json#/definitions/string" - }, - "breakAfter": { - "title": "Page break after", - "description": "PDF only: Value or expression indicating whether a page break should be added after the component. Can be either: 'auto' (default), 'always', or 'avoid'.", - "examples": ["auto", "always", "avoid"], - "default": "auto", - "$ref": "expression.schema.v1.json#/definitions/string" - } - }, - "additionalProperties": false - }, - "readOnly": { - "title": "Read only/disabled?", - "description": "Boolean value or expression indicating if the component should be read only/disabled. Defaults to false.
Please note that even with read-only fields in components, it may currently be possible to update the field by modifying the request sent to the API or through a direct API call.", - "default": false, - "$ref": "expression.schema.v1.json#/definitions/boolean" - }, - "required": { - "title": "Required?", - "description": "Boolean value or expression indicating if the component should be required. Defaults to false.", - "default": false, - "$ref": "expression.schema.v1.json#/definitions/boolean" - }, - "showValidations": { - "title": "Validation types", - "description": "List of validation types to show", - "type": "array", - "items": { - "enum": [ - "Schema", - "Component", - "Expression", - "CustomBackend", - "Required", - "AllExceptRequired", - "All" - ], - "type": "string" - } - }, - "renderAsSummary": { - "title": "Render as summary", - "description": "Boolean value indicating if the component should be rendered as a summary. Defaults to false.", - "default": false, - "type": "boolean" - }, - "forceShowInSummary": { - "title": "Force show in summary", - "description": "Will force show the component in a summary even if hideEmptyFields is set to true in the summary component.", - "default": false, - "$ref": "expression.schema.v1.json#/definitions/boolean" - }, - "optionsId": { - "title": "Dynamic options (fetched from server)", - "description": "ID of the option list to fetch from the server", - "type": "string" - }, - "mapping": { - "title": "Mapping", - "description": "A mapping of key-value pairs (usually used for mapping a path in the data model to a query string parameter).", - "type": "object", - "properties": {}, - "additionalProperties": { "type": "string" } - }, - "queryParameters": { - "title": "Query parameters", - "description": "A mapping of query string parameters to values. Will be appended to the URL when fetching options.", - "type": "object", - "properties": {}, - "additionalProperties": { "type": "string" } - }, - "options": { - "title": "Static options", - "description": "List of static options", - "type": "array", - "items": { - "title": "IRawOption", - "examples": [{ "label": "", "value": "" }], - "type": "object", - "properties": { - "label": { "type": "string" }, - "value": { - "anyOf": [ - { "type": "string" }, - { "type": "number" }, - { "type": "boolean" }, - { "const": null } - ] - }, - "description": { "type": "string" }, - "helpText": { "type": "string" } - }, - "required": ["label", "value"], - "additionalProperties": false - } - }, - "secure": { - "title": "Secure options (when using optionsId)", - "description": "Whether to call the secure API endpoint when fetching options from the server (allows for user/instance-specific options)", - "default": false, - "type": "boolean" - }, - "sortOrder": { - "description": "Sorts the code list in either ascending or descending order by label.", - "enum": ["asc", "desc"], - "type": "string" - }, - "source": { - "title": "Option source", - "description": "Allows for fetching options from the data model, pointing to a repeating group structure", - "type": "object", - "properties": { - "group": { - "title": "Group", - "description": "The repeating group to base options on.", - "examples": ["model.some.group"], - "type": "string" - }, - "label": { - "title": "Label", - "description": "A label of the option displayed in Radio- and Checkbox groups. Can be plain text, a text resource binding, or a dynamic expression.", - "examples": ["some.text.key"], - "$ref": "expression.schema.v1.json#/definitions/string" - }, - "value": { - "title": "Value", - "description": "Field in the group that should be used as value", - "examples": ["model.some.group[{0}].someField"], - "type": "string" - }, - "description": { - "title": "Description", - "description": "A description of the option displayed in Radio- and Checkbox groups. Can be plain text, a text resource binding, or a dynamic expression.", - "examples": ["some.text.key", "My Description"], - "$ref": "expression.schema.v1.json#/definitions/string" - }, - "helpText": { - "title": "Help Text", - "description": "A help text for the option displayed in Radio- and Checkbox groups. Can be plain text, a text resource binding, or a dynamic expression.", - "examples": ["some.text.key", "My Help Text"], - "$ref": "expression.schema.v1.json#/definitions/string" - } - }, - "required": ["group", "label", "value"], - "additionalProperties": false - }, - "preselectedOptionIndex": { - "title": "Preselected option index", - "description": "Index of the option to preselect (if no option has been selected yet)", - "type": "integer" - }, - "labelSettings": { - "title": "ILabelSettings", - "type": "object", - "properties": { - "optionalIndicator": { - "title": "Optional indicator", - "description": "Show optional indicator on label", - "type": "boolean" - } - }, - "additionalProperties": false - }, - "type": { "const": "Dropdown" }, - "textResourceBindings": { - "properties": { - "title": { - "title": "Title", - "description": "Label text/title shown above the component", - "$ref": "expression.schema.v1.json#/definitions/string" - }, - "description": { - "title": "Description", - "description": "Label description shown above the component, below the title", - "$ref": "expression.schema.v1.json#/definitions/string" - }, - "help": { - "title": "Help text", - "description": "Help text shown in a tooltip when clicking the help button", - "$ref": "expression.schema.v1.json#/definitions/string" - }, - "tableTitle": { - "title": "Table title", - "description": "Title used in the table view (overrides the default title)", - "$ref": "expression.schema.v1.json#/definitions/string" - }, - "shortName": { - "title": "Short name (for validation)", - "description": "Alternative name used for required validation messages (overrides the default title)", - "$ref": "expression.schema.v1.json#/definitions/string" - }, - "requiredValidation": { - "title": "Required validation message", - "description": "Full validation message shown when the component is required and no value has been entered (overrides both the default and shortName)", - "$ref": "expression.schema.v1.json#/definitions/string" - }, - "summaryTitle": { - "title": "Summary title", - "description": "Title used in the summary view (overrides the default title)", - "$ref": "expression.schema.v1.json#/definitions/string" - }, - "summaryAccessibleTitle": { - "title": "Accessible summary title", - "description": "Title used for aria-label on the edit button in the summary view (overrides the default and summary title)", - "$ref": "expression.schema.v1.json#/definitions/string" - } - } - }, - "alertOnChange": { - "title": "Alert on change", - "description": "Boolean value indicating if the component should alert on change", - "default": false, - "$ref": "expression.schema.v1.json#/definitions/boolean" - }, - "dataModelBindings": { - "title": "Data model binding", - "description": "Describes the location in the data model where the component should store its value(s). A simple binding is used for components that only store a single value, usually a string.", - "type": "object", - "properties": { - "simpleBinding": { "type": "string" }, - "label": { "type": "string" }, - "metadata": { - "description": "Describes the location where metadata for the option based component should be stored in the datamodel.", - "type": "string" - } - }, - "required": ["simpleBinding"], - "additionalProperties": false - } - }, - "required": ["id", "type", "dataModelBindings"], - "title": "Dropdown component schema" -} +{"$id":"https://altinncdn.no/schemas/json/component/Dropdown.schema.v1.json","$schema":"http://json-schema.org/draft-07/schema#","properties":{"id":{"title":"ID","description":"The component ID. Must be unique within all layouts/pages in a layout-set. Cannot end with .","type":"string","pattern":"^[0-9a-zA-Z][0-9a-zA-Z-]*(-?[a-zA-Z]+|[a-zA-Z][0-9]+|-[0-9]{6,})$"},"hidden":{"title":"Hidden","description":"Boolean value or expression indicating if the component should be hidden. Defaults to false.","default":false,"$ref":"expression.schema.v1.json#/definitions/boolean"},"grid":{"properties":{"xs":{"$ref":"#/definitions/IGridSize"},"sm":{"$ref":"#/definitions/IGridSize"},"md":{"$ref":"#/definitions/IGridSize"},"lg":{"$ref":"#/definitions/IGridSize"},"xl":{"$ref":"#/definitions/IGridSize"},"labelGrid":{"$ref":"#/definitions/IGridStyling"},"innerGrid":{"$ref":"#/definitions/IGridStyling"}}},"pageBreak":{"title":"Page break","description":"Optionally insert page-break before/after component when rendered in PDF","type":"object","properties":{"breakBefore":{"title":"Page break before","description":"PDF only: Value or expression indicating whether a page break should be added before the component. Can be either: 'auto' (default), 'always', or 'avoid'.","examples":["auto","always","avoid"],"default":"auto","$ref":"expression.schema.v1.json#/definitions/string"},"breakAfter":{"title":"Page break after","description":"PDF only: Value or expression indicating whether a page break should be added after the component. Can be either: 'auto' (default), 'always', or 'avoid'.","examples":["auto","always","avoid"],"default":"auto","$ref":"expression.schema.v1.json#/definitions/string"}},"additionalProperties":false},"readOnly":{"title":"Read only/disabled?","description":"Boolean value or expression indicating if the component should be read only/disabled. Defaults to false.
Please note that even with read-only fields in components, it may currently be possible to update the field by modifying the request sent to the API or through a direct API call.","default":false,"$ref":"expression.schema.v1.json#/definitions/boolean"},"required":{"title":"Required?","description":"Boolean value or expression indicating if the component should be required. Defaults to false.","default":false,"$ref":"expression.schema.v1.json#/definitions/boolean"},"showValidations":{"title":"Validation types","description":"List of validation types to show","type":"array","items":{"enum":["Schema","Component","Expression","CustomBackend","Required","AllExceptRequired","All"],"type":"string"}},"renderAsSummary":{"title":"Render as summary","description":"Boolean value indicating if the component should be rendered as a summary. Defaults to false.","default":false,"type":"boolean"},"forceShowInSummary":{"title":"Force show in summary","description":"Will force show the component in a summary even if hideEmptyFields is set to true in the summary component.","default":false,"$ref":"expression.schema.v1.json#/definitions/boolean"},"optionsId":{"title":"Dynamic options (fetched from server)","description":"ID of the option list to fetch from the server","type":"string"},"mapping":{"title":"Mapping","description":"A mapping of key-value pairs (usually used for mapping a path in the data model to a query string parameter).","type":"object","properties":{},"additionalProperties":{"type":"string"}},"queryParameters":{"title":"Query parameters","description":"A mapping of query string parameters to values. Will be appended to the URL when fetching options.","type":"object","properties":{},"additionalProperties":{"type":"string"}},"options":{"title":"Static options","description":"List of static options","type":"array","items":{"title":"IRawOption","examples":[{"label":"","value":""}],"type":"object","properties":{"label":{"type":"string"},"value":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"const":null}]},"description":{"type":"string"},"helpText":{"type":"string"}},"required":["label","value"],"additionalProperties":false}},"secure":{"title":"Secure options (when using optionsId)","description":"Whether to call the secure API endpoint when fetching options from the server (allows for user/instance-specific options)","default":false,"type":"boolean"},"sortOrder":{"description":"Sorts the code list in either ascending or descending order by label.","enum":["asc","desc"],"type":"string"},"source":{"title":"Option source","description":"Allows for fetching options from the data model, pointing to a repeating group structure","type":"object","properties":{"group":{"title":"Group","description":"The repeating group to base options on.","examples":["model.some.group"],"type":"string"},"label":{"title":"Label","description":"A label of the option displayed in Radio- and Checkbox groups. Can be plain text, a text resource binding, or a dynamic expression.","examples":["some.text.key"],"$ref":"expression.schema.v1.json#/definitions/string"},"value":{"title":"Value","description":"Field in the group that should be used as value","examples":["model.some.group[{0}].someField"],"type":"string"},"description":{"title":"Description","description":"A description of the option displayed in Radio- and Checkbox groups. Can be plain text, a text resource binding, or a dynamic expression.","examples":["some.text.key","My Description"],"$ref":"expression.schema.v1.json#/definitions/string"},"helpText":{"title":"Help Text","description":"A help text for the option displayed in Radio- and Checkbox groups. Can be plain text, a text resource binding, or a dynamic expression.","examples":["some.text.key","My Help Text"],"$ref":"expression.schema.v1.json#/definitions/string"}},"required":["group","label","value"],"additionalProperties":false},"preselectedOptionIndex":{"title":"Preselected option index","description":"Index of the option to preselect (if no option has been selected yet)","type":"integer"},"labelSettings":{"title":"ILabelSettings","type":"object","properties":{"optionalIndicator":{"title":"Optional indicator","description":"Show optional indicator on label","type":"boolean"}},"additionalProperties":false},"type":{"const":"Dropdown"},"textResourceBindings":{"properties":{"title":{"title":"Title","description":"Label text/title shown above the component","$ref":"expression.schema.v1.json#/definitions/string"},"description":{"title":"Description","description":"Label description shown above the component, below the title","$ref":"expression.schema.v1.json#/definitions/string"},"help":{"title":"Help text","description":"Help text shown in a tooltip when clicking the help button","$ref":"expression.schema.v1.json#/definitions/string"},"tableTitle":{"title":"Table title","description":"Title used in the table view (overrides the default title)","$ref":"expression.schema.v1.json#/definitions/string"},"shortName":{"title":"Short name (for validation)","description":"Alternative name used for required validation messages (overrides the default title)","$ref":"expression.schema.v1.json#/definitions/string"},"requiredValidation":{"title":"Required validation message","description":"Full validation message shown when the component is required and no value has been entered (overrides both the default and shortName)","$ref":"expression.schema.v1.json#/definitions/string"},"summaryTitle":{"title":"Summary title","description":"Title used in the summary view (overrides the default title)","$ref":"expression.schema.v1.json#/definitions/string"},"summaryAccessibleTitle":{"title":"Accessible summary title","description":"Title used for aria-label on the edit button in the summary view (overrides the default and summary title)","$ref":"expression.schema.v1.json#/definitions/string"}}},"alertOnChange":{"title":"Alert on change","description":"Boolean value indicating if the component should alert on change","default":false,"$ref":"expression.schema.v1.json#/definitions/boolean"},"dataModelBindings":{"title":"Data model binding","description":"Describes the location in the data model where the component should store its value(s). A simple binding is used for components that only store a single value, usually a string.","type":"object","properties":{"simpleBinding":{"type":"string"},"label":{"type":"string"},"metadata":{"description":"Describes the location where metadata for the option based component should be stored in the datamodel.","type":"string"}},"required":["simpleBinding"],"additionalProperties":false}},"required":["id","type","dataModelBindings"],"title":"Dropdown component schema"} \ No newline at end of file diff --git a/frontend/packages/ux-editor/src/testing/schemas/json/component/FileUpload.schema.v1.json b/frontend/packages/ux-editor/src/testing/schemas/json/component/FileUpload.schema.v1.json index cbd5260014e..78d3bbf6ad8 100644 --- a/frontend/packages/ux-editor/src/testing/schemas/json/component/FileUpload.schema.v1.json +++ b/frontend/packages/ux-editor/src/testing/schemas/json/component/FileUpload.schema.v1.json @@ -1,212 +1 @@ -{ - "$id": "https://altinncdn.no/schemas/json/component/FileUpload.schema.v1.json", - "$schema": "http://json-schema.org/draft-07/schema#", - "properties": { - "id": { - "title": "ID", - "description": "The component ID. Must be unique within all layouts/pages in a layout-set. Cannot end with .", - "type": "string", - "pattern": "^[0-9a-zA-Z][0-9a-zA-Z-]*(-?[a-zA-Z]+|[a-zA-Z][0-9]+|-[0-9]{6,})$" - }, - "hidden": { - "title": "Hidden", - "description": "Boolean value or expression indicating if the component should be hidden. Defaults to false.", - "default": false, - "$ref": "expression.schema.v1.json#/definitions/boolean" - }, - "grid": { - "properties": { - "xs": { "$ref": "#/definitions/IGridSize" }, - "sm": { "$ref": "#/definitions/IGridSize" }, - "md": { "$ref": "#/definitions/IGridSize" }, - "lg": { "$ref": "#/definitions/IGridSize" }, - "xl": { "$ref": "#/definitions/IGridSize" }, - "labelGrid": { "$ref": "#/definitions/IGridStyling" }, - "innerGrid": { "$ref": "#/definitions/IGridStyling" } - } - }, - "pageBreak": { - "title": "Page break", - "description": "Optionally insert page-break before/after component when rendered in PDF", - "type": "object", - "properties": { - "breakBefore": { - "title": "Page break before", - "description": "PDF only: Value or expression indicating whether a page break should be added before the component. Can be either: 'auto' (default), 'always', or 'avoid'.", - "examples": ["auto", "always", "avoid"], - "default": "auto", - "$ref": "expression.schema.v1.json#/definitions/string" - }, - "breakAfter": { - "title": "Page break after", - "description": "PDF only: Value or expression indicating whether a page break should be added after the component. Can be either: 'auto' (default), 'always', or 'avoid'.", - "examples": ["auto", "always", "avoid"], - "default": "auto", - "$ref": "expression.schema.v1.json#/definitions/string" - } - }, - "additionalProperties": false - }, - "readOnly": { - "title": "Read only/disabled?", - "description": "Boolean value or expression indicating if the component should be read only/disabled. Defaults to false.
Please note that even with read-only fields in components, it may currently be possible to update the field by modifying the request sent to the API or through a direct API call.", - "default": false, - "$ref": "expression.schema.v1.json#/definitions/boolean" - }, - "required": { - "title": "Required?", - "description": "Boolean value or expression indicating if the component should be required. Defaults to false.", - "default": false, - "$ref": "expression.schema.v1.json#/definitions/boolean" - }, - "showValidations": { - "title": "Validation types", - "description": "List of validation types to show", - "type": "array", - "items": { - "enum": [ - "Schema", - "Component", - "Expression", - "CustomBackend", - "Required", - "AllExceptRequired", - "All" - ], - "type": "string" - } - }, - "renderAsSummary": { - "title": "Render as summary", - "description": "Boolean value indicating if the component should be rendered as a summary. Defaults to false.", - "default": false, - "type": "boolean" - }, - "forceShowInSummary": { - "title": "Force show in summary", - "description": "Will force show the component in a summary even if hideEmptyFields is set to true in the summary component.", - "default": false, - "$ref": "expression.schema.v1.json#/definitions/boolean" - }, - "labelSettings": { - "title": "ILabelSettings", - "type": "object", - "properties": { - "optionalIndicator": { - "title": "Optional indicator", - "description": "Show optional indicator on label", - "type": "boolean" - } - }, - "additionalProperties": false - }, - "type": { "const": "FileUpload" }, - "textResourceBindings": { - "properties": { - "title": { - "title": "Title", - "description": "Label text/title shown above the component", - "$ref": "expression.schema.v1.json#/definitions/string" - }, - "description": { - "title": "Description", - "description": "Label description shown above the component, below the title", - "$ref": "expression.schema.v1.json#/definitions/string" - }, - "help": { - "title": "Help text", - "description": "Help text shown in a tooltip when clicking the help button", - "$ref": "expression.schema.v1.json#/definitions/string" - }, - "tableTitle": { - "title": "Table title", - "description": "Title used in the table view (overrides the default title)", - "$ref": "expression.schema.v1.json#/definitions/string" - }, - "shortName": { - "title": "Short name (for validation)", - "description": "Alternative name used for required validation messages (overrides the default title)", - "$ref": "expression.schema.v1.json#/definitions/string" - }, - "requiredValidation": { - "title": "Required validation message", - "description": "Full validation message shown when the component is required and no value has been entered (overrides both the default and shortName)", - "$ref": "expression.schema.v1.json#/definitions/string" - }, - "summaryTitle": { - "title": "Summary title", - "description": "Title used in the summary view (overrides the default title)", - "$ref": "expression.schema.v1.json#/definitions/string" - }, - "summaryAccessibleTitle": { - "title": "Accessible summary title", - "description": "Title used for aria-label on the edit button in the summary view (overrides the default and summary title)", - "$ref": "expression.schema.v1.json#/definitions/string" - } - } - }, - "dataModelBindings": { - "anyOf": [ - { - "title": "Data model binding", - "description": "Describes the location in the data model where the component should store its value(s). A simple binding is used for components that only store a single value, usually a string.", - "type": "object", - "properties": { "simpleBinding": { "type": "string" } }, - "required": ["simpleBinding"], - "additionalProperties": false - }, - { - "title": "Data model binding", - "description": "Describes the location in the data model where the component should store its value(s). A list binding should be pointed to an array structure in the data model, and is used for components that store multiple simple values (e.g. a list of strings).", - "type": "object", - "properties": { "list": { "type": "string" } }, - "required": ["list"], - "additionalProperties": false - } - ] - }, - "maxFileSizeInMB": { - "title": "Max file size (MB)", - "description": "Sets the maximum file size allowed in megabytes", - "type": "integer" - }, - "maxNumberOfAttachments": { - "title": "Max number of attachments", - "description": "Sets the maximum number of attachments allowed to upload", - "type": "integer" - }, - "minNumberOfAttachments": { - "title": "Min number of attachments", - "description": "Sets the minimum number of attachments required to upload", - "type": "integer" - }, - "displayMode": { "enum": ["simple", "list"], "type": "string" }, - "hasCustomFileEndings": { - "title": "Has custom file endings", - "description": "Boolean value indicating if the component has valid file endings", - "default": false, - "type": "boolean" - }, - "validFileEndings": { - "title": "Valid file endings", - "description": "A separated string of valid file endings to upload. If not set all endings are accepted.", - "examples": [".csv", ".doc", ".docx", ".gif", ".jpeg", ".pdf", ".txt"], - "anyOf": [{ "type": "string" }, { "type": "array", "items": { "type": "string" } }] - }, - "alertOnDelete": { - "title": "Alert on delete", - "description": "Boolean value indicating if warning popup should be displayed when attempting to delete an element", - "default": false, - "$ref": "expression.schema.v1.json#/definitions/boolean" - } - }, - "required": [ - "id", - "type", - "maxFileSizeInMB", - "maxNumberOfAttachments", - "minNumberOfAttachments", - "displayMode" - ], - "title": "FileUpload component schema" -} +{"$id":"https://altinncdn.no/schemas/json/component/FileUpload.schema.v1.json","$schema":"http://json-schema.org/draft-07/schema#","properties":{"id":{"title":"ID","description":"The component ID. Must be unique within all layouts/pages in a layout-set. Cannot end with .","type":"string","pattern":"^[0-9a-zA-Z][0-9a-zA-Z-]*(-?[a-zA-Z]+|[a-zA-Z][0-9]+|-[0-9]{6,})$"},"hidden":{"title":"Hidden","description":"Boolean value or expression indicating if the component should be hidden. Defaults to false.","default":false,"$ref":"expression.schema.v1.json#/definitions/boolean"},"grid":{"properties":{"xs":{"$ref":"#/definitions/IGridSize"},"sm":{"$ref":"#/definitions/IGridSize"},"md":{"$ref":"#/definitions/IGridSize"},"lg":{"$ref":"#/definitions/IGridSize"},"xl":{"$ref":"#/definitions/IGridSize"},"labelGrid":{"$ref":"#/definitions/IGridStyling"},"innerGrid":{"$ref":"#/definitions/IGridStyling"}}},"pageBreak":{"title":"Page break","description":"Optionally insert page-break before/after component when rendered in PDF","type":"object","properties":{"breakBefore":{"title":"Page break before","description":"PDF only: Value or expression indicating whether a page break should be added before the component. Can be either: 'auto' (default), 'always', or 'avoid'.","examples":["auto","always","avoid"],"default":"auto","$ref":"expression.schema.v1.json#/definitions/string"},"breakAfter":{"title":"Page break after","description":"PDF only: Value or expression indicating whether a page break should be added after the component. Can be either: 'auto' (default), 'always', or 'avoid'.","examples":["auto","always","avoid"],"default":"auto","$ref":"expression.schema.v1.json#/definitions/string"}},"additionalProperties":false},"readOnly":{"title":"Read only/disabled?","description":"Boolean value or expression indicating if the component should be read only/disabled. Defaults to false.
Please note that even with read-only fields in components, it may currently be possible to update the field by modifying the request sent to the API or through a direct API call.","default":false,"$ref":"expression.schema.v1.json#/definitions/boolean"},"required":{"title":"Required?","description":"Boolean value or expression indicating if the component should be required. Defaults to false.","default":false,"$ref":"expression.schema.v1.json#/definitions/boolean"},"showValidations":{"title":"Validation types","description":"List of validation types to show","type":"array","items":{"enum":["Schema","Component","Expression","CustomBackend","Required","AllExceptRequired","All"],"type":"string"}},"renderAsSummary":{"title":"Render as summary","description":"Boolean value indicating if the component should be rendered as a summary. Defaults to false.","default":false,"type":"boolean"},"forceShowInSummary":{"title":"Force show in summary","description":"Will force show the component in a summary even if hideEmptyFields is set to true in the summary component.","default":false,"$ref":"expression.schema.v1.json#/definitions/boolean"},"labelSettings":{"title":"ILabelSettings","type":"object","properties":{"optionalIndicator":{"title":"Optional indicator","description":"Show optional indicator on label","type":"boolean"}},"additionalProperties":false},"type":{"const":"FileUpload"},"textResourceBindings":{"properties":{"title":{"title":"Title","description":"Label text/title shown above the component","$ref":"expression.schema.v1.json#/definitions/string"},"description":{"title":"Description","description":"Label description shown above the component, below the title","$ref":"expression.schema.v1.json#/definitions/string"},"help":{"title":"Help text","description":"Help text shown in a tooltip when clicking the help button","$ref":"expression.schema.v1.json#/definitions/string"},"tableTitle":{"title":"Table title","description":"Title used in the table view (overrides the default title)","$ref":"expression.schema.v1.json#/definitions/string"},"shortName":{"title":"Short name (for validation)","description":"Alternative name used for required validation messages (overrides the default title)","$ref":"expression.schema.v1.json#/definitions/string"},"requiredValidation":{"title":"Required validation message","description":"Full validation message shown when the component is required and no value has been entered (overrides both the default and shortName)","$ref":"expression.schema.v1.json#/definitions/string"},"summaryTitle":{"title":"Summary title","description":"Title used in the summary view (overrides the default title)","$ref":"expression.schema.v1.json#/definitions/string"},"summaryAccessibleTitle":{"title":"Accessible summary title","description":"Title used for aria-label on the edit button in the summary view (overrides the default and summary title)","$ref":"expression.schema.v1.json#/definitions/string"}}},"dataModelBindings":{"anyOf":[{"title":"Data model binding","description":"Describes the location in the data model where the component should store its value(s). A simple binding is used for components that only store a single value, usually a string.","type":"object","properties":{"simpleBinding":{"type":"string"}},"required":["simpleBinding"],"additionalProperties":false},{"title":"Data model binding","description":"Describes the location in the data model where the component should store its value(s). A list binding should be pointed to an array structure in the data model, and is used for components that store multiple simple values (e.g. a list of strings).","type":"object","properties":{"list":{"type":"string"}},"required":["list"],"additionalProperties":false}]},"maxFileSizeInMB":{"title":"Max file size (MB)","description":"Sets the maximum file size allowed in megabytes","type":"integer"},"maxNumberOfAttachments":{"title":"Max number of attachments","description":"Sets the maximum number of attachments allowed to upload","type":"integer"},"minNumberOfAttachments":{"title":"Min number of attachments","description":"Sets the minimum number of attachments required to upload","type":"integer"},"displayMode":{"enum":["simple","list"],"type":"string"},"hasCustomFileEndings":{"title":"Has custom file endings","description":"Boolean value indicating if the component has valid file endings","default":false,"type":"boolean"},"validFileEndings":{"title":"Valid file endings","description":"A separated string of valid file endings to upload. If not set all endings are accepted.","examples":[".csv",".doc",".docx",".gif",".jpeg",".pdf",".txt"],"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]},"alertOnDelete":{"title":"Alert on delete","description":"Boolean value indicating if warning popup should be displayed when attempting to delete an element","default":false,"$ref":"expression.schema.v1.json#/definitions/boolean"}},"required":["id","type","maxFileSizeInMB","maxNumberOfAttachments","minNumberOfAttachments","displayMode"],"title":"FileUpload component schema"} \ No newline at end of file diff --git a/frontend/packages/ux-editor/src/testing/schemas/json/component/FileUploadWithTag.schema.v1.json b/frontend/packages/ux-editor/src/testing/schemas/json/component/FileUploadWithTag.schema.v1.json index 162a3a619da..49497d4bb41 100644 --- a/frontend/packages/ux-editor/src/testing/schemas/json/component/FileUploadWithTag.schema.v1.json +++ b/frontend/packages/ux-editor/src/testing/schemas/json/component/FileUploadWithTag.schema.v1.json @@ -1,311 +1 @@ -{ - "$id": "https://altinncdn.no/schemas/json/component/FileUploadWithTag.schema.v1.json", - "$schema": "http://json-schema.org/draft-07/schema#", - "properties": { - "id": { - "title": "ID", - "description": "The component ID. Must be unique within all layouts/pages in a layout-set. Cannot end with .", - "type": "string", - "pattern": "^[0-9a-zA-Z][0-9a-zA-Z-]*(-?[a-zA-Z]+|[a-zA-Z][0-9]+|-[0-9]{6,})$" - }, - "hidden": { - "title": "Hidden", - "description": "Boolean value or expression indicating if the component should be hidden. Defaults to false.", - "default": false, - "$ref": "expression.schema.v1.json#/definitions/boolean" - }, - "grid": { - "properties": { - "xs": { "$ref": "#/definitions/IGridSize" }, - "sm": { "$ref": "#/definitions/IGridSize" }, - "md": { "$ref": "#/definitions/IGridSize" }, - "lg": { "$ref": "#/definitions/IGridSize" }, - "xl": { "$ref": "#/definitions/IGridSize" }, - "labelGrid": { "$ref": "#/definitions/IGridStyling" }, - "innerGrid": { "$ref": "#/definitions/IGridStyling" } - } - }, - "pageBreak": { - "title": "Page break", - "description": "Optionally insert page-break before/after component when rendered in PDF", - "type": "object", - "properties": { - "breakBefore": { - "title": "Page break before", - "description": "PDF only: Value or expression indicating whether a page break should be added before the component. Can be either: 'auto' (default), 'always', or 'avoid'.", - "examples": ["auto", "always", "avoid"], - "default": "auto", - "$ref": "expression.schema.v1.json#/definitions/string" - }, - "breakAfter": { - "title": "Page break after", - "description": "PDF only: Value or expression indicating whether a page break should be added after the component. Can be either: 'auto' (default), 'always', or 'avoid'.", - "examples": ["auto", "always", "avoid"], - "default": "auto", - "$ref": "expression.schema.v1.json#/definitions/string" - } - }, - "additionalProperties": false - }, - "readOnly": { - "title": "Read only/disabled?", - "description": "Boolean value or expression indicating if the component should be read only/disabled. Defaults to false.
Please note that even with read-only fields in components, it may currently be possible to update the field by modifying the request sent to the API or through a direct API call.", - "default": false, - "$ref": "expression.schema.v1.json#/definitions/boolean" - }, - "required": { - "title": "Required?", - "description": "Boolean value or expression indicating if the component should be required. Defaults to false.", - "default": false, - "$ref": "expression.schema.v1.json#/definitions/boolean" - }, - "showValidations": { - "title": "Validation types", - "description": "List of validation types to show", - "type": "array", - "items": { - "enum": [ - "Schema", - "Component", - "Expression", - "CustomBackend", - "Required", - "AllExceptRequired", - "All" - ], - "type": "string" - } - }, - "renderAsSummary": { - "title": "Render as summary", - "description": "Boolean value indicating if the component should be rendered as a summary. Defaults to false.", - "default": false, - "type": "boolean" - }, - "forceShowInSummary": { - "title": "Force show in summary", - "description": "Will force show the component in a summary even if hideEmptyFields is set to true in the summary component.", - "default": false, - "$ref": "expression.schema.v1.json#/definitions/boolean" - }, - "labelSettings": { - "title": "ILabelSettings", - "type": "object", - "properties": { - "optionalIndicator": { - "title": "Optional indicator", - "description": "Show optional indicator on label", - "type": "boolean" - } - }, - "additionalProperties": false - }, - "optionsId": { - "title": "Dynamic options (fetched from server)", - "description": "ID of the option list to fetch from the server", - "type": "string" - }, - "mapping": { - "title": "Mapping", - "description": "A mapping of key-value pairs (usually used for mapping a path in the data model to a query string parameter).", - "type": "object", - "properties": {}, - "additionalProperties": { "type": "string" } - }, - "queryParameters": { - "title": "Query parameters", - "description": "A mapping of query string parameters to values. Will be appended to the URL when fetching options.", - "type": "object", - "properties": {}, - "additionalProperties": { "type": "string" } - }, - "options": { - "title": "Static options", - "description": "List of static options", - "type": "array", - "items": { - "title": "IRawOption", - "examples": [{ "label": "", "value": "" }], - "type": "object", - "properties": { - "label": { "type": "string" }, - "value": { - "anyOf": [ - { "type": "string" }, - { "type": "number" }, - { "type": "boolean" }, - { "const": null } - ] - }, - "description": { "type": "string" }, - "helpText": { "type": "string" } - }, - "required": ["label", "value"], - "additionalProperties": false - } - }, - "secure": { - "title": "Secure options (when using optionsId)", - "description": "Whether to call the secure API endpoint when fetching options from the server (allows for user/instance-specific options)", - "default": false, - "type": "boolean" - }, - "sortOrder": { - "description": "Sorts the code list in either ascending or descending order by label.", - "enum": ["asc", "desc"], - "type": "string" - }, - "source": { - "title": "Option source", - "description": "Allows for fetching options from the data model, pointing to a repeating group structure", - "type": "object", - "properties": { - "group": { - "title": "Group", - "description": "The repeating group to base options on.", - "examples": ["model.some.group"], - "type": "string" - }, - "label": { - "title": "Label", - "description": "A label of the option displayed in Radio- and Checkbox groups. Can be plain text, a text resource binding, or a dynamic expression.", - "examples": ["some.text.key"], - "$ref": "expression.schema.v1.json#/definitions/string" - }, - "value": { - "title": "Value", - "description": "Field in the group that should be used as value", - "examples": ["model.some.group[{0}].someField"], - "type": "string" - }, - "description": { - "title": "Description", - "description": "A description of the option displayed in Radio- and Checkbox groups. Can be plain text, a text resource binding, or a dynamic expression.", - "examples": ["some.text.key", "My Description"], - "$ref": "expression.schema.v1.json#/definitions/string" - }, - "helpText": { - "title": "Help Text", - "description": "A help text for the option displayed in Radio- and Checkbox groups. Can be plain text, a text resource binding, or a dynamic expression.", - "examples": ["some.text.key", "My Help Text"], - "$ref": "expression.schema.v1.json#/definitions/string" - } - }, - "required": ["group", "label", "value"], - "additionalProperties": false - }, - "type": { "const": "FileUploadWithTag" }, - "textResourceBindings": { - "properties": { - "title": { - "title": "Title", - "description": "Label text/title shown above the component", - "$ref": "expression.schema.v1.json#/definitions/string" - }, - "description": { - "title": "Description", - "description": "Label description shown above the component, below the title", - "$ref": "expression.schema.v1.json#/definitions/string" - }, - "help": { - "title": "Help text", - "description": "Help text shown in a tooltip when clicking the help button", - "$ref": "expression.schema.v1.json#/definitions/string" - }, - "tableTitle": { - "title": "Table title", - "description": "Title used in the table view (overrides the default title)", - "$ref": "expression.schema.v1.json#/definitions/string" - }, - "shortName": { - "title": "Short name (for validation)", - "description": "Alternative name used for required validation messages (overrides the default title)", - "$ref": "expression.schema.v1.json#/definitions/string" - }, - "requiredValidation": { - "title": "Required validation message", - "description": "Full validation message shown when the component is required and no value has been entered (overrides both the default and shortName)", - "$ref": "expression.schema.v1.json#/definitions/string" - }, - "summaryTitle": { - "title": "Summary title", - "description": "Title used in the summary view (overrides the default title)", - "$ref": "expression.schema.v1.json#/definitions/string" - }, - "summaryAccessibleTitle": { - "title": "Accessible summary title", - "description": "Title used for aria-label on the edit button in the summary view (overrides the default and summary title)", - "$ref": "expression.schema.v1.json#/definitions/string" - }, - "tagTitle": { - "title": "Tag title", - "description": "The title to show when selecting a tag for each uploaded file", - "$ref": "expression.schema.v1.json#/definitions/string" - } - } - }, - "dataModelBindings": { - "anyOf": [ - { - "title": "Data model binding", - "description": "Describes the location in the data model where the component should store its value(s). A simple binding is used for components that only store a single value, usually a string.", - "type": "object", - "properties": { "simpleBinding": { "type": "string" } }, - "required": ["simpleBinding"], - "additionalProperties": false - }, - { - "title": "Data model binding", - "description": "Describes the location in the data model where the component should store its value(s). A list binding should be pointed to an array structure in the data model, and is used for components that store multiple simple values (e.g. a list of strings).", - "type": "object", - "properties": { "list": { "type": "string" } }, - "required": ["list"], - "additionalProperties": false - } - ] - }, - "maxFileSizeInMB": { - "title": "Max file size (MB)", - "description": "Sets the maximum file size allowed in megabytes", - "type": "integer" - }, - "maxNumberOfAttachments": { - "title": "Max number of attachments", - "description": "Sets the maximum number of attachments allowed to upload", - "type": "integer" - }, - "minNumberOfAttachments": { - "title": "Min number of attachments", - "description": "Sets the minimum number of attachments required to upload", - "type": "integer" - }, - "displayMode": { "enum": ["simple", "list"], "type": "string" }, - "hasCustomFileEndings": { - "title": "Has custom file endings", - "description": "Boolean value indicating if the component has valid file endings", - "default": false, - "type": "boolean" - }, - "validFileEndings": { - "title": "Valid file endings", - "description": "A separated string of valid file endings to upload. If not set all endings are accepted.", - "examples": [".csv", ".doc", ".docx", ".gif", ".jpeg", ".pdf", ".txt"], - "anyOf": [{ "type": "string" }, { "type": "array", "items": { "type": "string" } }] - }, - "alertOnDelete": { - "title": "Alert on delete", - "description": "Boolean value indicating if warning popup should be displayed when attempting to delete an element", - "default": false, - "$ref": "expression.schema.v1.json#/definitions/boolean" - } - }, - "required": [ - "id", - "type", - "maxFileSizeInMB", - "maxNumberOfAttachments", - "minNumberOfAttachments", - "displayMode" - ], - "title": "FileUploadWithTag component schema" -} +{"$id":"https://altinncdn.no/schemas/json/component/FileUploadWithTag.schema.v1.json","$schema":"http://json-schema.org/draft-07/schema#","properties":{"id":{"title":"ID","description":"The component ID. Must be unique within all layouts/pages in a layout-set. Cannot end with .","type":"string","pattern":"^[0-9a-zA-Z][0-9a-zA-Z-]*(-?[a-zA-Z]+|[a-zA-Z][0-9]+|-[0-9]{6,})$"},"hidden":{"title":"Hidden","description":"Boolean value or expression indicating if the component should be hidden. Defaults to false.","default":false,"$ref":"expression.schema.v1.json#/definitions/boolean"},"grid":{"properties":{"xs":{"$ref":"#/definitions/IGridSize"},"sm":{"$ref":"#/definitions/IGridSize"},"md":{"$ref":"#/definitions/IGridSize"},"lg":{"$ref":"#/definitions/IGridSize"},"xl":{"$ref":"#/definitions/IGridSize"},"labelGrid":{"$ref":"#/definitions/IGridStyling"},"innerGrid":{"$ref":"#/definitions/IGridStyling"}}},"pageBreak":{"title":"Page break","description":"Optionally insert page-break before/after component when rendered in PDF","type":"object","properties":{"breakBefore":{"title":"Page break before","description":"PDF only: Value or expression indicating whether a page break should be added before the component. Can be either: 'auto' (default), 'always', or 'avoid'.","examples":["auto","always","avoid"],"default":"auto","$ref":"expression.schema.v1.json#/definitions/string"},"breakAfter":{"title":"Page break after","description":"PDF only: Value or expression indicating whether a page break should be added after the component. Can be either: 'auto' (default), 'always', or 'avoid'.","examples":["auto","always","avoid"],"default":"auto","$ref":"expression.schema.v1.json#/definitions/string"}},"additionalProperties":false},"readOnly":{"title":"Read only/disabled?","description":"Boolean value or expression indicating if the component should be read only/disabled. Defaults to false.
Please note that even with read-only fields in components, it may currently be possible to update the field by modifying the request sent to the API or through a direct API call.","default":false,"$ref":"expression.schema.v1.json#/definitions/boolean"},"required":{"title":"Required?","description":"Boolean value or expression indicating if the component should be required. Defaults to false.","default":false,"$ref":"expression.schema.v1.json#/definitions/boolean"},"showValidations":{"title":"Validation types","description":"List of validation types to show","type":"array","items":{"enum":["Schema","Component","Expression","CustomBackend","Required","AllExceptRequired","All"],"type":"string"}},"renderAsSummary":{"title":"Render as summary","description":"Boolean value indicating if the component should be rendered as a summary. Defaults to false.","default":false,"type":"boolean"},"forceShowInSummary":{"title":"Force show in summary","description":"Will force show the component in a summary even if hideEmptyFields is set to true in the summary component.","default":false,"$ref":"expression.schema.v1.json#/definitions/boolean"},"labelSettings":{"title":"ILabelSettings","type":"object","properties":{"optionalIndicator":{"title":"Optional indicator","description":"Show optional indicator on label","type":"boolean"}},"additionalProperties":false},"optionsId":{"title":"Dynamic options (fetched from server)","description":"ID of the option list to fetch from the server","type":"string"},"mapping":{"title":"Mapping","description":"A mapping of key-value pairs (usually used for mapping a path in the data model to a query string parameter).","type":"object","properties":{},"additionalProperties":{"type":"string"}},"queryParameters":{"title":"Query parameters","description":"A mapping of query string parameters to values. Will be appended to the URL when fetching options.","type":"object","properties":{},"additionalProperties":{"type":"string"}},"options":{"title":"Static options","description":"List of static options","type":"array","items":{"title":"IRawOption","examples":[{"label":"","value":""}],"type":"object","properties":{"label":{"type":"string"},"value":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"const":null}]},"description":{"type":"string"},"helpText":{"type":"string"}},"required":["label","value"],"additionalProperties":false}},"secure":{"title":"Secure options (when using optionsId)","description":"Whether to call the secure API endpoint when fetching options from the server (allows for user/instance-specific options)","default":false,"type":"boolean"},"sortOrder":{"description":"Sorts the code list in either ascending or descending order by label.","enum":["asc","desc"],"type":"string"},"source":{"title":"Option source","description":"Allows for fetching options from the data model, pointing to a repeating group structure","type":"object","properties":{"group":{"title":"Group","description":"The repeating group to base options on.","examples":["model.some.group"],"type":"string"},"label":{"title":"Label","description":"A label of the option displayed in Radio- and Checkbox groups. Can be plain text, a text resource binding, or a dynamic expression.","examples":["some.text.key"],"$ref":"expression.schema.v1.json#/definitions/string"},"value":{"title":"Value","description":"Field in the group that should be used as value","examples":["model.some.group[{0}].someField"],"type":"string"},"description":{"title":"Description","description":"A description of the option displayed in Radio- and Checkbox groups. Can be plain text, a text resource binding, or a dynamic expression.","examples":["some.text.key","My Description"],"$ref":"expression.schema.v1.json#/definitions/string"},"helpText":{"title":"Help Text","description":"A help text for the option displayed in Radio- and Checkbox groups. Can be plain text, a text resource binding, or a dynamic expression.","examples":["some.text.key","My Help Text"],"$ref":"expression.schema.v1.json#/definitions/string"}},"required":["group","label","value"],"additionalProperties":false},"type":{"const":"FileUploadWithTag"},"textResourceBindings":{"properties":{"title":{"title":"Title","description":"Label text/title shown above the component","$ref":"expression.schema.v1.json#/definitions/string"},"description":{"title":"Description","description":"Label description shown above the component, below the title","$ref":"expression.schema.v1.json#/definitions/string"},"help":{"title":"Help text","description":"Help text shown in a tooltip when clicking the help button","$ref":"expression.schema.v1.json#/definitions/string"},"tableTitle":{"title":"Table title","description":"Title used in the table view (overrides the default title)","$ref":"expression.schema.v1.json#/definitions/string"},"shortName":{"title":"Short name (for validation)","description":"Alternative name used for required validation messages (overrides the default title)","$ref":"expression.schema.v1.json#/definitions/string"},"requiredValidation":{"title":"Required validation message","description":"Full validation message shown when the component is required and no value has been entered (overrides both the default and shortName)","$ref":"expression.schema.v1.json#/definitions/string"},"summaryTitle":{"title":"Summary title","description":"Title used in the summary view (overrides the default title)","$ref":"expression.schema.v1.json#/definitions/string"},"summaryAccessibleTitle":{"title":"Accessible summary title","description":"Title used for aria-label on the edit button in the summary view (overrides the default and summary title)","$ref":"expression.schema.v1.json#/definitions/string"},"tagTitle":{"title":"Tag title","description":"The title to show when selecting a tag for each uploaded file","$ref":"expression.schema.v1.json#/definitions/string"}}},"dataModelBindings":{"anyOf":[{"title":"Data model binding","description":"Describes the location in the data model where the component should store its value(s). A simple binding is used for components that only store a single value, usually a string.","type":"object","properties":{"simpleBinding":{"type":"string"}},"required":["simpleBinding"],"additionalProperties":false},{"title":"Data model binding","description":"Describes the location in the data model where the component should store its value(s). A list binding should be pointed to an array structure in the data model, and is used for components that store multiple simple values (e.g. a list of strings).","type":"object","properties":{"list":{"type":"string"}},"required":["list"],"additionalProperties":false}]},"maxFileSizeInMB":{"title":"Max file size (MB)","description":"Sets the maximum file size allowed in megabytes","type":"integer"},"maxNumberOfAttachments":{"title":"Max number of attachments","description":"Sets the maximum number of attachments allowed to upload","type":"integer"},"minNumberOfAttachments":{"title":"Min number of attachments","description":"Sets the minimum number of attachments required to upload","type":"integer"},"displayMode":{"enum":["simple","list"],"type":"string"},"hasCustomFileEndings":{"title":"Has custom file endings","description":"Boolean value indicating if the component has valid file endings","default":false,"type":"boolean"},"validFileEndings":{"title":"Valid file endings","description":"A separated string of valid file endings to upload. If not set all endings are accepted.","examples":[".csv",".doc",".docx",".gif",".jpeg",".pdf",".txt"],"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]},"alertOnDelete":{"title":"Alert on delete","description":"Boolean value indicating if warning popup should be displayed when attempting to delete an element","default":false,"$ref":"expression.schema.v1.json#/definitions/boolean"}},"required":["id","type","maxFileSizeInMB","maxNumberOfAttachments","minNumberOfAttachments","displayMode"],"title":"FileUploadWithTag component schema"} \ No newline at end of file diff --git a/frontend/packages/ux-editor/src/testing/schemas/json/component/Grid.schema.v1.json b/frontend/packages/ux-editor/src/testing/schemas/json/component/Grid.schema.v1.json index 4d54c35417b..49fbdd866f1 100644 --- a/frontend/packages/ux-editor/src/testing/schemas/json/component/Grid.schema.v1.json +++ b/frontend/packages/ux-editor/src/testing/schemas/json/component/Grid.schema.v1.json @@ -1,138 +1 @@ -{ - "$id": "https://altinncdn.no/schemas/json/component/Grid.schema.v1.json", - "$schema": "http://json-schema.org/draft-07/schema#", - "properties": { - "id": { - "title": "ID", - "description": "The component ID. Must be unique within all layouts/pages in a layout-set. Cannot end with .", - "type": "string", - "pattern": "^[0-9a-zA-Z][0-9a-zA-Z-]*(-?[a-zA-Z]+|[a-zA-Z][0-9]+|-[0-9]{6,})$" - }, - "hidden": { - "title": "Hidden", - "description": "Boolean value or expression indicating if the component should be hidden. Defaults to false.", - "default": false, - "$ref": "expression.schema.v1.json#/definitions/boolean" - }, - "grid": { - "properties": { - "xs": { "$ref": "#/definitions/IGridSize" }, - "sm": { "$ref": "#/definitions/IGridSize" }, - "md": { "$ref": "#/definitions/IGridSize" }, - "lg": { "$ref": "#/definitions/IGridSize" }, - "xl": { "$ref": "#/definitions/IGridSize" }, - "labelGrid": { "$ref": "#/definitions/IGridStyling" }, - "innerGrid": { "$ref": "#/definitions/IGridStyling" } - } - }, - "pageBreak": { - "title": "Page break", - "description": "Optionally insert page-break before/after component when rendered in PDF", - "type": "object", - "properties": { - "breakBefore": { - "title": "Page break before", - "description": "PDF only: Value or expression indicating whether a page break should be added before the component. Can be either: 'auto' (default), 'always', or 'avoid'.", - "examples": ["auto", "always", "avoid"], - "default": "auto", - "$ref": "expression.schema.v1.json#/definitions/string" - }, - "breakAfter": { - "title": "Page break after", - "description": "PDF only: Value or expression indicating whether a page break should be added after the component. Can be either: 'auto' (default), 'always', or 'avoid'.", - "examples": ["auto", "always", "avoid"], - "default": "auto", - "$ref": "expression.schema.v1.json#/definitions/string" - } - }, - "additionalProperties": false - }, - "renderAsSummary": { - "title": "Render as summary", - "description": "Boolean value indicating if the component should be rendered as a summary. Defaults to false.", - "default": false, - "type": "boolean" - }, - "forceShowInSummary": { - "title": "Force show in summary", - "description": "Will force show the component in a summary even if hideEmptyFields is set to true in the summary component.", - "default": false, - "$ref": "expression.schema.v1.json#/definitions/boolean" - }, - "labelSettings": { - "title": "ILabelSettings", - "type": "object", - "properties": { - "optionalIndicator": { - "title": "Optional indicator", - "description": "Show optional indicator on label", - "type": "boolean" - } - }, - "additionalProperties": false - }, - "type": { "const": "Grid" }, - "textResourceBindings": { - "properties": { - "title": { - "title": "Title", - "description": "Label text/title shown above the component", - "$ref": "expression.schema.v1.json#/definitions/string" - }, - "description": { - "title": "Description", - "description": "Label description shown above the component, below the title", - "$ref": "expression.schema.v1.json#/definitions/string" - }, - "help": { - "title": "Help text", - "description": "Help text shown in a tooltip when clicking the help button", - "$ref": "expression.schema.v1.json#/definitions/string" - }, - "summaryTitle": { - "title": "Summary title", - "description": "Title used in the summary view (overrides the default title)", - "$ref": "expression.schema.v1.json#/definitions/string" - }, - "summaryAccessibleTitle": { - "title": "Accessible summary title", - "description": "Title used for aria-label on the edit button in the summary view (overrides the default and summary title)", - "$ref": "expression.schema.v1.json#/definitions/string" - } - } - }, - "rows": { - "title": "Rows in Grid or Grid-like component", - "description": "The list of rows in this grid", - "examples": [ - [ - { - "header": false, - "readOnly": false, - "cells": [{ "text": "hello.world" }, { "component": "myOtherComponent" }] - } - ] - ], - "type": "array", - "items": { - "title": "GridRow", - "type": "object", - "properties": { - "header": { "title": "Is header row?", "default": false, "type": "boolean" }, - "readOnly": { "title": "Is row read-only?", "default": false, "type": "boolean" }, - "columnOptions": { "$ref": "#/definitions/ITableColumnProperties" }, - "cells": { - "title": "Cells in table row", - "description": "The list of cells in this row", - "type": "array", - "items": { "$ref": "#/definitions/GridCell" } - } - }, - "required": ["cells"], - "additionalProperties": false - } - } - }, - "required": ["id", "type", "rows"], - "title": "Grid component schema" -} +{"$id":"https://altinncdn.no/schemas/json/component/Grid.schema.v1.json","$schema":"http://json-schema.org/draft-07/schema#","properties":{"id":{"title":"ID","description":"The component ID. Must be unique within all layouts/pages in a layout-set. Cannot end with .","type":"string","pattern":"^[0-9a-zA-Z][0-9a-zA-Z-]*(-?[a-zA-Z]+|[a-zA-Z][0-9]+|-[0-9]{6,})$"},"hidden":{"title":"Hidden","description":"Boolean value or expression indicating if the component should be hidden. Defaults to false.","default":false,"$ref":"expression.schema.v1.json#/definitions/boolean"},"grid":{"properties":{"xs":{"$ref":"#/definitions/IGridSize"},"sm":{"$ref":"#/definitions/IGridSize"},"md":{"$ref":"#/definitions/IGridSize"},"lg":{"$ref":"#/definitions/IGridSize"},"xl":{"$ref":"#/definitions/IGridSize"},"labelGrid":{"$ref":"#/definitions/IGridStyling"},"innerGrid":{"$ref":"#/definitions/IGridStyling"}}},"pageBreak":{"title":"Page break","description":"Optionally insert page-break before/after component when rendered in PDF","type":"object","properties":{"breakBefore":{"title":"Page break before","description":"PDF only: Value or expression indicating whether a page break should be added before the component. Can be either: 'auto' (default), 'always', or 'avoid'.","examples":["auto","always","avoid"],"default":"auto","$ref":"expression.schema.v1.json#/definitions/string"},"breakAfter":{"title":"Page break after","description":"PDF only: Value or expression indicating whether a page break should be added after the component. Can be either: 'auto' (default), 'always', or 'avoid'.","examples":["auto","always","avoid"],"default":"auto","$ref":"expression.schema.v1.json#/definitions/string"}},"additionalProperties":false},"renderAsSummary":{"title":"Render as summary","description":"Boolean value indicating if the component should be rendered as a summary. Defaults to false.","default":false,"type":"boolean"},"forceShowInSummary":{"title":"Force show in summary","description":"Will force show the component in a summary even if hideEmptyFields is set to true in the summary component.","default":false,"$ref":"expression.schema.v1.json#/definitions/boolean"},"labelSettings":{"title":"ILabelSettings","type":"object","properties":{"optionalIndicator":{"title":"Optional indicator","description":"Show optional indicator on label","type":"boolean"}},"additionalProperties":false},"type":{"const":"Grid"},"textResourceBindings":{"properties":{"title":{"title":"Title","description":"Label text/title shown above the component","$ref":"expression.schema.v1.json#/definitions/string"},"description":{"title":"Description","description":"Label description shown above the component, below the title","$ref":"expression.schema.v1.json#/definitions/string"},"help":{"title":"Help text","description":"Help text shown in a tooltip when clicking the help button","$ref":"expression.schema.v1.json#/definitions/string"},"summaryTitle":{"title":"Summary title","description":"Title used in the summary view (overrides the default title)","$ref":"expression.schema.v1.json#/definitions/string"},"summaryAccessibleTitle":{"title":"Accessible summary title","description":"Title used for aria-label on the edit button in the summary view (overrides the default and summary title)","$ref":"expression.schema.v1.json#/definitions/string"}}},"rows":{"title":"Rows in Grid or Grid-like component","description":"The list of rows in this grid","examples":[[{"header":false,"readOnly":false,"cells":[{"text":"hello.world"},{"component":"myOtherComponent"}]}]],"type":"array","items":{"title":"GridRow","type":"object","properties":{"header":{"title":"Is header row?","default":false,"type":"boolean"},"readOnly":{"title":"Is row read-only?","default":false,"type":"boolean"},"columnOptions":{"$ref":"#/definitions/ITableColumnProperties"},"cells":{"title":"Cells in table row","description":"The list of cells in this row","type":"array","items":{"$ref":"#/definitions/GridCell"}}},"required":["cells"],"additionalProperties":false}}},"required":["id","type","rows"],"title":"Grid component schema"} \ No newline at end of file diff --git a/frontend/packages/ux-editor/src/testing/schemas/json/component/Group.schema.v1.json b/frontend/packages/ux-editor/src/testing/schemas/json/component/Group.schema.v1.json index 1c4c05f295c..49bcf8b0691 100644 --- a/frontend/packages/ux-editor/src/testing/schemas/json/component/Group.schema.v1.json +++ b/frontend/packages/ux-editor/src/testing/schemas/json/component/Group.schema.v1.json @@ -1,108 +1 @@ -{ - "$id": "https://altinncdn.no/schemas/json/component/Group.schema.v1.json", - "$schema": "http://json-schema.org/draft-07/schema#", - "properties": { - "id": { - "title": "ID", - "description": "The component ID. Must be unique within all layouts/pages in a layout-set. Cannot end with .", - "type": "string", - "pattern": "^[0-9a-zA-Z][0-9a-zA-Z-]*(-?[a-zA-Z]+|[a-zA-Z][0-9]+|-[0-9]{6,})$" - }, - "hidden": { - "title": "Hidden", - "description": "Boolean value or expression indicating if the component should be hidden. Defaults to false.", - "default": false, - "$ref": "expression.schema.v1.json#/definitions/boolean" - }, - "grid": { - "properties": { - "xs": { "$ref": "#/definitions/IGridSize" }, - "sm": { "$ref": "#/definitions/IGridSize" }, - "md": { "$ref": "#/definitions/IGridSize" }, - "lg": { "$ref": "#/definitions/IGridSize" }, - "xl": { "$ref": "#/definitions/IGridSize" }, - "labelGrid": { "$ref": "#/definitions/IGridStyling" }, - "innerGrid": { "$ref": "#/definitions/IGridStyling" } - } - }, - "pageBreak": { - "title": "Page break", - "description": "Optionally insert page-break before/after component when rendered in PDF", - "type": "object", - "properties": { - "breakBefore": { - "title": "Page break before", - "description": "PDF only: Value or expression indicating whether a page break should be added before the component. Can be either: 'auto' (default), 'always', or 'avoid'.", - "examples": ["auto", "always", "avoid"], - "default": "auto", - "$ref": "expression.schema.v1.json#/definitions/string" - }, - "breakAfter": { - "title": "Page break after", - "description": "PDF only: Value or expression indicating whether a page break should be added after the component. Can be either: 'auto' (default), 'always', or 'avoid'.", - "examples": ["auto", "always", "avoid"], - "default": "auto", - "$ref": "expression.schema.v1.json#/definitions/string" - } - }, - "additionalProperties": false - }, - "renderAsSummary": { - "title": "Render as summary", - "description": "Boolean value indicating if the component should be rendered as a summary. Defaults to false.", - "default": false, - "type": "boolean" - }, - "forceShowInSummary": { - "title": "Force show in summary", - "description": "Will force show the component in a summary even if hideEmptyFields is set to true in the summary component.", - "default": false, - "$ref": "expression.schema.v1.json#/definitions/boolean" - }, - "type": { "const": "Group" }, - "textResourceBindings": { - "properties": { - "title": { - "title": "Title", - "description": "The title of the group (shown above the group)", - "$ref": "expression.schema.v1.json#/definitions/string" - }, - "description": { - "title": "Description", - "description": "The description text shown underneath the title", - "$ref": "expression.schema.v1.json#/definitions/string" - }, - "summaryTitle": { - "title": "Summary title", - "description": "Title used in the summary view (overrides the default title)", - "$ref": "expression.schema.v1.json#/definitions/string" - }, - "summaryAccessibleTitle": { - "title": "Accessible summary title", - "description": "Title used for aria-label on the edit button in the summary view (overrides the default and summary title)", - "$ref": "expression.schema.v1.json#/definitions/string" - } - } - }, - "groupingIndicator": { - "title": "Set grouping indicator", - "description": "Can visually group components together by indenting them or by putting them in a panel. ", - "enum": ["indented", "panel"], - "type": "string" - }, - "children": { - "title": "Children", - "description": "Array of component IDs that should be displayed in the group", - "type": "array", - "items": { "type": "string" } - }, - "headingLevel": { - "title": "Heading level", - "description": "The heading level of the group title.", - "enum": [2, 3, 4, 5, 6], - "type": "string" - } - }, - "required": ["id", "type", "children"], - "title": "Group component schema" -} +{"$id":"https://altinncdn.no/schemas/json/component/Group.schema.v1.json","$schema":"http://json-schema.org/draft-07/schema#","properties":{"id":{"title":"ID","description":"The component ID. Must be unique within all layouts/pages in a layout-set. Cannot end with .","type":"string","pattern":"^[0-9a-zA-Z][0-9a-zA-Z-]*(-?[a-zA-Z]+|[a-zA-Z][0-9]+|-[0-9]{6,})$"},"hidden":{"title":"Hidden","description":"Boolean value or expression indicating if the component should be hidden. Defaults to false.","default":false,"$ref":"expression.schema.v1.json#/definitions/boolean"},"grid":{"properties":{"xs":{"$ref":"#/definitions/IGridSize"},"sm":{"$ref":"#/definitions/IGridSize"},"md":{"$ref":"#/definitions/IGridSize"},"lg":{"$ref":"#/definitions/IGridSize"},"xl":{"$ref":"#/definitions/IGridSize"},"labelGrid":{"$ref":"#/definitions/IGridStyling"},"innerGrid":{"$ref":"#/definitions/IGridStyling"}}},"pageBreak":{"title":"Page break","description":"Optionally insert page-break before/after component when rendered in PDF","type":"object","properties":{"breakBefore":{"title":"Page break before","description":"PDF only: Value or expression indicating whether a page break should be added before the component. Can be either: 'auto' (default), 'always', or 'avoid'.","examples":["auto","always","avoid"],"default":"auto","$ref":"expression.schema.v1.json#/definitions/string"},"breakAfter":{"title":"Page break after","description":"PDF only: Value or expression indicating whether a page break should be added after the component. Can be either: 'auto' (default), 'always', or 'avoid'.","examples":["auto","always","avoid"],"default":"auto","$ref":"expression.schema.v1.json#/definitions/string"}},"additionalProperties":false},"renderAsSummary":{"title":"Render as summary","description":"Boolean value indicating if the component should be rendered as a summary. Defaults to false.","default":false,"type":"boolean"},"forceShowInSummary":{"title":"Force show in summary","description":"Will force show the component in a summary even if hideEmptyFields is set to true in the summary component.","default":false,"$ref":"expression.schema.v1.json#/definitions/boolean"},"type":{"const":"Group"},"textResourceBindings":{"properties":{"title":{"title":"Title","description":"The title of the group (shown above the group)","$ref":"expression.schema.v1.json#/definitions/string"},"description":{"title":"Description","description":"The description text shown underneath the title","$ref":"expression.schema.v1.json#/definitions/string"},"summaryTitle":{"title":"Summary title","description":"Title used in the summary view (overrides the default title)","$ref":"expression.schema.v1.json#/definitions/string"},"summaryAccessibleTitle":{"title":"Accessible summary title","description":"Title used for aria-label on the edit button in the summary view (overrides the default and summary title)","$ref":"expression.schema.v1.json#/definitions/string"}}},"groupingIndicator":{"title":"Set grouping indicator","description":"Can visually group components together by indenting them or by putting them in a panel. ","enum":["indented","panel"],"type":"string"},"children":{"title":"Children","description":"Array of component IDs that should be displayed in the group","type":"array","items":{"type":"string"}},"headingLevel":{"title":"Heading level","description":"The heading level of the group title.","enum":[2,3,4,5,6],"type":"number"}},"required":["id","type","children"],"title":"Group component schema"} \ No newline at end of file diff --git a/frontend/packages/ux-editor/src/testing/schemas/json/component/Header.schema.v1.json b/frontend/packages/ux-editor/src/testing/schemas/json/component/Header.schema.v1.json index 539e8b7e800..74d92afd183 100644 --- a/frontend/packages/ux-editor/src/testing/schemas/json/component/Header.schema.v1.json +++ b/frontend/packages/ux-editor/src/testing/schemas/json/component/Header.schema.v1.json @@ -1,76 +1 @@ -{ - "$id": "https://altinncdn.no/schemas/json/component/Header.schema.v1.json", - "$schema": "http://json-schema.org/draft-07/schema#", - "properties": { - "id": { - "title": "ID", - "description": "The component ID. Must be unique within all layouts/pages in a layout-set. Cannot end with .", - "type": "string", - "pattern": "^[0-9a-zA-Z][0-9a-zA-Z-]*(-?[a-zA-Z]+|[a-zA-Z][0-9]+|-[0-9]{6,})$" - }, - "hidden": { - "title": "Hidden", - "description": "Boolean value or expression indicating if the component should be hidden. Defaults to false.", - "default": false, - "$ref": "expression.schema.v1.json#/definitions/boolean" - }, - "grid": { - "properties": { - "xs": { "$ref": "#/definitions/IGridSize" }, - "sm": { "$ref": "#/definitions/IGridSize" }, - "md": { "$ref": "#/definitions/IGridSize" }, - "lg": { "$ref": "#/definitions/IGridSize" }, - "xl": { "$ref": "#/definitions/IGridSize" }, - "labelGrid": { "$ref": "#/definitions/IGridStyling" }, - "innerGrid": { "$ref": "#/definitions/IGridStyling" } - } - }, - "pageBreak": { - "title": "Page break", - "description": "Optionally insert page-break before/after component when rendered in PDF", - "type": "object", - "properties": { - "breakBefore": { - "title": "Page break before", - "description": "PDF only: Value or expression indicating whether a page break should be added before the component. Can be either: 'auto' (default), 'always', or 'avoid'.", - "examples": ["auto", "always", "avoid"], - "default": "auto", - "$ref": "expression.schema.v1.json#/definitions/string" - }, - "breakAfter": { - "title": "Page break after", - "description": "PDF only: Value or expression indicating whether a page break should be added after the component. Can be either: 'auto' (default), 'always', or 'avoid'.", - "examples": ["auto", "always", "avoid"], - "default": "auto", - "$ref": "expression.schema.v1.json#/definitions/string" - } - }, - "additionalProperties": false - }, - "type": { "const": "Header" }, - "textResourceBindings": { - "type": "object", - "properties": { - "title": { - "title": "Title", - "description": "The text to display in the header", - "$ref": "expression.schema.v1.json#/definitions/string" - }, - "help": { - "title": "Help text", - "description": "The text to display in the help tooltip/popup", - "$ref": "expression.schema.v1.json#/definitions/string" - } - }, - "additionalProperties": false - }, - "size": { - "title": "Size", - "description": "The size of the header", - "enum": ["L", "M", "S", "h2", "h3", "h4"], - "type": "string" - } - }, - "required": ["id", "type", "size"], - "title": "Header component schema" -} +{"$id":"https://altinncdn.no/schemas/json/component/Header.schema.v1.json","$schema":"http://json-schema.org/draft-07/schema#","properties":{"id":{"title":"ID","description":"The component ID. Must be unique within all layouts/pages in a layout-set. Cannot end with .","type":"string","pattern":"^[0-9a-zA-Z][0-9a-zA-Z-]*(-?[a-zA-Z]+|[a-zA-Z][0-9]+|-[0-9]{6,})$"},"hidden":{"title":"Hidden","description":"Boolean value or expression indicating if the component should be hidden. Defaults to false.","default":false,"$ref":"expression.schema.v1.json#/definitions/boolean"},"grid":{"properties":{"xs":{"$ref":"#/definitions/IGridSize"},"sm":{"$ref":"#/definitions/IGridSize"},"md":{"$ref":"#/definitions/IGridSize"},"lg":{"$ref":"#/definitions/IGridSize"},"xl":{"$ref":"#/definitions/IGridSize"},"labelGrid":{"$ref":"#/definitions/IGridStyling"},"innerGrid":{"$ref":"#/definitions/IGridStyling"}}},"pageBreak":{"title":"Page break","description":"Optionally insert page-break before/after component when rendered in PDF","type":"object","properties":{"breakBefore":{"title":"Page break before","description":"PDF only: Value or expression indicating whether a page break should be added before the component. Can be either: 'auto' (default), 'always', or 'avoid'.","examples":["auto","always","avoid"],"default":"auto","$ref":"expression.schema.v1.json#/definitions/string"},"breakAfter":{"title":"Page break after","description":"PDF only: Value or expression indicating whether a page break should be added after the component. Can be either: 'auto' (default), 'always', or 'avoid'.","examples":["auto","always","avoid"],"default":"auto","$ref":"expression.schema.v1.json#/definitions/string"}},"additionalProperties":false},"type":{"const":"Header"},"textResourceBindings":{"type":"object","properties":{"title":{"title":"Title","description":"The text to display in the header","$ref":"expression.schema.v1.json#/definitions/string"},"help":{"title":"Help text","description":"The text to display in the help tooltip/popup","$ref":"expression.schema.v1.json#/definitions/string"}},"additionalProperties":false},"size":{"title":"Size","description":"The size of the header","enum":["L","M","S","h2","h3","h4"],"type":"string"}},"required":["id","type","size"],"title":"Header component schema"} \ No newline at end of file diff --git a/frontend/packages/ux-editor/src/testing/schemas/json/component/IFrame.schema.v1.json b/frontend/packages/ux-editor/src/testing/schemas/json/component/IFrame.schema.v1.json index a960ac482fd..5f39343c136 100644 --- a/frontend/packages/ux-editor/src/testing/schemas/json/component/IFrame.schema.v1.json +++ b/frontend/packages/ux-editor/src/testing/schemas/json/component/IFrame.schema.v1.json @@ -1,84 +1 @@ -{ - "$id": "https://altinncdn.no/schemas/json/component/IFrame.schema.v1.json", - "$schema": "http://json-schema.org/draft-07/schema#", - "properties": { - "id": { - "title": "ID", - "description": "The component ID. Must be unique within all layouts/pages in a layout-set. Cannot end with .", - "type": "string", - "pattern": "^[0-9a-zA-Z][0-9a-zA-Z-]*(-?[a-zA-Z]+|[a-zA-Z][0-9]+|-[0-9]{6,})$" - }, - "hidden": { - "title": "Hidden", - "description": "Boolean value or expression indicating if the component should be hidden. Defaults to false.", - "default": false, - "$ref": "expression.schema.v1.json#/definitions/boolean" - }, - "grid": { - "properties": { - "xs": { "$ref": "#/definitions/IGridSize" }, - "sm": { "$ref": "#/definitions/IGridSize" }, - "md": { "$ref": "#/definitions/IGridSize" }, - "lg": { "$ref": "#/definitions/IGridSize" }, - "xl": { "$ref": "#/definitions/IGridSize" }, - "labelGrid": { "$ref": "#/definitions/IGridStyling" }, - "innerGrid": { "$ref": "#/definitions/IGridStyling" } - } - }, - "pageBreak": { - "title": "Page break", - "description": "Optionally insert page-break before/after component when rendered in PDF", - "type": "object", - "properties": { - "breakBefore": { - "title": "Page break before", - "description": "PDF only: Value or expression indicating whether a page break should be added before the component. Can be either: 'auto' (default), 'always', or 'avoid'.", - "examples": ["auto", "always", "avoid"], - "default": "auto", - "$ref": "expression.schema.v1.json#/definitions/string" - }, - "breakAfter": { - "title": "Page break after", - "description": "PDF only: Value or expression indicating whether a page break should be added after the component. Can be either: 'auto' (default), 'always', or 'avoid'.", - "examples": ["auto", "always", "avoid"], - "default": "auto", - "$ref": "expression.schema.v1.json#/definitions/string" - } - }, - "additionalProperties": false - }, - "type": { "const": "IFrame" }, - "textResourceBindings": { - "type": "object", - "properties": { - "title": { - "title": "Title/text/content", - "description": "The content of the IFrame. Can for example be be set to a string containing HTML, a text resource key, or an expression looking up a value from the data model", - "$ref": "expression.schema.v1.json#/definitions/string" - } - }, - "additionalProperties": false - }, - "sandbox": { - "title": "ISandboxProperties", - "type": "object", - "properties": { - "allowPopups": { - "title": "Allow popups", - "description": "Sets \"allow-popups\" in the sandbox attribute on the iframe. See: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/iframe#sandbox", - "default": false, - "type": "boolean" - }, - "allowPopupsToEscapeSandbox": { - "title": "Allow popups to escape sandbox", - "description": "Sets \"allow-popups-to-escape-sandbox\" in the sandbox attribute on the iframe. See: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/iframe#sandbox", - "default": false, - "type": "boolean" - } - }, - "additionalProperties": false - } - }, - "required": ["id", "type"], - "title": "IFrame component schema" -} +{"$id":"https://altinncdn.no/schemas/json/component/IFrame.schema.v1.json","$schema":"http://json-schema.org/draft-07/schema#","properties":{"id":{"title":"ID","description":"The component ID. Must be unique within all layouts/pages in a layout-set. Cannot end with .","type":"string","pattern":"^[0-9a-zA-Z][0-9a-zA-Z-]*(-?[a-zA-Z]+|[a-zA-Z][0-9]+|-[0-9]{6,})$"},"hidden":{"title":"Hidden","description":"Boolean value or expression indicating if the component should be hidden. Defaults to false.","default":false,"$ref":"expression.schema.v1.json#/definitions/boolean"},"grid":{"properties":{"xs":{"$ref":"#/definitions/IGridSize"},"sm":{"$ref":"#/definitions/IGridSize"},"md":{"$ref":"#/definitions/IGridSize"},"lg":{"$ref":"#/definitions/IGridSize"},"xl":{"$ref":"#/definitions/IGridSize"},"labelGrid":{"$ref":"#/definitions/IGridStyling"},"innerGrid":{"$ref":"#/definitions/IGridStyling"}}},"pageBreak":{"title":"Page break","description":"Optionally insert page-break before/after component when rendered in PDF","type":"object","properties":{"breakBefore":{"title":"Page break before","description":"PDF only: Value or expression indicating whether a page break should be added before the component. Can be either: 'auto' (default), 'always', or 'avoid'.","examples":["auto","always","avoid"],"default":"auto","$ref":"expression.schema.v1.json#/definitions/string"},"breakAfter":{"title":"Page break after","description":"PDF only: Value or expression indicating whether a page break should be added after the component. Can be either: 'auto' (default), 'always', or 'avoid'.","examples":["auto","always","avoid"],"default":"auto","$ref":"expression.schema.v1.json#/definitions/string"}},"additionalProperties":false},"type":{"const":"IFrame"},"textResourceBindings":{"type":"object","properties":{"title":{"title":"Title/text/content","description":"The content of the IFrame. Can for example be be set to a string containing HTML, a text resource key, or an expression looking up a value from the data model","$ref":"expression.schema.v1.json#/definitions/string"}},"additionalProperties":false},"sandbox":{"title":"ISandboxProperties","type":"object","properties":{"allowPopups":{"title":"Allow popups","description":"Sets \"allow-popups\" in the sandbox attribute on the iframe. See: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/iframe#sandbox","default":false,"type":"boolean"},"allowPopupsToEscapeSandbox":{"title":"Allow popups to escape sandbox","description":"Sets \"allow-popups-to-escape-sandbox\" in the sandbox attribute on the iframe. See: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/iframe#sandbox","default":false,"type":"boolean"}},"additionalProperties":false}},"required":["id","type"],"title":"IFrame component schema"} \ No newline at end of file diff --git a/frontend/packages/ux-editor/src/testing/schemas/json/component/Image.schema.v1.json b/frontend/packages/ux-editor/src/testing/schemas/json/component/Image.schema.v1.json index 37f138cc7dc..7d85f9a42f3 100644 --- a/frontend/packages/ux-editor/src/testing/schemas/json/component/Image.schema.v1.json +++ b/frontend/packages/ux-editor/src/testing/schemas/json/component/Image.schema.v1.json @@ -1,81 +1 @@ -{ - "$id": "https://altinncdn.no/schemas/json/component/Image.schema.v1.json", - "$schema": "http://json-schema.org/draft-07/schema#", - "properties": { - "id": { - "title": "ID", - "description": "The component ID. Must be unique within all layouts/pages in a layout-set. Cannot end with .", - "type": "string", - "pattern": "^[0-9a-zA-Z][0-9a-zA-Z-]*(-?[a-zA-Z]+|[a-zA-Z][0-9]+|-[0-9]{6,})$" - }, - "hidden": { - "title": "Hidden", - "description": "Boolean value or expression indicating if the component should be hidden. Defaults to false.", - "default": false, - "$ref": "expression.schema.v1.json#/definitions/boolean" - }, - "grid": { - "properties": { - "xs": { "$ref": "#/definitions/IGridSize" }, - "sm": { "$ref": "#/definitions/IGridSize" }, - "md": { "$ref": "#/definitions/IGridSize" }, - "lg": { "$ref": "#/definitions/IGridSize" }, - "xl": { "$ref": "#/definitions/IGridSize" }, - "labelGrid": { "$ref": "#/definitions/IGridStyling" }, - "innerGrid": { "$ref": "#/definitions/IGridStyling" } - } - }, - "pageBreak": { - "title": "Page break", - "description": "Optionally insert page-break before/after component when rendered in PDF", - "type": "object", - "properties": { - "breakBefore": { - "title": "Page break before", - "description": "PDF only: Value or expression indicating whether a page break should be added before the component. Can be either: 'auto' (default), 'always', or 'avoid'.", - "examples": ["auto", "always", "avoid"], - "default": "auto", - "$ref": "expression.schema.v1.json#/definitions/string" - }, - "breakAfter": { - "title": "Page break after", - "description": "PDF only: Value or expression indicating whether a page break should be added after the component. Can be either: 'auto' (default), 'always', or 'avoid'.", - "examples": ["auto", "always", "avoid"], - "default": "auto", - "$ref": "expression.schema.v1.json#/definitions/string" - } - }, - "additionalProperties": false - }, - "type": { "const": "Image" }, - "textResourceBindings": { - "type": "object", - "properties": { - "help": { - "title": "Help text", - "description": "Help text for the image (shown in help text tooltip/popup)", - "$ref": "expression.schema.v1.json#/definitions/string" - }, - "altTextImg": { - "title": "Alt text", - "description": "Alternative text for the image (for screen readers).", - "$ref": "expression.schema.v1.json#/definitions/string" - } - }, - "additionalProperties": false - }, - "image": { - "title": "IImage", - "type": "object", - "properties": { - "src": { "$ref": "#/definitions/IImageSrc" }, - "width": { "title": "Image width", "examples": ["100%"], "type": "string" }, - "align": { "$ref": "#/definitions/GridJustification" } - }, - "required": ["src", "width", "align"], - "additionalProperties": false - } - }, - "required": ["id", "type"], - "title": "Image component schema" -} +{"$id":"https://altinncdn.no/schemas/json/component/Image.schema.v1.json","$schema":"http://json-schema.org/draft-07/schema#","properties":{"id":{"title":"ID","description":"The component ID. Must be unique within all layouts/pages in a layout-set. Cannot end with .","type":"string","pattern":"^[0-9a-zA-Z][0-9a-zA-Z-]*(-?[a-zA-Z]+|[a-zA-Z][0-9]+|-[0-9]{6,})$"},"hidden":{"title":"Hidden","description":"Boolean value or expression indicating if the component should be hidden. Defaults to false.","default":false,"$ref":"expression.schema.v1.json#/definitions/boolean"},"grid":{"properties":{"xs":{"$ref":"#/definitions/IGridSize"},"sm":{"$ref":"#/definitions/IGridSize"},"md":{"$ref":"#/definitions/IGridSize"},"lg":{"$ref":"#/definitions/IGridSize"},"xl":{"$ref":"#/definitions/IGridSize"},"labelGrid":{"$ref":"#/definitions/IGridStyling"},"innerGrid":{"$ref":"#/definitions/IGridStyling"}}},"pageBreak":{"title":"Page break","description":"Optionally insert page-break before/after component when rendered in PDF","type":"object","properties":{"breakBefore":{"title":"Page break before","description":"PDF only: Value or expression indicating whether a page break should be added before the component. Can be either: 'auto' (default), 'always', or 'avoid'.","examples":["auto","always","avoid"],"default":"auto","$ref":"expression.schema.v1.json#/definitions/string"},"breakAfter":{"title":"Page break after","description":"PDF only: Value or expression indicating whether a page break should be added after the component. Can be either: 'auto' (default), 'always', or 'avoid'.","examples":["auto","always","avoid"],"default":"auto","$ref":"expression.schema.v1.json#/definitions/string"}},"additionalProperties":false},"type":{"const":"Image"},"textResourceBindings":{"type":"object","properties":{"help":{"title":"Help text","description":"Help text for the image (shown in help text tooltip/popup)","$ref":"expression.schema.v1.json#/definitions/string"},"altTextImg":{"title":"Alt text","description":"Alternative text for the image (for screen readers).","$ref":"expression.schema.v1.json#/definitions/string"}},"additionalProperties":false},"image":{"title":"IImage","type":"object","properties":{"src":{"$ref":"#/definitions/IImageSrc"},"width":{"title":"Image width","examples":["100%"],"type":"string"},"align":{"$ref":"#/definitions/GridJustification"}},"required":["src","width","align"],"additionalProperties":false}},"required":["id","type"],"title":"Image component schema"} \ No newline at end of file diff --git a/frontend/packages/ux-editor/src/testing/schemas/json/component/Input.schema.v1.json b/frontend/packages/ux-editor/src/testing/schemas/json/component/Input.schema.v1.json index 4f7bd9c4b30..a8ecb09bb38 100644 --- a/frontend/packages/ux-editor/src/testing/schemas/json/component/Input.schema.v1.json +++ b/frontend/packages/ux-editor/src/testing/schemas/json/component/Input.schema.v1.json @@ -1,482 +1 @@ -{ - "$id": "https://altinncdn.no/schemas/json/component/Input.schema.v1.json", - "$schema": "http://json-schema.org/draft-07/schema#", - "properties": { - "id": { - "title": "ID", - "description": "The component ID. Must be unique within all layouts/pages in a layout-set. Cannot end with .", - "type": "string", - "pattern": "^[0-9a-zA-Z][0-9a-zA-Z-]*(-?[a-zA-Z]+|[a-zA-Z][0-9]+|-[0-9]{6,})$" - }, - "hidden": { - "title": "Hidden", - "description": "Boolean value or expression indicating if the component should be hidden. Defaults to false.", - "default": false, - "$ref": "expression.schema.v1.json#/definitions/boolean" - }, - "grid": { - "properties": { - "xs": { "$ref": "#/definitions/IGridSize" }, - "sm": { "$ref": "#/definitions/IGridSize" }, - "md": { "$ref": "#/definitions/IGridSize" }, - "lg": { "$ref": "#/definitions/IGridSize" }, - "xl": { "$ref": "#/definitions/IGridSize" }, - "labelGrid": { "$ref": "#/definitions/IGridStyling" }, - "innerGrid": { "$ref": "#/definitions/IGridStyling" } - } - }, - "pageBreak": { - "title": "Page break", - "description": "Optionally insert page-break before/after component when rendered in PDF", - "type": "object", - "properties": { - "breakBefore": { - "title": "Page break before", - "description": "PDF only: Value or expression indicating whether a page break should be added before the component. Can be either: 'auto' (default), 'always', or 'avoid'.", - "examples": ["auto", "always", "avoid"], - "default": "auto", - "$ref": "expression.schema.v1.json#/definitions/string" - }, - "breakAfter": { - "title": "Page break after", - "description": "PDF only: Value or expression indicating whether a page break should be added after the component. Can be either: 'auto' (default), 'always', or 'avoid'.", - "examples": ["auto", "always", "avoid"], - "default": "auto", - "$ref": "expression.schema.v1.json#/definitions/string" - } - }, - "additionalProperties": false - }, - "readOnly": { - "title": "Read only/disabled?", - "description": "Boolean value or expression indicating if the component should be read only/disabled. Defaults to false.
Please note that even with read-only fields in components, it may currently be possible to update the field by modifying the request sent to the API or through a direct API call.", - "default": false, - "$ref": "expression.schema.v1.json#/definitions/boolean" - }, - "required": { - "title": "Required?", - "description": "Boolean value or expression indicating if the component should be required. Defaults to false.", - "default": false, - "$ref": "expression.schema.v1.json#/definitions/boolean" - }, - "showValidations": { - "title": "Validation types", - "description": "List of validation types to show", - "type": "array", - "items": { - "enum": [ - "Schema", - "Component", - "Expression", - "CustomBackend", - "Required", - "AllExceptRequired", - "All" - ], - "type": "string" - } - }, - "renderAsSummary": { - "title": "Render as summary", - "description": "Boolean value indicating if the component should be rendered as a summary. Defaults to false.", - "default": false, - "type": "boolean" - }, - "forceShowInSummary": { - "title": "Force show in summary", - "description": "Will force show the component in a summary even if hideEmptyFields is set to true in the summary component.", - "default": false, - "$ref": "expression.schema.v1.json#/definitions/boolean" - }, - "labelSettings": { - "title": "ILabelSettings", - "type": "object", - "properties": { - "optionalIndicator": { - "title": "Optional indicator", - "description": "Show optional indicator on label", - "type": "boolean" - } - }, - "additionalProperties": false - }, - "type": { "const": "Input" }, - "textResourceBindings": { - "properties": { - "title": { - "title": "Title", - "description": "Label text/title shown above the component", - "$ref": "expression.schema.v1.json#/definitions/string" - }, - "description": { - "title": "Description", - "description": "Label description shown above the component, below the title", - "$ref": "expression.schema.v1.json#/definitions/string" - }, - "help": { - "title": "Help text", - "description": "Help text shown in a tooltip when clicking the help button", - "$ref": "expression.schema.v1.json#/definitions/string" - }, - "tableTitle": { - "title": "Table title", - "description": "Title used in the table view (overrides the default title)", - "$ref": "expression.schema.v1.json#/definitions/string" - }, - "shortName": { - "title": "Short name (for validation)", - "description": "Alternative name used for required validation messages (overrides the default title)", - "$ref": "expression.schema.v1.json#/definitions/string" - }, - "requiredValidation": { - "title": "Required validation message", - "description": "Full validation message shown when the component is required and no value has been entered (overrides both the default and shortName)", - "$ref": "expression.schema.v1.json#/definitions/string" - }, - "summaryTitle": { - "title": "Summary title", - "description": "Title used in the summary view (overrides the default title)", - "$ref": "expression.schema.v1.json#/definitions/string" - }, - "summaryAccessibleTitle": { - "title": "Accessible summary title", - "description": "Title used for aria-label on the edit button in the summary view (overrides the default and summary title)", - "$ref": "expression.schema.v1.json#/definitions/string" - }, - "prefix": { - "title": "Prefix", - "description": "Prefix shown before the input field", - "$ref": "expression.schema.v1.json#/definitions/string" - }, - "suffix": { - "title": "Suffix", - "description": "Suffix shown after the input field", - "$ref": "expression.schema.v1.json#/definitions/string" - } - } - }, - "dataModelBindings": { - "title": "Data model binding", - "description": "Describes the location in the data model where the component should store its value(s). A simple binding is used for components that only store a single value, usually a string.", - "type": "object", - "properties": { "simpleBinding": { "type": "string" } }, - "required": ["simpleBinding"], - "additionalProperties": false - }, - "saveWhileTyping": { - "title": "Automatic saving while typing", - "description": "Lets you control how long we wait before saving the value locally while typing. This value is usually also used to determine how long we wait before saving the value to the server. The default value is 400 milliseconds.", - "default": 400, - "type": "number" - }, - "formatting": { - "title": "IFormatting", - "examples": [ - { "currency": "NOK" }, - { - "number": { - "thousandSeparator": " ", - "decimalSeparator": ",", - "allowNegative": false, - "suffix": " kr" - } - } - ], - "type": "object", - "properties": { - "currency": { - "title": "Language-sensitive currency formatting", - "description": "Enables currency to be language sensitive based on selected app language. Note: parts that already exist in number property are not overridden by this prop.", - "enum": [ - "AED", - "AFN", - "ALL", - "AMD", - "ANG", - "AOA", - "ARS", - "AUD", - "AWG", - "AZN", - "BAM", - "BBD", - "BDT", - "BGN", - "BHD", - "BIF", - "BMD", - "BND", - "BOB", - "BOV", - "BRL", - "BSD", - "BTN", - "BWP", - "BYN", - "BZD", - "CAD", - "CDF", - "CHE", - "CHF", - "CHW", - "CLF", - "CLP", - "CNY", - "COP", - "COU", - "CRC", - "CUC", - "CUP", - "CVE", - "CZK", - "DJF", - "DKK", - "DOP", - "DZD", - "EGP", - "ERN", - "ETB", - "EUR", - "FJD", - "FKP", - "GBP", - "GEL", - "GHS", - "GIP", - "GMD", - "GNF", - "GTQ", - "GYD", - "HKD", - "HNL", - "HTG", - "HUF", - "IDR", - "ILS", - "INR", - "IQD", - "IRR", - "ISK", - "JMD", - "JOD", - "JPY", - "KES", - "KGS", - "KHR", - "KMF", - "KPW", - "KRW", - "KWD", - "KYD", - "KZT", - "LAK", - "LBP", - "LKR", - "LRD", - "LSL", - "LYD", - "MAD", - "MDL", - "MGA", - "MKD", - "MMK", - "MNT", - "MOP", - "MRU", - "MUR", - "MVR", - "MWK", - "MXN", - "MXV", - "MYR", - "MZN", - "NAD", - "NGN", - "NIO", - "NOK", - "NPR", - "NZD", - "OMR", - "PAB", - "PEN", - "PGK", - "PHP", - "PKR", - "PLN", - "PYG", - "QAR", - "RON", - "RSD", - "RUB", - "RWF", - "SAR", - "SBD", - "SCR", - "SDG", - "SEK", - "SGD", - "SHP", - "SLE", - "SLL", - "SOS", - "SRD", - "SSP", - "STN", - "SVC", - "SYP", - "SZL", - "THB", - "TJS", - "TMT", - "TND", - "TOP", - "TRY", - "TTD", - "TWD", - "TZS", - "UAH", - "UGX", - "USD", - "USN", - "UYI", - "UYU", - "UYW", - "UZS", - "VED", - "VES", - "VND", - "VUV", - "WST", - "XAF", - "XCD", - "XDR", - "XOF", - "XPF", - "XSU", - "XUA", - "YER", - "ZAR", - "ZMW", - "ZWL" - ] - }, - "unit": { - "title": "Language-sensitive number formatting based on unit", - "description": "Enables unit along with thousand and decimal separators to be language sensitive based on selected app language. They are configured in number property. Note: parts that already exist in number property are not overridden by this prop.", - "enum": [ - "celsius", - "centimeter", - "day", - "degree", - "foot", - "gram", - "hectare", - "hour", - "inch", - "kilogram", - "kilometer", - "liter", - "meter", - "milliliter", - "millimeter", - "millisecond", - "minute", - "month", - "percent", - "second", - "week", - "year" - ] - }, - "position": { - "title": "Position of the currency/unit symbol", - "description": "Display the unit as prefix or suffix. Default is prefix. (Use only when using currency or unit options)", - "enum": ["prefix", "suffix"] - }, - "number": { - "anyOf": [ - { "$ref": "#/definitions/PatternFormatProps" }, - { "$ref": "#/definitions/NumberFormatProps" } - ] - }, - "align": { "default": "left", "enum": ["right", "center", "left"] } - }, - "additionalProperties": false - }, - "variant": { - "title": "Input variant", - "description": "The variant of the input field (text or search).", - "default": "text", - "enum": ["text", "search"], - "type": "string" - }, - "autocomplete": { - "title": "HTML autocomplete values", - "description": "Autocomplete hints to the browser. See https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/autocomplete", - "enum": [ - "on", - "off", - "name", - "honorific-prefix", - "given-name", - "additional-name", - "family-name", - "honorific-suffix", - "nickname", - "email", - "username", - "new-password", - "current-password", - "one-time-code", - "organization-title", - "organization", - "street-address", - "address-line1", - "address-line2", - "address-line3", - "address-level4", - "address-level3", - "address-level2", - "address-level1", - "country", - "country-name", - "postal-code", - "cc-name", - "cc-given-name", - "cc-additional-name", - "cc-family-name", - "cc-number", - "cc-exp", - "cc-exp-month", - "cc-exp-year", - "cc-csc", - "cc-type", - "transaction-currency", - "transaction-amount", - "language", - "bday", - "bday-day", - "bday-month", - "bday-year", - "sex", - "tel", - "tel-country-code", - "tel-national", - "tel-area-code", - "tel-local", - "tel-extension", - "impp", - "url", - "photo" - ], - "type": "string" - }, - "maxLength": { - "title": "Max length", - "description": "Max length of the input field. Will add a counter to let the user know how many characters are left.", - "type": "integer" - } - }, - "required": ["id", "type", "dataModelBindings"], - "title": "Input component schema" -} +{"$id":"https://altinncdn.no/schemas/json/component/Input.schema.v1.json","$schema":"http://json-schema.org/draft-07/schema#","properties":{"id":{"title":"ID","description":"The component ID. Must be unique within all layouts/pages in a layout-set. Cannot end with .","type":"string","pattern":"^[0-9a-zA-Z][0-9a-zA-Z-]*(-?[a-zA-Z]+|[a-zA-Z][0-9]+|-[0-9]{6,})$"},"hidden":{"title":"Hidden","description":"Boolean value or expression indicating if the component should be hidden. Defaults to false.","default":false,"$ref":"expression.schema.v1.json#/definitions/boolean"},"grid":{"properties":{"xs":{"$ref":"#/definitions/IGridSize"},"sm":{"$ref":"#/definitions/IGridSize"},"md":{"$ref":"#/definitions/IGridSize"},"lg":{"$ref":"#/definitions/IGridSize"},"xl":{"$ref":"#/definitions/IGridSize"},"labelGrid":{"$ref":"#/definitions/IGridStyling"},"innerGrid":{"$ref":"#/definitions/IGridStyling"}}},"pageBreak":{"title":"Page break","description":"Optionally insert page-break before/after component when rendered in PDF","type":"object","properties":{"breakBefore":{"title":"Page break before","description":"PDF only: Value or expression indicating whether a page break should be added before the component. Can be either: 'auto' (default), 'always', or 'avoid'.","examples":["auto","always","avoid"],"default":"auto","$ref":"expression.schema.v1.json#/definitions/string"},"breakAfter":{"title":"Page break after","description":"PDF only: Value or expression indicating whether a page break should be added after the component. Can be either: 'auto' (default), 'always', or 'avoid'.","examples":["auto","always","avoid"],"default":"auto","$ref":"expression.schema.v1.json#/definitions/string"}},"additionalProperties":false},"readOnly":{"title":"Read only/disabled?","description":"Boolean value or expression indicating if the component should be read only/disabled. Defaults to false.
Please note that even with read-only fields in components, it may currently be possible to update the field by modifying the request sent to the API or through a direct API call.","default":false,"$ref":"expression.schema.v1.json#/definitions/boolean"},"required":{"title":"Required?","description":"Boolean value or expression indicating if the component should be required. Defaults to false.","default":false,"$ref":"expression.schema.v1.json#/definitions/boolean"},"showValidations":{"title":"Validation types","description":"List of validation types to show","type":"array","items":{"enum":["Schema","Component","Expression","CustomBackend","Required","AllExceptRequired","All"],"type":"string"}},"renderAsSummary":{"title":"Render as summary","description":"Boolean value indicating if the component should be rendered as a summary. Defaults to false.","default":false,"type":"boolean"},"forceShowInSummary":{"title":"Force show in summary","description":"Will force show the component in a summary even if hideEmptyFields is set to true in the summary component.","default":false,"$ref":"expression.schema.v1.json#/definitions/boolean"},"labelSettings":{"title":"ILabelSettings","type":"object","properties":{"optionalIndicator":{"title":"Optional indicator","description":"Show optional indicator on label","type":"boolean"}},"additionalProperties":false},"type":{"const":"Input"},"textResourceBindings":{"properties":{"title":{"title":"Title","description":"Label text/title shown above the component","$ref":"expression.schema.v1.json#/definitions/string"},"description":{"title":"Description","description":"Label description shown above the component, below the title","$ref":"expression.schema.v1.json#/definitions/string"},"help":{"title":"Help text","description":"Help text shown in a tooltip when clicking the help button","$ref":"expression.schema.v1.json#/definitions/string"},"tableTitle":{"title":"Table title","description":"Title used in the table view (overrides the default title)","$ref":"expression.schema.v1.json#/definitions/string"},"shortName":{"title":"Short name (for validation)","description":"Alternative name used for required validation messages (overrides the default title)","$ref":"expression.schema.v1.json#/definitions/string"},"requiredValidation":{"title":"Required validation message","description":"Full validation message shown when the component is required and no value has been entered (overrides both the default and shortName)","$ref":"expression.schema.v1.json#/definitions/string"},"summaryTitle":{"title":"Summary title","description":"Title used in the summary view (overrides the default title)","$ref":"expression.schema.v1.json#/definitions/string"},"summaryAccessibleTitle":{"title":"Accessible summary title","description":"Title used for aria-label on the edit button in the summary view (overrides the default and summary title)","$ref":"expression.schema.v1.json#/definitions/string"},"prefix":{"title":"Prefix","description":"Prefix shown before the input field","$ref":"expression.schema.v1.json#/definitions/string"},"suffix":{"title":"Suffix","description":"Suffix shown after the input field","$ref":"expression.schema.v1.json#/definitions/string"}}},"dataModelBindings":{"title":"Data model binding","description":"Describes the location in the data model where the component should store its value(s). A simple binding is used for components that only store a single value, usually a string.","type":"object","properties":{"simpleBinding":{"type":"string"}},"required":["simpleBinding"],"additionalProperties":false},"saveWhileTyping":{"title":"Automatic saving while typing","description":"Lets you control how long we wait before saving the value locally while typing. This value is usually also used to determine how long we wait before saving the value to the server. The default value is 400 milliseconds.","default":400,"type":"number"},"formatting":{"title":"IFormatting","examples":[{"currency":"NOK"},{"number":{"thousandSeparator":" ","decimalSeparator":",","allowNegative":false,"suffix":" kr"}}],"type":"object","properties":{"currency":{"title":"Language-sensitive currency formatting","description":"Enables currency to be language sensitive based on selected app language. Note: parts that already exist in number property are not overridden by this prop.","enum":["AED","AFN","ALL","AMD","ANG","AOA","ARS","AUD","AWG","AZN","BAM","BBD","BDT","BGN","BHD","BIF","BMD","BND","BOB","BOV","BRL","BSD","BTN","BWP","BYN","BZD","CAD","CDF","CHE","CHF","CHW","CLF","CLP","CNY","COP","COU","CRC","CUC","CUP","CVE","CZK","DJF","DKK","DOP","DZD","EGP","ERN","ETB","EUR","FJD","FKP","GBP","GEL","GHS","GIP","GMD","GNF","GTQ","GYD","HKD","HNL","HTG","HUF","IDR","ILS","INR","IQD","IRR","ISK","JMD","JOD","JPY","KES","KGS","KHR","KMF","KPW","KRW","KWD","KYD","KZT","LAK","LBP","LKR","LRD","LSL","LYD","MAD","MDL","MGA","MKD","MMK","MNT","MOP","MRU","MUR","MVR","MWK","MXN","MXV","MYR","MZN","NAD","NGN","NIO","NOK","NPR","NZD","OMR","PAB","PEN","PGK","PHP","PKR","PLN","PYG","QAR","RON","RSD","RUB","RWF","SAR","SBD","SCR","SDG","SEK","SGD","SHP","SLE","SLL","SOS","SRD","SSP","STN","SVC","SYP","SZL","THB","TJS","TMT","TND","TOP","TRY","TTD","TWD","TZS","UAH","UGX","USD","USN","UYI","UYU","UYW","UZS","VED","VES","VND","VUV","WST","XAF","XCD","XDR","XOF","XPF","XSU","XUA","YER","ZAR","ZMW","ZWL"]},"unit":{"title":"Language-sensitive number formatting based on unit","description":"Enables unit along with thousand and decimal separators to be language sensitive based on selected app language. They are configured in number property. Note: parts that already exist in number property are not overridden by this prop.","enum":["celsius","centimeter","day","degree","foot","gram","hectare","hour","inch","kilogram","kilometer","liter","meter","milliliter","millimeter","millisecond","minute","month","percent","second","week","year"]},"position":{"title":"Position of the currency/unit symbol","description":"Display the unit as prefix or suffix. Default is prefix. (Use only when using currency or unit options)","enum":["prefix","suffix"]},"number":{"anyOf":[{"$ref":"#/definitions/PatternFormatProps"},{"$ref":"#/definitions/NumberFormatProps"}]},"align":{"default":"left","enum":["right","center","left"]}},"additionalProperties":false},"variant":{"title":"Input variant","description":"The variant of the input field (text or search).","default":"text","enum":["text","search"],"type":"string"},"autocomplete":{"title":"HTML autocomplete values","description":"Autocomplete hints to the browser. See https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/autocomplete","enum":["on","off","name","honorific-prefix","given-name","additional-name","family-name","honorific-suffix","nickname","email","username","new-password","current-password","one-time-code","organization-title","organization","street-address","address-line1","address-line2","address-line3","address-level4","address-level3","address-level2","address-level1","country","country-name","postal-code","cc-name","cc-given-name","cc-additional-name","cc-family-name","cc-number","cc-exp","cc-exp-month","cc-exp-year","cc-csc","cc-type","transaction-currency","transaction-amount","language","bday","bday-day","bday-month","bday-year","sex","tel","tel-country-code","tel-national","tel-area-code","tel-local","tel-extension","impp","url","photo"],"type":"string"},"maxLength":{"title":"Max length","description":"Max length of the input field. Will add a counter to let the user know how many characters are left.","type":"integer"}},"required":["id","type","dataModelBindings"],"title":"Input component schema"} \ No newline at end of file diff --git a/frontend/packages/ux-editor/src/testing/schemas/json/component/InstanceInformation.schema.v1.json b/frontend/packages/ux-editor/src/testing/schemas/json/component/InstanceInformation.schema.v1.json index 0f00fac044e..dc84b59c767 100644 --- a/frontend/packages/ux-editor/src/testing/schemas/json/component/InstanceInformation.schema.v1.json +++ b/frontend/packages/ux-editor/src/testing/schemas/json/component/InstanceInformation.schema.v1.json @@ -1,99 +1 @@ -{ - "$id": "https://altinncdn.no/schemas/json/component/InstanceInformation.schema.v1.json", - "$schema": "http://json-schema.org/draft-07/schema#", - "properties": { - "id": { - "title": "ID", - "description": "The component ID. Must be unique within all layouts/pages in a layout-set. Cannot end with .", - "type": "string", - "pattern": "^[0-9a-zA-Z][0-9a-zA-Z-]*(-?[a-zA-Z]+|[a-zA-Z][0-9]+|-[0-9]{6,})$" - }, - "hidden": { - "title": "Hidden", - "description": "Boolean value or expression indicating if the component should be hidden. Defaults to false.", - "default": false, - "$ref": "expression.schema.v1.json#/definitions/boolean" - }, - "grid": { - "properties": { - "xs": { "$ref": "#/definitions/IGridSize" }, - "sm": { "$ref": "#/definitions/IGridSize" }, - "md": { "$ref": "#/definitions/IGridSize" }, - "lg": { "$ref": "#/definitions/IGridSize" }, - "xl": { "$ref": "#/definitions/IGridSize" }, - "labelGrid": { "$ref": "#/definitions/IGridStyling" }, - "innerGrid": { "$ref": "#/definitions/IGridStyling" } - } - }, - "pageBreak": { - "title": "Page break", - "description": "Optionally insert page-break before/after component when rendered in PDF", - "type": "object", - "properties": { - "breakBefore": { - "title": "Page break before", - "description": "PDF only: Value or expression indicating whether a page break should be added before the component. Can be either: 'auto' (default), 'always', or 'avoid'.", - "examples": ["auto", "always", "avoid"], - "default": "auto", - "$ref": "expression.schema.v1.json#/definitions/string" - }, - "breakAfter": { - "title": "Page break after", - "description": "PDF only: Value or expression indicating whether a page break should be added after the component. Can be either: 'auto' (default), 'always', or 'avoid'.", - "examples": ["auto", "always", "avoid"], - "default": "auto", - "$ref": "expression.schema.v1.json#/definitions/string" - } - }, - "additionalProperties": false - }, - "labelSettings": { - "title": "ILabelSettings", - "type": "object", - "properties": { - "optionalIndicator": { - "title": "Optional indicator", - "description": "Show optional indicator on label", - "type": "boolean" - } - }, - "additionalProperties": false - }, - "type": { "const": "InstanceInformation" }, - "elements": { - "title": "Elements", - "description": "Which elements to show in the instance information", - "type": "object", - "properties": { - "dateSent": { "type": "boolean" }, - "sender": { "type": "boolean" }, - "receiver": { "type": "boolean" }, - "referenceNumber": { "type": "boolean" } - }, - "additionalProperties": false - }, - "textResourceBindings": { - "title": "TRBLabel", - "type": "object", - "properties": { - "title": { - "title": "Title", - "description": "Label text/title shown above the component", - "$ref": "expression.schema.v1.json#/definitions/string" - }, - "description": { - "title": "Description", - "description": "Label description shown above the component, below the title", - "$ref": "expression.schema.v1.json#/definitions/string" - }, - "help": { - "title": "Help text", - "description": "Help text shown in a tooltip when clicking the help button", - "$ref": "expression.schema.v1.json#/definitions/string" - } - } - } - }, - "required": ["id", "type"], - "title": "InstanceInformation component schema" -} +{"$id":"https://altinncdn.no/schemas/json/component/InstanceInformation.schema.v1.json","$schema":"http://json-schema.org/draft-07/schema#","properties":{"id":{"title":"ID","description":"The component ID. Must be unique within all layouts/pages in a layout-set. Cannot end with .","type":"string","pattern":"^[0-9a-zA-Z][0-9a-zA-Z-]*(-?[a-zA-Z]+|[a-zA-Z][0-9]+|-[0-9]{6,})$"},"hidden":{"title":"Hidden","description":"Boolean value or expression indicating if the component should be hidden. Defaults to false.","default":false,"$ref":"expression.schema.v1.json#/definitions/boolean"},"grid":{"properties":{"xs":{"$ref":"#/definitions/IGridSize"},"sm":{"$ref":"#/definitions/IGridSize"},"md":{"$ref":"#/definitions/IGridSize"},"lg":{"$ref":"#/definitions/IGridSize"},"xl":{"$ref":"#/definitions/IGridSize"},"labelGrid":{"$ref":"#/definitions/IGridStyling"},"innerGrid":{"$ref":"#/definitions/IGridStyling"}}},"pageBreak":{"title":"Page break","description":"Optionally insert page-break before/after component when rendered in PDF","type":"object","properties":{"breakBefore":{"title":"Page break before","description":"PDF only: Value or expression indicating whether a page break should be added before the component. Can be either: 'auto' (default), 'always', or 'avoid'.","examples":["auto","always","avoid"],"default":"auto","$ref":"expression.schema.v1.json#/definitions/string"},"breakAfter":{"title":"Page break after","description":"PDF only: Value or expression indicating whether a page break should be added after the component. Can be either: 'auto' (default), 'always', or 'avoid'.","examples":["auto","always","avoid"],"default":"auto","$ref":"expression.schema.v1.json#/definitions/string"}},"additionalProperties":false},"labelSettings":{"title":"ILabelSettings","type":"object","properties":{"optionalIndicator":{"title":"Optional indicator","description":"Show optional indicator on label","type":"boolean"}},"additionalProperties":false},"type":{"const":"InstanceInformation"},"elements":{"title":"Elements","description":"Which elements to show in the instance information","type":"object","properties":{"dateSent":{"type":"boolean"},"sender":{"type":"boolean"},"receiver":{"type":"boolean"},"referenceNumber":{"type":"boolean"}},"additionalProperties":false},"textResourceBindings":{"title":"TRBLabel","type":"object","properties":{"title":{"title":"Title","description":"Label text/title shown above the component","$ref":"expression.schema.v1.json#/definitions/string"},"description":{"title":"Description","description":"Label description shown above the component, below the title","$ref":"expression.schema.v1.json#/definitions/string"},"help":{"title":"Help text","description":"Help text shown in a tooltip when clicking the help button","$ref":"expression.schema.v1.json#/definitions/string"}}}},"required":["id","type"],"title":"InstanceInformation component schema"} \ No newline at end of file diff --git a/frontend/packages/ux-editor/src/testing/schemas/json/component/InstantiationButton.schema.v1.json b/frontend/packages/ux-editor/src/testing/schemas/json/component/InstantiationButton.schema.v1.json index bab7537533d..5a8865d0f49 100644 --- a/frontend/packages/ux-editor/src/testing/schemas/json/component/InstantiationButton.schema.v1.json +++ b/frontend/packages/ux-editor/src/testing/schemas/json/component/InstantiationButton.schema.v1.json @@ -1,72 +1 @@ -{ - "$id": "https://altinncdn.no/schemas/json/component/InstantiationButton.schema.v1.json", - "$schema": "http://json-schema.org/draft-07/schema#", - "properties": { - "id": { - "title": "ID", - "description": "The component ID. Must be unique within all layouts/pages in a layout-set. Cannot end with .", - "type": "string", - "pattern": "^[0-9a-zA-Z][0-9a-zA-Z-]*(-?[a-zA-Z]+|[a-zA-Z][0-9]+|-[0-9]{6,})$" - }, - "hidden": { - "title": "Hidden", - "description": "Boolean value or expression indicating if the component should be hidden. Defaults to false.", - "default": false, - "$ref": "expression.schema.v1.json#/definitions/boolean" - }, - "grid": { - "properties": { - "xs": { "$ref": "#/definitions/IGridSize" }, - "sm": { "$ref": "#/definitions/IGridSize" }, - "md": { "$ref": "#/definitions/IGridSize" }, - "lg": { "$ref": "#/definitions/IGridSize" }, - "xl": { "$ref": "#/definitions/IGridSize" }, - "labelGrid": { "$ref": "#/definitions/IGridStyling" }, - "innerGrid": { "$ref": "#/definitions/IGridStyling" } - } - }, - "pageBreak": { - "title": "Page break", - "description": "Optionally insert page-break before/after component when rendered in PDF", - "type": "object", - "properties": { - "breakBefore": { - "title": "Page break before", - "description": "PDF only: Value or expression indicating whether a page break should be added before the component. Can be either: 'auto' (default), 'always', or 'avoid'.", - "examples": ["auto", "always", "avoid"], - "default": "auto", - "$ref": "expression.schema.v1.json#/definitions/string" - }, - "breakAfter": { - "title": "Page break after", - "description": "PDF only: Value or expression indicating whether a page break should be added after the component. Can be either: 'auto' (default), 'always', or 'avoid'.", - "examples": ["auto", "always", "avoid"], - "default": "auto", - "$ref": "expression.schema.v1.json#/definitions/string" - } - }, - "additionalProperties": false - }, - "type": { "const": "InstantiationButton" }, - "textResourceBindings": { - "type": "object", - "properties": { - "title": { - "title": "Title", - "description": "The title/text to display on the button", - "$ref": "expression.schema.v1.json#/definitions/string" - } - }, - "additionalProperties": false - }, - "mapping": { - "title": "Mapping", - "description": "A mapping of key-value pairs (usually used for mapping a path in the data model to a query string parameter).", - "type": "object", - "properties": {}, - "additionalProperties": { "type": "string" } - } - }, - "required": ["id", "type"], - "title": "InstantiationButton component schema" -} +{"$id":"https://altinncdn.no/schemas/json/component/InstantiationButton.schema.v1.json","$schema":"http://json-schema.org/draft-07/schema#","properties":{"id":{"title":"ID","description":"The component ID. Must be unique within all layouts/pages in a layout-set. Cannot end with .","type":"string","pattern":"^[0-9a-zA-Z][0-9a-zA-Z-]*(-?[a-zA-Z]+|[a-zA-Z][0-9]+|-[0-9]{6,})$"},"hidden":{"title":"Hidden","description":"Boolean value or expression indicating if the component should be hidden. Defaults to false.","default":false,"$ref":"expression.schema.v1.json#/definitions/boolean"},"grid":{"properties":{"xs":{"$ref":"#/definitions/IGridSize"},"sm":{"$ref":"#/definitions/IGridSize"},"md":{"$ref":"#/definitions/IGridSize"},"lg":{"$ref":"#/definitions/IGridSize"},"xl":{"$ref":"#/definitions/IGridSize"},"labelGrid":{"$ref":"#/definitions/IGridStyling"},"innerGrid":{"$ref":"#/definitions/IGridStyling"}}},"pageBreak":{"title":"Page break","description":"Optionally insert page-break before/after component when rendered in PDF","type":"object","properties":{"breakBefore":{"title":"Page break before","description":"PDF only: Value or expression indicating whether a page break should be added before the component. Can be either: 'auto' (default), 'always', or 'avoid'.","examples":["auto","always","avoid"],"default":"auto","$ref":"expression.schema.v1.json#/definitions/string"},"breakAfter":{"title":"Page break after","description":"PDF only: Value or expression indicating whether a page break should be added after the component. Can be either: 'auto' (default), 'always', or 'avoid'.","examples":["auto","always","avoid"],"default":"auto","$ref":"expression.schema.v1.json#/definitions/string"}},"additionalProperties":false},"type":{"const":"InstantiationButton"},"textResourceBindings":{"type":"object","properties":{"title":{"title":"Title","description":"The title/text to display on the button","$ref":"expression.schema.v1.json#/definitions/string"}},"additionalProperties":false},"mapping":{"title":"Mapping","description":"A mapping of key-value pairs (usually used for mapping a path in the data model to a query string parameter).","type":"object","properties":{},"additionalProperties":{"type":"string"}}},"required":["id","type"],"title":"InstantiationButton component schema"} \ No newline at end of file diff --git a/frontend/packages/ux-editor/src/testing/schemas/json/component/Likert.schema.v1.json b/frontend/packages/ux-editor/src/testing/schemas/json/component/Likert.schema.v1.json index 5eaac98fd2c..7ca2886387a 100644 --- a/frontend/packages/ux-editor/src/testing/schemas/json/component/Likert.schema.v1.json +++ b/frontend/packages/ux-editor/src/testing/schemas/json/component/Likert.schema.v1.json @@ -1,281 +1 @@ -{ - "$id": "https://altinncdn.no/schemas/json/component/Likert.schema.v1.json", - "$schema": "http://json-schema.org/draft-07/schema#", - "properties": { - "id": { - "title": "ID", - "description": "The component ID. Must be unique within all layouts/pages in a layout-set. Cannot end with .", - "type": "string", - "pattern": "^[0-9a-zA-Z][0-9a-zA-Z-]*(-?[a-zA-Z]+|[a-zA-Z][0-9]+|-[0-9]{6,})$" - }, - "hidden": { - "title": "Hidden", - "description": "Boolean value or expression indicating if the component should be hidden. Defaults to false.", - "default": false, - "$ref": "expression.schema.v1.json#/definitions/boolean" - }, - "grid": { - "properties": { - "xs": { "$ref": "#/definitions/IGridSize" }, - "sm": { "$ref": "#/definitions/IGridSize" }, - "md": { "$ref": "#/definitions/IGridSize" }, - "lg": { "$ref": "#/definitions/IGridSize" }, - "xl": { "$ref": "#/definitions/IGridSize" }, - "labelGrid": { "$ref": "#/definitions/IGridStyling" }, - "innerGrid": { "$ref": "#/definitions/IGridStyling" } - } - }, - "pageBreak": { - "title": "Page break", - "description": "Optionally insert page-break before/after component when rendered in PDF", - "type": "object", - "properties": { - "breakBefore": { - "title": "Page break before", - "description": "PDF only: Value or expression indicating whether a page break should be added before the component. Can be either: 'auto' (default), 'always', or 'avoid'.", - "examples": ["auto", "always", "avoid"], - "default": "auto", - "$ref": "expression.schema.v1.json#/definitions/string" - }, - "breakAfter": { - "title": "Page break after", - "description": "PDF only: Value or expression indicating whether a page break should be added after the component. Can be either: 'auto' (default), 'always', or 'avoid'.", - "examples": ["auto", "always", "avoid"], - "default": "auto", - "$ref": "expression.schema.v1.json#/definitions/string" - } - }, - "additionalProperties": false - }, - "readOnly": { - "title": "Read only/disabled?", - "description": "Boolean value or expression indicating if the component should be read only/disabled. Defaults to false.
Please note that even with read-only fields in components, it may currently be possible to update the field by modifying the request sent to the API or through a direct API call.", - "default": false, - "$ref": "expression.schema.v1.json#/definitions/boolean" - }, - "required": { - "title": "Required?", - "description": "Boolean value or expression indicating if the component should be required. Defaults to false.", - "default": false, - "$ref": "expression.schema.v1.json#/definitions/boolean" - }, - "showValidations": { - "title": "Validation types", - "description": "List of validation types to show", - "type": "array", - "items": { - "enum": [ - "Schema", - "Component", - "Expression", - "CustomBackend", - "Required", - "AllExceptRequired", - "All" - ], - "type": "string" - } - }, - "renderAsSummary": { - "title": "Render as summary", - "description": "Boolean value indicating if the component should be rendered as a summary. Defaults to false.", - "default": false, - "type": "boolean" - }, - "forceShowInSummary": { - "title": "Force show in summary", - "description": "Will force show the component in a summary even if hideEmptyFields is set to true in the summary component.", - "default": false, - "$ref": "expression.schema.v1.json#/definitions/boolean" - }, - "optionsId": { - "title": "Dynamic options (fetched from server)", - "description": "ID of the option list to fetch from the server", - "type": "string" - }, - "mapping": { - "title": "Mapping", - "description": "A mapping of key-value pairs (usually used for mapping a path in the data model to a query string parameter).", - "type": "object", - "properties": {}, - "additionalProperties": { "type": "string" } - }, - "queryParameters": { - "title": "Query parameters", - "description": "A mapping of query string parameters to values. Will be appended to the URL when fetching options.", - "type": "object", - "properties": {}, - "additionalProperties": { "type": "string" } - }, - "options": { - "title": "Static options", - "description": "List of static options", - "type": "array", - "items": { - "title": "IRawOption", - "examples": [{ "label": "", "value": "" }], - "type": "object", - "properties": { - "label": { "type": "string" }, - "value": { - "anyOf": [ - { "type": "string" }, - { "type": "number" }, - { "type": "boolean" }, - { "const": null } - ] - }, - "description": { "type": "string" }, - "helpText": { "type": "string" } - }, - "required": ["label", "value"], - "additionalProperties": false - } - }, - "secure": { - "title": "Secure options (when using optionsId)", - "description": "Whether to call the secure API endpoint when fetching options from the server (allows for user/instance-specific options)", - "default": false, - "type": "boolean" - }, - "sortOrder": { - "description": "Sorts the code list in either ascending or descending order by label.", - "enum": ["asc", "desc"], - "type": "string" - }, - "source": { - "title": "Option source", - "description": "Allows for fetching options from the data model, pointing to a repeating group structure", - "type": "object", - "properties": { - "group": { - "title": "Group", - "description": "The repeating group to base options on.", - "examples": ["model.some.group"], - "type": "string" - }, - "label": { - "title": "Label", - "description": "A label of the option displayed in Radio- and Checkbox groups. Can be plain text, a text resource binding, or a dynamic expression.", - "examples": ["some.text.key"], - "$ref": "expression.schema.v1.json#/definitions/string" - }, - "value": { - "title": "Value", - "description": "Field in the group that should be used as value", - "examples": ["model.some.group[{0}].someField"], - "type": "string" - }, - "description": { - "title": "Description", - "description": "A description of the option displayed in Radio- and Checkbox groups. Can be plain text, a text resource binding, or a dynamic expression.", - "examples": ["some.text.key", "My Description"], - "$ref": "expression.schema.v1.json#/definitions/string" - }, - "helpText": { - "title": "Help Text", - "description": "A help text for the option displayed in Radio- and Checkbox groups. Can be plain text, a text resource binding, or a dynamic expression.", - "examples": ["some.text.key", "My Help Text"], - "$ref": "expression.schema.v1.json#/definitions/string" - } - }, - "required": ["group", "label", "value"], - "additionalProperties": false - }, - "type": { "const": "Likert" }, - "textResourceBindings": { - "properties": { - "title": { - "title": "Title", - "description": "The title of the group", - "$ref": "expression.schema.v1.json#/definitions/string" - }, - "description": { - "title": "Description", - "description": "The description text for the Likert table.", - "$ref": "expression.schema.v1.json#/definitions/string" - }, - "tableTitle": { - "title": "Table title", - "description": "Title used in the table view (overrides the default title)", - "$ref": "expression.schema.v1.json#/definitions/string" - }, - "shortName": { - "title": "Short name (for validation)", - "description": "Alternative name used for required validation messages (overrides the default title)", - "$ref": "expression.schema.v1.json#/definitions/string" - }, - "requiredValidation": { - "title": "Required validation message", - "description": "Full validation message shown when the component is required and no value has been entered (overrides both the default and shortName)", - "$ref": "expression.schema.v1.json#/definitions/string" - }, - "summaryTitle": { - "title": "Summary title", - "description": "Title used in the summary view (overrides the default title)", - "$ref": "expression.schema.v1.json#/definitions/string" - }, - "summaryAccessibleTitle": { - "title": "Accessible summary title", - "description": "Title used for aria-label on the edit button in the summary view (overrides the default and summary title)", - "$ref": "expression.schema.v1.json#/definitions/string" - }, - "leftColumnHeader": { - "title": "Left column header", - "description": "The header text for the left column in the Likert table", - "$ref": "expression.schema.v1.json#/definitions/string" - }, - "questions": { - "title": "Questions", - "description": "The questions to be displayed in each row (use a dynamic text resource)", - "$ref": "expression.schema.v1.json#/definitions/string" - }, - "questionDescriptions": { - "title": "Question descriptions", - "description": "The descriptions to be displayed in each row (use a dynamic text resource)", - "$ref": "expression.schema.v1.json#/definitions/string" - }, - "questionHelpTexts": { - "title": "Question help texts", - "description": "The help texts to be displayed in each row (use a dynamic text resource)", - "$ref": "expression.schema.v1.json#/definitions/string" - } - } - }, - "dataModelBindings": { - "title": "Data model binding", - "description": "Describes the location in the data model where the component should store its value(s). A list binding should be pointed to an array structure in the data model, and is used for components that store multiple simple values (e.g. a list of strings).", - "type": "object", - "properties": { - "answer": { - "title": "Answer", - "description": "Dot notation location for the answers. This must point to a property of the objects inside the question array. The answer for each question will be stored in the answer property of the corresponding question object.", - "type": "string" - }, - "questions": { - "title": "Questions", - "description": "Dot notation location for a likert structure (array of objects), where the data is stored", - "type": "string" - } - }, - "required": ["answer", "questions"], - "additionalProperties": false - }, - "filter": { - "title": "Filter", - "description": "Optionally filter specific rows within the likert group using start/stop indexes for displaying the desired ones(beware that start index starts at zero, and stop index starts at one, so {start, stop} = {0, 3} will display 3 rows, not 4)", - "type": "array", - "items": { - "type": "object", - "properties": { - "key": { "enum": ["start", "stop"] }, - "value": { "anyOf": [{ "type": "string", "pattern": "^\\d+$" }, { "type": "number" }] } - }, - "required": ["key", "value"], - "additionalProperties": false - } - } - }, - "required": ["id", "type", "dataModelBindings"], - "title": "Likert component schema" -} +{"$id":"https://altinncdn.no/schemas/json/component/Likert.schema.v1.json","$schema":"http://json-schema.org/draft-07/schema#","properties":{"id":{"title":"ID","description":"The component ID. Must be unique within all layouts/pages in a layout-set. Cannot end with .","type":"string","pattern":"^[0-9a-zA-Z][0-9a-zA-Z-]*(-?[a-zA-Z]+|[a-zA-Z][0-9]+|-[0-9]{6,})$"},"hidden":{"title":"Hidden","description":"Boolean value or expression indicating if the component should be hidden. Defaults to false.","default":false,"$ref":"expression.schema.v1.json#/definitions/boolean"},"grid":{"properties":{"xs":{"$ref":"#/definitions/IGridSize"},"sm":{"$ref":"#/definitions/IGridSize"},"md":{"$ref":"#/definitions/IGridSize"},"lg":{"$ref":"#/definitions/IGridSize"},"xl":{"$ref":"#/definitions/IGridSize"},"labelGrid":{"$ref":"#/definitions/IGridStyling"},"innerGrid":{"$ref":"#/definitions/IGridStyling"}}},"pageBreak":{"title":"Page break","description":"Optionally insert page-break before/after component when rendered in PDF","type":"object","properties":{"breakBefore":{"title":"Page break before","description":"PDF only: Value or expression indicating whether a page break should be added before the component. Can be either: 'auto' (default), 'always', or 'avoid'.","examples":["auto","always","avoid"],"default":"auto","$ref":"expression.schema.v1.json#/definitions/string"},"breakAfter":{"title":"Page break after","description":"PDF only: Value or expression indicating whether a page break should be added after the component. Can be either: 'auto' (default), 'always', or 'avoid'.","examples":["auto","always","avoid"],"default":"auto","$ref":"expression.schema.v1.json#/definitions/string"}},"additionalProperties":false},"readOnly":{"title":"Read only/disabled?","description":"Boolean value or expression indicating if the component should be read only/disabled. Defaults to false.
Please note that even with read-only fields in components, it may currently be possible to update the field by modifying the request sent to the API or through a direct API call.","default":false,"$ref":"expression.schema.v1.json#/definitions/boolean"},"required":{"title":"Required?","description":"Boolean value or expression indicating if the component should be required. Defaults to false.","default":false,"$ref":"expression.schema.v1.json#/definitions/boolean"},"showValidations":{"title":"Validation types","description":"List of validation types to show","type":"array","items":{"enum":["Schema","Component","Expression","CustomBackend","Required","AllExceptRequired","All"],"type":"string"}},"renderAsSummary":{"title":"Render as summary","description":"Boolean value indicating if the component should be rendered as a summary. Defaults to false.","default":false,"type":"boolean"},"forceShowInSummary":{"title":"Force show in summary","description":"Will force show the component in a summary even if hideEmptyFields is set to true in the summary component.","default":false,"$ref":"expression.schema.v1.json#/definitions/boolean"},"optionsId":{"title":"Dynamic options (fetched from server)","description":"ID of the option list to fetch from the server","type":"string"},"mapping":{"title":"Mapping","description":"A mapping of key-value pairs (usually used for mapping a path in the data model to a query string parameter).","type":"object","properties":{},"additionalProperties":{"type":"string"}},"queryParameters":{"title":"Query parameters","description":"A mapping of query string parameters to values. Will be appended to the URL when fetching options.","type":"object","properties":{},"additionalProperties":{"type":"string"}},"options":{"title":"Static options","description":"List of static options","type":"array","items":{"title":"IRawOption","examples":[{"label":"","value":""}],"type":"object","properties":{"label":{"type":"string"},"value":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"const":null}]},"description":{"type":"string"},"helpText":{"type":"string"}},"required":["label","value"],"additionalProperties":false}},"secure":{"title":"Secure options (when using optionsId)","description":"Whether to call the secure API endpoint when fetching options from the server (allows for user/instance-specific options)","default":false,"type":"boolean"},"sortOrder":{"description":"Sorts the code list in either ascending or descending order by label.","enum":["asc","desc"],"type":"string"},"source":{"title":"Option source","description":"Allows for fetching options from the data model, pointing to a repeating group structure","type":"object","properties":{"group":{"title":"Group","description":"The repeating group to base options on.","examples":["model.some.group"],"type":"string"},"label":{"title":"Label","description":"A label of the option displayed in Radio- and Checkbox groups. Can be plain text, a text resource binding, or a dynamic expression.","examples":["some.text.key"],"$ref":"expression.schema.v1.json#/definitions/string"},"value":{"title":"Value","description":"Field in the group that should be used as value","examples":["model.some.group[{0}].someField"],"type":"string"},"description":{"title":"Description","description":"A description of the option displayed in Radio- and Checkbox groups. Can be plain text, a text resource binding, or a dynamic expression.","examples":["some.text.key","My Description"],"$ref":"expression.schema.v1.json#/definitions/string"},"helpText":{"title":"Help Text","description":"A help text for the option displayed in Radio- and Checkbox groups. Can be plain text, a text resource binding, or a dynamic expression.","examples":["some.text.key","My Help Text"],"$ref":"expression.schema.v1.json#/definitions/string"}},"required":["group","label","value"],"additionalProperties":false},"type":{"const":"Likert"},"textResourceBindings":{"properties":{"title":{"title":"Title","description":"The title of the group","$ref":"expression.schema.v1.json#/definitions/string"},"description":{"title":"Description","description":"The description text for the Likert table.","$ref":"expression.schema.v1.json#/definitions/string"},"tableTitle":{"title":"Table title","description":"Title used in the table view (overrides the default title)","$ref":"expression.schema.v1.json#/definitions/string"},"shortName":{"title":"Short name (for validation)","description":"Alternative name used for required validation messages (overrides the default title)","$ref":"expression.schema.v1.json#/definitions/string"},"requiredValidation":{"title":"Required validation message","description":"Full validation message shown when the component is required and no value has been entered (overrides both the default and shortName)","$ref":"expression.schema.v1.json#/definitions/string"},"summaryTitle":{"title":"Summary title","description":"Title used in the summary view (overrides the default title)","$ref":"expression.schema.v1.json#/definitions/string"},"summaryAccessibleTitle":{"title":"Accessible summary title","description":"Title used for aria-label on the edit button in the summary view (overrides the default and summary title)","$ref":"expression.schema.v1.json#/definitions/string"},"leftColumnHeader":{"title":"Left column header","description":"The header text for the left column in the Likert table","$ref":"expression.schema.v1.json#/definitions/string"},"questions":{"title":"Questions","description":"The questions to be displayed in each row (use a dynamic text resource)","$ref":"expression.schema.v1.json#/definitions/string"},"questionDescriptions":{"title":"Question descriptions","description":"The descriptions to be displayed in each row (use a dynamic text resource)","$ref":"expression.schema.v1.json#/definitions/string"},"questionHelpTexts":{"title":"Question help texts","description":"The help texts to be displayed in each row (use a dynamic text resource)","$ref":"expression.schema.v1.json#/definitions/string"}}},"dataModelBindings":{"title":"Data model binding","description":"Describes the location in the data model where the component should store its value(s). A list binding should be pointed to an array structure in the data model, and is used for components that store multiple simple values (e.g. a list of strings).","type":"object","properties":{"answer":{"title":"Answer","description":"Dot notation location for the answers. This must point to a property of the objects inside the question array. The answer for each question will be stored in the answer property of the corresponding question object.","type":"string"},"questions":{"title":"Questions","description":"Dot notation location for a likert structure (array of objects), where the data is stored","type":"string"}},"required":["answer","questions"],"additionalProperties":false},"filter":{"title":"Filter","description":"Optionally filter specific rows within the likert group using start/stop indexes for displaying the desired ones(beware that start index starts at zero, and stop index starts at one, so {start, stop} = {0, 3} will display 3 rows, not 4)","type":"array","items":{"type":"object","properties":{"key":{"enum":["start","stop"]},"value":{"anyOf":[{"type":"string","pattern":"^\\d+$"},{"type":"number"}]}},"required":["key","value"],"additionalProperties":false}}},"required":["id","type","dataModelBindings"],"title":"Likert component schema"} \ No newline at end of file diff --git a/frontend/packages/ux-editor/src/testing/schemas/json/component/LikertItem.schema.v1.json b/frontend/packages/ux-editor/src/testing/schemas/json/component/LikertItem.schema.v1.json index dddb7c22ae5..2c4e7299962 100644 --- a/frontend/packages/ux-editor/src/testing/schemas/json/component/LikertItem.schema.v1.json +++ b/frontend/packages/ux-editor/src/testing/schemas/json/component/LikertItem.schema.v1.json @@ -1,265 +1 @@ -{ - "$id": "https://altinncdn.no/schemas/json/component/LikertItem.schema.v1.json", - "$schema": "http://json-schema.org/draft-07/schema#", - "properties": { - "id": { - "title": "ID", - "description": "The component ID. Must be unique within all layouts/pages in a layout-set. Cannot end with .", - "type": "string", - "pattern": "^[0-9a-zA-Z][0-9a-zA-Z-]*(-?[a-zA-Z]+|[a-zA-Z][0-9]+|-[0-9]{6,})$" - }, - "hidden": { - "title": "Hidden", - "description": "Boolean value or expression indicating if the component should be hidden. Defaults to false.", - "default": false, - "$ref": "expression.schema.v1.json#/definitions/boolean" - }, - "grid": { - "properties": { - "xs": { "$ref": "#/definitions/IGridSize" }, - "sm": { "$ref": "#/definitions/IGridSize" }, - "md": { "$ref": "#/definitions/IGridSize" }, - "lg": { "$ref": "#/definitions/IGridSize" }, - "xl": { "$ref": "#/definitions/IGridSize" }, - "labelGrid": { "$ref": "#/definitions/IGridStyling" }, - "innerGrid": { "$ref": "#/definitions/IGridStyling" } - } - }, - "pageBreak": { - "title": "Page break", - "description": "Optionally insert page-break before/after component when rendered in PDF", - "type": "object", - "properties": { - "breakBefore": { - "title": "Page break before", - "description": "PDF only: Value or expression indicating whether a page break should be added before the component. Can be either: 'auto' (default), 'always', or 'avoid'.", - "examples": ["auto", "always", "avoid"], - "default": "auto", - "$ref": "expression.schema.v1.json#/definitions/string" - }, - "breakAfter": { - "title": "Page break after", - "description": "PDF only: Value or expression indicating whether a page break should be added after the component. Can be either: 'auto' (default), 'always', or 'avoid'.", - "examples": ["auto", "always", "avoid"], - "default": "auto", - "$ref": "expression.schema.v1.json#/definitions/string" - } - }, - "additionalProperties": false - }, - "readOnly": { - "title": "Read only/disabled?", - "description": "Boolean value or expression indicating if the component should be read only/disabled. Defaults to false.
Please note that even with read-only fields in components, it may currently be possible to update the field by modifying the request sent to the API or through a direct API call.", - "default": false, - "$ref": "expression.schema.v1.json#/definitions/boolean" - }, - "required": { - "title": "Required?", - "description": "Boolean value or expression indicating if the component should be required. Defaults to false.", - "default": false, - "$ref": "expression.schema.v1.json#/definitions/boolean" - }, - "showValidations": { - "title": "Validation types", - "description": "List of validation types to show", - "type": "array", - "items": { - "enum": [ - "Schema", - "Component", - "Expression", - "CustomBackend", - "Required", - "AllExceptRequired", - "All" - ], - "type": "string" - } - }, - "renderAsSummary": { - "title": "Render as summary", - "description": "Boolean value indicating if the component should be rendered as a summary. Defaults to false.", - "default": false, - "type": "boolean" - }, - "forceShowInSummary": { - "title": "Force show in summary", - "description": "Will force show the component in a summary even if hideEmptyFields is set to true in the summary component.", - "default": false, - "$ref": "expression.schema.v1.json#/definitions/boolean" - }, - "optionsId": { - "title": "Dynamic options (fetched from server)", - "description": "ID of the option list to fetch from the server", - "type": "string" - }, - "mapping": { - "title": "Mapping", - "description": "A mapping of key-value pairs (usually used for mapping a path in the data model to a query string parameter).", - "type": "object", - "properties": {}, - "additionalProperties": { "type": "string" } - }, - "queryParameters": { - "title": "Query parameters", - "description": "A mapping of query string parameters to values. Will be appended to the URL when fetching options.", - "type": "object", - "properties": {}, - "additionalProperties": { "type": "string" } - }, - "options": { - "title": "Static options", - "description": "List of static options", - "type": "array", - "items": { - "title": "IRawOption", - "examples": [{ "label": "", "value": "" }], - "type": "object", - "properties": { - "label": { "type": "string" }, - "value": { - "anyOf": [ - { "type": "string" }, - { "type": "number" }, - { "type": "boolean" }, - { "const": null } - ] - }, - "description": { "type": "string" }, - "helpText": { "type": "string" } - }, - "required": ["label", "value"], - "additionalProperties": false - } - }, - "secure": { - "title": "Secure options (when using optionsId)", - "description": "Whether to call the secure API endpoint when fetching options from the server (allows for user/instance-specific options)", - "default": false, - "type": "boolean" - }, - "sortOrder": { - "description": "Sorts the code list in either ascending or descending order by label.", - "enum": ["asc", "desc"], - "type": "string" - }, - "source": { - "title": "Option source", - "description": "Allows for fetching options from the data model, pointing to a repeating group structure", - "type": "object", - "properties": { - "group": { - "title": "Group", - "description": "The repeating group to base options on.", - "examples": ["model.some.group"], - "type": "string" - }, - "label": { - "title": "Label", - "description": "A label of the option displayed in Radio- and Checkbox groups. Can be plain text, a text resource binding, or a dynamic expression.", - "examples": ["some.text.key"], - "$ref": "expression.schema.v1.json#/definitions/string" - }, - "value": { - "title": "Value", - "description": "Field in the group that should be used as value", - "examples": ["model.some.group[{0}].someField"], - "type": "string" - }, - "description": { - "title": "Description", - "description": "A description of the option displayed in Radio- and Checkbox groups. Can be plain text, a text resource binding, or a dynamic expression.", - "examples": ["some.text.key", "My Description"], - "$ref": "expression.schema.v1.json#/definitions/string" - }, - "helpText": { - "title": "Help Text", - "description": "A help text for the option displayed in Radio- and Checkbox groups. Can be plain text, a text resource binding, or a dynamic expression.", - "examples": ["some.text.key", "My Help Text"], - "$ref": "expression.schema.v1.json#/definitions/string" - } - }, - "required": ["group", "label", "value"], - "additionalProperties": false - }, - "preselectedOptionIndex": { - "title": "Preselected option index", - "description": "Index of the option to preselect (if no option has been selected yet)", - "type": "integer" - }, - "type": { "const": "LikertItem" }, - "textResourceBindings": { - "properties": { - "title": { - "title": "Title", - "description": "Title of the Likert component/row", - "$ref": "expression.schema.v1.json#/definitions/string" - }, - "description": { - "title": "Description", - "description": "Description of the Likert component/row", - "$ref": "expression.schema.v1.json#/definitions/string" - }, - "help": { - "title": "Help", - "description": "Help text of the Likert component/row", - "$ref": "expression.schema.v1.json#/definitions/string" - }, - "tableTitle": { - "title": "Table title", - "description": "Title used in the table view (overrides the default title)", - "$ref": "expression.schema.v1.json#/definitions/string" - }, - "shortName": { - "title": "Short name (for validation)", - "description": "Alternative name used for required validation messages (overrides the default title)", - "$ref": "expression.schema.v1.json#/definitions/string" - }, - "requiredValidation": { - "title": "Required validation message", - "description": "Full validation message shown when the component is required and no value has been entered (overrides both the default and shortName)", - "$ref": "expression.schema.v1.json#/definitions/string" - }, - "summaryTitle": { - "title": "Summary title", - "description": "Title used in the summary view (overrides the default title)", - "$ref": "expression.schema.v1.json#/definitions/string" - }, - "summaryAccessibleTitle": { - "title": "Accessible summary title", - "description": "Title used for aria-label on the edit button in the summary view (overrides the default and summary title)", - "$ref": "expression.schema.v1.json#/definitions/string" - } - } - }, - "dataModelBindings": { - "title": "Data model binding", - "description": "Describes the location in the data model where the component should store its value(s). A simple binding is used for components that only store a single value, usually a string.", - "type": "object", - "properties": { - "simpleBinding": { "type": "string" }, - "label": { "type": "string" }, - "metadata": { - "description": "Describes the location where metadata for the option based component should be stored in the datamodel.", - "type": "string" - } - }, - "required": ["simpleBinding"], - "additionalProperties": false - }, - "showLabelsInTable": { - "title": "Show label when single option in table", - "description": "Boolean value indicating if the label should be visible when only one option exists in table", - "default": false, - "type": "boolean" - }, - "layout": { - "title": "Layout", - "description": "Define the layout style for the options", - "enum": ["column", "row", "table"], - "type": "string" - } - }, - "required": ["id", "type", "dataModelBindings"], - "title": "LikertItem component schema" -} +{"$id":"https://altinncdn.no/schemas/json/component/LikertItem.schema.v1.json","$schema":"http://json-schema.org/draft-07/schema#","properties":{"id":{"title":"ID","description":"The component ID. Must be unique within all layouts/pages in a layout-set. Cannot end with .","type":"string","pattern":"^[0-9a-zA-Z][0-9a-zA-Z-]*(-?[a-zA-Z]+|[a-zA-Z][0-9]+|-[0-9]{6,})$"},"hidden":{"title":"Hidden","description":"Boolean value or expression indicating if the component should be hidden. Defaults to false.","default":false,"$ref":"expression.schema.v1.json#/definitions/boolean"},"grid":{"properties":{"xs":{"$ref":"#/definitions/IGridSize"},"sm":{"$ref":"#/definitions/IGridSize"},"md":{"$ref":"#/definitions/IGridSize"},"lg":{"$ref":"#/definitions/IGridSize"},"xl":{"$ref":"#/definitions/IGridSize"},"labelGrid":{"$ref":"#/definitions/IGridStyling"},"innerGrid":{"$ref":"#/definitions/IGridStyling"}}},"pageBreak":{"title":"Page break","description":"Optionally insert page-break before/after component when rendered in PDF","type":"object","properties":{"breakBefore":{"title":"Page break before","description":"PDF only: Value or expression indicating whether a page break should be added before the component. Can be either: 'auto' (default), 'always', or 'avoid'.","examples":["auto","always","avoid"],"default":"auto","$ref":"expression.schema.v1.json#/definitions/string"},"breakAfter":{"title":"Page break after","description":"PDF only: Value or expression indicating whether a page break should be added after the component. Can be either: 'auto' (default), 'always', or 'avoid'.","examples":["auto","always","avoid"],"default":"auto","$ref":"expression.schema.v1.json#/definitions/string"}},"additionalProperties":false},"readOnly":{"title":"Read only/disabled?","description":"Boolean value or expression indicating if the component should be read only/disabled. Defaults to false.
Please note that even with read-only fields in components, it may currently be possible to update the field by modifying the request sent to the API or through a direct API call.","default":false,"$ref":"expression.schema.v1.json#/definitions/boolean"},"required":{"title":"Required?","description":"Boolean value or expression indicating if the component should be required. Defaults to false.","default":false,"$ref":"expression.schema.v1.json#/definitions/boolean"},"showValidations":{"title":"Validation types","description":"List of validation types to show","type":"array","items":{"enum":["Schema","Component","Expression","CustomBackend","Required","AllExceptRequired","All"],"type":"string"}},"renderAsSummary":{"title":"Render as summary","description":"Boolean value indicating if the component should be rendered as a summary. Defaults to false.","default":false,"type":"boolean"},"forceShowInSummary":{"title":"Force show in summary","description":"Will force show the component in a summary even if hideEmptyFields is set to true in the summary component.","default":false,"$ref":"expression.schema.v1.json#/definitions/boolean"},"optionsId":{"title":"Dynamic options (fetched from server)","description":"ID of the option list to fetch from the server","type":"string"},"mapping":{"title":"Mapping","description":"A mapping of key-value pairs (usually used for mapping a path in the data model to a query string parameter).","type":"object","properties":{},"additionalProperties":{"type":"string"}},"queryParameters":{"title":"Query parameters","description":"A mapping of query string parameters to values. Will be appended to the URL when fetching options.","type":"object","properties":{},"additionalProperties":{"type":"string"}},"options":{"title":"Static options","description":"List of static options","type":"array","items":{"title":"IRawOption","examples":[{"label":"","value":""}],"type":"object","properties":{"label":{"type":"string"},"value":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"const":null}]},"description":{"type":"string"},"helpText":{"type":"string"}},"required":["label","value"],"additionalProperties":false}},"secure":{"title":"Secure options (when using optionsId)","description":"Whether to call the secure API endpoint when fetching options from the server (allows for user/instance-specific options)","default":false,"type":"boolean"},"sortOrder":{"description":"Sorts the code list in either ascending or descending order by label.","enum":["asc","desc"],"type":"string"},"source":{"title":"Option source","description":"Allows for fetching options from the data model, pointing to a repeating group structure","type":"object","properties":{"group":{"title":"Group","description":"The repeating group to base options on.","examples":["model.some.group"],"type":"string"},"label":{"title":"Label","description":"A label of the option displayed in Radio- and Checkbox groups. Can be plain text, a text resource binding, or a dynamic expression.","examples":["some.text.key"],"$ref":"expression.schema.v1.json#/definitions/string"},"value":{"title":"Value","description":"Field in the group that should be used as value","examples":["model.some.group[{0}].someField"],"type":"string"},"description":{"title":"Description","description":"A description of the option displayed in Radio- and Checkbox groups. Can be plain text, a text resource binding, or a dynamic expression.","examples":["some.text.key","My Description"],"$ref":"expression.schema.v1.json#/definitions/string"},"helpText":{"title":"Help Text","description":"A help text for the option displayed in Radio- and Checkbox groups. Can be plain text, a text resource binding, or a dynamic expression.","examples":["some.text.key","My Help Text"],"$ref":"expression.schema.v1.json#/definitions/string"}},"required":["group","label","value"],"additionalProperties":false},"preselectedOptionIndex":{"title":"Preselected option index","description":"Index of the option to preselect (if no option has been selected yet)","type":"integer"},"type":{"const":"LikertItem"},"textResourceBindings":{"properties":{"title":{"title":"Title","description":"Title of the Likert component/row","$ref":"expression.schema.v1.json#/definitions/string"},"description":{"title":"Description","description":"Description of the Likert component/row","$ref":"expression.schema.v1.json#/definitions/string"},"help":{"title":"Help","description":"Help text of the Likert component/row","$ref":"expression.schema.v1.json#/definitions/string"},"tableTitle":{"title":"Table title","description":"Title used in the table view (overrides the default title)","$ref":"expression.schema.v1.json#/definitions/string"},"shortName":{"title":"Short name (for validation)","description":"Alternative name used for required validation messages (overrides the default title)","$ref":"expression.schema.v1.json#/definitions/string"},"requiredValidation":{"title":"Required validation message","description":"Full validation message shown when the component is required and no value has been entered (overrides both the default and shortName)","$ref":"expression.schema.v1.json#/definitions/string"},"summaryTitle":{"title":"Summary title","description":"Title used in the summary view (overrides the default title)","$ref":"expression.schema.v1.json#/definitions/string"},"summaryAccessibleTitle":{"title":"Accessible summary title","description":"Title used for aria-label on the edit button in the summary view (overrides the default and summary title)","$ref":"expression.schema.v1.json#/definitions/string"}}},"dataModelBindings":{"title":"Data model binding","description":"Describes the location in the data model where the component should store its value(s). A simple binding is used for components that only store a single value, usually a string.","type":"object","properties":{"simpleBinding":{"type":"string"},"label":{"type":"string"},"metadata":{"description":"Describes the location where metadata for the option based component should be stored in the datamodel.","type":"string"}},"required":["simpleBinding"],"additionalProperties":false},"showLabelsInTable":{"title":"Show label when single option in table","description":"Boolean value indicating if the label should be visible when only one option exists in table","default":false,"type":"boolean"},"layout":{"title":"Layout","description":"Define the layout style for the options","enum":["column","row","table"],"type":"string"}},"required":["id","type","dataModelBindings"],"title":"LikertItem component schema"} \ No newline at end of file diff --git a/frontend/packages/ux-editor/src/testing/schemas/json/component/Link.schema.v1.json b/frontend/packages/ux-editor/src/testing/schemas/json/component/Link.schema.v1.json index 69e0af1e1d1..73d960df0d2 100644 --- a/frontend/packages/ux-editor/src/testing/schemas/json/component/Link.schema.v1.json +++ b/frontend/packages/ux-editor/src/testing/schemas/json/component/Link.schema.v1.json @@ -1,81 +1 @@ -{ - "$id": "https://altinncdn.no/schemas/json/component/Link.schema.v1.json", - "$schema": "http://json-schema.org/draft-07/schema#", - "properties": { - "id": { - "title": "ID", - "description": "The component ID. Must be unique within all layouts/pages in a layout-set. Cannot end with .", - "type": "string", - "pattern": "^[0-9a-zA-Z][0-9a-zA-Z-]*(-?[a-zA-Z]+|[a-zA-Z][0-9]+|-[0-9]{6,})$" - }, - "hidden": { - "title": "Hidden", - "description": "Boolean value or expression indicating if the component should be hidden. Defaults to false.", - "default": false, - "$ref": "expression.schema.v1.json#/definitions/boolean" - }, - "grid": { - "properties": { - "xs": { "$ref": "#/definitions/IGridSize" }, - "sm": { "$ref": "#/definitions/IGridSize" }, - "md": { "$ref": "#/definitions/IGridSize" }, - "lg": { "$ref": "#/definitions/IGridSize" }, - "xl": { "$ref": "#/definitions/IGridSize" }, - "labelGrid": { "$ref": "#/definitions/IGridStyling" }, - "innerGrid": { "$ref": "#/definitions/IGridStyling" } - } - }, - "pageBreak": { - "title": "Page break", - "description": "Optionally insert page-break before/after component when rendered in PDF", - "type": "object", - "properties": { - "breakBefore": { - "title": "Page break before", - "description": "PDF only: Value or expression indicating whether a page break should be added before the component. Can be either: 'auto' (default), 'always', or 'avoid'.", - "examples": ["auto", "always", "avoid"], - "default": "auto", - "$ref": "expression.schema.v1.json#/definitions/string" - }, - "breakAfter": { - "title": "Page break after", - "description": "PDF only: Value or expression indicating whether a page break should be added after the component. Can be either: 'auto' (default), 'always', or 'avoid'.", - "examples": ["auto", "always", "avoid"], - "default": "auto", - "$ref": "expression.schema.v1.json#/definitions/string" - } - }, - "additionalProperties": false - }, - "type": { "const": "Link" }, - "textResourceBindings": { - "type": "object", - "properties": { - "title": { - "title": "Title", - "description": "The title/text of the link", - "$ref": "expression.schema.v1.json#/definitions/string" - }, - "target": { - "title": "Target", - "description": "The target of the link", - "$ref": "expression.schema.v1.json#/definitions/string" - } - }, - "additionalProperties": false - }, - "style": { - "title": "Style", - "description": "The style of the link (a primary/secondary button, or an actual link)", - "enum": ["primary", "secondary", "link"], - "type": "string" - }, - "openInNewTab": { - "title": "Open in new tab", - "description": "Open the link in a new tab", - "type": "boolean" - } - }, - "required": ["id", "type", "style"], - "title": "Link component schema" -} +{"$id":"https://altinncdn.no/schemas/json/component/Link.schema.v1.json","$schema":"http://json-schema.org/draft-07/schema#","properties":{"id":{"title":"ID","description":"The component ID. Must be unique within all layouts/pages in a layout-set. Cannot end with .","type":"string","pattern":"^[0-9a-zA-Z][0-9a-zA-Z-]*(-?[a-zA-Z]+|[a-zA-Z][0-9]+|-[0-9]{6,})$"},"hidden":{"title":"Hidden","description":"Boolean value or expression indicating if the component should be hidden. Defaults to false.","default":false,"$ref":"expression.schema.v1.json#/definitions/boolean"},"grid":{"properties":{"xs":{"$ref":"#/definitions/IGridSize"},"sm":{"$ref":"#/definitions/IGridSize"},"md":{"$ref":"#/definitions/IGridSize"},"lg":{"$ref":"#/definitions/IGridSize"},"xl":{"$ref":"#/definitions/IGridSize"},"labelGrid":{"$ref":"#/definitions/IGridStyling"},"innerGrid":{"$ref":"#/definitions/IGridStyling"}}},"pageBreak":{"title":"Page break","description":"Optionally insert page-break before/after component when rendered in PDF","type":"object","properties":{"breakBefore":{"title":"Page break before","description":"PDF only: Value or expression indicating whether a page break should be added before the component. Can be either: 'auto' (default), 'always', or 'avoid'.","examples":["auto","always","avoid"],"default":"auto","$ref":"expression.schema.v1.json#/definitions/string"},"breakAfter":{"title":"Page break after","description":"PDF only: Value or expression indicating whether a page break should be added after the component. Can be either: 'auto' (default), 'always', or 'avoid'.","examples":["auto","always","avoid"],"default":"auto","$ref":"expression.schema.v1.json#/definitions/string"}},"additionalProperties":false},"type":{"const":"Link"},"textResourceBindings":{"type":"object","properties":{"title":{"title":"Title","description":"The title/text of the link","$ref":"expression.schema.v1.json#/definitions/string"},"target":{"title":"Target","description":"The target of the link","$ref":"expression.schema.v1.json#/definitions/string"}},"additionalProperties":false},"style":{"title":"Style","description":"The style of the link (a primary/secondary button, or an actual link)","enum":["primary","secondary","link"],"type":"string"},"openInNewTab":{"title":"Open in new tab","description":"Open the link in a new tab","type":"boolean"}},"required":["id","type","style"],"title":"Link component schema"} \ No newline at end of file diff --git a/frontend/packages/ux-editor/src/testing/schemas/json/component/List.schema.v1.json b/frontend/packages/ux-editor/src/testing/schemas/json/component/List.schema.v1.json index 46a50bc4259..bccca8d988e 100644 --- a/frontend/packages/ux-editor/src/testing/schemas/json/component/List.schema.v1.json +++ b/frontend/packages/ux-editor/src/testing/schemas/json/component/List.schema.v1.json @@ -1,220 +1 @@ -{ - "$id": "https://altinncdn.no/schemas/json/component/List.schema.v1.json", - "$schema": "http://json-schema.org/draft-07/schema#", - "properties": { - "id": { - "title": "ID", - "description": "The component ID. Must be unique within all layouts/pages in a layout-set. Cannot end with .", - "type": "string", - "pattern": "^[0-9a-zA-Z][0-9a-zA-Z-]*(-?[a-zA-Z]+|[a-zA-Z][0-9]+|-[0-9]{6,})$" - }, - "hidden": { - "title": "Hidden", - "description": "Boolean value or expression indicating if the component should be hidden. Defaults to false.", - "default": false, - "$ref": "expression.schema.v1.json#/definitions/boolean" - }, - "grid": { - "properties": { - "xs": { "$ref": "#/definitions/IGridSize" }, - "sm": { "$ref": "#/definitions/IGridSize" }, - "md": { "$ref": "#/definitions/IGridSize" }, - "lg": { "$ref": "#/definitions/IGridSize" }, - "xl": { "$ref": "#/definitions/IGridSize" }, - "labelGrid": { "$ref": "#/definitions/IGridStyling" }, - "innerGrid": { "$ref": "#/definitions/IGridStyling" } - } - }, - "pageBreak": { - "title": "Page break", - "description": "Optionally insert page-break before/after component when rendered in PDF", - "type": "object", - "properties": { - "breakBefore": { - "title": "Page break before", - "description": "PDF only: Value or expression indicating whether a page break should be added before the component. Can be either: 'auto' (default), 'always', or 'avoid'.", - "examples": ["auto", "always", "avoid"], - "default": "auto", - "$ref": "expression.schema.v1.json#/definitions/string" - }, - "breakAfter": { - "title": "Page break after", - "description": "PDF only: Value or expression indicating whether a page break should be added after the component. Can be either: 'auto' (default), 'always', or 'avoid'.", - "examples": ["auto", "always", "avoid"], - "default": "auto", - "$ref": "expression.schema.v1.json#/definitions/string" - } - }, - "additionalProperties": false - }, - "readOnly": { - "title": "Read only/disabled?", - "description": "Boolean value or expression indicating if the component should be read only/disabled. Defaults to false.
Please note that even with read-only fields in components, it may currently be possible to update the field by modifying the request sent to the API or through a direct API call.", - "default": false, - "$ref": "expression.schema.v1.json#/definitions/boolean" - }, - "required": { - "title": "Required?", - "description": "Boolean value or expression indicating if the component should be required. Defaults to false.", - "default": false, - "$ref": "expression.schema.v1.json#/definitions/boolean" - }, - "showValidations": { - "title": "Validation types", - "description": "List of validation types to show", - "type": "array", - "items": { - "enum": [ - "Schema", - "Component", - "Expression", - "CustomBackend", - "Required", - "AllExceptRequired", - "All" - ], - "type": "string" - } - }, - "renderAsSummary": { - "title": "Render as summary", - "description": "Boolean value indicating if the component should be rendered as a summary. Defaults to false.", - "default": false, - "type": "boolean" - }, - "forceShowInSummary": { - "title": "Force show in summary", - "description": "Will force show the component in a summary even if hideEmptyFields is set to true in the summary component.", - "default": false, - "$ref": "expression.schema.v1.json#/definitions/boolean" - }, - "labelSettings": { - "title": "ILabelSettings", - "type": "object", - "properties": { - "optionalIndicator": { - "title": "Optional indicator", - "description": "Show optional indicator on label", - "type": "boolean" - } - }, - "additionalProperties": false - }, - "type": { "const": "List" }, - "textResourceBindings": { - "properties": { - "title": { - "title": "Title", - "description": "Label text/title shown above the component", - "$ref": "expression.schema.v1.json#/definitions/string" - }, - "description": { - "title": "Description", - "description": "Label description shown above the component, below the title", - "$ref": "expression.schema.v1.json#/definitions/string" - }, - "help": { - "title": "Help text", - "description": "Help text shown in a tooltip when clicking the help button", - "$ref": "expression.schema.v1.json#/definitions/string" - }, - "tableTitle": { - "title": "Table title", - "description": "Title used in the table view (overrides the default title)", - "$ref": "expression.schema.v1.json#/definitions/string" - }, - "shortName": { - "title": "Short name (for validation)", - "description": "Alternative name used for required validation messages (overrides the default title)", - "$ref": "expression.schema.v1.json#/definitions/string" - }, - "requiredValidation": { - "title": "Required validation message", - "description": "Full validation message shown when the component is required and no value has been entered (overrides both the default and shortName)", - "$ref": "expression.schema.v1.json#/definitions/string" - }, - "summaryTitle": { - "title": "Summary title", - "description": "Title used in the summary view (overrides the default title)", - "$ref": "expression.schema.v1.json#/definitions/string" - }, - "summaryAccessibleTitle": { - "title": "Accessible summary title", - "description": "Title used for aria-label on the edit button in the summary view (overrides the default and summary title)", - "$ref": "expression.schema.v1.json#/definitions/string" - } - } - }, - "dataModelBindings": { - "title": "IDataModelBindingsForList", - "type": "object", - "properties": {}, - "additionalProperties": { "type": "string" } - }, - "tableHeaders": { - "title": "Table Headers", - "description": "An object where the fields in the datalist is mapped to headers. Must correspond to datalist representing a row. Can be added to the resource files to change between languages.", - "examples": [{ "productId": "product.id", "description": "Beskrivelse av produkt" }], - "type": "object", - "properties": {}, - "additionalProperties": { "type": "string" } - }, - "sortableColumns": { - "title": "Sortable columns", - "description": "An array of column keys that can be sorted (note that your API backend needs to support this as well). The column has to be represented by the the header name that is written in tableHeaders.", - "type": "array", - "items": { "type": "string" } - }, - "pagination": { - "title": "Pagination", - "description": "Pagination settings. Set this to enable pagination (must be supported by backend).", - "type": "object", - "properties": { - "alternatives": { - "title": "Alternatives", - "description": "List of page sizes the user can choose from. Make sure to test the performance of the largest number of items per page you are allowing.", - "type": "array", - "items": { "type": "number" } - }, - "default": { - "title": "Default", - "description": "The pagination size that is set to default.", - "type": "number" - } - }, - "required": ["alternatives", "default"], - "additionalProperties": false - }, - "dataListId": { - "title": "Data list ID", - "description": "The ID of the data list to use (must be implemented in your backend).", - "type": "string" - }, - "secure": { - "title": "Secure", - "description": "Boolean value indicating if the options should be instance aware. Defaults to false.", - "default": false, - "type": "boolean" - }, - "mapping": { - "title": "Mapping", - "description": "A mapping of key-value pairs (usually used for mapping a path in the data model to a query string parameter).", - "type": "object", - "properties": {}, - "additionalProperties": { "type": "string" } - }, - "bindingToShowInSummary": { - "title": "Binding to show in summary", - "description": "The value of this binding will be shown in the summary component for the list. This binding must be one of the specified bindings under dataModelBindings.", - "type": "string" - }, - "tableHeadersMobile": { - "title": "Table Headers Mobile", - "description": "An array of strings representing the columns that is chosen to be shown in the mobile view.", - "type": "array", - "items": { "type": "string" } - } - }, - "required": ["id", "type", "tableHeaders", "dataListId"], - "title": "List component schema" -} +{"$id":"https://altinncdn.no/schemas/json/component/List.schema.v1.json","$schema":"http://json-schema.org/draft-07/schema#","properties":{"id":{"title":"ID","description":"The component ID. Must be unique within all layouts/pages in a layout-set. Cannot end with .","type":"string","pattern":"^[0-9a-zA-Z][0-9a-zA-Z-]*(-?[a-zA-Z]+|[a-zA-Z][0-9]+|-[0-9]{6,})$"},"hidden":{"title":"Hidden","description":"Boolean value or expression indicating if the component should be hidden. Defaults to false.","default":false,"$ref":"expression.schema.v1.json#/definitions/boolean"},"grid":{"properties":{"xs":{"$ref":"#/definitions/IGridSize"},"sm":{"$ref":"#/definitions/IGridSize"},"md":{"$ref":"#/definitions/IGridSize"},"lg":{"$ref":"#/definitions/IGridSize"},"xl":{"$ref":"#/definitions/IGridSize"},"labelGrid":{"$ref":"#/definitions/IGridStyling"},"innerGrid":{"$ref":"#/definitions/IGridStyling"}}},"pageBreak":{"title":"Page break","description":"Optionally insert page-break before/after component when rendered in PDF","type":"object","properties":{"breakBefore":{"title":"Page break before","description":"PDF only: Value or expression indicating whether a page break should be added before the component. Can be either: 'auto' (default), 'always', or 'avoid'.","examples":["auto","always","avoid"],"default":"auto","$ref":"expression.schema.v1.json#/definitions/string"},"breakAfter":{"title":"Page break after","description":"PDF only: Value or expression indicating whether a page break should be added after the component. Can be either: 'auto' (default), 'always', or 'avoid'.","examples":["auto","always","avoid"],"default":"auto","$ref":"expression.schema.v1.json#/definitions/string"}},"additionalProperties":false},"readOnly":{"title":"Read only/disabled?","description":"Boolean value or expression indicating if the component should be read only/disabled. Defaults to false.
Please note that even with read-only fields in components, it may currently be possible to update the field by modifying the request sent to the API or through a direct API call.","default":false,"$ref":"expression.schema.v1.json#/definitions/boolean"},"required":{"title":"Required?","description":"Boolean value or expression indicating if the component should be required. Defaults to false.","default":false,"$ref":"expression.schema.v1.json#/definitions/boolean"},"showValidations":{"title":"Validation types","description":"List of validation types to show","type":"array","items":{"enum":["Schema","Component","Expression","CustomBackend","Required","AllExceptRequired","All"],"type":"string"}},"renderAsSummary":{"title":"Render as summary","description":"Boolean value indicating if the component should be rendered as a summary. Defaults to false.","default":false,"type":"boolean"},"forceShowInSummary":{"title":"Force show in summary","description":"Will force show the component in a summary even if hideEmptyFields is set to true in the summary component.","default":false,"$ref":"expression.schema.v1.json#/definitions/boolean"},"labelSettings":{"title":"ILabelSettings","type":"object","properties":{"optionalIndicator":{"title":"Optional indicator","description":"Show optional indicator on label","type":"boolean"}},"additionalProperties":false},"type":{"const":"List"},"textResourceBindings":{"properties":{"title":{"title":"Title","description":"Label text/title shown above the component","$ref":"expression.schema.v1.json#/definitions/string"},"description":{"title":"Description","description":"Label description shown above the component, below the title","$ref":"expression.schema.v1.json#/definitions/string"},"help":{"title":"Help text","description":"Help text shown in a tooltip when clicking the help button","$ref":"expression.schema.v1.json#/definitions/string"},"tableTitle":{"title":"Table title","description":"Title used in the table view (overrides the default title)","$ref":"expression.schema.v1.json#/definitions/string"},"shortName":{"title":"Short name (for validation)","description":"Alternative name used for required validation messages (overrides the default title)","$ref":"expression.schema.v1.json#/definitions/string"},"requiredValidation":{"title":"Required validation message","description":"Full validation message shown when the component is required and no value has been entered (overrides both the default and shortName)","$ref":"expression.schema.v1.json#/definitions/string"},"summaryTitle":{"title":"Summary title","description":"Title used in the summary view (overrides the default title)","$ref":"expression.schema.v1.json#/definitions/string"},"summaryAccessibleTitle":{"title":"Accessible summary title","description":"Title used for aria-label on the edit button in the summary view (overrides the default and summary title)","$ref":"expression.schema.v1.json#/definitions/string"}}},"dataModelBindings":{"title":"IDataModelBindingsForList","type":"object","properties":{},"additionalProperties":{"type":"string"}},"tableHeaders":{"title":"Table Headers","description":"An object where the fields in the datalist is mapped to headers. Must correspond to datalist representing a row. Can be added to the resource files to change between languages.","examples":[{"productId":"product.id","description":"Beskrivelse av produkt"}],"type":"object","properties":{},"additionalProperties":{"type":"string"}},"sortableColumns":{"title":"Sortable columns","description":"An array of column keys that can be sorted (note that your API backend needs to support this as well). The column has to be represented by the the header name that is written in tableHeaders.","type":"array","items":{"type":"string"}},"pagination":{"title":"Pagination","description":"Pagination settings. Set this to enable pagination (must be supported by backend).","type":"object","properties":{"alternatives":{"title":"Alternatives","description":"List of page sizes the user can choose from. Make sure to test the performance of the largest number of items per page you are allowing.","type":"array","items":{"type":"number"}},"default":{"title":"Default","description":"The pagination size that is set to default.","type":"number"}},"required":["alternatives","default"],"additionalProperties":false},"dataListId":{"title":"Data list ID","description":"The ID of the data list to use (must be implemented in your backend).","type":"string"},"secure":{"title":"Secure","description":"Boolean value indicating if the options should be instance aware. Defaults to false.","default":false,"type":"boolean"},"mapping":{"title":"Mapping","description":"A mapping of key-value pairs (usually used for mapping a path in the data model to a query string parameter).","type":"object","properties":{},"additionalProperties":{"type":"string"}},"bindingToShowInSummary":{"title":"Binding to show in summary","description":"The value of this binding will be shown in the summary component for the list. This binding must be one of the specified bindings under dataModelBindings.","type":"string"},"tableHeadersMobile":{"title":"Table Headers Mobile","description":"An array of strings representing the columns that is chosen to be shown in the mobile view.","type":"array","items":{"type":"string"}}},"required":["id","type","tableHeaders","dataListId"],"title":"List component schema"} \ No newline at end of file diff --git a/frontend/packages/ux-editor/src/testing/schemas/json/component/Map.schema.v1.json b/frontend/packages/ux-editor/src/testing/schemas/json/component/Map.schema.v1.json index 60ff8a768d9..c732ccf53aa 100644 --- a/frontend/packages/ux-editor/src/testing/schemas/json/component/Map.schema.v1.json +++ b/frontend/packages/ux-editor/src/testing/schemas/json/component/Map.schema.v1.json @@ -1,205 +1 @@ -{ - "$id": "https://altinncdn.no/schemas/json/component/Map.schema.v1.json", - "$schema": "http://json-schema.org/draft-07/schema#", - "properties": { - "id": { - "title": "ID", - "description": "The component ID. Must be unique within all layouts/pages in a layout-set. Cannot end with .", - "type": "string", - "pattern": "^[0-9a-zA-Z][0-9a-zA-Z-]*(-?[a-zA-Z]+|[a-zA-Z][0-9]+|-[0-9]{6,})$" - }, - "hidden": { - "title": "Hidden", - "description": "Boolean value or expression indicating if the component should be hidden. Defaults to false.", - "default": false, - "$ref": "expression.schema.v1.json#/definitions/boolean" - }, - "grid": { - "properties": { - "xs": { "$ref": "#/definitions/IGridSize" }, - "sm": { "$ref": "#/definitions/IGridSize" }, - "md": { "$ref": "#/definitions/IGridSize" }, - "lg": { "$ref": "#/definitions/IGridSize" }, - "xl": { "$ref": "#/definitions/IGridSize" }, - "labelGrid": { "$ref": "#/definitions/IGridStyling" }, - "innerGrid": { "$ref": "#/definitions/IGridStyling" } - } - }, - "pageBreak": { - "title": "Page break", - "description": "Optionally insert page-break before/after component when rendered in PDF", - "type": "object", - "properties": { - "breakBefore": { - "title": "Page break before", - "description": "PDF only: Value or expression indicating whether a page break should be added before the component. Can be either: 'auto' (default), 'always', or 'avoid'.", - "examples": ["auto", "always", "avoid"], - "default": "auto", - "$ref": "expression.schema.v1.json#/definitions/string" - }, - "breakAfter": { - "title": "Page break after", - "description": "PDF only: Value or expression indicating whether a page break should be added after the component. Can be either: 'auto' (default), 'always', or 'avoid'.", - "examples": ["auto", "always", "avoid"], - "default": "auto", - "$ref": "expression.schema.v1.json#/definitions/string" - } - }, - "additionalProperties": false - }, - "readOnly": { - "title": "Read only/disabled?", - "description": "Boolean value or expression indicating if the component should be read only/disabled. Defaults to false.
Please note that even with read-only fields in components, it may currently be possible to update the field by modifying the request sent to the API or through a direct API call.", - "default": false, - "$ref": "expression.schema.v1.json#/definitions/boolean" - }, - "required": { - "title": "Required?", - "description": "Boolean value or expression indicating if the component should be required. Defaults to false.", - "default": false, - "$ref": "expression.schema.v1.json#/definitions/boolean" - }, - "showValidations": { - "title": "Validation types", - "description": "List of validation types to show", - "type": "array", - "items": { - "enum": [ - "Schema", - "Component", - "Expression", - "CustomBackend", - "Required", - "AllExceptRequired", - "All" - ], - "type": "string" - } - }, - "renderAsSummary": { - "title": "Render as summary", - "description": "Boolean value indicating if the component should be rendered as a summary. Defaults to false.", - "default": false, - "type": "boolean" - }, - "forceShowInSummary": { - "title": "Force show in summary", - "description": "Will force show the component in a summary even if hideEmptyFields is set to true in the summary component.", - "default": false, - "$ref": "expression.schema.v1.json#/definitions/boolean" - }, - "labelSettings": { - "title": "ILabelSettings", - "type": "object", - "properties": { - "optionalIndicator": { - "title": "Optional indicator", - "description": "Show optional indicator on label", - "type": "boolean" - } - }, - "additionalProperties": false - }, - "type": { "const": "Map" }, - "textResourceBindings": { - "properties": { - "title": { - "title": "Title", - "description": "Label text/title shown above the component", - "$ref": "expression.schema.v1.json#/definitions/string" - }, - "description": { - "title": "Description", - "description": "Label description shown above the component, below the title", - "$ref": "expression.schema.v1.json#/definitions/string" - }, - "help": { - "title": "Help text", - "description": "Help text shown in a tooltip when clicking the help button", - "$ref": "expression.schema.v1.json#/definitions/string" - }, - "tableTitle": { - "title": "Table title", - "description": "Title used in the table view (overrides the default title)", - "$ref": "expression.schema.v1.json#/definitions/string" - }, - "shortName": { - "title": "Short name (for validation)", - "description": "Alternative name used for required validation messages (overrides the default title)", - "$ref": "expression.schema.v1.json#/definitions/string" - }, - "requiredValidation": { - "title": "Required validation message", - "description": "Full validation message shown when the component is required and no value has been entered (overrides both the default and shortName)", - "$ref": "expression.schema.v1.json#/definitions/string" - }, - "summaryTitle": { - "title": "Summary title", - "description": "Title used in the summary view (overrides the default title)", - "$ref": "expression.schema.v1.json#/definitions/string" - }, - "summaryAccessibleTitle": { - "title": "Accessible summary title", - "description": "Title used for aria-label on the edit button in the summary view (overrides the default and summary title)", - "$ref": "expression.schema.v1.json#/definitions/string" - } - } - }, - "dataModelBindings": { - "title": "IDataModelBindingsForMap", - "type": "object", - "properties": { - "simpleBinding": { "type": "string" }, - "geometries": { - "description": "Should point to an array of objects like {data: string, label: string}", - "type": "string" - } - }, - "additionalProperties": false - }, - "layers": { - "type": "array", - "items": { - "title": "MapLayer", - "type": "object", - "properties": { - "url": { - "title": "Map layer url", - "description": "Url to a map tile. {z}/{x}/{y} will be replaced with tile coordinates, {s} will be replaced with a random subdomain if subdomains are given", - "type": "string" - }, - "attribution": { - "title": "Attribution", - "description": "Ascribing a work or remark to a particular unit for recognition", - "type": "string" - }, - "subdomains": { - "title": "Subdomains", - "description": "List of subdomains. Used for balancing the load on different map tiling servers. A random one will replace {s} in the defined url.", - "type": "array", - "items": { "type": "string" } - } - }, - "required": ["url"], - "additionalProperties": false - } - }, - "centerLocation": { - "title": "Center location", - "description": "Center location of the map", - "type": "object", - "properties": { "latitude": { "type": "number" }, "longitude": { "type": "number" } }, - "required": ["latitude", "longitude"], - "additionalProperties": false - }, - "zoom": { "type": "number" }, - "geometryType": { - "title": "IGeometryType", - "default": "GeoJSON", - "enum": ["GeoJSON", "WKT"], - "type": "string" - } - }, - "required": ["id", "type", "dataModelBindings"], - "title": "Map component schema" -} +{"$id":"https://altinncdn.no/schemas/json/component/Map.schema.v1.json","$schema":"http://json-schema.org/draft-07/schema#","properties":{"id":{"title":"ID","description":"The component ID. Must be unique within all layouts/pages in a layout-set. Cannot end with .","type":"string","pattern":"^[0-9a-zA-Z][0-9a-zA-Z-]*(-?[a-zA-Z]+|[a-zA-Z][0-9]+|-[0-9]{6,})$"},"hidden":{"title":"Hidden","description":"Boolean value or expression indicating if the component should be hidden. Defaults to false.","default":false,"$ref":"expression.schema.v1.json#/definitions/boolean"},"grid":{"properties":{"xs":{"$ref":"#/definitions/IGridSize"},"sm":{"$ref":"#/definitions/IGridSize"},"md":{"$ref":"#/definitions/IGridSize"},"lg":{"$ref":"#/definitions/IGridSize"},"xl":{"$ref":"#/definitions/IGridSize"},"labelGrid":{"$ref":"#/definitions/IGridStyling"},"innerGrid":{"$ref":"#/definitions/IGridStyling"}}},"pageBreak":{"title":"Page break","description":"Optionally insert page-break before/after component when rendered in PDF","type":"object","properties":{"breakBefore":{"title":"Page break before","description":"PDF only: Value or expression indicating whether a page break should be added before the component. Can be either: 'auto' (default), 'always', or 'avoid'.","examples":["auto","always","avoid"],"default":"auto","$ref":"expression.schema.v1.json#/definitions/string"},"breakAfter":{"title":"Page break after","description":"PDF only: Value or expression indicating whether a page break should be added after the component. Can be either: 'auto' (default), 'always', or 'avoid'.","examples":["auto","always","avoid"],"default":"auto","$ref":"expression.schema.v1.json#/definitions/string"}},"additionalProperties":false},"readOnly":{"title":"Read only/disabled?","description":"Boolean value or expression indicating if the component should be read only/disabled. Defaults to false.
Please note that even with read-only fields in components, it may currently be possible to update the field by modifying the request sent to the API or through a direct API call.","default":false,"$ref":"expression.schema.v1.json#/definitions/boolean"},"required":{"title":"Required?","description":"Boolean value or expression indicating if the component should be required. Defaults to false.","default":false,"$ref":"expression.schema.v1.json#/definitions/boolean"},"showValidations":{"title":"Validation types","description":"List of validation types to show","type":"array","items":{"enum":["Schema","Component","Expression","CustomBackend","Required","AllExceptRequired","All"],"type":"string"}},"renderAsSummary":{"title":"Render as summary","description":"Boolean value indicating if the component should be rendered as a summary. Defaults to false.","default":false,"type":"boolean"},"forceShowInSummary":{"title":"Force show in summary","description":"Will force show the component in a summary even if hideEmptyFields is set to true in the summary component.","default":false,"$ref":"expression.schema.v1.json#/definitions/boolean"},"labelSettings":{"title":"ILabelSettings","type":"object","properties":{"optionalIndicator":{"title":"Optional indicator","description":"Show optional indicator on label","type":"boolean"}},"additionalProperties":false},"type":{"const":"Map"},"textResourceBindings":{"properties":{"title":{"title":"Title","description":"Label text/title shown above the component","$ref":"expression.schema.v1.json#/definitions/string"},"description":{"title":"Description","description":"Label description shown above the component, below the title","$ref":"expression.schema.v1.json#/definitions/string"},"help":{"title":"Help text","description":"Help text shown in a tooltip when clicking the help button","$ref":"expression.schema.v1.json#/definitions/string"},"tableTitle":{"title":"Table title","description":"Title used in the table view (overrides the default title)","$ref":"expression.schema.v1.json#/definitions/string"},"shortName":{"title":"Short name (for validation)","description":"Alternative name used for required validation messages (overrides the default title)","$ref":"expression.schema.v1.json#/definitions/string"},"requiredValidation":{"title":"Required validation message","description":"Full validation message shown when the component is required and no value has been entered (overrides both the default and shortName)","$ref":"expression.schema.v1.json#/definitions/string"},"summaryTitle":{"title":"Summary title","description":"Title used in the summary view (overrides the default title)","$ref":"expression.schema.v1.json#/definitions/string"},"summaryAccessibleTitle":{"title":"Accessible summary title","description":"Title used for aria-label on the edit button in the summary view (overrides the default and summary title)","$ref":"expression.schema.v1.json#/definitions/string"}}},"dataModelBindings":{"title":"IDataModelBindingsForMap","type":"object","properties":{"simpleBinding":{"type":"string"},"geometries":{"description":"Should point to an array of objects like {data: string, label: string}","type":"string"}},"additionalProperties":false},"layers":{"type":"array","items":{"title":"MapLayer","type":"object","properties":{"url":{"title":"Map layer url","description":"Url to a map tile. {z}/{x}/{y} will be replaced with tile coordinates, {s} will be replaced with a random subdomain if subdomains are given","type":"string"},"attribution":{"title":"Attribution","description":"Ascribing a work or remark to a particular unit for recognition","type":"string"},"subdomains":{"title":"Subdomains","description":"List of subdomains. Used for balancing the load on different map tiling servers. A random one will replace {s} in the defined url.","type":"array","items":{"type":"string"}}},"required":["url"],"additionalProperties":false}},"centerLocation":{"title":"Center location","description":"Center location of the map","type":"object","properties":{"latitude":{"type":"number"},"longitude":{"type":"number"}},"required":["latitude","longitude"],"additionalProperties":false},"zoom":{"type":"number"},"geometryType":{"title":"IGeometryType","default":"GeoJSON","enum":["GeoJSON","WKT"],"type":"string"}},"required":["id","type","dataModelBindings"],"title":"Map component schema"} \ No newline at end of file diff --git a/frontend/packages/ux-editor/src/testing/schemas/json/component/MultipleSelect.schema.v1.json b/frontend/packages/ux-editor/src/testing/schemas/json/component/MultipleSelect.schema.v1.json index 768cf9afbbf..f67e113eeb8 100644 --- a/frontend/packages/ux-editor/src/testing/schemas/json/component/MultipleSelect.schema.v1.json +++ b/frontend/packages/ux-editor/src/testing/schemas/json/component/MultipleSelect.schema.v1.json @@ -1,271 +1 @@ -{ - "$id": "https://altinncdn.no/schemas/json/component/MultipleSelect.schema.v1.json", - "$schema": "http://json-schema.org/draft-07/schema#", - "properties": { - "id": { - "title": "ID", - "description": "The component ID. Must be unique within all layouts/pages in a layout-set. Cannot end with .", - "type": "string", - "pattern": "^[0-9a-zA-Z][0-9a-zA-Z-]*(-?[a-zA-Z]+|[a-zA-Z][0-9]+|-[0-9]{6,})$" - }, - "hidden": { - "title": "Hidden", - "description": "Boolean value or expression indicating if the component should be hidden. Defaults to false.", - "default": false, - "$ref": "expression.schema.v1.json#/definitions/boolean" - }, - "grid": { - "properties": { - "xs": { "$ref": "#/definitions/IGridSize" }, - "sm": { "$ref": "#/definitions/IGridSize" }, - "md": { "$ref": "#/definitions/IGridSize" }, - "lg": { "$ref": "#/definitions/IGridSize" }, - "xl": { "$ref": "#/definitions/IGridSize" }, - "labelGrid": { "$ref": "#/definitions/IGridStyling" }, - "innerGrid": { "$ref": "#/definitions/IGridStyling" } - } - }, - "pageBreak": { - "title": "Page break", - "description": "Optionally insert page-break before/after component when rendered in PDF", - "type": "object", - "properties": { - "breakBefore": { - "title": "Page break before", - "description": "PDF only: Value or expression indicating whether a page break should be added before the component. Can be either: 'auto' (default), 'always', or 'avoid'.", - "examples": ["auto", "always", "avoid"], - "default": "auto", - "$ref": "expression.schema.v1.json#/definitions/string" - }, - "breakAfter": { - "title": "Page break after", - "description": "PDF only: Value or expression indicating whether a page break should be added after the component. Can be either: 'auto' (default), 'always', or 'avoid'.", - "examples": ["auto", "always", "avoid"], - "default": "auto", - "$ref": "expression.schema.v1.json#/definitions/string" - } - }, - "additionalProperties": false - }, - "readOnly": { - "title": "Read only/disabled?", - "description": "Boolean value or expression indicating if the component should be read only/disabled. Defaults to false.
Please note that even with read-only fields in components, it may currently be possible to update the field by modifying the request sent to the API or through a direct API call.", - "default": false, - "$ref": "expression.schema.v1.json#/definitions/boolean" - }, - "required": { - "title": "Required?", - "description": "Boolean value or expression indicating if the component should be required. Defaults to false.", - "default": false, - "$ref": "expression.schema.v1.json#/definitions/boolean" - }, - "showValidations": { - "title": "Validation types", - "description": "List of validation types to show", - "type": "array", - "items": { - "enum": [ - "Schema", - "Component", - "Expression", - "CustomBackend", - "Required", - "AllExceptRequired", - "All" - ], - "type": "string" - } - }, - "renderAsSummary": { - "title": "Render as summary", - "description": "Boolean value indicating if the component should be rendered as a summary. Defaults to false.", - "default": false, - "type": "boolean" - }, - "forceShowInSummary": { - "title": "Force show in summary", - "description": "Will force show the component in a summary even if hideEmptyFields is set to true in the summary component.", - "default": false, - "$ref": "expression.schema.v1.json#/definitions/boolean" - }, - "optionsId": { - "title": "Dynamic options (fetched from server)", - "description": "ID of the option list to fetch from the server", - "type": "string" - }, - "mapping": { - "title": "Mapping", - "description": "A mapping of key-value pairs (usually used for mapping a path in the data model to a query string parameter).", - "type": "object", - "properties": {}, - "additionalProperties": { "type": "string" } - }, - "queryParameters": { - "title": "Query parameters", - "description": "A mapping of query string parameters to values. Will be appended to the URL when fetching options.", - "type": "object", - "properties": {}, - "additionalProperties": { "type": "string" } - }, - "options": { - "title": "Static options", - "description": "List of static options", - "type": "array", - "items": { - "title": "IRawOption", - "examples": [{ "label": "", "value": "" }], - "type": "object", - "properties": { - "label": { "type": "string" }, - "value": { - "anyOf": [ - { "type": "string" }, - { "type": "number" }, - { "type": "boolean" }, - { "const": null } - ] - }, - "description": { "type": "string" }, - "helpText": { "type": "string" } - }, - "required": ["label", "value"], - "additionalProperties": false - } - }, - "secure": { - "title": "Secure options (when using optionsId)", - "description": "Whether to call the secure API endpoint when fetching options from the server (allows for user/instance-specific options)", - "default": false, - "type": "boolean" - }, - "sortOrder": { - "description": "Sorts the code list in either ascending or descending order by label.", - "enum": ["asc", "desc"], - "type": "string" - }, - "source": { - "title": "Option source", - "description": "Allows for fetching options from the data model, pointing to a repeating group structure", - "type": "object", - "properties": { - "group": { - "title": "Group", - "description": "The repeating group to base options on.", - "examples": ["model.some.group"], - "type": "string" - }, - "label": { - "title": "Label", - "description": "A label of the option displayed in Radio- and Checkbox groups. Can be plain text, a text resource binding, or a dynamic expression.", - "examples": ["some.text.key"], - "$ref": "expression.schema.v1.json#/definitions/string" - }, - "value": { - "title": "Value", - "description": "Field in the group that should be used as value", - "examples": ["model.some.group[{0}].someField"], - "type": "string" - }, - "description": { - "title": "Description", - "description": "A description of the option displayed in Radio- and Checkbox groups. Can be plain text, a text resource binding, or a dynamic expression.", - "examples": ["some.text.key", "My Description"], - "$ref": "expression.schema.v1.json#/definitions/string" - }, - "helpText": { - "title": "Help Text", - "description": "A help text for the option displayed in Radio- and Checkbox groups. Can be plain text, a text resource binding, or a dynamic expression.", - "examples": ["some.text.key", "My Help Text"], - "$ref": "expression.schema.v1.json#/definitions/string" - } - }, - "required": ["group", "label", "value"], - "additionalProperties": false - }, - "preselectedOptionIndex": { - "title": "Preselected option index", - "description": "Index of the option to preselect (if no option has been selected yet)", - "type": "integer" - }, - "labelSettings": { - "title": "ILabelSettings", - "type": "object", - "properties": { - "optionalIndicator": { - "title": "Optional indicator", - "description": "Show optional indicator on label", - "type": "boolean" - } - }, - "additionalProperties": false - }, - "type": { "const": "MultipleSelect" }, - "textResourceBindings": { - "properties": { - "title": { - "title": "Title", - "description": "Label text/title shown above the component", - "$ref": "expression.schema.v1.json#/definitions/string" - }, - "description": { - "title": "Description", - "description": "Label description shown above the component, below the title", - "$ref": "expression.schema.v1.json#/definitions/string" - }, - "help": { - "title": "Help text", - "description": "Help text shown in a tooltip when clicking the help button", - "$ref": "expression.schema.v1.json#/definitions/string" - }, - "tableTitle": { - "title": "Table title", - "description": "Title used in the table view (overrides the default title)", - "$ref": "expression.schema.v1.json#/definitions/string" - }, - "shortName": { - "title": "Short name (for validation)", - "description": "Alternative name used for required validation messages (overrides the default title)", - "$ref": "expression.schema.v1.json#/definitions/string" - }, - "requiredValidation": { - "title": "Required validation message", - "description": "Full validation message shown when the component is required and no value has been entered (overrides both the default and shortName)", - "$ref": "expression.schema.v1.json#/definitions/string" - }, - "summaryTitle": { - "title": "Summary title", - "description": "Title used in the summary view (overrides the default title)", - "$ref": "expression.schema.v1.json#/definitions/string" - }, - "summaryAccessibleTitle": { - "title": "Accessible summary title", - "description": "Title used for aria-label on the edit button in the summary view (overrides the default and summary title)", - "$ref": "expression.schema.v1.json#/definitions/string" - } - } - }, - "alertOnChange": { - "title": "Alert on change", - "description": "Boolean value indicating if the component should alert on change", - "default": false, - "$ref": "expression.schema.v1.json#/definitions/boolean" - }, - "dataModelBindings": { - "title": "Data model binding", - "description": "Describes the location in the data model where the component should store its value(s). A simple binding is used for components that only store a single value, usually a string.", - "type": "object", - "properties": { - "simpleBinding": { "type": "string" }, - "label": { "type": "string" }, - "metadata": { - "description": "Describes the location where metadata for the option based component should be stored in the datamodel.", - "type": "string" - } - }, - "required": ["simpleBinding"], - "additionalProperties": false - } - }, - "required": ["id", "type", "dataModelBindings"], - "title": "MultipleSelect component schema" -} +{"$id":"https://altinncdn.no/schemas/json/component/MultipleSelect.schema.v1.json","$schema":"http://json-schema.org/draft-07/schema#","properties":{"id":{"title":"ID","description":"The component ID. Must be unique within all layouts/pages in a layout-set. Cannot end with .","type":"string","pattern":"^[0-9a-zA-Z][0-9a-zA-Z-]*(-?[a-zA-Z]+|[a-zA-Z][0-9]+|-[0-9]{6,})$"},"hidden":{"title":"Hidden","description":"Boolean value or expression indicating if the component should be hidden. Defaults to false.","default":false,"$ref":"expression.schema.v1.json#/definitions/boolean"},"grid":{"properties":{"xs":{"$ref":"#/definitions/IGridSize"},"sm":{"$ref":"#/definitions/IGridSize"},"md":{"$ref":"#/definitions/IGridSize"},"lg":{"$ref":"#/definitions/IGridSize"},"xl":{"$ref":"#/definitions/IGridSize"},"labelGrid":{"$ref":"#/definitions/IGridStyling"},"innerGrid":{"$ref":"#/definitions/IGridStyling"}}},"pageBreak":{"title":"Page break","description":"Optionally insert page-break before/after component when rendered in PDF","type":"object","properties":{"breakBefore":{"title":"Page break before","description":"PDF only: Value or expression indicating whether a page break should be added before the component. Can be either: 'auto' (default), 'always', or 'avoid'.","examples":["auto","always","avoid"],"default":"auto","$ref":"expression.schema.v1.json#/definitions/string"},"breakAfter":{"title":"Page break after","description":"PDF only: Value or expression indicating whether a page break should be added after the component. Can be either: 'auto' (default), 'always', or 'avoid'.","examples":["auto","always","avoid"],"default":"auto","$ref":"expression.schema.v1.json#/definitions/string"}},"additionalProperties":false},"readOnly":{"title":"Read only/disabled?","description":"Boolean value or expression indicating if the component should be read only/disabled. Defaults to false.
Please note that even with read-only fields in components, it may currently be possible to update the field by modifying the request sent to the API or through a direct API call.","default":false,"$ref":"expression.schema.v1.json#/definitions/boolean"},"required":{"title":"Required?","description":"Boolean value or expression indicating if the component should be required. Defaults to false.","default":false,"$ref":"expression.schema.v1.json#/definitions/boolean"},"showValidations":{"title":"Validation types","description":"List of validation types to show","type":"array","items":{"enum":["Schema","Component","Expression","CustomBackend","Required","AllExceptRequired","All"],"type":"string"}},"renderAsSummary":{"title":"Render as summary","description":"Boolean value indicating if the component should be rendered as a summary. Defaults to false.","default":false,"type":"boolean"},"forceShowInSummary":{"title":"Force show in summary","description":"Will force show the component in a summary even if hideEmptyFields is set to true in the summary component.","default":false,"$ref":"expression.schema.v1.json#/definitions/boolean"},"optionsId":{"title":"Dynamic options (fetched from server)","description":"ID of the option list to fetch from the server","type":"string"},"mapping":{"title":"Mapping","description":"A mapping of key-value pairs (usually used for mapping a path in the data model to a query string parameter).","type":"object","properties":{},"additionalProperties":{"type":"string"}},"queryParameters":{"title":"Query parameters","description":"A mapping of query string parameters to values. Will be appended to the URL when fetching options.","type":"object","properties":{},"additionalProperties":{"type":"string"}},"options":{"title":"Static options","description":"List of static options","type":"array","items":{"title":"IRawOption","examples":[{"label":"","value":""}],"type":"object","properties":{"label":{"type":"string"},"value":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"const":null}]},"description":{"type":"string"},"helpText":{"type":"string"}},"required":["label","value"],"additionalProperties":false}},"secure":{"title":"Secure options (when using optionsId)","description":"Whether to call the secure API endpoint when fetching options from the server (allows for user/instance-specific options)","default":false,"type":"boolean"},"sortOrder":{"description":"Sorts the code list in either ascending or descending order by label.","enum":["asc","desc"],"type":"string"},"source":{"title":"Option source","description":"Allows for fetching options from the data model, pointing to a repeating group structure","type":"object","properties":{"group":{"title":"Group","description":"The repeating group to base options on.","examples":["model.some.group"],"type":"string"},"label":{"title":"Label","description":"A label of the option displayed in Radio- and Checkbox groups. Can be plain text, a text resource binding, or a dynamic expression.","examples":["some.text.key"],"$ref":"expression.schema.v1.json#/definitions/string"},"value":{"title":"Value","description":"Field in the group that should be used as value","examples":["model.some.group[{0}].someField"],"type":"string"},"description":{"title":"Description","description":"A description of the option displayed in Radio- and Checkbox groups. Can be plain text, a text resource binding, or a dynamic expression.","examples":["some.text.key","My Description"],"$ref":"expression.schema.v1.json#/definitions/string"},"helpText":{"title":"Help Text","description":"A help text for the option displayed in Radio- and Checkbox groups. Can be plain text, a text resource binding, or a dynamic expression.","examples":["some.text.key","My Help Text"],"$ref":"expression.schema.v1.json#/definitions/string"}},"required":["group","label","value"],"additionalProperties":false},"preselectedOptionIndex":{"title":"Preselected option index","description":"Index of the option to preselect (if no option has been selected yet)","type":"integer"},"labelSettings":{"title":"ILabelSettings","type":"object","properties":{"optionalIndicator":{"title":"Optional indicator","description":"Show optional indicator on label","type":"boolean"}},"additionalProperties":false},"type":{"const":"MultipleSelect"},"textResourceBindings":{"properties":{"title":{"title":"Title","description":"Label text/title shown above the component","$ref":"expression.schema.v1.json#/definitions/string"},"description":{"title":"Description","description":"Label description shown above the component, below the title","$ref":"expression.schema.v1.json#/definitions/string"},"help":{"title":"Help text","description":"Help text shown in a tooltip when clicking the help button","$ref":"expression.schema.v1.json#/definitions/string"},"tableTitle":{"title":"Table title","description":"Title used in the table view (overrides the default title)","$ref":"expression.schema.v1.json#/definitions/string"},"shortName":{"title":"Short name (for validation)","description":"Alternative name used for required validation messages (overrides the default title)","$ref":"expression.schema.v1.json#/definitions/string"},"requiredValidation":{"title":"Required validation message","description":"Full validation message shown when the component is required and no value has been entered (overrides both the default and shortName)","$ref":"expression.schema.v1.json#/definitions/string"},"summaryTitle":{"title":"Summary title","description":"Title used in the summary view (overrides the default title)","$ref":"expression.schema.v1.json#/definitions/string"},"summaryAccessibleTitle":{"title":"Accessible summary title","description":"Title used for aria-label on the edit button in the summary view (overrides the default and summary title)","$ref":"expression.schema.v1.json#/definitions/string"}}},"alertOnChange":{"title":"Alert on change","description":"Boolean value indicating if the component should alert on change","default":false,"$ref":"expression.schema.v1.json#/definitions/boolean"},"dataModelBindings":{"title":"Data model binding","description":"Describes the location in the data model where the component should store its value(s). A simple binding is used for components that only store a single value, usually a string.","type":"object","properties":{"simpleBinding":{"type":"string"},"label":{"type":"string"},"metadata":{"description":"Describes the location where metadata for the option based component should be stored in the datamodel.","type":"string"}},"required":["simpleBinding"],"additionalProperties":false}},"required":["id","type","dataModelBindings"],"title":"MultipleSelect component schema"} \ No newline at end of file diff --git a/frontend/packages/ux-editor/src/testing/schemas/json/component/NavigationBar.schema.v1.json b/frontend/packages/ux-editor/src/testing/schemas/json/component/NavigationBar.schema.v1.json index 350553ee9a0..c1dcae2c07c 100644 --- a/frontend/packages/ux-editor/src/testing/schemas/json/component/NavigationBar.schema.v1.json +++ b/frontend/packages/ux-editor/src/testing/schemas/json/component/NavigationBar.schema.v1.json @@ -1,87 +1 @@ -{ - "$id": "https://altinncdn.no/schemas/json/component/NavigationBar.schema.v1.json", - "$schema": "http://json-schema.org/draft-07/schema#", - "properties": { - "id": { - "title": "ID", - "description": "The component ID. Must be unique within all layouts/pages in a layout-set. Cannot end with .", - "type": "string", - "pattern": "^[0-9a-zA-Z][0-9a-zA-Z-]*(-?[a-zA-Z]+|[a-zA-Z][0-9]+|-[0-9]{6,})$" - }, - "hidden": { - "title": "Hidden", - "description": "Boolean value or expression indicating if the component should be hidden. Defaults to false.", - "default": false, - "$ref": "expression.schema.v1.json#/definitions/boolean" - }, - "grid": { - "properties": { - "xs": { "$ref": "#/definitions/IGridSize" }, - "sm": { "$ref": "#/definitions/IGridSize" }, - "md": { "$ref": "#/definitions/IGridSize" }, - "lg": { "$ref": "#/definitions/IGridSize" }, - "xl": { "$ref": "#/definitions/IGridSize" }, - "labelGrid": { "$ref": "#/definitions/IGridStyling" }, - "innerGrid": { "$ref": "#/definitions/IGridStyling" } - } - }, - "pageBreak": { - "title": "Page break", - "description": "Optionally insert page-break before/after component when rendered in PDF", - "type": "object", - "properties": { - "breakBefore": { - "title": "Page break before", - "description": "PDF only: Value or expression indicating whether a page break should be added before the component. Can be either: 'auto' (default), 'always', or 'avoid'.", - "examples": ["auto", "always", "avoid"], - "default": "auto", - "$ref": "expression.schema.v1.json#/definitions/string" - }, - "breakAfter": { - "title": "Page break after", - "description": "PDF only: Value or expression indicating whether a page break should be added after the component. Can be either: 'auto' (default), 'always', or 'avoid'.", - "examples": ["auto", "always", "avoid"], - "default": "auto", - "$ref": "expression.schema.v1.json#/definitions/string" - } - }, - "additionalProperties": false - }, - "type": { "const": "NavigationBar" }, - "compact": { - "title": "Compact", - "description": "Change appearance of navbar as compact in desktop view", - "type": "boolean" - }, - "validateOnForward": { - "title": "PageValidation", - "type": "object", - "properties": { - "page": { - "title": "Page", - "description": "Which pages should be validated when the next button is clicked.", - "enum": ["current", "currentAndPrevious", "all"] - }, - "show": { "$ref": "#/definitions/AllowedValidationMasks" } - }, - "required": ["page", "show"], - "additionalProperties": false - }, - "validateOnBackward": { - "title": "PageValidation", - "type": "object", - "properties": { - "page": { - "title": "Page", - "description": "Which pages should be validated when the next button is clicked.", - "enum": ["current", "currentAndPrevious", "all"] - }, - "show": { "$ref": "#/definitions/AllowedValidationMasks" } - }, - "required": ["page", "show"], - "additionalProperties": false - } - }, - "required": ["id", "type"], - "title": "NavigationBar component schema" -} +{"$id":"https://altinncdn.no/schemas/json/component/NavigationBar.schema.v1.json","$schema":"http://json-schema.org/draft-07/schema#","properties":{"id":{"title":"ID","description":"The component ID. Must be unique within all layouts/pages in a layout-set. Cannot end with .","type":"string","pattern":"^[0-9a-zA-Z][0-9a-zA-Z-]*(-?[a-zA-Z]+|[a-zA-Z][0-9]+|-[0-9]{6,})$"},"hidden":{"title":"Hidden","description":"Boolean value or expression indicating if the component should be hidden. Defaults to false.","default":false,"$ref":"expression.schema.v1.json#/definitions/boolean"},"grid":{"properties":{"xs":{"$ref":"#/definitions/IGridSize"},"sm":{"$ref":"#/definitions/IGridSize"},"md":{"$ref":"#/definitions/IGridSize"},"lg":{"$ref":"#/definitions/IGridSize"},"xl":{"$ref":"#/definitions/IGridSize"},"labelGrid":{"$ref":"#/definitions/IGridStyling"},"innerGrid":{"$ref":"#/definitions/IGridStyling"}}},"pageBreak":{"title":"Page break","description":"Optionally insert page-break before/after component when rendered in PDF","type":"object","properties":{"breakBefore":{"title":"Page break before","description":"PDF only: Value or expression indicating whether a page break should be added before the component. Can be either: 'auto' (default), 'always', or 'avoid'.","examples":["auto","always","avoid"],"default":"auto","$ref":"expression.schema.v1.json#/definitions/string"},"breakAfter":{"title":"Page break after","description":"PDF only: Value or expression indicating whether a page break should be added after the component. Can be either: 'auto' (default), 'always', or 'avoid'.","examples":["auto","always","avoid"],"default":"auto","$ref":"expression.schema.v1.json#/definitions/string"}},"additionalProperties":false},"type":{"const":"NavigationBar"},"compact":{"title":"Compact","description":"Change appearance of navbar as compact in desktop view","type":"boolean"},"validateOnForward":{"title":"PageValidation","type":"object","properties":{"page":{"title":"Page","description":"Which pages should be validated when the next button is clicked.","enum":["current","currentAndPrevious","all"]},"show":{"$ref":"#/definitions/AllowedValidationMasks"}},"required":["page","show"],"additionalProperties":false},"validateOnBackward":{"title":"PageValidation","type":"object","properties":{"page":{"title":"Page","description":"Which pages should be validated when the next button is clicked.","enum":["current","currentAndPrevious","all"]},"show":{"$ref":"#/definitions/AllowedValidationMasks"}},"required":["page","show"],"additionalProperties":false}},"required":["id","type"],"title":"NavigationBar component schema"} \ No newline at end of file diff --git a/frontend/packages/ux-editor/src/testing/schemas/json/component/NavigationButtons.schema.v1.json b/frontend/packages/ux-editor/src/testing/schemas/json/component/NavigationButtons.schema.v1.json index 0d91ddae873..4ec81acd177 100644 --- a/frontend/packages/ux-editor/src/testing/schemas/json/component/NavigationButtons.schema.v1.json +++ b/frontend/packages/ux-editor/src/testing/schemas/json/component/NavigationButtons.schema.v1.json @@ -1,104 +1 @@ -{ - "$id": "https://altinncdn.no/schemas/json/component/NavigationButtons.schema.v1.json", - "$schema": "http://json-schema.org/draft-07/schema#", - "properties": { - "id": { - "title": "ID", - "description": "The component ID. Must be unique within all layouts/pages in a layout-set. Cannot end with .", - "type": "string", - "pattern": "^[0-9a-zA-Z][0-9a-zA-Z-]*(-?[a-zA-Z]+|[a-zA-Z][0-9]+|-[0-9]{6,})$" - }, - "hidden": { - "title": "Hidden", - "description": "Boolean value or expression indicating if the component should be hidden. Defaults to false.", - "default": false, - "$ref": "expression.schema.v1.json#/definitions/boolean" - }, - "grid": { - "properties": { - "xs": { "$ref": "#/definitions/IGridSize" }, - "sm": { "$ref": "#/definitions/IGridSize" }, - "md": { "$ref": "#/definitions/IGridSize" }, - "lg": { "$ref": "#/definitions/IGridSize" }, - "xl": { "$ref": "#/definitions/IGridSize" }, - "labelGrid": { "$ref": "#/definitions/IGridStyling" }, - "innerGrid": { "$ref": "#/definitions/IGridStyling" } - } - }, - "pageBreak": { - "title": "Page break", - "description": "Optionally insert page-break before/after component when rendered in PDF", - "type": "object", - "properties": { - "breakBefore": { - "title": "Page break before", - "description": "PDF only: Value or expression indicating whether a page break should be added before the component. Can be either: 'auto' (default), 'always', or 'avoid'.", - "examples": ["auto", "always", "avoid"], - "default": "auto", - "$ref": "expression.schema.v1.json#/definitions/string" - }, - "breakAfter": { - "title": "Page break after", - "description": "PDF only: Value or expression indicating whether a page break should be added after the component. Can be either: 'auto' (default), 'always', or 'avoid'.", - "examples": ["auto", "always", "avoid"], - "default": "auto", - "$ref": "expression.schema.v1.json#/definitions/string" - } - }, - "additionalProperties": false - }, - "type": { "const": "NavigationButtons" }, - "textResourceBindings": { - "type": "object", - "properties": { - "back": { - "title": "Back", - "description": "Text on the back/previous page button", - "$ref": "expression.schema.v1.json#/definitions/string" - }, - "next": { - "title": "Next", - "description": "Text on the next page button", - "$ref": "expression.schema.v1.json#/definitions/string" - } - }, - "additionalProperties": false - }, - "showBackButton": { - "title": "Show back button", - "description": "Shows two buttons (back/next) instead of just 'next'.", - "default": false, - "type": "boolean" - }, - "validateOnNext": { - "title": "PageValidation", - "type": "object", - "properties": { - "page": { - "title": "Page", - "description": "Which pages should be validated when the next button is clicked.", - "enum": ["current", "currentAndPrevious", "all"] - }, - "show": { "$ref": "#/definitions/AllowedValidationMasks" } - }, - "required": ["page", "show"], - "additionalProperties": false - }, - "validateOnPrevious": { - "title": "PageValidation", - "type": "object", - "properties": { - "page": { - "title": "Page", - "description": "Which pages should be validated when the next button is clicked.", - "enum": ["current", "currentAndPrevious", "all"] - }, - "show": { "$ref": "#/definitions/AllowedValidationMasks" } - }, - "required": ["page", "show"], - "additionalProperties": false - } - }, - "required": ["id", "type"], - "title": "NavigationButtons component schema" -} +{"$id":"https://altinncdn.no/schemas/json/component/NavigationButtons.schema.v1.json","$schema":"http://json-schema.org/draft-07/schema#","properties":{"id":{"title":"ID","description":"The component ID. Must be unique within all layouts/pages in a layout-set. Cannot end with .","type":"string","pattern":"^[0-9a-zA-Z][0-9a-zA-Z-]*(-?[a-zA-Z]+|[a-zA-Z][0-9]+|-[0-9]{6,})$"},"hidden":{"title":"Hidden","description":"Boolean value or expression indicating if the component should be hidden. Defaults to false.","default":false,"$ref":"expression.schema.v1.json#/definitions/boolean"},"grid":{"properties":{"xs":{"$ref":"#/definitions/IGridSize"},"sm":{"$ref":"#/definitions/IGridSize"},"md":{"$ref":"#/definitions/IGridSize"},"lg":{"$ref":"#/definitions/IGridSize"},"xl":{"$ref":"#/definitions/IGridSize"},"labelGrid":{"$ref":"#/definitions/IGridStyling"},"innerGrid":{"$ref":"#/definitions/IGridStyling"}}},"pageBreak":{"title":"Page break","description":"Optionally insert page-break before/after component when rendered in PDF","type":"object","properties":{"breakBefore":{"title":"Page break before","description":"PDF only: Value or expression indicating whether a page break should be added before the component. Can be either: 'auto' (default), 'always', or 'avoid'.","examples":["auto","always","avoid"],"default":"auto","$ref":"expression.schema.v1.json#/definitions/string"},"breakAfter":{"title":"Page break after","description":"PDF only: Value or expression indicating whether a page break should be added after the component. Can be either: 'auto' (default), 'always', or 'avoid'.","examples":["auto","always","avoid"],"default":"auto","$ref":"expression.schema.v1.json#/definitions/string"}},"additionalProperties":false},"type":{"const":"NavigationButtons"},"textResourceBindings":{"type":"object","properties":{"back":{"title":"Back","description":"Text on the back/previous page button","$ref":"expression.schema.v1.json#/definitions/string"},"next":{"title":"Next","description":"Text on the next page button","$ref":"expression.schema.v1.json#/definitions/string"}},"additionalProperties":false},"showBackButton":{"title":"Show back button","description":"Shows two buttons (back/next) instead of just 'next'.","default":false,"type":"boolean"},"validateOnNext":{"title":"PageValidation","type":"object","properties":{"page":{"title":"Page","description":"Which pages should be validated when the next button is clicked.","enum":["current","currentAndPrevious","all"]},"show":{"$ref":"#/definitions/AllowedValidationMasks"}},"required":["page","show"],"additionalProperties":false},"validateOnPrevious":{"title":"PageValidation","type":"object","properties":{"page":{"title":"Page","description":"Which pages should be validated when the next button is clicked.","enum":["current","currentAndPrevious","all"]},"show":{"$ref":"#/definitions/AllowedValidationMasks"}},"required":["page","show"],"additionalProperties":false}},"required":["id","type"],"title":"NavigationButtons component schema"} \ No newline at end of file diff --git a/frontend/packages/ux-editor/src/testing/schemas/json/component/Number.schema.v1.json b/frontend/packages/ux-editor/src/testing/schemas/json/component/Number.schema.v1.json index 9b9aa0d221c..6f8a17153ba 100644 --- a/frontend/packages/ux-editor/src/testing/schemas/json/component/Number.schema.v1.json +++ b/frontend/packages/ux-editor/src/testing/schemas/json/component/Number.schema.v1.json @@ -1,312 +1 @@ -{ - "$id": "https://altinncdn.no/schemas/json/component/Number.schema.v1.json", - "$schema": "http://json-schema.org/draft-07/schema#", - "properties": { - "id": { - "title": "ID", - "description": "The component ID. Must be unique within all layouts/pages in a layout-set. Cannot end with .", - "type": "string", - "pattern": "^[0-9a-zA-Z][0-9a-zA-Z-]*(-?[a-zA-Z]+|[a-zA-Z][0-9]+|-[0-9]{6,})$" - }, - "hidden": { - "title": "Hidden", - "description": "Boolean value or expression indicating if the component should be hidden. Defaults to false.", - "default": false, - "$ref": "expression.schema.v1.json#/definitions/boolean" - }, - "grid": { - "properties": { - "xs": { "$ref": "#/definitions/IGridSize" }, - "sm": { "$ref": "#/definitions/IGridSize" }, - "md": { "$ref": "#/definitions/IGridSize" }, - "lg": { "$ref": "#/definitions/IGridSize" }, - "xl": { "$ref": "#/definitions/IGridSize" }, - "labelGrid": { "$ref": "#/definitions/IGridStyling" }, - "innerGrid": { "$ref": "#/definitions/IGridStyling" } - } - }, - "pageBreak": { - "title": "Page break", - "description": "Optionally insert page-break before/after component when rendered in PDF", - "type": "object", - "properties": { - "breakBefore": { - "title": "Page break before", - "description": "PDF only: Value or expression indicating whether a page break should be added before the component. Can be either: 'auto' (default), 'always', or 'avoid'.", - "examples": ["auto", "always", "avoid"], - "default": "auto", - "$ref": "expression.schema.v1.json#/definitions/string" - }, - "breakAfter": { - "title": "Page break after", - "description": "PDF only: Value or expression indicating whether a page break should be added after the component. Can be either: 'auto' (default), 'always', or 'avoid'.", - "examples": ["auto", "always", "avoid"], - "default": "auto", - "$ref": "expression.schema.v1.json#/definitions/string" - } - }, - "additionalProperties": false - }, - "type": { "const": "Number" }, - "textResourceBindings": { - "title": "TRBLabel", - "type": "object", - "properties": { - "title": { - "title": "Title", - "description": "Label text/title shown above the component", - "$ref": "expression.schema.v1.json#/definitions/string" - }, - "description": { - "title": "Description", - "description": "Label description shown above the component, below the title", - "$ref": "expression.schema.v1.json#/definitions/string" - }, - "help": { - "title": "Help text", - "description": "Help text shown in a tooltip when clicking the help button", - "$ref": "expression.schema.v1.json#/definitions/string" - } - } - }, - "formatting": { - "title": "IFormatting", - "examples": [ - { "currency": "NOK" }, - { - "number": { - "thousandSeparator": " ", - "decimalSeparator": ",", - "allowNegative": false, - "suffix": " kr" - } - } - ], - "type": "object", - "properties": { - "currency": { - "title": "Language-sensitive currency formatting", - "description": "Enables currency to be language sensitive based on selected app language. Note: parts that already exist in number property are not overridden by this prop.", - "enum": [ - "AED", - "AFN", - "ALL", - "AMD", - "ANG", - "AOA", - "ARS", - "AUD", - "AWG", - "AZN", - "BAM", - "BBD", - "BDT", - "BGN", - "BHD", - "BIF", - "BMD", - "BND", - "BOB", - "BOV", - "BRL", - "BSD", - "BTN", - "BWP", - "BYN", - "BZD", - "CAD", - "CDF", - "CHE", - "CHF", - "CHW", - "CLF", - "CLP", - "CNY", - "COP", - "COU", - "CRC", - "CUC", - "CUP", - "CVE", - "CZK", - "DJF", - "DKK", - "DOP", - "DZD", - "EGP", - "ERN", - "ETB", - "EUR", - "FJD", - "FKP", - "GBP", - "GEL", - "GHS", - "GIP", - "GMD", - "GNF", - "GTQ", - "GYD", - "HKD", - "HNL", - "HTG", - "HUF", - "IDR", - "ILS", - "INR", - "IQD", - "IRR", - "ISK", - "JMD", - "JOD", - "JPY", - "KES", - "KGS", - "KHR", - "KMF", - "KPW", - "KRW", - "KWD", - "KYD", - "KZT", - "LAK", - "LBP", - "LKR", - "LRD", - "LSL", - "LYD", - "MAD", - "MDL", - "MGA", - "MKD", - "MMK", - "MNT", - "MOP", - "MRU", - "MUR", - "MVR", - "MWK", - "MXN", - "MXV", - "MYR", - "MZN", - "NAD", - "NGN", - "NIO", - "NOK", - "NPR", - "NZD", - "OMR", - "PAB", - "PEN", - "PGK", - "PHP", - "PKR", - "PLN", - "PYG", - "QAR", - "RON", - "RSD", - "RUB", - "RWF", - "SAR", - "SBD", - "SCR", - "SDG", - "SEK", - "SGD", - "SHP", - "SLE", - "SLL", - "SOS", - "SRD", - "SSP", - "STN", - "SVC", - "SYP", - "SZL", - "THB", - "TJS", - "TMT", - "TND", - "TOP", - "TRY", - "TTD", - "TWD", - "TZS", - "UAH", - "UGX", - "USD", - "USN", - "UYI", - "UYU", - "UYW", - "UZS", - "VED", - "VES", - "VND", - "VUV", - "WST", - "XAF", - "XCD", - "XDR", - "XOF", - "XPF", - "XSU", - "XUA", - "YER", - "ZAR", - "ZMW", - "ZWL" - ] - }, - "unit": { - "title": "Language-sensitive number formatting based on unit", - "description": "Enables unit along with thousand and decimal separators to be language sensitive based on selected app language. They are configured in number property. Note: parts that already exist in number property are not overridden by this prop.", - "enum": [ - "celsius", - "centimeter", - "day", - "degree", - "foot", - "gram", - "hectare", - "hour", - "inch", - "kilogram", - "kilometer", - "liter", - "meter", - "milliliter", - "millimeter", - "millisecond", - "minute", - "month", - "percent", - "second", - "week", - "year" - ] - }, - "position": { - "title": "Position of the currency/unit symbol", - "description": "Display the unit as prefix or suffix. Default is prefix. (Use only when using currency or unit options)", - "enum": ["prefix", "suffix"] - }, - "number": { - "anyOf": [ - { "$ref": "#/definitions/PatternFormatProps" }, - { "$ref": "#/definitions/NumberFormatProps" } - ] - }, - "align": { "default": "left", "enum": ["right", "center", "left"] } - }, - "additionalProperties": false - }, - "value": { "$ref": "expression.schema.v1.json#/definitions/number" }, - "direction": { "default": "horizontal", "enum": ["horizontal", "vertical"], "type": "string" }, - "icon": { "examples": ["https://example.com/icon.svg"], "type": "string" } - }, - "required": ["id", "type", "value"], - "title": "Number component schema" -} +{"$id":"https://altinncdn.no/schemas/json/component/Number.schema.v1.json","$schema":"http://json-schema.org/draft-07/schema#","properties":{"id":{"title":"ID","description":"The component ID. Must be unique within all layouts/pages in a layout-set. Cannot end with .","type":"string","pattern":"^[0-9a-zA-Z][0-9a-zA-Z-]*(-?[a-zA-Z]+|[a-zA-Z][0-9]+|-[0-9]{6,})$"},"hidden":{"title":"Hidden","description":"Boolean value or expression indicating if the component should be hidden. Defaults to false.","default":false,"$ref":"expression.schema.v1.json#/definitions/boolean"},"grid":{"properties":{"xs":{"$ref":"#/definitions/IGridSize"},"sm":{"$ref":"#/definitions/IGridSize"},"md":{"$ref":"#/definitions/IGridSize"},"lg":{"$ref":"#/definitions/IGridSize"},"xl":{"$ref":"#/definitions/IGridSize"},"labelGrid":{"$ref":"#/definitions/IGridStyling"},"innerGrid":{"$ref":"#/definitions/IGridStyling"}}},"pageBreak":{"title":"Page break","description":"Optionally insert page-break before/after component when rendered in PDF","type":"object","properties":{"breakBefore":{"title":"Page break before","description":"PDF only: Value or expression indicating whether a page break should be added before the component. Can be either: 'auto' (default), 'always', or 'avoid'.","examples":["auto","always","avoid"],"default":"auto","$ref":"expression.schema.v1.json#/definitions/string"},"breakAfter":{"title":"Page break after","description":"PDF only: Value or expression indicating whether a page break should be added after the component. Can be either: 'auto' (default), 'always', or 'avoid'.","examples":["auto","always","avoid"],"default":"auto","$ref":"expression.schema.v1.json#/definitions/string"}},"additionalProperties":false},"type":{"const":"Number"},"textResourceBindings":{"title":"TRBLabel","type":"object","properties":{"title":{"title":"Title","description":"Label text/title shown above the component","$ref":"expression.schema.v1.json#/definitions/string"},"description":{"title":"Description","description":"Label description shown above the component, below the title","$ref":"expression.schema.v1.json#/definitions/string"},"help":{"title":"Help text","description":"Help text shown in a tooltip when clicking the help button","$ref":"expression.schema.v1.json#/definitions/string"}}},"formatting":{"title":"IFormatting","examples":[{"currency":"NOK"},{"number":{"thousandSeparator":" ","decimalSeparator":",","allowNegative":false,"suffix":" kr"}}],"type":"object","properties":{"currency":{"title":"Language-sensitive currency formatting","description":"Enables currency to be language sensitive based on selected app language. Note: parts that already exist in number property are not overridden by this prop.","enum":["AED","AFN","ALL","AMD","ANG","AOA","ARS","AUD","AWG","AZN","BAM","BBD","BDT","BGN","BHD","BIF","BMD","BND","BOB","BOV","BRL","BSD","BTN","BWP","BYN","BZD","CAD","CDF","CHE","CHF","CHW","CLF","CLP","CNY","COP","COU","CRC","CUC","CUP","CVE","CZK","DJF","DKK","DOP","DZD","EGP","ERN","ETB","EUR","FJD","FKP","GBP","GEL","GHS","GIP","GMD","GNF","GTQ","GYD","HKD","HNL","HTG","HUF","IDR","ILS","INR","IQD","IRR","ISK","JMD","JOD","JPY","KES","KGS","KHR","KMF","KPW","KRW","KWD","KYD","KZT","LAK","LBP","LKR","LRD","LSL","LYD","MAD","MDL","MGA","MKD","MMK","MNT","MOP","MRU","MUR","MVR","MWK","MXN","MXV","MYR","MZN","NAD","NGN","NIO","NOK","NPR","NZD","OMR","PAB","PEN","PGK","PHP","PKR","PLN","PYG","QAR","RON","RSD","RUB","RWF","SAR","SBD","SCR","SDG","SEK","SGD","SHP","SLE","SLL","SOS","SRD","SSP","STN","SVC","SYP","SZL","THB","TJS","TMT","TND","TOP","TRY","TTD","TWD","TZS","UAH","UGX","USD","USN","UYI","UYU","UYW","UZS","VED","VES","VND","VUV","WST","XAF","XCD","XDR","XOF","XPF","XSU","XUA","YER","ZAR","ZMW","ZWL"]},"unit":{"title":"Language-sensitive number formatting based on unit","description":"Enables unit along with thousand and decimal separators to be language sensitive based on selected app language. They are configured in number property. Note: parts that already exist in number property are not overridden by this prop.","enum":["celsius","centimeter","day","degree","foot","gram","hectare","hour","inch","kilogram","kilometer","liter","meter","milliliter","millimeter","millisecond","minute","month","percent","second","week","year"]},"position":{"title":"Position of the currency/unit symbol","description":"Display the unit as prefix or suffix. Default is prefix. (Use only when using currency or unit options)","enum":["prefix","suffix"]},"number":{"anyOf":[{"$ref":"#/definitions/PatternFormatProps"},{"$ref":"#/definitions/NumberFormatProps"}]},"align":{"default":"left","enum":["right","center","left"]}},"additionalProperties":false},"value":{"$ref":"expression.schema.v1.json#/definitions/number"},"direction":{"default":"horizontal","enum":["horizontal","vertical"],"type":"string"},"icon":{"examples":["https://example.com/icon.svg"],"type":"string"}},"required":["id","type","value"],"title":"Number component schema"} \ No newline at end of file diff --git a/frontend/packages/ux-editor/src/testing/schemas/json/component/Panel.schema.v1.json b/frontend/packages/ux-editor/src/testing/schemas/json/component/Panel.schema.v1.json index 71b44c85004..0733b1d1577 100644 --- a/frontend/packages/ux-editor/src/testing/schemas/json/component/Panel.schema.v1.json +++ b/frontend/packages/ux-editor/src/testing/schemas/json/component/Panel.schema.v1.json @@ -1,82 +1 @@ -{ - "$id": "https://altinncdn.no/schemas/json/component/Panel.schema.v1.json", - "$schema": "http://json-schema.org/draft-07/schema#", - "properties": { - "id": { - "title": "ID", - "description": "The component ID. Must be unique within all layouts/pages in a layout-set. Cannot end with .", - "type": "string", - "pattern": "^[0-9a-zA-Z][0-9a-zA-Z-]*(-?[a-zA-Z]+|[a-zA-Z][0-9]+|-[0-9]{6,})$" - }, - "hidden": { - "title": "Hidden", - "description": "Boolean value or expression indicating if the component should be hidden. Defaults to false.", - "default": false, - "$ref": "expression.schema.v1.json#/definitions/boolean" - }, - "grid": { - "properties": { - "xs": { "$ref": "#/definitions/IGridSize" }, - "sm": { "$ref": "#/definitions/IGridSize" }, - "md": { "$ref": "#/definitions/IGridSize" }, - "lg": { "$ref": "#/definitions/IGridSize" }, - "xl": { "$ref": "#/definitions/IGridSize" }, - "labelGrid": { "$ref": "#/definitions/IGridStyling" }, - "innerGrid": { "$ref": "#/definitions/IGridStyling" } - } - }, - "pageBreak": { - "title": "Page break", - "description": "Optionally insert page-break before/after component when rendered in PDF", - "type": "object", - "properties": { - "breakBefore": { - "title": "Page break before", - "description": "PDF only: Value or expression indicating whether a page break should be added before the component. Can be either: 'auto' (default), 'always', or 'avoid'.", - "examples": ["auto", "always", "avoid"], - "default": "auto", - "$ref": "expression.schema.v1.json#/definitions/string" - }, - "breakAfter": { - "title": "Page break after", - "description": "PDF only: Value or expression indicating whether a page break should be added after the component. Can be either: 'auto' (default), 'always', or 'avoid'.", - "examples": ["auto", "always", "avoid"], - "default": "auto", - "$ref": "expression.schema.v1.json#/definitions/string" - } - }, - "additionalProperties": false - }, - "variant": { - "title": "Panel variant", - "description": "Change the look of the panel", - "enum": ["info", "warning", "error", "success"], - "type": "string" - }, - "showIcon": { - "title": "Show icon", - "description": "Show icon in the panel header", - "default": true, - "type": "boolean" - }, - "type": { "const": "Panel" }, - "textResourceBindings": { - "type": "object", - "properties": { - "title": { - "title": "Title", - "description": "Header/title of the panel", - "$ref": "expression.schema.v1.json#/definitions/string" - }, - "body": { - "title": "Body", - "description": "Body of the panel", - "$ref": "expression.schema.v1.json#/definitions/string" - } - }, - "additionalProperties": false - } - }, - "required": ["id", "type"], - "title": "Panel component schema" -} +{"$id":"https://altinncdn.no/schemas/json/component/Panel.schema.v1.json","$schema":"http://json-schema.org/draft-07/schema#","properties":{"id":{"title":"ID","description":"The component ID. Must be unique within all layouts/pages in a layout-set. Cannot end with .","type":"string","pattern":"^[0-9a-zA-Z][0-9a-zA-Z-]*(-?[a-zA-Z]+|[a-zA-Z][0-9]+|-[0-9]{6,})$"},"hidden":{"title":"Hidden","description":"Boolean value or expression indicating if the component should be hidden. Defaults to false.","default":false,"$ref":"expression.schema.v1.json#/definitions/boolean"},"grid":{"properties":{"xs":{"$ref":"#/definitions/IGridSize"},"sm":{"$ref":"#/definitions/IGridSize"},"md":{"$ref":"#/definitions/IGridSize"},"lg":{"$ref":"#/definitions/IGridSize"},"xl":{"$ref":"#/definitions/IGridSize"},"labelGrid":{"$ref":"#/definitions/IGridStyling"},"innerGrid":{"$ref":"#/definitions/IGridStyling"}}},"pageBreak":{"title":"Page break","description":"Optionally insert page-break before/after component when rendered in PDF","type":"object","properties":{"breakBefore":{"title":"Page break before","description":"PDF only: Value or expression indicating whether a page break should be added before the component. Can be either: 'auto' (default), 'always', or 'avoid'.","examples":["auto","always","avoid"],"default":"auto","$ref":"expression.schema.v1.json#/definitions/string"},"breakAfter":{"title":"Page break after","description":"PDF only: Value or expression indicating whether a page break should be added after the component. Can be either: 'auto' (default), 'always', or 'avoid'.","examples":["auto","always","avoid"],"default":"auto","$ref":"expression.schema.v1.json#/definitions/string"}},"additionalProperties":false},"variant":{"title":"Panel variant","description":"Change the look of the panel","enum":["info","warning","error","success"],"type":"string"},"showIcon":{"title":"Show icon","description":"Show icon in the panel header","default":true,"type":"boolean"},"type":{"const":"Panel"},"textResourceBindings":{"type":"object","properties":{"title":{"title":"Title","description":"Header/title of the panel","$ref":"expression.schema.v1.json#/definitions/string"},"body":{"title":"Body","description":"Body of the panel","$ref":"expression.schema.v1.json#/definitions/string"}},"additionalProperties":false}},"required":["id","type"],"title":"Panel component schema"} \ No newline at end of file diff --git a/frontend/packages/ux-editor/src/testing/schemas/json/component/Paragraph.schema.v1.json b/frontend/packages/ux-editor/src/testing/schemas/json/component/Paragraph.schema.v1.json index ffa5c4ab13b..33eb19bc036 100644 --- a/frontend/packages/ux-editor/src/testing/schemas/json/component/Paragraph.schema.v1.json +++ b/frontend/packages/ux-editor/src/testing/schemas/json/component/Paragraph.schema.v1.json @@ -1,70 +1 @@ -{ - "$id": "https://altinncdn.no/schemas/json/component/Paragraph.schema.v1.json", - "$schema": "http://json-schema.org/draft-07/schema#", - "properties": { - "id": { - "title": "ID", - "description": "The component ID. Must be unique within all layouts/pages in a layout-set. Cannot end with .", - "type": "string", - "pattern": "^[0-9a-zA-Z][0-9a-zA-Z-]*(-?[a-zA-Z]+|[a-zA-Z][0-9]+|-[0-9]{6,})$" - }, - "hidden": { - "title": "Hidden", - "description": "Boolean value or expression indicating if the component should be hidden. Defaults to false.", - "default": false, - "$ref": "expression.schema.v1.json#/definitions/boolean" - }, - "grid": { - "properties": { - "xs": { "$ref": "#/definitions/IGridSize" }, - "sm": { "$ref": "#/definitions/IGridSize" }, - "md": { "$ref": "#/definitions/IGridSize" }, - "lg": { "$ref": "#/definitions/IGridSize" }, - "xl": { "$ref": "#/definitions/IGridSize" }, - "labelGrid": { "$ref": "#/definitions/IGridStyling" }, - "innerGrid": { "$ref": "#/definitions/IGridStyling" } - } - }, - "pageBreak": { - "title": "Page break", - "description": "Optionally insert page-break before/after component when rendered in PDF", - "type": "object", - "properties": { - "breakBefore": { - "title": "Page break before", - "description": "PDF only: Value or expression indicating whether a page break should be added before the component. Can be either: 'auto' (default), 'always', or 'avoid'.", - "examples": ["auto", "always", "avoid"], - "default": "auto", - "$ref": "expression.schema.v1.json#/definitions/string" - }, - "breakAfter": { - "title": "Page break after", - "description": "PDF only: Value or expression indicating whether a page break should be added after the component. Can be either: 'auto' (default), 'always', or 'avoid'.", - "examples": ["auto", "always", "avoid"], - "default": "auto", - "$ref": "expression.schema.v1.json#/definitions/string" - } - }, - "additionalProperties": false - }, - "type": { "const": "Paragraph" }, - "textResourceBindings": { - "type": "object", - "properties": { - "title": { - "title": "Title", - "description": "The title of the paragraph", - "$ref": "expression.schema.v1.json#/definitions/string" - }, - "help": { - "title": "Help text", - "description": "Help text, optionally shown in a tooltip", - "$ref": "expression.schema.v1.json#/definitions/string" - } - }, - "additionalProperties": false - } - }, - "required": ["id", "type"], - "title": "Paragraph component schema" -} +{"$id":"https://altinncdn.no/schemas/json/component/Paragraph.schema.v1.json","$schema":"http://json-schema.org/draft-07/schema#","properties":{"id":{"title":"ID","description":"The component ID. Must be unique within all layouts/pages in a layout-set. Cannot end with .","type":"string","pattern":"^[0-9a-zA-Z][0-9a-zA-Z-]*(-?[a-zA-Z]+|[a-zA-Z][0-9]+|-[0-9]{6,})$"},"hidden":{"title":"Hidden","description":"Boolean value or expression indicating if the component should be hidden. Defaults to false.","default":false,"$ref":"expression.schema.v1.json#/definitions/boolean"},"grid":{"properties":{"xs":{"$ref":"#/definitions/IGridSize"},"sm":{"$ref":"#/definitions/IGridSize"},"md":{"$ref":"#/definitions/IGridSize"},"lg":{"$ref":"#/definitions/IGridSize"},"xl":{"$ref":"#/definitions/IGridSize"},"labelGrid":{"$ref":"#/definitions/IGridStyling"},"innerGrid":{"$ref":"#/definitions/IGridStyling"}}},"pageBreak":{"title":"Page break","description":"Optionally insert page-break before/after component when rendered in PDF","type":"object","properties":{"breakBefore":{"title":"Page break before","description":"PDF only: Value or expression indicating whether a page break should be added before the component. Can be either: 'auto' (default), 'always', or 'avoid'.","examples":["auto","always","avoid"],"default":"auto","$ref":"expression.schema.v1.json#/definitions/string"},"breakAfter":{"title":"Page break after","description":"PDF only: Value or expression indicating whether a page break should be added after the component. Can be either: 'auto' (default), 'always', or 'avoid'.","examples":["auto","always","avoid"],"default":"auto","$ref":"expression.schema.v1.json#/definitions/string"}},"additionalProperties":false},"type":{"const":"Paragraph"},"textResourceBindings":{"type":"object","properties":{"title":{"title":"Title","description":"The title of the paragraph","$ref":"expression.schema.v1.json#/definitions/string"},"help":{"title":"Help text","description":"Help text, optionally shown in a tooltip","$ref":"expression.schema.v1.json#/definitions/string"}},"additionalProperties":false}},"required":["id","type"],"title":"Paragraph component schema"} \ No newline at end of file diff --git a/frontend/packages/ux-editor/src/testing/schemas/json/component/Payment.schema.v1.json b/frontend/packages/ux-editor/src/testing/schemas/json/component/Payment.schema.v1.json index a64d52f76c8..3c631c61c4b 100644 --- a/frontend/packages/ux-editor/src/testing/schemas/json/component/Payment.schema.v1.json +++ b/frontend/packages/ux-editor/src/testing/schemas/json/component/Payment.schema.v1.json @@ -1,82 +1 @@ -{ - "$id": "https://altinncdn.no/schemas/json/component/Payment.schema.v1.json", - "$schema": "http://json-schema.org/draft-07/schema#", - "properties": { - "id": { - "title": "ID", - "description": "The component ID. Must be unique within all layouts/pages in a layout-set. Cannot end with .", - "type": "string", - "pattern": "^[0-9a-zA-Z][0-9a-zA-Z-]*(-?[a-zA-Z]+|[a-zA-Z][0-9]+|-[0-9]{6,})$" - }, - "hidden": { - "title": "Hidden", - "description": "Boolean value or expression indicating if the component should be hidden. Defaults to false.", - "default": false, - "$ref": "expression.schema.v1.json#/definitions/boolean" - }, - "grid": { - "properties": { - "xs": { "$ref": "#/definitions/IGridSize" }, - "sm": { "$ref": "#/definitions/IGridSize" }, - "md": { "$ref": "#/definitions/IGridSize" }, - "lg": { "$ref": "#/definitions/IGridSize" }, - "xl": { "$ref": "#/definitions/IGridSize" }, - "labelGrid": { "$ref": "#/definitions/IGridStyling" }, - "innerGrid": { "$ref": "#/definitions/IGridStyling" } - } - }, - "pageBreak": { - "title": "Page break", - "description": "Optionally insert page-break before/after component when rendered in PDF", - "type": "object", - "properties": { - "breakBefore": { - "title": "Page break before", - "description": "PDF only: Value or expression indicating whether a page break should be added before the component. Can be either: 'auto' (default), 'always', or 'avoid'.", - "examples": ["auto", "always", "avoid"], - "default": "auto", - "$ref": "expression.schema.v1.json#/definitions/string" - }, - "breakAfter": { - "title": "Page break after", - "description": "PDF only: Value or expression indicating whether a page break should be added after the component. Can be either: 'auto' (default), 'always', or 'avoid'.", - "examples": ["auto", "always", "avoid"], - "default": "auto", - "$ref": "expression.schema.v1.json#/definitions/string" - } - }, - "additionalProperties": false - }, - "renderAsSummary": { - "title": "Render as summary", - "description": "Boolean value indicating if the component should be rendered as a summary. Defaults to false.", - "default": false, - "type": "boolean" - }, - "forceShowInSummary": { - "title": "Force show in summary", - "description": "Will force show the component in a summary even if hideEmptyFields is set to true in the summary component.", - "default": false, - "$ref": "expression.schema.v1.json#/definitions/boolean" - }, - "type": { "const": "Payment" }, - "textResourceBindings": { - "type": "object", - "properties": { - "title": { - "title": "Title", - "description": "The title of the paragraph", - "$ref": "expression.schema.v1.json#/definitions/string" - }, - "description": { - "title": "Description", - "description": "Description, optionally shown below the title", - "$ref": "expression.schema.v1.json#/definitions/string" - } - }, - "additionalProperties": false - } - }, - "required": ["id", "type"], - "title": "Payment component schema" -} +{"$id":"https://altinncdn.no/schemas/json/component/Payment.schema.v1.json","$schema":"http://json-schema.org/draft-07/schema#","properties":{"id":{"title":"ID","description":"The component ID. Must be unique within all layouts/pages in a layout-set. Cannot end with .","type":"string","pattern":"^[0-9a-zA-Z][0-9a-zA-Z-]*(-?[a-zA-Z]+|[a-zA-Z][0-9]+|-[0-9]{6,})$"},"hidden":{"title":"Hidden","description":"Boolean value or expression indicating if the component should be hidden. Defaults to false.","default":false,"$ref":"expression.schema.v1.json#/definitions/boolean"},"grid":{"properties":{"xs":{"$ref":"#/definitions/IGridSize"},"sm":{"$ref":"#/definitions/IGridSize"},"md":{"$ref":"#/definitions/IGridSize"},"lg":{"$ref":"#/definitions/IGridSize"},"xl":{"$ref":"#/definitions/IGridSize"},"labelGrid":{"$ref":"#/definitions/IGridStyling"},"innerGrid":{"$ref":"#/definitions/IGridStyling"}}},"pageBreak":{"title":"Page break","description":"Optionally insert page-break before/after component when rendered in PDF","type":"object","properties":{"breakBefore":{"title":"Page break before","description":"PDF only: Value or expression indicating whether a page break should be added before the component. Can be either: 'auto' (default), 'always', or 'avoid'.","examples":["auto","always","avoid"],"default":"auto","$ref":"expression.schema.v1.json#/definitions/string"},"breakAfter":{"title":"Page break after","description":"PDF only: Value or expression indicating whether a page break should be added after the component. Can be either: 'auto' (default), 'always', or 'avoid'.","examples":["auto","always","avoid"],"default":"auto","$ref":"expression.schema.v1.json#/definitions/string"}},"additionalProperties":false},"renderAsSummary":{"title":"Render as summary","description":"Boolean value indicating if the component should be rendered as a summary. Defaults to false.","default":false,"type":"boolean"},"forceShowInSummary":{"title":"Force show in summary","description":"Will force show the component in a summary even if hideEmptyFields is set to true in the summary component.","default":false,"$ref":"expression.schema.v1.json#/definitions/boolean"},"type":{"const":"Payment"},"textResourceBindings":{"type":"object","properties":{"title":{"title":"Title","description":"The title of the paragraph","$ref":"expression.schema.v1.json#/definitions/string"},"description":{"title":"Description","description":"Description, optionally shown below the title","$ref":"expression.schema.v1.json#/definitions/string"}},"additionalProperties":false}},"required":["id","type"],"title":"Payment component schema"} \ No newline at end of file diff --git a/frontend/packages/ux-editor/src/testing/schemas/json/component/PaymentDetails.schema.v1.json b/frontend/packages/ux-editor/src/testing/schemas/json/component/PaymentDetails.schema.v1.json index 0ad2bdb54a8..55b0a6d879d 100644 --- a/frontend/packages/ux-editor/src/testing/schemas/json/component/PaymentDetails.schema.v1.json +++ b/frontend/packages/ux-editor/src/testing/schemas/json/component/PaymentDetails.schema.v1.json @@ -1,77 +1 @@ -{ - "$id": "https://altinncdn.no/schemas/json/component/PaymentDetails.schema.v1.json", - "$schema": "http://json-schema.org/draft-07/schema#", - "properties": { - "id": { - "title": "ID", - "description": "The component ID. Must be unique within all layouts/pages in a layout-set. Cannot end with .", - "type": "string", - "pattern": "^[0-9a-zA-Z][0-9a-zA-Z-]*(-?[a-zA-Z]+|[a-zA-Z][0-9]+|-[0-9]{6,})$" - }, - "hidden": { - "title": "Hidden", - "description": "Boolean value or expression indicating if the component should be hidden. Defaults to false.", - "default": false, - "$ref": "expression.schema.v1.json#/definitions/boolean" - }, - "grid": { - "properties": { - "xs": { "$ref": "#/definitions/IGridSize" }, - "sm": { "$ref": "#/definitions/IGridSize" }, - "md": { "$ref": "#/definitions/IGridSize" }, - "lg": { "$ref": "#/definitions/IGridSize" }, - "xl": { "$ref": "#/definitions/IGridSize" }, - "labelGrid": { "$ref": "#/definitions/IGridStyling" }, - "innerGrid": { "$ref": "#/definitions/IGridStyling" } - } - }, - "pageBreak": { - "title": "Page break", - "description": "Optionally insert page-break before/after component when rendered in PDF", - "type": "object", - "properties": { - "breakBefore": { - "title": "Page break before", - "description": "PDF only: Value or expression indicating whether a page break should be added before the component. Can be either: 'auto' (default), 'always', or 'avoid'.", - "examples": ["auto", "always", "avoid"], - "default": "auto", - "$ref": "expression.schema.v1.json#/definitions/string" - }, - "breakAfter": { - "title": "Page break after", - "description": "PDF only: Value or expression indicating whether a page break should be added after the component. Can be either: 'auto' (default), 'always', or 'avoid'.", - "examples": ["auto", "always", "avoid"], - "default": "auto", - "$ref": "expression.schema.v1.json#/definitions/string" - } - }, - "additionalProperties": false - }, - "type": { "const": "PaymentDetails" }, - "textResourceBindings": { - "type": "object", - "properties": { - "title": { - "title": "Title", - "description": "The title of the paragraph", - "$ref": "expression.schema.v1.json#/definitions/string" - }, - "description": { - "title": "Description", - "description": "Description, optionally shown below the title", - "$ref": "expression.schema.v1.json#/definitions/string" - } - }, - "additionalProperties": false - }, - "mapping": { - "title": "Mapping", - "description": "A mapping of key-value pairs (usually used for mapping a path in the data model to a query string parameter).", - "type": "object", - "properties": {}, - "additionalProperties": { "type": "string" } - } - }, - "required": ["id", "type"], - "title": "PaymentDetails component schema" -} +{"$id":"https://altinncdn.no/schemas/json/component/PaymentDetails.schema.v1.json","$schema":"http://json-schema.org/draft-07/schema#","properties":{"id":{"title":"ID","description":"The component ID. Must be unique within all layouts/pages in a layout-set. Cannot end with .","type":"string","pattern":"^[0-9a-zA-Z][0-9a-zA-Z-]*(-?[a-zA-Z]+|[a-zA-Z][0-9]+|-[0-9]{6,})$"},"hidden":{"title":"Hidden","description":"Boolean value or expression indicating if the component should be hidden. Defaults to false.","default":false,"$ref":"expression.schema.v1.json#/definitions/boolean"},"grid":{"properties":{"xs":{"$ref":"#/definitions/IGridSize"},"sm":{"$ref":"#/definitions/IGridSize"},"md":{"$ref":"#/definitions/IGridSize"},"lg":{"$ref":"#/definitions/IGridSize"},"xl":{"$ref":"#/definitions/IGridSize"},"labelGrid":{"$ref":"#/definitions/IGridStyling"},"innerGrid":{"$ref":"#/definitions/IGridStyling"}}},"pageBreak":{"title":"Page break","description":"Optionally insert page-break before/after component when rendered in PDF","type":"object","properties":{"breakBefore":{"title":"Page break before","description":"PDF only: Value or expression indicating whether a page break should be added before the component. Can be either: 'auto' (default), 'always', or 'avoid'.","examples":["auto","always","avoid"],"default":"auto","$ref":"expression.schema.v1.json#/definitions/string"},"breakAfter":{"title":"Page break after","description":"PDF only: Value or expression indicating whether a page break should be added after the component. Can be either: 'auto' (default), 'always', or 'avoid'.","examples":["auto","always","avoid"],"default":"auto","$ref":"expression.schema.v1.json#/definitions/string"}},"additionalProperties":false},"type":{"const":"PaymentDetails"},"textResourceBindings":{"type":"object","properties":{"title":{"title":"Title","description":"The title of the paragraph","$ref":"expression.schema.v1.json#/definitions/string"},"description":{"title":"Description","description":"Description, optionally shown below the title","$ref":"expression.schema.v1.json#/definitions/string"}},"additionalProperties":false},"mapping":{"title":"Mapping","description":"A mapping of key-value pairs (usually used for mapping a path in the data model to a query string parameter).","type":"object","properties":{},"additionalProperties":{"type":"string"}}},"required":["id","type"],"title":"PaymentDetails component schema"} \ No newline at end of file diff --git a/frontend/packages/ux-editor/src/testing/schemas/json/component/PrintButton.schema.v1.json b/frontend/packages/ux-editor/src/testing/schemas/json/component/PrintButton.schema.v1.json index 3ccba13bab8..1743435c169 100644 --- a/frontend/packages/ux-editor/src/testing/schemas/json/component/PrintButton.schema.v1.json +++ b/frontend/packages/ux-editor/src/testing/schemas/json/component/PrintButton.schema.v1.json @@ -1,65 +1 @@ -{ - "$id": "https://altinncdn.no/schemas/json/component/PrintButton.schema.v1.json", - "$schema": "http://json-schema.org/draft-07/schema#", - "properties": { - "id": { - "title": "ID", - "description": "The component ID. Must be unique within all layouts/pages in a layout-set. Cannot end with .", - "type": "string", - "pattern": "^[0-9a-zA-Z][0-9a-zA-Z-]*(-?[a-zA-Z]+|[a-zA-Z][0-9]+|-[0-9]{6,})$" - }, - "hidden": { - "title": "Hidden", - "description": "Boolean value or expression indicating if the component should be hidden. Defaults to false.", - "default": false, - "$ref": "expression.schema.v1.json#/definitions/boolean" - }, - "grid": { - "properties": { - "xs": { "$ref": "#/definitions/IGridSize" }, - "sm": { "$ref": "#/definitions/IGridSize" }, - "md": { "$ref": "#/definitions/IGridSize" }, - "lg": { "$ref": "#/definitions/IGridSize" }, - "xl": { "$ref": "#/definitions/IGridSize" }, - "labelGrid": { "$ref": "#/definitions/IGridStyling" }, - "innerGrid": { "$ref": "#/definitions/IGridStyling" } - } - }, - "pageBreak": { - "title": "Page break", - "description": "Optionally insert page-break before/after component when rendered in PDF", - "type": "object", - "properties": { - "breakBefore": { - "title": "Page break before", - "description": "PDF only: Value or expression indicating whether a page break should be added before the component. Can be either: 'auto' (default), 'always', or 'avoid'.", - "examples": ["auto", "always", "avoid"], - "default": "auto", - "$ref": "expression.schema.v1.json#/definitions/string" - }, - "breakAfter": { - "title": "Page break after", - "description": "PDF only: Value or expression indicating whether a page break should be added after the component. Can be either: 'auto' (default), 'always', or 'avoid'.", - "examples": ["auto", "always", "avoid"], - "default": "auto", - "$ref": "expression.schema.v1.json#/definitions/string" - } - }, - "additionalProperties": false - }, - "type": { "const": "PrintButton" }, - "textResourceBindings": { - "type": "object", - "properties": { - "title": { - "title": "Title", - "description": "The title/text on the button", - "$ref": "expression.schema.v1.json#/definitions/string" - } - }, - "additionalProperties": false - } - }, - "required": ["id", "type"], - "title": "PrintButton component schema" -} +{"$id":"https://altinncdn.no/schemas/json/component/PrintButton.schema.v1.json","$schema":"http://json-schema.org/draft-07/schema#","properties":{"id":{"title":"ID","description":"The component ID. Must be unique within all layouts/pages in a layout-set. Cannot end with .","type":"string","pattern":"^[0-9a-zA-Z][0-9a-zA-Z-]*(-?[a-zA-Z]+|[a-zA-Z][0-9]+|-[0-9]{6,})$"},"hidden":{"title":"Hidden","description":"Boolean value or expression indicating if the component should be hidden. Defaults to false.","default":false,"$ref":"expression.schema.v1.json#/definitions/boolean"},"grid":{"properties":{"xs":{"$ref":"#/definitions/IGridSize"},"sm":{"$ref":"#/definitions/IGridSize"},"md":{"$ref":"#/definitions/IGridSize"},"lg":{"$ref":"#/definitions/IGridSize"},"xl":{"$ref":"#/definitions/IGridSize"},"labelGrid":{"$ref":"#/definitions/IGridStyling"},"innerGrid":{"$ref":"#/definitions/IGridStyling"}}},"pageBreak":{"title":"Page break","description":"Optionally insert page-break before/after component when rendered in PDF","type":"object","properties":{"breakBefore":{"title":"Page break before","description":"PDF only: Value or expression indicating whether a page break should be added before the component. Can be either: 'auto' (default), 'always', or 'avoid'.","examples":["auto","always","avoid"],"default":"auto","$ref":"expression.schema.v1.json#/definitions/string"},"breakAfter":{"title":"Page break after","description":"PDF only: Value or expression indicating whether a page break should be added after the component. Can be either: 'auto' (default), 'always', or 'avoid'.","examples":["auto","always","avoid"],"default":"auto","$ref":"expression.schema.v1.json#/definitions/string"}},"additionalProperties":false},"type":{"const":"PrintButton"},"textResourceBindings":{"type":"object","properties":{"title":{"title":"Title","description":"The title/text on the button","$ref":"expression.schema.v1.json#/definitions/string"}},"additionalProperties":false}},"required":["id","type"],"title":"PrintButton component schema"} \ No newline at end of file diff --git a/frontend/packages/ux-editor/src/testing/schemas/json/component/RadioButtons.schema.v1.json b/frontend/packages/ux-editor/src/testing/schemas/json/component/RadioButtons.schema.v1.json index 7cf07fc5b2f..a629dcb9189 100644 --- a/frontend/packages/ux-editor/src/testing/schemas/json/component/RadioButtons.schema.v1.json +++ b/frontend/packages/ux-editor/src/testing/schemas/json/component/RadioButtons.schema.v1.json @@ -1,288 +1 @@ -{ - "$id": "https://altinncdn.no/schemas/json/component/RadioButtons.schema.v1.json", - "$schema": "http://json-schema.org/draft-07/schema#", - "properties": { - "id": { - "title": "ID", - "description": "The component ID. Must be unique within all layouts/pages in a layout-set. Cannot end with .", - "type": "string", - "pattern": "^[0-9a-zA-Z][0-9a-zA-Z-]*(-?[a-zA-Z]+|[a-zA-Z][0-9]+|-[0-9]{6,})$" - }, - "hidden": { - "title": "Hidden", - "description": "Boolean value or expression indicating if the component should be hidden. Defaults to false.", - "default": false, - "$ref": "expression.schema.v1.json#/definitions/boolean" - }, - "grid": { - "properties": { - "xs": { "$ref": "#/definitions/IGridSize" }, - "sm": { "$ref": "#/definitions/IGridSize" }, - "md": { "$ref": "#/definitions/IGridSize" }, - "lg": { "$ref": "#/definitions/IGridSize" }, - "xl": { "$ref": "#/definitions/IGridSize" }, - "labelGrid": { "$ref": "#/definitions/IGridStyling" }, - "innerGrid": { "$ref": "#/definitions/IGridStyling" } - } - }, - "pageBreak": { - "title": "Page break", - "description": "Optionally insert page-break before/after component when rendered in PDF", - "type": "object", - "properties": { - "breakBefore": { - "title": "Page break before", - "description": "PDF only: Value or expression indicating whether a page break should be added before the component. Can be either: 'auto' (default), 'always', or 'avoid'.", - "examples": ["auto", "always", "avoid"], - "default": "auto", - "$ref": "expression.schema.v1.json#/definitions/string" - }, - "breakAfter": { - "title": "Page break after", - "description": "PDF only: Value or expression indicating whether a page break should be added after the component. Can be either: 'auto' (default), 'always', or 'avoid'.", - "examples": ["auto", "always", "avoid"], - "default": "auto", - "$ref": "expression.schema.v1.json#/definitions/string" - } - }, - "additionalProperties": false - }, - "readOnly": { - "title": "Read only/disabled?", - "description": "Boolean value or expression indicating if the component should be read only/disabled. Defaults to false.
Please note that even with read-only fields in components, it may currently be possible to update the field by modifying the request sent to the API or through a direct API call.", - "default": false, - "$ref": "expression.schema.v1.json#/definitions/boolean" - }, - "required": { - "title": "Required?", - "description": "Boolean value or expression indicating if the component should be required. Defaults to false.", - "default": false, - "$ref": "expression.schema.v1.json#/definitions/boolean" - }, - "showValidations": { - "title": "Validation types", - "description": "List of validation types to show", - "type": "array", - "items": { - "enum": [ - "Schema", - "Component", - "Expression", - "CustomBackend", - "Required", - "AllExceptRequired", - "All" - ], - "type": "string" - } - }, - "renderAsSummary": { - "title": "Render as summary", - "description": "Boolean value indicating if the component should be rendered as a summary. Defaults to false.", - "default": false, - "type": "boolean" - }, - "forceShowInSummary": { - "title": "Force show in summary", - "description": "Will force show the component in a summary even if hideEmptyFields is set to true in the summary component.", - "default": false, - "$ref": "expression.schema.v1.json#/definitions/boolean" - }, - "optionsId": { - "title": "Dynamic options (fetched from server)", - "description": "ID of the option list to fetch from the server", - "type": "string" - }, - "mapping": { - "title": "Mapping", - "description": "A mapping of key-value pairs (usually used for mapping a path in the data model to a query string parameter).", - "type": "object", - "properties": {}, - "additionalProperties": { "type": "string" } - }, - "queryParameters": { - "title": "Query parameters", - "description": "A mapping of query string parameters to values. Will be appended to the URL when fetching options.", - "type": "object", - "properties": {}, - "additionalProperties": { "type": "string" } - }, - "options": { - "title": "Static options", - "description": "List of static options", - "type": "array", - "items": { - "title": "IRawOption", - "examples": [{ "label": "", "value": "" }], - "type": "object", - "properties": { - "label": { "type": "string" }, - "value": { - "anyOf": [ - { "type": "string" }, - { "type": "number" }, - { "type": "boolean" }, - { "const": null } - ] - }, - "description": { "type": "string" }, - "helpText": { "type": "string" } - }, - "required": ["label", "value"], - "additionalProperties": false - } - }, - "secure": { - "title": "Secure options (when using optionsId)", - "description": "Whether to call the secure API endpoint when fetching options from the server (allows for user/instance-specific options)", - "default": false, - "type": "boolean" - }, - "sortOrder": { - "description": "Sorts the code list in either ascending or descending order by label.", - "enum": ["asc", "desc"], - "type": "string" - }, - "source": { - "title": "Option source", - "description": "Allows for fetching options from the data model, pointing to a repeating group structure", - "type": "object", - "properties": { - "group": { - "title": "Group", - "description": "The repeating group to base options on.", - "examples": ["model.some.group"], - "type": "string" - }, - "label": { - "title": "Label", - "description": "A label of the option displayed in Radio- and Checkbox groups. Can be plain text, a text resource binding, or a dynamic expression.", - "examples": ["some.text.key"], - "$ref": "expression.schema.v1.json#/definitions/string" - }, - "value": { - "title": "Value", - "description": "Field in the group that should be used as value", - "examples": ["model.some.group[{0}].someField"], - "type": "string" - }, - "description": { - "title": "Description", - "description": "A description of the option displayed in Radio- and Checkbox groups. Can be plain text, a text resource binding, or a dynamic expression.", - "examples": ["some.text.key", "My Description"], - "$ref": "expression.schema.v1.json#/definitions/string" - }, - "helpText": { - "title": "Help Text", - "description": "A help text for the option displayed in Radio- and Checkbox groups. Can be plain text, a text resource binding, or a dynamic expression.", - "examples": ["some.text.key", "My Help Text"], - "$ref": "expression.schema.v1.json#/definitions/string" - } - }, - "required": ["group", "label", "value"], - "additionalProperties": false - }, - "preselectedOptionIndex": { - "title": "Preselected option index", - "description": "Index of the option to preselect (if no option has been selected yet)", - "type": "integer" - }, - "labelSettings": { - "title": "ILabelSettings", - "type": "object", - "properties": { - "optionalIndicator": { - "title": "Optional indicator", - "description": "Show optional indicator on label", - "type": "boolean" - } - }, - "additionalProperties": false - }, - "type": { "const": "RadioButtons" }, - "textResourceBindings": { - "properties": { - "title": { - "title": "Title", - "description": "Label text/title shown above the component", - "$ref": "expression.schema.v1.json#/definitions/string" - }, - "description": { - "title": "Description", - "description": "Label description shown above the component, below the title", - "$ref": "expression.schema.v1.json#/definitions/string" - }, - "help": { - "title": "Help text", - "description": "Help text shown in a tooltip when clicking the help button", - "$ref": "expression.schema.v1.json#/definitions/string" - }, - "tableTitle": { - "title": "Table title", - "description": "Title used in the table view (overrides the default title)", - "$ref": "expression.schema.v1.json#/definitions/string" - }, - "shortName": { - "title": "Short name (for validation)", - "description": "Alternative name used for required validation messages (overrides the default title)", - "$ref": "expression.schema.v1.json#/definitions/string" - }, - "requiredValidation": { - "title": "Required validation message", - "description": "Full validation message shown when the component is required and no value has been entered (overrides both the default and shortName)", - "$ref": "expression.schema.v1.json#/definitions/string" - }, - "summaryTitle": { - "title": "Summary title", - "description": "Title used in the summary view (overrides the default title)", - "$ref": "expression.schema.v1.json#/definitions/string" - }, - "summaryAccessibleTitle": { - "title": "Accessible summary title", - "description": "Title used for aria-label on the edit button in the summary view (overrides the default and summary title)", - "$ref": "expression.schema.v1.json#/definitions/string" - } - } - }, - "dataModelBindings": { - "title": "Data model binding", - "description": "Describes the location in the data model where the component should store its value(s). A simple binding is used for components that only store a single value, usually a string.", - "type": "object", - "properties": { - "simpleBinding": { "type": "string" }, - "label": { "type": "string" }, - "metadata": { - "description": "Describes the location where metadata for the option based component should be stored in the datamodel.", - "type": "string" - } - }, - "required": ["simpleBinding"], - "additionalProperties": false - }, - "layout": { - "title": "Layout", - "description": "Define the layout style for the options", - "enum": ["column", "row", "table"], - "type": "string" - }, - "alertOnChange": { - "title": "Alert on change", - "description": "Boolean value indicating if the component should alert on change", - "default": false, - "$ref": "expression.schema.v1.json#/definitions/boolean" - }, - "showLabelsInTable": { - "title": "Show label when single option in table", - "description": "Boolean value indicating if the label should be visible when only one option exists in table", - "default": false, - "type": "boolean" - }, - "showAsCard": { - "title": "Show as card", - "description": "Boolean value indicating if the options should be displayed as cards. Defaults to false.", - "type": "boolean" - } - }, - "required": ["id", "type", "dataModelBindings"], - "title": "RadioButtons component schema" -} +{"$id":"https://altinncdn.no/schemas/json/component/RadioButtons.schema.v1.json","$schema":"http://json-schema.org/draft-07/schema#","properties":{"id":{"title":"ID","description":"The component ID. Must be unique within all layouts/pages in a layout-set. Cannot end with .","type":"string","pattern":"^[0-9a-zA-Z][0-9a-zA-Z-]*(-?[a-zA-Z]+|[a-zA-Z][0-9]+|-[0-9]{6,})$"},"hidden":{"title":"Hidden","description":"Boolean value or expression indicating if the component should be hidden. Defaults to false.","default":false,"$ref":"expression.schema.v1.json#/definitions/boolean"},"grid":{"properties":{"xs":{"$ref":"#/definitions/IGridSize"},"sm":{"$ref":"#/definitions/IGridSize"},"md":{"$ref":"#/definitions/IGridSize"},"lg":{"$ref":"#/definitions/IGridSize"},"xl":{"$ref":"#/definitions/IGridSize"},"labelGrid":{"$ref":"#/definitions/IGridStyling"},"innerGrid":{"$ref":"#/definitions/IGridStyling"}}},"pageBreak":{"title":"Page break","description":"Optionally insert page-break before/after component when rendered in PDF","type":"object","properties":{"breakBefore":{"title":"Page break before","description":"PDF only: Value or expression indicating whether a page break should be added before the component. Can be either: 'auto' (default), 'always', or 'avoid'.","examples":["auto","always","avoid"],"default":"auto","$ref":"expression.schema.v1.json#/definitions/string"},"breakAfter":{"title":"Page break after","description":"PDF only: Value or expression indicating whether a page break should be added after the component. Can be either: 'auto' (default), 'always', or 'avoid'.","examples":["auto","always","avoid"],"default":"auto","$ref":"expression.schema.v1.json#/definitions/string"}},"additionalProperties":false},"readOnly":{"title":"Read only/disabled?","description":"Boolean value or expression indicating if the component should be read only/disabled. Defaults to false.
Please note that even with read-only fields in components, it may currently be possible to update the field by modifying the request sent to the API or through a direct API call.","default":false,"$ref":"expression.schema.v1.json#/definitions/boolean"},"required":{"title":"Required?","description":"Boolean value or expression indicating if the component should be required. Defaults to false.","default":false,"$ref":"expression.schema.v1.json#/definitions/boolean"},"showValidations":{"title":"Validation types","description":"List of validation types to show","type":"array","items":{"enum":["Schema","Component","Expression","CustomBackend","Required","AllExceptRequired","All"],"type":"string"}},"renderAsSummary":{"title":"Render as summary","description":"Boolean value indicating if the component should be rendered as a summary. Defaults to false.","default":false,"type":"boolean"},"forceShowInSummary":{"title":"Force show in summary","description":"Will force show the component in a summary even if hideEmptyFields is set to true in the summary component.","default":false,"$ref":"expression.schema.v1.json#/definitions/boolean"},"optionsId":{"title":"Dynamic options (fetched from server)","description":"ID of the option list to fetch from the server","type":"string"},"mapping":{"title":"Mapping","description":"A mapping of key-value pairs (usually used for mapping a path in the data model to a query string parameter).","type":"object","properties":{},"additionalProperties":{"type":"string"}},"queryParameters":{"title":"Query parameters","description":"A mapping of query string parameters to values. Will be appended to the URL when fetching options.","type":"object","properties":{},"additionalProperties":{"type":"string"}},"options":{"title":"Static options","description":"List of static options","type":"array","items":{"title":"IRawOption","examples":[{"label":"","value":""}],"type":"object","properties":{"label":{"type":"string"},"value":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"const":null}]},"description":{"type":"string"},"helpText":{"type":"string"}},"required":["label","value"],"additionalProperties":false}},"secure":{"title":"Secure options (when using optionsId)","description":"Whether to call the secure API endpoint when fetching options from the server (allows for user/instance-specific options)","default":false,"type":"boolean"},"sortOrder":{"description":"Sorts the code list in either ascending or descending order by label.","enum":["asc","desc"],"type":"string"},"source":{"title":"Option source","description":"Allows for fetching options from the data model, pointing to a repeating group structure","type":"object","properties":{"group":{"title":"Group","description":"The repeating group to base options on.","examples":["model.some.group"],"type":"string"},"label":{"title":"Label","description":"A label of the option displayed in Radio- and Checkbox groups. Can be plain text, a text resource binding, or a dynamic expression.","examples":["some.text.key"],"$ref":"expression.schema.v1.json#/definitions/string"},"value":{"title":"Value","description":"Field in the group that should be used as value","examples":["model.some.group[{0}].someField"],"type":"string"},"description":{"title":"Description","description":"A description of the option displayed in Radio- and Checkbox groups. Can be plain text, a text resource binding, or a dynamic expression.","examples":["some.text.key","My Description"],"$ref":"expression.schema.v1.json#/definitions/string"},"helpText":{"title":"Help Text","description":"A help text for the option displayed in Radio- and Checkbox groups. Can be plain text, a text resource binding, or a dynamic expression.","examples":["some.text.key","My Help Text"],"$ref":"expression.schema.v1.json#/definitions/string"}},"required":["group","label","value"],"additionalProperties":false},"preselectedOptionIndex":{"title":"Preselected option index","description":"Index of the option to preselect (if no option has been selected yet)","type":"integer"},"labelSettings":{"title":"ILabelSettings","type":"object","properties":{"optionalIndicator":{"title":"Optional indicator","description":"Show optional indicator on label","type":"boolean"}},"additionalProperties":false},"type":{"const":"RadioButtons"},"textResourceBindings":{"properties":{"title":{"title":"Title","description":"Label text/title shown above the component","$ref":"expression.schema.v1.json#/definitions/string"},"description":{"title":"Description","description":"Label description shown above the component, below the title","$ref":"expression.schema.v1.json#/definitions/string"},"help":{"title":"Help text","description":"Help text shown in a tooltip when clicking the help button","$ref":"expression.schema.v1.json#/definitions/string"},"tableTitle":{"title":"Table title","description":"Title used in the table view (overrides the default title)","$ref":"expression.schema.v1.json#/definitions/string"},"shortName":{"title":"Short name (for validation)","description":"Alternative name used for required validation messages (overrides the default title)","$ref":"expression.schema.v1.json#/definitions/string"},"requiredValidation":{"title":"Required validation message","description":"Full validation message shown when the component is required and no value has been entered (overrides both the default and shortName)","$ref":"expression.schema.v1.json#/definitions/string"},"summaryTitle":{"title":"Summary title","description":"Title used in the summary view (overrides the default title)","$ref":"expression.schema.v1.json#/definitions/string"},"summaryAccessibleTitle":{"title":"Accessible summary title","description":"Title used for aria-label on the edit button in the summary view (overrides the default and summary title)","$ref":"expression.schema.v1.json#/definitions/string"}}},"dataModelBindings":{"title":"Data model binding","description":"Describes the location in the data model where the component should store its value(s). A simple binding is used for components that only store a single value, usually a string.","type":"object","properties":{"simpleBinding":{"type":"string"},"label":{"type":"string"},"metadata":{"description":"Describes the location where metadata for the option based component should be stored in the datamodel.","type":"string"}},"required":["simpleBinding"],"additionalProperties":false},"layout":{"title":"Layout","description":"Define the layout style for the options","enum":["column","row","table"],"type":"string"},"alertOnChange":{"title":"Alert on change","description":"Boolean value indicating if the component should alert on change","default":false,"$ref":"expression.schema.v1.json#/definitions/boolean"},"showLabelsInTable":{"title":"Show label when single option in table","description":"Boolean value indicating if the label should be visible when only one option exists in table","default":false,"type":"boolean"},"showAsCard":{"title":"Show as card","description":"Boolean value indicating if the options should be displayed as cards. Defaults to false.","type":"boolean"}},"required":["id","type","dataModelBindings"],"title":"RadioButtons component schema"} \ No newline at end of file diff --git a/frontend/packages/ux-editor/src/testing/schemas/json/component/RepeatingGroup.schema.v1.json b/frontend/packages/ux-editor/src/testing/schemas/json/component/RepeatingGroup.schema.v1.json index 7c418c41ca8..47cf0e2c4fa 100644 --- a/frontend/packages/ux-editor/src/testing/schemas/json/component/RepeatingGroup.schema.v1.json +++ b/frontend/packages/ux-editor/src/testing/schemas/json/component/RepeatingGroup.schema.v1.json @@ -1,367 +1 @@ -{ - "$id": "https://altinncdn.no/schemas/json/component/RepeatingGroup.schema.v1.json", - "$schema": "http://json-schema.org/draft-07/schema#", - "properties": { - "id": { - "title": "ID", - "description": "The component ID. Must be unique within all layouts/pages in a layout-set. Cannot end with .", - "type": "string", - "pattern": "^[0-9a-zA-Z][0-9a-zA-Z-]*(-?[a-zA-Z]+|[a-zA-Z][0-9]+|-[0-9]{6,})$" - }, - "hidden": { - "title": "Hidden", - "description": "Boolean value or expression indicating if the component should be hidden. Defaults to false.", - "default": false, - "$ref": "expression.schema.v1.json#/definitions/boolean" - }, - "grid": { - "properties": { - "xs": { "$ref": "#/definitions/IGridSize" }, - "sm": { "$ref": "#/definitions/IGridSize" }, - "md": { "$ref": "#/definitions/IGridSize" }, - "lg": { "$ref": "#/definitions/IGridSize" }, - "xl": { "$ref": "#/definitions/IGridSize" }, - "labelGrid": { "$ref": "#/definitions/IGridStyling" }, - "innerGrid": { "$ref": "#/definitions/IGridStyling" } - } - }, - "pageBreak": { - "title": "Page break", - "description": "Optionally insert page-break before/after component when rendered in PDF", - "type": "object", - "properties": { - "breakBefore": { - "title": "Page break before", - "description": "PDF only: Value or expression indicating whether a page break should be added before the component. Can be either: 'auto' (default), 'always', or 'avoid'.", - "examples": ["auto", "always", "avoid"], - "default": "auto", - "$ref": "expression.schema.v1.json#/definitions/string" - }, - "breakAfter": { - "title": "Page break after", - "description": "PDF only: Value or expression indicating whether a page break should be added after the component. Can be either: 'auto' (default), 'always', or 'avoid'.", - "examples": ["auto", "always", "avoid"], - "default": "auto", - "$ref": "expression.schema.v1.json#/definitions/string" - } - }, - "additionalProperties": false - }, - "renderAsSummary": { - "title": "Render as summary", - "description": "Boolean value indicating if the component should be rendered as a summary. Defaults to false.", - "default": false, - "type": "boolean" - }, - "forceShowInSummary": { - "title": "Force show in summary", - "description": "Will force show the component in a summary even if hideEmptyFields is set to true in the summary component.", - "default": false, - "$ref": "expression.schema.v1.json#/definitions/boolean" - }, - "type": { "const": "RepeatingGroup" }, - "textResourceBindings": { - "properties": { - "title": { - "title": "Title", - "description": "The title of the group (shown above each instance in a Summary)", - "$ref": "expression.schema.v1.json#/definitions/string" - }, - "description": { - "title": "Description", - "description": "The description text shown underneath the title", - "$ref": "expression.schema.v1.json#/definitions/string" - }, - "summaryTitle": { - "title": "Summary title", - "description": "Title used in the summary view (overrides the default title)", - "$ref": "expression.schema.v1.json#/definitions/string" - }, - "summaryAccessibleTitle": { - "title": "Accessible summary title", - "description": "Title used for aria-label on the edit button in the summary view (overrides the default and summary title)", - "$ref": "expression.schema.v1.json#/definitions/string" - }, - "add_button_full": { - "title": "Add button (full) (for repeating groups)", - "description": "The text for the \"Add\" button (overrides \"add_button\", and sets the full text for the button)", - "$ref": "expression.schema.v1.json#/definitions/string" - }, - "add_button": { - "title": "Add button (suffix) (for repeating groups)", - "description": "The text for the \"Add\" button (used as a suffix after the default button text)", - "$ref": "expression.schema.v1.json#/definitions/string" - }, - "save_button": { - "title": "Save button (for repeating groups)", - "description": "The text for the \"Save\" button when the repeating group item is in edit mode", - "$ref": "expression.schema.v1.json#/definitions/string" - }, - "save_and_next_button": { - "title": "Save and next button (for repeating groups)", - "description": "The text for the \"Save and next\" button when the repeating group item is in edit mode (only displayed if edit.saveAndNextButton is true)", - "$ref": "expression.schema.v1.json#/definitions/string" - }, - "edit_button_close": { - "title": "Edit button (close) (for repeating groups)", - "description": "The text for the \"Edit\" button when the repeating group item is in edit mode (i.e. the user can close the edit mode)", - "$ref": "expression.schema.v1.json#/definitions/string" - }, - "edit_button_open": { - "title": "Edit button (open) (for repeating groups)", - "description": "The text for the \"Edit\" button when the repeating group item is not in edit mode (i.e. the user can open the edit mode)", - "$ref": "expression.schema.v1.json#/definitions/string" - }, - "pagination_next_button": { - "title": "Next button in pagination", - "description": "The text for the \"Next\" button in pagination", - "$ref": "expression.schema.v1.json#/definitions/string" - }, - "pagination_back_button": { - "title": "Back button in pagination", - "description": "The text for the \"Back\" button in pagination", - "$ref": "expression.schema.v1.json#/definitions/string" - } - } - }, - "children": { - "title": "Children", - "description": "List of child component IDs to show inside (will be repeated according to the number of rows in the data model binding)", - "type": "array", - "items": { "type": "string" } - }, - "rowsBefore": { - "title": "Rows in Grid or Grid-like component", - "description": "The list of rows in this grid", - "examples": [ - [ - { - "header": false, - "readOnly": false, - "cells": [{ "text": "hello.world" }, { "component": "myOtherComponent" }] - } - ] - ], - "type": "array", - "items": { - "title": "GridRow", - "type": "object", - "properties": { - "header": { "title": "Is header row?", "default": false, "type": "boolean" }, - "readOnly": { "title": "Is row read-only?", "default": false, "type": "boolean" }, - "columnOptions": { "$ref": "#/definitions/ITableColumnProperties" }, - "cells": { - "title": "Cells in table row", - "description": "The list of cells in this row", - "type": "array", - "items": { "$ref": "#/definitions/GridCell" } - } - }, - "required": ["cells"], - "additionalProperties": false - } - }, - "rowsAfter": { - "title": "Rows in Grid or Grid-like component", - "description": "The list of rows in this grid", - "examples": [ - [ - { - "header": false, - "readOnly": false, - "cells": [{ "text": "hello.world" }, { "component": "myOtherComponent" }] - } - ] - ], - "type": "array", - "items": { - "title": "GridRow", - "type": "object", - "properties": { - "header": { "title": "Is header row?", "default": false, "type": "boolean" }, - "readOnly": { "title": "Is row read-only?", "default": false, "type": "boolean" }, - "columnOptions": { "$ref": "#/definitions/ITableColumnProperties" }, - "cells": { - "title": "Cells in table row", - "description": "The list of cells in this row", - "type": "array", - "items": { "$ref": "#/definitions/GridCell" } - } - }, - "required": ["cells"], - "additionalProperties": false - } - }, - "dataModelBindings": { - "title": "IDataModelBindingsForGroup", - "type": "object", - "properties": { - "group": { - "title": "Group", - "description": "Dot notation location for a repeating group structure (array of objects), where the data is stored", - "type": "string" - } - }, - "required": ["group"], - "additionalProperties": false - }, - "showValidations": { - "title": "Validation types", - "description": "List of validation types to show", - "type": "array", - "items": { - "enum": [ - "Schema", - "Component", - "Expression", - "CustomBackend", - "Required", - "AllExceptRequired", - "All" - ], - "type": "string" - } - }, - "validateOnSaveRow": { - "title": "Validation types", - "description": "List of validation types to show", - "type": "array", - "items": { - "enum": [ - "Schema", - "Component", - "Expression", - "CustomBackend", - "Required", - "AllExceptRequired", - "All" - ], - "type": "string" - } - }, - "edit": { - "title": "IGroupEditProperties", - "type": "object", - "properties": { - "mode": { - "title": "Mode", - "description": "The mode of the repeating group", - "default": "showTable", - "enum": ["hideTable", "showTable", "showAll", "onlyTable"] - }, - "addButton": { - "title": "Add button", - "description": "Expression or boolean indicating whether to show the \"Add\" button", - "default": true, - "$ref": "expression.schema.v1.json#/definitions/boolean" - }, - "saveButton": { - "title": "Save button", - "description": "Expression or boolean indicating whether to show the \"Save\" button", - "default": true, - "$ref": "expression.schema.v1.json#/definitions/boolean" - }, - "deleteButton": { - "title": "Delete button", - "description": "Expression or boolean indicating whether to show the \"Delete\" button", - "default": true, - "$ref": "expression.schema.v1.json#/definitions/boolean" - }, - "editButton": { - "title": "Edit button", - "description": "Expression or boolean indicating whether to show the \"Edit\" button", - "default": true, - "$ref": "expression.schema.v1.json#/definitions/boolean" - }, - "multiPage": { - "title": "Multi page functionality", - "description": "Turning this on makes it possible to display the edit mode for a repeating group with multiple inner pages. Every component referenced in the \"children\" property should have a prefix with the page number it should be displayed on (e.g. \"1:component1\", \"2:component2\", etc.)", - "default": false, - "type": "boolean" - }, - "openByDefault": { - "title": "Open by default", - "description": "If set to true, a row of the repeating group will be opened by default, if the group has no rows already. If set to \"first\" or \"last\", the first or last row will be opened by default", - "default": false, - "anyOf": [{ "type": "boolean" }, { "const": "first" }, { "const": "last" }] - }, - "alertOnDelete": { - "title": "Alert on delete", - "description": "Expression or boolean indicating whether to show an alert when the user clicks the \"Delete\" button, prompting them to confirm the deletion", - "default": false, - "$ref": "expression.schema.v1.json#/definitions/boolean" - }, - "saveAndNextButton": { - "title": "Save and next button", - "description": "Expression or boolean indicating whether to show the \"Save and next\" button when editing a repeating group row. This button will save the current row and open the next row for editing.", - "default": false, - "$ref": "expression.schema.v1.json#/definitions/boolean" - }, - "alwaysShowAddButton": { - "title": "Always show add button", - "description": "If set to true, the \"Add\" button will always be shown, even if the user is currently editing another row", - "default": false, - "type": "boolean" - } - }, - "additionalProperties": false - }, - "pagination": { - "title": "Pagination options", - "description": "Pagination options for the repeating group rows.", - "type": "object", - "properties": { "rowsPerPage": { "type": "integer", "minimum": 1 } }, - "required": ["rowsPerPage"], - "additionalProperties": false - }, - "maxCount": { - "title": "Max number of rows", - "description": "Maximum number of rows that can be added.", - "type": "integer", - "minimum": 2 - }, - "minCount": { - "title": "Min number of rows", - "description": "Minimum number of rows that should be added. If the user has not added enough rows, the repeating group will show a validation error", - "type": "integer" - }, - "tableHeaders": { - "title": "Table headers", - "description": "Array of component IDs that should be displayed as table headers. If not defined, all components referenced in the \"children\" property will be displayed as table headers", - "type": "array", - "items": { "type": "string" } - }, - "tableColumns": { - "examples": [{ "childComponent1": { "width": "auto" } }], - "type": "object", - "properties": {}, - "additionalProperties": { "$ref": "#/definitions/IGroupColumnFormatting" } - }, - "hiddenRow": { - "title": "Hidden row?", - "description": "Expression or boolean indicating whether each row should be hidden. An expression will be evaluated per row, and if it evaluates to true, the row will be hidden. If set to true, all rows will be hidden.", - "default": false, - "$ref": "expression.schema.v1.json#/definitions/boolean" - }, - "stickyHeader": { - "title": "Sticky header", - "description": "If set to true, the header of the repeating group will be sticky", - "default": false, - "type": "boolean" - }, - "labelSettings": { - "title": "ILabelSettings", - "type": "object", - "properties": { - "optionalIndicator": { - "title": "Optional indicator", - "description": "Show optional indicator on label", - "type": "boolean" - } - }, - "additionalProperties": false - } - }, - "required": ["id", "type", "children", "dataModelBindings"], - "title": "RepeatingGroup component schema" -} +{"$id":"https://altinncdn.no/schemas/json/component/RepeatingGroup.schema.v1.json","$schema":"http://json-schema.org/draft-07/schema#","properties":{"id":{"title":"ID","description":"The component ID. Must be unique within all layouts/pages in a layout-set. Cannot end with .","type":"string","pattern":"^[0-9a-zA-Z][0-9a-zA-Z-]*(-?[a-zA-Z]+|[a-zA-Z][0-9]+|-[0-9]{6,})$"},"hidden":{"title":"Hidden","description":"Boolean value or expression indicating if the component should be hidden. Defaults to false.","default":false,"$ref":"expression.schema.v1.json#/definitions/boolean"},"grid":{"properties":{"xs":{"$ref":"#/definitions/IGridSize"},"sm":{"$ref":"#/definitions/IGridSize"},"md":{"$ref":"#/definitions/IGridSize"},"lg":{"$ref":"#/definitions/IGridSize"},"xl":{"$ref":"#/definitions/IGridSize"},"labelGrid":{"$ref":"#/definitions/IGridStyling"},"innerGrid":{"$ref":"#/definitions/IGridStyling"}}},"pageBreak":{"title":"Page break","description":"Optionally insert page-break before/after component when rendered in PDF","type":"object","properties":{"breakBefore":{"title":"Page break before","description":"PDF only: Value or expression indicating whether a page break should be added before the component. Can be either: 'auto' (default), 'always', or 'avoid'.","examples":["auto","always","avoid"],"default":"auto","$ref":"expression.schema.v1.json#/definitions/string"},"breakAfter":{"title":"Page break after","description":"PDF only: Value or expression indicating whether a page break should be added after the component. Can be either: 'auto' (default), 'always', or 'avoid'.","examples":["auto","always","avoid"],"default":"auto","$ref":"expression.schema.v1.json#/definitions/string"}},"additionalProperties":false},"renderAsSummary":{"title":"Render as summary","description":"Boolean value indicating if the component should be rendered as a summary. Defaults to false.","default":false,"type":"boolean"},"forceShowInSummary":{"title":"Force show in summary","description":"Will force show the component in a summary even if hideEmptyFields is set to true in the summary component.","default":false,"$ref":"expression.schema.v1.json#/definitions/boolean"},"type":{"const":"RepeatingGroup"},"textResourceBindings":{"properties":{"title":{"title":"Title","description":"The title of the group (shown above each instance in a Summary)","$ref":"expression.schema.v1.json#/definitions/string"},"description":{"title":"Description","description":"The description text shown underneath the title","$ref":"expression.schema.v1.json#/definitions/string"},"summaryTitle":{"title":"Summary title","description":"Title used in the summary view (overrides the default title)","$ref":"expression.schema.v1.json#/definitions/string"},"summaryAccessibleTitle":{"title":"Accessible summary title","description":"Title used for aria-label on the edit button in the summary view (overrides the default and summary title)","$ref":"expression.schema.v1.json#/definitions/string"},"add_button_full":{"title":"Add button (full) (for repeating groups)","description":"The text for the \"Add\" button (overrides \"add_button\", and sets the full text for the button)","$ref":"expression.schema.v1.json#/definitions/string"},"add_button":{"title":"Add button (suffix) (for repeating groups)","description":"The text for the \"Add\" button (used as a suffix after the default button text)","$ref":"expression.schema.v1.json#/definitions/string"},"save_button":{"title":"Save button (for repeating groups)","description":"The text for the \"Save\" button when the repeating group item is in edit mode","$ref":"expression.schema.v1.json#/definitions/string"},"save_and_next_button":{"title":"Save and next button (for repeating groups)","description":"The text for the \"Save and next\" button when the repeating group item is in edit mode (only displayed if edit.saveAndNextButton is true)","$ref":"expression.schema.v1.json#/definitions/string"},"edit_button_close":{"title":"Edit button (close) (for repeating groups)","description":"The text for the \"Edit\" button when the repeating group item is in edit mode (i.e. the user can close the edit mode)","$ref":"expression.schema.v1.json#/definitions/string"},"edit_button_open":{"title":"Edit button (open) (for repeating groups)","description":"The text for the \"Edit\" button when the repeating group item is not in edit mode (i.e. the user can open the edit mode)","$ref":"expression.schema.v1.json#/definitions/string"},"pagination_next_button":{"title":"Next button in pagination","description":"The text for the \"Next\" button in pagination","$ref":"expression.schema.v1.json#/definitions/string"},"pagination_back_button":{"title":"Back button in pagination","description":"The text for the \"Back\" button in pagination","$ref":"expression.schema.v1.json#/definitions/string"}}},"children":{"title":"Children","description":"List of child component IDs to show inside (will be repeated according to the number of rows in the data model binding)","type":"array","items":{"type":"string"}},"rowsBefore":{"title":"Rows in Grid or Grid-like component","description":"The list of rows in this grid","examples":[[{"header":false,"readOnly":false,"cells":[{"text":"hello.world"},{"component":"myOtherComponent"}]}]],"type":"array","items":{"title":"GridRow","type":"object","properties":{"header":{"title":"Is header row?","default":false,"type":"boolean"},"readOnly":{"title":"Is row read-only?","default":false,"type":"boolean"},"columnOptions":{"$ref":"#/definitions/ITableColumnProperties"},"cells":{"title":"Cells in table row","description":"The list of cells in this row","type":"array","items":{"$ref":"#/definitions/GridCell"}}},"required":["cells"],"additionalProperties":false}},"rowsAfter":{"title":"Rows in Grid or Grid-like component","description":"The list of rows in this grid","examples":[[{"header":false,"readOnly":false,"cells":[{"text":"hello.world"},{"component":"myOtherComponent"}]}]],"type":"array","items":{"title":"GridRow","type":"object","properties":{"header":{"title":"Is header row?","default":false,"type":"boolean"},"readOnly":{"title":"Is row read-only?","default":false,"type":"boolean"},"columnOptions":{"$ref":"#/definitions/ITableColumnProperties"},"cells":{"title":"Cells in table row","description":"The list of cells in this row","type":"array","items":{"$ref":"#/definitions/GridCell"}}},"required":["cells"],"additionalProperties":false}},"dataModelBindings":{"title":"IDataModelBindingsForGroup","type":"object","properties":{"group":{"title":"Group","description":"Dot notation location for a repeating group structure (array of objects), where the data is stored","type":"string"}},"required":["group"],"additionalProperties":false},"showValidations":{"title":"Validation types","description":"List of validation types to show","type":"array","items":{"enum":["Schema","Component","Expression","CustomBackend","Required","AllExceptRequired","All"],"type":"string"}},"validateOnSaveRow":{"title":"Validation types","description":"List of validation types to show","type":"array","items":{"enum":["Schema","Component","Expression","CustomBackend","Required","AllExceptRequired","All"],"type":"string"}},"edit":{"title":"IGroupEditProperties","type":"object","properties":{"mode":{"title":"Mode","description":"The mode of the repeating group","default":"showTable","enum":["hideTable","showTable","showAll","onlyTable"]},"addButton":{"title":"Add button","description":"Expression or boolean indicating whether to show the \"Add\" button","default":true,"$ref":"expression.schema.v1.json#/definitions/boolean"},"saveButton":{"title":"Save button","description":"Expression or boolean indicating whether to show the \"Save\" button","default":true,"$ref":"expression.schema.v1.json#/definitions/boolean"},"deleteButton":{"title":"Delete button","description":"Expression or boolean indicating whether to show the \"Delete\" button","default":true,"$ref":"expression.schema.v1.json#/definitions/boolean"},"editButton":{"title":"Edit button","description":"Expression or boolean indicating whether to show the \"Edit\" button","default":true,"$ref":"expression.schema.v1.json#/definitions/boolean"},"multiPage":{"title":"Multi page functionality","description":"Turning this on makes it possible to display the edit mode for a repeating group with multiple inner pages. Every component referenced in the \"children\" property should have a prefix with the page number it should be displayed on (e.g. \"1:component1\", \"2:component2\", etc.)","default":false,"type":"boolean"},"openByDefault":{"title":"Open by default","description":"If set to true, a row of the repeating group will be opened by default, if the group has no rows already. If set to \"first\" or \"last\", the first or last row will be opened by default","default":false,"anyOf":[{"type":"boolean"},{"const":"first"},{"const":"last"}]},"alertOnDelete":{"title":"Alert on delete","description":"Expression or boolean indicating whether to show an alert when the user clicks the \"Delete\" button, prompting them to confirm the deletion","default":false,"$ref":"expression.schema.v1.json#/definitions/boolean"},"saveAndNextButton":{"title":"Save and next button","description":"Expression or boolean indicating whether to show the \"Save and next\" button when editing a repeating group row. This button will save the current row and open the next row for editing.","default":false,"$ref":"expression.schema.v1.json#/definitions/boolean"},"alwaysShowAddButton":{"title":"Always show add button","description":"If set to true, the \"Add\" button will always be shown, even if the user is currently editing another row","default":false,"type":"boolean"}},"additionalProperties":false},"pagination":{"title":"Pagination options","description":"Pagination options for the repeating group rows.","type":"object","properties":{"rowsPerPage":{"type":"integer","minimum":1}},"required":["rowsPerPage"],"additionalProperties":false},"maxCount":{"title":"Max number of rows","description":"Maximum number of rows that can be added.","type":"integer","minimum":2},"minCount":{"title":"Min number of rows","description":"Minimum number of rows that should be added. If the user has not added enough rows, the repeating group will show a validation error","type":"integer"},"tableHeaders":{"title":"Table headers","description":"Array of component IDs that should be displayed as table headers. If not defined, all components referenced in the \"children\" property will be displayed as table headers","type":"array","items":{"type":"string"}},"tableColumns":{"examples":[{"childComponent1":{"width":"auto"}}],"type":"object","properties":{},"additionalProperties":{"$ref":"#/definitions/IGroupColumnFormatting"}},"hiddenRow":{"title":"Hidden row?","description":"Expression or boolean indicating whether each row should be hidden. An expression will be evaluated per row, and if it evaluates to true, the row will be hidden. If set to true, all rows will be hidden.","default":false,"$ref":"expression.schema.v1.json#/definitions/boolean"},"stickyHeader":{"title":"Sticky header","description":"If set to true, the header of the repeating group will be sticky","default":false,"type":"boolean"},"labelSettings":{"title":"ILabelSettings","type":"object","properties":{"optionalIndicator":{"title":"Optional indicator","description":"Show optional indicator on label","type":"boolean"}},"additionalProperties":false}},"required":["id","type","children","dataModelBindings"],"title":"RepeatingGroup component schema"} \ No newline at end of file diff --git a/frontend/packages/ux-editor/src/testing/schemas/json/component/Summary.schema.v1.json b/frontend/packages/ux-editor/src/testing/schemas/json/component/Summary.schema.v1.json index 477470c732f..87f9fb8b2fc 100644 --- a/frontend/packages/ux-editor/src/testing/schemas/json/component/Summary.schema.v1.json +++ b/frontend/packages/ux-editor/src/testing/schemas/json/component/Summary.schema.v1.json @@ -1,120 +1 @@ -{ - "$id": "https://altinncdn.no/schemas/json/component/Summary.schema.v1.json", - "$schema": "http://json-schema.org/draft-07/schema#", - "properties": { - "id": { - "title": "ID", - "description": "The component ID. Must be unique within all layouts/pages in a layout-set. Cannot end with .", - "type": "string", - "pattern": "^[0-9a-zA-Z][0-9a-zA-Z-]*(-?[a-zA-Z]+|[a-zA-Z][0-9]+|-[0-9]{6,})$" - }, - "hidden": { - "title": "Hidden", - "description": "Boolean value or expression indicating if the component should be hidden. Defaults to false.", - "default": false, - "$ref": "expression.schema.v1.json#/definitions/boolean" - }, - "grid": { - "properties": { - "xs": { "$ref": "#/definitions/IGridSize" }, - "sm": { "$ref": "#/definitions/IGridSize" }, - "md": { "$ref": "#/definitions/IGridSize" }, - "lg": { "$ref": "#/definitions/IGridSize" }, - "xl": { "$ref": "#/definitions/IGridSize" }, - "labelGrid": { "$ref": "#/definitions/IGridStyling" }, - "innerGrid": { "$ref": "#/definitions/IGridStyling" } - } - }, - "pageBreak": { - "title": "Page break", - "description": "Optionally insert page-break before/after component when rendered in PDF", - "type": "object", - "properties": { - "breakBefore": { - "title": "Page break before", - "description": "PDF only: Value or expression indicating whether a page break should be added before the component. Can be either: 'auto' (default), 'always', or 'avoid'.", - "examples": ["auto", "always", "avoid"], - "default": "auto", - "$ref": "expression.schema.v1.json#/definitions/string" - }, - "breakAfter": { - "title": "Page break after", - "description": "PDF only: Value or expression indicating whether a page break should be added after the component. Can be either: 'auto' (default), 'always', or 'avoid'.", - "examples": ["auto", "always", "avoid"], - "default": "auto", - "$ref": "expression.schema.v1.json#/definitions/string" - } - }, - "additionalProperties": false - }, - "type": { "const": "Summary" }, - "componentRef": { - "title": "Component reference", - "description": "String value indicating which layout component (by ID) the summary is for.", - "type": "string" - }, - "largeGroup": { - "title": "Large group", - "description": "Boolean value indicating if summary of repeating group should be displayed in large format. Useful for displaying summary with nested groups.", - "default": false, - "type": "boolean" - }, - "excludedChildren": { - "title": "Excluded child components", - "description": "Array of component IDs that should not be shown in a repeating group's summary", - "type": "array", - "items": { "type": "string" } - }, - "textResourceBindings": { - "type": "object", - "properties": { - "returnToSummaryButtonTitle": { - "title": "ReturnToSummaryButtonTitle", - "description": "Used to specify the text on the NavigationButtons component that should be used after clicking \"Change\" on the summary component", - "$ref": "expression.schema.v1.json#/definitions/string" - } - }, - "additionalProperties": false - }, - "display": { - "title": "Display properties", - "description": "Optional properties to configure how summary is displayed", - "type": "object", - "properties": { - "hideChangeButton": { - "title": "Hide change button", - "description": "Set to true if the change button should be hidden for the summary component. False by default.", - "default": false, - "type": "boolean" - }, - "hideValidationMessages": { - "title": "Hide validation messages", - "description": "Set to true if the validation messages should be hidden for the component when shown in Summary. False by default.", - "default": false, - "type": "boolean" - }, - "useComponentGrid": { - "title": "Use component grid", - "description": "Set to true to allow summary component to use the grid setup of the referenced component. For group summary, this will apply for all group child components.", - "default": false, - "type": "boolean" - }, - "hideBottomBorder": { - "title": "Hide bottom border", - "description": "Set to true to hide the blue dashed border below the summary component. False by default.", - "default": false, - "type": "boolean" - }, - "nextButton": { - "title": "Display the next button", - "description": "Set to to true display a \"next\" button as well as the return to summary button", - "default": false, - "type": "boolean" - } - }, - "additionalProperties": false - } - }, - "required": ["id", "type", "componentRef"], - "title": "Summary component schema" -} +{"$id":"https://altinncdn.no/schemas/json/component/Summary.schema.v1.json","$schema":"http://json-schema.org/draft-07/schema#","properties":{"id":{"title":"ID","description":"The component ID. Must be unique within all layouts/pages in a layout-set. Cannot end with .","type":"string","pattern":"^[0-9a-zA-Z][0-9a-zA-Z-]*(-?[a-zA-Z]+|[a-zA-Z][0-9]+|-[0-9]{6,})$"},"hidden":{"title":"Hidden","description":"Boolean value or expression indicating if the component should be hidden. Defaults to false.","default":false,"$ref":"expression.schema.v1.json#/definitions/boolean"},"grid":{"properties":{"xs":{"$ref":"#/definitions/IGridSize"},"sm":{"$ref":"#/definitions/IGridSize"},"md":{"$ref":"#/definitions/IGridSize"},"lg":{"$ref":"#/definitions/IGridSize"},"xl":{"$ref":"#/definitions/IGridSize"},"labelGrid":{"$ref":"#/definitions/IGridStyling"},"innerGrid":{"$ref":"#/definitions/IGridStyling"}}},"pageBreak":{"title":"Page break","description":"Optionally insert page-break before/after component when rendered in PDF","type":"object","properties":{"breakBefore":{"title":"Page break before","description":"PDF only: Value or expression indicating whether a page break should be added before the component. Can be either: 'auto' (default), 'always', or 'avoid'.","examples":["auto","always","avoid"],"default":"auto","$ref":"expression.schema.v1.json#/definitions/string"},"breakAfter":{"title":"Page break after","description":"PDF only: Value or expression indicating whether a page break should be added after the component. Can be either: 'auto' (default), 'always', or 'avoid'.","examples":["auto","always","avoid"],"default":"auto","$ref":"expression.schema.v1.json#/definitions/string"}},"additionalProperties":false},"type":{"const":"Summary"},"componentRef":{"title":"Component reference","description":"String value indicating which layout component (by ID) the summary is for.","type":"string"},"largeGroup":{"title":"Large group","description":"Boolean value indicating if summary of repeating group should be displayed in large format. Useful for displaying summary with nested groups.","default":false,"type":"boolean"},"excludedChildren":{"title":"Excluded child components","description":"Array of component IDs that should not be shown in a repeating group's summary","type":"array","items":{"type":"string"}},"textResourceBindings":{"type":"object","properties":{"returnToSummaryButtonTitle":{"title":"ReturnToSummaryButtonTitle","description":"Used to specify the text on the NavigationButtons component that should be used after clicking \"Change\" on the summary component","$ref":"expression.schema.v1.json#/definitions/string"}},"additionalProperties":false},"display":{"title":"Display properties","description":"Optional properties to configure how summary is displayed","type":"object","properties":{"hideChangeButton":{"title":"Hide change button","description":"Set to true if the change button should be hidden for the summary component. False by default.","default":false,"type":"boolean"},"hideValidationMessages":{"title":"Hide validation messages","description":"Set to true if the validation messages should be hidden for the component when shown in Summary. False by default.","default":false,"type":"boolean"},"useComponentGrid":{"title":"Use component grid","description":"Set to true to allow summary component to use the grid setup of the referenced component. For group summary, this will apply for all group child components.","default":false,"type":"boolean"},"hideBottomBorder":{"title":"Hide bottom border","description":"Set to true to hide the blue dashed border below the summary component. False by default.","default":false,"type":"boolean"},"nextButton":{"title":"Display the next button","description":"Set to to true display a \"next\" button as well as the return to summary button","default":false,"type":"boolean"}},"additionalProperties":false}},"required":["id","type","componentRef"],"title":"Summary component schema"} \ No newline at end of file diff --git a/frontend/packages/ux-editor/src/testing/schemas/json/component/Summary2.schema.v1.json b/frontend/packages/ux-editor/src/testing/schemas/json/component/Summary2.schema.v1.json index db4b17c3875..cce48d5418e 100644 --- a/frontend/packages/ux-editor/src/testing/schemas/json/component/Summary2.schema.v1.json +++ b/frontend/packages/ux-editor/src/testing/schemas/json/component/Summary2.schema.v1.json @@ -1,95 +1 @@ -{ - "$id": "https://altinncdn.no/schemas/json/component/Summary2.schema.v1.json", - "$schema": "http://json-schema.org/draft-07/schema#", - "properties": { - "id": { - "title": "ID", - "description": "The component ID. Must be unique within all layouts/pages in a layout-set. Cannot end with .", - "type": "string", - "pattern": "^[0-9a-zA-Z][0-9a-zA-Z-]*(-?[a-zA-Z]+|[a-zA-Z][0-9]+|-[0-9]{6,})$" - }, - "hidden": { - "title": "Hidden", - "description": "Boolean value or expression indicating if the component should be hidden. Defaults to false.", - "default": false, - "$ref": "expression.schema.v1.json#/definitions/boolean" - }, - "grid": { - "properties": { - "xs": { "$ref": "#/definitions/IGridSize" }, - "sm": { "$ref": "#/definitions/IGridSize" }, - "md": { "$ref": "#/definitions/IGridSize" }, - "lg": { "$ref": "#/definitions/IGridSize" }, - "xl": { "$ref": "#/definitions/IGridSize" }, - "labelGrid": { "$ref": "#/definitions/IGridStyling" }, - "innerGrid": { "$ref": "#/definitions/IGridStyling" } - } - }, - "pageBreak": { - "title": "Page break", - "description": "Optionally insert page-break before/after component when rendered in PDF", - "type": "object", - "properties": { - "breakBefore": { - "title": "Page break before", - "description": "PDF only: Value or expression indicating whether a page break should be added before the component. Can be either: 'auto' (default), 'always', or 'avoid'.", - "examples": ["auto", "always", "avoid"], - "default": "auto", - "$ref": "expression.schema.v1.json#/definitions/string" - }, - "breakAfter": { - "title": "Page break after", - "description": "PDF only: Value or expression indicating whether a page break should be added after the component. Can be either: 'auto' (default), 'always', or 'avoid'.", - "examples": ["auto", "always", "avoid"], - "default": "auto", - "$ref": "expression.schema.v1.json#/definitions/string" - } - }, - "additionalProperties": false - }, - "type": { "const": "Summary2" }, - "target": { - "description": "Config for what should be rendered. If you set taskId, this property is optional.", - "type": "object", - "properties": { - "type": { - "title": "Mode", - "default": "component", - "enum": ["page", "layoutSet", "component"] - }, - "id": { "type": "string" }, - "taskId": { - "title": "Task ID", - "description": "Use this if you want to render something from another task.", - "type": "string" - } - }, - "additionalProperties": false - }, - "showPageInAccordion": { "type": "boolean" }, - "hideEmptyFields": { - "description": "Set this to true if you don't want to show fields that have not been filled out.", - "type": "boolean" - }, - "overrides": { - "type": "array", - "items": { - "title": "AnySummaryOverrideProps", - "anyOf": [ - { "$ref": "#/definitions/InputSummaryOverrideProps" }, - { "$ref": "#/definitions/CheckboxSummaryOverrideProps" }, - { "$ref": "#/definitions/RadioSummaryOverrideProps" }, - { "$ref": "#/definitions/DropdownSummaryOverrideProps" }, - { "$ref": "#/definitions/MultipleSelectSummaryOverrideProps" }, - { "$ref": "#/definitions/GroupSummaryOverrideProps" }, - { "$ref": "#/definitions/TextAreaSummaryOverrideProps" }, - { "$ref": "#/definitions/RepeatingGroupSummaryOverrideProps" }, - { "$ref": "#/definitions/DatepickerSummaryOverrideProps" }, - { "$ref": "#/definitions/ListSummaryOverrideProps" } - ] - } - } - }, - "required": ["id", "type"], - "title": "Summary2 component schema" -} +{"$id":"https://altinncdn.no/schemas/json/component/Summary2.schema.v1.json","$schema":"http://json-schema.org/draft-07/schema#","properties":{"id":{"title":"ID","description":"The component ID. Must be unique within all layouts/pages in a layout-set. Cannot end with .","type":"string","pattern":"^[0-9a-zA-Z][0-9a-zA-Z-]*(-?[a-zA-Z]+|[a-zA-Z][0-9]+|-[0-9]{6,})$"},"hidden":{"title":"Hidden","description":"Boolean value or expression indicating if the component should be hidden. Defaults to false.","default":false,"$ref":"expression.schema.v1.json#/definitions/boolean"},"grid":{"properties":{"xs":{"$ref":"#/definitions/IGridSize"},"sm":{"$ref":"#/definitions/IGridSize"},"md":{"$ref":"#/definitions/IGridSize"},"lg":{"$ref":"#/definitions/IGridSize"},"xl":{"$ref":"#/definitions/IGridSize"},"labelGrid":{"$ref":"#/definitions/IGridStyling"},"innerGrid":{"$ref":"#/definitions/IGridStyling"}}},"pageBreak":{"title":"Page break","description":"Optionally insert page-break before/after component when rendered in PDF","type":"object","properties":{"breakBefore":{"title":"Page break before","description":"PDF only: Value or expression indicating whether a page break should be added before the component. Can be either: 'auto' (default), 'always', or 'avoid'.","examples":["auto","always","avoid"],"default":"auto","$ref":"expression.schema.v1.json#/definitions/string"},"breakAfter":{"title":"Page break after","description":"PDF only: Value or expression indicating whether a page break should be added after the component. Can be either: 'auto' (default), 'always', or 'avoid'.","examples":["auto","always","avoid"],"default":"auto","$ref":"expression.schema.v1.json#/definitions/string"}},"additionalProperties":false},"type":{"const":"Summary2"},"target":{"description":"Config for what should be rendered. If you set taskId, this property is optional.","type":"object","properties":{"type":{"title":"Mode","default":"component","enum":["page","layoutSet","component"]},"id":{"type":"string"},"taskId":{"title":"Task ID","description":"Use this if you want to render something from another task.","type":"string"}},"additionalProperties":false},"showPageInAccordion":{"type":"boolean"},"hideEmptyFields":{"description":"Set this to true if you don't want to show fields that have not been filled out.","type":"boolean"},"overrides":{"type":"array","items":{"title":"AnySummaryOverrideProps","anyOf":[{"$ref":"#/definitions/InputSummaryOverrideProps"},{"$ref":"#/definitions/CheckboxSummaryOverrideProps"},{"$ref":"#/definitions/RadioSummaryOverrideProps"},{"$ref":"#/definitions/DropdownSummaryOverrideProps"},{"$ref":"#/definitions/MultipleSelectSummaryOverrideProps"},{"$ref":"#/definitions/GroupSummaryOverrideProps"},{"$ref":"#/definitions/TextAreaSummaryOverrideProps"},{"$ref":"#/definitions/RepeatingGroupSummaryOverrideProps"},{"$ref":"#/definitions/DatepickerSummaryOverrideProps"},{"$ref":"#/definitions/ListSummaryOverrideProps"}]}}},"required":["id","type"],"title":"Summary2 component schema"} \ No newline at end of file diff --git a/frontend/packages/ux-editor/src/testing/schemas/json/component/Tabs.schema.v1.json b/frontend/packages/ux-editor/src/testing/schemas/json/component/Tabs.schema.v1.json index 29fcc2cb22b..b95de5d91af 100644 --- a/frontend/packages/ux-editor/src/testing/schemas/json/component/Tabs.schema.v1.json +++ b/frontend/packages/ux-editor/src/testing/schemas/json/component/Tabs.schema.v1.json @@ -1,104 +1 @@ -{ - "$id": "https://altinncdn.no/schemas/json/component/Tabs.schema.v1.json", - "$schema": "http://json-schema.org/draft-07/schema#", - "properties": { - "id": { - "title": "ID", - "description": "The component ID. Must be unique within all layouts/pages in a layout-set. Cannot end with .", - "type": "string", - "pattern": "^[0-9a-zA-Z][0-9a-zA-Z-]*(-?[a-zA-Z]+|[a-zA-Z][0-9]+|-[0-9]{6,})$" - }, - "hidden": { - "title": "Hidden", - "description": "Boolean value or expression indicating if the component should be hidden. Defaults to false.", - "default": false, - "$ref": "expression.schema.v1.json#/definitions/boolean" - }, - "grid": { - "properties": { - "xs": { "$ref": "#/definitions/IGridSize" }, - "sm": { "$ref": "#/definitions/IGridSize" }, - "md": { "$ref": "#/definitions/IGridSize" }, - "lg": { "$ref": "#/definitions/IGridSize" }, - "xl": { "$ref": "#/definitions/IGridSize" }, - "labelGrid": { "$ref": "#/definitions/IGridStyling" }, - "innerGrid": { "$ref": "#/definitions/IGridStyling" } - } - }, - "pageBreak": { - "title": "Page break", - "description": "Optionally insert page-break before/after component when rendered in PDF", - "type": "object", - "properties": { - "breakBefore": { - "title": "Page break before", - "description": "PDF only: Value or expression indicating whether a page break should be added before the component. Can be either: 'auto' (default), 'always', or 'avoid'.", - "examples": ["auto", "always", "avoid"], - "default": "auto", - "$ref": "expression.schema.v1.json#/definitions/string" - }, - "breakAfter": { - "title": "Page break after", - "description": "PDF only: Value or expression indicating whether a page break should be added after the component. Can be either: 'auto' (default), 'always', or 'avoid'.", - "examples": ["auto", "always", "avoid"], - "default": "auto", - "$ref": "expression.schema.v1.json#/definitions/string" - } - }, - "additionalProperties": false - }, - "renderAsSummary": { - "title": "Render as summary", - "description": "Boolean value indicating if the component should be rendered as a summary. Defaults to false.", - "default": false, - "type": "boolean" - }, - "forceShowInSummary": { - "title": "Force show in summary", - "description": "Will force show the component in a summary even if hideEmptyFields is set to true in the summary component.", - "default": false, - "$ref": "expression.schema.v1.json#/definitions/boolean" - }, - "type": { "const": "Tabs" }, - "textResourceBindings": { - "title": "TRBSummarizable", - "type": "object", - "properties": { - "summaryTitle": { - "title": "Summary title", - "description": "Title used in the summary view (overrides the default title)", - "$ref": "expression.schema.v1.json#/definitions/string" - }, - "summaryAccessibleTitle": { - "title": "Accessible summary title", - "description": "Title used for aria-label on the edit button in the summary view (overrides the default and summary title)", - "$ref": "expression.schema.v1.json#/definitions/string" - } - } - }, - "size": { "default": "medium", "enum": ["small", "medium", "large"], "type": "string" }, - "defaultTab": { "type": "string" }, - "tabs": { - "type": "array", - "items": { - "title": "TabConfig", - "type": "object", - "properties": { - "id": { "type": "string" }, - "title": { "title": "Title", "description": "Title of the tab", "type": "string" }, - "icon": { "examples": ["https://example.com/icon.svg"], "type": "string" }, - "children": { - "title": "Children", - "description": "List of component IDs that should be displayed in the Tab", - "type": "array", - "items": { "type": "string" } - } - }, - "required": ["id", "title", "children"], - "additionalProperties": false - } - } - }, - "required": ["id", "type", "tabs"], - "title": "Tabs component schema" -} +{"$id":"https://altinncdn.no/schemas/json/component/Tabs.schema.v1.json","$schema":"http://json-schema.org/draft-07/schema#","properties":{"id":{"title":"ID","description":"The component ID. Must be unique within all layouts/pages in a layout-set. Cannot end with .","type":"string","pattern":"^[0-9a-zA-Z][0-9a-zA-Z-]*(-?[a-zA-Z]+|[a-zA-Z][0-9]+|-[0-9]{6,})$"},"hidden":{"title":"Hidden","description":"Boolean value or expression indicating if the component should be hidden. Defaults to false.","default":false,"$ref":"expression.schema.v1.json#/definitions/boolean"},"grid":{"properties":{"xs":{"$ref":"#/definitions/IGridSize"},"sm":{"$ref":"#/definitions/IGridSize"},"md":{"$ref":"#/definitions/IGridSize"},"lg":{"$ref":"#/definitions/IGridSize"},"xl":{"$ref":"#/definitions/IGridSize"},"labelGrid":{"$ref":"#/definitions/IGridStyling"},"innerGrid":{"$ref":"#/definitions/IGridStyling"}}},"pageBreak":{"title":"Page break","description":"Optionally insert page-break before/after component when rendered in PDF","type":"object","properties":{"breakBefore":{"title":"Page break before","description":"PDF only: Value or expression indicating whether a page break should be added before the component. Can be either: 'auto' (default), 'always', or 'avoid'.","examples":["auto","always","avoid"],"default":"auto","$ref":"expression.schema.v1.json#/definitions/string"},"breakAfter":{"title":"Page break after","description":"PDF only: Value or expression indicating whether a page break should be added after the component. Can be either: 'auto' (default), 'always', or 'avoid'.","examples":["auto","always","avoid"],"default":"auto","$ref":"expression.schema.v1.json#/definitions/string"}},"additionalProperties":false},"renderAsSummary":{"title":"Render as summary","description":"Boolean value indicating if the component should be rendered as a summary. Defaults to false.","default":false,"type":"boolean"},"forceShowInSummary":{"title":"Force show in summary","description":"Will force show the component in a summary even if hideEmptyFields is set to true in the summary component.","default":false,"$ref":"expression.schema.v1.json#/definitions/boolean"},"type":{"const":"Tabs"},"textResourceBindings":{"title":"TRBSummarizable","type":"object","properties":{"summaryTitle":{"title":"Summary title","description":"Title used in the summary view (overrides the default title)","$ref":"expression.schema.v1.json#/definitions/string"},"summaryAccessibleTitle":{"title":"Accessible summary title","description":"Title used for aria-label on the edit button in the summary view (overrides the default and summary title)","$ref":"expression.schema.v1.json#/definitions/string"}}},"size":{"default":"medium","enum":["small","medium","large"],"type":"string"},"defaultTab":{"type":"string"},"tabs":{"type":"array","items":{"title":"TabConfig","type":"object","properties":{"id":{"type":"string"},"title":{"title":"Title","description":"Title of the tab","type":"string"},"icon":{"examples":["https://example.com/icon.svg"],"type":"string"},"children":{"title":"Children","description":"List of component IDs that should be displayed in the Tab","type":"array","items":{"type":"string"}}},"required":["id","title","children"],"additionalProperties":false}}},"required":["id","type","tabs"],"title":"Tabs component schema"} \ No newline at end of file diff --git a/frontend/packages/ux-editor/src/testing/schemas/json/component/Text.schema.v1.json b/frontend/packages/ux-editor/src/testing/schemas/json/component/Text.schema.v1.json index a64b26edf89..67a7fb23d1a 100644 --- a/frontend/packages/ux-editor/src/testing/schemas/json/component/Text.schema.v1.json +++ b/frontend/packages/ux-editor/src/testing/schemas/json/component/Text.schema.v1.json @@ -1,78 +1 @@ -{ - "$id": "https://altinncdn.no/schemas/json/component/Text.schema.v1.json", - "$schema": "http://json-schema.org/draft-07/schema#", - "properties": { - "id": { - "title": "ID", - "description": "The component ID. Must be unique within all layouts/pages in a layout-set. Cannot end with .", - "type": "string", - "pattern": "^[0-9a-zA-Z][0-9a-zA-Z-]*(-?[a-zA-Z]+|[a-zA-Z][0-9]+|-[0-9]{6,})$" - }, - "hidden": { - "title": "Hidden", - "description": "Boolean value or expression indicating if the component should be hidden. Defaults to false.", - "default": false, - "$ref": "expression.schema.v1.json#/definitions/boolean" - }, - "grid": { - "properties": { - "xs": { "$ref": "#/definitions/IGridSize" }, - "sm": { "$ref": "#/definitions/IGridSize" }, - "md": { "$ref": "#/definitions/IGridSize" }, - "lg": { "$ref": "#/definitions/IGridSize" }, - "xl": { "$ref": "#/definitions/IGridSize" }, - "labelGrid": { "$ref": "#/definitions/IGridStyling" }, - "innerGrid": { "$ref": "#/definitions/IGridStyling" } - } - }, - "pageBreak": { - "title": "Page break", - "description": "Optionally insert page-break before/after component when rendered in PDF", - "type": "object", - "properties": { - "breakBefore": { - "title": "Page break before", - "description": "PDF only: Value or expression indicating whether a page break should be added before the component. Can be either: 'auto' (default), 'always', or 'avoid'.", - "examples": ["auto", "always", "avoid"], - "default": "auto", - "$ref": "expression.schema.v1.json#/definitions/string" - }, - "breakAfter": { - "title": "Page break after", - "description": "PDF only: Value or expression indicating whether a page break should be added after the component. Can be either: 'auto' (default), 'always', or 'avoid'.", - "examples": ["auto", "always", "avoid"], - "default": "auto", - "$ref": "expression.schema.v1.json#/definitions/string" - } - }, - "additionalProperties": false - }, - "type": { "const": "Text" }, - "textResourceBindings": { - "title": "TRBLabel", - "type": "object", - "properties": { - "title": { - "title": "Title", - "description": "Label text/title shown above the component", - "$ref": "expression.schema.v1.json#/definitions/string" - }, - "description": { - "title": "Description", - "description": "Label description shown above the component, below the title", - "$ref": "expression.schema.v1.json#/definitions/string" - }, - "help": { - "title": "Help text", - "description": "Help text shown in a tooltip when clicking the help button", - "$ref": "expression.schema.v1.json#/definitions/string" - } - } - }, - "value": { "$ref": "expression.schema.v1.json#/definitions/string" }, - "direction": { "default": "horizontal", "enum": ["horizontal", "vertical"], "type": "string" }, - "icon": { "examples": ["https://example.com/icon.svg"], "type": "string" } - }, - "required": ["id", "type", "value"], - "title": "Text component schema" -} +{"$id":"https://altinncdn.no/schemas/json/component/Text.schema.v1.json","$schema":"http://json-schema.org/draft-07/schema#","properties":{"id":{"title":"ID","description":"The component ID. Must be unique within all layouts/pages in a layout-set. Cannot end with .","type":"string","pattern":"^[0-9a-zA-Z][0-9a-zA-Z-]*(-?[a-zA-Z]+|[a-zA-Z][0-9]+|-[0-9]{6,})$"},"hidden":{"title":"Hidden","description":"Boolean value or expression indicating if the component should be hidden. Defaults to false.","default":false,"$ref":"expression.schema.v1.json#/definitions/boolean"},"grid":{"properties":{"xs":{"$ref":"#/definitions/IGridSize"},"sm":{"$ref":"#/definitions/IGridSize"},"md":{"$ref":"#/definitions/IGridSize"},"lg":{"$ref":"#/definitions/IGridSize"},"xl":{"$ref":"#/definitions/IGridSize"},"labelGrid":{"$ref":"#/definitions/IGridStyling"},"innerGrid":{"$ref":"#/definitions/IGridStyling"}}},"pageBreak":{"title":"Page break","description":"Optionally insert page-break before/after component when rendered in PDF","type":"object","properties":{"breakBefore":{"title":"Page break before","description":"PDF only: Value or expression indicating whether a page break should be added before the component. Can be either: 'auto' (default), 'always', or 'avoid'.","examples":["auto","always","avoid"],"default":"auto","$ref":"expression.schema.v1.json#/definitions/string"},"breakAfter":{"title":"Page break after","description":"PDF only: Value or expression indicating whether a page break should be added after the component. Can be either: 'auto' (default), 'always', or 'avoid'.","examples":["auto","always","avoid"],"default":"auto","$ref":"expression.schema.v1.json#/definitions/string"}},"additionalProperties":false},"type":{"const":"Text"},"textResourceBindings":{"title":"TRBLabel","type":"object","properties":{"title":{"title":"Title","description":"Label text/title shown above the component","$ref":"expression.schema.v1.json#/definitions/string"},"description":{"title":"Description","description":"Label description shown above the component, below the title","$ref":"expression.schema.v1.json#/definitions/string"},"help":{"title":"Help text","description":"Help text shown in a tooltip when clicking the help button","$ref":"expression.schema.v1.json#/definitions/string"}}},"value":{"$ref":"expression.schema.v1.json#/definitions/string"},"direction":{"default":"horizontal","enum":["horizontal","vertical"],"type":"string"},"icon":{"examples":["https://example.com/icon.svg"],"type":"string"}},"required":["id","type","value"],"title":"Text component schema"} \ No newline at end of file diff --git a/frontend/packages/ux-editor/src/testing/schemas/json/component/TextArea.schema.v1.json b/frontend/packages/ux-editor/src/testing/schemas/json/component/TextArea.schema.v1.json index 49843a3d98d..ee7ecd3dbc6 100644 --- a/frontend/packages/ux-editor/src/testing/schemas/json/component/TextArea.schema.v1.json +++ b/frontend/packages/ux-editor/src/testing/schemas/json/component/TextArea.schema.v1.json @@ -1,231 +1 @@ -{ - "$id": "https://altinncdn.no/schemas/json/component/TextArea.schema.v1.json", - "$schema": "http://json-schema.org/draft-07/schema#", - "properties": { - "id": { - "title": "ID", - "description": "The component ID. Must be unique within all layouts/pages in a layout-set. Cannot end with .", - "type": "string", - "pattern": "^[0-9a-zA-Z][0-9a-zA-Z-]*(-?[a-zA-Z]+|[a-zA-Z][0-9]+|-[0-9]{6,})$" - }, - "hidden": { - "title": "Hidden", - "description": "Boolean value or expression indicating if the component should be hidden. Defaults to false.", - "default": false, - "$ref": "expression.schema.v1.json#/definitions/boolean" - }, - "grid": { - "properties": { - "xs": { "$ref": "#/definitions/IGridSize" }, - "sm": { "$ref": "#/definitions/IGridSize" }, - "md": { "$ref": "#/definitions/IGridSize" }, - "lg": { "$ref": "#/definitions/IGridSize" }, - "xl": { "$ref": "#/definitions/IGridSize" }, - "labelGrid": { "$ref": "#/definitions/IGridStyling" }, - "innerGrid": { "$ref": "#/definitions/IGridStyling" } - } - }, - "pageBreak": { - "title": "Page break", - "description": "Optionally insert page-break before/after component when rendered in PDF", - "type": "object", - "properties": { - "breakBefore": { - "title": "Page break before", - "description": "PDF only: Value or expression indicating whether a page break should be added before the component. Can be either: 'auto' (default), 'always', or 'avoid'.", - "examples": ["auto", "always", "avoid"], - "default": "auto", - "$ref": "expression.schema.v1.json#/definitions/string" - }, - "breakAfter": { - "title": "Page break after", - "description": "PDF only: Value or expression indicating whether a page break should be added after the component. Can be either: 'auto' (default), 'always', or 'avoid'.", - "examples": ["auto", "always", "avoid"], - "default": "auto", - "$ref": "expression.schema.v1.json#/definitions/string" - } - }, - "additionalProperties": false - }, - "readOnly": { - "title": "Read only/disabled?", - "description": "Boolean value or expression indicating if the component should be read only/disabled. Defaults to false.
Please note that even with read-only fields in components, it may currently be possible to update the field by modifying the request sent to the API or through a direct API call.", - "default": false, - "$ref": "expression.schema.v1.json#/definitions/boolean" - }, - "required": { - "title": "Required?", - "description": "Boolean value or expression indicating if the component should be required. Defaults to false.", - "default": false, - "$ref": "expression.schema.v1.json#/definitions/boolean" - }, - "showValidations": { - "title": "Validation types", - "description": "List of validation types to show", - "type": "array", - "items": { - "enum": [ - "Schema", - "Component", - "Expression", - "CustomBackend", - "Required", - "AllExceptRequired", - "All" - ], - "type": "string" - } - }, - "renderAsSummary": { - "title": "Render as summary", - "description": "Boolean value indicating if the component should be rendered as a summary. Defaults to false.", - "default": false, - "type": "boolean" - }, - "forceShowInSummary": { - "title": "Force show in summary", - "description": "Will force show the component in a summary even if hideEmptyFields is set to true in the summary component.", - "default": false, - "$ref": "expression.schema.v1.json#/definitions/boolean" - }, - "labelSettings": { - "title": "ILabelSettings", - "type": "object", - "properties": { - "optionalIndicator": { - "title": "Optional indicator", - "description": "Show optional indicator on label", - "type": "boolean" - } - }, - "additionalProperties": false - }, - "type": { "const": "TextArea" }, - "textResourceBindings": { - "properties": { - "title": { - "title": "Title", - "description": "Label text/title shown above the component", - "$ref": "expression.schema.v1.json#/definitions/string" - }, - "description": { - "title": "Description", - "description": "Label description shown above the component, below the title", - "$ref": "expression.schema.v1.json#/definitions/string" - }, - "help": { - "title": "Help text", - "description": "Help text shown in a tooltip when clicking the help button", - "$ref": "expression.schema.v1.json#/definitions/string" - }, - "tableTitle": { - "title": "Table title", - "description": "Title used in the table view (overrides the default title)", - "$ref": "expression.schema.v1.json#/definitions/string" - }, - "shortName": { - "title": "Short name (for validation)", - "description": "Alternative name used for required validation messages (overrides the default title)", - "$ref": "expression.schema.v1.json#/definitions/string" - }, - "requiredValidation": { - "title": "Required validation message", - "description": "Full validation message shown when the component is required and no value has been entered (overrides both the default and shortName)", - "$ref": "expression.schema.v1.json#/definitions/string" - }, - "summaryTitle": { - "title": "Summary title", - "description": "Title used in the summary view (overrides the default title)", - "$ref": "expression.schema.v1.json#/definitions/string" - }, - "summaryAccessibleTitle": { - "title": "Accessible summary title", - "description": "Title used for aria-label on the edit button in the summary view (overrides the default and summary title)", - "$ref": "expression.schema.v1.json#/definitions/string" - } - } - }, - "dataModelBindings": { - "title": "Data model binding", - "description": "Describes the location in the data model where the component should store its value(s). A simple binding is used for components that only store a single value, usually a string.", - "type": "object", - "properties": { "simpleBinding": { "type": "string" } }, - "required": ["simpleBinding"], - "additionalProperties": false - }, - "saveWhileTyping": { - "title": "Automatic saving while typing", - "description": "Lets you control how long we wait before saving the value locally while typing. This value is usually also used to determine how long we wait before saving the value to the server. The default value is 400 milliseconds.", - "default": 400, - "type": "number" - }, - "autocomplete": { - "title": "HTML autocomplete values", - "description": "Autocomplete hints to the browser. See https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/autocomplete", - "enum": [ - "on", - "off", - "name", - "honorific-prefix", - "given-name", - "additional-name", - "family-name", - "honorific-suffix", - "nickname", - "email", - "username", - "new-password", - "current-password", - "one-time-code", - "organization-title", - "organization", - "street-address", - "address-line1", - "address-line2", - "address-line3", - "address-level4", - "address-level3", - "address-level2", - "address-level1", - "country", - "country-name", - "postal-code", - "cc-name", - "cc-given-name", - "cc-additional-name", - "cc-family-name", - "cc-number", - "cc-exp", - "cc-exp-month", - "cc-exp-year", - "cc-csc", - "cc-type", - "transaction-currency", - "transaction-amount", - "language", - "bday", - "bday-day", - "bday-month", - "bday-year", - "sex", - "tel", - "tel-country-code", - "tel-national", - "tel-area-code", - "tel-local", - "tel-extension", - "impp", - "url", - "photo" - ], - "type": "string" - }, - "maxLength": { - "title": "Max length", - "description": "Max length of the input field. Will add a counter to let the user know how many characters are left.", - "type": "integer" - } - }, - "required": ["id", "type", "dataModelBindings"], - "title": "TextArea component schema" -} +{"$id":"https://altinncdn.no/schemas/json/component/TextArea.schema.v1.json","$schema":"http://json-schema.org/draft-07/schema#","properties":{"id":{"title":"ID","description":"The component ID. Must be unique within all layouts/pages in a layout-set. Cannot end with .","type":"string","pattern":"^[0-9a-zA-Z][0-9a-zA-Z-]*(-?[a-zA-Z]+|[a-zA-Z][0-9]+|-[0-9]{6,})$"},"hidden":{"title":"Hidden","description":"Boolean value or expression indicating if the component should be hidden. Defaults to false.","default":false,"$ref":"expression.schema.v1.json#/definitions/boolean"},"grid":{"properties":{"xs":{"$ref":"#/definitions/IGridSize"},"sm":{"$ref":"#/definitions/IGridSize"},"md":{"$ref":"#/definitions/IGridSize"},"lg":{"$ref":"#/definitions/IGridSize"},"xl":{"$ref":"#/definitions/IGridSize"},"labelGrid":{"$ref":"#/definitions/IGridStyling"},"innerGrid":{"$ref":"#/definitions/IGridStyling"}}},"pageBreak":{"title":"Page break","description":"Optionally insert page-break before/after component when rendered in PDF","type":"object","properties":{"breakBefore":{"title":"Page break before","description":"PDF only: Value or expression indicating whether a page break should be added before the component. Can be either: 'auto' (default), 'always', or 'avoid'.","examples":["auto","always","avoid"],"default":"auto","$ref":"expression.schema.v1.json#/definitions/string"},"breakAfter":{"title":"Page break after","description":"PDF only: Value or expression indicating whether a page break should be added after the component. Can be either: 'auto' (default), 'always', or 'avoid'.","examples":["auto","always","avoid"],"default":"auto","$ref":"expression.schema.v1.json#/definitions/string"}},"additionalProperties":false},"readOnly":{"title":"Read only/disabled?","description":"Boolean value or expression indicating if the component should be read only/disabled. Defaults to false.
Please note that even with read-only fields in components, it may currently be possible to update the field by modifying the request sent to the API or through a direct API call.","default":false,"$ref":"expression.schema.v1.json#/definitions/boolean"},"required":{"title":"Required?","description":"Boolean value or expression indicating if the component should be required. Defaults to false.","default":false,"$ref":"expression.schema.v1.json#/definitions/boolean"},"showValidations":{"title":"Validation types","description":"List of validation types to show","type":"array","items":{"enum":["Schema","Component","Expression","CustomBackend","Required","AllExceptRequired","All"],"type":"string"}},"renderAsSummary":{"title":"Render as summary","description":"Boolean value indicating if the component should be rendered as a summary. Defaults to false.","default":false,"type":"boolean"},"forceShowInSummary":{"title":"Force show in summary","description":"Will force show the component in a summary even if hideEmptyFields is set to true in the summary component.","default":false,"$ref":"expression.schema.v1.json#/definitions/boolean"},"labelSettings":{"title":"ILabelSettings","type":"object","properties":{"optionalIndicator":{"title":"Optional indicator","description":"Show optional indicator on label","type":"boolean"}},"additionalProperties":false},"type":{"const":"TextArea"},"textResourceBindings":{"properties":{"title":{"title":"Title","description":"Label text/title shown above the component","$ref":"expression.schema.v1.json#/definitions/string"},"description":{"title":"Description","description":"Label description shown above the component, below the title","$ref":"expression.schema.v1.json#/definitions/string"},"help":{"title":"Help text","description":"Help text shown in a tooltip when clicking the help button","$ref":"expression.schema.v1.json#/definitions/string"},"tableTitle":{"title":"Table title","description":"Title used in the table view (overrides the default title)","$ref":"expression.schema.v1.json#/definitions/string"},"shortName":{"title":"Short name (for validation)","description":"Alternative name used for required validation messages (overrides the default title)","$ref":"expression.schema.v1.json#/definitions/string"},"requiredValidation":{"title":"Required validation message","description":"Full validation message shown when the component is required and no value has been entered (overrides both the default and shortName)","$ref":"expression.schema.v1.json#/definitions/string"},"summaryTitle":{"title":"Summary title","description":"Title used in the summary view (overrides the default title)","$ref":"expression.schema.v1.json#/definitions/string"},"summaryAccessibleTitle":{"title":"Accessible summary title","description":"Title used for aria-label on the edit button in the summary view (overrides the default and summary title)","$ref":"expression.schema.v1.json#/definitions/string"}}},"dataModelBindings":{"title":"Data model binding","description":"Describes the location in the data model where the component should store its value(s). A simple binding is used for components that only store a single value, usually a string.","type":"object","properties":{"simpleBinding":{"type":"string"}},"required":["simpleBinding"],"additionalProperties":false},"saveWhileTyping":{"title":"Automatic saving while typing","description":"Lets you control how long we wait before saving the value locally while typing. This value is usually also used to determine how long we wait before saving the value to the server. The default value is 400 milliseconds.","default":400,"type":"number"},"autocomplete":{"title":"HTML autocomplete values","description":"Autocomplete hints to the browser. See https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/autocomplete","enum":["on","off","name","honorific-prefix","given-name","additional-name","family-name","honorific-suffix","nickname","email","username","new-password","current-password","one-time-code","organization-title","organization","street-address","address-line1","address-line2","address-line3","address-level4","address-level3","address-level2","address-level1","country","country-name","postal-code","cc-name","cc-given-name","cc-additional-name","cc-family-name","cc-number","cc-exp","cc-exp-month","cc-exp-year","cc-csc","cc-type","transaction-currency","transaction-amount","language","bday","bday-day","bday-month","bday-year","sex","tel","tel-country-code","tel-national","tel-area-code","tel-local","tel-extension","impp","url","photo"],"type":"string"},"maxLength":{"title":"Max length","description":"Max length of the input field. Will add a counter to let the user know how many characters are left.","type":"integer"}},"required":["id","type","dataModelBindings"],"title":"TextArea component schema"} \ No newline at end of file diff --git a/frontend/packages/ux-editor/src/testing/schemas/json/component/Video.schema.v1.json b/frontend/packages/ux-editor/src/testing/schemas/json/component/Video.schema.v1.json index 6302443a758..eebe3e916c0 100644 --- a/frontend/packages/ux-editor/src/testing/schemas/json/component/Video.schema.v1.json +++ b/frontend/packages/ux-editor/src/testing/schemas/json/component/Video.schema.v1.json @@ -1,72 +1 @@ -{ - "$id": "https://altinncdn.no/schemas/json/component/Video.schema.v1.json", - "$schema": "http://json-schema.org/draft-07/schema#", - "properties": { - "id": { - "title": "ID", - "description": "The component ID. Must be unique within all layouts/pages in a layout-set. Cannot end with .", - "type": "string", - "pattern": "^[0-9a-zA-Z][0-9a-zA-Z-]*(-?[a-zA-Z]+|[a-zA-Z][0-9]+|-[0-9]{6,})$" - }, - "hidden": { - "title": "Hidden", - "description": "Boolean value or expression indicating if the component should be hidden. Defaults to false.", - "default": false, - "$ref": "expression.schema.v1.json#/definitions/boolean" - }, - "grid": { - "properties": { - "xs": { "$ref": "#/definitions/IGridSize" }, - "sm": { "$ref": "#/definitions/IGridSize" }, - "md": { "$ref": "#/definitions/IGridSize" }, - "lg": { "$ref": "#/definitions/IGridSize" }, - "xl": { "$ref": "#/definitions/IGridSize" }, - "labelGrid": { "$ref": "#/definitions/IGridStyling" }, - "innerGrid": { "$ref": "#/definitions/IGridStyling" } - } - }, - "pageBreak": { - "title": "Page break", - "description": "Optionally insert page-break before/after component when rendered in PDF", - "type": "object", - "properties": { - "breakBefore": { - "title": "Page break before", - "description": "PDF only: Value or expression indicating whether a page break should be added before the component. Can be either: 'auto' (default), 'always', or 'avoid'.", - "examples": ["auto", "always", "avoid"], - "default": "auto", - "$ref": "expression.schema.v1.json#/definitions/string" - }, - "breakAfter": { - "title": "Page break after", - "description": "PDF only: Value or expression indicating whether a page break should be added after the component. Can be either: 'auto' (default), 'always', or 'avoid'.", - "examples": ["auto", "always", "avoid"], - "default": "auto", - "$ref": "expression.schema.v1.json#/definitions/string" - } - }, - "additionalProperties": false - }, - "type": { "const": "Video" }, - "textResourceBindings": { - "type": "object", - "properties": { - "altText": { - "title": "Alt text", - "description": "Alternative text for the video (for screen readers).", - "$ref": "expression.schema.v1.json#/definitions/string" - } - }, - "additionalProperties": false - }, - "video": { - "title": "IVideo", - "type": "object", - "properties": { "src": { "$ref": "#/definitions/VideoSrc" } }, - "required": ["src"], - "additionalProperties": false - } - }, - "required": ["id", "type"], - "title": "Video component schema" -} +{"$id":"https://altinncdn.no/schemas/json/component/Video.schema.v1.json","$schema":"http://json-schema.org/draft-07/schema#","properties":{"id":{"title":"ID","description":"The component ID. Must be unique within all layouts/pages in a layout-set. Cannot end with .","type":"string","pattern":"^[0-9a-zA-Z][0-9a-zA-Z-]*(-?[a-zA-Z]+|[a-zA-Z][0-9]+|-[0-9]{6,})$"},"hidden":{"title":"Hidden","description":"Boolean value or expression indicating if the component should be hidden. Defaults to false.","default":false,"$ref":"expression.schema.v1.json#/definitions/boolean"},"grid":{"properties":{"xs":{"$ref":"#/definitions/IGridSize"},"sm":{"$ref":"#/definitions/IGridSize"},"md":{"$ref":"#/definitions/IGridSize"},"lg":{"$ref":"#/definitions/IGridSize"},"xl":{"$ref":"#/definitions/IGridSize"},"labelGrid":{"$ref":"#/definitions/IGridStyling"},"innerGrid":{"$ref":"#/definitions/IGridStyling"}}},"pageBreak":{"title":"Page break","description":"Optionally insert page-break before/after component when rendered in PDF","type":"object","properties":{"breakBefore":{"title":"Page break before","description":"PDF only: Value or expression indicating whether a page break should be added before the component. Can be either: 'auto' (default), 'always', or 'avoid'.","examples":["auto","always","avoid"],"default":"auto","$ref":"expression.schema.v1.json#/definitions/string"},"breakAfter":{"title":"Page break after","description":"PDF only: Value or expression indicating whether a page break should be added after the component. Can be either: 'auto' (default), 'always', or 'avoid'.","examples":["auto","always","avoid"],"default":"auto","$ref":"expression.schema.v1.json#/definitions/string"}},"additionalProperties":false},"type":{"const":"Video"},"textResourceBindings":{"type":"object","properties":{"altText":{"title":"Alt text","description":"Alternative text for the video (for screen readers).","$ref":"expression.schema.v1.json#/definitions/string"}},"additionalProperties":false},"video":{"title":"IVideo","type":"object","properties":{"src":{"$ref":"#/definitions/VideoSrc"}},"required":["src"],"additionalProperties":false}},"required":["id","type"],"title":"Video component schema"} \ No newline at end of file diff --git a/frontend/scripts/componentSchemas/schemaUtils.ts b/frontend/scripts/componentSchemas/schemaUtils.ts index e18fd028675..548851891e7 100644 --- a/frontend/scripts/componentSchemas/schemaUtils.ts +++ b/frontend/scripts/componentSchemas/schemaUtils.ts @@ -1,6 +1,8 @@ import jsonpointer from 'jsonpointer'; import { sortTextResourceBindings } from './languageUtils'; +export const allPropertyKeys = []; + export const generateComponentSchema = ( componentName: string, layoutSchema: any, @@ -19,7 +21,7 @@ export const generateComponentSchema = ( const expectedProperties = Object.keys( componentSchema.allOf[componentSchema.allOf.length - 1].properties, ); - pushPropertyKeys(expectedProperties); + allPropertyKeys.push(...expectedProperties); if (!verifySchema(schema, expectedProperties)) { return null; @@ -143,12 +145,6 @@ export const expandRefsInProperties = (properties: any, layoutSchema: any) => { return expandedProperties; }; -export const allPropertyKeys = []; - -const pushPropertyKeys = (propertyKeys: string[]) => { - allPropertyKeys.push(...propertyKeys); -}; - /** * Verifies that a schema has all expected properties * @param schema The schema to verify From 066fad40b68615a27e64981cea4f98d1541512bd Mon Sep 17 00:00:00 2001 From: Erling Hauan Date: Fri, 4 Oct 2024 14:21:48 +0200 Subject: [PATCH 6/7] Revert updated component schemas --- .../json/component/Accordion.schema.v1.json | 99 +++- .../component/AccordionGroup.schema.v1.json | 92 +++- .../component/ActionButton.schema.v1.json | 78 ++- .../json/component/Address.schema.v1.json | 187 ++++++- .../json/component/Alert.schema.v1.json | 77 ++- .../component/AttachmentList.schema.v1.json | 72 ++- .../json/component/Audio.schema.v1.json | 73 ++- .../json/component/Button.schema.v1.json | 80 ++- .../json/component/ButtonGroup.schema.v1.json | 114 ++++- .../json/component/Cards.schema.v1.json | 143 +++++- .../json/component/Checkboxes.schema.v1.json | 284 +++++++++- .../json/component/Custom.schema.v1.json | 141 ++++- .../component/CustomButton.schema.v1.json | 82 ++- .../json/component/Datepicker.schema.v1.json | 185 ++++++- .../json/component/Dropdown.schema.v1.json | 272 +++++++++- .../json/component/FileUpload.schema.v1.json | 213 +++++++- .../FileUploadWithTag.schema.v1.json | 312 ++++++++++- .../json/component/Grid.schema.v1.json | 139 ++++- .../json/component/Group.schema.v1.json | 109 +++- .../json/component/Header.schema.v1.json | 77 ++- .../json/component/IFrame.schema.v1.json | 85 ++- .../json/component/Image.schema.v1.json | 82 ++- .../json/component/Input.schema.v1.json | 483 +++++++++++++++++- .../InstanceInformation.schema.v1.json | 100 +++- .../InstantiationButton.schema.v1.json | 73 ++- .../json/component/Likert.schema.v1.json | 282 +++++++++- .../json/component/LikertItem.schema.v1.json | 266 +++++++++- .../json/component/Link.schema.v1.json | 82 ++- .../json/component/List.schema.v1.json | 221 +++++++- .../schemas/json/component/Map.schema.v1.json | 206 +++++++- .../component/MultipleSelect.schema.v1.json | 272 +++++++++- .../component/NavigationBar.schema.v1.json | 88 +++- .../NavigationButtons.schema.v1.json | 105 +++- .../json/component/Number.schema.v1.json | 313 +++++++++++- .../json/component/Panel.schema.v1.json | 83 ++- .../json/component/Paragraph.schema.v1.json | 71 ++- .../json/component/Payment.schema.v1.json | 83 ++- .../component/PaymentDetails.schema.v1.json | 78 ++- .../json/component/PrintButton.schema.v1.json | 66 ++- .../component/RadioButtons.schema.v1.json | 289 ++++++++++- .../component/RepeatingGroup.schema.v1.json | 368 ++++++++++++- .../json/component/Summary.schema.v1.json | 121 ++++- .../json/component/Summary2.schema.v1.json | 96 +++- .../json/component/Tabs.schema.v1.json | 105 +++- .../json/component/Text.schema.v1.json | 79 ++- .../json/component/TextArea.schema.v1.json | 232 ++++++++- .../json/component/Video.schema.v1.json | 73 ++- 47 files changed, 7184 insertions(+), 47 deletions(-) diff --git a/frontend/packages/ux-editor/src/testing/schemas/json/component/Accordion.schema.v1.json b/frontend/packages/ux-editor/src/testing/schemas/json/component/Accordion.schema.v1.json index 97bb1ec3a1e..5b94321f856 100644 --- a/frontend/packages/ux-editor/src/testing/schemas/json/component/Accordion.schema.v1.json +++ b/frontend/packages/ux-editor/src/testing/schemas/json/component/Accordion.schema.v1.json @@ -1 +1,98 @@ -{"$id":"https://altinncdn.no/schemas/json/component/Accordion.schema.v1.json","$schema":"http://json-schema.org/draft-07/schema#","properties":{"id":{"title":"ID","description":"The component ID. Must be unique within all layouts/pages in a layout-set. Cannot end with .","type":"string","pattern":"^[0-9a-zA-Z][0-9a-zA-Z-]*(-?[a-zA-Z]+|[a-zA-Z][0-9]+|-[0-9]{6,})$"},"hidden":{"title":"Hidden","description":"Boolean value or expression indicating if the component should be hidden. Defaults to false.","default":false,"$ref":"expression.schema.v1.json#/definitions/boolean"},"grid":{"properties":{"xs":{"$ref":"#/definitions/IGridSize"},"sm":{"$ref":"#/definitions/IGridSize"},"md":{"$ref":"#/definitions/IGridSize"},"lg":{"$ref":"#/definitions/IGridSize"},"xl":{"$ref":"#/definitions/IGridSize"},"labelGrid":{"$ref":"#/definitions/IGridStyling"},"innerGrid":{"$ref":"#/definitions/IGridStyling"}}},"pageBreak":{"title":"Page break","description":"Optionally insert page-break before/after component when rendered in PDF","type":"object","properties":{"breakBefore":{"title":"Page break before","description":"PDF only: Value or expression indicating whether a page break should be added before the component. Can be either: 'auto' (default), 'always', or 'avoid'.","examples":["auto","always","avoid"],"default":"auto","$ref":"expression.schema.v1.json#/definitions/string"},"breakAfter":{"title":"Page break after","description":"PDF only: Value or expression indicating whether a page break should be added after the component. Can be either: 'auto' (default), 'always', or 'avoid'.","examples":["auto","always","avoid"],"default":"auto","$ref":"expression.schema.v1.json#/definitions/string"}},"additionalProperties":false},"renderAsSummary":{"title":"Render as summary","description":"Boolean value indicating if the component should be rendered as a summary. Defaults to false.","default":false,"type":"boolean"},"forceShowInSummary":{"title":"Force show in summary","description":"Will force show the component in a summary even if hideEmptyFields is set to true in the summary component.","default":false,"$ref":"expression.schema.v1.json#/definitions/boolean"},"type":{"const":"Accordion"},"textResourceBindings":{"properties":{"title":{"title":"Title","description":"The title of the accordion","$ref":"expression.schema.v1.json#/definitions/string"},"summaryTitle":{"title":"Summary title","description":"Title used in the summary view (overrides the default title)","$ref":"expression.schema.v1.json#/definitions/string"},"summaryAccessibleTitle":{"title":"Accessible summary title","description":"Title used for aria-label on the edit button in the summary view (overrides the default and summary title)","$ref":"expression.schema.v1.json#/definitions/string"}}},"children":{"title":"Children","description":"List of child component IDs to show inside the Accordion (limited to a few component types)","type":"array","items":{"type":"string"}},"openByDefault":{"title":"Open by default","description":"Boolean value indicating if the accordion should be open by default","default":false,"$ref":"expression.schema.v1.json#/definitions/boolean"},"headingLevel":{"title":"HeadingLevel","enum":[2,3,4,5,6],"type":"number"}},"required":["id","type","children"],"title":"Accordion component schema"} \ No newline at end of file +{ + "$id": "https://altinncdn.no/schemas/json/component/Accordion.schema.v1.json", + "$schema": "http://json-schema.org/draft-07/schema#", + "properties": { + "id": { + "title": "ID", + "description": "The component ID. Must be unique within all layouts/pages in a layout-set. Cannot end with .", + "type": "string", + "pattern": "^[0-9a-zA-Z][0-9a-zA-Z-]*(-?[a-zA-Z]+|[a-zA-Z][0-9]+|-[0-9]{6,})$" + }, + "hidden": { + "title": "Hidden", + "description": "Boolean value or expression indicating if the component should be hidden. Defaults to false.", + "default": false, + "$ref": "expression.schema.v1.json#/definitions/boolean" + }, + "grid": { + "properties": { + "xs": { "$ref": "#/definitions/IGridSize" }, + "sm": { "$ref": "#/definitions/IGridSize" }, + "md": { "$ref": "#/definitions/IGridSize" }, + "lg": { "$ref": "#/definitions/IGridSize" }, + "xl": { "$ref": "#/definitions/IGridSize" }, + "labelGrid": { "$ref": "#/definitions/IGridStyling" }, + "innerGrid": { "$ref": "#/definitions/IGridStyling" } + } + }, + "pageBreak": { + "title": "Page break", + "description": "Optionally insert page-break before/after component when rendered in PDF", + "type": "object", + "properties": { + "breakBefore": { + "title": "Page break before", + "description": "PDF only: Value or expression indicating whether a page break should be added before the component. Can be either: 'auto' (default), 'always', or 'avoid'.", + "examples": ["auto", "always", "avoid"], + "default": "auto", + "$ref": "expression.schema.v1.json#/definitions/string" + }, + "breakAfter": { + "title": "Page break after", + "description": "PDF only: Value or expression indicating whether a page break should be added after the component. Can be either: 'auto' (default), 'always', or 'avoid'.", + "examples": ["auto", "always", "avoid"], + "default": "auto", + "$ref": "expression.schema.v1.json#/definitions/string" + } + }, + "additionalProperties": false + }, + "renderAsSummary": { + "title": "Render as summary", + "description": "Boolean value indicating if the component should be rendered as a summary. Defaults to false.", + "default": false, + "type": "boolean" + }, + "forceShowInSummary": { + "title": "Force show in summary", + "description": "Will force show the component in a summary even if hideEmptyFields is set to true in the summary component.", + "default": false, + "$ref": "expression.schema.v1.json#/definitions/boolean" + }, + "type": { "const": "Accordion" }, + "textResourceBindings": { + "properties": { + "title": { + "title": "Title", + "description": "The title of the accordion", + "$ref": "expression.schema.v1.json#/definitions/string" + }, + "summaryTitle": { + "title": "Summary title", + "description": "Title used in the summary view (overrides the default title)", + "$ref": "expression.schema.v1.json#/definitions/string" + }, + "summaryAccessibleTitle": { + "title": "Accessible summary title", + "description": "Title used for aria-label on the edit button in the summary view (overrides the default and summary title)", + "$ref": "expression.schema.v1.json#/definitions/string" + } + } + }, + "children": { + "title": "Children", + "description": "List of child component IDs to show inside the Accordion (limited to a few component types)", + "type": "array", + "items": { "type": "string" } + }, + "openByDefault": { + "title": "Open by default", + "description": "Boolean value indicating if the accordion should be open by default", + "default": false, + "$ref": "expression.schema.v1.json#/definitions/boolean" + }, + "headingLevel": { "title": "HeadingLevel", "enum": [2, 3, 4, 5, 6], "type": "string" } + }, + "required": ["id", "type", "children"], + "title": "Accordion component schema" +} diff --git a/frontend/packages/ux-editor/src/testing/schemas/json/component/AccordionGroup.schema.v1.json b/frontend/packages/ux-editor/src/testing/schemas/json/component/AccordionGroup.schema.v1.json index 876223e55f0..9cbe0ff7d88 100644 --- a/frontend/packages/ux-editor/src/testing/schemas/json/component/AccordionGroup.schema.v1.json +++ b/frontend/packages/ux-editor/src/testing/schemas/json/component/AccordionGroup.schema.v1.json @@ -1 +1,91 @@ -{"$id":"https://altinncdn.no/schemas/json/component/AccordionGroup.schema.v1.json","$schema":"http://json-schema.org/draft-07/schema#","properties":{"id":{"title":"ID","description":"The component ID. Must be unique within all layouts/pages in a layout-set. Cannot end with .","type":"string","pattern":"^[0-9a-zA-Z][0-9a-zA-Z-]*(-?[a-zA-Z]+|[a-zA-Z][0-9]+|-[0-9]{6,})$"},"hidden":{"title":"Hidden","description":"Boolean value or expression indicating if the component should be hidden. Defaults to false.","default":false,"$ref":"expression.schema.v1.json#/definitions/boolean"},"grid":{"properties":{"xs":{"$ref":"#/definitions/IGridSize"},"sm":{"$ref":"#/definitions/IGridSize"},"md":{"$ref":"#/definitions/IGridSize"},"lg":{"$ref":"#/definitions/IGridSize"},"xl":{"$ref":"#/definitions/IGridSize"},"labelGrid":{"$ref":"#/definitions/IGridStyling"},"innerGrid":{"$ref":"#/definitions/IGridStyling"}}},"pageBreak":{"title":"Page break","description":"Optionally insert page-break before/after component when rendered in PDF","type":"object","properties":{"breakBefore":{"title":"Page break before","description":"PDF only: Value or expression indicating whether a page break should be added before the component. Can be either: 'auto' (default), 'always', or 'avoid'.","examples":["auto","always","avoid"],"default":"auto","$ref":"expression.schema.v1.json#/definitions/string"},"breakAfter":{"title":"Page break after","description":"PDF only: Value or expression indicating whether a page break should be added after the component. Can be either: 'auto' (default), 'always', or 'avoid'.","examples":["auto","always","avoid"],"default":"auto","$ref":"expression.schema.v1.json#/definitions/string"}},"additionalProperties":false},"renderAsSummary":{"title":"Render as summary","description":"Boolean value indicating if the component should be rendered as a summary. Defaults to false.","default":false,"type":"boolean"},"forceShowInSummary":{"title":"Force show in summary","description":"Will force show the component in a summary even if hideEmptyFields is set to true in the summary component.","default":false,"$ref":"expression.schema.v1.json#/definitions/boolean"},"type":{"const":"AccordionGroup"},"textResourceBindings":{"properties":{"title":{"title":"Title","description":"The title of the accordion group","$ref":"expression.schema.v1.json#/definitions/string"},"summaryTitle":{"title":"Summary title","description":"Title used in the summary view (overrides the default title)","$ref":"expression.schema.v1.json#/definitions/string"},"summaryAccessibleTitle":{"title":"Accessible summary title","description":"Title used for aria-label on the edit button in the summary view (overrides the default and summary title)","$ref":"expression.schema.v1.json#/definitions/string"}}},"children":{"title":"Children","description":"List of child component IDs to show inside the Accordion (limited to a few component types)","type":"array","items":{"type":"string"}}},"required":["id","type","children"],"title":"AccordionGroup component schema"} \ No newline at end of file +{ + "$id": "https://altinncdn.no/schemas/json/component/AccordionGroup.schema.v1.json", + "$schema": "http://json-schema.org/draft-07/schema#", + "properties": { + "id": { + "title": "ID", + "description": "The component ID. Must be unique within all layouts/pages in a layout-set. Cannot end with .", + "type": "string", + "pattern": "^[0-9a-zA-Z][0-9a-zA-Z-]*(-?[a-zA-Z]+|[a-zA-Z][0-9]+|-[0-9]{6,})$" + }, + "hidden": { + "title": "Hidden", + "description": "Boolean value or expression indicating if the component should be hidden. Defaults to false.", + "default": false, + "$ref": "expression.schema.v1.json#/definitions/boolean" + }, + "grid": { + "properties": { + "xs": { "$ref": "#/definitions/IGridSize" }, + "sm": { "$ref": "#/definitions/IGridSize" }, + "md": { "$ref": "#/definitions/IGridSize" }, + "lg": { "$ref": "#/definitions/IGridSize" }, + "xl": { "$ref": "#/definitions/IGridSize" }, + "labelGrid": { "$ref": "#/definitions/IGridStyling" }, + "innerGrid": { "$ref": "#/definitions/IGridStyling" } + } + }, + "pageBreak": { + "title": "Page break", + "description": "Optionally insert page-break before/after component when rendered in PDF", + "type": "object", + "properties": { + "breakBefore": { + "title": "Page break before", + "description": "PDF only: Value or expression indicating whether a page break should be added before the component. Can be either: 'auto' (default), 'always', or 'avoid'.", + "examples": ["auto", "always", "avoid"], + "default": "auto", + "$ref": "expression.schema.v1.json#/definitions/string" + }, + "breakAfter": { + "title": "Page break after", + "description": "PDF only: Value or expression indicating whether a page break should be added after the component. Can be either: 'auto' (default), 'always', or 'avoid'.", + "examples": ["auto", "always", "avoid"], + "default": "auto", + "$ref": "expression.schema.v1.json#/definitions/string" + } + }, + "additionalProperties": false + }, + "renderAsSummary": { + "title": "Render as summary", + "description": "Boolean value indicating if the component should be rendered as a summary. Defaults to false.", + "default": false, + "type": "boolean" + }, + "forceShowInSummary": { + "title": "Force show in summary", + "description": "Will force show the component in a summary even if hideEmptyFields is set to true in the summary component.", + "default": false, + "$ref": "expression.schema.v1.json#/definitions/boolean" + }, + "type": { "const": "AccordionGroup" }, + "textResourceBindings": { + "properties": { + "title": { + "title": "Title", + "description": "The title of the accordion group", + "$ref": "expression.schema.v1.json#/definitions/string" + }, + "summaryTitle": { + "title": "Summary title", + "description": "Title used in the summary view (overrides the default title)", + "$ref": "expression.schema.v1.json#/definitions/string" + }, + "summaryAccessibleTitle": { + "title": "Accessible summary title", + "description": "Title used for aria-label on the edit button in the summary view (overrides the default and summary title)", + "$ref": "expression.schema.v1.json#/definitions/string" + } + } + }, + "children": { + "title": "Children", + "description": "List of child component IDs to show inside the Accordion (limited to a few component types)", + "type": "array", + "items": { "type": "string" } + } + }, + "required": ["id", "type", "children"], + "title": "AccordionGroup component schema" +} diff --git a/frontend/packages/ux-editor/src/testing/schemas/json/component/ActionButton.schema.v1.json b/frontend/packages/ux-editor/src/testing/schemas/json/component/ActionButton.schema.v1.json index 7c96220eae4..5821edef4f3 100644 --- a/frontend/packages/ux-editor/src/testing/schemas/json/component/ActionButton.schema.v1.json +++ b/frontend/packages/ux-editor/src/testing/schemas/json/component/ActionButton.schema.v1.json @@ -1 +1,77 @@ -{"$id":"https://altinncdn.no/schemas/json/component/ActionButton.schema.v1.json","$schema":"http://json-schema.org/draft-07/schema#","properties":{"id":{"title":"ID","description":"The component ID. Must be unique within all layouts/pages in a layout-set. Cannot end with .","type":"string","pattern":"^[0-9a-zA-Z][0-9a-zA-Z-]*(-?[a-zA-Z]+|[a-zA-Z][0-9]+|-[0-9]{6,})$"},"hidden":{"title":"Hidden","description":"Boolean value or expression indicating if the component should be hidden. Defaults to false.","default":false,"$ref":"expression.schema.v1.json#/definitions/boolean"},"grid":{"properties":{"xs":{"$ref":"#/definitions/IGridSize"},"sm":{"$ref":"#/definitions/IGridSize"},"md":{"$ref":"#/definitions/IGridSize"},"lg":{"$ref":"#/definitions/IGridSize"},"xl":{"$ref":"#/definitions/IGridSize"},"labelGrid":{"$ref":"#/definitions/IGridStyling"},"innerGrid":{"$ref":"#/definitions/IGridStyling"}}},"pageBreak":{"title":"Page break","description":"Optionally insert page-break before/after component when rendered in PDF","type":"object","properties":{"breakBefore":{"title":"Page break before","description":"PDF only: Value or expression indicating whether a page break should be added before the component. Can be either: 'auto' (default), 'always', or 'avoid'.","examples":["auto","always","avoid"],"default":"auto","$ref":"expression.schema.v1.json#/definitions/string"},"breakAfter":{"title":"Page break after","description":"PDF only: Value or expression indicating whether a page break should be added after the component. Can be either: 'auto' (default), 'always', or 'avoid'.","examples":["auto","always","avoid"],"default":"auto","$ref":"expression.schema.v1.json#/definitions/string"}},"additionalProperties":false},"type":{"const":"ActionButton"},"textResourceBindings":{"type":"object","properties":{"title":{"title":"Button title/text","description":"The text to display on the button.","$ref":"expression.schema.v1.json#/definitions/string"}},"additionalProperties":false},"action":{"title":"Action","description":"The action to perform when the button is clicked.","enum":["instantiate","confirm","sign","reject"],"type":"string"},"buttonStyle":{"title":"Button style","description":"The style/color scheme of the button.","enum":["primary","secondary"],"type":"string"}},"required":["id","type","action","buttonStyle"],"title":"ActionButton component schema"} \ No newline at end of file +{ + "$id": "https://altinncdn.no/schemas/json/component/ActionButton.schema.v1.json", + "$schema": "http://json-schema.org/draft-07/schema#", + "properties": { + "id": { + "title": "ID", + "description": "The component ID. Must be unique within all layouts/pages in a layout-set. Cannot end with .", + "type": "string", + "pattern": "^[0-9a-zA-Z][0-9a-zA-Z-]*(-?[a-zA-Z]+|[a-zA-Z][0-9]+|-[0-9]{6,})$" + }, + "hidden": { + "title": "Hidden", + "description": "Boolean value or expression indicating if the component should be hidden. Defaults to false.", + "default": false, + "$ref": "expression.schema.v1.json#/definitions/boolean" + }, + "grid": { + "properties": { + "xs": { "$ref": "#/definitions/IGridSize" }, + "sm": { "$ref": "#/definitions/IGridSize" }, + "md": { "$ref": "#/definitions/IGridSize" }, + "lg": { "$ref": "#/definitions/IGridSize" }, + "xl": { "$ref": "#/definitions/IGridSize" }, + "labelGrid": { "$ref": "#/definitions/IGridStyling" }, + "innerGrid": { "$ref": "#/definitions/IGridStyling" } + } + }, + "pageBreak": { + "title": "Page break", + "description": "Optionally insert page-break before/after component when rendered in PDF", + "type": "object", + "properties": { + "breakBefore": { + "title": "Page break before", + "description": "PDF only: Value or expression indicating whether a page break should be added before the component. Can be either: 'auto' (default), 'always', or 'avoid'.", + "examples": ["auto", "always", "avoid"], + "default": "auto", + "$ref": "expression.schema.v1.json#/definitions/string" + }, + "breakAfter": { + "title": "Page break after", + "description": "PDF only: Value or expression indicating whether a page break should be added after the component. Can be either: 'auto' (default), 'always', or 'avoid'.", + "examples": ["auto", "always", "avoid"], + "default": "auto", + "$ref": "expression.schema.v1.json#/definitions/string" + } + }, + "additionalProperties": false + }, + "type": { "const": "ActionButton" }, + "textResourceBindings": { + "type": "object", + "properties": { + "title": { + "title": "Button title/text", + "description": "The text to display on the button.", + "$ref": "expression.schema.v1.json#/definitions/string" + } + }, + "additionalProperties": false + }, + "action": { + "title": "Action", + "description": "The action to perform when the button is clicked.", + "enum": ["instantiate", "confirm", "sign", "reject"], + "type": "string" + }, + "buttonStyle": { + "title": "Button style", + "description": "The style/color scheme of the button.", + "enum": ["primary", "secondary"], + "type": "string" + } + }, + "required": ["id", "type", "action", "buttonStyle"], + "title": "ActionButton component schema" +} diff --git a/frontend/packages/ux-editor/src/testing/schemas/json/component/Address.schema.v1.json b/frontend/packages/ux-editor/src/testing/schemas/json/component/Address.schema.v1.json index 85c2dc36246..56453ff3bc5 100644 --- a/frontend/packages/ux-editor/src/testing/schemas/json/component/Address.schema.v1.json +++ b/frontend/packages/ux-editor/src/testing/schemas/json/component/Address.schema.v1.json @@ -1 +1,186 @@ -{"$id":"https://altinncdn.no/schemas/json/component/Address.schema.v1.json","$schema":"http://json-schema.org/draft-07/schema#","properties":{"id":{"title":"ID","description":"The component ID. Must be unique within all layouts/pages in a layout-set. Cannot end with .","type":"string","pattern":"^[0-9a-zA-Z][0-9a-zA-Z-]*(-?[a-zA-Z]+|[a-zA-Z][0-9]+|-[0-9]{6,})$"},"hidden":{"title":"Hidden","description":"Boolean value or expression indicating if the component should be hidden. Defaults to false.","default":false,"$ref":"expression.schema.v1.json#/definitions/boolean"},"grid":{"properties":{"xs":{"$ref":"#/definitions/IGridSize"},"sm":{"$ref":"#/definitions/IGridSize"},"md":{"$ref":"#/definitions/IGridSize"},"lg":{"$ref":"#/definitions/IGridSize"},"xl":{"$ref":"#/definitions/IGridSize"},"labelGrid":{"$ref":"#/definitions/IGridStyling"},"innerGrid":{"$ref":"#/definitions/IGridStyling"}}},"pageBreak":{"title":"Page break","description":"Optionally insert page-break before/after component when rendered in PDF","type":"object","properties":{"breakBefore":{"title":"Page break before","description":"PDF only: Value or expression indicating whether a page break should be added before the component. Can be either: 'auto' (default), 'always', or 'avoid'.","examples":["auto","always","avoid"],"default":"auto","$ref":"expression.schema.v1.json#/definitions/string"},"breakAfter":{"title":"Page break after","description":"PDF only: Value or expression indicating whether a page break should be added after the component. Can be either: 'auto' (default), 'always', or 'avoid'.","examples":["auto","always","avoid"],"default":"auto","$ref":"expression.schema.v1.json#/definitions/string"}},"additionalProperties":false},"readOnly":{"title":"Read only/disabled?","description":"Boolean value or expression indicating if the component should be read only/disabled. Defaults to false.
Please note that even with read-only fields in components, it may currently be possible to update the field by modifying the request sent to the API or through a direct API call.","default":false,"$ref":"expression.schema.v1.json#/definitions/boolean"},"required":{"title":"Required?","description":"Boolean value or expression indicating if the component should be required. Defaults to false.","default":false,"$ref":"expression.schema.v1.json#/definitions/boolean"},"showValidations":{"title":"Validation types","description":"List of validation types to show","type":"array","items":{"enum":["Schema","Component","Expression","CustomBackend","Required","AllExceptRequired","All"],"type":"string"}},"renderAsSummary":{"title":"Render as summary","description":"Boolean value indicating if the component should be rendered as a summary. Defaults to false.","default":false,"type":"boolean"},"forceShowInSummary":{"title":"Force show in summary","description":"Will force show the component in a summary even if hideEmptyFields is set to true in the summary component.","default":false,"$ref":"expression.schema.v1.json#/definitions/boolean"},"labelSettings":{"title":"ILabelSettings","type":"object","properties":{"optionalIndicator":{"title":"Optional indicator","description":"Show optional indicator on label","type":"boolean"}},"additionalProperties":false},"type":{"const":"Address"},"textResourceBindings":{"properties":{"title":{"title":"Title","description":"Title of the component","$ref":"expression.schema.v1.json#/definitions/string"},"tableTitle":{"title":"Table title","description":"Title used in the table view (overrides the default title)","$ref":"expression.schema.v1.json#/definitions/string"},"shortName":{"title":"Short name (for validation)","description":"Alternative name used for required validation messages (overrides the default title)","$ref":"expression.schema.v1.json#/definitions/string"},"requiredValidation":{"title":"Required validation message","description":"Full validation message shown when the component is required and no value has been entered (overrides both the default and shortName)","$ref":"expression.schema.v1.json#/definitions/string"},"summaryTitle":{"title":"Summary title","description":"Title used in the summary view (overrides the default title)","$ref":"expression.schema.v1.json#/definitions/string"},"summaryAccessibleTitle":{"title":"Accessible summary title","description":"Title used for aria-label on the edit button in the summary view (overrides the default and summary title)","$ref":"expression.schema.v1.json#/definitions/string"},"careOfTitle":{"title":"Care Of Title","description":"Title for care-of","$ref":"expression.schema.v1.json#/definitions/string"},"zipCodeTitle":{"title":"Zip Code Title","description":"Title for the zip code","$ref":"expression.schema.v1.json#/definitions/string"},"postPlaceTitle":{"title":"Post place Title","description":"Title for post place","$ref":"expression.schema.v1.json#/definitions/string"},"houseNumberTitle":{"title":"House number Title","description":"Title for house number","$ref":"expression.schema.v1.json#/definitions/string"}}},"dataModelBindings":{"title":"IDataModelBindingsForAddress","type":"object","properties":{"address":{"type":"string"},"zipCode":{"type":"string"},"postPlace":{"type":"string"},"careOf":{"type":"string"},"houseNumber":{"type":"string"}},"required":["address","zipCode","postPlace"],"additionalProperties":false},"saveWhileTyping":{"title":"Automatic saving while typing","description":"Lets you control how long we wait before saving the value locally while typing. This value is usually also used to determine how long we wait before saving the value to the server. The default value is 400 milliseconds.","default":400,"type":"number"},"simplified":{"title":"Simplified","description":"Whether to use the simplified address input or not","default":true,"type":"boolean"}},"required":["id","type","dataModelBindings"],"title":"Address component schema"} \ No newline at end of file +{ + "$id": "https://altinncdn.no/schemas/json/component/Address.schema.v1.json", + "$schema": "http://json-schema.org/draft-07/schema#", + "properties": { + "id": { + "title": "ID", + "description": "The component ID. Must be unique within all layouts/pages in a layout-set. Cannot end with .", + "type": "string", + "pattern": "^[0-9a-zA-Z][0-9a-zA-Z-]*(-?[a-zA-Z]+|[a-zA-Z][0-9]+|-[0-9]{6,})$" + }, + "hidden": { + "title": "Hidden", + "description": "Boolean value or expression indicating if the component should be hidden. Defaults to false.", + "default": false, + "$ref": "expression.schema.v1.json#/definitions/boolean" + }, + "grid": { + "properties": { + "xs": { "$ref": "#/definitions/IGridSize" }, + "sm": { "$ref": "#/definitions/IGridSize" }, + "md": { "$ref": "#/definitions/IGridSize" }, + "lg": { "$ref": "#/definitions/IGridSize" }, + "xl": { "$ref": "#/definitions/IGridSize" }, + "labelGrid": { "$ref": "#/definitions/IGridStyling" }, + "innerGrid": { "$ref": "#/definitions/IGridStyling" } + } + }, + "pageBreak": { + "title": "Page break", + "description": "Optionally insert page-break before/after component when rendered in PDF", + "type": "object", + "properties": { + "breakBefore": { + "title": "Page break before", + "description": "PDF only: Value or expression indicating whether a page break should be added before the component. Can be either: 'auto' (default), 'always', or 'avoid'.", + "examples": ["auto", "always", "avoid"], + "default": "auto", + "$ref": "expression.schema.v1.json#/definitions/string" + }, + "breakAfter": { + "title": "Page break after", + "description": "PDF only: Value or expression indicating whether a page break should be added after the component. Can be either: 'auto' (default), 'always', or 'avoid'.", + "examples": ["auto", "always", "avoid"], + "default": "auto", + "$ref": "expression.schema.v1.json#/definitions/string" + } + }, + "additionalProperties": false + }, + "readOnly": { + "title": "Read only/disabled?", + "description": "Boolean value or expression indicating if the component should be read only/disabled. Defaults to false.
Please note that even with read-only fields in components, it may currently be possible to update the field by modifying the request sent to the API or through a direct API call.", + "default": false, + "$ref": "expression.schema.v1.json#/definitions/boolean" + }, + "required": { + "title": "Required?", + "description": "Boolean value or expression indicating if the component should be required. Defaults to false.", + "default": false, + "$ref": "expression.schema.v1.json#/definitions/boolean" + }, + "showValidations": { + "title": "Validation types", + "description": "List of validation types to show", + "type": "array", + "items": { + "enum": [ + "Schema", + "Component", + "Expression", + "CustomBackend", + "Required", + "AllExceptRequired", + "All" + ], + "type": "string" + } + }, + "renderAsSummary": { + "title": "Render as summary", + "description": "Boolean value indicating if the component should be rendered as a summary. Defaults to false.", + "default": false, + "type": "boolean" + }, + "forceShowInSummary": { + "title": "Force show in summary", + "description": "Will force show the component in a summary even if hideEmptyFields is set to true in the summary component.", + "default": false, + "$ref": "expression.schema.v1.json#/definitions/boolean" + }, + "labelSettings": { + "title": "ILabelSettings", + "type": "object", + "properties": { + "optionalIndicator": { + "title": "Optional indicator", + "description": "Show optional indicator on label", + "type": "boolean" + } + }, + "additionalProperties": false + }, + "type": { "const": "Address" }, + "textResourceBindings": { + "properties": { + "title": { + "title": "Title", + "description": "Title of the component", + "$ref": "expression.schema.v1.json#/definitions/string" + }, + "tableTitle": { + "title": "Table title", + "description": "Title used in the table view (overrides the default title)", + "$ref": "expression.schema.v1.json#/definitions/string" + }, + "shortName": { + "title": "Short name (for validation)", + "description": "Alternative name used for required validation messages (overrides the default title)", + "$ref": "expression.schema.v1.json#/definitions/string" + }, + "requiredValidation": { + "title": "Required validation message", + "description": "Full validation message shown when the component is required and no value has been entered (overrides both the default and shortName)", + "$ref": "expression.schema.v1.json#/definitions/string" + }, + "summaryTitle": { + "title": "Summary title", + "description": "Title used in the summary view (overrides the default title)", + "$ref": "expression.schema.v1.json#/definitions/string" + }, + "summaryAccessibleTitle": { + "title": "Accessible summary title", + "description": "Title used for aria-label on the edit button in the summary view (overrides the default and summary title)", + "$ref": "expression.schema.v1.json#/definitions/string" + }, + "careOfTitle": { + "title": "Care Of Title", + "description": "Title for care-of", + "$ref": "expression.schema.v1.json#/definitions/string" + }, + "zipCodeTitle": { + "title": "Zip Code Title", + "description": "Title for the zip code", + "$ref": "expression.schema.v1.json#/definitions/string" + }, + "postPlaceTitle": { + "title": "Post place Title", + "description": "Title for post place", + "$ref": "expression.schema.v1.json#/definitions/string" + }, + "houseNumberTitle": { + "title": "House number Title", + "description": "Title for house number", + "$ref": "expression.schema.v1.json#/definitions/string" + } + } + }, + "dataModelBindings": { + "title": "IDataModelBindingsForAddress", + "type": "object", + "properties": { + "address": { "type": "string" }, + "zipCode": { "type": "string" }, + "postPlace": { "type": "string" }, + "careOf": { "type": "string" }, + "houseNumber": { "type": "string" } + }, + "required": ["address", "zipCode", "postPlace"], + "additionalProperties": false + }, + "saveWhileTyping": { + "title": "Automatic saving while typing", + "description": "Lets you control how long we wait before saving the value locally while typing. This value is usually also used to determine how long we wait before saving the value to the server. The default value is 400 milliseconds.", + "default": 400, + "type": "number" + }, + "simplified": { + "title": "Simplified", + "description": "Whether to use the simplified address input or not", + "default": true, + "type": "boolean" + } + }, + "required": ["id", "type", "dataModelBindings"], + "title": "Address component schema" +} diff --git a/frontend/packages/ux-editor/src/testing/schemas/json/component/Alert.schema.v1.json b/frontend/packages/ux-editor/src/testing/schemas/json/component/Alert.schema.v1.json index 8efd084e7e5..7b30e018ef7 100644 --- a/frontend/packages/ux-editor/src/testing/schemas/json/component/Alert.schema.v1.json +++ b/frontend/packages/ux-editor/src/testing/schemas/json/component/Alert.schema.v1.json @@ -1 +1,76 @@ -{"$id":"https://altinncdn.no/schemas/json/component/Alert.schema.v1.json","$schema":"http://json-schema.org/draft-07/schema#","properties":{"id":{"title":"ID","description":"The component ID. Must be unique within all layouts/pages in a layout-set. Cannot end with .","type":"string","pattern":"^[0-9a-zA-Z][0-9a-zA-Z-]*(-?[a-zA-Z]+|[a-zA-Z][0-9]+|-[0-9]{6,})$"},"hidden":{"title":"Hidden","description":"Boolean value or expression indicating if the component should be hidden. Defaults to false.","default":false,"$ref":"expression.schema.v1.json#/definitions/boolean"},"grid":{"properties":{"xs":{"$ref":"#/definitions/IGridSize"},"sm":{"$ref":"#/definitions/IGridSize"},"md":{"$ref":"#/definitions/IGridSize"},"lg":{"$ref":"#/definitions/IGridSize"},"xl":{"$ref":"#/definitions/IGridSize"},"labelGrid":{"$ref":"#/definitions/IGridStyling"},"innerGrid":{"$ref":"#/definitions/IGridStyling"}}},"pageBreak":{"title":"Page break","description":"Optionally insert page-break before/after component when rendered in PDF","type":"object","properties":{"breakBefore":{"title":"Page break before","description":"PDF only: Value or expression indicating whether a page break should be added before the component. Can be either: 'auto' (default), 'always', or 'avoid'.","examples":["auto","always","avoid"],"default":"auto","$ref":"expression.schema.v1.json#/definitions/string"},"breakAfter":{"title":"Page break after","description":"PDF only: Value or expression indicating whether a page break should be added after the component. Can be either: 'auto' (default), 'always', or 'avoid'.","examples":["auto","always","avoid"],"default":"auto","$ref":"expression.schema.v1.json#/definitions/string"}},"additionalProperties":false},"type":{"const":"Alert"},"textResourceBindings":{"type":"object","properties":{"title":{"title":"Title","description":"The title of the alert","$ref":"expression.schema.v1.json#/definitions/string"},"body":{"title":"Body","description":"The body text of the alert","$ref":"expression.schema.v1.json#/definitions/string"}},"additionalProperties":false},"severity":{"title":"Alert severity","description":"The severity of the alert","enum":["success","warning","danger","info"],"type":"string"}},"required":["id","type","severity"],"title":"Alert component schema"} \ No newline at end of file +{ + "$id": "https://altinncdn.no/schemas/json/component/Alert.schema.v1.json", + "$schema": "http://json-schema.org/draft-07/schema#", + "properties": { + "id": { + "title": "ID", + "description": "The component ID. Must be unique within all layouts/pages in a layout-set. Cannot end with .", + "type": "string", + "pattern": "^[0-9a-zA-Z][0-9a-zA-Z-]*(-?[a-zA-Z]+|[a-zA-Z][0-9]+|-[0-9]{6,})$" + }, + "hidden": { + "title": "Hidden", + "description": "Boolean value or expression indicating if the component should be hidden. Defaults to false.", + "default": false, + "$ref": "expression.schema.v1.json#/definitions/boolean" + }, + "grid": { + "properties": { + "xs": { "$ref": "#/definitions/IGridSize" }, + "sm": { "$ref": "#/definitions/IGridSize" }, + "md": { "$ref": "#/definitions/IGridSize" }, + "lg": { "$ref": "#/definitions/IGridSize" }, + "xl": { "$ref": "#/definitions/IGridSize" }, + "labelGrid": { "$ref": "#/definitions/IGridStyling" }, + "innerGrid": { "$ref": "#/definitions/IGridStyling" } + } + }, + "pageBreak": { + "title": "Page break", + "description": "Optionally insert page-break before/after component when rendered in PDF", + "type": "object", + "properties": { + "breakBefore": { + "title": "Page break before", + "description": "PDF only: Value or expression indicating whether a page break should be added before the component. Can be either: 'auto' (default), 'always', or 'avoid'.", + "examples": ["auto", "always", "avoid"], + "default": "auto", + "$ref": "expression.schema.v1.json#/definitions/string" + }, + "breakAfter": { + "title": "Page break after", + "description": "PDF only: Value or expression indicating whether a page break should be added after the component. Can be either: 'auto' (default), 'always', or 'avoid'.", + "examples": ["auto", "always", "avoid"], + "default": "auto", + "$ref": "expression.schema.v1.json#/definitions/string" + } + }, + "additionalProperties": false + }, + "type": { "const": "Alert" }, + "textResourceBindings": { + "type": "object", + "properties": { + "title": { + "title": "Title", + "description": "The title of the alert", + "$ref": "expression.schema.v1.json#/definitions/string" + }, + "body": { + "title": "Body", + "description": "The body text of the alert", + "$ref": "expression.schema.v1.json#/definitions/string" + } + }, + "additionalProperties": false + }, + "severity": { + "title": "Alert severity", + "description": "The severity of the alert", + "enum": ["success", "warning", "danger", "info"], + "type": "string" + } + }, + "required": ["id", "type", "severity"], + "title": "Alert component schema" +} diff --git a/frontend/packages/ux-editor/src/testing/schemas/json/component/AttachmentList.schema.v1.json b/frontend/packages/ux-editor/src/testing/schemas/json/component/AttachmentList.schema.v1.json index 85958543256..f98e09d8834 100644 --- a/frontend/packages/ux-editor/src/testing/schemas/json/component/AttachmentList.schema.v1.json +++ b/frontend/packages/ux-editor/src/testing/schemas/json/component/AttachmentList.schema.v1.json @@ -1 +1,71 @@ -{"$id":"https://altinncdn.no/schemas/json/component/AttachmentList.schema.v1.json","$schema":"http://json-schema.org/draft-07/schema#","properties":{"id":{"title":"ID","description":"The component ID. Must be unique within all layouts/pages in a layout-set. Cannot end with .","type":"string","pattern":"^[0-9a-zA-Z][0-9a-zA-Z-]*(-?[a-zA-Z]+|[a-zA-Z][0-9]+|-[0-9]{6,})$"},"hidden":{"title":"Hidden","description":"Boolean value or expression indicating if the component should be hidden. Defaults to false.","default":false,"$ref":"expression.schema.v1.json#/definitions/boolean"},"grid":{"properties":{"xs":{"$ref":"#/definitions/IGridSize"},"sm":{"$ref":"#/definitions/IGridSize"},"md":{"$ref":"#/definitions/IGridSize"},"lg":{"$ref":"#/definitions/IGridSize"},"xl":{"$ref":"#/definitions/IGridSize"},"labelGrid":{"$ref":"#/definitions/IGridStyling"},"innerGrid":{"$ref":"#/definitions/IGridStyling"}}},"pageBreak":{"title":"Page break","description":"Optionally insert page-break before/after component when rendered in PDF","type":"object","properties":{"breakBefore":{"title":"Page break before","description":"PDF only: Value or expression indicating whether a page break should be added before the component. Can be either: 'auto' (default), 'always', or 'avoid'.","examples":["auto","always","avoid"],"default":"auto","$ref":"expression.schema.v1.json#/definitions/string"},"breakAfter":{"title":"Page break after","description":"PDF only: Value or expression indicating whether a page break should be added after the component. Can be either: 'auto' (default), 'always', or 'avoid'.","examples":["auto","always","avoid"],"default":"auto","$ref":"expression.schema.v1.json#/definitions/string"}},"additionalProperties":false},"type":{"const":"AttachmentList"},"textResourceBindings":{"type":"object","properties":{"title":{"title":"Title","description":"Title shown above the attachment list","$ref":"expression.schema.v1.json#/definitions/string"}},"additionalProperties":false},"dataTypeIds":{"title":"Data type IDs","description":"List of data type IDs for the attachment list to show","type":"array","items":{"type":"string"}}},"required":["id","type"],"title":"AttachmentList component schema"} \ No newline at end of file +{ + "$id": "https://altinncdn.no/schemas/json/component/AttachmentList.schema.v1.json", + "$schema": "http://json-schema.org/draft-07/schema#", + "properties": { + "id": { + "title": "ID", + "description": "The component ID. Must be unique within all layouts/pages in a layout-set. Cannot end with .", + "type": "string", + "pattern": "^[0-9a-zA-Z][0-9a-zA-Z-]*(-?[a-zA-Z]+|[a-zA-Z][0-9]+|-[0-9]{6,})$" + }, + "hidden": { + "title": "Hidden", + "description": "Boolean value or expression indicating if the component should be hidden. Defaults to false.", + "default": false, + "$ref": "expression.schema.v1.json#/definitions/boolean" + }, + "grid": { + "properties": { + "xs": { "$ref": "#/definitions/IGridSize" }, + "sm": { "$ref": "#/definitions/IGridSize" }, + "md": { "$ref": "#/definitions/IGridSize" }, + "lg": { "$ref": "#/definitions/IGridSize" }, + "xl": { "$ref": "#/definitions/IGridSize" }, + "labelGrid": { "$ref": "#/definitions/IGridStyling" }, + "innerGrid": { "$ref": "#/definitions/IGridStyling" } + } + }, + "pageBreak": { + "title": "Page break", + "description": "Optionally insert page-break before/after component when rendered in PDF", + "type": "object", + "properties": { + "breakBefore": { + "title": "Page break before", + "description": "PDF only: Value or expression indicating whether a page break should be added before the component. Can be either: 'auto' (default), 'always', or 'avoid'.", + "examples": ["auto", "always", "avoid"], + "default": "auto", + "$ref": "expression.schema.v1.json#/definitions/string" + }, + "breakAfter": { + "title": "Page break after", + "description": "PDF only: Value or expression indicating whether a page break should be added after the component. Can be either: 'auto' (default), 'always', or 'avoid'.", + "examples": ["auto", "always", "avoid"], + "default": "auto", + "$ref": "expression.schema.v1.json#/definitions/string" + } + }, + "additionalProperties": false + }, + "type": { "const": "AttachmentList" }, + "textResourceBindings": { + "type": "object", + "properties": { + "title": { + "title": "Title", + "description": "Title shown above the attachment list", + "$ref": "expression.schema.v1.json#/definitions/string" + } + }, + "additionalProperties": false + }, + "dataTypeIds": { + "title": "Data type IDs", + "description": "List of data type IDs for the attachment list to show", + "type": "array", + "items": { "type": "string" } + } + }, + "required": ["id", "type"], + "title": "AttachmentList component schema" +} diff --git a/frontend/packages/ux-editor/src/testing/schemas/json/component/Audio.schema.v1.json b/frontend/packages/ux-editor/src/testing/schemas/json/component/Audio.schema.v1.json index 404f47fdb08..96ce7ee32ff 100644 --- a/frontend/packages/ux-editor/src/testing/schemas/json/component/Audio.schema.v1.json +++ b/frontend/packages/ux-editor/src/testing/schemas/json/component/Audio.schema.v1.json @@ -1 +1,72 @@ -{"$id":"https://altinncdn.no/schemas/json/component/Audio.schema.v1.json","$schema":"http://json-schema.org/draft-07/schema#","properties":{"id":{"title":"ID","description":"The component ID. Must be unique within all layouts/pages in a layout-set. Cannot end with .","type":"string","pattern":"^[0-9a-zA-Z][0-9a-zA-Z-]*(-?[a-zA-Z]+|[a-zA-Z][0-9]+|-[0-9]{6,})$"},"hidden":{"title":"Hidden","description":"Boolean value or expression indicating if the component should be hidden. Defaults to false.","default":false,"$ref":"expression.schema.v1.json#/definitions/boolean"},"grid":{"properties":{"xs":{"$ref":"#/definitions/IGridSize"},"sm":{"$ref":"#/definitions/IGridSize"},"md":{"$ref":"#/definitions/IGridSize"},"lg":{"$ref":"#/definitions/IGridSize"},"xl":{"$ref":"#/definitions/IGridSize"},"labelGrid":{"$ref":"#/definitions/IGridStyling"},"innerGrid":{"$ref":"#/definitions/IGridStyling"}}},"pageBreak":{"title":"Page break","description":"Optionally insert page-break before/after component when rendered in PDF","type":"object","properties":{"breakBefore":{"title":"Page break before","description":"PDF only: Value or expression indicating whether a page break should be added before the component. Can be either: 'auto' (default), 'always', or 'avoid'.","examples":["auto","always","avoid"],"default":"auto","$ref":"expression.schema.v1.json#/definitions/string"},"breakAfter":{"title":"Page break after","description":"PDF only: Value or expression indicating whether a page break should be added after the component. Can be either: 'auto' (default), 'always', or 'avoid'.","examples":["auto","always","avoid"],"default":"auto","$ref":"expression.schema.v1.json#/definitions/string"}},"additionalProperties":false},"type":{"const":"Audio"},"textResourceBindings":{"type":"object","properties":{"altText":{"title":"Alt text","description":"Alternative text for the audio (for screen readers).","$ref":"expression.schema.v1.json#/definitions/string"}},"additionalProperties":false},"audio":{"title":"IAudio","type":"object","properties":{"src":{"$ref":"#/definitions/AudioSrc"}},"required":["src"],"additionalProperties":false}},"required":["id","type"],"title":"Audio component schema"} \ No newline at end of file +{ + "$id": "https://altinncdn.no/schemas/json/component/Audio.schema.v1.json", + "$schema": "http://json-schema.org/draft-07/schema#", + "properties": { + "id": { + "title": "ID", + "description": "The component ID. Must be unique within all layouts/pages in a layout-set. Cannot end with .", + "type": "string", + "pattern": "^[0-9a-zA-Z][0-9a-zA-Z-]*(-?[a-zA-Z]+|[a-zA-Z][0-9]+|-[0-9]{6,})$" + }, + "hidden": { + "title": "Hidden", + "description": "Boolean value or expression indicating if the component should be hidden. Defaults to false.", + "default": false, + "$ref": "expression.schema.v1.json#/definitions/boolean" + }, + "grid": { + "properties": { + "xs": { "$ref": "#/definitions/IGridSize" }, + "sm": { "$ref": "#/definitions/IGridSize" }, + "md": { "$ref": "#/definitions/IGridSize" }, + "lg": { "$ref": "#/definitions/IGridSize" }, + "xl": { "$ref": "#/definitions/IGridSize" }, + "labelGrid": { "$ref": "#/definitions/IGridStyling" }, + "innerGrid": { "$ref": "#/definitions/IGridStyling" } + } + }, + "pageBreak": { + "title": "Page break", + "description": "Optionally insert page-break before/after component when rendered in PDF", + "type": "object", + "properties": { + "breakBefore": { + "title": "Page break before", + "description": "PDF only: Value or expression indicating whether a page break should be added before the component. Can be either: 'auto' (default), 'always', or 'avoid'.", + "examples": ["auto", "always", "avoid"], + "default": "auto", + "$ref": "expression.schema.v1.json#/definitions/string" + }, + "breakAfter": { + "title": "Page break after", + "description": "PDF only: Value or expression indicating whether a page break should be added after the component. Can be either: 'auto' (default), 'always', or 'avoid'.", + "examples": ["auto", "always", "avoid"], + "default": "auto", + "$ref": "expression.schema.v1.json#/definitions/string" + } + }, + "additionalProperties": false + }, + "type": { "const": "Audio" }, + "textResourceBindings": { + "type": "object", + "properties": { + "altText": { + "title": "Alt text", + "description": "Alternative text for the audio (for screen readers).", + "$ref": "expression.schema.v1.json#/definitions/string" + } + }, + "additionalProperties": false + }, + "audio": { + "title": "IAudio", + "type": "object", + "properties": { "src": { "$ref": "#/definitions/AudioSrc" } }, + "required": ["src"], + "additionalProperties": false + } + }, + "required": ["id", "type"], + "title": "Audio component schema" +} diff --git a/frontend/packages/ux-editor/src/testing/schemas/json/component/Button.schema.v1.json b/frontend/packages/ux-editor/src/testing/schemas/json/component/Button.schema.v1.json index 6d954d7ca2f..da68744a360 100644 --- a/frontend/packages/ux-editor/src/testing/schemas/json/component/Button.schema.v1.json +++ b/frontend/packages/ux-editor/src/testing/schemas/json/component/Button.schema.v1.json @@ -1 +1,79 @@ -{"$id":"https://altinncdn.no/schemas/json/component/Button.schema.v1.json","$schema":"http://json-schema.org/draft-07/schema#","properties":{"id":{"title":"ID","description":"The component ID. Must be unique within all layouts/pages in a layout-set. Cannot end with .","type":"string","pattern":"^[0-9a-zA-Z][0-9a-zA-Z-]*(-?[a-zA-Z]+|[a-zA-Z][0-9]+|-[0-9]{6,})$"},"hidden":{"title":"Hidden","description":"Boolean value or expression indicating if the component should be hidden. Defaults to false.","default":false,"$ref":"expression.schema.v1.json#/definitions/boolean"},"grid":{"properties":{"xs":{"$ref":"#/definitions/IGridSize"},"sm":{"$ref":"#/definitions/IGridSize"},"md":{"$ref":"#/definitions/IGridSize"},"lg":{"$ref":"#/definitions/IGridSize"},"xl":{"$ref":"#/definitions/IGridSize"},"labelGrid":{"$ref":"#/definitions/IGridStyling"},"innerGrid":{"$ref":"#/definitions/IGridStyling"}}},"pageBreak":{"title":"Page break","description":"Optionally insert page-break before/after component when rendered in PDF","type":"object","properties":{"breakBefore":{"title":"Page break before","description":"PDF only: Value or expression indicating whether a page break should be added before the component. Can be either: 'auto' (default), 'always', or 'avoid'.","examples":["auto","always","avoid"],"default":"auto","$ref":"expression.schema.v1.json#/definitions/string"},"breakAfter":{"title":"Page break after","description":"PDF only: Value or expression indicating whether a page break should be added after the component. Can be either: 'auto' (default), 'always', or 'avoid'.","examples":["auto","always","avoid"],"default":"auto","$ref":"expression.schema.v1.json#/definitions/string"}},"additionalProperties":false},"type":{"const":"Button"},"textResourceBindings":{"type":"object","properties":{"title":{"title":"Title","description":"The title/text on the button","$ref":"expression.schema.v1.json#/definitions/string"}},"additionalProperties":false},"mode":{"title":"Mode","description":"The mode of the button","default":"submit","enum":["submit","save","instantiate"],"type":"string"},"mapping":{"title":"Mapping","description":"A mapping of key-value pairs (usually used for mapping a path in the data model to a query string parameter).","type":"object","properties":{},"additionalProperties":{"type":"string"}}},"required":["id","type"],"title":"Button component schema"} \ No newline at end of file +{ + "$id": "https://altinncdn.no/schemas/json/component/Button.schema.v1.json", + "$schema": "http://json-schema.org/draft-07/schema#", + "properties": { + "id": { + "title": "ID", + "description": "The component ID. Must be unique within all layouts/pages in a layout-set. Cannot end with .", + "type": "string", + "pattern": "^[0-9a-zA-Z][0-9a-zA-Z-]*(-?[a-zA-Z]+|[a-zA-Z][0-9]+|-[0-9]{6,})$" + }, + "hidden": { + "title": "Hidden", + "description": "Boolean value or expression indicating if the component should be hidden. Defaults to false.", + "default": false, + "$ref": "expression.schema.v1.json#/definitions/boolean" + }, + "grid": { + "properties": { + "xs": { "$ref": "#/definitions/IGridSize" }, + "sm": { "$ref": "#/definitions/IGridSize" }, + "md": { "$ref": "#/definitions/IGridSize" }, + "lg": { "$ref": "#/definitions/IGridSize" }, + "xl": { "$ref": "#/definitions/IGridSize" }, + "labelGrid": { "$ref": "#/definitions/IGridStyling" }, + "innerGrid": { "$ref": "#/definitions/IGridStyling" } + } + }, + "pageBreak": { + "title": "Page break", + "description": "Optionally insert page-break before/after component when rendered in PDF", + "type": "object", + "properties": { + "breakBefore": { + "title": "Page break before", + "description": "PDF only: Value or expression indicating whether a page break should be added before the component. Can be either: 'auto' (default), 'always', or 'avoid'.", + "examples": ["auto", "always", "avoid"], + "default": "auto", + "$ref": "expression.schema.v1.json#/definitions/string" + }, + "breakAfter": { + "title": "Page break after", + "description": "PDF only: Value or expression indicating whether a page break should be added after the component. Can be either: 'auto' (default), 'always', or 'avoid'.", + "examples": ["auto", "always", "avoid"], + "default": "auto", + "$ref": "expression.schema.v1.json#/definitions/string" + } + }, + "additionalProperties": false + }, + "type": { "const": "Button" }, + "textResourceBindings": { + "type": "object", + "properties": { + "title": { + "title": "Title", + "description": "The title/text on the button", + "$ref": "expression.schema.v1.json#/definitions/string" + } + }, + "additionalProperties": false + }, + "mode": { + "title": "Mode", + "description": "The mode of the button", + "default": "submit", + "enum": ["submit", "save", "instantiate"], + "type": "string" + }, + "mapping": { + "title": "Mapping", + "description": "A mapping of key-value pairs (usually used for mapping a path in the data model to a query string parameter).", + "type": "object", + "properties": {}, + "additionalProperties": { "type": "string" } + } + }, + "required": ["id", "type"], + "title": "Button component schema" +} diff --git a/frontend/packages/ux-editor/src/testing/schemas/json/component/ButtonGroup.schema.v1.json b/frontend/packages/ux-editor/src/testing/schemas/json/component/ButtonGroup.schema.v1.json index 0ecb90014c9..f84b2537b94 100644 --- a/frontend/packages/ux-editor/src/testing/schemas/json/component/ButtonGroup.schema.v1.json +++ b/frontend/packages/ux-editor/src/testing/schemas/json/component/ButtonGroup.schema.v1.json @@ -1 +1,113 @@ -{"$id":"https://altinncdn.no/schemas/json/component/ButtonGroup.schema.v1.json","$schema":"http://json-schema.org/draft-07/schema#","properties":{"id":{"title":"ID","description":"The component ID. Must be unique within all layouts/pages in a layout-set. Cannot end with .","type":"string","pattern":"^[0-9a-zA-Z][0-9a-zA-Z-]*(-?[a-zA-Z]+|[a-zA-Z][0-9]+|-[0-9]{6,})$"},"hidden":{"title":"Hidden","description":"Boolean value or expression indicating if the component should be hidden. Defaults to false.","default":false,"$ref":"expression.schema.v1.json#/definitions/boolean"},"grid":{"properties":{"xs":{"$ref":"#/definitions/IGridSize"},"sm":{"$ref":"#/definitions/IGridSize"},"md":{"$ref":"#/definitions/IGridSize"},"lg":{"$ref":"#/definitions/IGridSize"},"xl":{"$ref":"#/definitions/IGridSize"},"labelGrid":{"$ref":"#/definitions/IGridStyling"},"innerGrid":{"$ref":"#/definitions/IGridStyling"}}},"pageBreak":{"title":"Page break","description":"Optionally insert page-break before/after component when rendered in PDF","type":"object","properties":{"breakBefore":{"title":"Page break before","description":"PDF only: Value or expression indicating whether a page break should be added before the component. Can be either: 'auto' (default), 'always', or 'avoid'.","examples":["auto","always","avoid"],"default":"auto","$ref":"expression.schema.v1.json#/definitions/string"},"breakAfter":{"title":"Page break after","description":"PDF only: Value or expression indicating whether a page break should be added after the component. Can be either: 'auto' (default), 'always', or 'avoid'.","examples":["auto","always","avoid"],"default":"auto","$ref":"expression.schema.v1.json#/definitions/string"}},"additionalProperties":false},"renderAsSummary":{"title":"Render as summary","description":"Boolean value indicating if the component should be rendered as a summary. Defaults to false.","default":false,"type":"boolean"},"forceShowInSummary":{"title":"Force show in summary","description":"Will force show the component in a summary even if hideEmptyFields is set to true in the summary component.","default":false,"$ref":"expression.schema.v1.json#/definitions/boolean"},"labelSettings":{"title":"ILabelSettings","type":"object","properties":{"optionalIndicator":{"title":"Optional indicator","description":"Show optional indicator on label","type":"boolean"}},"additionalProperties":false},"type":{"const":"ButtonGroup"},"textResourceBindings":{"properties":{"title":{"title":"Title","description":"Label text/title shown above the component","$ref":"expression.schema.v1.json#/definitions/string"},"description":{"title":"Description","description":"Label description shown above the component, below the title","$ref":"expression.schema.v1.json#/definitions/string"},"help":{"title":"Help text","description":"Help text shown in a tooltip when clicking the help button","$ref":"expression.schema.v1.json#/definitions/string"},"summaryTitle":{"title":"Summary title","description":"Title used in the summary view (overrides the default title)","$ref":"expression.schema.v1.json#/definitions/string"},"summaryAccessibleTitle":{"title":"Accessible summary title","description":"Title used for aria-label on the edit button in the summary view (overrides the default and summary title)","$ref":"expression.schema.v1.json#/definitions/string"}}},"children":{"title":"Children","description":"Child component IDs of button-like components to be rendered in this group","type":"array","items":{"type":"string"}}},"required":["id","type","children"],"title":"ButtonGroup component schema"} \ No newline at end of file +{ + "$id": "https://altinncdn.no/schemas/json/component/ButtonGroup.schema.v1.json", + "$schema": "http://json-schema.org/draft-07/schema#", + "properties": { + "id": { + "title": "ID", + "description": "The component ID. Must be unique within all layouts/pages in a layout-set. Cannot end with .", + "type": "string", + "pattern": "^[0-9a-zA-Z][0-9a-zA-Z-]*(-?[a-zA-Z]+|[a-zA-Z][0-9]+|-[0-9]{6,})$" + }, + "hidden": { + "title": "Hidden", + "description": "Boolean value or expression indicating if the component should be hidden. Defaults to false.", + "default": false, + "$ref": "expression.schema.v1.json#/definitions/boolean" + }, + "grid": { + "properties": { + "xs": { "$ref": "#/definitions/IGridSize" }, + "sm": { "$ref": "#/definitions/IGridSize" }, + "md": { "$ref": "#/definitions/IGridSize" }, + "lg": { "$ref": "#/definitions/IGridSize" }, + "xl": { "$ref": "#/definitions/IGridSize" }, + "labelGrid": { "$ref": "#/definitions/IGridStyling" }, + "innerGrid": { "$ref": "#/definitions/IGridStyling" } + } + }, + "pageBreak": { + "title": "Page break", + "description": "Optionally insert page-break before/after component when rendered in PDF", + "type": "object", + "properties": { + "breakBefore": { + "title": "Page break before", + "description": "PDF only: Value or expression indicating whether a page break should be added before the component. Can be either: 'auto' (default), 'always', or 'avoid'.", + "examples": ["auto", "always", "avoid"], + "default": "auto", + "$ref": "expression.schema.v1.json#/definitions/string" + }, + "breakAfter": { + "title": "Page break after", + "description": "PDF only: Value or expression indicating whether a page break should be added after the component. Can be either: 'auto' (default), 'always', or 'avoid'.", + "examples": ["auto", "always", "avoid"], + "default": "auto", + "$ref": "expression.schema.v1.json#/definitions/string" + } + }, + "additionalProperties": false + }, + "renderAsSummary": { + "title": "Render as summary", + "description": "Boolean value indicating if the component should be rendered as a summary. Defaults to false.", + "default": false, + "type": "boolean" + }, + "forceShowInSummary": { + "title": "Force show in summary", + "description": "Will force show the component in a summary even if hideEmptyFields is set to true in the summary component.", + "default": false, + "$ref": "expression.schema.v1.json#/definitions/boolean" + }, + "labelSettings": { + "title": "ILabelSettings", + "type": "object", + "properties": { + "optionalIndicator": { + "title": "Optional indicator", + "description": "Show optional indicator on label", + "type": "boolean" + } + }, + "additionalProperties": false + }, + "type": { "const": "ButtonGroup" }, + "textResourceBindings": { + "properties": { + "title": { + "title": "Title", + "description": "Label text/title shown above the component", + "$ref": "expression.schema.v1.json#/definitions/string" + }, + "description": { + "title": "Description", + "description": "Label description shown above the component, below the title", + "$ref": "expression.schema.v1.json#/definitions/string" + }, + "help": { + "title": "Help text", + "description": "Help text shown in a tooltip when clicking the help button", + "$ref": "expression.schema.v1.json#/definitions/string" + }, + "summaryTitle": { + "title": "Summary title", + "description": "Title used in the summary view (overrides the default title)", + "$ref": "expression.schema.v1.json#/definitions/string" + }, + "summaryAccessibleTitle": { + "title": "Accessible summary title", + "description": "Title used for aria-label on the edit button in the summary view (overrides the default and summary title)", + "$ref": "expression.schema.v1.json#/definitions/string" + } + } + }, + "children": { + "title": "Children", + "description": "Child component IDs of button-like components to be rendered in this group", + "type": "array", + "items": { "type": "string" } + } + }, + "required": ["id", "type", "children"], + "title": "ButtonGroup component schema" +} diff --git a/frontend/packages/ux-editor/src/testing/schemas/json/component/Cards.schema.v1.json b/frontend/packages/ux-editor/src/testing/schemas/json/component/Cards.schema.v1.json index 44558d642c0..3b89dc79b26 100644 --- a/frontend/packages/ux-editor/src/testing/schemas/json/component/Cards.schema.v1.json +++ b/frontend/packages/ux-editor/src/testing/schemas/json/component/Cards.schema.v1.json @@ -1 +1,142 @@ -{"$id":"https://altinncdn.no/schemas/json/component/Cards.schema.v1.json","$schema":"http://json-schema.org/draft-07/schema#","properties":{"id":{"title":"ID","description":"The component ID. Must be unique within all layouts/pages in a layout-set. Cannot end with .","type":"string","pattern":"^[0-9a-zA-Z][0-9a-zA-Z-]*(-?[a-zA-Z]+|[a-zA-Z][0-9]+|-[0-9]{6,})$"},"hidden":{"title":"Hidden","description":"Boolean value or expression indicating if the component should be hidden. Defaults to false.","default":false,"$ref":"expression.schema.v1.json#/definitions/boolean"},"grid":{"properties":{"xs":{"$ref":"#/definitions/IGridSize"},"sm":{"$ref":"#/definitions/IGridSize"},"md":{"$ref":"#/definitions/IGridSize"},"lg":{"$ref":"#/definitions/IGridSize"},"xl":{"$ref":"#/definitions/IGridSize"},"labelGrid":{"$ref":"#/definitions/IGridStyling"},"innerGrid":{"$ref":"#/definitions/IGridStyling"}}},"pageBreak":{"title":"Page break","description":"Optionally insert page-break before/after component when rendered in PDF","type":"object","properties":{"breakBefore":{"title":"Page break before","description":"PDF only: Value or expression indicating whether a page break should be added before the component. Can be either: 'auto' (default), 'always', or 'avoid'.","examples":["auto","always","avoid"],"default":"auto","$ref":"expression.schema.v1.json#/definitions/string"},"breakAfter":{"title":"Page break after","description":"PDF only: Value or expression indicating whether a page break should be added after the component. Can be either: 'auto' (default), 'always', or 'avoid'.","examples":["auto","always","avoid"],"default":"auto","$ref":"expression.schema.v1.json#/definitions/string"}},"additionalProperties":false},"renderAsSummary":{"title":"Render as summary","description":"Boolean value indicating if the component should be rendered as a summary. Defaults to false.","default":false,"type":"boolean"},"forceShowInSummary":{"title":"Force show in summary","description":"Will force show the component in a summary even if hideEmptyFields is set to true in the summary component.","default":false,"$ref":"expression.schema.v1.json#/definitions/boolean"},"type":{"const":"Cards"},"textResourceBindings":{"title":"TRBSummarizable","type":"object","properties":{"summaryTitle":{"title":"Summary title","description":"Title used in the summary view (overrides the default title)","$ref":"expression.schema.v1.json#/definitions/string"},"summaryAccessibleTitle":{"title":"Accessible summary title","description":"Title used for aria-label on the edit button in the summary view (overrides the default and summary title)","$ref":"expression.schema.v1.json#/definitions/string"}}},"mediaPosition":{"title":"ImagePosition","description":"Position of the media (image/video/audio) in each card","default":"top","enum":["top","bottom"],"type":"string"},"minMediaHeight":{"title":"minMediaHeight","description":"Fixed minimum height of media (if media is present)","examples":["100px","100%","100rem"],"default":"150px","type":"string"},"minWidth":{"title":"minWidth","description":"Fixed minimum width of the card","examples":["100","100px","100%","100rem"],"default":"250px","type":"string","pattern":"^[0-9]+(px|rem|%)?$"},"color":{"title":"Card color","description":"The color style for these cards","enum":["neutral","subtle"],"type":"string"},"cards":{"type":"array","items":{"title":"CardConfigExternal","type":"object","properties":{"media":{"title":"Media","description":"Media to display on the top/bottom of the card (must reference an Image, Audio or Video component","type":"string"},"title":{"title":"Title","description":"Title of the card","type":"string"},"description":{"title":"Description/body text","description":"Full text displayed underneath the title, above any component children","type":"string"},"footer":{"title":"Footer","description":"Footer text of the card","type":"string"},"children":{"title":"Children","description":"Child component IDs to show inside the card","type":"array","items":{"type":"string"}}},"additionalProperties":false}}},"required":["id","type","color","cards"],"title":"Cards component schema"} \ No newline at end of file +{ + "$id": "https://altinncdn.no/schemas/json/component/Cards.schema.v1.json", + "$schema": "http://json-schema.org/draft-07/schema#", + "properties": { + "id": { + "title": "ID", + "description": "The component ID. Must be unique within all layouts/pages in a layout-set. Cannot end with .", + "type": "string", + "pattern": "^[0-9a-zA-Z][0-9a-zA-Z-]*(-?[a-zA-Z]+|[a-zA-Z][0-9]+|-[0-9]{6,})$" + }, + "hidden": { + "title": "Hidden", + "description": "Boolean value or expression indicating if the component should be hidden. Defaults to false.", + "default": false, + "$ref": "expression.schema.v1.json#/definitions/boolean" + }, + "grid": { + "properties": { + "xs": { "$ref": "#/definitions/IGridSize" }, + "sm": { "$ref": "#/definitions/IGridSize" }, + "md": { "$ref": "#/definitions/IGridSize" }, + "lg": { "$ref": "#/definitions/IGridSize" }, + "xl": { "$ref": "#/definitions/IGridSize" }, + "labelGrid": { "$ref": "#/definitions/IGridStyling" }, + "innerGrid": { "$ref": "#/definitions/IGridStyling" } + } + }, + "pageBreak": { + "title": "Page break", + "description": "Optionally insert page-break before/after component when rendered in PDF", + "type": "object", + "properties": { + "breakBefore": { + "title": "Page break before", + "description": "PDF only: Value or expression indicating whether a page break should be added before the component. Can be either: 'auto' (default), 'always', or 'avoid'.", + "examples": ["auto", "always", "avoid"], + "default": "auto", + "$ref": "expression.schema.v1.json#/definitions/string" + }, + "breakAfter": { + "title": "Page break after", + "description": "PDF only: Value or expression indicating whether a page break should be added after the component. Can be either: 'auto' (default), 'always', or 'avoid'.", + "examples": ["auto", "always", "avoid"], + "default": "auto", + "$ref": "expression.schema.v1.json#/definitions/string" + } + }, + "additionalProperties": false + }, + "renderAsSummary": { + "title": "Render as summary", + "description": "Boolean value indicating if the component should be rendered as a summary. Defaults to false.", + "default": false, + "type": "boolean" + }, + "forceShowInSummary": { + "title": "Force show in summary", + "description": "Will force show the component in a summary even if hideEmptyFields is set to true in the summary component.", + "default": false, + "$ref": "expression.schema.v1.json#/definitions/boolean" + }, + "type": { "const": "Cards" }, + "textResourceBindings": { + "title": "TRBSummarizable", + "type": "object", + "properties": { + "summaryTitle": { + "title": "Summary title", + "description": "Title used in the summary view (overrides the default title)", + "$ref": "expression.schema.v1.json#/definitions/string" + }, + "summaryAccessibleTitle": { + "title": "Accessible summary title", + "description": "Title used for aria-label on the edit button in the summary view (overrides the default and summary title)", + "$ref": "expression.schema.v1.json#/definitions/string" + } + } + }, + "mediaPosition": { + "title": "ImagePosition", + "description": "Position of the media (image/video/audio) in each card", + "default": "top", + "enum": ["top", "bottom"], + "type": "string" + }, + "minMediaHeight": { + "title": "minMediaHeight", + "description": "Fixed minimum height of media (if media is present)", + "examples": ["100px", "100%", "100rem"], + "default": "150px", + "type": "string" + }, + "minWidth": { + "title": "minWidth", + "description": "Fixed minimum width of the card", + "examples": ["100", "100px", "100%", "100rem"], + "default": "250px", + "type": "string", + "pattern": "^[0-9]+(px|rem|%)?$" + }, + "color": { + "title": "Card color", + "description": "The color style for these cards", + "enum": ["neutral", "subtle"], + "type": "string" + }, + "cards": { + "type": "array", + "items": { + "title": "CardConfigExternal", + "type": "object", + "properties": { + "media": { + "title": "Media", + "description": "Media to display on the top/bottom of the card (must reference an Image, Audio or Video component", + "type": "string" + }, + "title": { "title": "Title", "description": "Title of the card", "type": "string" }, + "description": { + "title": "Description/body text", + "description": "Full text displayed underneath the title, above any component children", + "type": "string" + }, + "footer": { + "title": "Footer", + "description": "Footer text of the card", + "type": "string" + }, + "children": { + "title": "Children", + "description": "Child component IDs to show inside the card", + "type": "array", + "items": { "type": "string" } + } + }, + "additionalProperties": false + } + } + }, + "required": ["id", "type", "color", "cards"], + "title": "Cards component schema" +} diff --git a/frontend/packages/ux-editor/src/testing/schemas/json/component/Checkboxes.schema.v1.json b/frontend/packages/ux-editor/src/testing/schemas/json/component/Checkboxes.schema.v1.json index c6f7a2db104..c508fbc884a 100644 --- a/frontend/packages/ux-editor/src/testing/schemas/json/component/Checkboxes.schema.v1.json +++ b/frontend/packages/ux-editor/src/testing/schemas/json/component/Checkboxes.schema.v1.json @@ -1 +1,283 @@ -{"$id":"https://altinncdn.no/schemas/json/component/Checkboxes.schema.v1.json","$schema":"http://json-schema.org/draft-07/schema#","properties":{"id":{"title":"ID","description":"The component ID. Must be unique within all layouts/pages in a layout-set. Cannot end with .","type":"string","pattern":"^[0-9a-zA-Z][0-9a-zA-Z-]*(-?[a-zA-Z]+|[a-zA-Z][0-9]+|-[0-9]{6,})$"},"hidden":{"title":"Hidden","description":"Boolean value or expression indicating if the component should be hidden. Defaults to false.","default":false,"$ref":"expression.schema.v1.json#/definitions/boolean"},"grid":{"properties":{"xs":{"$ref":"#/definitions/IGridSize"},"sm":{"$ref":"#/definitions/IGridSize"},"md":{"$ref":"#/definitions/IGridSize"},"lg":{"$ref":"#/definitions/IGridSize"},"xl":{"$ref":"#/definitions/IGridSize"},"labelGrid":{"$ref":"#/definitions/IGridStyling"},"innerGrid":{"$ref":"#/definitions/IGridStyling"}}},"pageBreak":{"title":"Page break","description":"Optionally insert page-break before/after component when rendered in PDF","type":"object","properties":{"breakBefore":{"title":"Page break before","description":"PDF only: Value or expression indicating whether a page break should be added before the component. Can be either: 'auto' (default), 'always', or 'avoid'.","examples":["auto","always","avoid"],"default":"auto","$ref":"expression.schema.v1.json#/definitions/string"},"breakAfter":{"title":"Page break after","description":"PDF only: Value or expression indicating whether a page break should be added after the component. Can be either: 'auto' (default), 'always', or 'avoid'.","examples":["auto","always","avoid"],"default":"auto","$ref":"expression.schema.v1.json#/definitions/string"}},"additionalProperties":false},"readOnly":{"title":"Read only/disabled?","description":"Boolean value or expression indicating if the component should be read only/disabled. Defaults to false.
Please note that even with read-only fields in components, it may currently be possible to update the field by modifying the request sent to the API or through a direct API call.","default":false,"$ref":"expression.schema.v1.json#/definitions/boolean"},"required":{"title":"Required?","description":"Boolean value or expression indicating if the component should be required. Defaults to false.","default":false,"$ref":"expression.schema.v1.json#/definitions/boolean"},"showValidations":{"title":"Validation types","description":"List of validation types to show","type":"array","items":{"enum":["Schema","Component","Expression","CustomBackend","Required","AllExceptRequired","All"],"type":"string"}},"renderAsSummary":{"title":"Render as summary","description":"Boolean value indicating if the component should be rendered as a summary. Defaults to false.","default":false,"type":"boolean"},"forceShowInSummary":{"title":"Force show in summary","description":"Will force show the component in a summary even if hideEmptyFields is set to true in the summary component.","default":false,"$ref":"expression.schema.v1.json#/definitions/boolean"},"optionsId":{"title":"Dynamic options (fetched from server)","description":"ID of the option list to fetch from the server","type":"string"},"mapping":{"title":"Mapping","description":"A mapping of key-value pairs (usually used for mapping a path in the data model to a query string parameter).","type":"object","properties":{},"additionalProperties":{"type":"string"}},"queryParameters":{"title":"Query parameters","description":"A mapping of query string parameters to values. Will be appended to the URL when fetching options.","type":"object","properties":{},"additionalProperties":{"type":"string"}},"options":{"title":"Static options","description":"List of static options","type":"array","items":{"title":"IRawOption","examples":[{"label":"","value":""}],"type":"object","properties":{"label":{"type":"string"},"value":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"const":null}]},"description":{"type":"string"},"helpText":{"type":"string"}},"required":["label","value"],"additionalProperties":false}},"secure":{"title":"Secure options (when using optionsId)","description":"Whether to call the secure API endpoint when fetching options from the server (allows for user/instance-specific options)","default":false,"type":"boolean"},"sortOrder":{"description":"Sorts the code list in either ascending or descending order by label.","enum":["asc","desc"],"type":"string"},"source":{"title":"Option source","description":"Allows for fetching options from the data model, pointing to a repeating group structure","type":"object","properties":{"group":{"title":"Group","description":"The repeating group to base options on.","examples":["model.some.group"],"type":"string"},"label":{"title":"Label","description":"A label of the option displayed in Radio- and Checkbox groups. Can be plain text, a text resource binding, or a dynamic expression.","examples":["some.text.key"],"$ref":"expression.schema.v1.json#/definitions/string"},"value":{"title":"Value","description":"Field in the group that should be used as value","examples":["model.some.group[{0}].someField"],"type":"string"},"description":{"title":"Description","description":"A description of the option displayed in Radio- and Checkbox groups. Can be plain text, a text resource binding, or a dynamic expression.","examples":["some.text.key","My Description"],"$ref":"expression.schema.v1.json#/definitions/string"},"helpText":{"title":"Help Text","description":"A help text for the option displayed in Radio- and Checkbox groups. Can be plain text, a text resource binding, or a dynamic expression.","examples":["some.text.key","My Help Text"],"$ref":"expression.schema.v1.json#/definitions/string"}},"required":["group","label","value"],"additionalProperties":false},"preselectedOptionIndex":{"title":"Preselected option index","description":"Index of the option to preselect (if no option has been selected yet)","type":"integer"},"labelSettings":{"title":"ILabelSettings","type":"object","properties":{"optionalIndicator":{"title":"Optional indicator","description":"Show optional indicator on label","type":"boolean"}},"additionalProperties":false},"type":{"const":"Checkboxes"},"textResourceBindings":{"properties":{"title":{"title":"Title","description":"Label text/title shown above the component","$ref":"expression.schema.v1.json#/definitions/string"},"description":{"title":"Description","description":"Label description shown above the component, below the title","$ref":"expression.schema.v1.json#/definitions/string"},"help":{"title":"Help text","description":"Help text shown in a tooltip when clicking the help button","$ref":"expression.schema.v1.json#/definitions/string"},"tableTitle":{"title":"Table title","description":"Title used in the table view (overrides the default title)","$ref":"expression.schema.v1.json#/definitions/string"},"shortName":{"title":"Short name (for validation)","description":"Alternative name used for required validation messages (overrides the default title)","$ref":"expression.schema.v1.json#/definitions/string"},"requiredValidation":{"title":"Required validation message","description":"Full validation message shown when the component is required and no value has been entered (overrides both the default and shortName)","$ref":"expression.schema.v1.json#/definitions/string"},"summaryTitle":{"title":"Summary title","description":"Title used in the summary view (overrides the default title)","$ref":"expression.schema.v1.json#/definitions/string"},"summaryAccessibleTitle":{"title":"Accessible summary title","description":"Title used for aria-label on the edit button in the summary view (overrides the default and summary title)","$ref":"expression.schema.v1.json#/definitions/string"}}},"dataModelBindings":{"title":"Data model binding","description":"Describes the location in the data model where the component should store its value(s). A simple binding is used for components that only store a single value, usually a string.","type":"object","properties":{"simpleBinding":{"type":"string"},"label":{"type":"string"},"metadata":{"description":"Describes the location where metadata for the option based component should be stored in the datamodel.","type":"string"}},"required":["simpleBinding"],"additionalProperties":false},"layout":{"title":"Layout","description":"Define the layout style for the options","enum":["column","row","table"],"type":"string"},"showLabelsInTable":{"title":"Show label when single option in table","description":"Boolean value indicating if the label should be visible when only one option exists in table","default":false,"type":"boolean"},"alertOnChange":{"title":"Alert on change","description":"Boolean value indicating if the component should alert on change","default":false,"$ref":"expression.schema.v1.json#/definitions/boolean"}},"required":["id","type","dataModelBindings"],"title":"Checkboxes component schema"} \ No newline at end of file +{ + "$id": "https://altinncdn.no/schemas/json/component/Checkboxes.schema.v1.json", + "$schema": "http://json-schema.org/draft-07/schema#", + "properties": { + "id": { + "title": "ID", + "description": "The component ID. Must be unique within all layouts/pages in a layout-set. Cannot end with .", + "type": "string", + "pattern": "^[0-9a-zA-Z][0-9a-zA-Z-]*(-?[a-zA-Z]+|[a-zA-Z][0-9]+|-[0-9]{6,})$" + }, + "hidden": { + "title": "Hidden", + "description": "Boolean value or expression indicating if the component should be hidden. Defaults to false.", + "default": false, + "$ref": "expression.schema.v1.json#/definitions/boolean" + }, + "grid": { + "properties": { + "xs": { "$ref": "#/definitions/IGridSize" }, + "sm": { "$ref": "#/definitions/IGridSize" }, + "md": { "$ref": "#/definitions/IGridSize" }, + "lg": { "$ref": "#/definitions/IGridSize" }, + "xl": { "$ref": "#/definitions/IGridSize" }, + "labelGrid": { "$ref": "#/definitions/IGridStyling" }, + "innerGrid": { "$ref": "#/definitions/IGridStyling" } + } + }, + "pageBreak": { + "title": "Page break", + "description": "Optionally insert page-break before/after component when rendered in PDF", + "type": "object", + "properties": { + "breakBefore": { + "title": "Page break before", + "description": "PDF only: Value or expression indicating whether a page break should be added before the component. Can be either: 'auto' (default), 'always', or 'avoid'.", + "examples": ["auto", "always", "avoid"], + "default": "auto", + "$ref": "expression.schema.v1.json#/definitions/string" + }, + "breakAfter": { + "title": "Page break after", + "description": "PDF only: Value or expression indicating whether a page break should be added after the component. Can be either: 'auto' (default), 'always', or 'avoid'.", + "examples": ["auto", "always", "avoid"], + "default": "auto", + "$ref": "expression.schema.v1.json#/definitions/string" + } + }, + "additionalProperties": false + }, + "readOnly": { + "title": "Read only/disabled?", + "description": "Boolean value or expression indicating if the component should be read only/disabled. Defaults to false.
Please note that even with read-only fields in components, it may currently be possible to update the field by modifying the request sent to the API or through a direct API call.", + "default": false, + "$ref": "expression.schema.v1.json#/definitions/boolean" + }, + "required": { + "title": "Required?", + "description": "Boolean value or expression indicating if the component should be required. Defaults to false.", + "default": false, + "$ref": "expression.schema.v1.json#/definitions/boolean" + }, + "showValidations": { + "title": "Validation types", + "description": "List of validation types to show", + "type": "array", + "items": { + "enum": [ + "Schema", + "Component", + "Expression", + "CustomBackend", + "Required", + "AllExceptRequired", + "All" + ], + "type": "string" + } + }, + "renderAsSummary": { + "title": "Render as summary", + "description": "Boolean value indicating if the component should be rendered as a summary. Defaults to false.", + "default": false, + "type": "boolean" + }, + "forceShowInSummary": { + "title": "Force show in summary", + "description": "Will force show the component in a summary even if hideEmptyFields is set to true in the summary component.", + "default": false, + "$ref": "expression.schema.v1.json#/definitions/boolean" + }, + "optionsId": { + "title": "Dynamic options (fetched from server)", + "description": "ID of the option list to fetch from the server", + "type": "string" + }, + "mapping": { + "title": "Mapping", + "description": "A mapping of key-value pairs (usually used for mapping a path in the data model to a query string parameter).", + "type": "object", + "properties": {}, + "additionalProperties": { "type": "string" } + }, + "queryParameters": { + "title": "Query parameters", + "description": "A mapping of query string parameters to values. Will be appended to the URL when fetching options.", + "type": "object", + "properties": {}, + "additionalProperties": { "type": "string" } + }, + "options": { + "title": "Static options", + "description": "List of static options", + "type": "array", + "items": { + "title": "IRawOption", + "examples": [{ "label": "", "value": "" }], + "type": "object", + "properties": { + "label": { "type": "string" }, + "value": { + "anyOf": [ + { "type": "string" }, + { "type": "number" }, + { "type": "boolean" }, + { "const": null } + ] + }, + "description": { "type": "string" }, + "helpText": { "type": "string" } + }, + "required": ["label", "value"], + "additionalProperties": false + } + }, + "secure": { + "title": "Secure options (when using optionsId)", + "description": "Whether to call the secure API endpoint when fetching options from the server (allows for user/instance-specific options)", + "default": false, + "type": "boolean" + }, + "sortOrder": { + "description": "Sorts the code list in either ascending or descending order by label.", + "enum": ["asc", "desc"], + "type": "string" + }, + "source": { + "title": "Option source", + "description": "Allows for fetching options from the data model, pointing to a repeating group structure", + "type": "object", + "properties": { + "group": { + "title": "Group", + "description": "The repeating group to base options on.", + "examples": ["model.some.group"], + "type": "string" + }, + "label": { + "title": "Label", + "description": "A label of the option displayed in Radio- and Checkbox groups. Can be plain text, a text resource binding, or a dynamic expression.", + "examples": ["some.text.key"], + "$ref": "expression.schema.v1.json#/definitions/string" + }, + "value": { + "title": "Value", + "description": "Field in the group that should be used as value", + "examples": ["model.some.group[{0}].someField"], + "type": "string" + }, + "description": { + "title": "Description", + "description": "A description of the option displayed in Radio- and Checkbox groups. Can be plain text, a text resource binding, or a dynamic expression.", + "examples": ["some.text.key", "My Description"], + "$ref": "expression.schema.v1.json#/definitions/string" + }, + "helpText": { + "title": "Help Text", + "description": "A help text for the option displayed in Radio- and Checkbox groups. Can be plain text, a text resource binding, or a dynamic expression.", + "examples": ["some.text.key", "My Help Text"], + "$ref": "expression.schema.v1.json#/definitions/string" + } + }, + "required": ["group", "label", "value"], + "additionalProperties": false + }, + "preselectedOptionIndex": { + "title": "Preselected option index", + "description": "Index of the option to preselect (if no option has been selected yet)", + "type": "integer" + }, + "labelSettings": { + "title": "ILabelSettings", + "type": "object", + "properties": { + "optionalIndicator": { + "title": "Optional indicator", + "description": "Show optional indicator on label", + "type": "boolean" + } + }, + "additionalProperties": false + }, + "type": { "const": "Checkboxes" }, + "textResourceBindings": { + "properties": { + "title": { + "title": "Title", + "description": "Label text/title shown above the component", + "$ref": "expression.schema.v1.json#/definitions/string" + }, + "description": { + "title": "Description", + "description": "Label description shown above the component, below the title", + "$ref": "expression.schema.v1.json#/definitions/string" + }, + "help": { + "title": "Help text", + "description": "Help text shown in a tooltip when clicking the help button", + "$ref": "expression.schema.v1.json#/definitions/string" + }, + "tableTitle": { + "title": "Table title", + "description": "Title used in the table view (overrides the default title)", + "$ref": "expression.schema.v1.json#/definitions/string" + }, + "shortName": { + "title": "Short name (for validation)", + "description": "Alternative name used for required validation messages (overrides the default title)", + "$ref": "expression.schema.v1.json#/definitions/string" + }, + "requiredValidation": { + "title": "Required validation message", + "description": "Full validation message shown when the component is required and no value has been entered (overrides both the default and shortName)", + "$ref": "expression.schema.v1.json#/definitions/string" + }, + "summaryTitle": { + "title": "Summary title", + "description": "Title used in the summary view (overrides the default title)", + "$ref": "expression.schema.v1.json#/definitions/string" + }, + "summaryAccessibleTitle": { + "title": "Accessible summary title", + "description": "Title used for aria-label on the edit button in the summary view (overrides the default and summary title)", + "$ref": "expression.schema.v1.json#/definitions/string" + } + } + }, + "dataModelBindings": { + "title": "Data model binding", + "description": "Describes the location in the data model where the component should store its value(s). A simple binding is used for components that only store a single value, usually a string.", + "type": "object", + "properties": { + "simpleBinding": { "type": "string" }, + "label": { "type": "string" }, + "metadata": { + "description": "Describes the location where metadata for the option based component should be stored in the datamodel.", + "type": "string" + } + }, + "required": ["simpleBinding"], + "additionalProperties": false + }, + "layout": { + "title": "Layout", + "description": "Define the layout style for the options", + "enum": ["column", "row", "table"], + "type": "string" + }, + "showLabelsInTable": { + "title": "Show label when single option in table", + "description": "Boolean value indicating if the label should be visible when only one option exists in table", + "default": false, + "type": "boolean" + }, + "alertOnChange": { + "title": "Alert on change", + "description": "Boolean value indicating if the component should alert on change", + "default": false, + "$ref": "expression.schema.v1.json#/definitions/boolean" + } + }, + "required": ["id", "type", "dataModelBindings"], + "title": "Checkboxes component schema" +} diff --git a/frontend/packages/ux-editor/src/testing/schemas/json/component/Custom.schema.v1.json b/frontend/packages/ux-editor/src/testing/schemas/json/component/Custom.schema.v1.json index cb4df54f850..9abe46fab49 100644 --- a/frontend/packages/ux-editor/src/testing/schemas/json/component/Custom.schema.v1.json +++ b/frontend/packages/ux-editor/src/testing/schemas/json/component/Custom.schema.v1.json @@ -1 +1,140 @@ -{"$id":"https://altinncdn.no/schemas/json/component/Custom.schema.v1.json","$schema":"http://json-schema.org/draft-07/schema#","properties":{"id":{"title":"ID","description":"The component ID. Must be unique within all layouts/pages in a layout-set. Cannot end with .","type":"string","pattern":"^[0-9a-zA-Z][0-9a-zA-Z-]*(-?[a-zA-Z]+|[a-zA-Z][0-9]+|-[0-9]{6,})$"},"hidden":{"title":"Hidden","description":"Boolean value or expression indicating if the component should be hidden. Defaults to false.","default":false,"$ref":"expression.schema.v1.json#/definitions/boolean"},"grid":{"properties":{"xs":{"$ref":"#/definitions/IGridSize"},"sm":{"$ref":"#/definitions/IGridSize"},"md":{"$ref":"#/definitions/IGridSize"},"lg":{"$ref":"#/definitions/IGridSize"},"xl":{"$ref":"#/definitions/IGridSize"},"labelGrid":{"$ref":"#/definitions/IGridStyling"},"innerGrid":{"$ref":"#/definitions/IGridStyling"}}},"pageBreak":{"title":"Page break","description":"Optionally insert page-break before/after component when rendered in PDF","type":"object","properties":{"breakBefore":{"title":"Page break before","description":"PDF only: Value or expression indicating whether a page break should be added before the component. Can be either: 'auto' (default), 'always', or 'avoid'.","examples":["auto","always","avoid"],"default":"auto","$ref":"expression.schema.v1.json#/definitions/string"},"breakAfter":{"title":"Page break after","description":"PDF only: Value or expression indicating whether a page break should be added after the component. Can be either: 'auto' (default), 'always', or 'avoid'.","examples":["auto","always","avoid"],"default":"auto","$ref":"expression.schema.v1.json#/definitions/string"}},"additionalProperties":false},"readOnly":{"title":"Read only/disabled?","description":"Boolean value or expression indicating if the component should be read only/disabled. Defaults to false.
Please note that even with read-only fields in components, it may currently be possible to update the field by modifying the request sent to the API or through a direct API call.","default":false,"$ref":"expression.schema.v1.json#/definitions/boolean"},"required":{"title":"Required?","description":"Boolean value or expression indicating if the component should be required. Defaults to false.","default":false,"$ref":"expression.schema.v1.json#/definitions/boolean"},"showValidations":{"title":"Validation types","description":"List of validation types to show","type":"array","items":{"enum":["Schema","Component","Expression","CustomBackend","Required","AllExceptRequired","All"],"type":"string"}},"renderAsSummary":{"title":"Render as summary","description":"Boolean value indicating if the component should be rendered as a summary. Defaults to false.","default":false,"type":"boolean"},"forceShowInSummary":{"title":"Force show in summary","description":"Will force show the component in a summary even if hideEmptyFields is set to true in the summary component.","default":false,"$ref":"expression.schema.v1.json#/definitions/boolean"},"type":{"const":"Custom"},"textResourceBindings":{"properties":{"title":{"title":"Title","description":"Title (passed on as the \"text\" property to the component)","$ref":"expression.schema.v1.json#/definitions/string"},"tableTitle":{"title":"Table title","description":"Title used in the table view (overrides the default title)","$ref":"expression.schema.v1.json#/definitions/string"},"shortName":{"title":"Short name (for validation)","description":"Alternative name used for required validation messages (overrides the default title)","$ref":"expression.schema.v1.json#/definitions/string"},"requiredValidation":{"title":"Required validation message","description":"Full validation message shown when the component is required and no value has been entered (overrides both the default and shortName)","$ref":"expression.schema.v1.json#/definitions/string"},"summaryTitle":{"title":"Summary title","description":"Title used in the summary view (overrides the default title)","$ref":"expression.schema.v1.json#/definitions/string"},"summaryAccessibleTitle":{"title":"Accessible summary title","description":"Title used for aria-label on the edit button in the summary view (overrides the default and summary title)","$ref":"expression.schema.v1.json#/definitions/string"}}},"dataModelBindings":{"title":"IDataModelBindingsForCustom","type":"object","properties":{},"additionalProperties":{"type":"string"}},"tagName":{"title":"Tag name","description":"Web component tag name to use","type":"string"}},"required":["id","type","tagName"],"title":"Custom component schema"} \ No newline at end of file +{ + "$id": "https://altinncdn.no/schemas/json/component/Custom.schema.v1.json", + "$schema": "http://json-schema.org/draft-07/schema#", + "properties": { + "id": { + "title": "ID", + "description": "The component ID. Must be unique within all layouts/pages in a layout-set. Cannot end with .", + "type": "string", + "pattern": "^[0-9a-zA-Z][0-9a-zA-Z-]*(-?[a-zA-Z]+|[a-zA-Z][0-9]+|-[0-9]{6,})$" + }, + "hidden": { + "title": "Hidden", + "description": "Boolean value or expression indicating if the component should be hidden. Defaults to false.", + "default": false, + "$ref": "expression.schema.v1.json#/definitions/boolean" + }, + "grid": { + "properties": { + "xs": { "$ref": "#/definitions/IGridSize" }, + "sm": { "$ref": "#/definitions/IGridSize" }, + "md": { "$ref": "#/definitions/IGridSize" }, + "lg": { "$ref": "#/definitions/IGridSize" }, + "xl": { "$ref": "#/definitions/IGridSize" }, + "labelGrid": { "$ref": "#/definitions/IGridStyling" }, + "innerGrid": { "$ref": "#/definitions/IGridStyling" } + } + }, + "pageBreak": { + "title": "Page break", + "description": "Optionally insert page-break before/after component when rendered in PDF", + "type": "object", + "properties": { + "breakBefore": { + "title": "Page break before", + "description": "PDF only: Value or expression indicating whether a page break should be added before the component. Can be either: 'auto' (default), 'always', or 'avoid'.", + "examples": ["auto", "always", "avoid"], + "default": "auto", + "$ref": "expression.schema.v1.json#/definitions/string" + }, + "breakAfter": { + "title": "Page break after", + "description": "PDF only: Value or expression indicating whether a page break should be added after the component. Can be either: 'auto' (default), 'always', or 'avoid'.", + "examples": ["auto", "always", "avoid"], + "default": "auto", + "$ref": "expression.schema.v1.json#/definitions/string" + } + }, + "additionalProperties": false + }, + "readOnly": { + "title": "Read only/disabled?", + "description": "Boolean value or expression indicating if the component should be read only/disabled. Defaults to false.
Please note that even with read-only fields in components, it may currently be possible to update the field by modifying the request sent to the API or through a direct API call.", + "default": false, + "$ref": "expression.schema.v1.json#/definitions/boolean" + }, + "required": { + "title": "Required?", + "description": "Boolean value or expression indicating if the component should be required. Defaults to false.", + "default": false, + "$ref": "expression.schema.v1.json#/definitions/boolean" + }, + "showValidations": { + "title": "Validation types", + "description": "List of validation types to show", + "type": "array", + "items": { + "enum": [ + "Schema", + "Component", + "Expression", + "CustomBackend", + "Required", + "AllExceptRequired", + "All" + ], + "type": "string" + } + }, + "renderAsSummary": { + "title": "Render as summary", + "description": "Boolean value indicating if the component should be rendered as a summary. Defaults to false.", + "default": false, + "type": "boolean" + }, + "forceShowInSummary": { + "title": "Force show in summary", + "description": "Will force show the component in a summary even if hideEmptyFields is set to true in the summary component.", + "default": false, + "$ref": "expression.schema.v1.json#/definitions/boolean" + }, + "type": { "const": "Custom" }, + "textResourceBindings": { + "properties": { + "title": { + "title": "Title", + "description": "Title (passed on as the \"text\" property to the component)", + "$ref": "expression.schema.v1.json#/definitions/string" + }, + "tableTitle": { + "title": "Table title", + "description": "Title used in the table view (overrides the default title)", + "$ref": "expression.schema.v1.json#/definitions/string" + }, + "shortName": { + "title": "Short name (for validation)", + "description": "Alternative name used for required validation messages (overrides the default title)", + "$ref": "expression.schema.v1.json#/definitions/string" + }, + "requiredValidation": { + "title": "Required validation message", + "description": "Full validation message shown when the component is required and no value has been entered (overrides both the default and shortName)", + "$ref": "expression.schema.v1.json#/definitions/string" + }, + "summaryTitle": { + "title": "Summary title", + "description": "Title used in the summary view (overrides the default title)", + "$ref": "expression.schema.v1.json#/definitions/string" + }, + "summaryAccessibleTitle": { + "title": "Accessible summary title", + "description": "Title used for aria-label on the edit button in the summary view (overrides the default and summary title)", + "$ref": "expression.schema.v1.json#/definitions/string" + } + } + }, + "dataModelBindings": { + "title": "IDataModelBindingsForCustom", + "type": "object", + "properties": {}, + "additionalProperties": { "type": "string" } + }, + "tagName": { + "title": "Tag name", + "description": "Web component tag name to use", + "type": "string" + } + }, + "required": ["id", "type", "tagName"], + "title": "Custom component schema" +} diff --git a/frontend/packages/ux-editor/src/testing/schemas/json/component/CustomButton.schema.v1.json b/frontend/packages/ux-editor/src/testing/schemas/json/component/CustomButton.schema.v1.json index c553d9670d4..00975f900e9 100644 --- a/frontend/packages/ux-editor/src/testing/schemas/json/component/CustomButton.schema.v1.json +++ b/frontend/packages/ux-editor/src/testing/schemas/json/component/CustomButton.schema.v1.json @@ -1 +1,81 @@ -{"$id":"https://altinncdn.no/schemas/json/component/CustomButton.schema.v1.json","$schema":"http://json-schema.org/draft-07/schema#","properties":{"id":{"title":"ID","description":"The component ID. Must be unique within all layouts/pages in a layout-set. Cannot end with .","type":"string","pattern":"^[0-9a-zA-Z][0-9a-zA-Z-]*(-?[a-zA-Z]+|[a-zA-Z][0-9]+|-[0-9]{6,})$"},"hidden":{"title":"Hidden","description":"Boolean value or expression indicating if the component should be hidden. Defaults to false.","default":false,"$ref":"expression.schema.v1.json#/definitions/boolean"},"grid":{"properties":{"xs":{"$ref":"#/definitions/IGridSize"},"sm":{"$ref":"#/definitions/IGridSize"},"md":{"$ref":"#/definitions/IGridSize"},"lg":{"$ref":"#/definitions/IGridSize"},"xl":{"$ref":"#/definitions/IGridSize"},"labelGrid":{"$ref":"#/definitions/IGridStyling"},"innerGrid":{"$ref":"#/definitions/IGridStyling"}}},"pageBreak":{"title":"Page break","description":"Optionally insert page-break before/after component when rendered in PDF","type":"object","properties":{"breakBefore":{"title":"Page break before","description":"PDF only: Value or expression indicating whether a page break should be added before the component. Can be either: 'auto' (default), 'always', or 'avoid'.","examples":["auto","always","avoid"],"default":"auto","$ref":"expression.schema.v1.json#/definitions/string"},"breakAfter":{"title":"Page break after","description":"PDF only: Value or expression indicating whether a page break should be added after the component. Can be either: 'auto' (default), 'always', or 'avoid'.","examples":["auto","always","avoid"],"default":"auto","$ref":"expression.schema.v1.json#/definitions/string"}},"additionalProperties":false},"type":{"const":"CustomButton"},"actions":{"type":"array","items":{"title":"CustomAction","anyOf":[{"$ref":"#/definitions/ClientAction"},{"$ref":"#/definitions/ServerAction"}]}},"buttonStyle":{"title":"Button style","description":"The style/color scheme of the button.","enum":["primary","secondary"],"type":"string"},"textResourceBindings":{"type":"object","properties":{"title":{"title":"Title","description":"The title/text on the button","$ref":"expression.schema.v1.json#/definitions/string"}},"additionalProperties":false}},"required":["id","type","actions","buttonStyle"],"title":"CustomButton component schema"} \ No newline at end of file +{ + "$id": "https://altinncdn.no/schemas/json/component/CustomButton.schema.v1.json", + "$schema": "http://json-schema.org/draft-07/schema#", + "properties": { + "id": { + "title": "ID", + "description": "The component ID. Must be unique within all layouts/pages in a layout-set. Cannot end with .", + "type": "string", + "pattern": "^[0-9a-zA-Z][0-9a-zA-Z-]*(-?[a-zA-Z]+|[a-zA-Z][0-9]+|-[0-9]{6,})$" + }, + "hidden": { + "title": "Hidden", + "description": "Boolean value or expression indicating if the component should be hidden. Defaults to false.", + "default": false, + "$ref": "expression.schema.v1.json#/definitions/boolean" + }, + "grid": { + "properties": { + "xs": { "$ref": "#/definitions/IGridSize" }, + "sm": { "$ref": "#/definitions/IGridSize" }, + "md": { "$ref": "#/definitions/IGridSize" }, + "lg": { "$ref": "#/definitions/IGridSize" }, + "xl": { "$ref": "#/definitions/IGridSize" }, + "labelGrid": { "$ref": "#/definitions/IGridStyling" }, + "innerGrid": { "$ref": "#/definitions/IGridStyling" } + } + }, + "pageBreak": { + "title": "Page break", + "description": "Optionally insert page-break before/after component when rendered in PDF", + "type": "object", + "properties": { + "breakBefore": { + "title": "Page break before", + "description": "PDF only: Value or expression indicating whether a page break should be added before the component. Can be either: 'auto' (default), 'always', or 'avoid'.", + "examples": ["auto", "always", "avoid"], + "default": "auto", + "$ref": "expression.schema.v1.json#/definitions/string" + }, + "breakAfter": { + "title": "Page break after", + "description": "PDF only: Value or expression indicating whether a page break should be added after the component. Can be either: 'auto' (default), 'always', or 'avoid'.", + "examples": ["auto", "always", "avoid"], + "default": "auto", + "$ref": "expression.schema.v1.json#/definitions/string" + } + }, + "additionalProperties": false + }, + "type": { "const": "CustomButton" }, + "actions": { + "type": "array", + "items": { + "title": "CustomAction", + "anyOf": [ + { "$ref": "#/definitions/ClientAction" }, + { "$ref": "#/definitions/ServerAction" } + ] + } + }, + "buttonStyle": { + "title": "Button style", + "description": "The style/color scheme of the button.", + "enum": ["primary", "secondary"], + "type": "string" + }, + "textResourceBindings": { + "type": "object", + "properties": { + "title": { + "title": "Title", + "description": "The title/text on the button", + "$ref": "expression.schema.v1.json#/definitions/string" + } + }, + "additionalProperties": false + } + }, + "required": ["id", "type", "actions", "buttonStyle"], + "title": "CustomButton component schema" +} diff --git a/frontend/packages/ux-editor/src/testing/schemas/json/component/Datepicker.schema.v1.json b/frontend/packages/ux-editor/src/testing/schemas/json/component/Datepicker.schema.v1.json index c760622e181..c1559ae50ae 100644 --- a/frontend/packages/ux-editor/src/testing/schemas/json/component/Datepicker.schema.v1.json +++ b/frontend/packages/ux-editor/src/testing/schemas/json/component/Datepicker.schema.v1.json @@ -1 +1,184 @@ -{"$id":"https://altinncdn.no/schemas/json/component/Datepicker.schema.v1.json","$schema":"http://json-schema.org/draft-07/schema#","properties":{"id":{"title":"ID","description":"The component ID. Must be unique within all layouts/pages in a layout-set. Cannot end with .","type":"string","pattern":"^[0-9a-zA-Z][0-9a-zA-Z-]*(-?[a-zA-Z]+|[a-zA-Z][0-9]+|-[0-9]{6,})$"},"hidden":{"title":"Hidden","description":"Boolean value or expression indicating if the component should be hidden. Defaults to false.","default":false,"$ref":"expression.schema.v1.json#/definitions/boolean"},"grid":{"properties":{"xs":{"$ref":"#/definitions/IGridSize"},"sm":{"$ref":"#/definitions/IGridSize"},"md":{"$ref":"#/definitions/IGridSize"},"lg":{"$ref":"#/definitions/IGridSize"},"xl":{"$ref":"#/definitions/IGridSize"},"labelGrid":{"$ref":"#/definitions/IGridStyling"},"innerGrid":{"$ref":"#/definitions/IGridStyling"}}},"pageBreak":{"title":"Page break","description":"Optionally insert page-break before/after component when rendered in PDF","type":"object","properties":{"breakBefore":{"title":"Page break before","description":"PDF only: Value or expression indicating whether a page break should be added before the component. Can be either: 'auto' (default), 'always', or 'avoid'.","examples":["auto","always","avoid"],"default":"auto","$ref":"expression.schema.v1.json#/definitions/string"},"breakAfter":{"title":"Page break after","description":"PDF only: Value or expression indicating whether a page break should be added after the component. Can be either: 'auto' (default), 'always', or 'avoid'.","examples":["auto","always","avoid"],"default":"auto","$ref":"expression.schema.v1.json#/definitions/string"}},"additionalProperties":false},"readOnly":{"title":"Read only/disabled?","description":"Boolean value or expression indicating if the component should be read only/disabled. Defaults to false.
Please note that even with read-only fields in components, it may currently be possible to update the field by modifying the request sent to the API or through a direct API call.","default":false,"$ref":"expression.schema.v1.json#/definitions/boolean"},"required":{"title":"Required?","description":"Boolean value or expression indicating if the component should be required. Defaults to false.","default":false,"$ref":"expression.schema.v1.json#/definitions/boolean"},"showValidations":{"title":"Validation types","description":"List of validation types to show","type":"array","items":{"enum":["Schema","Component","Expression","CustomBackend","Required","AllExceptRequired","All"],"type":"string"}},"renderAsSummary":{"title":"Render as summary","description":"Boolean value indicating if the component should be rendered as a summary. Defaults to false.","default":false,"type":"boolean"},"forceShowInSummary":{"title":"Force show in summary","description":"Will force show the component in a summary even if hideEmptyFields is set to true in the summary component.","default":false,"$ref":"expression.schema.v1.json#/definitions/boolean"},"labelSettings":{"title":"ILabelSettings","type":"object","properties":{"optionalIndicator":{"title":"Optional indicator","description":"Show optional indicator on label","type":"boolean"}},"additionalProperties":false},"type":{"const":"Datepicker"},"textResourceBindings":{"properties":{"title":{"title":"Title","description":"Label text/title shown above the component","$ref":"expression.schema.v1.json#/definitions/string"},"description":{"title":"Description","description":"Label description shown above the component, below the title","$ref":"expression.schema.v1.json#/definitions/string"},"help":{"title":"Help text","description":"Help text shown in a tooltip when clicking the help button","$ref":"expression.schema.v1.json#/definitions/string"},"tableTitle":{"title":"Table title","description":"Title used in the table view (overrides the default title)","$ref":"expression.schema.v1.json#/definitions/string"},"shortName":{"title":"Short name (for validation)","description":"Alternative name used for required validation messages (overrides the default title)","$ref":"expression.schema.v1.json#/definitions/string"},"requiredValidation":{"title":"Required validation message","description":"Full validation message shown when the component is required and no value has been entered (overrides both the default and shortName)","$ref":"expression.schema.v1.json#/definitions/string"},"summaryTitle":{"title":"Summary title","description":"Title used in the summary view (overrides the default title)","$ref":"expression.schema.v1.json#/definitions/string"},"summaryAccessibleTitle":{"title":"Accessible summary title","description":"Title used for aria-label on the edit button in the summary view (overrides the default and summary title)","$ref":"expression.schema.v1.json#/definitions/string"}}},"dataModelBindings":{"title":"Data model binding","description":"Describes the location in the data model where the component should store its value(s). A simple binding is used for components that only store a single value, usually a string.","type":"object","properties":{"simpleBinding":{"type":"string"}},"required":["simpleBinding"],"additionalProperties":false},"minDate":{"title":"Earliest date","description":"Sets the earliest allowed date. Can also use keyword 'today' to disable all past dates dynamically based on the current date. Defaults to 1900-01-01T12:00:00.000Z.","default":"1900-01-01T12:00:00.000Z","anyOf":[{"type":"string"},{"const":"today"}]},"maxDate":{"title":"Latest date","description":"Sets the latest allowed date. Can also use keyword 'today' to disable all future dates dynamically based on the current date. Defaults to 2100-01-01T12:00:00.000Z.","default":"2100-01-01T12:00:00.000Z","anyOf":[{"type":"string"},{"const":"today"}]},"timeStamp":{"title":"Include time","description":"Boolean value indicating if the date time should be stored as a timeStamp. Defaults to true. If true: 'YYYY-MM-DDThh:mm:ss.sssZ', if false 'YYYY-MM-DD';","default":true,"type":"boolean"},"format":{"title":"Date format","description":"Date format used when displaying the date to the user. The user date format from the locale will be prioritized over this setting.","examples":["DD/MM/YYYY","MM/DD/YYYY","YYYY-MM-DD"],"default":"DD.MM.YYYY","type":"string"}},"required":["id","type","dataModelBindings"],"title":"Datepicker component schema"} \ No newline at end of file +{ + "$id": "https://altinncdn.no/schemas/json/component/Datepicker.schema.v1.json", + "$schema": "http://json-schema.org/draft-07/schema#", + "properties": { + "id": { + "title": "ID", + "description": "The component ID. Must be unique within all layouts/pages in a layout-set. Cannot end with .", + "type": "string", + "pattern": "^[0-9a-zA-Z][0-9a-zA-Z-]*(-?[a-zA-Z]+|[a-zA-Z][0-9]+|-[0-9]{6,})$" + }, + "hidden": { + "title": "Hidden", + "description": "Boolean value or expression indicating if the component should be hidden. Defaults to false.", + "default": false, + "$ref": "expression.schema.v1.json#/definitions/boolean" + }, + "grid": { + "properties": { + "xs": { "$ref": "#/definitions/IGridSize" }, + "sm": { "$ref": "#/definitions/IGridSize" }, + "md": { "$ref": "#/definitions/IGridSize" }, + "lg": { "$ref": "#/definitions/IGridSize" }, + "xl": { "$ref": "#/definitions/IGridSize" }, + "labelGrid": { "$ref": "#/definitions/IGridStyling" }, + "innerGrid": { "$ref": "#/definitions/IGridStyling" } + } + }, + "pageBreak": { + "title": "Page break", + "description": "Optionally insert page-break before/after component when rendered in PDF", + "type": "object", + "properties": { + "breakBefore": { + "title": "Page break before", + "description": "PDF only: Value or expression indicating whether a page break should be added before the component. Can be either: 'auto' (default), 'always', or 'avoid'.", + "examples": ["auto", "always", "avoid"], + "default": "auto", + "$ref": "expression.schema.v1.json#/definitions/string" + }, + "breakAfter": { + "title": "Page break after", + "description": "PDF only: Value or expression indicating whether a page break should be added after the component. Can be either: 'auto' (default), 'always', or 'avoid'.", + "examples": ["auto", "always", "avoid"], + "default": "auto", + "$ref": "expression.schema.v1.json#/definitions/string" + } + }, + "additionalProperties": false + }, + "readOnly": { + "title": "Read only/disabled?", + "description": "Boolean value or expression indicating if the component should be read only/disabled. Defaults to false.
Please note that even with read-only fields in components, it may currently be possible to update the field by modifying the request sent to the API or through a direct API call.", + "default": false, + "$ref": "expression.schema.v1.json#/definitions/boolean" + }, + "required": { + "title": "Required?", + "description": "Boolean value or expression indicating if the component should be required. Defaults to false.", + "default": false, + "$ref": "expression.schema.v1.json#/definitions/boolean" + }, + "showValidations": { + "title": "Validation types", + "description": "List of validation types to show", + "type": "array", + "items": { + "enum": [ + "Schema", + "Component", + "Expression", + "CustomBackend", + "Required", + "AllExceptRequired", + "All" + ], + "type": "string" + } + }, + "renderAsSummary": { + "title": "Render as summary", + "description": "Boolean value indicating if the component should be rendered as a summary. Defaults to false.", + "default": false, + "type": "boolean" + }, + "forceShowInSummary": { + "title": "Force show in summary", + "description": "Will force show the component in a summary even if hideEmptyFields is set to true in the summary component.", + "default": false, + "$ref": "expression.schema.v1.json#/definitions/boolean" + }, + "labelSettings": { + "title": "ILabelSettings", + "type": "object", + "properties": { + "optionalIndicator": { + "title": "Optional indicator", + "description": "Show optional indicator on label", + "type": "boolean" + } + }, + "additionalProperties": false + }, + "type": { "const": "Datepicker" }, + "textResourceBindings": { + "properties": { + "title": { + "title": "Title", + "description": "Label text/title shown above the component", + "$ref": "expression.schema.v1.json#/definitions/string" + }, + "description": { + "title": "Description", + "description": "Label description shown above the component, below the title", + "$ref": "expression.schema.v1.json#/definitions/string" + }, + "help": { + "title": "Help text", + "description": "Help text shown in a tooltip when clicking the help button", + "$ref": "expression.schema.v1.json#/definitions/string" + }, + "tableTitle": { + "title": "Table title", + "description": "Title used in the table view (overrides the default title)", + "$ref": "expression.schema.v1.json#/definitions/string" + }, + "shortName": { + "title": "Short name (for validation)", + "description": "Alternative name used for required validation messages (overrides the default title)", + "$ref": "expression.schema.v1.json#/definitions/string" + }, + "requiredValidation": { + "title": "Required validation message", + "description": "Full validation message shown when the component is required and no value has been entered (overrides both the default and shortName)", + "$ref": "expression.schema.v1.json#/definitions/string" + }, + "summaryTitle": { + "title": "Summary title", + "description": "Title used in the summary view (overrides the default title)", + "$ref": "expression.schema.v1.json#/definitions/string" + }, + "summaryAccessibleTitle": { + "title": "Accessible summary title", + "description": "Title used for aria-label on the edit button in the summary view (overrides the default and summary title)", + "$ref": "expression.schema.v1.json#/definitions/string" + } + } + }, + "dataModelBindings": { + "title": "Data model binding", + "description": "Describes the location in the data model where the component should store its value(s). A simple binding is used for components that only store a single value, usually a string.", + "type": "object", + "properties": { "simpleBinding": { "type": "string" } }, + "required": ["simpleBinding"], + "additionalProperties": false + }, + "minDate": { + "title": "Earliest date", + "description": "Sets the earliest allowed date. Can also use keyword 'today' to disable all past dates dynamically based on the current date. Defaults to 1900-01-01T12:00:00.000Z.", + "default": "1900-01-01T12:00:00.000Z", + "anyOf": [{ "type": "string" }, { "const": "today" }] + }, + "maxDate": { + "title": "Latest date", + "description": "Sets the latest allowed date. Can also use keyword 'today' to disable all future dates dynamically based on the current date. Defaults to 2100-01-01T12:00:00.000Z.", + "default": "2100-01-01T12:00:00.000Z", + "anyOf": [{ "type": "string" }, { "const": "today" }] + }, + "timeStamp": { + "title": "Include time", + "description": "Boolean value indicating if the date time should be stored as a timeStamp. Defaults to true. If true: 'YYYY-MM-DDThh:mm:ss.sssZ', if false 'YYYY-MM-DD';", + "default": true, + "type": "boolean" + }, + "format": { + "title": "Date format", + "description": "Date format used when displaying the date to the user. The user date format from the locale will be prioritized over this setting.", + "examples": ["DD/MM/YYYY", "MM/DD/YYYY", "YYYY-MM-DD"], + "default": "DD.MM.YYYY", + "type": "string" + } + }, + "required": ["id", "type", "dataModelBindings"], + "title": "Datepicker component schema" +} diff --git a/frontend/packages/ux-editor/src/testing/schemas/json/component/Dropdown.schema.v1.json b/frontend/packages/ux-editor/src/testing/schemas/json/component/Dropdown.schema.v1.json index ac1518e1840..73c8d188a63 100644 --- a/frontend/packages/ux-editor/src/testing/schemas/json/component/Dropdown.schema.v1.json +++ b/frontend/packages/ux-editor/src/testing/schemas/json/component/Dropdown.schema.v1.json @@ -1 +1,271 @@ -{"$id":"https://altinncdn.no/schemas/json/component/Dropdown.schema.v1.json","$schema":"http://json-schema.org/draft-07/schema#","properties":{"id":{"title":"ID","description":"The component ID. Must be unique within all layouts/pages in a layout-set. Cannot end with .","type":"string","pattern":"^[0-9a-zA-Z][0-9a-zA-Z-]*(-?[a-zA-Z]+|[a-zA-Z][0-9]+|-[0-9]{6,})$"},"hidden":{"title":"Hidden","description":"Boolean value or expression indicating if the component should be hidden. Defaults to false.","default":false,"$ref":"expression.schema.v1.json#/definitions/boolean"},"grid":{"properties":{"xs":{"$ref":"#/definitions/IGridSize"},"sm":{"$ref":"#/definitions/IGridSize"},"md":{"$ref":"#/definitions/IGridSize"},"lg":{"$ref":"#/definitions/IGridSize"},"xl":{"$ref":"#/definitions/IGridSize"},"labelGrid":{"$ref":"#/definitions/IGridStyling"},"innerGrid":{"$ref":"#/definitions/IGridStyling"}}},"pageBreak":{"title":"Page break","description":"Optionally insert page-break before/after component when rendered in PDF","type":"object","properties":{"breakBefore":{"title":"Page break before","description":"PDF only: Value or expression indicating whether a page break should be added before the component. Can be either: 'auto' (default), 'always', or 'avoid'.","examples":["auto","always","avoid"],"default":"auto","$ref":"expression.schema.v1.json#/definitions/string"},"breakAfter":{"title":"Page break after","description":"PDF only: Value or expression indicating whether a page break should be added after the component. Can be either: 'auto' (default), 'always', or 'avoid'.","examples":["auto","always","avoid"],"default":"auto","$ref":"expression.schema.v1.json#/definitions/string"}},"additionalProperties":false},"readOnly":{"title":"Read only/disabled?","description":"Boolean value or expression indicating if the component should be read only/disabled. Defaults to false.
Please note that even with read-only fields in components, it may currently be possible to update the field by modifying the request sent to the API or through a direct API call.","default":false,"$ref":"expression.schema.v1.json#/definitions/boolean"},"required":{"title":"Required?","description":"Boolean value or expression indicating if the component should be required. Defaults to false.","default":false,"$ref":"expression.schema.v1.json#/definitions/boolean"},"showValidations":{"title":"Validation types","description":"List of validation types to show","type":"array","items":{"enum":["Schema","Component","Expression","CustomBackend","Required","AllExceptRequired","All"],"type":"string"}},"renderAsSummary":{"title":"Render as summary","description":"Boolean value indicating if the component should be rendered as a summary. Defaults to false.","default":false,"type":"boolean"},"forceShowInSummary":{"title":"Force show in summary","description":"Will force show the component in a summary even if hideEmptyFields is set to true in the summary component.","default":false,"$ref":"expression.schema.v1.json#/definitions/boolean"},"optionsId":{"title":"Dynamic options (fetched from server)","description":"ID of the option list to fetch from the server","type":"string"},"mapping":{"title":"Mapping","description":"A mapping of key-value pairs (usually used for mapping a path in the data model to a query string parameter).","type":"object","properties":{},"additionalProperties":{"type":"string"}},"queryParameters":{"title":"Query parameters","description":"A mapping of query string parameters to values. Will be appended to the URL when fetching options.","type":"object","properties":{},"additionalProperties":{"type":"string"}},"options":{"title":"Static options","description":"List of static options","type":"array","items":{"title":"IRawOption","examples":[{"label":"","value":""}],"type":"object","properties":{"label":{"type":"string"},"value":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"const":null}]},"description":{"type":"string"},"helpText":{"type":"string"}},"required":["label","value"],"additionalProperties":false}},"secure":{"title":"Secure options (when using optionsId)","description":"Whether to call the secure API endpoint when fetching options from the server (allows for user/instance-specific options)","default":false,"type":"boolean"},"sortOrder":{"description":"Sorts the code list in either ascending or descending order by label.","enum":["asc","desc"],"type":"string"},"source":{"title":"Option source","description":"Allows for fetching options from the data model, pointing to a repeating group structure","type":"object","properties":{"group":{"title":"Group","description":"The repeating group to base options on.","examples":["model.some.group"],"type":"string"},"label":{"title":"Label","description":"A label of the option displayed in Radio- and Checkbox groups. Can be plain text, a text resource binding, or a dynamic expression.","examples":["some.text.key"],"$ref":"expression.schema.v1.json#/definitions/string"},"value":{"title":"Value","description":"Field in the group that should be used as value","examples":["model.some.group[{0}].someField"],"type":"string"},"description":{"title":"Description","description":"A description of the option displayed in Radio- and Checkbox groups. Can be plain text, a text resource binding, or a dynamic expression.","examples":["some.text.key","My Description"],"$ref":"expression.schema.v1.json#/definitions/string"},"helpText":{"title":"Help Text","description":"A help text for the option displayed in Radio- and Checkbox groups. Can be plain text, a text resource binding, or a dynamic expression.","examples":["some.text.key","My Help Text"],"$ref":"expression.schema.v1.json#/definitions/string"}},"required":["group","label","value"],"additionalProperties":false},"preselectedOptionIndex":{"title":"Preselected option index","description":"Index of the option to preselect (if no option has been selected yet)","type":"integer"},"labelSettings":{"title":"ILabelSettings","type":"object","properties":{"optionalIndicator":{"title":"Optional indicator","description":"Show optional indicator on label","type":"boolean"}},"additionalProperties":false},"type":{"const":"Dropdown"},"textResourceBindings":{"properties":{"title":{"title":"Title","description":"Label text/title shown above the component","$ref":"expression.schema.v1.json#/definitions/string"},"description":{"title":"Description","description":"Label description shown above the component, below the title","$ref":"expression.schema.v1.json#/definitions/string"},"help":{"title":"Help text","description":"Help text shown in a tooltip when clicking the help button","$ref":"expression.schema.v1.json#/definitions/string"},"tableTitle":{"title":"Table title","description":"Title used in the table view (overrides the default title)","$ref":"expression.schema.v1.json#/definitions/string"},"shortName":{"title":"Short name (for validation)","description":"Alternative name used for required validation messages (overrides the default title)","$ref":"expression.schema.v1.json#/definitions/string"},"requiredValidation":{"title":"Required validation message","description":"Full validation message shown when the component is required and no value has been entered (overrides both the default and shortName)","$ref":"expression.schema.v1.json#/definitions/string"},"summaryTitle":{"title":"Summary title","description":"Title used in the summary view (overrides the default title)","$ref":"expression.schema.v1.json#/definitions/string"},"summaryAccessibleTitle":{"title":"Accessible summary title","description":"Title used for aria-label on the edit button in the summary view (overrides the default and summary title)","$ref":"expression.schema.v1.json#/definitions/string"}}},"alertOnChange":{"title":"Alert on change","description":"Boolean value indicating if the component should alert on change","default":false,"$ref":"expression.schema.v1.json#/definitions/boolean"},"dataModelBindings":{"title":"Data model binding","description":"Describes the location in the data model where the component should store its value(s). A simple binding is used for components that only store a single value, usually a string.","type":"object","properties":{"simpleBinding":{"type":"string"},"label":{"type":"string"},"metadata":{"description":"Describes the location where metadata for the option based component should be stored in the datamodel.","type":"string"}},"required":["simpleBinding"],"additionalProperties":false}},"required":["id","type","dataModelBindings"],"title":"Dropdown component schema"} \ No newline at end of file +{ + "$id": "https://altinncdn.no/schemas/json/component/Dropdown.schema.v1.json", + "$schema": "http://json-schema.org/draft-07/schema#", + "properties": { + "id": { + "title": "ID", + "description": "The component ID. Must be unique within all layouts/pages in a layout-set. Cannot end with .", + "type": "string", + "pattern": "^[0-9a-zA-Z][0-9a-zA-Z-]*(-?[a-zA-Z]+|[a-zA-Z][0-9]+|-[0-9]{6,})$" + }, + "hidden": { + "title": "Hidden", + "description": "Boolean value or expression indicating if the component should be hidden. Defaults to false.", + "default": false, + "$ref": "expression.schema.v1.json#/definitions/boolean" + }, + "grid": { + "properties": { + "xs": { "$ref": "#/definitions/IGridSize" }, + "sm": { "$ref": "#/definitions/IGridSize" }, + "md": { "$ref": "#/definitions/IGridSize" }, + "lg": { "$ref": "#/definitions/IGridSize" }, + "xl": { "$ref": "#/definitions/IGridSize" }, + "labelGrid": { "$ref": "#/definitions/IGridStyling" }, + "innerGrid": { "$ref": "#/definitions/IGridStyling" } + } + }, + "pageBreak": { + "title": "Page break", + "description": "Optionally insert page-break before/after component when rendered in PDF", + "type": "object", + "properties": { + "breakBefore": { + "title": "Page break before", + "description": "PDF only: Value or expression indicating whether a page break should be added before the component. Can be either: 'auto' (default), 'always', or 'avoid'.", + "examples": ["auto", "always", "avoid"], + "default": "auto", + "$ref": "expression.schema.v1.json#/definitions/string" + }, + "breakAfter": { + "title": "Page break after", + "description": "PDF only: Value or expression indicating whether a page break should be added after the component. Can be either: 'auto' (default), 'always', or 'avoid'.", + "examples": ["auto", "always", "avoid"], + "default": "auto", + "$ref": "expression.schema.v1.json#/definitions/string" + } + }, + "additionalProperties": false + }, + "readOnly": { + "title": "Read only/disabled?", + "description": "Boolean value or expression indicating if the component should be read only/disabled. Defaults to false.
Please note that even with read-only fields in components, it may currently be possible to update the field by modifying the request sent to the API or through a direct API call.", + "default": false, + "$ref": "expression.schema.v1.json#/definitions/boolean" + }, + "required": { + "title": "Required?", + "description": "Boolean value or expression indicating if the component should be required. Defaults to false.", + "default": false, + "$ref": "expression.schema.v1.json#/definitions/boolean" + }, + "showValidations": { + "title": "Validation types", + "description": "List of validation types to show", + "type": "array", + "items": { + "enum": [ + "Schema", + "Component", + "Expression", + "CustomBackend", + "Required", + "AllExceptRequired", + "All" + ], + "type": "string" + } + }, + "renderAsSummary": { + "title": "Render as summary", + "description": "Boolean value indicating if the component should be rendered as a summary. Defaults to false.", + "default": false, + "type": "boolean" + }, + "forceShowInSummary": { + "title": "Force show in summary", + "description": "Will force show the component in a summary even if hideEmptyFields is set to true in the summary component.", + "default": false, + "$ref": "expression.schema.v1.json#/definitions/boolean" + }, + "optionsId": { + "title": "Dynamic options (fetched from server)", + "description": "ID of the option list to fetch from the server", + "type": "string" + }, + "mapping": { + "title": "Mapping", + "description": "A mapping of key-value pairs (usually used for mapping a path in the data model to a query string parameter).", + "type": "object", + "properties": {}, + "additionalProperties": { "type": "string" } + }, + "queryParameters": { + "title": "Query parameters", + "description": "A mapping of query string parameters to values. Will be appended to the URL when fetching options.", + "type": "object", + "properties": {}, + "additionalProperties": { "type": "string" } + }, + "options": { + "title": "Static options", + "description": "List of static options", + "type": "array", + "items": { + "title": "IRawOption", + "examples": [{ "label": "", "value": "" }], + "type": "object", + "properties": { + "label": { "type": "string" }, + "value": { + "anyOf": [ + { "type": "string" }, + { "type": "number" }, + { "type": "boolean" }, + { "const": null } + ] + }, + "description": { "type": "string" }, + "helpText": { "type": "string" } + }, + "required": ["label", "value"], + "additionalProperties": false + } + }, + "secure": { + "title": "Secure options (when using optionsId)", + "description": "Whether to call the secure API endpoint when fetching options from the server (allows for user/instance-specific options)", + "default": false, + "type": "boolean" + }, + "sortOrder": { + "description": "Sorts the code list in either ascending or descending order by label.", + "enum": ["asc", "desc"], + "type": "string" + }, + "source": { + "title": "Option source", + "description": "Allows for fetching options from the data model, pointing to a repeating group structure", + "type": "object", + "properties": { + "group": { + "title": "Group", + "description": "The repeating group to base options on.", + "examples": ["model.some.group"], + "type": "string" + }, + "label": { + "title": "Label", + "description": "A label of the option displayed in Radio- and Checkbox groups. Can be plain text, a text resource binding, or a dynamic expression.", + "examples": ["some.text.key"], + "$ref": "expression.schema.v1.json#/definitions/string" + }, + "value": { + "title": "Value", + "description": "Field in the group that should be used as value", + "examples": ["model.some.group[{0}].someField"], + "type": "string" + }, + "description": { + "title": "Description", + "description": "A description of the option displayed in Radio- and Checkbox groups. Can be plain text, a text resource binding, or a dynamic expression.", + "examples": ["some.text.key", "My Description"], + "$ref": "expression.schema.v1.json#/definitions/string" + }, + "helpText": { + "title": "Help Text", + "description": "A help text for the option displayed in Radio- and Checkbox groups. Can be plain text, a text resource binding, or a dynamic expression.", + "examples": ["some.text.key", "My Help Text"], + "$ref": "expression.schema.v1.json#/definitions/string" + } + }, + "required": ["group", "label", "value"], + "additionalProperties": false + }, + "preselectedOptionIndex": { + "title": "Preselected option index", + "description": "Index of the option to preselect (if no option has been selected yet)", + "type": "integer" + }, + "labelSettings": { + "title": "ILabelSettings", + "type": "object", + "properties": { + "optionalIndicator": { + "title": "Optional indicator", + "description": "Show optional indicator on label", + "type": "boolean" + } + }, + "additionalProperties": false + }, + "type": { "const": "Dropdown" }, + "textResourceBindings": { + "properties": { + "title": { + "title": "Title", + "description": "Label text/title shown above the component", + "$ref": "expression.schema.v1.json#/definitions/string" + }, + "description": { + "title": "Description", + "description": "Label description shown above the component, below the title", + "$ref": "expression.schema.v1.json#/definitions/string" + }, + "help": { + "title": "Help text", + "description": "Help text shown in a tooltip when clicking the help button", + "$ref": "expression.schema.v1.json#/definitions/string" + }, + "tableTitle": { + "title": "Table title", + "description": "Title used in the table view (overrides the default title)", + "$ref": "expression.schema.v1.json#/definitions/string" + }, + "shortName": { + "title": "Short name (for validation)", + "description": "Alternative name used for required validation messages (overrides the default title)", + "$ref": "expression.schema.v1.json#/definitions/string" + }, + "requiredValidation": { + "title": "Required validation message", + "description": "Full validation message shown when the component is required and no value has been entered (overrides both the default and shortName)", + "$ref": "expression.schema.v1.json#/definitions/string" + }, + "summaryTitle": { + "title": "Summary title", + "description": "Title used in the summary view (overrides the default title)", + "$ref": "expression.schema.v1.json#/definitions/string" + }, + "summaryAccessibleTitle": { + "title": "Accessible summary title", + "description": "Title used for aria-label on the edit button in the summary view (overrides the default and summary title)", + "$ref": "expression.schema.v1.json#/definitions/string" + } + } + }, + "alertOnChange": { + "title": "Alert on change", + "description": "Boolean value indicating if the component should alert on change", + "default": false, + "$ref": "expression.schema.v1.json#/definitions/boolean" + }, + "dataModelBindings": { + "title": "Data model binding", + "description": "Describes the location in the data model where the component should store its value(s). A simple binding is used for components that only store a single value, usually a string.", + "type": "object", + "properties": { + "simpleBinding": { "type": "string" }, + "label": { "type": "string" }, + "metadata": { + "description": "Describes the location where metadata for the option based component should be stored in the datamodel.", + "type": "string" + } + }, + "required": ["simpleBinding"], + "additionalProperties": false + } + }, + "required": ["id", "type", "dataModelBindings"], + "title": "Dropdown component schema" +} diff --git a/frontend/packages/ux-editor/src/testing/schemas/json/component/FileUpload.schema.v1.json b/frontend/packages/ux-editor/src/testing/schemas/json/component/FileUpload.schema.v1.json index 78d3bbf6ad8..cbd5260014e 100644 --- a/frontend/packages/ux-editor/src/testing/schemas/json/component/FileUpload.schema.v1.json +++ b/frontend/packages/ux-editor/src/testing/schemas/json/component/FileUpload.schema.v1.json @@ -1 +1,212 @@ -{"$id":"https://altinncdn.no/schemas/json/component/FileUpload.schema.v1.json","$schema":"http://json-schema.org/draft-07/schema#","properties":{"id":{"title":"ID","description":"The component ID. Must be unique within all layouts/pages in a layout-set. Cannot end with .","type":"string","pattern":"^[0-9a-zA-Z][0-9a-zA-Z-]*(-?[a-zA-Z]+|[a-zA-Z][0-9]+|-[0-9]{6,})$"},"hidden":{"title":"Hidden","description":"Boolean value or expression indicating if the component should be hidden. Defaults to false.","default":false,"$ref":"expression.schema.v1.json#/definitions/boolean"},"grid":{"properties":{"xs":{"$ref":"#/definitions/IGridSize"},"sm":{"$ref":"#/definitions/IGridSize"},"md":{"$ref":"#/definitions/IGridSize"},"lg":{"$ref":"#/definitions/IGridSize"},"xl":{"$ref":"#/definitions/IGridSize"},"labelGrid":{"$ref":"#/definitions/IGridStyling"},"innerGrid":{"$ref":"#/definitions/IGridStyling"}}},"pageBreak":{"title":"Page break","description":"Optionally insert page-break before/after component when rendered in PDF","type":"object","properties":{"breakBefore":{"title":"Page break before","description":"PDF only: Value or expression indicating whether a page break should be added before the component. Can be either: 'auto' (default), 'always', or 'avoid'.","examples":["auto","always","avoid"],"default":"auto","$ref":"expression.schema.v1.json#/definitions/string"},"breakAfter":{"title":"Page break after","description":"PDF only: Value or expression indicating whether a page break should be added after the component. Can be either: 'auto' (default), 'always', or 'avoid'.","examples":["auto","always","avoid"],"default":"auto","$ref":"expression.schema.v1.json#/definitions/string"}},"additionalProperties":false},"readOnly":{"title":"Read only/disabled?","description":"Boolean value or expression indicating if the component should be read only/disabled. Defaults to false.
Please note that even with read-only fields in components, it may currently be possible to update the field by modifying the request sent to the API or through a direct API call.","default":false,"$ref":"expression.schema.v1.json#/definitions/boolean"},"required":{"title":"Required?","description":"Boolean value or expression indicating if the component should be required. Defaults to false.","default":false,"$ref":"expression.schema.v1.json#/definitions/boolean"},"showValidations":{"title":"Validation types","description":"List of validation types to show","type":"array","items":{"enum":["Schema","Component","Expression","CustomBackend","Required","AllExceptRequired","All"],"type":"string"}},"renderAsSummary":{"title":"Render as summary","description":"Boolean value indicating if the component should be rendered as a summary. Defaults to false.","default":false,"type":"boolean"},"forceShowInSummary":{"title":"Force show in summary","description":"Will force show the component in a summary even if hideEmptyFields is set to true in the summary component.","default":false,"$ref":"expression.schema.v1.json#/definitions/boolean"},"labelSettings":{"title":"ILabelSettings","type":"object","properties":{"optionalIndicator":{"title":"Optional indicator","description":"Show optional indicator on label","type":"boolean"}},"additionalProperties":false},"type":{"const":"FileUpload"},"textResourceBindings":{"properties":{"title":{"title":"Title","description":"Label text/title shown above the component","$ref":"expression.schema.v1.json#/definitions/string"},"description":{"title":"Description","description":"Label description shown above the component, below the title","$ref":"expression.schema.v1.json#/definitions/string"},"help":{"title":"Help text","description":"Help text shown in a tooltip when clicking the help button","$ref":"expression.schema.v1.json#/definitions/string"},"tableTitle":{"title":"Table title","description":"Title used in the table view (overrides the default title)","$ref":"expression.schema.v1.json#/definitions/string"},"shortName":{"title":"Short name (for validation)","description":"Alternative name used for required validation messages (overrides the default title)","$ref":"expression.schema.v1.json#/definitions/string"},"requiredValidation":{"title":"Required validation message","description":"Full validation message shown when the component is required and no value has been entered (overrides both the default and shortName)","$ref":"expression.schema.v1.json#/definitions/string"},"summaryTitle":{"title":"Summary title","description":"Title used in the summary view (overrides the default title)","$ref":"expression.schema.v1.json#/definitions/string"},"summaryAccessibleTitle":{"title":"Accessible summary title","description":"Title used for aria-label on the edit button in the summary view (overrides the default and summary title)","$ref":"expression.schema.v1.json#/definitions/string"}}},"dataModelBindings":{"anyOf":[{"title":"Data model binding","description":"Describes the location in the data model where the component should store its value(s). A simple binding is used for components that only store a single value, usually a string.","type":"object","properties":{"simpleBinding":{"type":"string"}},"required":["simpleBinding"],"additionalProperties":false},{"title":"Data model binding","description":"Describes the location in the data model where the component should store its value(s). A list binding should be pointed to an array structure in the data model, and is used for components that store multiple simple values (e.g. a list of strings).","type":"object","properties":{"list":{"type":"string"}},"required":["list"],"additionalProperties":false}]},"maxFileSizeInMB":{"title":"Max file size (MB)","description":"Sets the maximum file size allowed in megabytes","type":"integer"},"maxNumberOfAttachments":{"title":"Max number of attachments","description":"Sets the maximum number of attachments allowed to upload","type":"integer"},"minNumberOfAttachments":{"title":"Min number of attachments","description":"Sets the minimum number of attachments required to upload","type":"integer"},"displayMode":{"enum":["simple","list"],"type":"string"},"hasCustomFileEndings":{"title":"Has custom file endings","description":"Boolean value indicating if the component has valid file endings","default":false,"type":"boolean"},"validFileEndings":{"title":"Valid file endings","description":"A separated string of valid file endings to upload. If not set all endings are accepted.","examples":[".csv",".doc",".docx",".gif",".jpeg",".pdf",".txt"],"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]},"alertOnDelete":{"title":"Alert on delete","description":"Boolean value indicating if warning popup should be displayed when attempting to delete an element","default":false,"$ref":"expression.schema.v1.json#/definitions/boolean"}},"required":["id","type","maxFileSizeInMB","maxNumberOfAttachments","minNumberOfAttachments","displayMode"],"title":"FileUpload component schema"} \ No newline at end of file +{ + "$id": "https://altinncdn.no/schemas/json/component/FileUpload.schema.v1.json", + "$schema": "http://json-schema.org/draft-07/schema#", + "properties": { + "id": { + "title": "ID", + "description": "The component ID. Must be unique within all layouts/pages in a layout-set. Cannot end with .", + "type": "string", + "pattern": "^[0-9a-zA-Z][0-9a-zA-Z-]*(-?[a-zA-Z]+|[a-zA-Z][0-9]+|-[0-9]{6,})$" + }, + "hidden": { + "title": "Hidden", + "description": "Boolean value or expression indicating if the component should be hidden. Defaults to false.", + "default": false, + "$ref": "expression.schema.v1.json#/definitions/boolean" + }, + "grid": { + "properties": { + "xs": { "$ref": "#/definitions/IGridSize" }, + "sm": { "$ref": "#/definitions/IGridSize" }, + "md": { "$ref": "#/definitions/IGridSize" }, + "lg": { "$ref": "#/definitions/IGridSize" }, + "xl": { "$ref": "#/definitions/IGridSize" }, + "labelGrid": { "$ref": "#/definitions/IGridStyling" }, + "innerGrid": { "$ref": "#/definitions/IGridStyling" } + } + }, + "pageBreak": { + "title": "Page break", + "description": "Optionally insert page-break before/after component when rendered in PDF", + "type": "object", + "properties": { + "breakBefore": { + "title": "Page break before", + "description": "PDF only: Value or expression indicating whether a page break should be added before the component. Can be either: 'auto' (default), 'always', or 'avoid'.", + "examples": ["auto", "always", "avoid"], + "default": "auto", + "$ref": "expression.schema.v1.json#/definitions/string" + }, + "breakAfter": { + "title": "Page break after", + "description": "PDF only: Value or expression indicating whether a page break should be added after the component. Can be either: 'auto' (default), 'always', or 'avoid'.", + "examples": ["auto", "always", "avoid"], + "default": "auto", + "$ref": "expression.schema.v1.json#/definitions/string" + } + }, + "additionalProperties": false + }, + "readOnly": { + "title": "Read only/disabled?", + "description": "Boolean value or expression indicating if the component should be read only/disabled. Defaults to false.
Please note that even with read-only fields in components, it may currently be possible to update the field by modifying the request sent to the API or through a direct API call.", + "default": false, + "$ref": "expression.schema.v1.json#/definitions/boolean" + }, + "required": { + "title": "Required?", + "description": "Boolean value or expression indicating if the component should be required. Defaults to false.", + "default": false, + "$ref": "expression.schema.v1.json#/definitions/boolean" + }, + "showValidations": { + "title": "Validation types", + "description": "List of validation types to show", + "type": "array", + "items": { + "enum": [ + "Schema", + "Component", + "Expression", + "CustomBackend", + "Required", + "AllExceptRequired", + "All" + ], + "type": "string" + } + }, + "renderAsSummary": { + "title": "Render as summary", + "description": "Boolean value indicating if the component should be rendered as a summary. Defaults to false.", + "default": false, + "type": "boolean" + }, + "forceShowInSummary": { + "title": "Force show in summary", + "description": "Will force show the component in a summary even if hideEmptyFields is set to true in the summary component.", + "default": false, + "$ref": "expression.schema.v1.json#/definitions/boolean" + }, + "labelSettings": { + "title": "ILabelSettings", + "type": "object", + "properties": { + "optionalIndicator": { + "title": "Optional indicator", + "description": "Show optional indicator on label", + "type": "boolean" + } + }, + "additionalProperties": false + }, + "type": { "const": "FileUpload" }, + "textResourceBindings": { + "properties": { + "title": { + "title": "Title", + "description": "Label text/title shown above the component", + "$ref": "expression.schema.v1.json#/definitions/string" + }, + "description": { + "title": "Description", + "description": "Label description shown above the component, below the title", + "$ref": "expression.schema.v1.json#/definitions/string" + }, + "help": { + "title": "Help text", + "description": "Help text shown in a tooltip when clicking the help button", + "$ref": "expression.schema.v1.json#/definitions/string" + }, + "tableTitle": { + "title": "Table title", + "description": "Title used in the table view (overrides the default title)", + "$ref": "expression.schema.v1.json#/definitions/string" + }, + "shortName": { + "title": "Short name (for validation)", + "description": "Alternative name used for required validation messages (overrides the default title)", + "$ref": "expression.schema.v1.json#/definitions/string" + }, + "requiredValidation": { + "title": "Required validation message", + "description": "Full validation message shown when the component is required and no value has been entered (overrides both the default and shortName)", + "$ref": "expression.schema.v1.json#/definitions/string" + }, + "summaryTitle": { + "title": "Summary title", + "description": "Title used in the summary view (overrides the default title)", + "$ref": "expression.schema.v1.json#/definitions/string" + }, + "summaryAccessibleTitle": { + "title": "Accessible summary title", + "description": "Title used for aria-label on the edit button in the summary view (overrides the default and summary title)", + "$ref": "expression.schema.v1.json#/definitions/string" + } + } + }, + "dataModelBindings": { + "anyOf": [ + { + "title": "Data model binding", + "description": "Describes the location in the data model where the component should store its value(s). A simple binding is used for components that only store a single value, usually a string.", + "type": "object", + "properties": { "simpleBinding": { "type": "string" } }, + "required": ["simpleBinding"], + "additionalProperties": false + }, + { + "title": "Data model binding", + "description": "Describes the location in the data model where the component should store its value(s). A list binding should be pointed to an array structure in the data model, and is used for components that store multiple simple values (e.g. a list of strings).", + "type": "object", + "properties": { "list": { "type": "string" } }, + "required": ["list"], + "additionalProperties": false + } + ] + }, + "maxFileSizeInMB": { + "title": "Max file size (MB)", + "description": "Sets the maximum file size allowed in megabytes", + "type": "integer" + }, + "maxNumberOfAttachments": { + "title": "Max number of attachments", + "description": "Sets the maximum number of attachments allowed to upload", + "type": "integer" + }, + "minNumberOfAttachments": { + "title": "Min number of attachments", + "description": "Sets the minimum number of attachments required to upload", + "type": "integer" + }, + "displayMode": { "enum": ["simple", "list"], "type": "string" }, + "hasCustomFileEndings": { + "title": "Has custom file endings", + "description": "Boolean value indicating if the component has valid file endings", + "default": false, + "type": "boolean" + }, + "validFileEndings": { + "title": "Valid file endings", + "description": "A separated string of valid file endings to upload. If not set all endings are accepted.", + "examples": [".csv", ".doc", ".docx", ".gif", ".jpeg", ".pdf", ".txt"], + "anyOf": [{ "type": "string" }, { "type": "array", "items": { "type": "string" } }] + }, + "alertOnDelete": { + "title": "Alert on delete", + "description": "Boolean value indicating if warning popup should be displayed when attempting to delete an element", + "default": false, + "$ref": "expression.schema.v1.json#/definitions/boolean" + } + }, + "required": [ + "id", + "type", + "maxFileSizeInMB", + "maxNumberOfAttachments", + "minNumberOfAttachments", + "displayMode" + ], + "title": "FileUpload component schema" +} diff --git a/frontend/packages/ux-editor/src/testing/schemas/json/component/FileUploadWithTag.schema.v1.json b/frontend/packages/ux-editor/src/testing/schemas/json/component/FileUploadWithTag.schema.v1.json index 49497d4bb41..162a3a619da 100644 --- a/frontend/packages/ux-editor/src/testing/schemas/json/component/FileUploadWithTag.schema.v1.json +++ b/frontend/packages/ux-editor/src/testing/schemas/json/component/FileUploadWithTag.schema.v1.json @@ -1 +1,311 @@ -{"$id":"https://altinncdn.no/schemas/json/component/FileUploadWithTag.schema.v1.json","$schema":"http://json-schema.org/draft-07/schema#","properties":{"id":{"title":"ID","description":"The component ID. Must be unique within all layouts/pages in a layout-set. Cannot end with .","type":"string","pattern":"^[0-9a-zA-Z][0-9a-zA-Z-]*(-?[a-zA-Z]+|[a-zA-Z][0-9]+|-[0-9]{6,})$"},"hidden":{"title":"Hidden","description":"Boolean value or expression indicating if the component should be hidden. Defaults to false.","default":false,"$ref":"expression.schema.v1.json#/definitions/boolean"},"grid":{"properties":{"xs":{"$ref":"#/definitions/IGridSize"},"sm":{"$ref":"#/definitions/IGridSize"},"md":{"$ref":"#/definitions/IGridSize"},"lg":{"$ref":"#/definitions/IGridSize"},"xl":{"$ref":"#/definitions/IGridSize"},"labelGrid":{"$ref":"#/definitions/IGridStyling"},"innerGrid":{"$ref":"#/definitions/IGridStyling"}}},"pageBreak":{"title":"Page break","description":"Optionally insert page-break before/after component when rendered in PDF","type":"object","properties":{"breakBefore":{"title":"Page break before","description":"PDF only: Value or expression indicating whether a page break should be added before the component. Can be either: 'auto' (default), 'always', or 'avoid'.","examples":["auto","always","avoid"],"default":"auto","$ref":"expression.schema.v1.json#/definitions/string"},"breakAfter":{"title":"Page break after","description":"PDF only: Value or expression indicating whether a page break should be added after the component. Can be either: 'auto' (default), 'always', or 'avoid'.","examples":["auto","always","avoid"],"default":"auto","$ref":"expression.schema.v1.json#/definitions/string"}},"additionalProperties":false},"readOnly":{"title":"Read only/disabled?","description":"Boolean value or expression indicating if the component should be read only/disabled. Defaults to false.
Please note that even with read-only fields in components, it may currently be possible to update the field by modifying the request sent to the API or through a direct API call.","default":false,"$ref":"expression.schema.v1.json#/definitions/boolean"},"required":{"title":"Required?","description":"Boolean value or expression indicating if the component should be required. Defaults to false.","default":false,"$ref":"expression.schema.v1.json#/definitions/boolean"},"showValidations":{"title":"Validation types","description":"List of validation types to show","type":"array","items":{"enum":["Schema","Component","Expression","CustomBackend","Required","AllExceptRequired","All"],"type":"string"}},"renderAsSummary":{"title":"Render as summary","description":"Boolean value indicating if the component should be rendered as a summary. Defaults to false.","default":false,"type":"boolean"},"forceShowInSummary":{"title":"Force show in summary","description":"Will force show the component in a summary even if hideEmptyFields is set to true in the summary component.","default":false,"$ref":"expression.schema.v1.json#/definitions/boolean"},"labelSettings":{"title":"ILabelSettings","type":"object","properties":{"optionalIndicator":{"title":"Optional indicator","description":"Show optional indicator on label","type":"boolean"}},"additionalProperties":false},"optionsId":{"title":"Dynamic options (fetched from server)","description":"ID of the option list to fetch from the server","type":"string"},"mapping":{"title":"Mapping","description":"A mapping of key-value pairs (usually used for mapping a path in the data model to a query string parameter).","type":"object","properties":{},"additionalProperties":{"type":"string"}},"queryParameters":{"title":"Query parameters","description":"A mapping of query string parameters to values. Will be appended to the URL when fetching options.","type":"object","properties":{},"additionalProperties":{"type":"string"}},"options":{"title":"Static options","description":"List of static options","type":"array","items":{"title":"IRawOption","examples":[{"label":"","value":""}],"type":"object","properties":{"label":{"type":"string"},"value":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"const":null}]},"description":{"type":"string"},"helpText":{"type":"string"}},"required":["label","value"],"additionalProperties":false}},"secure":{"title":"Secure options (when using optionsId)","description":"Whether to call the secure API endpoint when fetching options from the server (allows for user/instance-specific options)","default":false,"type":"boolean"},"sortOrder":{"description":"Sorts the code list in either ascending or descending order by label.","enum":["asc","desc"],"type":"string"},"source":{"title":"Option source","description":"Allows for fetching options from the data model, pointing to a repeating group structure","type":"object","properties":{"group":{"title":"Group","description":"The repeating group to base options on.","examples":["model.some.group"],"type":"string"},"label":{"title":"Label","description":"A label of the option displayed in Radio- and Checkbox groups. Can be plain text, a text resource binding, or a dynamic expression.","examples":["some.text.key"],"$ref":"expression.schema.v1.json#/definitions/string"},"value":{"title":"Value","description":"Field in the group that should be used as value","examples":["model.some.group[{0}].someField"],"type":"string"},"description":{"title":"Description","description":"A description of the option displayed in Radio- and Checkbox groups. Can be plain text, a text resource binding, or a dynamic expression.","examples":["some.text.key","My Description"],"$ref":"expression.schema.v1.json#/definitions/string"},"helpText":{"title":"Help Text","description":"A help text for the option displayed in Radio- and Checkbox groups. Can be plain text, a text resource binding, or a dynamic expression.","examples":["some.text.key","My Help Text"],"$ref":"expression.schema.v1.json#/definitions/string"}},"required":["group","label","value"],"additionalProperties":false},"type":{"const":"FileUploadWithTag"},"textResourceBindings":{"properties":{"title":{"title":"Title","description":"Label text/title shown above the component","$ref":"expression.schema.v1.json#/definitions/string"},"description":{"title":"Description","description":"Label description shown above the component, below the title","$ref":"expression.schema.v1.json#/definitions/string"},"help":{"title":"Help text","description":"Help text shown in a tooltip when clicking the help button","$ref":"expression.schema.v1.json#/definitions/string"},"tableTitle":{"title":"Table title","description":"Title used in the table view (overrides the default title)","$ref":"expression.schema.v1.json#/definitions/string"},"shortName":{"title":"Short name (for validation)","description":"Alternative name used for required validation messages (overrides the default title)","$ref":"expression.schema.v1.json#/definitions/string"},"requiredValidation":{"title":"Required validation message","description":"Full validation message shown when the component is required and no value has been entered (overrides both the default and shortName)","$ref":"expression.schema.v1.json#/definitions/string"},"summaryTitle":{"title":"Summary title","description":"Title used in the summary view (overrides the default title)","$ref":"expression.schema.v1.json#/definitions/string"},"summaryAccessibleTitle":{"title":"Accessible summary title","description":"Title used for aria-label on the edit button in the summary view (overrides the default and summary title)","$ref":"expression.schema.v1.json#/definitions/string"},"tagTitle":{"title":"Tag title","description":"The title to show when selecting a tag for each uploaded file","$ref":"expression.schema.v1.json#/definitions/string"}}},"dataModelBindings":{"anyOf":[{"title":"Data model binding","description":"Describes the location in the data model where the component should store its value(s). A simple binding is used for components that only store a single value, usually a string.","type":"object","properties":{"simpleBinding":{"type":"string"}},"required":["simpleBinding"],"additionalProperties":false},{"title":"Data model binding","description":"Describes the location in the data model where the component should store its value(s). A list binding should be pointed to an array structure in the data model, and is used for components that store multiple simple values (e.g. a list of strings).","type":"object","properties":{"list":{"type":"string"}},"required":["list"],"additionalProperties":false}]},"maxFileSizeInMB":{"title":"Max file size (MB)","description":"Sets the maximum file size allowed in megabytes","type":"integer"},"maxNumberOfAttachments":{"title":"Max number of attachments","description":"Sets the maximum number of attachments allowed to upload","type":"integer"},"minNumberOfAttachments":{"title":"Min number of attachments","description":"Sets the minimum number of attachments required to upload","type":"integer"},"displayMode":{"enum":["simple","list"],"type":"string"},"hasCustomFileEndings":{"title":"Has custom file endings","description":"Boolean value indicating if the component has valid file endings","default":false,"type":"boolean"},"validFileEndings":{"title":"Valid file endings","description":"A separated string of valid file endings to upload. If not set all endings are accepted.","examples":[".csv",".doc",".docx",".gif",".jpeg",".pdf",".txt"],"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]},"alertOnDelete":{"title":"Alert on delete","description":"Boolean value indicating if warning popup should be displayed when attempting to delete an element","default":false,"$ref":"expression.schema.v1.json#/definitions/boolean"}},"required":["id","type","maxFileSizeInMB","maxNumberOfAttachments","minNumberOfAttachments","displayMode"],"title":"FileUploadWithTag component schema"} \ No newline at end of file +{ + "$id": "https://altinncdn.no/schemas/json/component/FileUploadWithTag.schema.v1.json", + "$schema": "http://json-schema.org/draft-07/schema#", + "properties": { + "id": { + "title": "ID", + "description": "The component ID. Must be unique within all layouts/pages in a layout-set. Cannot end with .", + "type": "string", + "pattern": "^[0-9a-zA-Z][0-9a-zA-Z-]*(-?[a-zA-Z]+|[a-zA-Z][0-9]+|-[0-9]{6,})$" + }, + "hidden": { + "title": "Hidden", + "description": "Boolean value or expression indicating if the component should be hidden. Defaults to false.", + "default": false, + "$ref": "expression.schema.v1.json#/definitions/boolean" + }, + "grid": { + "properties": { + "xs": { "$ref": "#/definitions/IGridSize" }, + "sm": { "$ref": "#/definitions/IGridSize" }, + "md": { "$ref": "#/definitions/IGridSize" }, + "lg": { "$ref": "#/definitions/IGridSize" }, + "xl": { "$ref": "#/definitions/IGridSize" }, + "labelGrid": { "$ref": "#/definitions/IGridStyling" }, + "innerGrid": { "$ref": "#/definitions/IGridStyling" } + } + }, + "pageBreak": { + "title": "Page break", + "description": "Optionally insert page-break before/after component when rendered in PDF", + "type": "object", + "properties": { + "breakBefore": { + "title": "Page break before", + "description": "PDF only: Value or expression indicating whether a page break should be added before the component. Can be either: 'auto' (default), 'always', or 'avoid'.", + "examples": ["auto", "always", "avoid"], + "default": "auto", + "$ref": "expression.schema.v1.json#/definitions/string" + }, + "breakAfter": { + "title": "Page break after", + "description": "PDF only: Value or expression indicating whether a page break should be added after the component. Can be either: 'auto' (default), 'always', or 'avoid'.", + "examples": ["auto", "always", "avoid"], + "default": "auto", + "$ref": "expression.schema.v1.json#/definitions/string" + } + }, + "additionalProperties": false + }, + "readOnly": { + "title": "Read only/disabled?", + "description": "Boolean value or expression indicating if the component should be read only/disabled. Defaults to false.
Please note that even with read-only fields in components, it may currently be possible to update the field by modifying the request sent to the API or through a direct API call.", + "default": false, + "$ref": "expression.schema.v1.json#/definitions/boolean" + }, + "required": { + "title": "Required?", + "description": "Boolean value or expression indicating if the component should be required. Defaults to false.", + "default": false, + "$ref": "expression.schema.v1.json#/definitions/boolean" + }, + "showValidations": { + "title": "Validation types", + "description": "List of validation types to show", + "type": "array", + "items": { + "enum": [ + "Schema", + "Component", + "Expression", + "CustomBackend", + "Required", + "AllExceptRequired", + "All" + ], + "type": "string" + } + }, + "renderAsSummary": { + "title": "Render as summary", + "description": "Boolean value indicating if the component should be rendered as a summary. Defaults to false.", + "default": false, + "type": "boolean" + }, + "forceShowInSummary": { + "title": "Force show in summary", + "description": "Will force show the component in a summary even if hideEmptyFields is set to true in the summary component.", + "default": false, + "$ref": "expression.schema.v1.json#/definitions/boolean" + }, + "labelSettings": { + "title": "ILabelSettings", + "type": "object", + "properties": { + "optionalIndicator": { + "title": "Optional indicator", + "description": "Show optional indicator on label", + "type": "boolean" + } + }, + "additionalProperties": false + }, + "optionsId": { + "title": "Dynamic options (fetched from server)", + "description": "ID of the option list to fetch from the server", + "type": "string" + }, + "mapping": { + "title": "Mapping", + "description": "A mapping of key-value pairs (usually used for mapping a path in the data model to a query string parameter).", + "type": "object", + "properties": {}, + "additionalProperties": { "type": "string" } + }, + "queryParameters": { + "title": "Query parameters", + "description": "A mapping of query string parameters to values. Will be appended to the URL when fetching options.", + "type": "object", + "properties": {}, + "additionalProperties": { "type": "string" } + }, + "options": { + "title": "Static options", + "description": "List of static options", + "type": "array", + "items": { + "title": "IRawOption", + "examples": [{ "label": "", "value": "" }], + "type": "object", + "properties": { + "label": { "type": "string" }, + "value": { + "anyOf": [ + { "type": "string" }, + { "type": "number" }, + { "type": "boolean" }, + { "const": null } + ] + }, + "description": { "type": "string" }, + "helpText": { "type": "string" } + }, + "required": ["label", "value"], + "additionalProperties": false + } + }, + "secure": { + "title": "Secure options (when using optionsId)", + "description": "Whether to call the secure API endpoint when fetching options from the server (allows for user/instance-specific options)", + "default": false, + "type": "boolean" + }, + "sortOrder": { + "description": "Sorts the code list in either ascending or descending order by label.", + "enum": ["asc", "desc"], + "type": "string" + }, + "source": { + "title": "Option source", + "description": "Allows for fetching options from the data model, pointing to a repeating group structure", + "type": "object", + "properties": { + "group": { + "title": "Group", + "description": "The repeating group to base options on.", + "examples": ["model.some.group"], + "type": "string" + }, + "label": { + "title": "Label", + "description": "A label of the option displayed in Radio- and Checkbox groups. Can be plain text, a text resource binding, or a dynamic expression.", + "examples": ["some.text.key"], + "$ref": "expression.schema.v1.json#/definitions/string" + }, + "value": { + "title": "Value", + "description": "Field in the group that should be used as value", + "examples": ["model.some.group[{0}].someField"], + "type": "string" + }, + "description": { + "title": "Description", + "description": "A description of the option displayed in Radio- and Checkbox groups. Can be plain text, a text resource binding, or a dynamic expression.", + "examples": ["some.text.key", "My Description"], + "$ref": "expression.schema.v1.json#/definitions/string" + }, + "helpText": { + "title": "Help Text", + "description": "A help text for the option displayed in Radio- and Checkbox groups. Can be plain text, a text resource binding, or a dynamic expression.", + "examples": ["some.text.key", "My Help Text"], + "$ref": "expression.schema.v1.json#/definitions/string" + } + }, + "required": ["group", "label", "value"], + "additionalProperties": false + }, + "type": { "const": "FileUploadWithTag" }, + "textResourceBindings": { + "properties": { + "title": { + "title": "Title", + "description": "Label text/title shown above the component", + "$ref": "expression.schema.v1.json#/definitions/string" + }, + "description": { + "title": "Description", + "description": "Label description shown above the component, below the title", + "$ref": "expression.schema.v1.json#/definitions/string" + }, + "help": { + "title": "Help text", + "description": "Help text shown in a tooltip when clicking the help button", + "$ref": "expression.schema.v1.json#/definitions/string" + }, + "tableTitle": { + "title": "Table title", + "description": "Title used in the table view (overrides the default title)", + "$ref": "expression.schema.v1.json#/definitions/string" + }, + "shortName": { + "title": "Short name (for validation)", + "description": "Alternative name used for required validation messages (overrides the default title)", + "$ref": "expression.schema.v1.json#/definitions/string" + }, + "requiredValidation": { + "title": "Required validation message", + "description": "Full validation message shown when the component is required and no value has been entered (overrides both the default and shortName)", + "$ref": "expression.schema.v1.json#/definitions/string" + }, + "summaryTitle": { + "title": "Summary title", + "description": "Title used in the summary view (overrides the default title)", + "$ref": "expression.schema.v1.json#/definitions/string" + }, + "summaryAccessibleTitle": { + "title": "Accessible summary title", + "description": "Title used for aria-label on the edit button in the summary view (overrides the default and summary title)", + "$ref": "expression.schema.v1.json#/definitions/string" + }, + "tagTitle": { + "title": "Tag title", + "description": "The title to show when selecting a tag for each uploaded file", + "$ref": "expression.schema.v1.json#/definitions/string" + } + } + }, + "dataModelBindings": { + "anyOf": [ + { + "title": "Data model binding", + "description": "Describes the location in the data model where the component should store its value(s). A simple binding is used for components that only store a single value, usually a string.", + "type": "object", + "properties": { "simpleBinding": { "type": "string" } }, + "required": ["simpleBinding"], + "additionalProperties": false + }, + { + "title": "Data model binding", + "description": "Describes the location in the data model where the component should store its value(s). A list binding should be pointed to an array structure in the data model, and is used for components that store multiple simple values (e.g. a list of strings).", + "type": "object", + "properties": { "list": { "type": "string" } }, + "required": ["list"], + "additionalProperties": false + } + ] + }, + "maxFileSizeInMB": { + "title": "Max file size (MB)", + "description": "Sets the maximum file size allowed in megabytes", + "type": "integer" + }, + "maxNumberOfAttachments": { + "title": "Max number of attachments", + "description": "Sets the maximum number of attachments allowed to upload", + "type": "integer" + }, + "minNumberOfAttachments": { + "title": "Min number of attachments", + "description": "Sets the minimum number of attachments required to upload", + "type": "integer" + }, + "displayMode": { "enum": ["simple", "list"], "type": "string" }, + "hasCustomFileEndings": { + "title": "Has custom file endings", + "description": "Boolean value indicating if the component has valid file endings", + "default": false, + "type": "boolean" + }, + "validFileEndings": { + "title": "Valid file endings", + "description": "A separated string of valid file endings to upload. If not set all endings are accepted.", + "examples": [".csv", ".doc", ".docx", ".gif", ".jpeg", ".pdf", ".txt"], + "anyOf": [{ "type": "string" }, { "type": "array", "items": { "type": "string" } }] + }, + "alertOnDelete": { + "title": "Alert on delete", + "description": "Boolean value indicating if warning popup should be displayed when attempting to delete an element", + "default": false, + "$ref": "expression.schema.v1.json#/definitions/boolean" + } + }, + "required": [ + "id", + "type", + "maxFileSizeInMB", + "maxNumberOfAttachments", + "minNumberOfAttachments", + "displayMode" + ], + "title": "FileUploadWithTag component schema" +} diff --git a/frontend/packages/ux-editor/src/testing/schemas/json/component/Grid.schema.v1.json b/frontend/packages/ux-editor/src/testing/schemas/json/component/Grid.schema.v1.json index 49fbdd866f1..4d54c35417b 100644 --- a/frontend/packages/ux-editor/src/testing/schemas/json/component/Grid.schema.v1.json +++ b/frontend/packages/ux-editor/src/testing/schemas/json/component/Grid.schema.v1.json @@ -1 +1,138 @@ -{"$id":"https://altinncdn.no/schemas/json/component/Grid.schema.v1.json","$schema":"http://json-schema.org/draft-07/schema#","properties":{"id":{"title":"ID","description":"The component ID. Must be unique within all layouts/pages in a layout-set. Cannot end with .","type":"string","pattern":"^[0-9a-zA-Z][0-9a-zA-Z-]*(-?[a-zA-Z]+|[a-zA-Z][0-9]+|-[0-9]{6,})$"},"hidden":{"title":"Hidden","description":"Boolean value or expression indicating if the component should be hidden. Defaults to false.","default":false,"$ref":"expression.schema.v1.json#/definitions/boolean"},"grid":{"properties":{"xs":{"$ref":"#/definitions/IGridSize"},"sm":{"$ref":"#/definitions/IGridSize"},"md":{"$ref":"#/definitions/IGridSize"},"lg":{"$ref":"#/definitions/IGridSize"},"xl":{"$ref":"#/definitions/IGridSize"},"labelGrid":{"$ref":"#/definitions/IGridStyling"},"innerGrid":{"$ref":"#/definitions/IGridStyling"}}},"pageBreak":{"title":"Page break","description":"Optionally insert page-break before/after component when rendered in PDF","type":"object","properties":{"breakBefore":{"title":"Page break before","description":"PDF only: Value or expression indicating whether a page break should be added before the component. Can be either: 'auto' (default), 'always', or 'avoid'.","examples":["auto","always","avoid"],"default":"auto","$ref":"expression.schema.v1.json#/definitions/string"},"breakAfter":{"title":"Page break after","description":"PDF only: Value or expression indicating whether a page break should be added after the component. Can be either: 'auto' (default), 'always', or 'avoid'.","examples":["auto","always","avoid"],"default":"auto","$ref":"expression.schema.v1.json#/definitions/string"}},"additionalProperties":false},"renderAsSummary":{"title":"Render as summary","description":"Boolean value indicating if the component should be rendered as a summary. Defaults to false.","default":false,"type":"boolean"},"forceShowInSummary":{"title":"Force show in summary","description":"Will force show the component in a summary even if hideEmptyFields is set to true in the summary component.","default":false,"$ref":"expression.schema.v1.json#/definitions/boolean"},"labelSettings":{"title":"ILabelSettings","type":"object","properties":{"optionalIndicator":{"title":"Optional indicator","description":"Show optional indicator on label","type":"boolean"}},"additionalProperties":false},"type":{"const":"Grid"},"textResourceBindings":{"properties":{"title":{"title":"Title","description":"Label text/title shown above the component","$ref":"expression.schema.v1.json#/definitions/string"},"description":{"title":"Description","description":"Label description shown above the component, below the title","$ref":"expression.schema.v1.json#/definitions/string"},"help":{"title":"Help text","description":"Help text shown in a tooltip when clicking the help button","$ref":"expression.schema.v1.json#/definitions/string"},"summaryTitle":{"title":"Summary title","description":"Title used in the summary view (overrides the default title)","$ref":"expression.schema.v1.json#/definitions/string"},"summaryAccessibleTitle":{"title":"Accessible summary title","description":"Title used for aria-label on the edit button in the summary view (overrides the default and summary title)","$ref":"expression.schema.v1.json#/definitions/string"}}},"rows":{"title":"Rows in Grid or Grid-like component","description":"The list of rows in this grid","examples":[[{"header":false,"readOnly":false,"cells":[{"text":"hello.world"},{"component":"myOtherComponent"}]}]],"type":"array","items":{"title":"GridRow","type":"object","properties":{"header":{"title":"Is header row?","default":false,"type":"boolean"},"readOnly":{"title":"Is row read-only?","default":false,"type":"boolean"},"columnOptions":{"$ref":"#/definitions/ITableColumnProperties"},"cells":{"title":"Cells in table row","description":"The list of cells in this row","type":"array","items":{"$ref":"#/definitions/GridCell"}}},"required":["cells"],"additionalProperties":false}}},"required":["id","type","rows"],"title":"Grid component schema"} \ No newline at end of file +{ + "$id": "https://altinncdn.no/schemas/json/component/Grid.schema.v1.json", + "$schema": "http://json-schema.org/draft-07/schema#", + "properties": { + "id": { + "title": "ID", + "description": "The component ID. Must be unique within all layouts/pages in a layout-set. Cannot end with .", + "type": "string", + "pattern": "^[0-9a-zA-Z][0-9a-zA-Z-]*(-?[a-zA-Z]+|[a-zA-Z][0-9]+|-[0-9]{6,})$" + }, + "hidden": { + "title": "Hidden", + "description": "Boolean value or expression indicating if the component should be hidden. Defaults to false.", + "default": false, + "$ref": "expression.schema.v1.json#/definitions/boolean" + }, + "grid": { + "properties": { + "xs": { "$ref": "#/definitions/IGridSize" }, + "sm": { "$ref": "#/definitions/IGridSize" }, + "md": { "$ref": "#/definitions/IGridSize" }, + "lg": { "$ref": "#/definitions/IGridSize" }, + "xl": { "$ref": "#/definitions/IGridSize" }, + "labelGrid": { "$ref": "#/definitions/IGridStyling" }, + "innerGrid": { "$ref": "#/definitions/IGridStyling" } + } + }, + "pageBreak": { + "title": "Page break", + "description": "Optionally insert page-break before/after component when rendered in PDF", + "type": "object", + "properties": { + "breakBefore": { + "title": "Page break before", + "description": "PDF only: Value or expression indicating whether a page break should be added before the component. Can be either: 'auto' (default), 'always', or 'avoid'.", + "examples": ["auto", "always", "avoid"], + "default": "auto", + "$ref": "expression.schema.v1.json#/definitions/string" + }, + "breakAfter": { + "title": "Page break after", + "description": "PDF only: Value or expression indicating whether a page break should be added after the component. Can be either: 'auto' (default), 'always', or 'avoid'.", + "examples": ["auto", "always", "avoid"], + "default": "auto", + "$ref": "expression.schema.v1.json#/definitions/string" + } + }, + "additionalProperties": false + }, + "renderAsSummary": { + "title": "Render as summary", + "description": "Boolean value indicating if the component should be rendered as a summary. Defaults to false.", + "default": false, + "type": "boolean" + }, + "forceShowInSummary": { + "title": "Force show in summary", + "description": "Will force show the component in a summary even if hideEmptyFields is set to true in the summary component.", + "default": false, + "$ref": "expression.schema.v1.json#/definitions/boolean" + }, + "labelSettings": { + "title": "ILabelSettings", + "type": "object", + "properties": { + "optionalIndicator": { + "title": "Optional indicator", + "description": "Show optional indicator on label", + "type": "boolean" + } + }, + "additionalProperties": false + }, + "type": { "const": "Grid" }, + "textResourceBindings": { + "properties": { + "title": { + "title": "Title", + "description": "Label text/title shown above the component", + "$ref": "expression.schema.v1.json#/definitions/string" + }, + "description": { + "title": "Description", + "description": "Label description shown above the component, below the title", + "$ref": "expression.schema.v1.json#/definitions/string" + }, + "help": { + "title": "Help text", + "description": "Help text shown in a tooltip when clicking the help button", + "$ref": "expression.schema.v1.json#/definitions/string" + }, + "summaryTitle": { + "title": "Summary title", + "description": "Title used in the summary view (overrides the default title)", + "$ref": "expression.schema.v1.json#/definitions/string" + }, + "summaryAccessibleTitle": { + "title": "Accessible summary title", + "description": "Title used for aria-label on the edit button in the summary view (overrides the default and summary title)", + "$ref": "expression.schema.v1.json#/definitions/string" + } + } + }, + "rows": { + "title": "Rows in Grid or Grid-like component", + "description": "The list of rows in this grid", + "examples": [ + [ + { + "header": false, + "readOnly": false, + "cells": [{ "text": "hello.world" }, { "component": "myOtherComponent" }] + } + ] + ], + "type": "array", + "items": { + "title": "GridRow", + "type": "object", + "properties": { + "header": { "title": "Is header row?", "default": false, "type": "boolean" }, + "readOnly": { "title": "Is row read-only?", "default": false, "type": "boolean" }, + "columnOptions": { "$ref": "#/definitions/ITableColumnProperties" }, + "cells": { + "title": "Cells in table row", + "description": "The list of cells in this row", + "type": "array", + "items": { "$ref": "#/definitions/GridCell" } + } + }, + "required": ["cells"], + "additionalProperties": false + } + } + }, + "required": ["id", "type", "rows"], + "title": "Grid component schema" +} diff --git a/frontend/packages/ux-editor/src/testing/schemas/json/component/Group.schema.v1.json b/frontend/packages/ux-editor/src/testing/schemas/json/component/Group.schema.v1.json index 49bcf8b0691..1c4c05f295c 100644 --- a/frontend/packages/ux-editor/src/testing/schemas/json/component/Group.schema.v1.json +++ b/frontend/packages/ux-editor/src/testing/schemas/json/component/Group.schema.v1.json @@ -1 +1,108 @@ -{"$id":"https://altinncdn.no/schemas/json/component/Group.schema.v1.json","$schema":"http://json-schema.org/draft-07/schema#","properties":{"id":{"title":"ID","description":"The component ID. Must be unique within all layouts/pages in a layout-set. Cannot end with .","type":"string","pattern":"^[0-9a-zA-Z][0-9a-zA-Z-]*(-?[a-zA-Z]+|[a-zA-Z][0-9]+|-[0-9]{6,})$"},"hidden":{"title":"Hidden","description":"Boolean value or expression indicating if the component should be hidden. Defaults to false.","default":false,"$ref":"expression.schema.v1.json#/definitions/boolean"},"grid":{"properties":{"xs":{"$ref":"#/definitions/IGridSize"},"sm":{"$ref":"#/definitions/IGridSize"},"md":{"$ref":"#/definitions/IGridSize"},"lg":{"$ref":"#/definitions/IGridSize"},"xl":{"$ref":"#/definitions/IGridSize"},"labelGrid":{"$ref":"#/definitions/IGridStyling"},"innerGrid":{"$ref":"#/definitions/IGridStyling"}}},"pageBreak":{"title":"Page break","description":"Optionally insert page-break before/after component when rendered in PDF","type":"object","properties":{"breakBefore":{"title":"Page break before","description":"PDF only: Value or expression indicating whether a page break should be added before the component. Can be either: 'auto' (default), 'always', or 'avoid'.","examples":["auto","always","avoid"],"default":"auto","$ref":"expression.schema.v1.json#/definitions/string"},"breakAfter":{"title":"Page break after","description":"PDF only: Value or expression indicating whether a page break should be added after the component. Can be either: 'auto' (default), 'always', or 'avoid'.","examples":["auto","always","avoid"],"default":"auto","$ref":"expression.schema.v1.json#/definitions/string"}},"additionalProperties":false},"renderAsSummary":{"title":"Render as summary","description":"Boolean value indicating if the component should be rendered as a summary. Defaults to false.","default":false,"type":"boolean"},"forceShowInSummary":{"title":"Force show in summary","description":"Will force show the component in a summary even if hideEmptyFields is set to true in the summary component.","default":false,"$ref":"expression.schema.v1.json#/definitions/boolean"},"type":{"const":"Group"},"textResourceBindings":{"properties":{"title":{"title":"Title","description":"The title of the group (shown above the group)","$ref":"expression.schema.v1.json#/definitions/string"},"description":{"title":"Description","description":"The description text shown underneath the title","$ref":"expression.schema.v1.json#/definitions/string"},"summaryTitle":{"title":"Summary title","description":"Title used in the summary view (overrides the default title)","$ref":"expression.schema.v1.json#/definitions/string"},"summaryAccessibleTitle":{"title":"Accessible summary title","description":"Title used for aria-label on the edit button in the summary view (overrides the default and summary title)","$ref":"expression.schema.v1.json#/definitions/string"}}},"groupingIndicator":{"title":"Set grouping indicator","description":"Can visually group components together by indenting them or by putting them in a panel. ","enum":["indented","panel"],"type":"string"},"children":{"title":"Children","description":"Array of component IDs that should be displayed in the group","type":"array","items":{"type":"string"}},"headingLevel":{"title":"Heading level","description":"The heading level of the group title.","enum":[2,3,4,5,6],"type":"number"}},"required":["id","type","children"],"title":"Group component schema"} \ No newline at end of file +{ + "$id": "https://altinncdn.no/schemas/json/component/Group.schema.v1.json", + "$schema": "http://json-schema.org/draft-07/schema#", + "properties": { + "id": { + "title": "ID", + "description": "The component ID. Must be unique within all layouts/pages in a layout-set. Cannot end with .", + "type": "string", + "pattern": "^[0-9a-zA-Z][0-9a-zA-Z-]*(-?[a-zA-Z]+|[a-zA-Z][0-9]+|-[0-9]{6,})$" + }, + "hidden": { + "title": "Hidden", + "description": "Boolean value or expression indicating if the component should be hidden. Defaults to false.", + "default": false, + "$ref": "expression.schema.v1.json#/definitions/boolean" + }, + "grid": { + "properties": { + "xs": { "$ref": "#/definitions/IGridSize" }, + "sm": { "$ref": "#/definitions/IGridSize" }, + "md": { "$ref": "#/definitions/IGridSize" }, + "lg": { "$ref": "#/definitions/IGridSize" }, + "xl": { "$ref": "#/definitions/IGridSize" }, + "labelGrid": { "$ref": "#/definitions/IGridStyling" }, + "innerGrid": { "$ref": "#/definitions/IGridStyling" } + } + }, + "pageBreak": { + "title": "Page break", + "description": "Optionally insert page-break before/after component when rendered in PDF", + "type": "object", + "properties": { + "breakBefore": { + "title": "Page break before", + "description": "PDF only: Value or expression indicating whether a page break should be added before the component. Can be either: 'auto' (default), 'always', or 'avoid'.", + "examples": ["auto", "always", "avoid"], + "default": "auto", + "$ref": "expression.schema.v1.json#/definitions/string" + }, + "breakAfter": { + "title": "Page break after", + "description": "PDF only: Value or expression indicating whether a page break should be added after the component. Can be either: 'auto' (default), 'always', or 'avoid'.", + "examples": ["auto", "always", "avoid"], + "default": "auto", + "$ref": "expression.schema.v1.json#/definitions/string" + } + }, + "additionalProperties": false + }, + "renderAsSummary": { + "title": "Render as summary", + "description": "Boolean value indicating if the component should be rendered as a summary. Defaults to false.", + "default": false, + "type": "boolean" + }, + "forceShowInSummary": { + "title": "Force show in summary", + "description": "Will force show the component in a summary even if hideEmptyFields is set to true in the summary component.", + "default": false, + "$ref": "expression.schema.v1.json#/definitions/boolean" + }, + "type": { "const": "Group" }, + "textResourceBindings": { + "properties": { + "title": { + "title": "Title", + "description": "The title of the group (shown above the group)", + "$ref": "expression.schema.v1.json#/definitions/string" + }, + "description": { + "title": "Description", + "description": "The description text shown underneath the title", + "$ref": "expression.schema.v1.json#/definitions/string" + }, + "summaryTitle": { + "title": "Summary title", + "description": "Title used in the summary view (overrides the default title)", + "$ref": "expression.schema.v1.json#/definitions/string" + }, + "summaryAccessibleTitle": { + "title": "Accessible summary title", + "description": "Title used for aria-label on the edit button in the summary view (overrides the default and summary title)", + "$ref": "expression.schema.v1.json#/definitions/string" + } + } + }, + "groupingIndicator": { + "title": "Set grouping indicator", + "description": "Can visually group components together by indenting them or by putting them in a panel. ", + "enum": ["indented", "panel"], + "type": "string" + }, + "children": { + "title": "Children", + "description": "Array of component IDs that should be displayed in the group", + "type": "array", + "items": { "type": "string" } + }, + "headingLevel": { + "title": "Heading level", + "description": "The heading level of the group title.", + "enum": [2, 3, 4, 5, 6], + "type": "string" + } + }, + "required": ["id", "type", "children"], + "title": "Group component schema" +} diff --git a/frontend/packages/ux-editor/src/testing/schemas/json/component/Header.schema.v1.json b/frontend/packages/ux-editor/src/testing/schemas/json/component/Header.schema.v1.json index 74d92afd183..539e8b7e800 100644 --- a/frontend/packages/ux-editor/src/testing/schemas/json/component/Header.schema.v1.json +++ b/frontend/packages/ux-editor/src/testing/schemas/json/component/Header.schema.v1.json @@ -1 +1,76 @@ -{"$id":"https://altinncdn.no/schemas/json/component/Header.schema.v1.json","$schema":"http://json-schema.org/draft-07/schema#","properties":{"id":{"title":"ID","description":"The component ID. Must be unique within all layouts/pages in a layout-set. Cannot end with .","type":"string","pattern":"^[0-9a-zA-Z][0-9a-zA-Z-]*(-?[a-zA-Z]+|[a-zA-Z][0-9]+|-[0-9]{6,})$"},"hidden":{"title":"Hidden","description":"Boolean value or expression indicating if the component should be hidden. Defaults to false.","default":false,"$ref":"expression.schema.v1.json#/definitions/boolean"},"grid":{"properties":{"xs":{"$ref":"#/definitions/IGridSize"},"sm":{"$ref":"#/definitions/IGridSize"},"md":{"$ref":"#/definitions/IGridSize"},"lg":{"$ref":"#/definitions/IGridSize"},"xl":{"$ref":"#/definitions/IGridSize"},"labelGrid":{"$ref":"#/definitions/IGridStyling"},"innerGrid":{"$ref":"#/definitions/IGridStyling"}}},"pageBreak":{"title":"Page break","description":"Optionally insert page-break before/after component when rendered in PDF","type":"object","properties":{"breakBefore":{"title":"Page break before","description":"PDF only: Value or expression indicating whether a page break should be added before the component. Can be either: 'auto' (default), 'always', or 'avoid'.","examples":["auto","always","avoid"],"default":"auto","$ref":"expression.schema.v1.json#/definitions/string"},"breakAfter":{"title":"Page break after","description":"PDF only: Value or expression indicating whether a page break should be added after the component. Can be either: 'auto' (default), 'always', or 'avoid'.","examples":["auto","always","avoid"],"default":"auto","$ref":"expression.schema.v1.json#/definitions/string"}},"additionalProperties":false},"type":{"const":"Header"},"textResourceBindings":{"type":"object","properties":{"title":{"title":"Title","description":"The text to display in the header","$ref":"expression.schema.v1.json#/definitions/string"},"help":{"title":"Help text","description":"The text to display in the help tooltip/popup","$ref":"expression.schema.v1.json#/definitions/string"}},"additionalProperties":false},"size":{"title":"Size","description":"The size of the header","enum":["L","M","S","h2","h3","h4"],"type":"string"}},"required":["id","type","size"],"title":"Header component schema"} \ No newline at end of file +{ + "$id": "https://altinncdn.no/schemas/json/component/Header.schema.v1.json", + "$schema": "http://json-schema.org/draft-07/schema#", + "properties": { + "id": { + "title": "ID", + "description": "The component ID. Must be unique within all layouts/pages in a layout-set. Cannot end with .", + "type": "string", + "pattern": "^[0-9a-zA-Z][0-9a-zA-Z-]*(-?[a-zA-Z]+|[a-zA-Z][0-9]+|-[0-9]{6,})$" + }, + "hidden": { + "title": "Hidden", + "description": "Boolean value or expression indicating if the component should be hidden. Defaults to false.", + "default": false, + "$ref": "expression.schema.v1.json#/definitions/boolean" + }, + "grid": { + "properties": { + "xs": { "$ref": "#/definitions/IGridSize" }, + "sm": { "$ref": "#/definitions/IGridSize" }, + "md": { "$ref": "#/definitions/IGridSize" }, + "lg": { "$ref": "#/definitions/IGridSize" }, + "xl": { "$ref": "#/definitions/IGridSize" }, + "labelGrid": { "$ref": "#/definitions/IGridStyling" }, + "innerGrid": { "$ref": "#/definitions/IGridStyling" } + } + }, + "pageBreak": { + "title": "Page break", + "description": "Optionally insert page-break before/after component when rendered in PDF", + "type": "object", + "properties": { + "breakBefore": { + "title": "Page break before", + "description": "PDF only: Value or expression indicating whether a page break should be added before the component. Can be either: 'auto' (default), 'always', or 'avoid'.", + "examples": ["auto", "always", "avoid"], + "default": "auto", + "$ref": "expression.schema.v1.json#/definitions/string" + }, + "breakAfter": { + "title": "Page break after", + "description": "PDF only: Value or expression indicating whether a page break should be added after the component. Can be either: 'auto' (default), 'always', or 'avoid'.", + "examples": ["auto", "always", "avoid"], + "default": "auto", + "$ref": "expression.schema.v1.json#/definitions/string" + } + }, + "additionalProperties": false + }, + "type": { "const": "Header" }, + "textResourceBindings": { + "type": "object", + "properties": { + "title": { + "title": "Title", + "description": "The text to display in the header", + "$ref": "expression.schema.v1.json#/definitions/string" + }, + "help": { + "title": "Help text", + "description": "The text to display in the help tooltip/popup", + "$ref": "expression.schema.v1.json#/definitions/string" + } + }, + "additionalProperties": false + }, + "size": { + "title": "Size", + "description": "The size of the header", + "enum": ["L", "M", "S", "h2", "h3", "h4"], + "type": "string" + } + }, + "required": ["id", "type", "size"], + "title": "Header component schema" +} diff --git a/frontend/packages/ux-editor/src/testing/schemas/json/component/IFrame.schema.v1.json b/frontend/packages/ux-editor/src/testing/schemas/json/component/IFrame.schema.v1.json index 5f39343c136..a960ac482fd 100644 --- a/frontend/packages/ux-editor/src/testing/schemas/json/component/IFrame.schema.v1.json +++ b/frontend/packages/ux-editor/src/testing/schemas/json/component/IFrame.schema.v1.json @@ -1 +1,84 @@ -{"$id":"https://altinncdn.no/schemas/json/component/IFrame.schema.v1.json","$schema":"http://json-schema.org/draft-07/schema#","properties":{"id":{"title":"ID","description":"The component ID. Must be unique within all layouts/pages in a layout-set. Cannot end with .","type":"string","pattern":"^[0-9a-zA-Z][0-9a-zA-Z-]*(-?[a-zA-Z]+|[a-zA-Z][0-9]+|-[0-9]{6,})$"},"hidden":{"title":"Hidden","description":"Boolean value or expression indicating if the component should be hidden. Defaults to false.","default":false,"$ref":"expression.schema.v1.json#/definitions/boolean"},"grid":{"properties":{"xs":{"$ref":"#/definitions/IGridSize"},"sm":{"$ref":"#/definitions/IGridSize"},"md":{"$ref":"#/definitions/IGridSize"},"lg":{"$ref":"#/definitions/IGridSize"},"xl":{"$ref":"#/definitions/IGridSize"},"labelGrid":{"$ref":"#/definitions/IGridStyling"},"innerGrid":{"$ref":"#/definitions/IGridStyling"}}},"pageBreak":{"title":"Page break","description":"Optionally insert page-break before/after component when rendered in PDF","type":"object","properties":{"breakBefore":{"title":"Page break before","description":"PDF only: Value or expression indicating whether a page break should be added before the component. Can be either: 'auto' (default), 'always', or 'avoid'.","examples":["auto","always","avoid"],"default":"auto","$ref":"expression.schema.v1.json#/definitions/string"},"breakAfter":{"title":"Page break after","description":"PDF only: Value or expression indicating whether a page break should be added after the component. Can be either: 'auto' (default), 'always', or 'avoid'.","examples":["auto","always","avoid"],"default":"auto","$ref":"expression.schema.v1.json#/definitions/string"}},"additionalProperties":false},"type":{"const":"IFrame"},"textResourceBindings":{"type":"object","properties":{"title":{"title":"Title/text/content","description":"The content of the IFrame. Can for example be be set to a string containing HTML, a text resource key, or an expression looking up a value from the data model","$ref":"expression.schema.v1.json#/definitions/string"}},"additionalProperties":false},"sandbox":{"title":"ISandboxProperties","type":"object","properties":{"allowPopups":{"title":"Allow popups","description":"Sets \"allow-popups\" in the sandbox attribute on the iframe. See: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/iframe#sandbox","default":false,"type":"boolean"},"allowPopupsToEscapeSandbox":{"title":"Allow popups to escape sandbox","description":"Sets \"allow-popups-to-escape-sandbox\" in the sandbox attribute on the iframe. See: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/iframe#sandbox","default":false,"type":"boolean"}},"additionalProperties":false}},"required":["id","type"],"title":"IFrame component schema"} \ No newline at end of file +{ + "$id": "https://altinncdn.no/schemas/json/component/IFrame.schema.v1.json", + "$schema": "http://json-schema.org/draft-07/schema#", + "properties": { + "id": { + "title": "ID", + "description": "The component ID. Must be unique within all layouts/pages in a layout-set. Cannot end with .", + "type": "string", + "pattern": "^[0-9a-zA-Z][0-9a-zA-Z-]*(-?[a-zA-Z]+|[a-zA-Z][0-9]+|-[0-9]{6,})$" + }, + "hidden": { + "title": "Hidden", + "description": "Boolean value or expression indicating if the component should be hidden. Defaults to false.", + "default": false, + "$ref": "expression.schema.v1.json#/definitions/boolean" + }, + "grid": { + "properties": { + "xs": { "$ref": "#/definitions/IGridSize" }, + "sm": { "$ref": "#/definitions/IGridSize" }, + "md": { "$ref": "#/definitions/IGridSize" }, + "lg": { "$ref": "#/definitions/IGridSize" }, + "xl": { "$ref": "#/definitions/IGridSize" }, + "labelGrid": { "$ref": "#/definitions/IGridStyling" }, + "innerGrid": { "$ref": "#/definitions/IGridStyling" } + } + }, + "pageBreak": { + "title": "Page break", + "description": "Optionally insert page-break before/after component when rendered in PDF", + "type": "object", + "properties": { + "breakBefore": { + "title": "Page break before", + "description": "PDF only: Value or expression indicating whether a page break should be added before the component. Can be either: 'auto' (default), 'always', or 'avoid'.", + "examples": ["auto", "always", "avoid"], + "default": "auto", + "$ref": "expression.schema.v1.json#/definitions/string" + }, + "breakAfter": { + "title": "Page break after", + "description": "PDF only: Value or expression indicating whether a page break should be added after the component. Can be either: 'auto' (default), 'always', or 'avoid'.", + "examples": ["auto", "always", "avoid"], + "default": "auto", + "$ref": "expression.schema.v1.json#/definitions/string" + } + }, + "additionalProperties": false + }, + "type": { "const": "IFrame" }, + "textResourceBindings": { + "type": "object", + "properties": { + "title": { + "title": "Title/text/content", + "description": "The content of the IFrame. Can for example be be set to a string containing HTML, a text resource key, or an expression looking up a value from the data model", + "$ref": "expression.schema.v1.json#/definitions/string" + } + }, + "additionalProperties": false + }, + "sandbox": { + "title": "ISandboxProperties", + "type": "object", + "properties": { + "allowPopups": { + "title": "Allow popups", + "description": "Sets \"allow-popups\" in the sandbox attribute on the iframe. See: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/iframe#sandbox", + "default": false, + "type": "boolean" + }, + "allowPopupsToEscapeSandbox": { + "title": "Allow popups to escape sandbox", + "description": "Sets \"allow-popups-to-escape-sandbox\" in the sandbox attribute on the iframe. See: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/iframe#sandbox", + "default": false, + "type": "boolean" + } + }, + "additionalProperties": false + } + }, + "required": ["id", "type"], + "title": "IFrame component schema" +} diff --git a/frontend/packages/ux-editor/src/testing/schemas/json/component/Image.schema.v1.json b/frontend/packages/ux-editor/src/testing/schemas/json/component/Image.schema.v1.json index 7d85f9a42f3..37f138cc7dc 100644 --- a/frontend/packages/ux-editor/src/testing/schemas/json/component/Image.schema.v1.json +++ b/frontend/packages/ux-editor/src/testing/schemas/json/component/Image.schema.v1.json @@ -1 +1,81 @@ -{"$id":"https://altinncdn.no/schemas/json/component/Image.schema.v1.json","$schema":"http://json-schema.org/draft-07/schema#","properties":{"id":{"title":"ID","description":"The component ID. Must be unique within all layouts/pages in a layout-set. Cannot end with .","type":"string","pattern":"^[0-9a-zA-Z][0-9a-zA-Z-]*(-?[a-zA-Z]+|[a-zA-Z][0-9]+|-[0-9]{6,})$"},"hidden":{"title":"Hidden","description":"Boolean value or expression indicating if the component should be hidden. Defaults to false.","default":false,"$ref":"expression.schema.v1.json#/definitions/boolean"},"grid":{"properties":{"xs":{"$ref":"#/definitions/IGridSize"},"sm":{"$ref":"#/definitions/IGridSize"},"md":{"$ref":"#/definitions/IGridSize"},"lg":{"$ref":"#/definitions/IGridSize"},"xl":{"$ref":"#/definitions/IGridSize"},"labelGrid":{"$ref":"#/definitions/IGridStyling"},"innerGrid":{"$ref":"#/definitions/IGridStyling"}}},"pageBreak":{"title":"Page break","description":"Optionally insert page-break before/after component when rendered in PDF","type":"object","properties":{"breakBefore":{"title":"Page break before","description":"PDF only: Value or expression indicating whether a page break should be added before the component. Can be either: 'auto' (default), 'always', or 'avoid'.","examples":["auto","always","avoid"],"default":"auto","$ref":"expression.schema.v1.json#/definitions/string"},"breakAfter":{"title":"Page break after","description":"PDF only: Value or expression indicating whether a page break should be added after the component. Can be either: 'auto' (default), 'always', or 'avoid'.","examples":["auto","always","avoid"],"default":"auto","$ref":"expression.schema.v1.json#/definitions/string"}},"additionalProperties":false},"type":{"const":"Image"},"textResourceBindings":{"type":"object","properties":{"help":{"title":"Help text","description":"Help text for the image (shown in help text tooltip/popup)","$ref":"expression.schema.v1.json#/definitions/string"},"altTextImg":{"title":"Alt text","description":"Alternative text for the image (for screen readers).","$ref":"expression.schema.v1.json#/definitions/string"}},"additionalProperties":false},"image":{"title":"IImage","type":"object","properties":{"src":{"$ref":"#/definitions/IImageSrc"},"width":{"title":"Image width","examples":["100%"],"type":"string"},"align":{"$ref":"#/definitions/GridJustification"}},"required":["src","width","align"],"additionalProperties":false}},"required":["id","type"],"title":"Image component schema"} \ No newline at end of file +{ + "$id": "https://altinncdn.no/schemas/json/component/Image.schema.v1.json", + "$schema": "http://json-schema.org/draft-07/schema#", + "properties": { + "id": { + "title": "ID", + "description": "The component ID. Must be unique within all layouts/pages in a layout-set. Cannot end with .", + "type": "string", + "pattern": "^[0-9a-zA-Z][0-9a-zA-Z-]*(-?[a-zA-Z]+|[a-zA-Z][0-9]+|-[0-9]{6,})$" + }, + "hidden": { + "title": "Hidden", + "description": "Boolean value or expression indicating if the component should be hidden. Defaults to false.", + "default": false, + "$ref": "expression.schema.v1.json#/definitions/boolean" + }, + "grid": { + "properties": { + "xs": { "$ref": "#/definitions/IGridSize" }, + "sm": { "$ref": "#/definitions/IGridSize" }, + "md": { "$ref": "#/definitions/IGridSize" }, + "lg": { "$ref": "#/definitions/IGridSize" }, + "xl": { "$ref": "#/definitions/IGridSize" }, + "labelGrid": { "$ref": "#/definitions/IGridStyling" }, + "innerGrid": { "$ref": "#/definitions/IGridStyling" } + } + }, + "pageBreak": { + "title": "Page break", + "description": "Optionally insert page-break before/after component when rendered in PDF", + "type": "object", + "properties": { + "breakBefore": { + "title": "Page break before", + "description": "PDF only: Value or expression indicating whether a page break should be added before the component. Can be either: 'auto' (default), 'always', or 'avoid'.", + "examples": ["auto", "always", "avoid"], + "default": "auto", + "$ref": "expression.schema.v1.json#/definitions/string" + }, + "breakAfter": { + "title": "Page break after", + "description": "PDF only: Value or expression indicating whether a page break should be added after the component. Can be either: 'auto' (default), 'always', or 'avoid'.", + "examples": ["auto", "always", "avoid"], + "default": "auto", + "$ref": "expression.schema.v1.json#/definitions/string" + } + }, + "additionalProperties": false + }, + "type": { "const": "Image" }, + "textResourceBindings": { + "type": "object", + "properties": { + "help": { + "title": "Help text", + "description": "Help text for the image (shown in help text tooltip/popup)", + "$ref": "expression.schema.v1.json#/definitions/string" + }, + "altTextImg": { + "title": "Alt text", + "description": "Alternative text for the image (for screen readers).", + "$ref": "expression.schema.v1.json#/definitions/string" + } + }, + "additionalProperties": false + }, + "image": { + "title": "IImage", + "type": "object", + "properties": { + "src": { "$ref": "#/definitions/IImageSrc" }, + "width": { "title": "Image width", "examples": ["100%"], "type": "string" }, + "align": { "$ref": "#/definitions/GridJustification" } + }, + "required": ["src", "width", "align"], + "additionalProperties": false + } + }, + "required": ["id", "type"], + "title": "Image component schema" +} diff --git a/frontend/packages/ux-editor/src/testing/schemas/json/component/Input.schema.v1.json b/frontend/packages/ux-editor/src/testing/schemas/json/component/Input.schema.v1.json index a8ecb09bb38..4f7bd9c4b30 100644 --- a/frontend/packages/ux-editor/src/testing/schemas/json/component/Input.schema.v1.json +++ b/frontend/packages/ux-editor/src/testing/schemas/json/component/Input.schema.v1.json @@ -1 +1,482 @@ -{"$id":"https://altinncdn.no/schemas/json/component/Input.schema.v1.json","$schema":"http://json-schema.org/draft-07/schema#","properties":{"id":{"title":"ID","description":"The component ID. Must be unique within all layouts/pages in a layout-set. Cannot end with .","type":"string","pattern":"^[0-9a-zA-Z][0-9a-zA-Z-]*(-?[a-zA-Z]+|[a-zA-Z][0-9]+|-[0-9]{6,})$"},"hidden":{"title":"Hidden","description":"Boolean value or expression indicating if the component should be hidden. Defaults to false.","default":false,"$ref":"expression.schema.v1.json#/definitions/boolean"},"grid":{"properties":{"xs":{"$ref":"#/definitions/IGridSize"},"sm":{"$ref":"#/definitions/IGridSize"},"md":{"$ref":"#/definitions/IGridSize"},"lg":{"$ref":"#/definitions/IGridSize"},"xl":{"$ref":"#/definitions/IGridSize"},"labelGrid":{"$ref":"#/definitions/IGridStyling"},"innerGrid":{"$ref":"#/definitions/IGridStyling"}}},"pageBreak":{"title":"Page break","description":"Optionally insert page-break before/after component when rendered in PDF","type":"object","properties":{"breakBefore":{"title":"Page break before","description":"PDF only: Value or expression indicating whether a page break should be added before the component. Can be either: 'auto' (default), 'always', or 'avoid'.","examples":["auto","always","avoid"],"default":"auto","$ref":"expression.schema.v1.json#/definitions/string"},"breakAfter":{"title":"Page break after","description":"PDF only: Value or expression indicating whether a page break should be added after the component. Can be either: 'auto' (default), 'always', or 'avoid'.","examples":["auto","always","avoid"],"default":"auto","$ref":"expression.schema.v1.json#/definitions/string"}},"additionalProperties":false},"readOnly":{"title":"Read only/disabled?","description":"Boolean value or expression indicating if the component should be read only/disabled. Defaults to false.
Please note that even with read-only fields in components, it may currently be possible to update the field by modifying the request sent to the API or through a direct API call.","default":false,"$ref":"expression.schema.v1.json#/definitions/boolean"},"required":{"title":"Required?","description":"Boolean value or expression indicating if the component should be required. Defaults to false.","default":false,"$ref":"expression.schema.v1.json#/definitions/boolean"},"showValidations":{"title":"Validation types","description":"List of validation types to show","type":"array","items":{"enum":["Schema","Component","Expression","CustomBackend","Required","AllExceptRequired","All"],"type":"string"}},"renderAsSummary":{"title":"Render as summary","description":"Boolean value indicating if the component should be rendered as a summary. Defaults to false.","default":false,"type":"boolean"},"forceShowInSummary":{"title":"Force show in summary","description":"Will force show the component in a summary even if hideEmptyFields is set to true in the summary component.","default":false,"$ref":"expression.schema.v1.json#/definitions/boolean"},"labelSettings":{"title":"ILabelSettings","type":"object","properties":{"optionalIndicator":{"title":"Optional indicator","description":"Show optional indicator on label","type":"boolean"}},"additionalProperties":false},"type":{"const":"Input"},"textResourceBindings":{"properties":{"title":{"title":"Title","description":"Label text/title shown above the component","$ref":"expression.schema.v1.json#/definitions/string"},"description":{"title":"Description","description":"Label description shown above the component, below the title","$ref":"expression.schema.v1.json#/definitions/string"},"help":{"title":"Help text","description":"Help text shown in a tooltip when clicking the help button","$ref":"expression.schema.v1.json#/definitions/string"},"tableTitle":{"title":"Table title","description":"Title used in the table view (overrides the default title)","$ref":"expression.schema.v1.json#/definitions/string"},"shortName":{"title":"Short name (for validation)","description":"Alternative name used for required validation messages (overrides the default title)","$ref":"expression.schema.v1.json#/definitions/string"},"requiredValidation":{"title":"Required validation message","description":"Full validation message shown when the component is required and no value has been entered (overrides both the default and shortName)","$ref":"expression.schema.v1.json#/definitions/string"},"summaryTitle":{"title":"Summary title","description":"Title used in the summary view (overrides the default title)","$ref":"expression.schema.v1.json#/definitions/string"},"summaryAccessibleTitle":{"title":"Accessible summary title","description":"Title used for aria-label on the edit button in the summary view (overrides the default and summary title)","$ref":"expression.schema.v1.json#/definitions/string"},"prefix":{"title":"Prefix","description":"Prefix shown before the input field","$ref":"expression.schema.v1.json#/definitions/string"},"suffix":{"title":"Suffix","description":"Suffix shown after the input field","$ref":"expression.schema.v1.json#/definitions/string"}}},"dataModelBindings":{"title":"Data model binding","description":"Describes the location in the data model where the component should store its value(s). A simple binding is used for components that only store a single value, usually a string.","type":"object","properties":{"simpleBinding":{"type":"string"}},"required":["simpleBinding"],"additionalProperties":false},"saveWhileTyping":{"title":"Automatic saving while typing","description":"Lets you control how long we wait before saving the value locally while typing. This value is usually also used to determine how long we wait before saving the value to the server. The default value is 400 milliseconds.","default":400,"type":"number"},"formatting":{"title":"IFormatting","examples":[{"currency":"NOK"},{"number":{"thousandSeparator":" ","decimalSeparator":",","allowNegative":false,"suffix":" kr"}}],"type":"object","properties":{"currency":{"title":"Language-sensitive currency formatting","description":"Enables currency to be language sensitive based on selected app language. Note: parts that already exist in number property are not overridden by this prop.","enum":["AED","AFN","ALL","AMD","ANG","AOA","ARS","AUD","AWG","AZN","BAM","BBD","BDT","BGN","BHD","BIF","BMD","BND","BOB","BOV","BRL","BSD","BTN","BWP","BYN","BZD","CAD","CDF","CHE","CHF","CHW","CLF","CLP","CNY","COP","COU","CRC","CUC","CUP","CVE","CZK","DJF","DKK","DOP","DZD","EGP","ERN","ETB","EUR","FJD","FKP","GBP","GEL","GHS","GIP","GMD","GNF","GTQ","GYD","HKD","HNL","HTG","HUF","IDR","ILS","INR","IQD","IRR","ISK","JMD","JOD","JPY","KES","KGS","KHR","KMF","KPW","KRW","KWD","KYD","KZT","LAK","LBP","LKR","LRD","LSL","LYD","MAD","MDL","MGA","MKD","MMK","MNT","MOP","MRU","MUR","MVR","MWK","MXN","MXV","MYR","MZN","NAD","NGN","NIO","NOK","NPR","NZD","OMR","PAB","PEN","PGK","PHP","PKR","PLN","PYG","QAR","RON","RSD","RUB","RWF","SAR","SBD","SCR","SDG","SEK","SGD","SHP","SLE","SLL","SOS","SRD","SSP","STN","SVC","SYP","SZL","THB","TJS","TMT","TND","TOP","TRY","TTD","TWD","TZS","UAH","UGX","USD","USN","UYI","UYU","UYW","UZS","VED","VES","VND","VUV","WST","XAF","XCD","XDR","XOF","XPF","XSU","XUA","YER","ZAR","ZMW","ZWL"]},"unit":{"title":"Language-sensitive number formatting based on unit","description":"Enables unit along with thousand and decimal separators to be language sensitive based on selected app language. They are configured in number property. Note: parts that already exist in number property are not overridden by this prop.","enum":["celsius","centimeter","day","degree","foot","gram","hectare","hour","inch","kilogram","kilometer","liter","meter","milliliter","millimeter","millisecond","minute","month","percent","second","week","year"]},"position":{"title":"Position of the currency/unit symbol","description":"Display the unit as prefix or suffix. Default is prefix. (Use only when using currency or unit options)","enum":["prefix","suffix"]},"number":{"anyOf":[{"$ref":"#/definitions/PatternFormatProps"},{"$ref":"#/definitions/NumberFormatProps"}]},"align":{"default":"left","enum":["right","center","left"]}},"additionalProperties":false},"variant":{"title":"Input variant","description":"The variant of the input field (text or search).","default":"text","enum":["text","search"],"type":"string"},"autocomplete":{"title":"HTML autocomplete values","description":"Autocomplete hints to the browser. See https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/autocomplete","enum":["on","off","name","honorific-prefix","given-name","additional-name","family-name","honorific-suffix","nickname","email","username","new-password","current-password","one-time-code","organization-title","organization","street-address","address-line1","address-line2","address-line3","address-level4","address-level3","address-level2","address-level1","country","country-name","postal-code","cc-name","cc-given-name","cc-additional-name","cc-family-name","cc-number","cc-exp","cc-exp-month","cc-exp-year","cc-csc","cc-type","transaction-currency","transaction-amount","language","bday","bday-day","bday-month","bday-year","sex","tel","tel-country-code","tel-national","tel-area-code","tel-local","tel-extension","impp","url","photo"],"type":"string"},"maxLength":{"title":"Max length","description":"Max length of the input field. Will add a counter to let the user know how many characters are left.","type":"integer"}},"required":["id","type","dataModelBindings"],"title":"Input component schema"} \ No newline at end of file +{ + "$id": "https://altinncdn.no/schemas/json/component/Input.schema.v1.json", + "$schema": "http://json-schema.org/draft-07/schema#", + "properties": { + "id": { + "title": "ID", + "description": "The component ID. Must be unique within all layouts/pages in a layout-set. Cannot end with .", + "type": "string", + "pattern": "^[0-9a-zA-Z][0-9a-zA-Z-]*(-?[a-zA-Z]+|[a-zA-Z][0-9]+|-[0-9]{6,})$" + }, + "hidden": { + "title": "Hidden", + "description": "Boolean value or expression indicating if the component should be hidden. Defaults to false.", + "default": false, + "$ref": "expression.schema.v1.json#/definitions/boolean" + }, + "grid": { + "properties": { + "xs": { "$ref": "#/definitions/IGridSize" }, + "sm": { "$ref": "#/definitions/IGridSize" }, + "md": { "$ref": "#/definitions/IGridSize" }, + "lg": { "$ref": "#/definitions/IGridSize" }, + "xl": { "$ref": "#/definitions/IGridSize" }, + "labelGrid": { "$ref": "#/definitions/IGridStyling" }, + "innerGrid": { "$ref": "#/definitions/IGridStyling" } + } + }, + "pageBreak": { + "title": "Page break", + "description": "Optionally insert page-break before/after component when rendered in PDF", + "type": "object", + "properties": { + "breakBefore": { + "title": "Page break before", + "description": "PDF only: Value or expression indicating whether a page break should be added before the component. Can be either: 'auto' (default), 'always', or 'avoid'.", + "examples": ["auto", "always", "avoid"], + "default": "auto", + "$ref": "expression.schema.v1.json#/definitions/string" + }, + "breakAfter": { + "title": "Page break after", + "description": "PDF only: Value or expression indicating whether a page break should be added after the component. Can be either: 'auto' (default), 'always', or 'avoid'.", + "examples": ["auto", "always", "avoid"], + "default": "auto", + "$ref": "expression.schema.v1.json#/definitions/string" + } + }, + "additionalProperties": false + }, + "readOnly": { + "title": "Read only/disabled?", + "description": "Boolean value or expression indicating if the component should be read only/disabled. Defaults to false.
Please note that even with read-only fields in components, it may currently be possible to update the field by modifying the request sent to the API or through a direct API call.", + "default": false, + "$ref": "expression.schema.v1.json#/definitions/boolean" + }, + "required": { + "title": "Required?", + "description": "Boolean value or expression indicating if the component should be required. Defaults to false.", + "default": false, + "$ref": "expression.schema.v1.json#/definitions/boolean" + }, + "showValidations": { + "title": "Validation types", + "description": "List of validation types to show", + "type": "array", + "items": { + "enum": [ + "Schema", + "Component", + "Expression", + "CustomBackend", + "Required", + "AllExceptRequired", + "All" + ], + "type": "string" + } + }, + "renderAsSummary": { + "title": "Render as summary", + "description": "Boolean value indicating if the component should be rendered as a summary. Defaults to false.", + "default": false, + "type": "boolean" + }, + "forceShowInSummary": { + "title": "Force show in summary", + "description": "Will force show the component in a summary even if hideEmptyFields is set to true in the summary component.", + "default": false, + "$ref": "expression.schema.v1.json#/definitions/boolean" + }, + "labelSettings": { + "title": "ILabelSettings", + "type": "object", + "properties": { + "optionalIndicator": { + "title": "Optional indicator", + "description": "Show optional indicator on label", + "type": "boolean" + } + }, + "additionalProperties": false + }, + "type": { "const": "Input" }, + "textResourceBindings": { + "properties": { + "title": { + "title": "Title", + "description": "Label text/title shown above the component", + "$ref": "expression.schema.v1.json#/definitions/string" + }, + "description": { + "title": "Description", + "description": "Label description shown above the component, below the title", + "$ref": "expression.schema.v1.json#/definitions/string" + }, + "help": { + "title": "Help text", + "description": "Help text shown in a tooltip when clicking the help button", + "$ref": "expression.schema.v1.json#/definitions/string" + }, + "tableTitle": { + "title": "Table title", + "description": "Title used in the table view (overrides the default title)", + "$ref": "expression.schema.v1.json#/definitions/string" + }, + "shortName": { + "title": "Short name (for validation)", + "description": "Alternative name used for required validation messages (overrides the default title)", + "$ref": "expression.schema.v1.json#/definitions/string" + }, + "requiredValidation": { + "title": "Required validation message", + "description": "Full validation message shown when the component is required and no value has been entered (overrides both the default and shortName)", + "$ref": "expression.schema.v1.json#/definitions/string" + }, + "summaryTitle": { + "title": "Summary title", + "description": "Title used in the summary view (overrides the default title)", + "$ref": "expression.schema.v1.json#/definitions/string" + }, + "summaryAccessibleTitle": { + "title": "Accessible summary title", + "description": "Title used for aria-label on the edit button in the summary view (overrides the default and summary title)", + "$ref": "expression.schema.v1.json#/definitions/string" + }, + "prefix": { + "title": "Prefix", + "description": "Prefix shown before the input field", + "$ref": "expression.schema.v1.json#/definitions/string" + }, + "suffix": { + "title": "Suffix", + "description": "Suffix shown after the input field", + "$ref": "expression.schema.v1.json#/definitions/string" + } + } + }, + "dataModelBindings": { + "title": "Data model binding", + "description": "Describes the location in the data model where the component should store its value(s). A simple binding is used for components that only store a single value, usually a string.", + "type": "object", + "properties": { "simpleBinding": { "type": "string" } }, + "required": ["simpleBinding"], + "additionalProperties": false + }, + "saveWhileTyping": { + "title": "Automatic saving while typing", + "description": "Lets you control how long we wait before saving the value locally while typing. This value is usually also used to determine how long we wait before saving the value to the server. The default value is 400 milliseconds.", + "default": 400, + "type": "number" + }, + "formatting": { + "title": "IFormatting", + "examples": [ + { "currency": "NOK" }, + { + "number": { + "thousandSeparator": " ", + "decimalSeparator": ",", + "allowNegative": false, + "suffix": " kr" + } + } + ], + "type": "object", + "properties": { + "currency": { + "title": "Language-sensitive currency formatting", + "description": "Enables currency to be language sensitive based on selected app language. Note: parts that already exist in number property are not overridden by this prop.", + "enum": [ + "AED", + "AFN", + "ALL", + "AMD", + "ANG", + "AOA", + "ARS", + "AUD", + "AWG", + "AZN", + "BAM", + "BBD", + "BDT", + "BGN", + "BHD", + "BIF", + "BMD", + "BND", + "BOB", + "BOV", + "BRL", + "BSD", + "BTN", + "BWP", + "BYN", + "BZD", + "CAD", + "CDF", + "CHE", + "CHF", + "CHW", + "CLF", + "CLP", + "CNY", + "COP", + "COU", + "CRC", + "CUC", + "CUP", + "CVE", + "CZK", + "DJF", + "DKK", + "DOP", + "DZD", + "EGP", + "ERN", + "ETB", + "EUR", + "FJD", + "FKP", + "GBP", + "GEL", + "GHS", + "GIP", + "GMD", + "GNF", + "GTQ", + "GYD", + "HKD", + "HNL", + "HTG", + "HUF", + "IDR", + "ILS", + "INR", + "IQD", + "IRR", + "ISK", + "JMD", + "JOD", + "JPY", + "KES", + "KGS", + "KHR", + "KMF", + "KPW", + "KRW", + "KWD", + "KYD", + "KZT", + "LAK", + "LBP", + "LKR", + "LRD", + "LSL", + "LYD", + "MAD", + "MDL", + "MGA", + "MKD", + "MMK", + "MNT", + "MOP", + "MRU", + "MUR", + "MVR", + "MWK", + "MXN", + "MXV", + "MYR", + "MZN", + "NAD", + "NGN", + "NIO", + "NOK", + "NPR", + "NZD", + "OMR", + "PAB", + "PEN", + "PGK", + "PHP", + "PKR", + "PLN", + "PYG", + "QAR", + "RON", + "RSD", + "RUB", + "RWF", + "SAR", + "SBD", + "SCR", + "SDG", + "SEK", + "SGD", + "SHP", + "SLE", + "SLL", + "SOS", + "SRD", + "SSP", + "STN", + "SVC", + "SYP", + "SZL", + "THB", + "TJS", + "TMT", + "TND", + "TOP", + "TRY", + "TTD", + "TWD", + "TZS", + "UAH", + "UGX", + "USD", + "USN", + "UYI", + "UYU", + "UYW", + "UZS", + "VED", + "VES", + "VND", + "VUV", + "WST", + "XAF", + "XCD", + "XDR", + "XOF", + "XPF", + "XSU", + "XUA", + "YER", + "ZAR", + "ZMW", + "ZWL" + ] + }, + "unit": { + "title": "Language-sensitive number formatting based on unit", + "description": "Enables unit along with thousand and decimal separators to be language sensitive based on selected app language. They are configured in number property. Note: parts that already exist in number property are not overridden by this prop.", + "enum": [ + "celsius", + "centimeter", + "day", + "degree", + "foot", + "gram", + "hectare", + "hour", + "inch", + "kilogram", + "kilometer", + "liter", + "meter", + "milliliter", + "millimeter", + "millisecond", + "minute", + "month", + "percent", + "second", + "week", + "year" + ] + }, + "position": { + "title": "Position of the currency/unit symbol", + "description": "Display the unit as prefix or suffix. Default is prefix. (Use only when using currency or unit options)", + "enum": ["prefix", "suffix"] + }, + "number": { + "anyOf": [ + { "$ref": "#/definitions/PatternFormatProps" }, + { "$ref": "#/definitions/NumberFormatProps" } + ] + }, + "align": { "default": "left", "enum": ["right", "center", "left"] } + }, + "additionalProperties": false + }, + "variant": { + "title": "Input variant", + "description": "The variant of the input field (text or search).", + "default": "text", + "enum": ["text", "search"], + "type": "string" + }, + "autocomplete": { + "title": "HTML autocomplete values", + "description": "Autocomplete hints to the browser. See https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/autocomplete", + "enum": [ + "on", + "off", + "name", + "honorific-prefix", + "given-name", + "additional-name", + "family-name", + "honorific-suffix", + "nickname", + "email", + "username", + "new-password", + "current-password", + "one-time-code", + "organization-title", + "organization", + "street-address", + "address-line1", + "address-line2", + "address-line3", + "address-level4", + "address-level3", + "address-level2", + "address-level1", + "country", + "country-name", + "postal-code", + "cc-name", + "cc-given-name", + "cc-additional-name", + "cc-family-name", + "cc-number", + "cc-exp", + "cc-exp-month", + "cc-exp-year", + "cc-csc", + "cc-type", + "transaction-currency", + "transaction-amount", + "language", + "bday", + "bday-day", + "bday-month", + "bday-year", + "sex", + "tel", + "tel-country-code", + "tel-national", + "tel-area-code", + "tel-local", + "tel-extension", + "impp", + "url", + "photo" + ], + "type": "string" + }, + "maxLength": { + "title": "Max length", + "description": "Max length of the input field. Will add a counter to let the user know how many characters are left.", + "type": "integer" + } + }, + "required": ["id", "type", "dataModelBindings"], + "title": "Input component schema" +} diff --git a/frontend/packages/ux-editor/src/testing/schemas/json/component/InstanceInformation.schema.v1.json b/frontend/packages/ux-editor/src/testing/schemas/json/component/InstanceInformation.schema.v1.json index dc84b59c767..0f00fac044e 100644 --- a/frontend/packages/ux-editor/src/testing/schemas/json/component/InstanceInformation.schema.v1.json +++ b/frontend/packages/ux-editor/src/testing/schemas/json/component/InstanceInformation.schema.v1.json @@ -1 +1,99 @@ -{"$id":"https://altinncdn.no/schemas/json/component/InstanceInformation.schema.v1.json","$schema":"http://json-schema.org/draft-07/schema#","properties":{"id":{"title":"ID","description":"The component ID. Must be unique within all layouts/pages in a layout-set. Cannot end with .","type":"string","pattern":"^[0-9a-zA-Z][0-9a-zA-Z-]*(-?[a-zA-Z]+|[a-zA-Z][0-9]+|-[0-9]{6,})$"},"hidden":{"title":"Hidden","description":"Boolean value or expression indicating if the component should be hidden. Defaults to false.","default":false,"$ref":"expression.schema.v1.json#/definitions/boolean"},"grid":{"properties":{"xs":{"$ref":"#/definitions/IGridSize"},"sm":{"$ref":"#/definitions/IGridSize"},"md":{"$ref":"#/definitions/IGridSize"},"lg":{"$ref":"#/definitions/IGridSize"},"xl":{"$ref":"#/definitions/IGridSize"},"labelGrid":{"$ref":"#/definitions/IGridStyling"},"innerGrid":{"$ref":"#/definitions/IGridStyling"}}},"pageBreak":{"title":"Page break","description":"Optionally insert page-break before/after component when rendered in PDF","type":"object","properties":{"breakBefore":{"title":"Page break before","description":"PDF only: Value or expression indicating whether a page break should be added before the component. Can be either: 'auto' (default), 'always', or 'avoid'.","examples":["auto","always","avoid"],"default":"auto","$ref":"expression.schema.v1.json#/definitions/string"},"breakAfter":{"title":"Page break after","description":"PDF only: Value or expression indicating whether a page break should be added after the component. Can be either: 'auto' (default), 'always', or 'avoid'.","examples":["auto","always","avoid"],"default":"auto","$ref":"expression.schema.v1.json#/definitions/string"}},"additionalProperties":false},"labelSettings":{"title":"ILabelSettings","type":"object","properties":{"optionalIndicator":{"title":"Optional indicator","description":"Show optional indicator on label","type":"boolean"}},"additionalProperties":false},"type":{"const":"InstanceInformation"},"elements":{"title":"Elements","description":"Which elements to show in the instance information","type":"object","properties":{"dateSent":{"type":"boolean"},"sender":{"type":"boolean"},"receiver":{"type":"boolean"},"referenceNumber":{"type":"boolean"}},"additionalProperties":false},"textResourceBindings":{"title":"TRBLabel","type":"object","properties":{"title":{"title":"Title","description":"Label text/title shown above the component","$ref":"expression.schema.v1.json#/definitions/string"},"description":{"title":"Description","description":"Label description shown above the component, below the title","$ref":"expression.schema.v1.json#/definitions/string"},"help":{"title":"Help text","description":"Help text shown in a tooltip when clicking the help button","$ref":"expression.schema.v1.json#/definitions/string"}}}},"required":["id","type"],"title":"InstanceInformation component schema"} \ No newline at end of file +{ + "$id": "https://altinncdn.no/schemas/json/component/InstanceInformation.schema.v1.json", + "$schema": "http://json-schema.org/draft-07/schema#", + "properties": { + "id": { + "title": "ID", + "description": "The component ID. Must be unique within all layouts/pages in a layout-set. Cannot end with .", + "type": "string", + "pattern": "^[0-9a-zA-Z][0-9a-zA-Z-]*(-?[a-zA-Z]+|[a-zA-Z][0-9]+|-[0-9]{6,})$" + }, + "hidden": { + "title": "Hidden", + "description": "Boolean value or expression indicating if the component should be hidden. Defaults to false.", + "default": false, + "$ref": "expression.schema.v1.json#/definitions/boolean" + }, + "grid": { + "properties": { + "xs": { "$ref": "#/definitions/IGridSize" }, + "sm": { "$ref": "#/definitions/IGridSize" }, + "md": { "$ref": "#/definitions/IGridSize" }, + "lg": { "$ref": "#/definitions/IGridSize" }, + "xl": { "$ref": "#/definitions/IGridSize" }, + "labelGrid": { "$ref": "#/definitions/IGridStyling" }, + "innerGrid": { "$ref": "#/definitions/IGridStyling" } + } + }, + "pageBreak": { + "title": "Page break", + "description": "Optionally insert page-break before/after component when rendered in PDF", + "type": "object", + "properties": { + "breakBefore": { + "title": "Page break before", + "description": "PDF only: Value or expression indicating whether a page break should be added before the component. Can be either: 'auto' (default), 'always', or 'avoid'.", + "examples": ["auto", "always", "avoid"], + "default": "auto", + "$ref": "expression.schema.v1.json#/definitions/string" + }, + "breakAfter": { + "title": "Page break after", + "description": "PDF only: Value or expression indicating whether a page break should be added after the component. Can be either: 'auto' (default), 'always', or 'avoid'.", + "examples": ["auto", "always", "avoid"], + "default": "auto", + "$ref": "expression.schema.v1.json#/definitions/string" + } + }, + "additionalProperties": false + }, + "labelSettings": { + "title": "ILabelSettings", + "type": "object", + "properties": { + "optionalIndicator": { + "title": "Optional indicator", + "description": "Show optional indicator on label", + "type": "boolean" + } + }, + "additionalProperties": false + }, + "type": { "const": "InstanceInformation" }, + "elements": { + "title": "Elements", + "description": "Which elements to show in the instance information", + "type": "object", + "properties": { + "dateSent": { "type": "boolean" }, + "sender": { "type": "boolean" }, + "receiver": { "type": "boolean" }, + "referenceNumber": { "type": "boolean" } + }, + "additionalProperties": false + }, + "textResourceBindings": { + "title": "TRBLabel", + "type": "object", + "properties": { + "title": { + "title": "Title", + "description": "Label text/title shown above the component", + "$ref": "expression.schema.v1.json#/definitions/string" + }, + "description": { + "title": "Description", + "description": "Label description shown above the component, below the title", + "$ref": "expression.schema.v1.json#/definitions/string" + }, + "help": { + "title": "Help text", + "description": "Help text shown in a tooltip when clicking the help button", + "$ref": "expression.schema.v1.json#/definitions/string" + } + } + } + }, + "required": ["id", "type"], + "title": "InstanceInformation component schema" +} diff --git a/frontend/packages/ux-editor/src/testing/schemas/json/component/InstantiationButton.schema.v1.json b/frontend/packages/ux-editor/src/testing/schemas/json/component/InstantiationButton.schema.v1.json index 5a8865d0f49..bab7537533d 100644 --- a/frontend/packages/ux-editor/src/testing/schemas/json/component/InstantiationButton.schema.v1.json +++ b/frontend/packages/ux-editor/src/testing/schemas/json/component/InstantiationButton.schema.v1.json @@ -1 +1,72 @@ -{"$id":"https://altinncdn.no/schemas/json/component/InstantiationButton.schema.v1.json","$schema":"http://json-schema.org/draft-07/schema#","properties":{"id":{"title":"ID","description":"The component ID. Must be unique within all layouts/pages in a layout-set. Cannot end with .","type":"string","pattern":"^[0-9a-zA-Z][0-9a-zA-Z-]*(-?[a-zA-Z]+|[a-zA-Z][0-9]+|-[0-9]{6,})$"},"hidden":{"title":"Hidden","description":"Boolean value or expression indicating if the component should be hidden. Defaults to false.","default":false,"$ref":"expression.schema.v1.json#/definitions/boolean"},"grid":{"properties":{"xs":{"$ref":"#/definitions/IGridSize"},"sm":{"$ref":"#/definitions/IGridSize"},"md":{"$ref":"#/definitions/IGridSize"},"lg":{"$ref":"#/definitions/IGridSize"},"xl":{"$ref":"#/definitions/IGridSize"},"labelGrid":{"$ref":"#/definitions/IGridStyling"},"innerGrid":{"$ref":"#/definitions/IGridStyling"}}},"pageBreak":{"title":"Page break","description":"Optionally insert page-break before/after component when rendered in PDF","type":"object","properties":{"breakBefore":{"title":"Page break before","description":"PDF only: Value or expression indicating whether a page break should be added before the component. Can be either: 'auto' (default), 'always', or 'avoid'.","examples":["auto","always","avoid"],"default":"auto","$ref":"expression.schema.v1.json#/definitions/string"},"breakAfter":{"title":"Page break after","description":"PDF only: Value or expression indicating whether a page break should be added after the component. Can be either: 'auto' (default), 'always', or 'avoid'.","examples":["auto","always","avoid"],"default":"auto","$ref":"expression.schema.v1.json#/definitions/string"}},"additionalProperties":false},"type":{"const":"InstantiationButton"},"textResourceBindings":{"type":"object","properties":{"title":{"title":"Title","description":"The title/text to display on the button","$ref":"expression.schema.v1.json#/definitions/string"}},"additionalProperties":false},"mapping":{"title":"Mapping","description":"A mapping of key-value pairs (usually used for mapping a path in the data model to a query string parameter).","type":"object","properties":{},"additionalProperties":{"type":"string"}}},"required":["id","type"],"title":"InstantiationButton component schema"} \ No newline at end of file +{ + "$id": "https://altinncdn.no/schemas/json/component/InstantiationButton.schema.v1.json", + "$schema": "http://json-schema.org/draft-07/schema#", + "properties": { + "id": { + "title": "ID", + "description": "The component ID. Must be unique within all layouts/pages in a layout-set. Cannot end with .", + "type": "string", + "pattern": "^[0-9a-zA-Z][0-9a-zA-Z-]*(-?[a-zA-Z]+|[a-zA-Z][0-9]+|-[0-9]{6,})$" + }, + "hidden": { + "title": "Hidden", + "description": "Boolean value or expression indicating if the component should be hidden. Defaults to false.", + "default": false, + "$ref": "expression.schema.v1.json#/definitions/boolean" + }, + "grid": { + "properties": { + "xs": { "$ref": "#/definitions/IGridSize" }, + "sm": { "$ref": "#/definitions/IGridSize" }, + "md": { "$ref": "#/definitions/IGridSize" }, + "lg": { "$ref": "#/definitions/IGridSize" }, + "xl": { "$ref": "#/definitions/IGridSize" }, + "labelGrid": { "$ref": "#/definitions/IGridStyling" }, + "innerGrid": { "$ref": "#/definitions/IGridStyling" } + } + }, + "pageBreak": { + "title": "Page break", + "description": "Optionally insert page-break before/after component when rendered in PDF", + "type": "object", + "properties": { + "breakBefore": { + "title": "Page break before", + "description": "PDF only: Value or expression indicating whether a page break should be added before the component. Can be either: 'auto' (default), 'always', or 'avoid'.", + "examples": ["auto", "always", "avoid"], + "default": "auto", + "$ref": "expression.schema.v1.json#/definitions/string" + }, + "breakAfter": { + "title": "Page break after", + "description": "PDF only: Value or expression indicating whether a page break should be added after the component. Can be either: 'auto' (default), 'always', or 'avoid'.", + "examples": ["auto", "always", "avoid"], + "default": "auto", + "$ref": "expression.schema.v1.json#/definitions/string" + } + }, + "additionalProperties": false + }, + "type": { "const": "InstantiationButton" }, + "textResourceBindings": { + "type": "object", + "properties": { + "title": { + "title": "Title", + "description": "The title/text to display on the button", + "$ref": "expression.schema.v1.json#/definitions/string" + } + }, + "additionalProperties": false + }, + "mapping": { + "title": "Mapping", + "description": "A mapping of key-value pairs (usually used for mapping a path in the data model to a query string parameter).", + "type": "object", + "properties": {}, + "additionalProperties": { "type": "string" } + } + }, + "required": ["id", "type"], + "title": "InstantiationButton component schema" +} diff --git a/frontend/packages/ux-editor/src/testing/schemas/json/component/Likert.schema.v1.json b/frontend/packages/ux-editor/src/testing/schemas/json/component/Likert.schema.v1.json index 7ca2886387a..5eaac98fd2c 100644 --- a/frontend/packages/ux-editor/src/testing/schemas/json/component/Likert.schema.v1.json +++ b/frontend/packages/ux-editor/src/testing/schemas/json/component/Likert.schema.v1.json @@ -1 +1,281 @@ -{"$id":"https://altinncdn.no/schemas/json/component/Likert.schema.v1.json","$schema":"http://json-schema.org/draft-07/schema#","properties":{"id":{"title":"ID","description":"The component ID. Must be unique within all layouts/pages in a layout-set. Cannot end with .","type":"string","pattern":"^[0-9a-zA-Z][0-9a-zA-Z-]*(-?[a-zA-Z]+|[a-zA-Z][0-9]+|-[0-9]{6,})$"},"hidden":{"title":"Hidden","description":"Boolean value or expression indicating if the component should be hidden. Defaults to false.","default":false,"$ref":"expression.schema.v1.json#/definitions/boolean"},"grid":{"properties":{"xs":{"$ref":"#/definitions/IGridSize"},"sm":{"$ref":"#/definitions/IGridSize"},"md":{"$ref":"#/definitions/IGridSize"},"lg":{"$ref":"#/definitions/IGridSize"},"xl":{"$ref":"#/definitions/IGridSize"},"labelGrid":{"$ref":"#/definitions/IGridStyling"},"innerGrid":{"$ref":"#/definitions/IGridStyling"}}},"pageBreak":{"title":"Page break","description":"Optionally insert page-break before/after component when rendered in PDF","type":"object","properties":{"breakBefore":{"title":"Page break before","description":"PDF only: Value or expression indicating whether a page break should be added before the component. Can be either: 'auto' (default), 'always', or 'avoid'.","examples":["auto","always","avoid"],"default":"auto","$ref":"expression.schema.v1.json#/definitions/string"},"breakAfter":{"title":"Page break after","description":"PDF only: Value or expression indicating whether a page break should be added after the component. Can be either: 'auto' (default), 'always', or 'avoid'.","examples":["auto","always","avoid"],"default":"auto","$ref":"expression.schema.v1.json#/definitions/string"}},"additionalProperties":false},"readOnly":{"title":"Read only/disabled?","description":"Boolean value or expression indicating if the component should be read only/disabled. Defaults to false.
Please note that even with read-only fields in components, it may currently be possible to update the field by modifying the request sent to the API or through a direct API call.","default":false,"$ref":"expression.schema.v1.json#/definitions/boolean"},"required":{"title":"Required?","description":"Boolean value or expression indicating if the component should be required. Defaults to false.","default":false,"$ref":"expression.schema.v1.json#/definitions/boolean"},"showValidations":{"title":"Validation types","description":"List of validation types to show","type":"array","items":{"enum":["Schema","Component","Expression","CustomBackend","Required","AllExceptRequired","All"],"type":"string"}},"renderAsSummary":{"title":"Render as summary","description":"Boolean value indicating if the component should be rendered as a summary. Defaults to false.","default":false,"type":"boolean"},"forceShowInSummary":{"title":"Force show in summary","description":"Will force show the component in a summary even if hideEmptyFields is set to true in the summary component.","default":false,"$ref":"expression.schema.v1.json#/definitions/boolean"},"optionsId":{"title":"Dynamic options (fetched from server)","description":"ID of the option list to fetch from the server","type":"string"},"mapping":{"title":"Mapping","description":"A mapping of key-value pairs (usually used for mapping a path in the data model to a query string parameter).","type":"object","properties":{},"additionalProperties":{"type":"string"}},"queryParameters":{"title":"Query parameters","description":"A mapping of query string parameters to values. Will be appended to the URL when fetching options.","type":"object","properties":{},"additionalProperties":{"type":"string"}},"options":{"title":"Static options","description":"List of static options","type":"array","items":{"title":"IRawOption","examples":[{"label":"","value":""}],"type":"object","properties":{"label":{"type":"string"},"value":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"const":null}]},"description":{"type":"string"},"helpText":{"type":"string"}},"required":["label","value"],"additionalProperties":false}},"secure":{"title":"Secure options (when using optionsId)","description":"Whether to call the secure API endpoint when fetching options from the server (allows for user/instance-specific options)","default":false,"type":"boolean"},"sortOrder":{"description":"Sorts the code list in either ascending or descending order by label.","enum":["asc","desc"],"type":"string"},"source":{"title":"Option source","description":"Allows for fetching options from the data model, pointing to a repeating group structure","type":"object","properties":{"group":{"title":"Group","description":"The repeating group to base options on.","examples":["model.some.group"],"type":"string"},"label":{"title":"Label","description":"A label of the option displayed in Radio- and Checkbox groups. Can be plain text, a text resource binding, or a dynamic expression.","examples":["some.text.key"],"$ref":"expression.schema.v1.json#/definitions/string"},"value":{"title":"Value","description":"Field in the group that should be used as value","examples":["model.some.group[{0}].someField"],"type":"string"},"description":{"title":"Description","description":"A description of the option displayed in Radio- and Checkbox groups. Can be plain text, a text resource binding, or a dynamic expression.","examples":["some.text.key","My Description"],"$ref":"expression.schema.v1.json#/definitions/string"},"helpText":{"title":"Help Text","description":"A help text for the option displayed in Radio- and Checkbox groups. Can be plain text, a text resource binding, or a dynamic expression.","examples":["some.text.key","My Help Text"],"$ref":"expression.schema.v1.json#/definitions/string"}},"required":["group","label","value"],"additionalProperties":false},"type":{"const":"Likert"},"textResourceBindings":{"properties":{"title":{"title":"Title","description":"The title of the group","$ref":"expression.schema.v1.json#/definitions/string"},"description":{"title":"Description","description":"The description text for the Likert table.","$ref":"expression.schema.v1.json#/definitions/string"},"tableTitle":{"title":"Table title","description":"Title used in the table view (overrides the default title)","$ref":"expression.schema.v1.json#/definitions/string"},"shortName":{"title":"Short name (for validation)","description":"Alternative name used for required validation messages (overrides the default title)","$ref":"expression.schema.v1.json#/definitions/string"},"requiredValidation":{"title":"Required validation message","description":"Full validation message shown when the component is required and no value has been entered (overrides both the default and shortName)","$ref":"expression.schema.v1.json#/definitions/string"},"summaryTitle":{"title":"Summary title","description":"Title used in the summary view (overrides the default title)","$ref":"expression.schema.v1.json#/definitions/string"},"summaryAccessibleTitle":{"title":"Accessible summary title","description":"Title used for aria-label on the edit button in the summary view (overrides the default and summary title)","$ref":"expression.schema.v1.json#/definitions/string"},"leftColumnHeader":{"title":"Left column header","description":"The header text for the left column in the Likert table","$ref":"expression.schema.v1.json#/definitions/string"},"questions":{"title":"Questions","description":"The questions to be displayed in each row (use a dynamic text resource)","$ref":"expression.schema.v1.json#/definitions/string"},"questionDescriptions":{"title":"Question descriptions","description":"The descriptions to be displayed in each row (use a dynamic text resource)","$ref":"expression.schema.v1.json#/definitions/string"},"questionHelpTexts":{"title":"Question help texts","description":"The help texts to be displayed in each row (use a dynamic text resource)","$ref":"expression.schema.v1.json#/definitions/string"}}},"dataModelBindings":{"title":"Data model binding","description":"Describes the location in the data model where the component should store its value(s). A list binding should be pointed to an array structure in the data model, and is used for components that store multiple simple values (e.g. a list of strings).","type":"object","properties":{"answer":{"title":"Answer","description":"Dot notation location for the answers. This must point to a property of the objects inside the question array. The answer for each question will be stored in the answer property of the corresponding question object.","type":"string"},"questions":{"title":"Questions","description":"Dot notation location for a likert structure (array of objects), where the data is stored","type":"string"}},"required":["answer","questions"],"additionalProperties":false},"filter":{"title":"Filter","description":"Optionally filter specific rows within the likert group using start/stop indexes for displaying the desired ones(beware that start index starts at zero, and stop index starts at one, so {start, stop} = {0, 3} will display 3 rows, not 4)","type":"array","items":{"type":"object","properties":{"key":{"enum":["start","stop"]},"value":{"anyOf":[{"type":"string","pattern":"^\\d+$"},{"type":"number"}]}},"required":["key","value"],"additionalProperties":false}}},"required":["id","type","dataModelBindings"],"title":"Likert component schema"} \ No newline at end of file +{ + "$id": "https://altinncdn.no/schemas/json/component/Likert.schema.v1.json", + "$schema": "http://json-schema.org/draft-07/schema#", + "properties": { + "id": { + "title": "ID", + "description": "The component ID. Must be unique within all layouts/pages in a layout-set. Cannot end with .", + "type": "string", + "pattern": "^[0-9a-zA-Z][0-9a-zA-Z-]*(-?[a-zA-Z]+|[a-zA-Z][0-9]+|-[0-9]{6,})$" + }, + "hidden": { + "title": "Hidden", + "description": "Boolean value or expression indicating if the component should be hidden. Defaults to false.", + "default": false, + "$ref": "expression.schema.v1.json#/definitions/boolean" + }, + "grid": { + "properties": { + "xs": { "$ref": "#/definitions/IGridSize" }, + "sm": { "$ref": "#/definitions/IGridSize" }, + "md": { "$ref": "#/definitions/IGridSize" }, + "lg": { "$ref": "#/definitions/IGridSize" }, + "xl": { "$ref": "#/definitions/IGridSize" }, + "labelGrid": { "$ref": "#/definitions/IGridStyling" }, + "innerGrid": { "$ref": "#/definitions/IGridStyling" } + } + }, + "pageBreak": { + "title": "Page break", + "description": "Optionally insert page-break before/after component when rendered in PDF", + "type": "object", + "properties": { + "breakBefore": { + "title": "Page break before", + "description": "PDF only: Value or expression indicating whether a page break should be added before the component. Can be either: 'auto' (default), 'always', or 'avoid'.", + "examples": ["auto", "always", "avoid"], + "default": "auto", + "$ref": "expression.schema.v1.json#/definitions/string" + }, + "breakAfter": { + "title": "Page break after", + "description": "PDF only: Value or expression indicating whether a page break should be added after the component. Can be either: 'auto' (default), 'always', or 'avoid'.", + "examples": ["auto", "always", "avoid"], + "default": "auto", + "$ref": "expression.schema.v1.json#/definitions/string" + } + }, + "additionalProperties": false + }, + "readOnly": { + "title": "Read only/disabled?", + "description": "Boolean value or expression indicating if the component should be read only/disabled. Defaults to false.
Please note that even with read-only fields in components, it may currently be possible to update the field by modifying the request sent to the API or through a direct API call.", + "default": false, + "$ref": "expression.schema.v1.json#/definitions/boolean" + }, + "required": { + "title": "Required?", + "description": "Boolean value or expression indicating if the component should be required. Defaults to false.", + "default": false, + "$ref": "expression.schema.v1.json#/definitions/boolean" + }, + "showValidations": { + "title": "Validation types", + "description": "List of validation types to show", + "type": "array", + "items": { + "enum": [ + "Schema", + "Component", + "Expression", + "CustomBackend", + "Required", + "AllExceptRequired", + "All" + ], + "type": "string" + } + }, + "renderAsSummary": { + "title": "Render as summary", + "description": "Boolean value indicating if the component should be rendered as a summary. Defaults to false.", + "default": false, + "type": "boolean" + }, + "forceShowInSummary": { + "title": "Force show in summary", + "description": "Will force show the component in a summary even if hideEmptyFields is set to true in the summary component.", + "default": false, + "$ref": "expression.schema.v1.json#/definitions/boolean" + }, + "optionsId": { + "title": "Dynamic options (fetched from server)", + "description": "ID of the option list to fetch from the server", + "type": "string" + }, + "mapping": { + "title": "Mapping", + "description": "A mapping of key-value pairs (usually used for mapping a path in the data model to a query string parameter).", + "type": "object", + "properties": {}, + "additionalProperties": { "type": "string" } + }, + "queryParameters": { + "title": "Query parameters", + "description": "A mapping of query string parameters to values. Will be appended to the URL when fetching options.", + "type": "object", + "properties": {}, + "additionalProperties": { "type": "string" } + }, + "options": { + "title": "Static options", + "description": "List of static options", + "type": "array", + "items": { + "title": "IRawOption", + "examples": [{ "label": "", "value": "" }], + "type": "object", + "properties": { + "label": { "type": "string" }, + "value": { + "anyOf": [ + { "type": "string" }, + { "type": "number" }, + { "type": "boolean" }, + { "const": null } + ] + }, + "description": { "type": "string" }, + "helpText": { "type": "string" } + }, + "required": ["label", "value"], + "additionalProperties": false + } + }, + "secure": { + "title": "Secure options (when using optionsId)", + "description": "Whether to call the secure API endpoint when fetching options from the server (allows for user/instance-specific options)", + "default": false, + "type": "boolean" + }, + "sortOrder": { + "description": "Sorts the code list in either ascending or descending order by label.", + "enum": ["asc", "desc"], + "type": "string" + }, + "source": { + "title": "Option source", + "description": "Allows for fetching options from the data model, pointing to a repeating group structure", + "type": "object", + "properties": { + "group": { + "title": "Group", + "description": "The repeating group to base options on.", + "examples": ["model.some.group"], + "type": "string" + }, + "label": { + "title": "Label", + "description": "A label of the option displayed in Radio- and Checkbox groups. Can be plain text, a text resource binding, or a dynamic expression.", + "examples": ["some.text.key"], + "$ref": "expression.schema.v1.json#/definitions/string" + }, + "value": { + "title": "Value", + "description": "Field in the group that should be used as value", + "examples": ["model.some.group[{0}].someField"], + "type": "string" + }, + "description": { + "title": "Description", + "description": "A description of the option displayed in Radio- and Checkbox groups. Can be plain text, a text resource binding, or a dynamic expression.", + "examples": ["some.text.key", "My Description"], + "$ref": "expression.schema.v1.json#/definitions/string" + }, + "helpText": { + "title": "Help Text", + "description": "A help text for the option displayed in Radio- and Checkbox groups. Can be plain text, a text resource binding, or a dynamic expression.", + "examples": ["some.text.key", "My Help Text"], + "$ref": "expression.schema.v1.json#/definitions/string" + } + }, + "required": ["group", "label", "value"], + "additionalProperties": false + }, + "type": { "const": "Likert" }, + "textResourceBindings": { + "properties": { + "title": { + "title": "Title", + "description": "The title of the group", + "$ref": "expression.schema.v1.json#/definitions/string" + }, + "description": { + "title": "Description", + "description": "The description text for the Likert table.", + "$ref": "expression.schema.v1.json#/definitions/string" + }, + "tableTitle": { + "title": "Table title", + "description": "Title used in the table view (overrides the default title)", + "$ref": "expression.schema.v1.json#/definitions/string" + }, + "shortName": { + "title": "Short name (for validation)", + "description": "Alternative name used for required validation messages (overrides the default title)", + "$ref": "expression.schema.v1.json#/definitions/string" + }, + "requiredValidation": { + "title": "Required validation message", + "description": "Full validation message shown when the component is required and no value has been entered (overrides both the default and shortName)", + "$ref": "expression.schema.v1.json#/definitions/string" + }, + "summaryTitle": { + "title": "Summary title", + "description": "Title used in the summary view (overrides the default title)", + "$ref": "expression.schema.v1.json#/definitions/string" + }, + "summaryAccessibleTitle": { + "title": "Accessible summary title", + "description": "Title used for aria-label on the edit button in the summary view (overrides the default and summary title)", + "$ref": "expression.schema.v1.json#/definitions/string" + }, + "leftColumnHeader": { + "title": "Left column header", + "description": "The header text for the left column in the Likert table", + "$ref": "expression.schema.v1.json#/definitions/string" + }, + "questions": { + "title": "Questions", + "description": "The questions to be displayed in each row (use a dynamic text resource)", + "$ref": "expression.schema.v1.json#/definitions/string" + }, + "questionDescriptions": { + "title": "Question descriptions", + "description": "The descriptions to be displayed in each row (use a dynamic text resource)", + "$ref": "expression.schema.v1.json#/definitions/string" + }, + "questionHelpTexts": { + "title": "Question help texts", + "description": "The help texts to be displayed in each row (use a dynamic text resource)", + "$ref": "expression.schema.v1.json#/definitions/string" + } + } + }, + "dataModelBindings": { + "title": "Data model binding", + "description": "Describes the location in the data model where the component should store its value(s). A list binding should be pointed to an array structure in the data model, and is used for components that store multiple simple values (e.g. a list of strings).", + "type": "object", + "properties": { + "answer": { + "title": "Answer", + "description": "Dot notation location for the answers. This must point to a property of the objects inside the question array. The answer for each question will be stored in the answer property of the corresponding question object.", + "type": "string" + }, + "questions": { + "title": "Questions", + "description": "Dot notation location for a likert structure (array of objects), where the data is stored", + "type": "string" + } + }, + "required": ["answer", "questions"], + "additionalProperties": false + }, + "filter": { + "title": "Filter", + "description": "Optionally filter specific rows within the likert group using start/stop indexes for displaying the desired ones(beware that start index starts at zero, and stop index starts at one, so {start, stop} = {0, 3} will display 3 rows, not 4)", + "type": "array", + "items": { + "type": "object", + "properties": { + "key": { "enum": ["start", "stop"] }, + "value": { "anyOf": [{ "type": "string", "pattern": "^\\d+$" }, { "type": "number" }] } + }, + "required": ["key", "value"], + "additionalProperties": false + } + } + }, + "required": ["id", "type", "dataModelBindings"], + "title": "Likert component schema" +} diff --git a/frontend/packages/ux-editor/src/testing/schemas/json/component/LikertItem.schema.v1.json b/frontend/packages/ux-editor/src/testing/schemas/json/component/LikertItem.schema.v1.json index 2c4e7299962..dddb7c22ae5 100644 --- a/frontend/packages/ux-editor/src/testing/schemas/json/component/LikertItem.schema.v1.json +++ b/frontend/packages/ux-editor/src/testing/schemas/json/component/LikertItem.schema.v1.json @@ -1 +1,265 @@ -{"$id":"https://altinncdn.no/schemas/json/component/LikertItem.schema.v1.json","$schema":"http://json-schema.org/draft-07/schema#","properties":{"id":{"title":"ID","description":"The component ID. Must be unique within all layouts/pages in a layout-set. Cannot end with .","type":"string","pattern":"^[0-9a-zA-Z][0-9a-zA-Z-]*(-?[a-zA-Z]+|[a-zA-Z][0-9]+|-[0-9]{6,})$"},"hidden":{"title":"Hidden","description":"Boolean value or expression indicating if the component should be hidden. Defaults to false.","default":false,"$ref":"expression.schema.v1.json#/definitions/boolean"},"grid":{"properties":{"xs":{"$ref":"#/definitions/IGridSize"},"sm":{"$ref":"#/definitions/IGridSize"},"md":{"$ref":"#/definitions/IGridSize"},"lg":{"$ref":"#/definitions/IGridSize"},"xl":{"$ref":"#/definitions/IGridSize"},"labelGrid":{"$ref":"#/definitions/IGridStyling"},"innerGrid":{"$ref":"#/definitions/IGridStyling"}}},"pageBreak":{"title":"Page break","description":"Optionally insert page-break before/after component when rendered in PDF","type":"object","properties":{"breakBefore":{"title":"Page break before","description":"PDF only: Value or expression indicating whether a page break should be added before the component. Can be either: 'auto' (default), 'always', or 'avoid'.","examples":["auto","always","avoid"],"default":"auto","$ref":"expression.schema.v1.json#/definitions/string"},"breakAfter":{"title":"Page break after","description":"PDF only: Value or expression indicating whether a page break should be added after the component. Can be either: 'auto' (default), 'always', or 'avoid'.","examples":["auto","always","avoid"],"default":"auto","$ref":"expression.schema.v1.json#/definitions/string"}},"additionalProperties":false},"readOnly":{"title":"Read only/disabled?","description":"Boolean value or expression indicating if the component should be read only/disabled. Defaults to false.
Please note that even with read-only fields in components, it may currently be possible to update the field by modifying the request sent to the API or through a direct API call.","default":false,"$ref":"expression.schema.v1.json#/definitions/boolean"},"required":{"title":"Required?","description":"Boolean value or expression indicating if the component should be required. Defaults to false.","default":false,"$ref":"expression.schema.v1.json#/definitions/boolean"},"showValidations":{"title":"Validation types","description":"List of validation types to show","type":"array","items":{"enum":["Schema","Component","Expression","CustomBackend","Required","AllExceptRequired","All"],"type":"string"}},"renderAsSummary":{"title":"Render as summary","description":"Boolean value indicating if the component should be rendered as a summary. Defaults to false.","default":false,"type":"boolean"},"forceShowInSummary":{"title":"Force show in summary","description":"Will force show the component in a summary even if hideEmptyFields is set to true in the summary component.","default":false,"$ref":"expression.schema.v1.json#/definitions/boolean"},"optionsId":{"title":"Dynamic options (fetched from server)","description":"ID of the option list to fetch from the server","type":"string"},"mapping":{"title":"Mapping","description":"A mapping of key-value pairs (usually used for mapping a path in the data model to a query string parameter).","type":"object","properties":{},"additionalProperties":{"type":"string"}},"queryParameters":{"title":"Query parameters","description":"A mapping of query string parameters to values. Will be appended to the URL when fetching options.","type":"object","properties":{},"additionalProperties":{"type":"string"}},"options":{"title":"Static options","description":"List of static options","type":"array","items":{"title":"IRawOption","examples":[{"label":"","value":""}],"type":"object","properties":{"label":{"type":"string"},"value":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"const":null}]},"description":{"type":"string"},"helpText":{"type":"string"}},"required":["label","value"],"additionalProperties":false}},"secure":{"title":"Secure options (when using optionsId)","description":"Whether to call the secure API endpoint when fetching options from the server (allows for user/instance-specific options)","default":false,"type":"boolean"},"sortOrder":{"description":"Sorts the code list in either ascending or descending order by label.","enum":["asc","desc"],"type":"string"},"source":{"title":"Option source","description":"Allows for fetching options from the data model, pointing to a repeating group structure","type":"object","properties":{"group":{"title":"Group","description":"The repeating group to base options on.","examples":["model.some.group"],"type":"string"},"label":{"title":"Label","description":"A label of the option displayed in Radio- and Checkbox groups. Can be plain text, a text resource binding, or a dynamic expression.","examples":["some.text.key"],"$ref":"expression.schema.v1.json#/definitions/string"},"value":{"title":"Value","description":"Field in the group that should be used as value","examples":["model.some.group[{0}].someField"],"type":"string"},"description":{"title":"Description","description":"A description of the option displayed in Radio- and Checkbox groups. Can be plain text, a text resource binding, or a dynamic expression.","examples":["some.text.key","My Description"],"$ref":"expression.schema.v1.json#/definitions/string"},"helpText":{"title":"Help Text","description":"A help text for the option displayed in Radio- and Checkbox groups. Can be plain text, a text resource binding, or a dynamic expression.","examples":["some.text.key","My Help Text"],"$ref":"expression.schema.v1.json#/definitions/string"}},"required":["group","label","value"],"additionalProperties":false},"preselectedOptionIndex":{"title":"Preselected option index","description":"Index of the option to preselect (if no option has been selected yet)","type":"integer"},"type":{"const":"LikertItem"},"textResourceBindings":{"properties":{"title":{"title":"Title","description":"Title of the Likert component/row","$ref":"expression.schema.v1.json#/definitions/string"},"description":{"title":"Description","description":"Description of the Likert component/row","$ref":"expression.schema.v1.json#/definitions/string"},"help":{"title":"Help","description":"Help text of the Likert component/row","$ref":"expression.schema.v1.json#/definitions/string"},"tableTitle":{"title":"Table title","description":"Title used in the table view (overrides the default title)","$ref":"expression.schema.v1.json#/definitions/string"},"shortName":{"title":"Short name (for validation)","description":"Alternative name used for required validation messages (overrides the default title)","$ref":"expression.schema.v1.json#/definitions/string"},"requiredValidation":{"title":"Required validation message","description":"Full validation message shown when the component is required and no value has been entered (overrides both the default and shortName)","$ref":"expression.schema.v1.json#/definitions/string"},"summaryTitle":{"title":"Summary title","description":"Title used in the summary view (overrides the default title)","$ref":"expression.schema.v1.json#/definitions/string"},"summaryAccessibleTitle":{"title":"Accessible summary title","description":"Title used for aria-label on the edit button in the summary view (overrides the default and summary title)","$ref":"expression.schema.v1.json#/definitions/string"}}},"dataModelBindings":{"title":"Data model binding","description":"Describes the location in the data model where the component should store its value(s). A simple binding is used for components that only store a single value, usually a string.","type":"object","properties":{"simpleBinding":{"type":"string"},"label":{"type":"string"},"metadata":{"description":"Describes the location where metadata for the option based component should be stored in the datamodel.","type":"string"}},"required":["simpleBinding"],"additionalProperties":false},"showLabelsInTable":{"title":"Show label when single option in table","description":"Boolean value indicating if the label should be visible when only one option exists in table","default":false,"type":"boolean"},"layout":{"title":"Layout","description":"Define the layout style for the options","enum":["column","row","table"],"type":"string"}},"required":["id","type","dataModelBindings"],"title":"LikertItem component schema"} \ No newline at end of file +{ + "$id": "https://altinncdn.no/schemas/json/component/LikertItem.schema.v1.json", + "$schema": "http://json-schema.org/draft-07/schema#", + "properties": { + "id": { + "title": "ID", + "description": "The component ID. Must be unique within all layouts/pages in a layout-set. Cannot end with .", + "type": "string", + "pattern": "^[0-9a-zA-Z][0-9a-zA-Z-]*(-?[a-zA-Z]+|[a-zA-Z][0-9]+|-[0-9]{6,})$" + }, + "hidden": { + "title": "Hidden", + "description": "Boolean value or expression indicating if the component should be hidden. Defaults to false.", + "default": false, + "$ref": "expression.schema.v1.json#/definitions/boolean" + }, + "grid": { + "properties": { + "xs": { "$ref": "#/definitions/IGridSize" }, + "sm": { "$ref": "#/definitions/IGridSize" }, + "md": { "$ref": "#/definitions/IGridSize" }, + "lg": { "$ref": "#/definitions/IGridSize" }, + "xl": { "$ref": "#/definitions/IGridSize" }, + "labelGrid": { "$ref": "#/definitions/IGridStyling" }, + "innerGrid": { "$ref": "#/definitions/IGridStyling" } + } + }, + "pageBreak": { + "title": "Page break", + "description": "Optionally insert page-break before/after component when rendered in PDF", + "type": "object", + "properties": { + "breakBefore": { + "title": "Page break before", + "description": "PDF only: Value or expression indicating whether a page break should be added before the component. Can be either: 'auto' (default), 'always', or 'avoid'.", + "examples": ["auto", "always", "avoid"], + "default": "auto", + "$ref": "expression.schema.v1.json#/definitions/string" + }, + "breakAfter": { + "title": "Page break after", + "description": "PDF only: Value or expression indicating whether a page break should be added after the component. Can be either: 'auto' (default), 'always', or 'avoid'.", + "examples": ["auto", "always", "avoid"], + "default": "auto", + "$ref": "expression.schema.v1.json#/definitions/string" + } + }, + "additionalProperties": false + }, + "readOnly": { + "title": "Read only/disabled?", + "description": "Boolean value or expression indicating if the component should be read only/disabled. Defaults to false.
Please note that even with read-only fields in components, it may currently be possible to update the field by modifying the request sent to the API or through a direct API call.", + "default": false, + "$ref": "expression.schema.v1.json#/definitions/boolean" + }, + "required": { + "title": "Required?", + "description": "Boolean value or expression indicating if the component should be required. Defaults to false.", + "default": false, + "$ref": "expression.schema.v1.json#/definitions/boolean" + }, + "showValidations": { + "title": "Validation types", + "description": "List of validation types to show", + "type": "array", + "items": { + "enum": [ + "Schema", + "Component", + "Expression", + "CustomBackend", + "Required", + "AllExceptRequired", + "All" + ], + "type": "string" + } + }, + "renderAsSummary": { + "title": "Render as summary", + "description": "Boolean value indicating if the component should be rendered as a summary. Defaults to false.", + "default": false, + "type": "boolean" + }, + "forceShowInSummary": { + "title": "Force show in summary", + "description": "Will force show the component in a summary even if hideEmptyFields is set to true in the summary component.", + "default": false, + "$ref": "expression.schema.v1.json#/definitions/boolean" + }, + "optionsId": { + "title": "Dynamic options (fetched from server)", + "description": "ID of the option list to fetch from the server", + "type": "string" + }, + "mapping": { + "title": "Mapping", + "description": "A mapping of key-value pairs (usually used for mapping a path in the data model to a query string parameter).", + "type": "object", + "properties": {}, + "additionalProperties": { "type": "string" } + }, + "queryParameters": { + "title": "Query parameters", + "description": "A mapping of query string parameters to values. Will be appended to the URL when fetching options.", + "type": "object", + "properties": {}, + "additionalProperties": { "type": "string" } + }, + "options": { + "title": "Static options", + "description": "List of static options", + "type": "array", + "items": { + "title": "IRawOption", + "examples": [{ "label": "", "value": "" }], + "type": "object", + "properties": { + "label": { "type": "string" }, + "value": { + "anyOf": [ + { "type": "string" }, + { "type": "number" }, + { "type": "boolean" }, + { "const": null } + ] + }, + "description": { "type": "string" }, + "helpText": { "type": "string" } + }, + "required": ["label", "value"], + "additionalProperties": false + } + }, + "secure": { + "title": "Secure options (when using optionsId)", + "description": "Whether to call the secure API endpoint when fetching options from the server (allows for user/instance-specific options)", + "default": false, + "type": "boolean" + }, + "sortOrder": { + "description": "Sorts the code list in either ascending or descending order by label.", + "enum": ["asc", "desc"], + "type": "string" + }, + "source": { + "title": "Option source", + "description": "Allows for fetching options from the data model, pointing to a repeating group structure", + "type": "object", + "properties": { + "group": { + "title": "Group", + "description": "The repeating group to base options on.", + "examples": ["model.some.group"], + "type": "string" + }, + "label": { + "title": "Label", + "description": "A label of the option displayed in Radio- and Checkbox groups. Can be plain text, a text resource binding, or a dynamic expression.", + "examples": ["some.text.key"], + "$ref": "expression.schema.v1.json#/definitions/string" + }, + "value": { + "title": "Value", + "description": "Field in the group that should be used as value", + "examples": ["model.some.group[{0}].someField"], + "type": "string" + }, + "description": { + "title": "Description", + "description": "A description of the option displayed in Radio- and Checkbox groups. Can be plain text, a text resource binding, or a dynamic expression.", + "examples": ["some.text.key", "My Description"], + "$ref": "expression.schema.v1.json#/definitions/string" + }, + "helpText": { + "title": "Help Text", + "description": "A help text for the option displayed in Radio- and Checkbox groups. Can be plain text, a text resource binding, or a dynamic expression.", + "examples": ["some.text.key", "My Help Text"], + "$ref": "expression.schema.v1.json#/definitions/string" + } + }, + "required": ["group", "label", "value"], + "additionalProperties": false + }, + "preselectedOptionIndex": { + "title": "Preselected option index", + "description": "Index of the option to preselect (if no option has been selected yet)", + "type": "integer" + }, + "type": { "const": "LikertItem" }, + "textResourceBindings": { + "properties": { + "title": { + "title": "Title", + "description": "Title of the Likert component/row", + "$ref": "expression.schema.v1.json#/definitions/string" + }, + "description": { + "title": "Description", + "description": "Description of the Likert component/row", + "$ref": "expression.schema.v1.json#/definitions/string" + }, + "help": { + "title": "Help", + "description": "Help text of the Likert component/row", + "$ref": "expression.schema.v1.json#/definitions/string" + }, + "tableTitle": { + "title": "Table title", + "description": "Title used in the table view (overrides the default title)", + "$ref": "expression.schema.v1.json#/definitions/string" + }, + "shortName": { + "title": "Short name (for validation)", + "description": "Alternative name used for required validation messages (overrides the default title)", + "$ref": "expression.schema.v1.json#/definitions/string" + }, + "requiredValidation": { + "title": "Required validation message", + "description": "Full validation message shown when the component is required and no value has been entered (overrides both the default and shortName)", + "$ref": "expression.schema.v1.json#/definitions/string" + }, + "summaryTitle": { + "title": "Summary title", + "description": "Title used in the summary view (overrides the default title)", + "$ref": "expression.schema.v1.json#/definitions/string" + }, + "summaryAccessibleTitle": { + "title": "Accessible summary title", + "description": "Title used for aria-label on the edit button in the summary view (overrides the default and summary title)", + "$ref": "expression.schema.v1.json#/definitions/string" + } + } + }, + "dataModelBindings": { + "title": "Data model binding", + "description": "Describes the location in the data model where the component should store its value(s). A simple binding is used for components that only store a single value, usually a string.", + "type": "object", + "properties": { + "simpleBinding": { "type": "string" }, + "label": { "type": "string" }, + "metadata": { + "description": "Describes the location where metadata for the option based component should be stored in the datamodel.", + "type": "string" + } + }, + "required": ["simpleBinding"], + "additionalProperties": false + }, + "showLabelsInTable": { + "title": "Show label when single option in table", + "description": "Boolean value indicating if the label should be visible when only one option exists in table", + "default": false, + "type": "boolean" + }, + "layout": { + "title": "Layout", + "description": "Define the layout style for the options", + "enum": ["column", "row", "table"], + "type": "string" + } + }, + "required": ["id", "type", "dataModelBindings"], + "title": "LikertItem component schema" +} diff --git a/frontend/packages/ux-editor/src/testing/schemas/json/component/Link.schema.v1.json b/frontend/packages/ux-editor/src/testing/schemas/json/component/Link.schema.v1.json index 73d960df0d2..69e0af1e1d1 100644 --- a/frontend/packages/ux-editor/src/testing/schemas/json/component/Link.schema.v1.json +++ b/frontend/packages/ux-editor/src/testing/schemas/json/component/Link.schema.v1.json @@ -1 +1,81 @@ -{"$id":"https://altinncdn.no/schemas/json/component/Link.schema.v1.json","$schema":"http://json-schema.org/draft-07/schema#","properties":{"id":{"title":"ID","description":"The component ID. Must be unique within all layouts/pages in a layout-set. Cannot end with .","type":"string","pattern":"^[0-9a-zA-Z][0-9a-zA-Z-]*(-?[a-zA-Z]+|[a-zA-Z][0-9]+|-[0-9]{6,})$"},"hidden":{"title":"Hidden","description":"Boolean value or expression indicating if the component should be hidden. Defaults to false.","default":false,"$ref":"expression.schema.v1.json#/definitions/boolean"},"grid":{"properties":{"xs":{"$ref":"#/definitions/IGridSize"},"sm":{"$ref":"#/definitions/IGridSize"},"md":{"$ref":"#/definitions/IGridSize"},"lg":{"$ref":"#/definitions/IGridSize"},"xl":{"$ref":"#/definitions/IGridSize"},"labelGrid":{"$ref":"#/definitions/IGridStyling"},"innerGrid":{"$ref":"#/definitions/IGridStyling"}}},"pageBreak":{"title":"Page break","description":"Optionally insert page-break before/after component when rendered in PDF","type":"object","properties":{"breakBefore":{"title":"Page break before","description":"PDF only: Value or expression indicating whether a page break should be added before the component. Can be either: 'auto' (default), 'always', or 'avoid'.","examples":["auto","always","avoid"],"default":"auto","$ref":"expression.schema.v1.json#/definitions/string"},"breakAfter":{"title":"Page break after","description":"PDF only: Value or expression indicating whether a page break should be added after the component. Can be either: 'auto' (default), 'always', or 'avoid'.","examples":["auto","always","avoid"],"default":"auto","$ref":"expression.schema.v1.json#/definitions/string"}},"additionalProperties":false},"type":{"const":"Link"},"textResourceBindings":{"type":"object","properties":{"title":{"title":"Title","description":"The title/text of the link","$ref":"expression.schema.v1.json#/definitions/string"},"target":{"title":"Target","description":"The target of the link","$ref":"expression.schema.v1.json#/definitions/string"}},"additionalProperties":false},"style":{"title":"Style","description":"The style of the link (a primary/secondary button, or an actual link)","enum":["primary","secondary","link"],"type":"string"},"openInNewTab":{"title":"Open in new tab","description":"Open the link in a new tab","type":"boolean"}},"required":["id","type","style"],"title":"Link component schema"} \ No newline at end of file +{ + "$id": "https://altinncdn.no/schemas/json/component/Link.schema.v1.json", + "$schema": "http://json-schema.org/draft-07/schema#", + "properties": { + "id": { + "title": "ID", + "description": "The component ID. Must be unique within all layouts/pages in a layout-set. Cannot end with .", + "type": "string", + "pattern": "^[0-9a-zA-Z][0-9a-zA-Z-]*(-?[a-zA-Z]+|[a-zA-Z][0-9]+|-[0-9]{6,})$" + }, + "hidden": { + "title": "Hidden", + "description": "Boolean value or expression indicating if the component should be hidden. Defaults to false.", + "default": false, + "$ref": "expression.schema.v1.json#/definitions/boolean" + }, + "grid": { + "properties": { + "xs": { "$ref": "#/definitions/IGridSize" }, + "sm": { "$ref": "#/definitions/IGridSize" }, + "md": { "$ref": "#/definitions/IGridSize" }, + "lg": { "$ref": "#/definitions/IGridSize" }, + "xl": { "$ref": "#/definitions/IGridSize" }, + "labelGrid": { "$ref": "#/definitions/IGridStyling" }, + "innerGrid": { "$ref": "#/definitions/IGridStyling" } + } + }, + "pageBreak": { + "title": "Page break", + "description": "Optionally insert page-break before/after component when rendered in PDF", + "type": "object", + "properties": { + "breakBefore": { + "title": "Page break before", + "description": "PDF only: Value or expression indicating whether a page break should be added before the component. Can be either: 'auto' (default), 'always', or 'avoid'.", + "examples": ["auto", "always", "avoid"], + "default": "auto", + "$ref": "expression.schema.v1.json#/definitions/string" + }, + "breakAfter": { + "title": "Page break after", + "description": "PDF only: Value or expression indicating whether a page break should be added after the component. Can be either: 'auto' (default), 'always', or 'avoid'.", + "examples": ["auto", "always", "avoid"], + "default": "auto", + "$ref": "expression.schema.v1.json#/definitions/string" + } + }, + "additionalProperties": false + }, + "type": { "const": "Link" }, + "textResourceBindings": { + "type": "object", + "properties": { + "title": { + "title": "Title", + "description": "The title/text of the link", + "$ref": "expression.schema.v1.json#/definitions/string" + }, + "target": { + "title": "Target", + "description": "The target of the link", + "$ref": "expression.schema.v1.json#/definitions/string" + } + }, + "additionalProperties": false + }, + "style": { + "title": "Style", + "description": "The style of the link (a primary/secondary button, or an actual link)", + "enum": ["primary", "secondary", "link"], + "type": "string" + }, + "openInNewTab": { + "title": "Open in new tab", + "description": "Open the link in a new tab", + "type": "boolean" + } + }, + "required": ["id", "type", "style"], + "title": "Link component schema" +} diff --git a/frontend/packages/ux-editor/src/testing/schemas/json/component/List.schema.v1.json b/frontend/packages/ux-editor/src/testing/schemas/json/component/List.schema.v1.json index bccca8d988e..46a50bc4259 100644 --- a/frontend/packages/ux-editor/src/testing/schemas/json/component/List.schema.v1.json +++ b/frontend/packages/ux-editor/src/testing/schemas/json/component/List.schema.v1.json @@ -1 +1,220 @@ -{"$id":"https://altinncdn.no/schemas/json/component/List.schema.v1.json","$schema":"http://json-schema.org/draft-07/schema#","properties":{"id":{"title":"ID","description":"The component ID. Must be unique within all layouts/pages in a layout-set. Cannot end with .","type":"string","pattern":"^[0-9a-zA-Z][0-9a-zA-Z-]*(-?[a-zA-Z]+|[a-zA-Z][0-9]+|-[0-9]{6,})$"},"hidden":{"title":"Hidden","description":"Boolean value or expression indicating if the component should be hidden. Defaults to false.","default":false,"$ref":"expression.schema.v1.json#/definitions/boolean"},"grid":{"properties":{"xs":{"$ref":"#/definitions/IGridSize"},"sm":{"$ref":"#/definitions/IGridSize"},"md":{"$ref":"#/definitions/IGridSize"},"lg":{"$ref":"#/definitions/IGridSize"},"xl":{"$ref":"#/definitions/IGridSize"},"labelGrid":{"$ref":"#/definitions/IGridStyling"},"innerGrid":{"$ref":"#/definitions/IGridStyling"}}},"pageBreak":{"title":"Page break","description":"Optionally insert page-break before/after component when rendered in PDF","type":"object","properties":{"breakBefore":{"title":"Page break before","description":"PDF only: Value or expression indicating whether a page break should be added before the component. Can be either: 'auto' (default), 'always', or 'avoid'.","examples":["auto","always","avoid"],"default":"auto","$ref":"expression.schema.v1.json#/definitions/string"},"breakAfter":{"title":"Page break after","description":"PDF only: Value or expression indicating whether a page break should be added after the component. Can be either: 'auto' (default), 'always', or 'avoid'.","examples":["auto","always","avoid"],"default":"auto","$ref":"expression.schema.v1.json#/definitions/string"}},"additionalProperties":false},"readOnly":{"title":"Read only/disabled?","description":"Boolean value or expression indicating if the component should be read only/disabled. Defaults to false.
Please note that even with read-only fields in components, it may currently be possible to update the field by modifying the request sent to the API or through a direct API call.","default":false,"$ref":"expression.schema.v1.json#/definitions/boolean"},"required":{"title":"Required?","description":"Boolean value or expression indicating if the component should be required. Defaults to false.","default":false,"$ref":"expression.schema.v1.json#/definitions/boolean"},"showValidations":{"title":"Validation types","description":"List of validation types to show","type":"array","items":{"enum":["Schema","Component","Expression","CustomBackend","Required","AllExceptRequired","All"],"type":"string"}},"renderAsSummary":{"title":"Render as summary","description":"Boolean value indicating if the component should be rendered as a summary. Defaults to false.","default":false,"type":"boolean"},"forceShowInSummary":{"title":"Force show in summary","description":"Will force show the component in a summary even if hideEmptyFields is set to true in the summary component.","default":false,"$ref":"expression.schema.v1.json#/definitions/boolean"},"labelSettings":{"title":"ILabelSettings","type":"object","properties":{"optionalIndicator":{"title":"Optional indicator","description":"Show optional indicator on label","type":"boolean"}},"additionalProperties":false},"type":{"const":"List"},"textResourceBindings":{"properties":{"title":{"title":"Title","description":"Label text/title shown above the component","$ref":"expression.schema.v1.json#/definitions/string"},"description":{"title":"Description","description":"Label description shown above the component, below the title","$ref":"expression.schema.v1.json#/definitions/string"},"help":{"title":"Help text","description":"Help text shown in a tooltip when clicking the help button","$ref":"expression.schema.v1.json#/definitions/string"},"tableTitle":{"title":"Table title","description":"Title used in the table view (overrides the default title)","$ref":"expression.schema.v1.json#/definitions/string"},"shortName":{"title":"Short name (for validation)","description":"Alternative name used for required validation messages (overrides the default title)","$ref":"expression.schema.v1.json#/definitions/string"},"requiredValidation":{"title":"Required validation message","description":"Full validation message shown when the component is required and no value has been entered (overrides both the default and shortName)","$ref":"expression.schema.v1.json#/definitions/string"},"summaryTitle":{"title":"Summary title","description":"Title used in the summary view (overrides the default title)","$ref":"expression.schema.v1.json#/definitions/string"},"summaryAccessibleTitle":{"title":"Accessible summary title","description":"Title used for aria-label on the edit button in the summary view (overrides the default and summary title)","$ref":"expression.schema.v1.json#/definitions/string"}}},"dataModelBindings":{"title":"IDataModelBindingsForList","type":"object","properties":{},"additionalProperties":{"type":"string"}},"tableHeaders":{"title":"Table Headers","description":"An object where the fields in the datalist is mapped to headers. Must correspond to datalist representing a row. Can be added to the resource files to change between languages.","examples":[{"productId":"product.id","description":"Beskrivelse av produkt"}],"type":"object","properties":{},"additionalProperties":{"type":"string"}},"sortableColumns":{"title":"Sortable columns","description":"An array of column keys that can be sorted (note that your API backend needs to support this as well). The column has to be represented by the the header name that is written in tableHeaders.","type":"array","items":{"type":"string"}},"pagination":{"title":"Pagination","description":"Pagination settings. Set this to enable pagination (must be supported by backend).","type":"object","properties":{"alternatives":{"title":"Alternatives","description":"List of page sizes the user can choose from. Make sure to test the performance of the largest number of items per page you are allowing.","type":"array","items":{"type":"number"}},"default":{"title":"Default","description":"The pagination size that is set to default.","type":"number"}},"required":["alternatives","default"],"additionalProperties":false},"dataListId":{"title":"Data list ID","description":"The ID of the data list to use (must be implemented in your backend).","type":"string"},"secure":{"title":"Secure","description":"Boolean value indicating if the options should be instance aware. Defaults to false.","default":false,"type":"boolean"},"mapping":{"title":"Mapping","description":"A mapping of key-value pairs (usually used for mapping a path in the data model to a query string parameter).","type":"object","properties":{},"additionalProperties":{"type":"string"}},"bindingToShowInSummary":{"title":"Binding to show in summary","description":"The value of this binding will be shown in the summary component for the list. This binding must be one of the specified bindings under dataModelBindings.","type":"string"},"tableHeadersMobile":{"title":"Table Headers Mobile","description":"An array of strings representing the columns that is chosen to be shown in the mobile view.","type":"array","items":{"type":"string"}}},"required":["id","type","tableHeaders","dataListId"],"title":"List component schema"} \ No newline at end of file +{ + "$id": "https://altinncdn.no/schemas/json/component/List.schema.v1.json", + "$schema": "http://json-schema.org/draft-07/schema#", + "properties": { + "id": { + "title": "ID", + "description": "The component ID. Must be unique within all layouts/pages in a layout-set. Cannot end with .", + "type": "string", + "pattern": "^[0-9a-zA-Z][0-9a-zA-Z-]*(-?[a-zA-Z]+|[a-zA-Z][0-9]+|-[0-9]{6,})$" + }, + "hidden": { + "title": "Hidden", + "description": "Boolean value or expression indicating if the component should be hidden. Defaults to false.", + "default": false, + "$ref": "expression.schema.v1.json#/definitions/boolean" + }, + "grid": { + "properties": { + "xs": { "$ref": "#/definitions/IGridSize" }, + "sm": { "$ref": "#/definitions/IGridSize" }, + "md": { "$ref": "#/definitions/IGridSize" }, + "lg": { "$ref": "#/definitions/IGridSize" }, + "xl": { "$ref": "#/definitions/IGridSize" }, + "labelGrid": { "$ref": "#/definitions/IGridStyling" }, + "innerGrid": { "$ref": "#/definitions/IGridStyling" } + } + }, + "pageBreak": { + "title": "Page break", + "description": "Optionally insert page-break before/after component when rendered in PDF", + "type": "object", + "properties": { + "breakBefore": { + "title": "Page break before", + "description": "PDF only: Value or expression indicating whether a page break should be added before the component. Can be either: 'auto' (default), 'always', or 'avoid'.", + "examples": ["auto", "always", "avoid"], + "default": "auto", + "$ref": "expression.schema.v1.json#/definitions/string" + }, + "breakAfter": { + "title": "Page break after", + "description": "PDF only: Value or expression indicating whether a page break should be added after the component. Can be either: 'auto' (default), 'always', or 'avoid'.", + "examples": ["auto", "always", "avoid"], + "default": "auto", + "$ref": "expression.schema.v1.json#/definitions/string" + } + }, + "additionalProperties": false + }, + "readOnly": { + "title": "Read only/disabled?", + "description": "Boolean value or expression indicating if the component should be read only/disabled. Defaults to false.
Please note that even with read-only fields in components, it may currently be possible to update the field by modifying the request sent to the API or through a direct API call.", + "default": false, + "$ref": "expression.schema.v1.json#/definitions/boolean" + }, + "required": { + "title": "Required?", + "description": "Boolean value or expression indicating if the component should be required. Defaults to false.", + "default": false, + "$ref": "expression.schema.v1.json#/definitions/boolean" + }, + "showValidations": { + "title": "Validation types", + "description": "List of validation types to show", + "type": "array", + "items": { + "enum": [ + "Schema", + "Component", + "Expression", + "CustomBackend", + "Required", + "AllExceptRequired", + "All" + ], + "type": "string" + } + }, + "renderAsSummary": { + "title": "Render as summary", + "description": "Boolean value indicating if the component should be rendered as a summary. Defaults to false.", + "default": false, + "type": "boolean" + }, + "forceShowInSummary": { + "title": "Force show in summary", + "description": "Will force show the component in a summary even if hideEmptyFields is set to true in the summary component.", + "default": false, + "$ref": "expression.schema.v1.json#/definitions/boolean" + }, + "labelSettings": { + "title": "ILabelSettings", + "type": "object", + "properties": { + "optionalIndicator": { + "title": "Optional indicator", + "description": "Show optional indicator on label", + "type": "boolean" + } + }, + "additionalProperties": false + }, + "type": { "const": "List" }, + "textResourceBindings": { + "properties": { + "title": { + "title": "Title", + "description": "Label text/title shown above the component", + "$ref": "expression.schema.v1.json#/definitions/string" + }, + "description": { + "title": "Description", + "description": "Label description shown above the component, below the title", + "$ref": "expression.schema.v1.json#/definitions/string" + }, + "help": { + "title": "Help text", + "description": "Help text shown in a tooltip when clicking the help button", + "$ref": "expression.schema.v1.json#/definitions/string" + }, + "tableTitle": { + "title": "Table title", + "description": "Title used in the table view (overrides the default title)", + "$ref": "expression.schema.v1.json#/definitions/string" + }, + "shortName": { + "title": "Short name (for validation)", + "description": "Alternative name used for required validation messages (overrides the default title)", + "$ref": "expression.schema.v1.json#/definitions/string" + }, + "requiredValidation": { + "title": "Required validation message", + "description": "Full validation message shown when the component is required and no value has been entered (overrides both the default and shortName)", + "$ref": "expression.schema.v1.json#/definitions/string" + }, + "summaryTitle": { + "title": "Summary title", + "description": "Title used in the summary view (overrides the default title)", + "$ref": "expression.schema.v1.json#/definitions/string" + }, + "summaryAccessibleTitle": { + "title": "Accessible summary title", + "description": "Title used for aria-label on the edit button in the summary view (overrides the default and summary title)", + "$ref": "expression.schema.v1.json#/definitions/string" + } + } + }, + "dataModelBindings": { + "title": "IDataModelBindingsForList", + "type": "object", + "properties": {}, + "additionalProperties": { "type": "string" } + }, + "tableHeaders": { + "title": "Table Headers", + "description": "An object where the fields in the datalist is mapped to headers. Must correspond to datalist representing a row. Can be added to the resource files to change between languages.", + "examples": [{ "productId": "product.id", "description": "Beskrivelse av produkt" }], + "type": "object", + "properties": {}, + "additionalProperties": { "type": "string" } + }, + "sortableColumns": { + "title": "Sortable columns", + "description": "An array of column keys that can be sorted (note that your API backend needs to support this as well). The column has to be represented by the the header name that is written in tableHeaders.", + "type": "array", + "items": { "type": "string" } + }, + "pagination": { + "title": "Pagination", + "description": "Pagination settings. Set this to enable pagination (must be supported by backend).", + "type": "object", + "properties": { + "alternatives": { + "title": "Alternatives", + "description": "List of page sizes the user can choose from. Make sure to test the performance of the largest number of items per page you are allowing.", + "type": "array", + "items": { "type": "number" } + }, + "default": { + "title": "Default", + "description": "The pagination size that is set to default.", + "type": "number" + } + }, + "required": ["alternatives", "default"], + "additionalProperties": false + }, + "dataListId": { + "title": "Data list ID", + "description": "The ID of the data list to use (must be implemented in your backend).", + "type": "string" + }, + "secure": { + "title": "Secure", + "description": "Boolean value indicating if the options should be instance aware. Defaults to false.", + "default": false, + "type": "boolean" + }, + "mapping": { + "title": "Mapping", + "description": "A mapping of key-value pairs (usually used for mapping a path in the data model to a query string parameter).", + "type": "object", + "properties": {}, + "additionalProperties": { "type": "string" } + }, + "bindingToShowInSummary": { + "title": "Binding to show in summary", + "description": "The value of this binding will be shown in the summary component for the list. This binding must be one of the specified bindings under dataModelBindings.", + "type": "string" + }, + "tableHeadersMobile": { + "title": "Table Headers Mobile", + "description": "An array of strings representing the columns that is chosen to be shown in the mobile view.", + "type": "array", + "items": { "type": "string" } + } + }, + "required": ["id", "type", "tableHeaders", "dataListId"], + "title": "List component schema" +} diff --git a/frontend/packages/ux-editor/src/testing/schemas/json/component/Map.schema.v1.json b/frontend/packages/ux-editor/src/testing/schemas/json/component/Map.schema.v1.json index c732ccf53aa..60ff8a768d9 100644 --- a/frontend/packages/ux-editor/src/testing/schemas/json/component/Map.schema.v1.json +++ b/frontend/packages/ux-editor/src/testing/schemas/json/component/Map.schema.v1.json @@ -1 +1,205 @@ -{"$id":"https://altinncdn.no/schemas/json/component/Map.schema.v1.json","$schema":"http://json-schema.org/draft-07/schema#","properties":{"id":{"title":"ID","description":"The component ID. Must be unique within all layouts/pages in a layout-set. Cannot end with .","type":"string","pattern":"^[0-9a-zA-Z][0-9a-zA-Z-]*(-?[a-zA-Z]+|[a-zA-Z][0-9]+|-[0-9]{6,})$"},"hidden":{"title":"Hidden","description":"Boolean value or expression indicating if the component should be hidden. Defaults to false.","default":false,"$ref":"expression.schema.v1.json#/definitions/boolean"},"grid":{"properties":{"xs":{"$ref":"#/definitions/IGridSize"},"sm":{"$ref":"#/definitions/IGridSize"},"md":{"$ref":"#/definitions/IGridSize"},"lg":{"$ref":"#/definitions/IGridSize"},"xl":{"$ref":"#/definitions/IGridSize"},"labelGrid":{"$ref":"#/definitions/IGridStyling"},"innerGrid":{"$ref":"#/definitions/IGridStyling"}}},"pageBreak":{"title":"Page break","description":"Optionally insert page-break before/after component when rendered in PDF","type":"object","properties":{"breakBefore":{"title":"Page break before","description":"PDF only: Value or expression indicating whether a page break should be added before the component. Can be either: 'auto' (default), 'always', or 'avoid'.","examples":["auto","always","avoid"],"default":"auto","$ref":"expression.schema.v1.json#/definitions/string"},"breakAfter":{"title":"Page break after","description":"PDF only: Value or expression indicating whether a page break should be added after the component. Can be either: 'auto' (default), 'always', or 'avoid'.","examples":["auto","always","avoid"],"default":"auto","$ref":"expression.schema.v1.json#/definitions/string"}},"additionalProperties":false},"readOnly":{"title":"Read only/disabled?","description":"Boolean value or expression indicating if the component should be read only/disabled. Defaults to false.
Please note that even with read-only fields in components, it may currently be possible to update the field by modifying the request sent to the API or through a direct API call.","default":false,"$ref":"expression.schema.v1.json#/definitions/boolean"},"required":{"title":"Required?","description":"Boolean value or expression indicating if the component should be required. Defaults to false.","default":false,"$ref":"expression.schema.v1.json#/definitions/boolean"},"showValidations":{"title":"Validation types","description":"List of validation types to show","type":"array","items":{"enum":["Schema","Component","Expression","CustomBackend","Required","AllExceptRequired","All"],"type":"string"}},"renderAsSummary":{"title":"Render as summary","description":"Boolean value indicating if the component should be rendered as a summary. Defaults to false.","default":false,"type":"boolean"},"forceShowInSummary":{"title":"Force show in summary","description":"Will force show the component in a summary even if hideEmptyFields is set to true in the summary component.","default":false,"$ref":"expression.schema.v1.json#/definitions/boolean"},"labelSettings":{"title":"ILabelSettings","type":"object","properties":{"optionalIndicator":{"title":"Optional indicator","description":"Show optional indicator on label","type":"boolean"}},"additionalProperties":false},"type":{"const":"Map"},"textResourceBindings":{"properties":{"title":{"title":"Title","description":"Label text/title shown above the component","$ref":"expression.schema.v1.json#/definitions/string"},"description":{"title":"Description","description":"Label description shown above the component, below the title","$ref":"expression.schema.v1.json#/definitions/string"},"help":{"title":"Help text","description":"Help text shown in a tooltip when clicking the help button","$ref":"expression.schema.v1.json#/definitions/string"},"tableTitle":{"title":"Table title","description":"Title used in the table view (overrides the default title)","$ref":"expression.schema.v1.json#/definitions/string"},"shortName":{"title":"Short name (for validation)","description":"Alternative name used for required validation messages (overrides the default title)","$ref":"expression.schema.v1.json#/definitions/string"},"requiredValidation":{"title":"Required validation message","description":"Full validation message shown when the component is required and no value has been entered (overrides both the default and shortName)","$ref":"expression.schema.v1.json#/definitions/string"},"summaryTitle":{"title":"Summary title","description":"Title used in the summary view (overrides the default title)","$ref":"expression.schema.v1.json#/definitions/string"},"summaryAccessibleTitle":{"title":"Accessible summary title","description":"Title used for aria-label on the edit button in the summary view (overrides the default and summary title)","$ref":"expression.schema.v1.json#/definitions/string"}}},"dataModelBindings":{"title":"IDataModelBindingsForMap","type":"object","properties":{"simpleBinding":{"type":"string"},"geometries":{"description":"Should point to an array of objects like {data: string, label: string}","type":"string"}},"additionalProperties":false},"layers":{"type":"array","items":{"title":"MapLayer","type":"object","properties":{"url":{"title":"Map layer url","description":"Url to a map tile. {z}/{x}/{y} will be replaced with tile coordinates, {s} will be replaced with a random subdomain if subdomains are given","type":"string"},"attribution":{"title":"Attribution","description":"Ascribing a work or remark to a particular unit for recognition","type":"string"},"subdomains":{"title":"Subdomains","description":"List of subdomains. Used for balancing the load on different map tiling servers. A random one will replace {s} in the defined url.","type":"array","items":{"type":"string"}}},"required":["url"],"additionalProperties":false}},"centerLocation":{"title":"Center location","description":"Center location of the map","type":"object","properties":{"latitude":{"type":"number"},"longitude":{"type":"number"}},"required":["latitude","longitude"],"additionalProperties":false},"zoom":{"type":"number"},"geometryType":{"title":"IGeometryType","default":"GeoJSON","enum":["GeoJSON","WKT"],"type":"string"}},"required":["id","type","dataModelBindings"],"title":"Map component schema"} \ No newline at end of file +{ + "$id": "https://altinncdn.no/schemas/json/component/Map.schema.v1.json", + "$schema": "http://json-schema.org/draft-07/schema#", + "properties": { + "id": { + "title": "ID", + "description": "The component ID. Must be unique within all layouts/pages in a layout-set. Cannot end with .", + "type": "string", + "pattern": "^[0-9a-zA-Z][0-9a-zA-Z-]*(-?[a-zA-Z]+|[a-zA-Z][0-9]+|-[0-9]{6,})$" + }, + "hidden": { + "title": "Hidden", + "description": "Boolean value or expression indicating if the component should be hidden. Defaults to false.", + "default": false, + "$ref": "expression.schema.v1.json#/definitions/boolean" + }, + "grid": { + "properties": { + "xs": { "$ref": "#/definitions/IGridSize" }, + "sm": { "$ref": "#/definitions/IGridSize" }, + "md": { "$ref": "#/definitions/IGridSize" }, + "lg": { "$ref": "#/definitions/IGridSize" }, + "xl": { "$ref": "#/definitions/IGridSize" }, + "labelGrid": { "$ref": "#/definitions/IGridStyling" }, + "innerGrid": { "$ref": "#/definitions/IGridStyling" } + } + }, + "pageBreak": { + "title": "Page break", + "description": "Optionally insert page-break before/after component when rendered in PDF", + "type": "object", + "properties": { + "breakBefore": { + "title": "Page break before", + "description": "PDF only: Value or expression indicating whether a page break should be added before the component. Can be either: 'auto' (default), 'always', or 'avoid'.", + "examples": ["auto", "always", "avoid"], + "default": "auto", + "$ref": "expression.schema.v1.json#/definitions/string" + }, + "breakAfter": { + "title": "Page break after", + "description": "PDF only: Value or expression indicating whether a page break should be added after the component. Can be either: 'auto' (default), 'always', or 'avoid'.", + "examples": ["auto", "always", "avoid"], + "default": "auto", + "$ref": "expression.schema.v1.json#/definitions/string" + } + }, + "additionalProperties": false + }, + "readOnly": { + "title": "Read only/disabled?", + "description": "Boolean value or expression indicating if the component should be read only/disabled. Defaults to false.
Please note that even with read-only fields in components, it may currently be possible to update the field by modifying the request sent to the API or through a direct API call.", + "default": false, + "$ref": "expression.schema.v1.json#/definitions/boolean" + }, + "required": { + "title": "Required?", + "description": "Boolean value or expression indicating if the component should be required. Defaults to false.", + "default": false, + "$ref": "expression.schema.v1.json#/definitions/boolean" + }, + "showValidations": { + "title": "Validation types", + "description": "List of validation types to show", + "type": "array", + "items": { + "enum": [ + "Schema", + "Component", + "Expression", + "CustomBackend", + "Required", + "AllExceptRequired", + "All" + ], + "type": "string" + } + }, + "renderAsSummary": { + "title": "Render as summary", + "description": "Boolean value indicating if the component should be rendered as a summary. Defaults to false.", + "default": false, + "type": "boolean" + }, + "forceShowInSummary": { + "title": "Force show in summary", + "description": "Will force show the component in a summary even if hideEmptyFields is set to true in the summary component.", + "default": false, + "$ref": "expression.schema.v1.json#/definitions/boolean" + }, + "labelSettings": { + "title": "ILabelSettings", + "type": "object", + "properties": { + "optionalIndicator": { + "title": "Optional indicator", + "description": "Show optional indicator on label", + "type": "boolean" + } + }, + "additionalProperties": false + }, + "type": { "const": "Map" }, + "textResourceBindings": { + "properties": { + "title": { + "title": "Title", + "description": "Label text/title shown above the component", + "$ref": "expression.schema.v1.json#/definitions/string" + }, + "description": { + "title": "Description", + "description": "Label description shown above the component, below the title", + "$ref": "expression.schema.v1.json#/definitions/string" + }, + "help": { + "title": "Help text", + "description": "Help text shown in a tooltip when clicking the help button", + "$ref": "expression.schema.v1.json#/definitions/string" + }, + "tableTitle": { + "title": "Table title", + "description": "Title used in the table view (overrides the default title)", + "$ref": "expression.schema.v1.json#/definitions/string" + }, + "shortName": { + "title": "Short name (for validation)", + "description": "Alternative name used for required validation messages (overrides the default title)", + "$ref": "expression.schema.v1.json#/definitions/string" + }, + "requiredValidation": { + "title": "Required validation message", + "description": "Full validation message shown when the component is required and no value has been entered (overrides both the default and shortName)", + "$ref": "expression.schema.v1.json#/definitions/string" + }, + "summaryTitle": { + "title": "Summary title", + "description": "Title used in the summary view (overrides the default title)", + "$ref": "expression.schema.v1.json#/definitions/string" + }, + "summaryAccessibleTitle": { + "title": "Accessible summary title", + "description": "Title used for aria-label on the edit button in the summary view (overrides the default and summary title)", + "$ref": "expression.schema.v1.json#/definitions/string" + } + } + }, + "dataModelBindings": { + "title": "IDataModelBindingsForMap", + "type": "object", + "properties": { + "simpleBinding": { "type": "string" }, + "geometries": { + "description": "Should point to an array of objects like {data: string, label: string}", + "type": "string" + } + }, + "additionalProperties": false + }, + "layers": { + "type": "array", + "items": { + "title": "MapLayer", + "type": "object", + "properties": { + "url": { + "title": "Map layer url", + "description": "Url to a map tile. {z}/{x}/{y} will be replaced with tile coordinates, {s} will be replaced with a random subdomain if subdomains are given", + "type": "string" + }, + "attribution": { + "title": "Attribution", + "description": "Ascribing a work or remark to a particular unit for recognition", + "type": "string" + }, + "subdomains": { + "title": "Subdomains", + "description": "List of subdomains. Used for balancing the load on different map tiling servers. A random one will replace {s} in the defined url.", + "type": "array", + "items": { "type": "string" } + } + }, + "required": ["url"], + "additionalProperties": false + } + }, + "centerLocation": { + "title": "Center location", + "description": "Center location of the map", + "type": "object", + "properties": { "latitude": { "type": "number" }, "longitude": { "type": "number" } }, + "required": ["latitude", "longitude"], + "additionalProperties": false + }, + "zoom": { "type": "number" }, + "geometryType": { + "title": "IGeometryType", + "default": "GeoJSON", + "enum": ["GeoJSON", "WKT"], + "type": "string" + } + }, + "required": ["id", "type", "dataModelBindings"], + "title": "Map component schema" +} diff --git a/frontend/packages/ux-editor/src/testing/schemas/json/component/MultipleSelect.schema.v1.json b/frontend/packages/ux-editor/src/testing/schemas/json/component/MultipleSelect.schema.v1.json index f67e113eeb8..768cf9afbbf 100644 --- a/frontend/packages/ux-editor/src/testing/schemas/json/component/MultipleSelect.schema.v1.json +++ b/frontend/packages/ux-editor/src/testing/schemas/json/component/MultipleSelect.schema.v1.json @@ -1 +1,271 @@ -{"$id":"https://altinncdn.no/schemas/json/component/MultipleSelect.schema.v1.json","$schema":"http://json-schema.org/draft-07/schema#","properties":{"id":{"title":"ID","description":"The component ID. Must be unique within all layouts/pages in a layout-set. Cannot end with .","type":"string","pattern":"^[0-9a-zA-Z][0-9a-zA-Z-]*(-?[a-zA-Z]+|[a-zA-Z][0-9]+|-[0-9]{6,})$"},"hidden":{"title":"Hidden","description":"Boolean value or expression indicating if the component should be hidden. Defaults to false.","default":false,"$ref":"expression.schema.v1.json#/definitions/boolean"},"grid":{"properties":{"xs":{"$ref":"#/definitions/IGridSize"},"sm":{"$ref":"#/definitions/IGridSize"},"md":{"$ref":"#/definitions/IGridSize"},"lg":{"$ref":"#/definitions/IGridSize"},"xl":{"$ref":"#/definitions/IGridSize"},"labelGrid":{"$ref":"#/definitions/IGridStyling"},"innerGrid":{"$ref":"#/definitions/IGridStyling"}}},"pageBreak":{"title":"Page break","description":"Optionally insert page-break before/after component when rendered in PDF","type":"object","properties":{"breakBefore":{"title":"Page break before","description":"PDF only: Value or expression indicating whether a page break should be added before the component. Can be either: 'auto' (default), 'always', or 'avoid'.","examples":["auto","always","avoid"],"default":"auto","$ref":"expression.schema.v1.json#/definitions/string"},"breakAfter":{"title":"Page break after","description":"PDF only: Value or expression indicating whether a page break should be added after the component. Can be either: 'auto' (default), 'always', or 'avoid'.","examples":["auto","always","avoid"],"default":"auto","$ref":"expression.schema.v1.json#/definitions/string"}},"additionalProperties":false},"readOnly":{"title":"Read only/disabled?","description":"Boolean value or expression indicating if the component should be read only/disabled. Defaults to false.
Please note that even with read-only fields in components, it may currently be possible to update the field by modifying the request sent to the API or through a direct API call.","default":false,"$ref":"expression.schema.v1.json#/definitions/boolean"},"required":{"title":"Required?","description":"Boolean value or expression indicating if the component should be required. Defaults to false.","default":false,"$ref":"expression.schema.v1.json#/definitions/boolean"},"showValidations":{"title":"Validation types","description":"List of validation types to show","type":"array","items":{"enum":["Schema","Component","Expression","CustomBackend","Required","AllExceptRequired","All"],"type":"string"}},"renderAsSummary":{"title":"Render as summary","description":"Boolean value indicating if the component should be rendered as a summary. Defaults to false.","default":false,"type":"boolean"},"forceShowInSummary":{"title":"Force show in summary","description":"Will force show the component in a summary even if hideEmptyFields is set to true in the summary component.","default":false,"$ref":"expression.schema.v1.json#/definitions/boolean"},"optionsId":{"title":"Dynamic options (fetched from server)","description":"ID of the option list to fetch from the server","type":"string"},"mapping":{"title":"Mapping","description":"A mapping of key-value pairs (usually used for mapping a path in the data model to a query string parameter).","type":"object","properties":{},"additionalProperties":{"type":"string"}},"queryParameters":{"title":"Query parameters","description":"A mapping of query string parameters to values. Will be appended to the URL when fetching options.","type":"object","properties":{},"additionalProperties":{"type":"string"}},"options":{"title":"Static options","description":"List of static options","type":"array","items":{"title":"IRawOption","examples":[{"label":"","value":""}],"type":"object","properties":{"label":{"type":"string"},"value":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"const":null}]},"description":{"type":"string"},"helpText":{"type":"string"}},"required":["label","value"],"additionalProperties":false}},"secure":{"title":"Secure options (when using optionsId)","description":"Whether to call the secure API endpoint when fetching options from the server (allows for user/instance-specific options)","default":false,"type":"boolean"},"sortOrder":{"description":"Sorts the code list in either ascending or descending order by label.","enum":["asc","desc"],"type":"string"},"source":{"title":"Option source","description":"Allows for fetching options from the data model, pointing to a repeating group structure","type":"object","properties":{"group":{"title":"Group","description":"The repeating group to base options on.","examples":["model.some.group"],"type":"string"},"label":{"title":"Label","description":"A label of the option displayed in Radio- and Checkbox groups. Can be plain text, a text resource binding, or a dynamic expression.","examples":["some.text.key"],"$ref":"expression.schema.v1.json#/definitions/string"},"value":{"title":"Value","description":"Field in the group that should be used as value","examples":["model.some.group[{0}].someField"],"type":"string"},"description":{"title":"Description","description":"A description of the option displayed in Radio- and Checkbox groups. Can be plain text, a text resource binding, or a dynamic expression.","examples":["some.text.key","My Description"],"$ref":"expression.schema.v1.json#/definitions/string"},"helpText":{"title":"Help Text","description":"A help text for the option displayed in Radio- and Checkbox groups. Can be plain text, a text resource binding, or a dynamic expression.","examples":["some.text.key","My Help Text"],"$ref":"expression.schema.v1.json#/definitions/string"}},"required":["group","label","value"],"additionalProperties":false},"preselectedOptionIndex":{"title":"Preselected option index","description":"Index of the option to preselect (if no option has been selected yet)","type":"integer"},"labelSettings":{"title":"ILabelSettings","type":"object","properties":{"optionalIndicator":{"title":"Optional indicator","description":"Show optional indicator on label","type":"boolean"}},"additionalProperties":false},"type":{"const":"MultipleSelect"},"textResourceBindings":{"properties":{"title":{"title":"Title","description":"Label text/title shown above the component","$ref":"expression.schema.v1.json#/definitions/string"},"description":{"title":"Description","description":"Label description shown above the component, below the title","$ref":"expression.schema.v1.json#/definitions/string"},"help":{"title":"Help text","description":"Help text shown in a tooltip when clicking the help button","$ref":"expression.schema.v1.json#/definitions/string"},"tableTitle":{"title":"Table title","description":"Title used in the table view (overrides the default title)","$ref":"expression.schema.v1.json#/definitions/string"},"shortName":{"title":"Short name (for validation)","description":"Alternative name used for required validation messages (overrides the default title)","$ref":"expression.schema.v1.json#/definitions/string"},"requiredValidation":{"title":"Required validation message","description":"Full validation message shown when the component is required and no value has been entered (overrides both the default and shortName)","$ref":"expression.schema.v1.json#/definitions/string"},"summaryTitle":{"title":"Summary title","description":"Title used in the summary view (overrides the default title)","$ref":"expression.schema.v1.json#/definitions/string"},"summaryAccessibleTitle":{"title":"Accessible summary title","description":"Title used for aria-label on the edit button in the summary view (overrides the default and summary title)","$ref":"expression.schema.v1.json#/definitions/string"}}},"alertOnChange":{"title":"Alert on change","description":"Boolean value indicating if the component should alert on change","default":false,"$ref":"expression.schema.v1.json#/definitions/boolean"},"dataModelBindings":{"title":"Data model binding","description":"Describes the location in the data model where the component should store its value(s). A simple binding is used for components that only store a single value, usually a string.","type":"object","properties":{"simpleBinding":{"type":"string"},"label":{"type":"string"},"metadata":{"description":"Describes the location where metadata for the option based component should be stored in the datamodel.","type":"string"}},"required":["simpleBinding"],"additionalProperties":false}},"required":["id","type","dataModelBindings"],"title":"MultipleSelect component schema"} \ No newline at end of file +{ + "$id": "https://altinncdn.no/schemas/json/component/MultipleSelect.schema.v1.json", + "$schema": "http://json-schema.org/draft-07/schema#", + "properties": { + "id": { + "title": "ID", + "description": "The component ID. Must be unique within all layouts/pages in a layout-set. Cannot end with .", + "type": "string", + "pattern": "^[0-9a-zA-Z][0-9a-zA-Z-]*(-?[a-zA-Z]+|[a-zA-Z][0-9]+|-[0-9]{6,})$" + }, + "hidden": { + "title": "Hidden", + "description": "Boolean value or expression indicating if the component should be hidden. Defaults to false.", + "default": false, + "$ref": "expression.schema.v1.json#/definitions/boolean" + }, + "grid": { + "properties": { + "xs": { "$ref": "#/definitions/IGridSize" }, + "sm": { "$ref": "#/definitions/IGridSize" }, + "md": { "$ref": "#/definitions/IGridSize" }, + "lg": { "$ref": "#/definitions/IGridSize" }, + "xl": { "$ref": "#/definitions/IGridSize" }, + "labelGrid": { "$ref": "#/definitions/IGridStyling" }, + "innerGrid": { "$ref": "#/definitions/IGridStyling" } + } + }, + "pageBreak": { + "title": "Page break", + "description": "Optionally insert page-break before/after component when rendered in PDF", + "type": "object", + "properties": { + "breakBefore": { + "title": "Page break before", + "description": "PDF only: Value or expression indicating whether a page break should be added before the component. Can be either: 'auto' (default), 'always', or 'avoid'.", + "examples": ["auto", "always", "avoid"], + "default": "auto", + "$ref": "expression.schema.v1.json#/definitions/string" + }, + "breakAfter": { + "title": "Page break after", + "description": "PDF only: Value or expression indicating whether a page break should be added after the component. Can be either: 'auto' (default), 'always', or 'avoid'.", + "examples": ["auto", "always", "avoid"], + "default": "auto", + "$ref": "expression.schema.v1.json#/definitions/string" + } + }, + "additionalProperties": false + }, + "readOnly": { + "title": "Read only/disabled?", + "description": "Boolean value or expression indicating if the component should be read only/disabled. Defaults to false.
Please note that even with read-only fields in components, it may currently be possible to update the field by modifying the request sent to the API or through a direct API call.", + "default": false, + "$ref": "expression.schema.v1.json#/definitions/boolean" + }, + "required": { + "title": "Required?", + "description": "Boolean value or expression indicating if the component should be required. Defaults to false.", + "default": false, + "$ref": "expression.schema.v1.json#/definitions/boolean" + }, + "showValidations": { + "title": "Validation types", + "description": "List of validation types to show", + "type": "array", + "items": { + "enum": [ + "Schema", + "Component", + "Expression", + "CustomBackend", + "Required", + "AllExceptRequired", + "All" + ], + "type": "string" + } + }, + "renderAsSummary": { + "title": "Render as summary", + "description": "Boolean value indicating if the component should be rendered as a summary. Defaults to false.", + "default": false, + "type": "boolean" + }, + "forceShowInSummary": { + "title": "Force show in summary", + "description": "Will force show the component in a summary even if hideEmptyFields is set to true in the summary component.", + "default": false, + "$ref": "expression.schema.v1.json#/definitions/boolean" + }, + "optionsId": { + "title": "Dynamic options (fetched from server)", + "description": "ID of the option list to fetch from the server", + "type": "string" + }, + "mapping": { + "title": "Mapping", + "description": "A mapping of key-value pairs (usually used for mapping a path in the data model to a query string parameter).", + "type": "object", + "properties": {}, + "additionalProperties": { "type": "string" } + }, + "queryParameters": { + "title": "Query parameters", + "description": "A mapping of query string parameters to values. Will be appended to the URL when fetching options.", + "type": "object", + "properties": {}, + "additionalProperties": { "type": "string" } + }, + "options": { + "title": "Static options", + "description": "List of static options", + "type": "array", + "items": { + "title": "IRawOption", + "examples": [{ "label": "", "value": "" }], + "type": "object", + "properties": { + "label": { "type": "string" }, + "value": { + "anyOf": [ + { "type": "string" }, + { "type": "number" }, + { "type": "boolean" }, + { "const": null } + ] + }, + "description": { "type": "string" }, + "helpText": { "type": "string" } + }, + "required": ["label", "value"], + "additionalProperties": false + } + }, + "secure": { + "title": "Secure options (when using optionsId)", + "description": "Whether to call the secure API endpoint when fetching options from the server (allows for user/instance-specific options)", + "default": false, + "type": "boolean" + }, + "sortOrder": { + "description": "Sorts the code list in either ascending or descending order by label.", + "enum": ["asc", "desc"], + "type": "string" + }, + "source": { + "title": "Option source", + "description": "Allows for fetching options from the data model, pointing to a repeating group structure", + "type": "object", + "properties": { + "group": { + "title": "Group", + "description": "The repeating group to base options on.", + "examples": ["model.some.group"], + "type": "string" + }, + "label": { + "title": "Label", + "description": "A label of the option displayed in Radio- and Checkbox groups. Can be plain text, a text resource binding, or a dynamic expression.", + "examples": ["some.text.key"], + "$ref": "expression.schema.v1.json#/definitions/string" + }, + "value": { + "title": "Value", + "description": "Field in the group that should be used as value", + "examples": ["model.some.group[{0}].someField"], + "type": "string" + }, + "description": { + "title": "Description", + "description": "A description of the option displayed in Radio- and Checkbox groups. Can be plain text, a text resource binding, or a dynamic expression.", + "examples": ["some.text.key", "My Description"], + "$ref": "expression.schema.v1.json#/definitions/string" + }, + "helpText": { + "title": "Help Text", + "description": "A help text for the option displayed in Radio- and Checkbox groups. Can be plain text, a text resource binding, or a dynamic expression.", + "examples": ["some.text.key", "My Help Text"], + "$ref": "expression.schema.v1.json#/definitions/string" + } + }, + "required": ["group", "label", "value"], + "additionalProperties": false + }, + "preselectedOptionIndex": { + "title": "Preselected option index", + "description": "Index of the option to preselect (if no option has been selected yet)", + "type": "integer" + }, + "labelSettings": { + "title": "ILabelSettings", + "type": "object", + "properties": { + "optionalIndicator": { + "title": "Optional indicator", + "description": "Show optional indicator on label", + "type": "boolean" + } + }, + "additionalProperties": false + }, + "type": { "const": "MultipleSelect" }, + "textResourceBindings": { + "properties": { + "title": { + "title": "Title", + "description": "Label text/title shown above the component", + "$ref": "expression.schema.v1.json#/definitions/string" + }, + "description": { + "title": "Description", + "description": "Label description shown above the component, below the title", + "$ref": "expression.schema.v1.json#/definitions/string" + }, + "help": { + "title": "Help text", + "description": "Help text shown in a tooltip when clicking the help button", + "$ref": "expression.schema.v1.json#/definitions/string" + }, + "tableTitle": { + "title": "Table title", + "description": "Title used in the table view (overrides the default title)", + "$ref": "expression.schema.v1.json#/definitions/string" + }, + "shortName": { + "title": "Short name (for validation)", + "description": "Alternative name used for required validation messages (overrides the default title)", + "$ref": "expression.schema.v1.json#/definitions/string" + }, + "requiredValidation": { + "title": "Required validation message", + "description": "Full validation message shown when the component is required and no value has been entered (overrides both the default and shortName)", + "$ref": "expression.schema.v1.json#/definitions/string" + }, + "summaryTitle": { + "title": "Summary title", + "description": "Title used in the summary view (overrides the default title)", + "$ref": "expression.schema.v1.json#/definitions/string" + }, + "summaryAccessibleTitle": { + "title": "Accessible summary title", + "description": "Title used for aria-label on the edit button in the summary view (overrides the default and summary title)", + "$ref": "expression.schema.v1.json#/definitions/string" + } + } + }, + "alertOnChange": { + "title": "Alert on change", + "description": "Boolean value indicating if the component should alert on change", + "default": false, + "$ref": "expression.schema.v1.json#/definitions/boolean" + }, + "dataModelBindings": { + "title": "Data model binding", + "description": "Describes the location in the data model where the component should store its value(s). A simple binding is used for components that only store a single value, usually a string.", + "type": "object", + "properties": { + "simpleBinding": { "type": "string" }, + "label": { "type": "string" }, + "metadata": { + "description": "Describes the location where metadata for the option based component should be stored in the datamodel.", + "type": "string" + } + }, + "required": ["simpleBinding"], + "additionalProperties": false + } + }, + "required": ["id", "type", "dataModelBindings"], + "title": "MultipleSelect component schema" +} diff --git a/frontend/packages/ux-editor/src/testing/schemas/json/component/NavigationBar.schema.v1.json b/frontend/packages/ux-editor/src/testing/schemas/json/component/NavigationBar.schema.v1.json index c1dcae2c07c..350553ee9a0 100644 --- a/frontend/packages/ux-editor/src/testing/schemas/json/component/NavigationBar.schema.v1.json +++ b/frontend/packages/ux-editor/src/testing/schemas/json/component/NavigationBar.schema.v1.json @@ -1 +1,87 @@ -{"$id":"https://altinncdn.no/schemas/json/component/NavigationBar.schema.v1.json","$schema":"http://json-schema.org/draft-07/schema#","properties":{"id":{"title":"ID","description":"The component ID. Must be unique within all layouts/pages in a layout-set. Cannot end with .","type":"string","pattern":"^[0-9a-zA-Z][0-9a-zA-Z-]*(-?[a-zA-Z]+|[a-zA-Z][0-9]+|-[0-9]{6,})$"},"hidden":{"title":"Hidden","description":"Boolean value or expression indicating if the component should be hidden. Defaults to false.","default":false,"$ref":"expression.schema.v1.json#/definitions/boolean"},"grid":{"properties":{"xs":{"$ref":"#/definitions/IGridSize"},"sm":{"$ref":"#/definitions/IGridSize"},"md":{"$ref":"#/definitions/IGridSize"},"lg":{"$ref":"#/definitions/IGridSize"},"xl":{"$ref":"#/definitions/IGridSize"},"labelGrid":{"$ref":"#/definitions/IGridStyling"},"innerGrid":{"$ref":"#/definitions/IGridStyling"}}},"pageBreak":{"title":"Page break","description":"Optionally insert page-break before/after component when rendered in PDF","type":"object","properties":{"breakBefore":{"title":"Page break before","description":"PDF only: Value or expression indicating whether a page break should be added before the component. Can be either: 'auto' (default), 'always', or 'avoid'.","examples":["auto","always","avoid"],"default":"auto","$ref":"expression.schema.v1.json#/definitions/string"},"breakAfter":{"title":"Page break after","description":"PDF only: Value or expression indicating whether a page break should be added after the component. Can be either: 'auto' (default), 'always', or 'avoid'.","examples":["auto","always","avoid"],"default":"auto","$ref":"expression.schema.v1.json#/definitions/string"}},"additionalProperties":false},"type":{"const":"NavigationBar"},"compact":{"title":"Compact","description":"Change appearance of navbar as compact in desktop view","type":"boolean"},"validateOnForward":{"title":"PageValidation","type":"object","properties":{"page":{"title":"Page","description":"Which pages should be validated when the next button is clicked.","enum":["current","currentAndPrevious","all"]},"show":{"$ref":"#/definitions/AllowedValidationMasks"}},"required":["page","show"],"additionalProperties":false},"validateOnBackward":{"title":"PageValidation","type":"object","properties":{"page":{"title":"Page","description":"Which pages should be validated when the next button is clicked.","enum":["current","currentAndPrevious","all"]},"show":{"$ref":"#/definitions/AllowedValidationMasks"}},"required":["page","show"],"additionalProperties":false}},"required":["id","type"],"title":"NavigationBar component schema"} \ No newline at end of file +{ + "$id": "https://altinncdn.no/schemas/json/component/NavigationBar.schema.v1.json", + "$schema": "http://json-schema.org/draft-07/schema#", + "properties": { + "id": { + "title": "ID", + "description": "The component ID. Must be unique within all layouts/pages in a layout-set. Cannot end with .", + "type": "string", + "pattern": "^[0-9a-zA-Z][0-9a-zA-Z-]*(-?[a-zA-Z]+|[a-zA-Z][0-9]+|-[0-9]{6,})$" + }, + "hidden": { + "title": "Hidden", + "description": "Boolean value or expression indicating if the component should be hidden. Defaults to false.", + "default": false, + "$ref": "expression.schema.v1.json#/definitions/boolean" + }, + "grid": { + "properties": { + "xs": { "$ref": "#/definitions/IGridSize" }, + "sm": { "$ref": "#/definitions/IGridSize" }, + "md": { "$ref": "#/definitions/IGridSize" }, + "lg": { "$ref": "#/definitions/IGridSize" }, + "xl": { "$ref": "#/definitions/IGridSize" }, + "labelGrid": { "$ref": "#/definitions/IGridStyling" }, + "innerGrid": { "$ref": "#/definitions/IGridStyling" } + } + }, + "pageBreak": { + "title": "Page break", + "description": "Optionally insert page-break before/after component when rendered in PDF", + "type": "object", + "properties": { + "breakBefore": { + "title": "Page break before", + "description": "PDF only: Value or expression indicating whether a page break should be added before the component. Can be either: 'auto' (default), 'always', or 'avoid'.", + "examples": ["auto", "always", "avoid"], + "default": "auto", + "$ref": "expression.schema.v1.json#/definitions/string" + }, + "breakAfter": { + "title": "Page break after", + "description": "PDF only: Value or expression indicating whether a page break should be added after the component. Can be either: 'auto' (default), 'always', or 'avoid'.", + "examples": ["auto", "always", "avoid"], + "default": "auto", + "$ref": "expression.schema.v1.json#/definitions/string" + } + }, + "additionalProperties": false + }, + "type": { "const": "NavigationBar" }, + "compact": { + "title": "Compact", + "description": "Change appearance of navbar as compact in desktop view", + "type": "boolean" + }, + "validateOnForward": { + "title": "PageValidation", + "type": "object", + "properties": { + "page": { + "title": "Page", + "description": "Which pages should be validated when the next button is clicked.", + "enum": ["current", "currentAndPrevious", "all"] + }, + "show": { "$ref": "#/definitions/AllowedValidationMasks" } + }, + "required": ["page", "show"], + "additionalProperties": false + }, + "validateOnBackward": { + "title": "PageValidation", + "type": "object", + "properties": { + "page": { + "title": "Page", + "description": "Which pages should be validated when the next button is clicked.", + "enum": ["current", "currentAndPrevious", "all"] + }, + "show": { "$ref": "#/definitions/AllowedValidationMasks" } + }, + "required": ["page", "show"], + "additionalProperties": false + } + }, + "required": ["id", "type"], + "title": "NavigationBar component schema" +} diff --git a/frontend/packages/ux-editor/src/testing/schemas/json/component/NavigationButtons.schema.v1.json b/frontend/packages/ux-editor/src/testing/schemas/json/component/NavigationButtons.schema.v1.json index 4ec81acd177..0d91ddae873 100644 --- a/frontend/packages/ux-editor/src/testing/schemas/json/component/NavigationButtons.schema.v1.json +++ b/frontend/packages/ux-editor/src/testing/schemas/json/component/NavigationButtons.schema.v1.json @@ -1 +1,104 @@ -{"$id":"https://altinncdn.no/schemas/json/component/NavigationButtons.schema.v1.json","$schema":"http://json-schema.org/draft-07/schema#","properties":{"id":{"title":"ID","description":"The component ID. Must be unique within all layouts/pages in a layout-set. Cannot end with .","type":"string","pattern":"^[0-9a-zA-Z][0-9a-zA-Z-]*(-?[a-zA-Z]+|[a-zA-Z][0-9]+|-[0-9]{6,})$"},"hidden":{"title":"Hidden","description":"Boolean value or expression indicating if the component should be hidden. Defaults to false.","default":false,"$ref":"expression.schema.v1.json#/definitions/boolean"},"grid":{"properties":{"xs":{"$ref":"#/definitions/IGridSize"},"sm":{"$ref":"#/definitions/IGridSize"},"md":{"$ref":"#/definitions/IGridSize"},"lg":{"$ref":"#/definitions/IGridSize"},"xl":{"$ref":"#/definitions/IGridSize"},"labelGrid":{"$ref":"#/definitions/IGridStyling"},"innerGrid":{"$ref":"#/definitions/IGridStyling"}}},"pageBreak":{"title":"Page break","description":"Optionally insert page-break before/after component when rendered in PDF","type":"object","properties":{"breakBefore":{"title":"Page break before","description":"PDF only: Value or expression indicating whether a page break should be added before the component. Can be either: 'auto' (default), 'always', or 'avoid'.","examples":["auto","always","avoid"],"default":"auto","$ref":"expression.schema.v1.json#/definitions/string"},"breakAfter":{"title":"Page break after","description":"PDF only: Value or expression indicating whether a page break should be added after the component. Can be either: 'auto' (default), 'always', or 'avoid'.","examples":["auto","always","avoid"],"default":"auto","$ref":"expression.schema.v1.json#/definitions/string"}},"additionalProperties":false},"type":{"const":"NavigationButtons"},"textResourceBindings":{"type":"object","properties":{"back":{"title":"Back","description":"Text on the back/previous page button","$ref":"expression.schema.v1.json#/definitions/string"},"next":{"title":"Next","description":"Text on the next page button","$ref":"expression.schema.v1.json#/definitions/string"}},"additionalProperties":false},"showBackButton":{"title":"Show back button","description":"Shows two buttons (back/next) instead of just 'next'.","default":false,"type":"boolean"},"validateOnNext":{"title":"PageValidation","type":"object","properties":{"page":{"title":"Page","description":"Which pages should be validated when the next button is clicked.","enum":["current","currentAndPrevious","all"]},"show":{"$ref":"#/definitions/AllowedValidationMasks"}},"required":["page","show"],"additionalProperties":false},"validateOnPrevious":{"title":"PageValidation","type":"object","properties":{"page":{"title":"Page","description":"Which pages should be validated when the next button is clicked.","enum":["current","currentAndPrevious","all"]},"show":{"$ref":"#/definitions/AllowedValidationMasks"}},"required":["page","show"],"additionalProperties":false}},"required":["id","type"],"title":"NavigationButtons component schema"} \ No newline at end of file +{ + "$id": "https://altinncdn.no/schemas/json/component/NavigationButtons.schema.v1.json", + "$schema": "http://json-schema.org/draft-07/schema#", + "properties": { + "id": { + "title": "ID", + "description": "The component ID. Must be unique within all layouts/pages in a layout-set. Cannot end with .", + "type": "string", + "pattern": "^[0-9a-zA-Z][0-9a-zA-Z-]*(-?[a-zA-Z]+|[a-zA-Z][0-9]+|-[0-9]{6,})$" + }, + "hidden": { + "title": "Hidden", + "description": "Boolean value or expression indicating if the component should be hidden. Defaults to false.", + "default": false, + "$ref": "expression.schema.v1.json#/definitions/boolean" + }, + "grid": { + "properties": { + "xs": { "$ref": "#/definitions/IGridSize" }, + "sm": { "$ref": "#/definitions/IGridSize" }, + "md": { "$ref": "#/definitions/IGridSize" }, + "lg": { "$ref": "#/definitions/IGridSize" }, + "xl": { "$ref": "#/definitions/IGridSize" }, + "labelGrid": { "$ref": "#/definitions/IGridStyling" }, + "innerGrid": { "$ref": "#/definitions/IGridStyling" } + } + }, + "pageBreak": { + "title": "Page break", + "description": "Optionally insert page-break before/after component when rendered in PDF", + "type": "object", + "properties": { + "breakBefore": { + "title": "Page break before", + "description": "PDF only: Value or expression indicating whether a page break should be added before the component. Can be either: 'auto' (default), 'always', or 'avoid'.", + "examples": ["auto", "always", "avoid"], + "default": "auto", + "$ref": "expression.schema.v1.json#/definitions/string" + }, + "breakAfter": { + "title": "Page break after", + "description": "PDF only: Value or expression indicating whether a page break should be added after the component. Can be either: 'auto' (default), 'always', or 'avoid'.", + "examples": ["auto", "always", "avoid"], + "default": "auto", + "$ref": "expression.schema.v1.json#/definitions/string" + } + }, + "additionalProperties": false + }, + "type": { "const": "NavigationButtons" }, + "textResourceBindings": { + "type": "object", + "properties": { + "back": { + "title": "Back", + "description": "Text on the back/previous page button", + "$ref": "expression.schema.v1.json#/definitions/string" + }, + "next": { + "title": "Next", + "description": "Text on the next page button", + "$ref": "expression.schema.v1.json#/definitions/string" + } + }, + "additionalProperties": false + }, + "showBackButton": { + "title": "Show back button", + "description": "Shows two buttons (back/next) instead of just 'next'.", + "default": false, + "type": "boolean" + }, + "validateOnNext": { + "title": "PageValidation", + "type": "object", + "properties": { + "page": { + "title": "Page", + "description": "Which pages should be validated when the next button is clicked.", + "enum": ["current", "currentAndPrevious", "all"] + }, + "show": { "$ref": "#/definitions/AllowedValidationMasks" } + }, + "required": ["page", "show"], + "additionalProperties": false + }, + "validateOnPrevious": { + "title": "PageValidation", + "type": "object", + "properties": { + "page": { + "title": "Page", + "description": "Which pages should be validated when the next button is clicked.", + "enum": ["current", "currentAndPrevious", "all"] + }, + "show": { "$ref": "#/definitions/AllowedValidationMasks" } + }, + "required": ["page", "show"], + "additionalProperties": false + } + }, + "required": ["id", "type"], + "title": "NavigationButtons component schema" +} diff --git a/frontend/packages/ux-editor/src/testing/schemas/json/component/Number.schema.v1.json b/frontend/packages/ux-editor/src/testing/schemas/json/component/Number.schema.v1.json index 6f8a17153ba..9b9aa0d221c 100644 --- a/frontend/packages/ux-editor/src/testing/schemas/json/component/Number.schema.v1.json +++ b/frontend/packages/ux-editor/src/testing/schemas/json/component/Number.schema.v1.json @@ -1 +1,312 @@ -{"$id":"https://altinncdn.no/schemas/json/component/Number.schema.v1.json","$schema":"http://json-schema.org/draft-07/schema#","properties":{"id":{"title":"ID","description":"The component ID. Must be unique within all layouts/pages in a layout-set. Cannot end with .","type":"string","pattern":"^[0-9a-zA-Z][0-9a-zA-Z-]*(-?[a-zA-Z]+|[a-zA-Z][0-9]+|-[0-9]{6,})$"},"hidden":{"title":"Hidden","description":"Boolean value or expression indicating if the component should be hidden. Defaults to false.","default":false,"$ref":"expression.schema.v1.json#/definitions/boolean"},"grid":{"properties":{"xs":{"$ref":"#/definitions/IGridSize"},"sm":{"$ref":"#/definitions/IGridSize"},"md":{"$ref":"#/definitions/IGridSize"},"lg":{"$ref":"#/definitions/IGridSize"},"xl":{"$ref":"#/definitions/IGridSize"},"labelGrid":{"$ref":"#/definitions/IGridStyling"},"innerGrid":{"$ref":"#/definitions/IGridStyling"}}},"pageBreak":{"title":"Page break","description":"Optionally insert page-break before/after component when rendered in PDF","type":"object","properties":{"breakBefore":{"title":"Page break before","description":"PDF only: Value or expression indicating whether a page break should be added before the component. Can be either: 'auto' (default), 'always', or 'avoid'.","examples":["auto","always","avoid"],"default":"auto","$ref":"expression.schema.v1.json#/definitions/string"},"breakAfter":{"title":"Page break after","description":"PDF only: Value or expression indicating whether a page break should be added after the component. Can be either: 'auto' (default), 'always', or 'avoid'.","examples":["auto","always","avoid"],"default":"auto","$ref":"expression.schema.v1.json#/definitions/string"}},"additionalProperties":false},"type":{"const":"Number"},"textResourceBindings":{"title":"TRBLabel","type":"object","properties":{"title":{"title":"Title","description":"Label text/title shown above the component","$ref":"expression.schema.v1.json#/definitions/string"},"description":{"title":"Description","description":"Label description shown above the component, below the title","$ref":"expression.schema.v1.json#/definitions/string"},"help":{"title":"Help text","description":"Help text shown in a tooltip when clicking the help button","$ref":"expression.schema.v1.json#/definitions/string"}}},"formatting":{"title":"IFormatting","examples":[{"currency":"NOK"},{"number":{"thousandSeparator":" ","decimalSeparator":",","allowNegative":false,"suffix":" kr"}}],"type":"object","properties":{"currency":{"title":"Language-sensitive currency formatting","description":"Enables currency to be language sensitive based on selected app language. Note: parts that already exist in number property are not overridden by this prop.","enum":["AED","AFN","ALL","AMD","ANG","AOA","ARS","AUD","AWG","AZN","BAM","BBD","BDT","BGN","BHD","BIF","BMD","BND","BOB","BOV","BRL","BSD","BTN","BWP","BYN","BZD","CAD","CDF","CHE","CHF","CHW","CLF","CLP","CNY","COP","COU","CRC","CUC","CUP","CVE","CZK","DJF","DKK","DOP","DZD","EGP","ERN","ETB","EUR","FJD","FKP","GBP","GEL","GHS","GIP","GMD","GNF","GTQ","GYD","HKD","HNL","HTG","HUF","IDR","ILS","INR","IQD","IRR","ISK","JMD","JOD","JPY","KES","KGS","KHR","KMF","KPW","KRW","KWD","KYD","KZT","LAK","LBP","LKR","LRD","LSL","LYD","MAD","MDL","MGA","MKD","MMK","MNT","MOP","MRU","MUR","MVR","MWK","MXN","MXV","MYR","MZN","NAD","NGN","NIO","NOK","NPR","NZD","OMR","PAB","PEN","PGK","PHP","PKR","PLN","PYG","QAR","RON","RSD","RUB","RWF","SAR","SBD","SCR","SDG","SEK","SGD","SHP","SLE","SLL","SOS","SRD","SSP","STN","SVC","SYP","SZL","THB","TJS","TMT","TND","TOP","TRY","TTD","TWD","TZS","UAH","UGX","USD","USN","UYI","UYU","UYW","UZS","VED","VES","VND","VUV","WST","XAF","XCD","XDR","XOF","XPF","XSU","XUA","YER","ZAR","ZMW","ZWL"]},"unit":{"title":"Language-sensitive number formatting based on unit","description":"Enables unit along with thousand and decimal separators to be language sensitive based on selected app language. They are configured in number property. Note: parts that already exist in number property are not overridden by this prop.","enum":["celsius","centimeter","day","degree","foot","gram","hectare","hour","inch","kilogram","kilometer","liter","meter","milliliter","millimeter","millisecond","minute","month","percent","second","week","year"]},"position":{"title":"Position of the currency/unit symbol","description":"Display the unit as prefix or suffix. Default is prefix. (Use only when using currency or unit options)","enum":["prefix","suffix"]},"number":{"anyOf":[{"$ref":"#/definitions/PatternFormatProps"},{"$ref":"#/definitions/NumberFormatProps"}]},"align":{"default":"left","enum":["right","center","left"]}},"additionalProperties":false},"value":{"$ref":"expression.schema.v1.json#/definitions/number"},"direction":{"default":"horizontal","enum":["horizontal","vertical"],"type":"string"},"icon":{"examples":["https://example.com/icon.svg"],"type":"string"}},"required":["id","type","value"],"title":"Number component schema"} \ No newline at end of file +{ + "$id": "https://altinncdn.no/schemas/json/component/Number.schema.v1.json", + "$schema": "http://json-schema.org/draft-07/schema#", + "properties": { + "id": { + "title": "ID", + "description": "The component ID. Must be unique within all layouts/pages in a layout-set. Cannot end with .", + "type": "string", + "pattern": "^[0-9a-zA-Z][0-9a-zA-Z-]*(-?[a-zA-Z]+|[a-zA-Z][0-9]+|-[0-9]{6,})$" + }, + "hidden": { + "title": "Hidden", + "description": "Boolean value or expression indicating if the component should be hidden. Defaults to false.", + "default": false, + "$ref": "expression.schema.v1.json#/definitions/boolean" + }, + "grid": { + "properties": { + "xs": { "$ref": "#/definitions/IGridSize" }, + "sm": { "$ref": "#/definitions/IGridSize" }, + "md": { "$ref": "#/definitions/IGridSize" }, + "lg": { "$ref": "#/definitions/IGridSize" }, + "xl": { "$ref": "#/definitions/IGridSize" }, + "labelGrid": { "$ref": "#/definitions/IGridStyling" }, + "innerGrid": { "$ref": "#/definitions/IGridStyling" } + } + }, + "pageBreak": { + "title": "Page break", + "description": "Optionally insert page-break before/after component when rendered in PDF", + "type": "object", + "properties": { + "breakBefore": { + "title": "Page break before", + "description": "PDF only: Value or expression indicating whether a page break should be added before the component. Can be either: 'auto' (default), 'always', or 'avoid'.", + "examples": ["auto", "always", "avoid"], + "default": "auto", + "$ref": "expression.schema.v1.json#/definitions/string" + }, + "breakAfter": { + "title": "Page break after", + "description": "PDF only: Value or expression indicating whether a page break should be added after the component. Can be either: 'auto' (default), 'always', or 'avoid'.", + "examples": ["auto", "always", "avoid"], + "default": "auto", + "$ref": "expression.schema.v1.json#/definitions/string" + } + }, + "additionalProperties": false + }, + "type": { "const": "Number" }, + "textResourceBindings": { + "title": "TRBLabel", + "type": "object", + "properties": { + "title": { + "title": "Title", + "description": "Label text/title shown above the component", + "$ref": "expression.schema.v1.json#/definitions/string" + }, + "description": { + "title": "Description", + "description": "Label description shown above the component, below the title", + "$ref": "expression.schema.v1.json#/definitions/string" + }, + "help": { + "title": "Help text", + "description": "Help text shown in a tooltip when clicking the help button", + "$ref": "expression.schema.v1.json#/definitions/string" + } + } + }, + "formatting": { + "title": "IFormatting", + "examples": [ + { "currency": "NOK" }, + { + "number": { + "thousandSeparator": " ", + "decimalSeparator": ",", + "allowNegative": false, + "suffix": " kr" + } + } + ], + "type": "object", + "properties": { + "currency": { + "title": "Language-sensitive currency formatting", + "description": "Enables currency to be language sensitive based on selected app language. Note: parts that already exist in number property are not overridden by this prop.", + "enum": [ + "AED", + "AFN", + "ALL", + "AMD", + "ANG", + "AOA", + "ARS", + "AUD", + "AWG", + "AZN", + "BAM", + "BBD", + "BDT", + "BGN", + "BHD", + "BIF", + "BMD", + "BND", + "BOB", + "BOV", + "BRL", + "BSD", + "BTN", + "BWP", + "BYN", + "BZD", + "CAD", + "CDF", + "CHE", + "CHF", + "CHW", + "CLF", + "CLP", + "CNY", + "COP", + "COU", + "CRC", + "CUC", + "CUP", + "CVE", + "CZK", + "DJF", + "DKK", + "DOP", + "DZD", + "EGP", + "ERN", + "ETB", + "EUR", + "FJD", + "FKP", + "GBP", + "GEL", + "GHS", + "GIP", + "GMD", + "GNF", + "GTQ", + "GYD", + "HKD", + "HNL", + "HTG", + "HUF", + "IDR", + "ILS", + "INR", + "IQD", + "IRR", + "ISK", + "JMD", + "JOD", + "JPY", + "KES", + "KGS", + "KHR", + "KMF", + "KPW", + "KRW", + "KWD", + "KYD", + "KZT", + "LAK", + "LBP", + "LKR", + "LRD", + "LSL", + "LYD", + "MAD", + "MDL", + "MGA", + "MKD", + "MMK", + "MNT", + "MOP", + "MRU", + "MUR", + "MVR", + "MWK", + "MXN", + "MXV", + "MYR", + "MZN", + "NAD", + "NGN", + "NIO", + "NOK", + "NPR", + "NZD", + "OMR", + "PAB", + "PEN", + "PGK", + "PHP", + "PKR", + "PLN", + "PYG", + "QAR", + "RON", + "RSD", + "RUB", + "RWF", + "SAR", + "SBD", + "SCR", + "SDG", + "SEK", + "SGD", + "SHP", + "SLE", + "SLL", + "SOS", + "SRD", + "SSP", + "STN", + "SVC", + "SYP", + "SZL", + "THB", + "TJS", + "TMT", + "TND", + "TOP", + "TRY", + "TTD", + "TWD", + "TZS", + "UAH", + "UGX", + "USD", + "USN", + "UYI", + "UYU", + "UYW", + "UZS", + "VED", + "VES", + "VND", + "VUV", + "WST", + "XAF", + "XCD", + "XDR", + "XOF", + "XPF", + "XSU", + "XUA", + "YER", + "ZAR", + "ZMW", + "ZWL" + ] + }, + "unit": { + "title": "Language-sensitive number formatting based on unit", + "description": "Enables unit along with thousand and decimal separators to be language sensitive based on selected app language. They are configured in number property. Note: parts that already exist in number property are not overridden by this prop.", + "enum": [ + "celsius", + "centimeter", + "day", + "degree", + "foot", + "gram", + "hectare", + "hour", + "inch", + "kilogram", + "kilometer", + "liter", + "meter", + "milliliter", + "millimeter", + "millisecond", + "minute", + "month", + "percent", + "second", + "week", + "year" + ] + }, + "position": { + "title": "Position of the currency/unit symbol", + "description": "Display the unit as prefix or suffix. Default is prefix. (Use only when using currency or unit options)", + "enum": ["prefix", "suffix"] + }, + "number": { + "anyOf": [ + { "$ref": "#/definitions/PatternFormatProps" }, + { "$ref": "#/definitions/NumberFormatProps" } + ] + }, + "align": { "default": "left", "enum": ["right", "center", "left"] } + }, + "additionalProperties": false + }, + "value": { "$ref": "expression.schema.v1.json#/definitions/number" }, + "direction": { "default": "horizontal", "enum": ["horizontal", "vertical"], "type": "string" }, + "icon": { "examples": ["https://example.com/icon.svg"], "type": "string" } + }, + "required": ["id", "type", "value"], + "title": "Number component schema" +} diff --git a/frontend/packages/ux-editor/src/testing/schemas/json/component/Panel.schema.v1.json b/frontend/packages/ux-editor/src/testing/schemas/json/component/Panel.schema.v1.json index 0733b1d1577..71b44c85004 100644 --- a/frontend/packages/ux-editor/src/testing/schemas/json/component/Panel.schema.v1.json +++ b/frontend/packages/ux-editor/src/testing/schemas/json/component/Panel.schema.v1.json @@ -1 +1,82 @@ -{"$id":"https://altinncdn.no/schemas/json/component/Panel.schema.v1.json","$schema":"http://json-schema.org/draft-07/schema#","properties":{"id":{"title":"ID","description":"The component ID. Must be unique within all layouts/pages in a layout-set. Cannot end with .","type":"string","pattern":"^[0-9a-zA-Z][0-9a-zA-Z-]*(-?[a-zA-Z]+|[a-zA-Z][0-9]+|-[0-9]{6,})$"},"hidden":{"title":"Hidden","description":"Boolean value or expression indicating if the component should be hidden. Defaults to false.","default":false,"$ref":"expression.schema.v1.json#/definitions/boolean"},"grid":{"properties":{"xs":{"$ref":"#/definitions/IGridSize"},"sm":{"$ref":"#/definitions/IGridSize"},"md":{"$ref":"#/definitions/IGridSize"},"lg":{"$ref":"#/definitions/IGridSize"},"xl":{"$ref":"#/definitions/IGridSize"},"labelGrid":{"$ref":"#/definitions/IGridStyling"},"innerGrid":{"$ref":"#/definitions/IGridStyling"}}},"pageBreak":{"title":"Page break","description":"Optionally insert page-break before/after component when rendered in PDF","type":"object","properties":{"breakBefore":{"title":"Page break before","description":"PDF only: Value or expression indicating whether a page break should be added before the component. Can be either: 'auto' (default), 'always', or 'avoid'.","examples":["auto","always","avoid"],"default":"auto","$ref":"expression.schema.v1.json#/definitions/string"},"breakAfter":{"title":"Page break after","description":"PDF only: Value or expression indicating whether a page break should be added after the component. Can be either: 'auto' (default), 'always', or 'avoid'.","examples":["auto","always","avoid"],"default":"auto","$ref":"expression.schema.v1.json#/definitions/string"}},"additionalProperties":false},"variant":{"title":"Panel variant","description":"Change the look of the panel","enum":["info","warning","error","success"],"type":"string"},"showIcon":{"title":"Show icon","description":"Show icon in the panel header","default":true,"type":"boolean"},"type":{"const":"Panel"},"textResourceBindings":{"type":"object","properties":{"title":{"title":"Title","description":"Header/title of the panel","$ref":"expression.schema.v1.json#/definitions/string"},"body":{"title":"Body","description":"Body of the panel","$ref":"expression.schema.v1.json#/definitions/string"}},"additionalProperties":false}},"required":["id","type"],"title":"Panel component schema"} \ No newline at end of file +{ + "$id": "https://altinncdn.no/schemas/json/component/Panel.schema.v1.json", + "$schema": "http://json-schema.org/draft-07/schema#", + "properties": { + "id": { + "title": "ID", + "description": "The component ID. Must be unique within all layouts/pages in a layout-set. Cannot end with .", + "type": "string", + "pattern": "^[0-9a-zA-Z][0-9a-zA-Z-]*(-?[a-zA-Z]+|[a-zA-Z][0-9]+|-[0-9]{6,})$" + }, + "hidden": { + "title": "Hidden", + "description": "Boolean value or expression indicating if the component should be hidden. Defaults to false.", + "default": false, + "$ref": "expression.schema.v1.json#/definitions/boolean" + }, + "grid": { + "properties": { + "xs": { "$ref": "#/definitions/IGridSize" }, + "sm": { "$ref": "#/definitions/IGridSize" }, + "md": { "$ref": "#/definitions/IGridSize" }, + "lg": { "$ref": "#/definitions/IGridSize" }, + "xl": { "$ref": "#/definitions/IGridSize" }, + "labelGrid": { "$ref": "#/definitions/IGridStyling" }, + "innerGrid": { "$ref": "#/definitions/IGridStyling" } + } + }, + "pageBreak": { + "title": "Page break", + "description": "Optionally insert page-break before/after component when rendered in PDF", + "type": "object", + "properties": { + "breakBefore": { + "title": "Page break before", + "description": "PDF only: Value or expression indicating whether a page break should be added before the component. Can be either: 'auto' (default), 'always', or 'avoid'.", + "examples": ["auto", "always", "avoid"], + "default": "auto", + "$ref": "expression.schema.v1.json#/definitions/string" + }, + "breakAfter": { + "title": "Page break after", + "description": "PDF only: Value or expression indicating whether a page break should be added after the component. Can be either: 'auto' (default), 'always', or 'avoid'.", + "examples": ["auto", "always", "avoid"], + "default": "auto", + "$ref": "expression.schema.v1.json#/definitions/string" + } + }, + "additionalProperties": false + }, + "variant": { + "title": "Panel variant", + "description": "Change the look of the panel", + "enum": ["info", "warning", "error", "success"], + "type": "string" + }, + "showIcon": { + "title": "Show icon", + "description": "Show icon in the panel header", + "default": true, + "type": "boolean" + }, + "type": { "const": "Panel" }, + "textResourceBindings": { + "type": "object", + "properties": { + "title": { + "title": "Title", + "description": "Header/title of the panel", + "$ref": "expression.schema.v1.json#/definitions/string" + }, + "body": { + "title": "Body", + "description": "Body of the panel", + "$ref": "expression.schema.v1.json#/definitions/string" + } + }, + "additionalProperties": false + } + }, + "required": ["id", "type"], + "title": "Panel component schema" +} diff --git a/frontend/packages/ux-editor/src/testing/schemas/json/component/Paragraph.schema.v1.json b/frontend/packages/ux-editor/src/testing/schemas/json/component/Paragraph.schema.v1.json index 33eb19bc036..ffa5c4ab13b 100644 --- a/frontend/packages/ux-editor/src/testing/schemas/json/component/Paragraph.schema.v1.json +++ b/frontend/packages/ux-editor/src/testing/schemas/json/component/Paragraph.schema.v1.json @@ -1 +1,70 @@ -{"$id":"https://altinncdn.no/schemas/json/component/Paragraph.schema.v1.json","$schema":"http://json-schema.org/draft-07/schema#","properties":{"id":{"title":"ID","description":"The component ID. Must be unique within all layouts/pages in a layout-set. Cannot end with .","type":"string","pattern":"^[0-9a-zA-Z][0-9a-zA-Z-]*(-?[a-zA-Z]+|[a-zA-Z][0-9]+|-[0-9]{6,})$"},"hidden":{"title":"Hidden","description":"Boolean value or expression indicating if the component should be hidden. Defaults to false.","default":false,"$ref":"expression.schema.v1.json#/definitions/boolean"},"grid":{"properties":{"xs":{"$ref":"#/definitions/IGridSize"},"sm":{"$ref":"#/definitions/IGridSize"},"md":{"$ref":"#/definitions/IGridSize"},"lg":{"$ref":"#/definitions/IGridSize"},"xl":{"$ref":"#/definitions/IGridSize"},"labelGrid":{"$ref":"#/definitions/IGridStyling"},"innerGrid":{"$ref":"#/definitions/IGridStyling"}}},"pageBreak":{"title":"Page break","description":"Optionally insert page-break before/after component when rendered in PDF","type":"object","properties":{"breakBefore":{"title":"Page break before","description":"PDF only: Value or expression indicating whether a page break should be added before the component. Can be either: 'auto' (default), 'always', or 'avoid'.","examples":["auto","always","avoid"],"default":"auto","$ref":"expression.schema.v1.json#/definitions/string"},"breakAfter":{"title":"Page break after","description":"PDF only: Value or expression indicating whether a page break should be added after the component. Can be either: 'auto' (default), 'always', or 'avoid'.","examples":["auto","always","avoid"],"default":"auto","$ref":"expression.schema.v1.json#/definitions/string"}},"additionalProperties":false},"type":{"const":"Paragraph"},"textResourceBindings":{"type":"object","properties":{"title":{"title":"Title","description":"The title of the paragraph","$ref":"expression.schema.v1.json#/definitions/string"},"help":{"title":"Help text","description":"Help text, optionally shown in a tooltip","$ref":"expression.schema.v1.json#/definitions/string"}},"additionalProperties":false}},"required":["id","type"],"title":"Paragraph component schema"} \ No newline at end of file +{ + "$id": "https://altinncdn.no/schemas/json/component/Paragraph.schema.v1.json", + "$schema": "http://json-schema.org/draft-07/schema#", + "properties": { + "id": { + "title": "ID", + "description": "The component ID. Must be unique within all layouts/pages in a layout-set. Cannot end with .", + "type": "string", + "pattern": "^[0-9a-zA-Z][0-9a-zA-Z-]*(-?[a-zA-Z]+|[a-zA-Z][0-9]+|-[0-9]{6,})$" + }, + "hidden": { + "title": "Hidden", + "description": "Boolean value or expression indicating if the component should be hidden. Defaults to false.", + "default": false, + "$ref": "expression.schema.v1.json#/definitions/boolean" + }, + "grid": { + "properties": { + "xs": { "$ref": "#/definitions/IGridSize" }, + "sm": { "$ref": "#/definitions/IGridSize" }, + "md": { "$ref": "#/definitions/IGridSize" }, + "lg": { "$ref": "#/definitions/IGridSize" }, + "xl": { "$ref": "#/definitions/IGridSize" }, + "labelGrid": { "$ref": "#/definitions/IGridStyling" }, + "innerGrid": { "$ref": "#/definitions/IGridStyling" } + } + }, + "pageBreak": { + "title": "Page break", + "description": "Optionally insert page-break before/after component when rendered in PDF", + "type": "object", + "properties": { + "breakBefore": { + "title": "Page break before", + "description": "PDF only: Value or expression indicating whether a page break should be added before the component. Can be either: 'auto' (default), 'always', or 'avoid'.", + "examples": ["auto", "always", "avoid"], + "default": "auto", + "$ref": "expression.schema.v1.json#/definitions/string" + }, + "breakAfter": { + "title": "Page break after", + "description": "PDF only: Value or expression indicating whether a page break should be added after the component. Can be either: 'auto' (default), 'always', or 'avoid'.", + "examples": ["auto", "always", "avoid"], + "default": "auto", + "$ref": "expression.schema.v1.json#/definitions/string" + } + }, + "additionalProperties": false + }, + "type": { "const": "Paragraph" }, + "textResourceBindings": { + "type": "object", + "properties": { + "title": { + "title": "Title", + "description": "The title of the paragraph", + "$ref": "expression.schema.v1.json#/definitions/string" + }, + "help": { + "title": "Help text", + "description": "Help text, optionally shown in a tooltip", + "$ref": "expression.schema.v1.json#/definitions/string" + } + }, + "additionalProperties": false + } + }, + "required": ["id", "type"], + "title": "Paragraph component schema" +} diff --git a/frontend/packages/ux-editor/src/testing/schemas/json/component/Payment.schema.v1.json b/frontend/packages/ux-editor/src/testing/schemas/json/component/Payment.schema.v1.json index 3c631c61c4b..a64d52f76c8 100644 --- a/frontend/packages/ux-editor/src/testing/schemas/json/component/Payment.schema.v1.json +++ b/frontend/packages/ux-editor/src/testing/schemas/json/component/Payment.schema.v1.json @@ -1 +1,82 @@ -{"$id":"https://altinncdn.no/schemas/json/component/Payment.schema.v1.json","$schema":"http://json-schema.org/draft-07/schema#","properties":{"id":{"title":"ID","description":"The component ID. Must be unique within all layouts/pages in a layout-set. Cannot end with .","type":"string","pattern":"^[0-9a-zA-Z][0-9a-zA-Z-]*(-?[a-zA-Z]+|[a-zA-Z][0-9]+|-[0-9]{6,})$"},"hidden":{"title":"Hidden","description":"Boolean value or expression indicating if the component should be hidden. Defaults to false.","default":false,"$ref":"expression.schema.v1.json#/definitions/boolean"},"grid":{"properties":{"xs":{"$ref":"#/definitions/IGridSize"},"sm":{"$ref":"#/definitions/IGridSize"},"md":{"$ref":"#/definitions/IGridSize"},"lg":{"$ref":"#/definitions/IGridSize"},"xl":{"$ref":"#/definitions/IGridSize"},"labelGrid":{"$ref":"#/definitions/IGridStyling"},"innerGrid":{"$ref":"#/definitions/IGridStyling"}}},"pageBreak":{"title":"Page break","description":"Optionally insert page-break before/after component when rendered in PDF","type":"object","properties":{"breakBefore":{"title":"Page break before","description":"PDF only: Value or expression indicating whether a page break should be added before the component. Can be either: 'auto' (default), 'always', or 'avoid'.","examples":["auto","always","avoid"],"default":"auto","$ref":"expression.schema.v1.json#/definitions/string"},"breakAfter":{"title":"Page break after","description":"PDF only: Value or expression indicating whether a page break should be added after the component. Can be either: 'auto' (default), 'always', or 'avoid'.","examples":["auto","always","avoid"],"default":"auto","$ref":"expression.schema.v1.json#/definitions/string"}},"additionalProperties":false},"renderAsSummary":{"title":"Render as summary","description":"Boolean value indicating if the component should be rendered as a summary. Defaults to false.","default":false,"type":"boolean"},"forceShowInSummary":{"title":"Force show in summary","description":"Will force show the component in a summary even if hideEmptyFields is set to true in the summary component.","default":false,"$ref":"expression.schema.v1.json#/definitions/boolean"},"type":{"const":"Payment"},"textResourceBindings":{"type":"object","properties":{"title":{"title":"Title","description":"The title of the paragraph","$ref":"expression.schema.v1.json#/definitions/string"},"description":{"title":"Description","description":"Description, optionally shown below the title","$ref":"expression.schema.v1.json#/definitions/string"}},"additionalProperties":false}},"required":["id","type"],"title":"Payment component schema"} \ No newline at end of file +{ + "$id": "https://altinncdn.no/schemas/json/component/Payment.schema.v1.json", + "$schema": "http://json-schema.org/draft-07/schema#", + "properties": { + "id": { + "title": "ID", + "description": "The component ID. Must be unique within all layouts/pages in a layout-set. Cannot end with .", + "type": "string", + "pattern": "^[0-9a-zA-Z][0-9a-zA-Z-]*(-?[a-zA-Z]+|[a-zA-Z][0-9]+|-[0-9]{6,})$" + }, + "hidden": { + "title": "Hidden", + "description": "Boolean value or expression indicating if the component should be hidden. Defaults to false.", + "default": false, + "$ref": "expression.schema.v1.json#/definitions/boolean" + }, + "grid": { + "properties": { + "xs": { "$ref": "#/definitions/IGridSize" }, + "sm": { "$ref": "#/definitions/IGridSize" }, + "md": { "$ref": "#/definitions/IGridSize" }, + "lg": { "$ref": "#/definitions/IGridSize" }, + "xl": { "$ref": "#/definitions/IGridSize" }, + "labelGrid": { "$ref": "#/definitions/IGridStyling" }, + "innerGrid": { "$ref": "#/definitions/IGridStyling" } + } + }, + "pageBreak": { + "title": "Page break", + "description": "Optionally insert page-break before/after component when rendered in PDF", + "type": "object", + "properties": { + "breakBefore": { + "title": "Page break before", + "description": "PDF only: Value or expression indicating whether a page break should be added before the component. Can be either: 'auto' (default), 'always', or 'avoid'.", + "examples": ["auto", "always", "avoid"], + "default": "auto", + "$ref": "expression.schema.v1.json#/definitions/string" + }, + "breakAfter": { + "title": "Page break after", + "description": "PDF only: Value or expression indicating whether a page break should be added after the component. Can be either: 'auto' (default), 'always', or 'avoid'.", + "examples": ["auto", "always", "avoid"], + "default": "auto", + "$ref": "expression.schema.v1.json#/definitions/string" + } + }, + "additionalProperties": false + }, + "renderAsSummary": { + "title": "Render as summary", + "description": "Boolean value indicating if the component should be rendered as a summary. Defaults to false.", + "default": false, + "type": "boolean" + }, + "forceShowInSummary": { + "title": "Force show in summary", + "description": "Will force show the component in a summary even if hideEmptyFields is set to true in the summary component.", + "default": false, + "$ref": "expression.schema.v1.json#/definitions/boolean" + }, + "type": { "const": "Payment" }, + "textResourceBindings": { + "type": "object", + "properties": { + "title": { + "title": "Title", + "description": "The title of the paragraph", + "$ref": "expression.schema.v1.json#/definitions/string" + }, + "description": { + "title": "Description", + "description": "Description, optionally shown below the title", + "$ref": "expression.schema.v1.json#/definitions/string" + } + }, + "additionalProperties": false + } + }, + "required": ["id", "type"], + "title": "Payment component schema" +} diff --git a/frontend/packages/ux-editor/src/testing/schemas/json/component/PaymentDetails.schema.v1.json b/frontend/packages/ux-editor/src/testing/schemas/json/component/PaymentDetails.schema.v1.json index 55b0a6d879d..0ad2bdb54a8 100644 --- a/frontend/packages/ux-editor/src/testing/schemas/json/component/PaymentDetails.schema.v1.json +++ b/frontend/packages/ux-editor/src/testing/schemas/json/component/PaymentDetails.schema.v1.json @@ -1 +1,77 @@ -{"$id":"https://altinncdn.no/schemas/json/component/PaymentDetails.schema.v1.json","$schema":"http://json-schema.org/draft-07/schema#","properties":{"id":{"title":"ID","description":"The component ID. Must be unique within all layouts/pages in a layout-set. Cannot end with .","type":"string","pattern":"^[0-9a-zA-Z][0-9a-zA-Z-]*(-?[a-zA-Z]+|[a-zA-Z][0-9]+|-[0-9]{6,})$"},"hidden":{"title":"Hidden","description":"Boolean value or expression indicating if the component should be hidden. Defaults to false.","default":false,"$ref":"expression.schema.v1.json#/definitions/boolean"},"grid":{"properties":{"xs":{"$ref":"#/definitions/IGridSize"},"sm":{"$ref":"#/definitions/IGridSize"},"md":{"$ref":"#/definitions/IGridSize"},"lg":{"$ref":"#/definitions/IGridSize"},"xl":{"$ref":"#/definitions/IGridSize"},"labelGrid":{"$ref":"#/definitions/IGridStyling"},"innerGrid":{"$ref":"#/definitions/IGridStyling"}}},"pageBreak":{"title":"Page break","description":"Optionally insert page-break before/after component when rendered in PDF","type":"object","properties":{"breakBefore":{"title":"Page break before","description":"PDF only: Value or expression indicating whether a page break should be added before the component. Can be either: 'auto' (default), 'always', or 'avoid'.","examples":["auto","always","avoid"],"default":"auto","$ref":"expression.schema.v1.json#/definitions/string"},"breakAfter":{"title":"Page break after","description":"PDF only: Value or expression indicating whether a page break should be added after the component. Can be either: 'auto' (default), 'always', or 'avoid'.","examples":["auto","always","avoid"],"default":"auto","$ref":"expression.schema.v1.json#/definitions/string"}},"additionalProperties":false},"type":{"const":"PaymentDetails"},"textResourceBindings":{"type":"object","properties":{"title":{"title":"Title","description":"The title of the paragraph","$ref":"expression.schema.v1.json#/definitions/string"},"description":{"title":"Description","description":"Description, optionally shown below the title","$ref":"expression.schema.v1.json#/definitions/string"}},"additionalProperties":false},"mapping":{"title":"Mapping","description":"A mapping of key-value pairs (usually used for mapping a path in the data model to a query string parameter).","type":"object","properties":{},"additionalProperties":{"type":"string"}}},"required":["id","type"],"title":"PaymentDetails component schema"} \ No newline at end of file +{ + "$id": "https://altinncdn.no/schemas/json/component/PaymentDetails.schema.v1.json", + "$schema": "http://json-schema.org/draft-07/schema#", + "properties": { + "id": { + "title": "ID", + "description": "The component ID. Must be unique within all layouts/pages in a layout-set. Cannot end with .", + "type": "string", + "pattern": "^[0-9a-zA-Z][0-9a-zA-Z-]*(-?[a-zA-Z]+|[a-zA-Z][0-9]+|-[0-9]{6,})$" + }, + "hidden": { + "title": "Hidden", + "description": "Boolean value or expression indicating if the component should be hidden. Defaults to false.", + "default": false, + "$ref": "expression.schema.v1.json#/definitions/boolean" + }, + "grid": { + "properties": { + "xs": { "$ref": "#/definitions/IGridSize" }, + "sm": { "$ref": "#/definitions/IGridSize" }, + "md": { "$ref": "#/definitions/IGridSize" }, + "lg": { "$ref": "#/definitions/IGridSize" }, + "xl": { "$ref": "#/definitions/IGridSize" }, + "labelGrid": { "$ref": "#/definitions/IGridStyling" }, + "innerGrid": { "$ref": "#/definitions/IGridStyling" } + } + }, + "pageBreak": { + "title": "Page break", + "description": "Optionally insert page-break before/after component when rendered in PDF", + "type": "object", + "properties": { + "breakBefore": { + "title": "Page break before", + "description": "PDF only: Value or expression indicating whether a page break should be added before the component. Can be either: 'auto' (default), 'always', or 'avoid'.", + "examples": ["auto", "always", "avoid"], + "default": "auto", + "$ref": "expression.schema.v1.json#/definitions/string" + }, + "breakAfter": { + "title": "Page break after", + "description": "PDF only: Value or expression indicating whether a page break should be added after the component. Can be either: 'auto' (default), 'always', or 'avoid'.", + "examples": ["auto", "always", "avoid"], + "default": "auto", + "$ref": "expression.schema.v1.json#/definitions/string" + } + }, + "additionalProperties": false + }, + "type": { "const": "PaymentDetails" }, + "textResourceBindings": { + "type": "object", + "properties": { + "title": { + "title": "Title", + "description": "The title of the paragraph", + "$ref": "expression.schema.v1.json#/definitions/string" + }, + "description": { + "title": "Description", + "description": "Description, optionally shown below the title", + "$ref": "expression.schema.v1.json#/definitions/string" + } + }, + "additionalProperties": false + }, + "mapping": { + "title": "Mapping", + "description": "A mapping of key-value pairs (usually used for mapping a path in the data model to a query string parameter).", + "type": "object", + "properties": {}, + "additionalProperties": { "type": "string" } + } + }, + "required": ["id", "type"], + "title": "PaymentDetails component schema" +} diff --git a/frontend/packages/ux-editor/src/testing/schemas/json/component/PrintButton.schema.v1.json b/frontend/packages/ux-editor/src/testing/schemas/json/component/PrintButton.schema.v1.json index 1743435c169..3ccba13bab8 100644 --- a/frontend/packages/ux-editor/src/testing/schemas/json/component/PrintButton.schema.v1.json +++ b/frontend/packages/ux-editor/src/testing/schemas/json/component/PrintButton.schema.v1.json @@ -1 +1,65 @@ -{"$id":"https://altinncdn.no/schemas/json/component/PrintButton.schema.v1.json","$schema":"http://json-schema.org/draft-07/schema#","properties":{"id":{"title":"ID","description":"The component ID. Must be unique within all layouts/pages in a layout-set. Cannot end with .","type":"string","pattern":"^[0-9a-zA-Z][0-9a-zA-Z-]*(-?[a-zA-Z]+|[a-zA-Z][0-9]+|-[0-9]{6,})$"},"hidden":{"title":"Hidden","description":"Boolean value or expression indicating if the component should be hidden. Defaults to false.","default":false,"$ref":"expression.schema.v1.json#/definitions/boolean"},"grid":{"properties":{"xs":{"$ref":"#/definitions/IGridSize"},"sm":{"$ref":"#/definitions/IGridSize"},"md":{"$ref":"#/definitions/IGridSize"},"lg":{"$ref":"#/definitions/IGridSize"},"xl":{"$ref":"#/definitions/IGridSize"},"labelGrid":{"$ref":"#/definitions/IGridStyling"},"innerGrid":{"$ref":"#/definitions/IGridStyling"}}},"pageBreak":{"title":"Page break","description":"Optionally insert page-break before/after component when rendered in PDF","type":"object","properties":{"breakBefore":{"title":"Page break before","description":"PDF only: Value or expression indicating whether a page break should be added before the component. Can be either: 'auto' (default), 'always', or 'avoid'.","examples":["auto","always","avoid"],"default":"auto","$ref":"expression.schema.v1.json#/definitions/string"},"breakAfter":{"title":"Page break after","description":"PDF only: Value or expression indicating whether a page break should be added after the component. Can be either: 'auto' (default), 'always', or 'avoid'.","examples":["auto","always","avoid"],"default":"auto","$ref":"expression.schema.v1.json#/definitions/string"}},"additionalProperties":false},"type":{"const":"PrintButton"},"textResourceBindings":{"type":"object","properties":{"title":{"title":"Title","description":"The title/text on the button","$ref":"expression.schema.v1.json#/definitions/string"}},"additionalProperties":false}},"required":["id","type"],"title":"PrintButton component schema"} \ No newline at end of file +{ + "$id": "https://altinncdn.no/schemas/json/component/PrintButton.schema.v1.json", + "$schema": "http://json-schema.org/draft-07/schema#", + "properties": { + "id": { + "title": "ID", + "description": "The component ID. Must be unique within all layouts/pages in a layout-set. Cannot end with .", + "type": "string", + "pattern": "^[0-9a-zA-Z][0-9a-zA-Z-]*(-?[a-zA-Z]+|[a-zA-Z][0-9]+|-[0-9]{6,})$" + }, + "hidden": { + "title": "Hidden", + "description": "Boolean value or expression indicating if the component should be hidden. Defaults to false.", + "default": false, + "$ref": "expression.schema.v1.json#/definitions/boolean" + }, + "grid": { + "properties": { + "xs": { "$ref": "#/definitions/IGridSize" }, + "sm": { "$ref": "#/definitions/IGridSize" }, + "md": { "$ref": "#/definitions/IGridSize" }, + "lg": { "$ref": "#/definitions/IGridSize" }, + "xl": { "$ref": "#/definitions/IGridSize" }, + "labelGrid": { "$ref": "#/definitions/IGridStyling" }, + "innerGrid": { "$ref": "#/definitions/IGridStyling" } + } + }, + "pageBreak": { + "title": "Page break", + "description": "Optionally insert page-break before/after component when rendered in PDF", + "type": "object", + "properties": { + "breakBefore": { + "title": "Page break before", + "description": "PDF only: Value or expression indicating whether a page break should be added before the component. Can be either: 'auto' (default), 'always', or 'avoid'.", + "examples": ["auto", "always", "avoid"], + "default": "auto", + "$ref": "expression.schema.v1.json#/definitions/string" + }, + "breakAfter": { + "title": "Page break after", + "description": "PDF only: Value or expression indicating whether a page break should be added after the component. Can be either: 'auto' (default), 'always', or 'avoid'.", + "examples": ["auto", "always", "avoid"], + "default": "auto", + "$ref": "expression.schema.v1.json#/definitions/string" + } + }, + "additionalProperties": false + }, + "type": { "const": "PrintButton" }, + "textResourceBindings": { + "type": "object", + "properties": { + "title": { + "title": "Title", + "description": "The title/text on the button", + "$ref": "expression.schema.v1.json#/definitions/string" + } + }, + "additionalProperties": false + } + }, + "required": ["id", "type"], + "title": "PrintButton component schema" +} diff --git a/frontend/packages/ux-editor/src/testing/schemas/json/component/RadioButtons.schema.v1.json b/frontend/packages/ux-editor/src/testing/schemas/json/component/RadioButtons.schema.v1.json index a629dcb9189..7cf07fc5b2f 100644 --- a/frontend/packages/ux-editor/src/testing/schemas/json/component/RadioButtons.schema.v1.json +++ b/frontend/packages/ux-editor/src/testing/schemas/json/component/RadioButtons.schema.v1.json @@ -1 +1,288 @@ -{"$id":"https://altinncdn.no/schemas/json/component/RadioButtons.schema.v1.json","$schema":"http://json-schema.org/draft-07/schema#","properties":{"id":{"title":"ID","description":"The component ID. Must be unique within all layouts/pages in a layout-set. Cannot end with .","type":"string","pattern":"^[0-9a-zA-Z][0-9a-zA-Z-]*(-?[a-zA-Z]+|[a-zA-Z][0-9]+|-[0-9]{6,})$"},"hidden":{"title":"Hidden","description":"Boolean value or expression indicating if the component should be hidden. Defaults to false.","default":false,"$ref":"expression.schema.v1.json#/definitions/boolean"},"grid":{"properties":{"xs":{"$ref":"#/definitions/IGridSize"},"sm":{"$ref":"#/definitions/IGridSize"},"md":{"$ref":"#/definitions/IGridSize"},"lg":{"$ref":"#/definitions/IGridSize"},"xl":{"$ref":"#/definitions/IGridSize"},"labelGrid":{"$ref":"#/definitions/IGridStyling"},"innerGrid":{"$ref":"#/definitions/IGridStyling"}}},"pageBreak":{"title":"Page break","description":"Optionally insert page-break before/after component when rendered in PDF","type":"object","properties":{"breakBefore":{"title":"Page break before","description":"PDF only: Value or expression indicating whether a page break should be added before the component. Can be either: 'auto' (default), 'always', or 'avoid'.","examples":["auto","always","avoid"],"default":"auto","$ref":"expression.schema.v1.json#/definitions/string"},"breakAfter":{"title":"Page break after","description":"PDF only: Value or expression indicating whether a page break should be added after the component. Can be either: 'auto' (default), 'always', or 'avoid'.","examples":["auto","always","avoid"],"default":"auto","$ref":"expression.schema.v1.json#/definitions/string"}},"additionalProperties":false},"readOnly":{"title":"Read only/disabled?","description":"Boolean value or expression indicating if the component should be read only/disabled. Defaults to false.
Please note that even with read-only fields in components, it may currently be possible to update the field by modifying the request sent to the API or through a direct API call.","default":false,"$ref":"expression.schema.v1.json#/definitions/boolean"},"required":{"title":"Required?","description":"Boolean value or expression indicating if the component should be required. Defaults to false.","default":false,"$ref":"expression.schema.v1.json#/definitions/boolean"},"showValidations":{"title":"Validation types","description":"List of validation types to show","type":"array","items":{"enum":["Schema","Component","Expression","CustomBackend","Required","AllExceptRequired","All"],"type":"string"}},"renderAsSummary":{"title":"Render as summary","description":"Boolean value indicating if the component should be rendered as a summary. Defaults to false.","default":false,"type":"boolean"},"forceShowInSummary":{"title":"Force show in summary","description":"Will force show the component in a summary even if hideEmptyFields is set to true in the summary component.","default":false,"$ref":"expression.schema.v1.json#/definitions/boolean"},"optionsId":{"title":"Dynamic options (fetched from server)","description":"ID of the option list to fetch from the server","type":"string"},"mapping":{"title":"Mapping","description":"A mapping of key-value pairs (usually used for mapping a path in the data model to a query string parameter).","type":"object","properties":{},"additionalProperties":{"type":"string"}},"queryParameters":{"title":"Query parameters","description":"A mapping of query string parameters to values. Will be appended to the URL when fetching options.","type":"object","properties":{},"additionalProperties":{"type":"string"}},"options":{"title":"Static options","description":"List of static options","type":"array","items":{"title":"IRawOption","examples":[{"label":"","value":""}],"type":"object","properties":{"label":{"type":"string"},"value":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"const":null}]},"description":{"type":"string"},"helpText":{"type":"string"}},"required":["label","value"],"additionalProperties":false}},"secure":{"title":"Secure options (when using optionsId)","description":"Whether to call the secure API endpoint when fetching options from the server (allows for user/instance-specific options)","default":false,"type":"boolean"},"sortOrder":{"description":"Sorts the code list in either ascending or descending order by label.","enum":["asc","desc"],"type":"string"},"source":{"title":"Option source","description":"Allows for fetching options from the data model, pointing to a repeating group structure","type":"object","properties":{"group":{"title":"Group","description":"The repeating group to base options on.","examples":["model.some.group"],"type":"string"},"label":{"title":"Label","description":"A label of the option displayed in Radio- and Checkbox groups. Can be plain text, a text resource binding, or a dynamic expression.","examples":["some.text.key"],"$ref":"expression.schema.v1.json#/definitions/string"},"value":{"title":"Value","description":"Field in the group that should be used as value","examples":["model.some.group[{0}].someField"],"type":"string"},"description":{"title":"Description","description":"A description of the option displayed in Radio- and Checkbox groups. Can be plain text, a text resource binding, or a dynamic expression.","examples":["some.text.key","My Description"],"$ref":"expression.schema.v1.json#/definitions/string"},"helpText":{"title":"Help Text","description":"A help text for the option displayed in Radio- and Checkbox groups. Can be plain text, a text resource binding, or a dynamic expression.","examples":["some.text.key","My Help Text"],"$ref":"expression.schema.v1.json#/definitions/string"}},"required":["group","label","value"],"additionalProperties":false},"preselectedOptionIndex":{"title":"Preselected option index","description":"Index of the option to preselect (if no option has been selected yet)","type":"integer"},"labelSettings":{"title":"ILabelSettings","type":"object","properties":{"optionalIndicator":{"title":"Optional indicator","description":"Show optional indicator on label","type":"boolean"}},"additionalProperties":false},"type":{"const":"RadioButtons"},"textResourceBindings":{"properties":{"title":{"title":"Title","description":"Label text/title shown above the component","$ref":"expression.schema.v1.json#/definitions/string"},"description":{"title":"Description","description":"Label description shown above the component, below the title","$ref":"expression.schema.v1.json#/definitions/string"},"help":{"title":"Help text","description":"Help text shown in a tooltip when clicking the help button","$ref":"expression.schema.v1.json#/definitions/string"},"tableTitle":{"title":"Table title","description":"Title used in the table view (overrides the default title)","$ref":"expression.schema.v1.json#/definitions/string"},"shortName":{"title":"Short name (for validation)","description":"Alternative name used for required validation messages (overrides the default title)","$ref":"expression.schema.v1.json#/definitions/string"},"requiredValidation":{"title":"Required validation message","description":"Full validation message shown when the component is required and no value has been entered (overrides both the default and shortName)","$ref":"expression.schema.v1.json#/definitions/string"},"summaryTitle":{"title":"Summary title","description":"Title used in the summary view (overrides the default title)","$ref":"expression.schema.v1.json#/definitions/string"},"summaryAccessibleTitle":{"title":"Accessible summary title","description":"Title used for aria-label on the edit button in the summary view (overrides the default and summary title)","$ref":"expression.schema.v1.json#/definitions/string"}}},"dataModelBindings":{"title":"Data model binding","description":"Describes the location in the data model where the component should store its value(s). A simple binding is used for components that only store a single value, usually a string.","type":"object","properties":{"simpleBinding":{"type":"string"},"label":{"type":"string"},"metadata":{"description":"Describes the location where metadata for the option based component should be stored in the datamodel.","type":"string"}},"required":["simpleBinding"],"additionalProperties":false},"layout":{"title":"Layout","description":"Define the layout style for the options","enum":["column","row","table"],"type":"string"},"alertOnChange":{"title":"Alert on change","description":"Boolean value indicating if the component should alert on change","default":false,"$ref":"expression.schema.v1.json#/definitions/boolean"},"showLabelsInTable":{"title":"Show label when single option in table","description":"Boolean value indicating if the label should be visible when only one option exists in table","default":false,"type":"boolean"},"showAsCard":{"title":"Show as card","description":"Boolean value indicating if the options should be displayed as cards. Defaults to false.","type":"boolean"}},"required":["id","type","dataModelBindings"],"title":"RadioButtons component schema"} \ No newline at end of file +{ + "$id": "https://altinncdn.no/schemas/json/component/RadioButtons.schema.v1.json", + "$schema": "http://json-schema.org/draft-07/schema#", + "properties": { + "id": { + "title": "ID", + "description": "The component ID. Must be unique within all layouts/pages in a layout-set. Cannot end with .", + "type": "string", + "pattern": "^[0-9a-zA-Z][0-9a-zA-Z-]*(-?[a-zA-Z]+|[a-zA-Z][0-9]+|-[0-9]{6,})$" + }, + "hidden": { + "title": "Hidden", + "description": "Boolean value or expression indicating if the component should be hidden. Defaults to false.", + "default": false, + "$ref": "expression.schema.v1.json#/definitions/boolean" + }, + "grid": { + "properties": { + "xs": { "$ref": "#/definitions/IGridSize" }, + "sm": { "$ref": "#/definitions/IGridSize" }, + "md": { "$ref": "#/definitions/IGridSize" }, + "lg": { "$ref": "#/definitions/IGridSize" }, + "xl": { "$ref": "#/definitions/IGridSize" }, + "labelGrid": { "$ref": "#/definitions/IGridStyling" }, + "innerGrid": { "$ref": "#/definitions/IGridStyling" } + } + }, + "pageBreak": { + "title": "Page break", + "description": "Optionally insert page-break before/after component when rendered in PDF", + "type": "object", + "properties": { + "breakBefore": { + "title": "Page break before", + "description": "PDF only: Value or expression indicating whether a page break should be added before the component. Can be either: 'auto' (default), 'always', or 'avoid'.", + "examples": ["auto", "always", "avoid"], + "default": "auto", + "$ref": "expression.schema.v1.json#/definitions/string" + }, + "breakAfter": { + "title": "Page break after", + "description": "PDF only: Value or expression indicating whether a page break should be added after the component. Can be either: 'auto' (default), 'always', or 'avoid'.", + "examples": ["auto", "always", "avoid"], + "default": "auto", + "$ref": "expression.schema.v1.json#/definitions/string" + } + }, + "additionalProperties": false + }, + "readOnly": { + "title": "Read only/disabled?", + "description": "Boolean value or expression indicating if the component should be read only/disabled. Defaults to false.
Please note that even with read-only fields in components, it may currently be possible to update the field by modifying the request sent to the API or through a direct API call.", + "default": false, + "$ref": "expression.schema.v1.json#/definitions/boolean" + }, + "required": { + "title": "Required?", + "description": "Boolean value or expression indicating if the component should be required. Defaults to false.", + "default": false, + "$ref": "expression.schema.v1.json#/definitions/boolean" + }, + "showValidations": { + "title": "Validation types", + "description": "List of validation types to show", + "type": "array", + "items": { + "enum": [ + "Schema", + "Component", + "Expression", + "CustomBackend", + "Required", + "AllExceptRequired", + "All" + ], + "type": "string" + } + }, + "renderAsSummary": { + "title": "Render as summary", + "description": "Boolean value indicating if the component should be rendered as a summary. Defaults to false.", + "default": false, + "type": "boolean" + }, + "forceShowInSummary": { + "title": "Force show in summary", + "description": "Will force show the component in a summary even if hideEmptyFields is set to true in the summary component.", + "default": false, + "$ref": "expression.schema.v1.json#/definitions/boolean" + }, + "optionsId": { + "title": "Dynamic options (fetched from server)", + "description": "ID of the option list to fetch from the server", + "type": "string" + }, + "mapping": { + "title": "Mapping", + "description": "A mapping of key-value pairs (usually used for mapping a path in the data model to a query string parameter).", + "type": "object", + "properties": {}, + "additionalProperties": { "type": "string" } + }, + "queryParameters": { + "title": "Query parameters", + "description": "A mapping of query string parameters to values. Will be appended to the URL when fetching options.", + "type": "object", + "properties": {}, + "additionalProperties": { "type": "string" } + }, + "options": { + "title": "Static options", + "description": "List of static options", + "type": "array", + "items": { + "title": "IRawOption", + "examples": [{ "label": "", "value": "" }], + "type": "object", + "properties": { + "label": { "type": "string" }, + "value": { + "anyOf": [ + { "type": "string" }, + { "type": "number" }, + { "type": "boolean" }, + { "const": null } + ] + }, + "description": { "type": "string" }, + "helpText": { "type": "string" } + }, + "required": ["label", "value"], + "additionalProperties": false + } + }, + "secure": { + "title": "Secure options (when using optionsId)", + "description": "Whether to call the secure API endpoint when fetching options from the server (allows for user/instance-specific options)", + "default": false, + "type": "boolean" + }, + "sortOrder": { + "description": "Sorts the code list in either ascending or descending order by label.", + "enum": ["asc", "desc"], + "type": "string" + }, + "source": { + "title": "Option source", + "description": "Allows for fetching options from the data model, pointing to a repeating group structure", + "type": "object", + "properties": { + "group": { + "title": "Group", + "description": "The repeating group to base options on.", + "examples": ["model.some.group"], + "type": "string" + }, + "label": { + "title": "Label", + "description": "A label of the option displayed in Radio- and Checkbox groups. Can be plain text, a text resource binding, or a dynamic expression.", + "examples": ["some.text.key"], + "$ref": "expression.schema.v1.json#/definitions/string" + }, + "value": { + "title": "Value", + "description": "Field in the group that should be used as value", + "examples": ["model.some.group[{0}].someField"], + "type": "string" + }, + "description": { + "title": "Description", + "description": "A description of the option displayed in Radio- and Checkbox groups. Can be plain text, a text resource binding, or a dynamic expression.", + "examples": ["some.text.key", "My Description"], + "$ref": "expression.schema.v1.json#/definitions/string" + }, + "helpText": { + "title": "Help Text", + "description": "A help text for the option displayed in Radio- and Checkbox groups. Can be plain text, a text resource binding, or a dynamic expression.", + "examples": ["some.text.key", "My Help Text"], + "$ref": "expression.schema.v1.json#/definitions/string" + } + }, + "required": ["group", "label", "value"], + "additionalProperties": false + }, + "preselectedOptionIndex": { + "title": "Preselected option index", + "description": "Index of the option to preselect (if no option has been selected yet)", + "type": "integer" + }, + "labelSettings": { + "title": "ILabelSettings", + "type": "object", + "properties": { + "optionalIndicator": { + "title": "Optional indicator", + "description": "Show optional indicator on label", + "type": "boolean" + } + }, + "additionalProperties": false + }, + "type": { "const": "RadioButtons" }, + "textResourceBindings": { + "properties": { + "title": { + "title": "Title", + "description": "Label text/title shown above the component", + "$ref": "expression.schema.v1.json#/definitions/string" + }, + "description": { + "title": "Description", + "description": "Label description shown above the component, below the title", + "$ref": "expression.schema.v1.json#/definitions/string" + }, + "help": { + "title": "Help text", + "description": "Help text shown in a tooltip when clicking the help button", + "$ref": "expression.schema.v1.json#/definitions/string" + }, + "tableTitle": { + "title": "Table title", + "description": "Title used in the table view (overrides the default title)", + "$ref": "expression.schema.v1.json#/definitions/string" + }, + "shortName": { + "title": "Short name (for validation)", + "description": "Alternative name used for required validation messages (overrides the default title)", + "$ref": "expression.schema.v1.json#/definitions/string" + }, + "requiredValidation": { + "title": "Required validation message", + "description": "Full validation message shown when the component is required and no value has been entered (overrides both the default and shortName)", + "$ref": "expression.schema.v1.json#/definitions/string" + }, + "summaryTitle": { + "title": "Summary title", + "description": "Title used in the summary view (overrides the default title)", + "$ref": "expression.schema.v1.json#/definitions/string" + }, + "summaryAccessibleTitle": { + "title": "Accessible summary title", + "description": "Title used for aria-label on the edit button in the summary view (overrides the default and summary title)", + "$ref": "expression.schema.v1.json#/definitions/string" + } + } + }, + "dataModelBindings": { + "title": "Data model binding", + "description": "Describes the location in the data model where the component should store its value(s). A simple binding is used for components that only store a single value, usually a string.", + "type": "object", + "properties": { + "simpleBinding": { "type": "string" }, + "label": { "type": "string" }, + "metadata": { + "description": "Describes the location where metadata for the option based component should be stored in the datamodel.", + "type": "string" + } + }, + "required": ["simpleBinding"], + "additionalProperties": false + }, + "layout": { + "title": "Layout", + "description": "Define the layout style for the options", + "enum": ["column", "row", "table"], + "type": "string" + }, + "alertOnChange": { + "title": "Alert on change", + "description": "Boolean value indicating if the component should alert on change", + "default": false, + "$ref": "expression.schema.v1.json#/definitions/boolean" + }, + "showLabelsInTable": { + "title": "Show label when single option in table", + "description": "Boolean value indicating if the label should be visible when only one option exists in table", + "default": false, + "type": "boolean" + }, + "showAsCard": { + "title": "Show as card", + "description": "Boolean value indicating if the options should be displayed as cards. Defaults to false.", + "type": "boolean" + } + }, + "required": ["id", "type", "dataModelBindings"], + "title": "RadioButtons component schema" +} diff --git a/frontend/packages/ux-editor/src/testing/schemas/json/component/RepeatingGroup.schema.v1.json b/frontend/packages/ux-editor/src/testing/schemas/json/component/RepeatingGroup.schema.v1.json index 47cf0e2c4fa..7c418c41ca8 100644 --- a/frontend/packages/ux-editor/src/testing/schemas/json/component/RepeatingGroup.schema.v1.json +++ b/frontend/packages/ux-editor/src/testing/schemas/json/component/RepeatingGroup.schema.v1.json @@ -1 +1,367 @@ -{"$id":"https://altinncdn.no/schemas/json/component/RepeatingGroup.schema.v1.json","$schema":"http://json-schema.org/draft-07/schema#","properties":{"id":{"title":"ID","description":"The component ID. Must be unique within all layouts/pages in a layout-set. Cannot end with .","type":"string","pattern":"^[0-9a-zA-Z][0-9a-zA-Z-]*(-?[a-zA-Z]+|[a-zA-Z][0-9]+|-[0-9]{6,})$"},"hidden":{"title":"Hidden","description":"Boolean value or expression indicating if the component should be hidden. Defaults to false.","default":false,"$ref":"expression.schema.v1.json#/definitions/boolean"},"grid":{"properties":{"xs":{"$ref":"#/definitions/IGridSize"},"sm":{"$ref":"#/definitions/IGridSize"},"md":{"$ref":"#/definitions/IGridSize"},"lg":{"$ref":"#/definitions/IGridSize"},"xl":{"$ref":"#/definitions/IGridSize"},"labelGrid":{"$ref":"#/definitions/IGridStyling"},"innerGrid":{"$ref":"#/definitions/IGridStyling"}}},"pageBreak":{"title":"Page break","description":"Optionally insert page-break before/after component when rendered in PDF","type":"object","properties":{"breakBefore":{"title":"Page break before","description":"PDF only: Value or expression indicating whether a page break should be added before the component. Can be either: 'auto' (default), 'always', or 'avoid'.","examples":["auto","always","avoid"],"default":"auto","$ref":"expression.schema.v1.json#/definitions/string"},"breakAfter":{"title":"Page break after","description":"PDF only: Value or expression indicating whether a page break should be added after the component. Can be either: 'auto' (default), 'always', or 'avoid'.","examples":["auto","always","avoid"],"default":"auto","$ref":"expression.schema.v1.json#/definitions/string"}},"additionalProperties":false},"renderAsSummary":{"title":"Render as summary","description":"Boolean value indicating if the component should be rendered as a summary. Defaults to false.","default":false,"type":"boolean"},"forceShowInSummary":{"title":"Force show in summary","description":"Will force show the component in a summary even if hideEmptyFields is set to true in the summary component.","default":false,"$ref":"expression.schema.v1.json#/definitions/boolean"},"type":{"const":"RepeatingGroup"},"textResourceBindings":{"properties":{"title":{"title":"Title","description":"The title of the group (shown above each instance in a Summary)","$ref":"expression.schema.v1.json#/definitions/string"},"description":{"title":"Description","description":"The description text shown underneath the title","$ref":"expression.schema.v1.json#/definitions/string"},"summaryTitle":{"title":"Summary title","description":"Title used in the summary view (overrides the default title)","$ref":"expression.schema.v1.json#/definitions/string"},"summaryAccessibleTitle":{"title":"Accessible summary title","description":"Title used for aria-label on the edit button in the summary view (overrides the default and summary title)","$ref":"expression.schema.v1.json#/definitions/string"},"add_button_full":{"title":"Add button (full) (for repeating groups)","description":"The text for the \"Add\" button (overrides \"add_button\", and sets the full text for the button)","$ref":"expression.schema.v1.json#/definitions/string"},"add_button":{"title":"Add button (suffix) (for repeating groups)","description":"The text for the \"Add\" button (used as a suffix after the default button text)","$ref":"expression.schema.v1.json#/definitions/string"},"save_button":{"title":"Save button (for repeating groups)","description":"The text for the \"Save\" button when the repeating group item is in edit mode","$ref":"expression.schema.v1.json#/definitions/string"},"save_and_next_button":{"title":"Save and next button (for repeating groups)","description":"The text for the \"Save and next\" button when the repeating group item is in edit mode (only displayed if edit.saveAndNextButton is true)","$ref":"expression.schema.v1.json#/definitions/string"},"edit_button_close":{"title":"Edit button (close) (for repeating groups)","description":"The text for the \"Edit\" button when the repeating group item is in edit mode (i.e. the user can close the edit mode)","$ref":"expression.schema.v1.json#/definitions/string"},"edit_button_open":{"title":"Edit button (open) (for repeating groups)","description":"The text for the \"Edit\" button when the repeating group item is not in edit mode (i.e. the user can open the edit mode)","$ref":"expression.schema.v1.json#/definitions/string"},"pagination_next_button":{"title":"Next button in pagination","description":"The text for the \"Next\" button in pagination","$ref":"expression.schema.v1.json#/definitions/string"},"pagination_back_button":{"title":"Back button in pagination","description":"The text for the \"Back\" button in pagination","$ref":"expression.schema.v1.json#/definitions/string"}}},"children":{"title":"Children","description":"List of child component IDs to show inside (will be repeated according to the number of rows in the data model binding)","type":"array","items":{"type":"string"}},"rowsBefore":{"title":"Rows in Grid or Grid-like component","description":"The list of rows in this grid","examples":[[{"header":false,"readOnly":false,"cells":[{"text":"hello.world"},{"component":"myOtherComponent"}]}]],"type":"array","items":{"title":"GridRow","type":"object","properties":{"header":{"title":"Is header row?","default":false,"type":"boolean"},"readOnly":{"title":"Is row read-only?","default":false,"type":"boolean"},"columnOptions":{"$ref":"#/definitions/ITableColumnProperties"},"cells":{"title":"Cells in table row","description":"The list of cells in this row","type":"array","items":{"$ref":"#/definitions/GridCell"}}},"required":["cells"],"additionalProperties":false}},"rowsAfter":{"title":"Rows in Grid or Grid-like component","description":"The list of rows in this grid","examples":[[{"header":false,"readOnly":false,"cells":[{"text":"hello.world"},{"component":"myOtherComponent"}]}]],"type":"array","items":{"title":"GridRow","type":"object","properties":{"header":{"title":"Is header row?","default":false,"type":"boolean"},"readOnly":{"title":"Is row read-only?","default":false,"type":"boolean"},"columnOptions":{"$ref":"#/definitions/ITableColumnProperties"},"cells":{"title":"Cells in table row","description":"The list of cells in this row","type":"array","items":{"$ref":"#/definitions/GridCell"}}},"required":["cells"],"additionalProperties":false}},"dataModelBindings":{"title":"IDataModelBindingsForGroup","type":"object","properties":{"group":{"title":"Group","description":"Dot notation location for a repeating group structure (array of objects), where the data is stored","type":"string"}},"required":["group"],"additionalProperties":false},"showValidations":{"title":"Validation types","description":"List of validation types to show","type":"array","items":{"enum":["Schema","Component","Expression","CustomBackend","Required","AllExceptRequired","All"],"type":"string"}},"validateOnSaveRow":{"title":"Validation types","description":"List of validation types to show","type":"array","items":{"enum":["Schema","Component","Expression","CustomBackend","Required","AllExceptRequired","All"],"type":"string"}},"edit":{"title":"IGroupEditProperties","type":"object","properties":{"mode":{"title":"Mode","description":"The mode of the repeating group","default":"showTable","enum":["hideTable","showTable","showAll","onlyTable"]},"addButton":{"title":"Add button","description":"Expression or boolean indicating whether to show the \"Add\" button","default":true,"$ref":"expression.schema.v1.json#/definitions/boolean"},"saveButton":{"title":"Save button","description":"Expression or boolean indicating whether to show the \"Save\" button","default":true,"$ref":"expression.schema.v1.json#/definitions/boolean"},"deleteButton":{"title":"Delete button","description":"Expression or boolean indicating whether to show the \"Delete\" button","default":true,"$ref":"expression.schema.v1.json#/definitions/boolean"},"editButton":{"title":"Edit button","description":"Expression or boolean indicating whether to show the \"Edit\" button","default":true,"$ref":"expression.schema.v1.json#/definitions/boolean"},"multiPage":{"title":"Multi page functionality","description":"Turning this on makes it possible to display the edit mode for a repeating group with multiple inner pages. Every component referenced in the \"children\" property should have a prefix with the page number it should be displayed on (e.g. \"1:component1\", \"2:component2\", etc.)","default":false,"type":"boolean"},"openByDefault":{"title":"Open by default","description":"If set to true, a row of the repeating group will be opened by default, if the group has no rows already. If set to \"first\" or \"last\", the first or last row will be opened by default","default":false,"anyOf":[{"type":"boolean"},{"const":"first"},{"const":"last"}]},"alertOnDelete":{"title":"Alert on delete","description":"Expression or boolean indicating whether to show an alert when the user clicks the \"Delete\" button, prompting them to confirm the deletion","default":false,"$ref":"expression.schema.v1.json#/definitions/boolean"},"saveAndNextButton":{"title":"Save and next button","description":"Expression or boolean indicating whether to show the \"Save and next\" button when editing a repeating group row. This button will save the current row and open the next row for editing.","default":false,"$ref":"expression.schema.v1.json#/definitions/boolean"},"alwaysShowAddButton":{"title":"Always show add button","description":"If set to true, the \"Add\" button will always be shown, even if the user is currently editing another row","default":false,"type":"boolean"}},"additionalProperties":false},"pagination":{"title":"Pagination options","description":"Pagination options for the repeating group rows.","type":"object","properties":{"rowsPerPage":{"type":"integer","minimum":1}},"required":["rowsPerPage"],"additionalProperties":false},"maxCount":{"title":"Max number of rows","description":"Maximum number of rows that can be added.","type":"integer","minimum":2},"minCount":{"title":"Min number of rows","description":"Minimum number of rows that should be added. If the user has not added enough rows, the repeating group will show a validation error","type":"integer"},"tableHeaders":{"title":"Table headers","description":"Array of component IDs that should be displayed as table headers. If not defined, all components referenced in the \"children\" property will be displayed as table headers","type":"array","items":{"type":"string"}},"tableColumns":{"examples":[{"childComponent1":{"width":"auto"}}],"type":"object","properties":{},"additionalProperties":{"$ref":"#/definitions/IGroupColumnFormatting"}},"hiddenRow":{"title":"Hidden row?","description":"Expression or boolean indicating whether each row should be hidden. An expression will be evaluated per row, and if it evaluates to true, the row will be hidden. If set to true, all rows will be hidden.","default":false,"$ref":"expression.schema.v1.json#/definitions/boolean"},"stickyHeader":{"title":"Sticky header","description":"If set to true, the header of the repeating group will be sticky","default":false,"type":"boolean"},"labelSettings":{"title":"ILabelSettings","type":"object","properties":{"optionalIndicator":{"title":"Optional indicator","description":"Show optional indicator on label","type":"boolean"}},"additionalProperties":false}},"required":["id","type","children","dataModelBindings"],"title":"RepeatingGroup component schema"} \ No newline at end of file +{ + "$id": "https://altinncdn.no/schemas/json/component/RepeatingGroup.schema.v1.json", + "$schema": "http://json-schema.org/draft-07/schema#", + "properties": { + "id": { + "title": "ID", + "description": "The component ID. Must be unique within all layouts/pages in a layout-set. Cannot end with .", + "type": "string", + "pattern": "^[0-9a-zA-Z][0-9a-zA-Z-]*(-?[a-zA-Z]+|[a-zA-Z][0-9]+|-[0-9]{6,})$" + }, + "hidden": { + "title": "Hidden", + "description": "Boolean value or expression indicating if the component should be hidden. Defaults to false.", + "default": false, + "$ref": "expression.schema.v1.json#/definitions/boolean" + }, + "grid": { + "properties": { + "xs": { "$ref": "#/definitions/IGridSize" }, + "sm": { "$ref": "#/definitions/IGridSize" }, + "md": { "$ref": "#/definitions/IGridSize" }, + "lg": { "$ref": "#/definitions/IGridSize" }, + "xl": { "$ref": "#/definitions/IGridSize" }, + "labelGrid": { "$ref": "#/definitions/IGridStyling" }, + "innerGrid": { "$ref": "#/definitions/IGridStyling" } + } + }, + "pageBreak": { + "title": "Page break", + "description": "Optionally insert page-break before/after component when rendered in PDF", + "type": "object", + "properties": { + "breakBefore": { + "title": "Page break before", + "description": "PDF only: Value or expression indicating whether a page break should be added before the component. Can be either: 'auto' (default), 'always', or 'avoid'.", + "examples": ["auto", "always", "avoid"], + "default": "auto", + "$ref": "expression.schema.v1.json#/definitions/string" + }, + "breakAfter": { + "title": "Page break after", + "description": "PDF only: Value or expression indicating whether a page break should be added after the component. Can be either: 'auto' (default), 'always', or 'avoid'.", + "examples": ["auto", "always", "avoid"], + "default": "auto", + "$ref": "expression.schema.v1.json#/definitions/string" + } + }, + "additionalProperties": false + }, + "renderAsSummary": { + "title": "Render as summary", + "description": "Boolean value indicating if the component should be rendered as a summary. Defaults to false.", + "default": false, + "type": "boolean" + }, + "forceShowInSummary": { + "title": "Force show in summary", + "description": "Will force show the component in a summary even if hideEmptyFields is set to true in the summary component.", + "default": false, + "$ref": "expression.schema.v1.json#/definitions/boolean" + }, + "type": { "const": "RepeatingGroup" }, + "textResourceBindings": { + "properties": { + "title": { + "title": "Title", + "description": "The title of the group (shown above each instance in a Summary)", + "$ref": "expression.schema.v1.json#/definitions/string" + }, + "description": { + "title": "Description", + "description": "The description text shown underneath the title", + "$ref": "expression.schema.v1.json#/definitions/string" + }, + "summaryTitle": { + "title": "Summary title", + "description": "Title used in the summary view (overrides the default title)", + "$ref": "expression.schema.v1.json#/definitions/string" + }, + "summaryAccessibleTitle": { + "title": "Accessible summary title", + "description": "Title used for aria-label on the edit button in the summary view (overrides the default and summary title)", + "$ref": "expression.schema.v1.json#/definitions/string" + }, + "add_button_full": { + "title": "Add button (full) (for repeating groups)", + "description": "The text for the \"Add\" button (overrides \"add_button\", and sets the full text for the button)", + "$ref": "expression.schema.v1.json#/definitions/string" + }, + "add_button": { + "title": "Add button (suffix) (for repeating groups)", + "description": "The text for the \"Add\" button (used as a suffix after the default button text)", + "$ref": "expression.schema.v1.json#/definitions/string" + }, + "save_button": { + "title": "Save button (for repeating groups)", + "description": "The text for the \"Save\" button when the repeating group item is in edit mode", + "$ref": "expression.schema.v1.json#/definitions/string" + }, + "save_and_next_button": { + "title": "Save and next button (for repeating groups)", + "description": "The text for the \"Save and next\" button when the repeating group item is in edit mode (only displayed if edit.saveAndNextButton is true)", + "$ref": "expression.schema.v1.json#/definitions/string" + }, + "edit_button_close": { + "title": "Edit button (close) (for repeating groups)", + "description": "The text for the \"Edit\" button when the repeating group item is in edit mode (i.e. the user can close the edit mode)", + "$ref": "expression.schema.v1.json#/definitions/string" + }, + "edit_button_open": { + "title": "Edit button (open) (for repeating groups)", + "description": "The text for the \"Edit\" button when the repeating group item is not in edit mode (i.e. the user can open the edit mode)", + "$ref": "expression.schema.v1.json#/definitions/string" + }, + "pagination_next_button": { + "title": "Next button in pagination", + "description": "The text for the \"Next\" button in pagination", + "$ref": "expression.schema.v1.json#/definitions/string" + }, + "pagination_back_button": { + "title": "Back button in pagination", + "description": "The text for the \"Back\" button in pagination", + "$ref": "expression.schema.v1.json#/definitions/string" + } + } + }, + "children": { + "title": "Children", + "description": "List of child component IDs to show inside (will be repeated according to the number of rows in the data model binding)", + "type": "array", + "items": { "type": "string" } + }, + "rowsBefore": { + "title": "Rows in Grid or Grid-like component", + "description": "The list of rows in this grid", + "examples": [ + [ + { + "header": false, + "readOnly": false, + "cells": [{ "text": "hello.world" }, { "component": "myOtherComponent" }] + } + ] + ], + "type": "array", + "items": { + "title": "GridRow", + "type": "object", + "properties": { + "header": { "title": "Is header row?", "default": false, "type": "boolean" }, + "readOnly": { "title": "Is row read-only?", "default": false, "type": "boolean" }, + "columnOptions": { "$ref": "#/definitions/ITableColumnProperties" }, + "cells": { + "title": "Cells in table row", + "description": "The list of cells in this row", + "type": "array", + "items": { "$ref": "#/definitions/GridCell" } + } + }, + "required": ["cells"], + "additionalProperties": false + } + }, + "rowsAfter": { + "title": "Rows in Grid or Grid-like component", + "description": "The list of rows in this grid", + "examples": [ + [ + { + "header": false, + "readOnly": false, + "cells": [{ "text": "hello.world" }, { "component": "myOtherComponent" }] + } + ] + ], + "type": "array", + "items": { + "title": "GridRow", + "type": "object", + "properties": { + "header": { "title": "Is header row?", "default": false, "type": "boolean" }, + "readOnly": { "title": "Is row read-only?", "default": false, "type": "boolean" }, + "columnOptions": { "$ref": "#/definitions/ITableColumnProperties" }, + "cells": { + "title": "Cells in table row", + "description": "The list of cells in this row", + "type": "array", + "items": { "$ref": "#/definitions/GridCell" } + } + }, + "required": ["cells"], + "additionalProperties": false + } + }, + "dataModelBindings": { + "title": "IDataModelBindingsForGroup", + "type": "object", + "properties": { + "group": { + "title": "Group", + "description": "Dot notation location for a repeating group structure (array of objects), where the data is stored", + "type": "string" + } + }, + "required": ["group"], + "additionalProperties": false + }, + "showValidations": { + "title": "Validation types", + "description": "List of validation types to show", + "type": "array", + "items": { + "enum": [ + "Schema", + "Component", + "Expression", + "CustomBackend", + "Required", + "AllExceptRequired", + "All" + ], + "type": "string" + } + }, + "validateOnSaveRow": { + "title": "Validation types", + "description": "List of validation types to show", + "type": "array", + "items": { + "enum": [ + "Schema", + "Component", + "Expression", + "CustomBackend", + "Required", + "AllExceptRequired", + "All" + ], + "type": "string" + } + }, + "edit": { + "title": "IGroupEditProperties", + "type": "object", + "properties": { + "mode": { + "title": "Mode", + "description": "The mode of the repeating group", + "default": "showTable", + "enum": ["hideTable", "showTable", "showAll", "onlyTable"] + }, + "addButton": { + "title": "Add button", + "description": "Expression or boolean indicating whether to show the \"Add\" button", + "default": true, + "$ref": "expression.schema.v1.json#/definitions/boolean" + }, + "saveButton": { + "title": "Save button", + "description": "Expression or boolean indicating whether to show the \"Save\" button", + "default": true, + "$ref": "expression.schema.v1.json#/definitions/boolean" + }, + "deleteButton": { + "title": "Delete button", + "description": "Expression or boolean indicating whether to show the \"Delete\" button", + "default": true, + "$ref": "expression.schema.v1.json#/definitions/boolean" + }, + "editButton": { + "title": "Edit button", + "description": "Expression or boolean indicating whether to show the \"Edit\" button", + "default": true, + "$ref": "expression.schema.v1.json#/definitions/boolean" + }, + "multiPage": { + "title": "Multi page functionality", + "description": "Turning this on makes it possible to display the edit mode for a repeating group with multiple inner pages. Every component referenced in the \"children\" property should have a prefix with the page number it should be displayed on (e.g. \"1:component1\", \"2:component2\", etc.)", + "default": false, + "type": "boolean" + }, + "openByDefault": { + "title": "Open by default", + "description": "If set to true, a row of the repeating group will be opened by default, if the group has no rows already. If set to \"first\" or \"last\", the first or last row will be opened by default", + "default": false, + "anyOf": [{ "type": "boolean" }, { "const": "first" }, { "const": "last" }] + }, + "alertOnDelete": { + "title": "Alert on delete", + "description": "Expression or boolean indicating whether to show an alert when the user clicks the \"Delete\" button, prompting them to confirm the deletion", + "default": false, + "$ref": "expression.schema.v1.json#/definitions/boolean" + }, + "saveAndNextButton": { + "title": "Save and next button", + "description": "Expression or boolean indicating whether to show the \"Save and next\" button when editing a repeating group row. This button will save the current row and open the next row for editing.", + "default": false, + "$ref": "expression.schema.v1.json#/definitions/boolean" + }, + "alwaysShowAddButton": { + "title": "Always show add button", + "description": "If set to true, the \"Add\" button will always be shown, even if the user is currently editing another row", + "default": false, + "type": "boolean" + } + }, + "additionalProperties": false + }, + "pagination": { + "title": "Pagination options", + "description": "Pagination options for the repeating group rows.", + "type": "object", + "properties": { "rowsPerPage": { "type": "integer", "minimum": 1 } }, + "required": ["rowsPerPage"], + "additionalProperties": false + }, + "maxCount": { + "title": "Max number of rows", + "description": "Maximum number of rows that can be added.", + "type": "integer", + "minimum": 2 + }, + "minCount": { + "title": "Min number of rows", + "description": "Minimum number of rows that should be added. If the user has not added enough rows, the repeating group will show a validation error", + "type": "integer" + }, + "tableHeaders": { + "title": "Table headers", + "description": "Array of component IDs that should be displayed as table headers. If not defined, all components referenced in the \"children\" property will be displayed as table headers", + "type": "array", + "items": { "type": "string" } + }, + "tableColumns": { + "examples": [{ "childComponent1": { "width": "auto" } }], + "type": "object", + "properties": {}, + "additionalProperties": { "$ref": "#/definitions/IGroupColumnFormatting" } + }, + "hiddenRow": { + "title": "Hidden row?", + "description": "Expression or boolean indicating whether each row should be hidden. An expression will be evaluated per row, and if it evaluates to true, the row will be hidden. If set to true, all rows will be hidden.", + "default": false, + "$ref": "expression.schema.v1.json#/definitions/boolean" + }, + "stickyHeader": { + "title": "Sticky header", + "description": "If set to true, the header of the repeating group will be sticky", + "default": false, + "type": "boolean" + }, + "labelSettings": { + "title": "ILabelSettings", + "type": "object", + "properties": { + "optionalIndicator": { + "title": "Optional indicator", + "description": "Show optional indicator on label", + "type": "boolean" + } + }, + "additionalProperties": false + } + }, + "required": ["id", "type", "children", "dataModelBindings"], + "title": "RepeatingGroup component schema" +} diff --git a/frontend/packages/ux-editor/src/testing/schemas/json/component/Summary.schema.v1.json b/frontend/packages/ux-editor/src/testing/schemas/json/component/Summary.schema.v1.json index 87f9fb8b2fc..477470c732f 100644 --- a/frontend/packages/ux-editor/src/testing/schemas/json/component/Summary.schema.v1.json +++ b/frontend/packages/ux-editor/src/testing/schemas/json/component/Summary.schema.v1.json @@ -1 +1,120 @@ -{"$id":"https://altinncdn.no/schemas/json/component/Summary.schema.v1.json","$schema":"http://json-schema.org/draft-07/schema#","properties":{"id":{"title":"ID","description":"The component ID. Must be unique within all layouts/pages in a layout-set. Cannot end with .","type":"string","pattern":"^[0-9a-zA-Z][0-9a-zA-Z-]*(-?[a-zA-Z]+|[a-zA-Z][0-9]+|-[0-9]{6,})$"},"hidden":{"title":"Hidden","description":"Boolean value or expression indicating if the component should be hidden. Defaults to false.","default":false,"$ref":"expression.schema.v1.json#/definitions/boolean"},"grid":{"properties":{"xs":{"$ref":"#/definitions/IGridSize"},"sm":{"$ref":"#/definitions/IGridSize"},"md":{"$ref":"#/definitions/IGridSize"},"lg":{"$ref":"#/definitions/IGridSize"},"xl":{"$ref":"#/definitions/IGridSize"},"labelGrid":{"$ref":"#/definitions/IGridStyling"},"innerGrid":{"$ref":"#/definitions/IGridStyling"}}},"pageBreak":{"title":"Page break","description":"Optionally insert page-break before/after component when rendered in PDF","type":"object","properties":{"breakBefore":{"title":"Page break before","description":"PDF only: Value or expression indicating whether a page break should be added before the component. Can be either: 'auto' (default), 'always', or 'avoid'.","examples":["auto","always","avoid"],"default":"auto","$ref":"expression.schema.v1.json#/definitions/string"},"breakAfter":{"title":"Page break after","description":"PDF only: Value or expression indicating whether a page break should be added after the component. Can be either: 'auto' (default), 'always', or 'avoid'.","examples":["auto","always","avoid"],"default":"auto","$ref":"expression.schema.v1.json#/definitions/string"}},"additionalProperties":false},"type":{"const":"Summary"},"componentRef":{"title":"Component reference","description":"String value indicating which layout component (by ID) the summary is for.","type":"string"},"largeGroup":{"title":"Large group","description":"Boolean value indicating if summary of repeating group should be displayed in large format. Useful for displaying summary with nested groups.","default":false,"type":"boolean"},"excludedChildren":{"title":"Excluded child components","description":"Array of component IDs that should not be shown in a repeating group's summary","type":"array","items":{"type":"string"}},"textResourceBindings":{"type":"object","properties":{"returnToSummaryButtonTitle":{"title":"ReturnToSummaryButtonTitle","description":"Used to specify the text on the NavigationButtons component that should be used after clicking \"Change\" on the summary component","$ref":"expression.schema.v1.json#/definitions/string"}},"additionalProperties":false},"display":{"title":"Display properties","description":"Optional properties to configure how summary is displayed","type":"object","properties":{"hideChangeButton":{"title":"Hide change button","description":"Set to true if the change button should be hidden for the summary component. False by default.","default":false,"type":"boolean"},"hideValidationMessages":{"title":"Hide validation messages","description":"Set to true if the validation messages should be hidden for the component when shown in Summary. False by default.","default":false,"type":"boolean"},"useComponentGrid":{"title":"Use component grid","description":"Set to true to allow summary component to use the grid setup of the referenced component. For group summary, this will apply for all group child components.","default":false,"type":"boolean"},"hideBottomBorder":{"title":"Hide bottom border","description":"Set to true to hide the blue dashed border below the summary component. False by default.","default":false,"type":"boolean"},"nextButton":{"title":"Display the next button","description":"Set to to true display a \"next\" button as well as the return to summary button","default":false,"type":"boolean"}},"additionalProperties":false}},"required":["id","type","componentRef"],"title":"Summary component schema"} \ No newline at end of file +{ + "$id": "https://altinncdn.no/schemas/json/component/Summary.schema.v1.json", + "$schema": "http://json-schema.org/draft-07/schema#", + "properties": { + "id": { + "title": "ID", + "description": "The component ID. Must be unique within all layouts/pages in a layout-set. Cannot end with .", + "type": "string", + "pattern": "^[0-9a-zA-Z][0-9a-zA-Z-]*(-?[a-zA-Z]+|[a-zA-Z][0-9]+|-[0-9]{6,})$" + }, + "hidden": { + "title": "Hidden", + "description": "Boolean value or expression indicating if the component should be hidden. Defaults to false.", + "default": false, + "$ref": "expression.schema.v1.json#/definitions/boolean" + }, + "grid": { + "properties": { + "xs": { "$ref": "#/definitions/IGridSize" }, + "sm": { "$ref": "#/definitions/IGridSize" }, + "md": { "$ref": "#/definitions/IGridSize" }, + "lg": { "$ref": "#/definitions/IGridSize" }, + "xl": { "$ref": "#/definitions/IGridSize" }, + "labelGrid": { "$ref": "#/definitions/IGridStyling" }, + "innerGrid": { "$ref": "#/definitions/IGridStyling" } + } + }, + "pageBreak": { + "title": "Page break", + "description": "Optionally insert page-break before/after component when rendered in PDF", + "type": "object", + "properties": { + "breakBefore": { + "title": "Page break before", + "description": "PDF only: Value or expression indicating whether a page break should be added before the component. Can be either: 'auto' (default), 'always', or 'avoid'.", + "examples": ["auto", "always", "avoid"], + "default": "auto", + "$ref": "expression.schema.v1.json#/definitions/string" + }, + "breakAfter": { + "title": "Page break after", + "description": "PDF only: Value or expression indicating whether a page break should be added after the component. Can be either: 'auto' (default), 'always', or 'avoid'.", + "examples": ["auto", "always", "avoid"], + "default": "auto", + "$ref": "expression.schema.v1.json#/definitions/string" + } + }, + "additionalProperties": false + }, + "type": { "const": "Summary" }, + "componentRef": { + "title": "Component reference", + "description": "String value indicating which layout component (by ID) the summary is for.", + "type": "string" + }, + "largeGroup": { + "title": "Large group", + "description": "Boolean value indicating if summary of repeating group should be displayed in large format. Useful for displaying summary with nested groups.", + "default": false, + "type": "boolean" + }, + "excludedChildren": { + "title": "Excluded child components", + "description": "Array of component IDs that should not be shown in a repeating group's summary", + "type": "array", + "items": { "type": "string" } + }, + "textResourceBindings": { + "type": "object", + "properties": { + "returnToSummaryButtonTitle": { + "title": "ReturnToSummaryButtonTitle", + "description": "Used to specify the text on the NavigationButtons component that should be used after clicking \"Change\" on the summary component", + "$ref": "expression.schema.v1.json#/definitions/string" + } + }, + "additionalProperties": false + }, + "display": { + "title": "Display properties", + "description": "Optional properties to configure how summary is displayed", + "type": "object", + "properties": { + "hideChangeButton": { + "title": "Hide change button", + "description": "Set to true if the change button should be hidden for the summary component. False by default.", + "default": false, + "type": "boolean" + }, + "hideValidationMessages": { + "title": "Hide validation messages", + "description": "Set to true if the validation messages should be hidden for the component when shown in Summary. False by default.", + "default": false, + "type": "boolean" + }, + "useComponentGrid": { + "title": "Use component grid", + "description": "Set to true to allow summary component to use the grid setup of the referenced component. For group summary, this will apply for all group child components.", + "default": false, + "type": "boolean" + }, + "hideBottomBorder": { + "title": "Hide bottom border", + "description": "Set to true to hide the blue dashed border below the summary component. False by default.", + "default": false, + "type": "boolean" + }, + "nextButton": { + "title": "Display the next button", + "description": "Set to to true display a \"next\" button as well as the return to summary button", + "default": false, + "type": "boolean" + } + }, + "additionalProperties": false + } + }, + "required": ["id", "type", "componentRef"], + "title": "Summary component schema" +} diff --git a/frontend/packages/ux-editor/src/testing/schemas/json/component/Summary2.schema.v1.json b/frontend/packages/ux-editor/src/testing/schemas/json/component/Summary2.schema.v1.json index cce48d5418e..db4b17c3875 100644 --- a/frontend/packages/ux-editor/src/testing/schemas/json/component/Summary2.schema.v1.json +++ b/frontend/packages/ux-editor/src/testing/schemas/json/component/Summary2.schema.v1.json @@ -1 +1,95 @@ -{"$id":"https://altinncdn.no/schemas/json/component/Summary2.schema.v1.json","$schema":"http://json-schema.org/draft-07/schema#","properties":{"id":{"title":"ID","description":"The component ID. Must be unique within all layouts/pages in a layout-set. Cannot end with .","type":"string","pattern":"^[0-9a-zA-Z][0-9a-zA-Z-]*(-?[a-zA-Z]+|[a-zA-Z][0-9]+|-[0-9]{6,})$"},"hidden":{"title":"Hidden","description":"Boolean value or expression indicating if the component should be hidden. Defaults to false.","default":false,"$ref":"expression.schema.v1.json#/definitions/boolean"},"grid":{"properties":{"xs":{"$ref":"#/definitions/IGridSize"},"sm":{"$ref":"#/definitions/IGridSize"},"md":{"$ref":"#/definitions/IGridSize"},"lg":{"$ref":"#/definitions/IGridSize"},"xl":{"$ref":"#/definitions/IGridSize"},"labelGrid":{"$ref":"#/definitions/IGridStyling"},"innerGrid":{"$ref":"#/definitions/IGridStyling"}}},"pageBreak":{"title":"Page break","description":"Optionally insert page-break before/after component when rendered in PDF","type":"object","properties":{"breakBefore":{"title":"Page break before","description":"PDF only: Value or expression indicating whether a page break should be added before the component. Can be either: 'auto' (default), 'always', or 'avoid'.","examples":["auto","always","avoid"],"default":"auto","$ref":"expression.schema.v1.json#/definitions/string"},"breakAfter":{"title":"Page break after","description":"PDF only: Value or expression indicating whether a page break should be added after the component. Can be either: 'auto' (default), 'always', or 'avoid'.","examples":["auto","always","avoid"],"default":"auto","$ref":"expression.schema.v1.json#/definitions/string"}},"additionalProperties":false},"type":{"const":"Summary2"},"target":{"description":"Config for what should be rendered. If you set taskId, this property is optional.","type":"object","properties":{"type":{"title":"Mode","default":"component","enum":["page","layoutSet","component"]},"id":{"type":"string"},"taskId":{"title":"Task ID","description":"Use this if you want to render something from another task.","type":"string"}},"additionalProperties":false},"showPageInAccordion":{"type":"boolean"},"hideEmptyFields":{"description":"Set this to true if you don't want to show fields that have not been filled out.","type":"boolean"},"overrides":{"type":"array","items":{"title":"AnySummaryOverrideProps","anyOf":[{"$ref":"#/definitions/InputSummaryOverrideProps"},{"$ref":"#/definitions/CheckboxSummaryOverrideProps"},{"$ref":"#/definitions/RadioSummaryOverrideProps"},{"$ref":"#/definitions/DropdownSummaryOverrideProps"},{"$ref":"#/definitions/MultipleSelectSummaryOverrideProps"},{"$ref":"#/definitions/GroupSummaryOverrideProps"},{"$ref":"#/definitions/TextAreaSummaryOverrideProps"},{"$ref":"#/definitions/RepeatingGroupSummaryOverrideProps"},{"$ref":"#/definitions/DatepickerSummaryOverrideProps"},{"$ref":"#/definitions/ListSummaryOverrideProps"}]}}},"required":["id","type"],"title":"Summary2 component schema"} \ No newline at end of file +{ + "$id": "https://altinncdn.no/schemas/json/component/Summary2.schema.v1.json", + "$schema": "http://json-schema.org/draft-07/schema#", + "properties": { + "id": { + "title": "ID", + "description": "The component ID. Must be unique within all layouts/pages in a layout-set. Cannot end with .", + "type": "string", + "pattern": "^[0-9a-zA-Z][0-9a-zA-Z-]*(-?[a-zA-Z]+|[a-zA-Z][0-9]+|-[0-9]{6,})$" + }, + "hidden": { + "title": "Hidden", + "description": "Boolean value or expression indicating if the component should be hidden. Defaults to false.", + "default": false, + "$ref": "expression.schema.v1.json#/definitions/boolean" + }, + "grid": { + "properties": { + "xs": { "$ref": "#/definitions/IGridSize" }, + "sm": { "$ref": "#/definitions/IGridSize" }, + "md": { "$ref": "#/definitions/IGridSize" }, + "lg": { "$ref": "#/definitions/IGridSize" }, + "xl": { "$ref": "#/definitions/IGridSize" }, + "labelGrid": { "$ref": "#/definitions/IGridStyling" }, + "innerGrid": { "$ref": "#/definitions/IGridStyling" } + } + }, + "pageBreak": { + "title": "Page break", + "description": "Optionally insert page-break before/after component when rendered in PDF", + "type": "object", + "properties": { + "breakBefore": { + "title": "Page break before", + "description": "PDF only: Value or expression indicating whether a page break should be added before the component. Can be either: 'auto' (default), 'always', or 'avoid'.", + "examples": ["auto", "always", "avoid"], + "default": "auto", + "$ref": "expression.schema.v1.json#/definitions/string" + }, + "breakAfter": { + "title": "Page break after", + "description": "PDF only: Value or expression indicating whether a page break should be added after the component. Can be either: 'auto' (default), 'always', or 'avoid'.", + "examples": ["auto", "always", "avoid"], + "default": "auto", + "$ref": "expression.schema.v1.json#/definitions/string" + } + }, + "additionalProperties": false + }, + "type": { "const": "Summary2" }, + "target": { + "description": "Config for what should be rendered. If you set taskId, this property is optional.", + "type": "object", + "properties": { + "type": { + "title": "Mode", + "default": "component", + "enum": ["page", "layoutSet", "component"] + }, + "id": { "type": "string" }, + "taskId": { + "title": "Task ID", + "description": "Use this if you want to render something from another task.", + "type": "string" + } + }, + "additionalProperties": false + }, + "showPageInAccordion": { "type": "boolean" }, + "hideEmptyFields": { + "description": "Set this to true if you don't want to show fields that have not been filled out.", + "type": "boolean" + }, + "overrides": { + "type": "array", + "items": { + "title": "AnySummaryOverrideProps", + "anyOf": [ + { "$ref": "#/definitions/InputSummaryOverrideProps" }, + { "$ref": "#/definitions/CheckboxSummaryOverrideProps" }, + { "$ref": "#/definitions/RadioSummaryOverrideProps" }, + { "$ref": "#/definitions/DropdownSummaryOverrideProps" }, + { "$ref": "#/definitions/MultipleSelectSummaryOverrideProps" }, + { "$ref": "#/definitions/GroupSummaryOverrideProps" }, + { "$ref": "#/definitions/TextAreaSummaryOverrideProps" }, + { "$ref": "#/definitions/RepeatingGroupSummaryOverrideProps" }, + { "$ref": "#/definitions/DatepickerSummaryOverrideProps" }, + { "$ref": "#/definitions/ListSummaryOverrideProps" } + ] + } + } + }, + "required": ["id", "type"], + "title": "Summary2 component schema" +} diff --git a/frontend/packages/ux-editor/src/testing/schemas/json/component/Tabs.schema.v1.json b/frontend/packages/ux-editor/src/testing/schemas/json/component/Tabs.schema.v1.json index b95de5d91af..29fcc2cb22b 100644 --- a/frontend/packages/ux-editor/src/testing/schemas/json/component/Tabs.schema.v1.json +++ b/frontend/packages/ux-editor/src/testing/schemas/json/component/Tabs.schema.v1.json @@ -1 +1,104 @@ -{"$id":"https://altinncdn.no/schemas/json/component/Tabs.schema.v1.json","$schema":"http://json-schema.org/draft-07/schema#","properties":{"id":{"title":"ID","description":"The component ID. Must be unique within all layouts/pages in a layout-set. Cannot end with .","type":"string","pattern":"^[0-9a-zA-Z][0-9a-zA-Z-]*(-?[a-zA-Z]+|[a-zA-Z][0-9]+|-[0-9]{6,})$"},"hidden":{"title":"Hidden","description":"Boolean value or expression indicating if the component should be hidden. Defaults to false.","default":false,"$ref":"expression.schema.v1.json#/definitions/boolean"},"grid":{"properties":{"xs":{"$ref":"#/definitions/IGridSize"},"sm":{"$ref":"#/definitions/IGridSize"},"md":{"$ref":"#/definitions/IGridSize"},"lg":{"$ref":"#/definitions/IGridSize"},"xl":{"$ref":"#/definitions/IGridSize"},"labelGrid":{"$ref":"#/definitions/IGridStyling"},"innerGrid":{"$ref":"#/definitions/IGridStyling"}}},"pageBreak":{"title":"Page break","description":"Optionally insert page-break before/after component when rendered in PDF","type":"object","properties":{"breakBefore":{"title":"Page break before","description":"PDF only: Value or expression indicating whether a page break should be added before the component. Can be either: 'auto' (default), 'always', or 'avoid'.","examples":["auto","always","avoid"],"default":"auto","$ref":"expression.schema.v1.json#/definitions/string"},"breakAfter":{"title":"Page break after","description":"PDF only: Value or expression indicating whether a page break should be added after the component. Can be either: 'auto' (default), 'always', or 'avoid'.","examples":["auto","always","avoid"],"default":"auto","$ref":"expression.schema.v1.json#/definitions/string"}},"additionalProperties":false},"renderAsSummary":{"title":"Render as summary","description":"Boolean value indicating if the component should be rendered as a summary. Defaults to false.","default":false,"type":"boolean"},"forceShowInSummary":{"title":"Force show in summary","description":"Will force show the component in a summary even if hideEmptyFields is set to true in the summary component.","default":false,"$ref":"expression.schema.v1.json#/definitions/boolean"},"type":{"const":"Tabs"},"textResourceBindings":{"title":"TRBSummarizable","type":"object","properties":{"summaryTitle":{"title":"Summary title","description":"Title used in the summary view (overrides the default title)","$ref":"expression.schema.v1.json#/definitions/string"},"summaryAccessibleTitle":{"title":"Accessible summary title","description":"Title used for aria-label on the edit button in the summary view (overrides the default and summary title)","$ref":"expression.schema.v1.json#/definitions/string"}}},"size":{"default":"medium","enum":["small","medium","large"],"type":"string"},"defaultTab":{"type":"string"},"tabs":{"type":"array","items":{"title":"TabConfig","type":"object","properties":{"id":{"type":"string"},"title":{"title":"Title","description":"Title of the tab","type":"string"},"icon":{"examples":["https://example.com/icon.svg"],"type":"string"},"children":{"title":"Children","description":"List of component IDs that should be displayed in the Tab","type":"array","items":{"type":"string"}}},"required":["id","title","children"],"additionalProperties":false}}},"required":["id","type","tabs"],"title":"Tabs component schema"} \ No newline at end of file +{ + "$id": "https://altinncdn.no/schemas/json/component/Tabs.schema.v1.json", + "$schema": "http://json-schema.org/draft-07/schema#", + "properties": { + "id": { + "title": "ID", + "description": "The component ID. Must be unique within all layouts/pages in a layout-set. Cannot end with .", + "type": "string", + "pattern": "^[0-9a-zA-Z][0-9a-zA-Z-]*(-?[a-zA-Z]+|[a-zA-Z][0-9]+|-[0-9]{6,})$" + }, + "hidden": { + "title": "Hidden", + "description": "Boolean value or expression indicating if the component should be hidden. Defaults to false.", + "default": false, + "$ref": "expression.schema.v1.json#/definitions/boolean" + }, + "grid": { + "properties": { + "xs": { "$ref": "#/definitions/IGridSize" }, + "sm": { "$ref": "#/definitions/IGridSize" }, + "md": { "$ref": "#/definitions/IGridSize" }, + "lg": { "$ref": "#/definitions/IGridSize" }, + "xl": { "$ref": "#/definitions/IGridSize" }, + "labelGrid": { "$ref": "#/definitions/IGridStyling" }, + "innerGrid": { "$ref": "#/definitions/IGridStyling" } + } + }, + "pageBreak": { + "title": "Page break", + "description": "Optionally insert page-break before/after component when rendered in PDF", + "type": "object", + "properties": { + "breakBefore": { + "title": "Page break before", + "description": "PDF only: Value or expression indicating whether a page break should be added before the component. Can be either: 'auto' (default), 'always', or 'avoid'.", + "examples": ["auto", "always", "avoid"], + "default": "auto", + "$ref": "expression.schema.v1.json#/definitions/string" + }, + "breakAfter": { + "title": "Page break after", + "description": "PDF only: Value or expression indicating whether a page break should be added after the component. Can be either: 'auto' (default), 'always', or 'avoid'.", + "examples": ["auto", "always", "avoid"], + "default": "auto", + "$ref": "expression.schema.v1.json#/definitions/string" + } + }, + "additionalProperties": false + }, + "renderAsSummary": { + "title": "Render as summary", + "description": "Boolean value indicating if the component should be rendered as a summary. Defaults to false.", + "default": false, + "type": "boolean" + }, + "forceShowInSummary": { + "title": "Force show in summary", + "description": "Will force show the component in a summary even if hideEmptyFields is set to true in the summary component.", + "default": false, + "$ref": "expression.schema.v1.json#/definitions/boolean" + }, + "type": { "const": "Tabs" }, + "textResourceBindings": { + "title": "TRBSummarizable", + "type": "object", + "properties": { + "summaryTitle": { + "title": "Summary title", + "description": "Title used in the summary view (overrides the default title)", + "$ref": "expression.schema.v1.json#/definitions/string" + }, + "summaryAccessibleTitle": { + "title": "Accessible summary title", + "description": "Title used for aria-label on the edit button in the summary view (overrides the default and summary title)", + "$ref": "expression.schema.v1.json#/definitions/string" + } + } + }, + "size": { "default": "medium", "enum": ["small", "medium", "large"], "type": "string" }, + "defaultTab": { "type": "string" }, + "tabs": { + "type": "array", + "items": { + "title": "TabConfig", + "type": "object", + "properties": { + "id": { "type": "string" }, + "title": { "title": "Title", "description": "Title of the tab", "type": "string" }, + "icon": { "examples": ["https://example.com/icon.svg"], "type": "string" }, + "children": { + "title": "Children", + "description": "List of component IDs that should be displayed in the Tab", + "type": "array", + "items": { "type": "string" } + } + }, + "required": ["id", "title", "children"], + "additionalProperties": false + } + } + }, + "required": ["id", "type", "tabs"], + "title": "Tabs component schema" +} diff --git a/frontend/packages/ux-editor/src/testing/schemas/json/component/Text.schema.v1.json b/frontend/packages/ux-editor/src/testing/schemas/json/component/Text.schema.v1.json index 67a7fb23d1a..a64b26edf89 100644 --- a/frontend/packages/ux-editor/src/testing/schemas/json/component/Text.schema.v1.json +++ b/frontend/packages/ux-editor/src/testing/schemas/json/component/Text.schema.v1.json @@ -1 +1,78 @@ -{"$id":"https://altinncdn.no/schemas/json/component/Text.schema.v1.json","$schema":"http://json-schema.org/draft-07/schema#","properties":{"id":{"title":"ID","description":"The component ID. Must be unique within all layouts/pages in a layout-set. Cannot end with .","type":"string","pattern":"^[0-9a-zA-Z][0-9a-zA-Z-]*(-?[a-zA-Z]+|[a-zA-Z][0-9]+|-[0-9]{6,})$"},"hidden":{"title":"Hidden","description":"Boolean value or expression indicating if the component should be hidden. Defaults to false.","default":false,"$ref":"expression.schema.v1.json#/definitions/boolean"},"grid":{"properties":{"xs":{"$ref":"#/definitions/IGridSize"},"sm":{"$ref":"#/definitions/IGridSize"},"md":{"$ref":"#/definitions/IGridSize"},"lg":{"$ref":"#/definitions/IGridSize"},"xl":{"$ref":"#/definitions/IGridSize"},"labelGrid":{"$ref":"#/definitions/IGridStyling"},"innerGrid":{"$ref":"#/definitions/IGridStyling"}}},"pageBreak":{"title":"Page break","description":"Optionally insert page-break before/after component when rendered in PDF","type":"object","properties":{"breakBefore":{"title":"Page break before","description":"PDF only: Value or expression indicating whether a page break should be added before the component. Can be either: 'auto' (default), 'always', or 'avoid'.","examples":["auto","always","avoid"],"default":"auto","$ref":"expression.schema.v1.json#/definitions/string"},"breakAfter":{"title":"Page break after","description":"PDF only: Value or expression indicating whether a page break should be added after the component. Can be either: 'auto' (default), 'always', or 'avoid'.","examples":["auto","always","avoid"],"default":"auto","$ref":"expression.schema.v1.json#/definitions/string"}},"additionalProperties":false},"type":{"const":"Text"},"textResourceBindings":{"title":"TRBLabel","type":"object","properties":{"title":{"title":"Title","description":"Label text/title shown above the component","$ref":"expression.schema.v1.json#/definitions/string"},"description":{"title":"Description","description":"Label description shown above the component, below the title","$ref":"expression.schema.v1.json#/definitions/string"},"help":{"title":"Help text","description":"Help text shown in a tooltip when clicking the help button","$ref":"expression.schema.v1.json#/definitions/string"}}},"value":{"$ref":"expression.schema.v1.json#/definitions/string"},"direction":{"default":"horizontal","enum":["horizontal","vertical"],"type":"string"},"icon":{"examples":["https://example.com/icon.svg"],"type":"string"}},"required":["id","type","value"],"title":"Text component schema"} \ No newline at end of file +{ + "$id": "https://altinncdn.no/schemas/json/component/Text.schema.v1.json", + "$schema": "http://json-schema.org/draft-07/schema#", + "properties": { + "id": { + "title": "ID", + "description": "The component ID. Must be unique within all layouts/pages in a layout-set. Cannot end with .", + "type": "string", + "pattern": "^[0-9a-zA-Z][0-9a-zA-Z-]*(-?[a-zA-Z]+|[a-zA-Z][0-9]+|-[0-9]{6,})$" + }, + "hidden": { + "title": "Hidden", + "description": "Boolean value or expression indicating if the component should be hidden. Defaults to false.", + "default": false, + "$ref": "expression.schema.v1.json#/definitions/boolean" + }, + "grid": { + "properties": { + "xs": { "$ref": "#/definitions/IGridSize" }, + "sm": { "$ref": "#/definitions/IGridSize" }, + "md": { "$ref": "#/definitions/IGridSize" }, + "lg": { "$ref": "#/definitions/IGridSize" }, + "xl": { "$ref": "#/definitions/IGridSize" }, + "labelGrid": { "$ref": "#/definitions/IGridStyling" }, + "innerGrid": { "$ref": "#/definitions/IGridStyling" } + } + }, + "pageBreak": { + "title": "Page break", + "description": "Optionally insert page-break before/after component when rendered in PDF", + "type": "object", + "properties": { + "breakBefore": { + "title": "Page break before", + "description": "PDF only: Value or expression indicating whether a page break should be added before the component. Can be either: 'auto' (default), 'always', or 'avoid'.", + "examples": ["auto", "always", "avoid"], + "default": "auto", + "$ref": "expression.schema.v1.json#/definitions/string" + }, + "breakAfter": { + "title": "Page break after", + "description": "PDF only: Value or expression indicating whether a page break should be added after the component. Can be either: 'auto' (default), 'always', or 'avoid'.", + "examples": ["auto", "always", "avoid"], + "default": "auto", + "$ref": "expression.schema.v1.json#/definitions/string" + } + }, + "additionalProperties": false + }, + "type": { "const": "Text" }, + "textResourceBindings": { + "title": "TRBLabel", + "type": "object", + "properties": { + "title": { + "title": "Title", + "description": "Label text/title shown above the component", + "$ref": "expression.schema.v1.json#/definitions/string" + }, + "description": { + "title": "Description", + "description": "Label description shown above the component, below the title", + "$ref": "expression.schema.v1.json#/definitions/string" + }, + "help": { + "title": "Help text", + "description": "Help text shown in a tooltip when clicking the help button", + "$ref": "expression.schema.v1.json#/definitions/string" + } + } + }, + "value": { "$ref": "expression.schema.v1.json#/definitions/string" }, + "direction": { "default": "horizontal", "enum": ["horizontal", "vertical"], "type": "string" }, + "icon": { "examples": ["https://example.com/icon.svg"], "type": "string" } + }, + "required": ["id", "type", "value"], + "title": "Text component schema" +} diff --git a/frontend/packages/ux-editor/src/testing/schemas/json/component/TextArea.schema.v1.json b/frontend/packages/ux-editor/src/testing/schemas/json/component/TextArea.schema.v1.json index ee7ecd3dbc6..49843a3d98d 100644 --- a/frontend/packages/ux-editor/src/testing/schemas/json/component/TextArea.schema.v1.json +++ b/frontend/packages/ux-editor/src/testing/schemas/json/component/TextArea.schema.v1.json @@ -1 +1,231 @@ -{"$id":"https://altinncdn.no/schemas/json/component/TextArea.schema.v1.json","$schema":"http://json-schema.org/draft-07/schema#","properties":{"id":{"title":"ID","description":"The component ID. Must be unique within all layouts/pages in a layout-set. Cannot end with .","type":"string","pattern":"^[0-9a-zA-Z][0-9a-zA-Z-]*(-?[a-zA-Z]+|[a-zA-Z][0-9]+|-[0-9]{6,})$"},"hidden":{"title":"Hidden","description":"Boolean value or expression indicating if the component should be hidden. Defaults to false.","default":false,"$ref":"expression.schema.v1.json#/definitions/boolean"},"grid":{"properties":{"xs":{"$ref":"#/definitions/IGridSize"},"sm":{"$ref":"#/definitions/IGridSize"},"md":{"$ref":"#/definitions/IGridSize"},"lg":{"$ref":"#/definitions/IGridSize"},"xl":{"$ref":"#/definitions/IGridSize"},"labelGrid":{"$ref":"#/definitions/IGridStyling"},"innerGrid":{"$ref":"#/definitions/IGridStyling"}}},"pageBreak":{"title":"Page break","description":"Optionally insert page-break before/after component when rendered in PDF","type":"object","properties":{"breakBefore":{"title":"Page break before","description":"PDF only: Value or expression indicating whether a page break should be added before the component. Can be either: 'auto' (default), 'always', or 'avoid'.","examples":["auto","always","avoid"],"default":"auto","$ref":"expression.schema.v1.json#/definitions/string"},"breakAfter":{"title":"Page break after","description":"PDF only: Value or expression indicating whether a page break should be added after the component. Can be either: 'auto' (default), 'always', or 'avoid'.","examples":["auto","always","avoid"],"default":"auto","$ref":"expression.schema.v1.json#/definitions/string"}},"additionalProperties":false},"readOnly":{"title":"Read only/disabled?","description":"Boolean value or expression indicating if the component should be read only/disabled. Defaults to false.
Please note that even with read-only fields in components, it may currently be possible to update the field by modifying the request sent to the API or through a direct API call.","default":false,"$ref":"expression.schema.v1.json#/definitions/boolean"},"required":{"title":"Required?","description":"Boolean value or expression indicating if the component should be required. Defaults to false.","default":false,"$ref":"expression.schema.v1.json#/definitions/boolean"},"showValidations":{"title":"Validation types","description":"List of validation types to show","type":"array","items":{"enum":["Schema","Component","Expression","CustomBackend","Required","AllExceptRequired","All"],"type":"string"}},"renderAsSummary":{"title":"Render as summary","description":"Boolean value indicating if the component should be rendered as a summary. Defaults to false.","default":false,"type":"boolean"},"forceShowInSummary":{"title":"Force show in summary","description":"Will force show the component in a summary even if hideEmptyFields is set to true in the summary component.","default":false,"$ref":"expression.schema.v1.json#/definitions/boolean"},"labelSettings":{"title":"ILabelSettings","type":"object","properties":{"optionalIndicator":{"title":"Optional indicator","description":"Show optional indicator on label","type":"boolean"}},"additionalProperties":false},"type":{"const":"TextArea"},"textResourceBindings":{"properties":{"title":{"title":"Title","description":"Label text/title shown above the component","$ref":"expression.schema.v1.json#/definitions/string"},"description":{"title":"Description","description":"Label description shown above the component, below the title","$ref":"expression.schema.v1.json#/definitions/string"},"help":{"title":"Help text","description":"Help text shown in a tooltip when clicking the help button","$ref":"expression.schema.v1.json#/definitions/string"},"tableTitle":{"title":"Table title","description":"Title used in the table view (overrides the default title)","$ref":"expression.schema.v1.json#/definitions/string"},"shortName":{"title":"Short name (for validation)","description":"Alternative name used for required validation messages (overrides the default title)","$ref":"expression.schema.v1.json#/definitions/string"},"requiredValidation":{"title":"Required validation message","description":"Full validation message shown when the component is required and no value has been entered (overrides both the default and shortName)","$ref":"expression.schema.v1.json#/definitions/string"},"summaryTitle":{"title":"Summary title","description":"Title used in the summary view (overrides the default title)","$ref":"expression.schema.v1.json#/definitions/string"},"summaryAccessibleTitle":{"title":"Accessible summary title","description":"Title used for aria-label on the edit button in the summary view (overrides the default and summary title)","$ref":"expression.schema.v1.json#/definitions/string"}}},"dataModelBindings":{"title":"Data model binding","description":"Describes the location in the data model where the component should store its value(s). A simple binding is used for components that only store a single value, usually a string.","type":"object","properties":{"simpleBinding":{"type":"string"}},"required":["simpleBinding"],"additionalProperties":false},"saveWhileTyping":{"title":"Automatic saving while typing","description":"Lets you control how long we wait before saving the value locally while typing. This value is usually also used to determine how long we wait before saving the value to the server. The default value is 400 milliseconds.","default":400,"type":"number"},"autocomplete":{"title":"HTML autocomplete values","description":"Autocomplete hints to the browser. See https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/autocomplete","enum":["on","off","name","honorific-prefix","given-name","additional-name","family-name","honorific-suffix","nickname","email","username","new-password","current-password","one-time-code","organization-title","organization","street-address","address-line1","address-line2","address-line3","address-level4","address-level3","address-level2","address-level1","country","country-name","postal-code","cc-name","cc-given-name","cc-additional-name","cc-family-name","cc-number","cc-exp","cc-exp-month","cc-exp-year","cc-csc","cc-type","transaction-currency","transaction-amount","language","bday","bday-day","bday-month","bday-year","sex","tel","tel-country-code","tel-national","tel-area-code","tel-local","tel-extension","impp","url","photo"],"type":"string"},"maxLength":{"title":"Max length","description":"Max length of the input field. Will add a counter to let the user know how many characters are left.","type":"integer"}},"required":["id","type","dataModelBindings"],"title":"TextArea component schema"} \ No newline at end of file +{ + "$id": "https://altinncdn.no/schemas/json/component/TextArea.schema.v1.json", + "$schema": "http://json-schema.org/draft-07/schema#", + "properties": { + "id": { + "title": "ID", + "description": "The component ID. Must be unique within all layouts/pages in a layout-set. Cannot end with .", + "type": "string", + "pattern": "^[0-9a-zA-Z][0-9a-zA-Z-]*(-?[a-zA-Z]+|[a-zA-Z][0-9]+|-[0-9]{6,})$" + }, + "hidden": { + "title": "Hidden", + "description": "Boolean value or expression indicating if the component should be hidden. Defaults to false.", + "default": false, + "$ref": "expression.schema.v1.json#/definitions/boolean" + }, + "grid": { + "properties": { + "xs": { "$ref": "#/definitions/IGridSize" }, + "sm": { "$ref": "#/definitions/IGridSize" }, + "md": { "$ref": "#/definitions/IGridSize" }, + "lg": { "$ref": "#/definitions/IGridSize" }, + "xl": { "$ref": "#/definitions/IGridSize" }, + "labelGrid": { "$ref": "#/definitions/IGridStyling" }, + "innerGrid": { "$ref": "#/definitions/IGridStyling" } + } + }, + "pageBreak": { + "title": "Page break", + "description": "Optionally insert page-break before/after component when rendered in PDF", + "type": "object", + "properties": { + "breakBefore": { + "title": "Page break before", + "description": "PDF only: Value or expression indicating whether a page break should be added before the component. Can be either: 'auto' (default), 'always', or 'avoid'.", + "examples": ["auto", "always", "avoid"], + "default": "auto", + "$ref": "expression.schema.v1.json#/definitions/string" + }, + "breakAfter": { + "title": "Page break after", + "description": "PDF only: Value or expression indicating whether a page break should be added after the component. Can be either: 'auto' (default), 'always', or 'avoid'.", + "examples": ["auto", "always", "avoid"], + "default": "auto", + "$ref": "expression.schema.v1.json#/definitions/string" + } + }, + "additionalProperties": false + }, + "readOnly": { + "title": "Read only/disabled?", + "description": "Boolean value or expression indicating if the component should be read only/disabled. Defaults to false.
Please note that even with read-only fields in components, it may currently be possible to update the field by modifying the request sent to the API or through a direct API call.", + "default": false, + "$ref": "expression.schema.v1.json#/definitions/boolean" + }, + "required": { + "title": "Required?", + "description": "Boolean value or expression indicating if the component should be required. Defaults to false.", + "default": false, + "$ref": "expression.schema.v1.json#/definitions/boolean" + }, + "showValidations": { + "title": "Validation types", + "description": "List of validation types to show", + "type": "array", + "items": { + "enum": [ + "Schema", + "Component", + "Expression", + "CustomBackend", + "Required", + "AllExceptRequired", + "All" + ], + "type": "string" + } + }, + "renderAsSummary": { + "title": "Render as summary", + "description": "Boolean value indicating if the component should be rendered as a summary. Defaults to false.", + "default": false, + "type": "boolean" + }, + "forceShowInSummary": { + "title": "Force show in summary", + "description": "Will force show the component in a summary even if hideEmptyFields is set to true in the summary component.", + "default": false, + "$ref": "expression.schema.v1.json#/definitions/boolean" + }, + "labelSettings": { + "title": "ILabelSettings", + "type": "object", + "properties": { + "optionalIndicator": { + "title": "Optional indicator", + "description": "Show optional indicator on label", + "type": "boolean" + } + }, + "additionalProperties": false + }, + "type": { "const": "TextArea" }, + "textResourceBindings": { + "properties": { + "title": { + "title": "Title", + "description": "Label text/title shown above the component", + "$ref": "expression.schema.v1.json#/definitions/string" + }, + "description": { + "title": "Description", + "description": "Label description shown above the component, below the title", + "$ref": "expression.schema.v1.json#/definitions/string" + }, + "help": { + "title": "Help text", + "description": "Help text shown in a tooltip when clicking the help button", + "$ref": "expression.schema.v1.json#/definitions/string" + }, + "tableTitle": { + "title": "Table title", + "description": "Title used in the table view (overrides the default title)", + "$ref": "expression.schema.v1.json#/definitions/string" + }, + "shortName": { + "title": "Short name (for validation)", + "description": "Alternative name used for required validation messages (overrides the default title)", + "$ref": "expression.schema.v1.json#/definitions/string" + }, + "requiredValidation": { + "title": "Required validation message", + "description": "Full validation message shown when the component is required and no value has been entered (overrides both the default and shortName)", + "$ref": "expression.schema.v1.json#/definitions/string" + }, + "summaryTitle": { + "title": "Summary title", + "description": "Title used in the summary view (overrides the default title)", + "$ref": "expression.schema.v1.json#/definitions/string" + }, + "summaryAccessibleTitle": { + "title": "Accessible summary title", + "description": "Title used for aria-label on the edit button in the summary view (overrides the default and summary title)", + "$ref": "expression.schema.v1.json#/definitions/string" + } + } + }, + "dataModelBindings": { + "title": "Data model binding", + "description": "Describes the location in the data model where the component should store its value(s). A simple binding is used for components that only store a single value, usually a string.", + "type": "object", + "properties": { "simpleBinding": { "type": "string" } }, + "required": ["simpleBinding"], + "additionalProperties": false + }, + "saveWhileTyping": { + "title": "Automatic saving while typing", + "description": "Lets you control how long we wait before saving the value locally while typing. This value is usually also used to determine how long we wait before saving the value to the server. The default value is 400 milliseconds.", + "default": 400, + "type": "number" + }, + "autocomplete": { + "title": "HTML autocomplete values", + "description": "Autocomplete hints to the browser. See https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/autocomplete", + "enum": [ + "on", + "off", + "name", + "honorific-prefix", + "given-name", + "additional-name", + "family-name", + "honorific-suffix", + "nickname", + "email", + "username", + "new-password", + "current-password", + "one-time-code", + "organization-title", + "organization", + "street-address", + "address-line1", + "address-line2", + "address-line3", + "address-level4", + "address-level3", + "address-level2", + "address-level1", + "country", + "country-name", + "postal-code", + "cc-name", + "cc-given-name", + "cc-additional-name", + "cc-family-name", + "cc-number", + "cc-exp", + "cc-exp-month", + "cc-exp-year", + "cc-csc", + "cc-type", + "transaction-currency", + "transaction-amount", + "language", + "bday", + "bday-day", + "bday-month", + "bday-year", + "sex", + "tel", + "tel-country-code", + "tel-national", + "tel-area-code", + "tel-local", + "tel-extension", + "impp", + "url", + "photo" + ], + "type": "string" + }, + "maxLength": { + "title": "Max length", + "description": "Max length of the input field. Will add a counter to let the user know how many characters are left.", + "type": "integer" + } + }, + "required": ["id", "type", "dataModelBindings"], + "title": "TextArea component schema" +} diff --git a/frontend/packages/ux-editor/src/testing/schemas/json/component/Video.schema.v1.json b/frontend/packages/ux-editor/src/testing/schemas/json/component/Video.schema.v1.json index eebe3e916c0..6302443a758 100644 --- a/frontend/packages/ux-editor/src/testing/schemas/json/component/Video.schema.v1.json +++ b/frontend/packages/ux-editor/src/testing/schemas/json/component/Video.schema.v1.json @@ -1 +1,72 @@ -{"$id":"https://altinncdn.no/schemas/json/component/Video.schema.v1.json","$schema":"http://json-schema.org/draft-07/schema#","properties":{"id":{"title":"ID","description":"The component ID. Must be unique within all layouts/pages in a layout-set. Cannot end with .","type":"string","pattern":"^[0-9a-zA-Z][0-9a-zA-Z-]*(-?[a-zA-Z]+|[a-zA-Z][0-9]+|-[0-9]{6,})$"},"hidden":{"title":"Hidden","description":"Boolean value or expression indicating if the component should be hidden. Defaults to false.","default":false,"$ref":"expression.schema.v1.json#/definitions/boolean"},"grid":{"properties":{"xs":{"$ref":"#/definitions/IGridSize"},"sm":{"$ref":"#/definitions/IGridSize"},"md":{"$ref":"#/definitions/IGridSize"},"lg":{"$ref":"#/definitions/IGridSize"},"xl":{"$ref":"#/definitions/IGridSize"},"labelGrid":{"$ref":"#/definitions/IGridStyling"},"innerGrid":{"$ref":"#/definitions/IGridStyling"}}},"pageBreak":{"title":"Page break","description":"Optionally insert page-break before/after component when rendered in PDF","type":"object","properties":{"breakBefore":{"title":"Page break before","description":"PDF only: Value or expression indicating whether a page break should be added before the component. Can be either: 'auto' (default), 'always', or 'avoid'.","examples":["auto","always","avoid"],"default":"auto","$ref":"expression.schema.v1.json#/definitions/string"},"breakAfter":{"title":"Page break after","description":"PDF only: Value or expression indicating whether a page break should be added after the component. Can be either: 'auto' (default), 'always', or 'avoid'.","examples":["auto","always","avoid"],"default":"auto","$ref":"expression.schema.v1.json#/definitions/string"}},"additionalProperties":false},"type":{"const":"Video"},"textResourceBindings":{"type":"object","properties":{"altText":{"title":"Alt text","description":"Alternative text for the video (for screen readers).","$ref":"expression.schema.v1.json#/definitions/string"}},"additionalProperties":false},"video":{"title":"IVideo","type":"object","properties":{"src":{"$ref":"#/definitions/VideoSrc"}},"required":["src"],"additionalProperties":false}},"required":["id","type"],"title":"Video component schema"} \ No newline at end of file +{ + "$id": "https://altinncdn.no/schemas/json/component/Video.schema.v1.json", + "$schema": "http://json-schema.org/draft-07/schema#", + "properties": { + "id": { + "title": "ID", + "description": "The component ID. Must be unique within all layouts/pages in a layout-set. Cannot end with .", + "type": "string", + "pattern": "^[0-9a-zA-Z][0-9a-zA-Z-]*(-?[a-zA-Z]+|[a-zA-Z][0-9]+|-[0-9]{6,})$" + }, + "hidden": { + "title": "Hidden", + "description": "Boolean value or expression indicating if the component should be hidden. Defaults to false.", + "default": false, + "$ref": "expression.schema.v1.json#/definitions/boolean" + }, + "grid": { + "properties": { + "xs": { "$ref": "#/definitions/IGridSize" }, + "sm": { "$ref": "#/definitions/IGridSize" }, + "md": { "$ref": "#/definitions/IGridSize" }, + "lg": { "$ref": "#/definitions/IGridSize" }, + "xl": { "$ref": "#/definitions/IGridSize" }, + "labelGrid": { "$ref": "#/definitions/IGridStyling" }, + "innerGrid": { "$ref": "#/definitions/IGridStyling" } + } + }, + "pageBreak": { + "title": "Page break", + "description": "Optionally insert page-break before/after component when rendered in PDF", + "type": "object", + "properties": { + "breakBefore": { + "title": "Page break before", + "description": "PDF only: Value or expression indicating whether a page break should be added before the component. Can be either: 'auto' (default), 'always', or 'avoid'.", + "examples": ["auto", "always", "avoid"], + "default": "auto", + "$ref": "expression.schema.v1.json#/definitions/string" + }, + "breakAfter": { + "title": "Page break after", + "description": "PDF only: Value or expression indicating whether a page break should be added after the component. Can be either: 'auto' (default), 'always', or 'avoid'.", + "examples": ["auto", "always", "avoid"], + "default": "auto", + "$ref": "expression.schema.v1.json#/definitions/string" + } + }, + "additionalProperties": false + }, + "type": { "const": "Video" }, + "textResourceBindings": { + "type": "object", + "properties": { + "altText": { + "title": "Alt text", + "description": "Alternative text for the video (for screen readers).", + "$ref": "expression.schema.v1.json#/definitions/string" + } + }, + "additionalProperties": false + }, + "video": { + "title": "IVideo", + "type": "object", + "properties": { "src": { "$ref": "#/definitions/VideoSrc" } }, + "required": ["src"], + "additionalProperties": false + } + }, + "required": ["id", "type"], + "title": "Video component schema" +} From aa1a2e222deec78c11e7cd1ce1c6b190a3538314 Mon Sep 17 00:00:00 2001 From: Erling Hauan Date: Fri, 4 Oct 2024 14:42:13 +0200 Subject: [PATCH 7/7] Rerun component script for frontend v4 --- .../src/testing/schemas/json/component/Accordion.schema.v1.json | 2 +- .../src/testing/schemas/json/component/Group.schema.v1.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/frontend/packages/ux-editor/src/testing/schemas/json/component/Accordion.schema.v1.json b/frontend/packages/ux-editor/src/testing/schemas/json/component/Accordion.schema.v1.json index 5b94321f856..f7bfd4c0572 100644 --- a/frontend/packages/ux-editor/src/testing/schemas/json/component/Accordion.schema.v1.json +++ b/frontend/packages/ux-editor/src/testing/schemas/json/component/Accordion.schema.v1.json @@ -91,7 +91,7 @@ "default": false, "$ref": "expression.schema.v1.json#/definitions/boolean" }, - "headingLevel": { "title": "HeadingLevel", "enum": [2, 3, 4, 5, 6], "type": "string" } + "headingLevel": { "title": "HeadingLevel", "enum": [2, 3, 4, 5, 6], "type": "number" } }, "required": ["id", "type", "children"], "title": "Accordion component schema" diff --git a/frontend/packages/ux-editor/src/testing/schemas/json/component/Group.schema.v1.json b/frontend/packages/ux-editor/src/testing/schemas/json/component/Group.schema.v1.json index 1c4c05f295c..e355a660449 100644 --- a/frontend/packages/ux-editor/src/testing/schemas/json/component/Group.schema.v1.json +++ b/frontend/packages/ux-editor/src/testing/schemas/json/component/Group.schema.v1.json @@ -100,7 +100,7 @@ "title": "Heading level", "description": "The heading level of the group title.", "enum": [2, 3, 4, 5, 6], - "type": "string" + "type": "number" } }, "required": ["id", "type", "children"],