Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(ui-editor): add lookup components #14516

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 30 additions & 0 deletions backend/src/Designer/Controllers/PreviewController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -676,6 +676,36 @@ public IActionResult ValidationConfig(string org, string app, string modelname)
return Ok();
}

/// <summary>
/// Action for mocking the GET method for organisation lookup for v4 apps
/// </summary>
/// <param name="org">The org</param>
/// <param name="app">The app</param>
/// <param name="organisationNumber">The organisation number to lookup</param>
/// <returns></returns>
[HttpGet]
[Route("api/v1/lookup/organisation/{organisationNumber}")]
public IActionResult OrganisationLookup(string org, string app, string organisationNumber)
{
string lookupResponse = $"{{\"success\":true,\"organisationDetails\":{{\"orgNr\":\"{organisationNumber}\",\"name\":\"Test AS (preview)\"}}}}";
return Ok(lookupResponse);
}

/// <summary>
/// Action for mocking the POST method for person lookup for v4 apps
/// </summary>
/// <param name="org">The org</param>
/// <param name="app">The app</param>
/// <returns></returns>
[HttpPost]
[Route("api/v1/lookup/person")]
public IActionResult PersonLookup(string org, string app)
{
string mockSsn = "12345678912";
string lookupResponse = $"{{\"success\":true,\"personDetails\":{{\"ssn\":\"{mockSsn}\",\"name\":\"Test T. Testesen (preview)\", \"lastName\":\"Testesen (preview)\"}}}}";
return Ok(lookupResponse);
}
Comment on lines +694 to +707
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Enhance the person lookup endpoint with request validation and error handling.

Consider the following improvements:

  1. Add request body model and validation
  2. Return more realistic mock data
  3. Add error handling
  4. Document the expected request format
+/// <summary>
+/// Request model for person lookup
+/// </summary>
+public class PersonLookupRequest
+{
+    public string SearchTerm { get; set; }
+    public string SearchType { get; set; } // e.g., "ssn", "name"
+}

 [HttpPost]
 [Route("api/v1/lookup/person")]
-public IActionResult PersonLookup(string org, string app)
+public IActionResult PersonLookup(string org, string app, [FromBody] PersonLookupRequest request)
 {
+    if (request == null || string.IsNullOrEmpty(request.SearchTerm))
+    {
+        return BadRequest(new { success = false, message = "Invalid request" });
+    }
+
     string mockSsn = "12345678912";
-    string lookupResponse = $"{{\"success\":true,\"personDetails\":{{\"ssn\":\"{mockSsn}\",\"name\":\"Test T. Testesen (preview)\", \"lastName\":\"Testesen (preview)\"}}}}";
+    string lookupResponse = $@"{{
+        ""success"": true,
+        ""personDetails"": {{
+            ""ssn"": ""{mockSsn}"",
+            ""firstName"": ""Test"",
+            ""middleName"": ""T."",
+            ""lastName"": ""Testesen (preview)"",
+            ""address"": {{
+                ""street"": ""Test Street 1"",
+                ""postalCode"": ""0123"",
+                ""city"": ""Oslo""
+            }}
+        }}
+    }}";
     return Ok(lookupResponse);
 }
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
/// <summary>
/// Action for mocking the POST method for person lookup for v4 apps
/// </summary>
/// <param name="org">The org</param>
/// <param name="app">The app</param>
/// <returns></returns>
[HttpPost]
[Route("api/v1/lookup/person")]
public IActionResult PersonLookup(string org, string app)
{
string mockSsn = "12345678912";
string lookupResponse = $"{{\"success\":true,\"personDetails\":{{\"ssn\":\"{mockSsn}\",\"name\":\"Test T. Testesen (preview)\", \"lastName\":\"Testesen (preview)\"}}}}";
return Ok(lookupResponse);
}
/// <summary>
/// Request model for person lookup
/// </summary>
public class PersonLookupRequest
{
public string SearchTerm { get; set; }
public string SearchType { get; set; } // e.g., "ssn", "name"
}
/// <summary>
/// Action for mocking the POST method for person lookup for v4 apps
/// </summary>
/// <param name="org">The org</param>
/// <param name="app">The app</param>
/// <returns></returns>
[HttpPost]
[Route("api/v1/lookup/person")]
public IActionResult PersonLookup(string org, string app, [FromBody] PersonLookupRequest request)
{
if (request == null || string.IsNullOrEmpty(request.SearchTerm))
{
return BadRequest(new { success = false, message = "Invalid request" });
}
string mockSsn = "12345678912";
string lookupResponse = $@"{{
""success"": true,
""personDetails"": {{
""ssn"": ""{mockSsn}"",
""firstName"": ""Test"",
""middleName"": ""T."",
""lastName"": ""Testesen (preview)"",
""address"": {{
""street"": ""Test Street 1"",
""postalCode"": ""0123"",
""city"": ""Oslo""
}}
}}
}}";
return Ok(lookupResponse);
}


