Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions src/codegen/Common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,13 @@ const common = {
new CG.obj(
new CG.prop('labelGrid', CG.common('IGridStyling').optional()),
new CG.prop('innerGrid', CG.common('IGridStyling').optional()),
new CG.prop(
'validationGrid',
CG.common('IGridStyling')
.optional()
.setTitle('Validation grid')
.setDescription('Column span for validation messages; defaults to innerGrid when omitted'),
),
)
.extends(CG.common('IGridStyling'))
.setTitle('Grid')
Expand Down
21 changes: 18 additions & 3 deletions src/layout/ComponentStructureWrapper.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,16 +31,31 @@ export function ComponentStructureWrapper({
const showValidationMessages = layoutComponent.renderDefaultValidations();
const indexedId = useIndexedId(baseComponentId);

const innerGrid = grid?.innerGrid;
const validationGrid = grid?.validationGrid ?? innerGrid;

const componentWithValidations = (
<Flex
id={`form-content-${indexedId}`}
className={className}
size={{ xs: 12, ...grid?.innerGrid }}
size={{ xs: 12 }}
style={style}
item
>
{children}
{showValidationMessages && <AllComponentValidations baseComponentId={baseComponentId} />}
<Flex
item
size={{ xs: 12, ...innerGrid }}
>
{children}
</Flex>
{showValidationMessages && (
<Flex
item
size={{ xs: 12, ...validationGrid }}
Comment thread
JamalAlabdullah marked this conversation as resolved.
>
<AllComponentValidations baseComponentId={baseComponentId} />
</Flex>
)}
</Flex>
);

Expand Down
2 changes: 1 addition & 1 deletion test/e2e/integration/frontend-test/formatting.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ const appFrontend = new AppFrontend();
describe('Formatting', () => {
it('Number formatting', () => {
cy.goto('changename');
cy.get('#form-content-newFirstName').should('have.css', 'flex', '0 1 50%');
cy.get('#form-content-newFirstName').invoke('css', 'flex').should('match', /^0 1 /);
cy.get('[data-componentid=newFirstName]').should('have.css', 'border-bottom', '1px dashed rgb(148, 148, 148)');
cy.get(appFrontend.changeOfName.mobilenummer).type('44444444');
cy.get(appFrontend.changeOfName.mobilenummer).should('have.value', '+47 444 44 444');
Expand Down
2 changes: 1 addition & 1 deletion test/e2e/pageobjects/app-frontend.ts
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ export class AppFrontend {
secondGroup_table: '[id^="group-group2-table"]',
subGroup: '[id^="group-subGroup"]',
currentValue: 'input[id^="currentValue"]',
navigationBarButton: '#form-content-nav2 > div > nav > button',
navigationBarButton: '#form-content-nav2 [data-testid="NavigationBar"] > button[aria-controls="navigation-menu"]',
newValue: 'input[id^="newValue"]',
newValueLabel: 'label[for^="newValue"]',
addNewItem: '[id^="add-button-mainGroup"]',
Expand Down
Loading