private static string GetSelectedLayoutSetInEditorFromRefererHeader(string refererHeader)
{
Uri refererUri = new(refererHeader);
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
using System;
using System.Net;
using System.Net.Http;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc.Testing;
using Xunit;

namespace Designer.Tests.Controllers.PreviewController
{
public class OrganisationLookupTests : PreviewControllerTestsBase<OrganisationLookupTests>, IClassFixture<WebApplicationFactory<Program>>
{
protected const string organisationNumber = "123456789";

public OrganisationLookupTests(WebApplicationFactory<Program> factory) : base(factory)
{
}

[Fact]
public async Task Get_OrganisationLookup_Ok()
{
string dataPathWithData = $"{Org}/{AppV4}/api/v1/lookup/organisation/{organisationNumber}";
using HttpRequestMessage httpRequestMessage = new(HttpMethod.Get, dataPathWithData);
httpRequestMessage.Headers.Referrer = new Uri($"{MockedReferrerUrl}?org={Org}&app={AppV4}&selectedLayoutSet=");

using HttpResponseMessage response = await HttpClient.SendAsync(httpRequestMessage);
Assert.Equal(HttpStatusCode.OK, response.StatusCode);

string responseBody = await response.Content.ReadAsStringAsync();
Assert.Contains(organisationNumber, responseBody);
Assert.Contains("Test AS", responseBody);
}
Comment on lines +18 to +31
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Enhance test coverage with additional scenarios.

Similar to PersonLookupTests, consider adding tests for:

  • Invalid organisation numbers (e.g., non-numeric, wrong length)
  • Missing referrer header
  • Error responses

Example test case:

[Theory]
[InlineData("12345")]  // Too short
[InlineData("1234567890")] // Too long
[InlineData("abcdefghi")] // Non-numeric
public async Task Get_OrganisationLookup_InvalidNumber_ReturnsBadRequest(string invalidNumber)
{
    string dataPathWithData = $"{Org}/{AppV4}/api/v1/lookup/organisation/{invalidNumber}";
    using HttpRequestMessage httpRequestMessage = new(HttpMethod.Get, dataPathWithData);
    httpRequestMessage.Headers.Referrer = new Uri($"{MockedReferrerUrl}?org={Org}&app={AppV4}&selectedLayoutSet=");

    using HttpResponseMessage response = await HttpClient.SendAsync(httpRequestMessage);
    Assert.Equal(HttpStatusCode.BadRequest, response.StatusCode);
}

Comment on lines +18 to +31
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Enhance test coverage with additional test cases.

The current test only covers the happy path. Consider adding:

  • Test with invalid organisation number format
  • Test with non-existent organisation number
  • Validation of complete response structure
+ [Fact]
+ public async Task Get_OrganisationLookup_InvalidFormat_ReturnsBadRequest()
+ {
+     string invalidOrgNumber = "invalid";
+     string dataPathWithData = $"{Org}/{AppV4}/api/v1/lookup/organisation/{invalidOrgNumber}";
+     using HttpRequestMessage httpRequestMessage = new(HttpMethod.Get, dataPathWithData);
+     httpRequestMessage.Headers.Referrer = new Uri($"{MockedReferrerUrl}?org={Org}&app={AppV4}&selectedLayoutSet=");
+ 
+     using HttpResponseMessage response = await HttpClient.SendAsync(httpRequestMessage);
+     Assert.Equal(HttpStatusCode.BadRequest, response.StatusCode);
+ }
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
[Fact]
public async Task Get_OrganisationLookup_Ok()
{
string dataPathWithData = $"{Org}/{AppV4}/api/v1/lookup/organisation/{organisationNumber}";
using HttpRequestMessage httpRequestMessage = new(HttpMethod.Get, dataPathWithData);
httpRequestMessage.Headers.Referrer = new Uri($"{MockedReferrerUrl}?org={Org}&app={AppV4}&selectedLayoutSet=");
using HttpResponseMessage response = await HttpClient.SendAsync(httpRequestMessage);
Assert.Equal(HttpStatusCode.OK, response.StatusCode);
string responseBody = await response.Content.ReadAsStringAsync();
Assert.Contains(organisationNumber, responseBody);
Assert.Contains("Test AS", responseBody);
}
[Fact]
public async Task Get_OrganisationLookup_Ok()
{
string dataPathWithData = $"{Org}/{AppV4}/api/v1/lookup/organisation/{organisationNumber}";
using HttpRequestMessage httpRequestMessage = new(HttpMethod.Get, dataPathWithData);
httpRequestMessage.Headers.Referrer = new Uri($"{MockedReferrerUrl}?org={Org}&app={AppV4}&selectedLayoutSet=");
using HttpResponseMessage response = await HttpClient.SendAsync(httpRequestMessage);
Assert.Equal(HttpStatusCode.OK, response.StatusCode);
string responseBody = await response.Content.ReadAsStringAsync();
Assert.Contains(organisationNumber, responseBody);
Assert.Contains("Test AS", responseBody);
}
[Fact]
public async Task Get_OrganisationLookup_InvalidFormat_ReturnsBadRequest()
{
string invalidOrgNumber = "invalid";
string dataPathWithData = $"{Org}/{AppV4}/api/v1/lookup/organisation/{invalidOrgNumber}";
using HttpRequestMessage httpRequestMessage = new(HttpMethod.Get, dataPathWithData);
httpRequestMessage.Headers.Referrer = new Uri($"{MockedReferrerUrl}?org={Org}&app={AppV4}&selectedLayoutSet=");
using HttpResponseMessage response = await HttpClient.SendAsync(httpRequestMessage);
Assert.Equal(HttpStatusCode.BadRequest, response.StatusCode);
}

}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
using System;
using System.Net;
using System.Net.Http;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc.Testing;
using Xunit;

namespace Designer.Tests.Controllers.PreviewController
{
public class PersonLookupTests : PreviewControllerTestsBase<PersonLookupTests>, IClassFixture<WebApplicationFactory<Program>>
{

public PersonLookupTests(WebApplicationFactory<Program> factory) : base(factory)
{
}

[Fact]
public async Task Post_PersonLookup_Ok()
{
string dataPathWithData = $"{Org}/{AppV4}/api/v1/lookup/person";
using HttpRequestMessage httpRequestMessage = new(HttpMethod.Post, dataPathWithData);
httpRequestMessage.Headers.Referrer = new Uri($"{MockedReferrerUrl}?org={Org}&app={AppV4}&selectedLayoutSet=");

using HttpResponseMessage response = await HttpClient.SendAsync(httpRequestMessage);
Assert.Equal(HttpStatusCode.OK, response.StatusCode);

string responseBody = await response.Content.ReadAsStringAsync();
Assert.Contains("Test T. Testesen", responseBody);
}
Comment on lines +17 to +29
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Add test coverage for error scenarios.

The current test only covers the successful case. Consider adding tests for:

  • Invalid request parameters
  • Missing referrer header
  • Error responses from the lookup service

Example test case:

[Fact]
public async Task Post_PersonLookup_MissingReferrer_ReturnsBadRequest()
{
    string dataPathWithData = $"{Org}/{AppV4}/api/v1/lookup/person";
    using HttpRequestMessage httpRequestMessage = new(HttpMethod.Post, dataPathWithData);
    // No referrer header set

    using HttpResponseMessage response = await HttpClient.SendAsync(httpRequestMessage);
    Assert.Equal(HttpStatusCode.BadRequest, response.StatusCode);
}

Comment on lines +17 to +29
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Enhance test coverage with additional test cases.

The current test only covers the happy path. Consider adding:

  • Test cases for invalid requests
  • Validation of the complete response structure
  • Edge cases (empty/invalid search criteria)
+ [Fact]
+ public async Task Post_PersonLookup_InvalidRequest_ReturnsBadRequest()
+ {
+     string dataPathWithData = $"{Org}/{AppV4}/api/v1/lookup/person";
+     using HttpRequestMessage httpRequestMessage = new(HttpMethod.Post, dataPathWithData);
+     httpRequestMessage.Content = new StringContent("invalid_request_body");
+ 
+     using HttpResponseMessage response = await HttpClient.SendAsync(httpRequestMessage);
+     Assert.Equal(HttpStatusCode.BadRequest, response.StatusCode);
+ }

Committable suggestion skipped: line range outside the PR's diff.

}
}
18 changes: 18 additions & 0 deletions frontend/packages/shared/src/types/ComponentSpecificConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,16 @@ export type DataModelBindingsSimple = {

type DataModelBindingsForFileUpload = DataModelBindingsSimple | DataModelBindingsList;

type DataModelBindingsOrganisationLookup = {
organisation_lookup_orgnr: string | InternalBindingFormat;
organisation_lookup_name?: string | InternalBindingFormat;
};

type DataModelBindingsPersonLookup = {
person_lookup_ssn: string | InternalBindingFormat;
person_lookup_name: string | InternalBindingFormat;
};

type Option<T extends string | boolean | number = string | boolean | number> = {
label: string;
value: T;
Expand Down Expand Up @@ -330,13 +340,21 @@ export type ComponentSpecificConfig<T extends ComponentType = ComponentType> = {
validateOnNext?: PageValidation;
validateOnPrevious?: PageValidation;
};
[ComponentType.OrganisationLookup]: FormComponentProps &
SummarizableComponentProps & {
dataModelBindings: DataModelBindingsOrganisationLookup;
};
[ComponentType.Panel]: {
variant?: FormPanelVariant;
showIcon?: boolean;
};
[ComponentType.Paragraph]: {};
[ComponentType.Payment]: SummarizableComponentProps;
[ComponentType.PaymentDetails]: {};
[ComponentType.PersonLookup]: FormComponentProps &
SummarizableComponentProps & {
dataModelBindings: DataModelBindingsPersonLookup;
};
[ComponentType.PrintButton]: {};
[ComponentType.RadioButtons]: FormComponentProps &
SummarizableComponentProps &
Expand Down
2 changes: 2 additions & 0 deletions frontend/packages/shared/src/types/ComponentType.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,12 @@ export enum ComponentType {
MultipleSelect = 'MultipleSelect',
NavigationBar = 'NavigationBar',
NavigationButtons = 'NavigationButtons',
OrganisationLookup = 'OrganisationLookup',
Panel = 'Panel',
Paragraph = 'Paragraph',
Payment = 'Payment',
PaymentDetails = 'PaymentDetails',
PersonLookup = 'PersonLookup',
PrintButton = 'PrintButton',
RadioButtons = 'RadioButtons',
RepeatingGroup = 'RepeatingGroup',
Expand Down
22 changes: 21 additions & 1 deletion frontend/packages/ux-editor/src/data/formItemConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -390,6 +390,12 @@ export const formItemConfigs: FormItemConfigs = {
propertyPath: 'definitions/navigationButtonsComponent',
icon: FingerButtonIcon,
},
[ComponentType.OrganisationLookup]: {
name: ComponentType.OrganisationLookup,
itemType: LayoutItemType.Component,
defaultProperties: {},
icon: ShortTextIcon,
},
[ComponentType.Panel]: {
name: ComponentType.Panel,
itemType: LayoutItemType.Component,
Expand Down Expand Up @@ -422,6 +428,12 @@ export const formItemConfigs: FormItemConfigs = {
defaultProperties: {},
icon: PaymentDetailsIcon,
},
[ComponentType.PersonLookup]: {
name: ComponentType.PersonLookup,
itemType: LayoutItemType.Component,
defaultProperties: {},
icon: ShortTextIcon,
},
[ComponentType.PrintButton]: {
name: ComponentType.PrintButton,
itemType: LayoutItemType.Component,
Expand Down Expand Up @@ -516,6 +528,8 @@ export const schemaComponents: FormItemConfigs[ComponentType][] = [
formItemConfigs[ComponentType.RadioButtons],
formItemConfigs[ComponentType.Dropdown],
formItemConfigs[ComponentType.MultipleSelect],
formItemConfigs[ComponentType.OrganisationLookup],
formItemConfigs[ComponentType.PersonLookup],
formItemConfigs[ComponentType.Likert],
formItemConfigs[ComponentType.Datepicker],
formItemConfigs[ComponentType.FileUpload],
Expand Down Expand Up @@ -576,7 +590,13 @@ export const defaultComponents: ComponentType[] = [
];

export const allComponents: KeyValuePairs<ComponentType[]> = {
form: [ComponentType.Input, ComponentType.TextArea, ComponentType.Datepicker],
form: [
ComponentType.Input,
ComponentType.TextArea,
ComponentType.Datepicker,
ComponentType.OrganisationLookup,
ComponentType.PersonLookup,
],
text: [ComponentType.Header, ComponentType.Paragraph, ComponentType.Panel, ComponentType.Alert],
select: [
ComponentType.Checkboxes,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,12 @@ import MapSchema from './schemas/json/component/Map.schema.v1.json';
import MultipleSelectSchema from './schemas/json/component/MultipleSelect.schema.v1.json';
import NavigationBarSchema from './schemas/json/component/NavigationBar.schema.v1.json';
import NavigationButtonsSchema from './schemas/json/component/NavigationButtons.schema.v1.json';
import OrganisationLookupSchema from './schemas/json/component/OrganisationLookup.schema.v1.json';
import PanelSchema from './schemas/json/component/Panel.schema.v1.json';
import ParagraphSchema from './schemas/json/component/Paragraph.schema.v1.json';
import PaymentDetailsSchema from './schemas/json/component/PaymentDetails.schema.v1.json';
import PaymentSchema from './schemas/json/component/Payment.schema.v1.json';
import PersonLookupSchema from './schemas/json/component/PersonLookup.schema.v1.json';
import PrintButtonSchema from './schemas/json/component/PrintButton.schema.v1.json';
import RadioButtonsSchema from './schemas/json/component/RadioButtons.schema.v1.json';
import RepeatingGroupSchema from './schemas/json/component/RepeatingGroup.schema.v1.json';
Expand Down Expand Up @@ -73,10 +75,12 @@ export const componentSchemaMocks: Record<ComponentType, JsonSchema> = {
[ComponentType.MultipleSelect]: MultipleSelectSchema,
[ComponentType.NavigationBar]: NavigationBarSchema,
[ComponentType.NavigationButtons]: NavigationButtonsSchema,
[ComponentType.OrganisationLookup]: OrganisationLookupSchema,
[ComponentType.Panel]: PanelSchema,
[ComponentType.Paragraph]: ParagraphSchema,
[ComponentType.Payment]: PaymentSchema,
[ComponentType.PaymentDetails]: PaymentDetailsSchema,
[ComponentType.PersonLookup]: PersonLookupSchema,
[ComponentType.PrintButton]: PrintButtonSchema,
[ComponentType.RadioButtons]: RadioButtonsSchema,
[ComponentType.RepeatingGroup]: RepeatingGroupSchema,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,148 @@
{
"$id": "https://altinncdn.no/schemas/json/component/OrganisationLookup.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 <dash><number>.",
"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": { "default": "auto", "$ref": "#/definitions/IGridSize" },
"sm": { "default": "auto", "$ref": "#/definitions/IGridSize" },
"md": { "default": "auto", "$ref": "#/definitions/IGridSize" },
"lg": { "default": "auto", "$ref": "#/definitions/IGridSize" },
"xl": { "default": "auto", "$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. <br /> <i>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.<i/>",
"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": "OrganisationLookup" },
"textResourceBindings": {
"properties": {
"title": {
"title": "Title",
"description": "The title of the component",
"$ref": "expression.schema.v1.json#/definitions/string"
},
"description": {
"title": "Description",
"description": "Description, optionally shown below the title",
"$ref": "expression.schema.v1.json#/definitions/string"
},
"help": {
"title": "Help Text",
"description": "Help text, optionally shown next to the title",
"$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": {
"type": "object",
"properties": {
"organisation_lookup_orgnr": { "$ref": "#/definitions/IRawDataModelBinding" },
"organisation_lookup_name": { "$ref": "#/definitions/IRawDataModelBinding" }
},
"required": ["organisation_lookup_orgnr"],
"additionalProperties": false
}
},
"required": ["id", "type", "dataModelBindings"],
"title": "OrganisationLookup component schema"
}
Loading
Loading