@ukhomeoffice/cop-react-form-renderer 5.90.1 → 5.91.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/CheckYourAnswers/Answer.js +15 -15
- package/dist/components/CheckYourAnswers/Answer.test.js +181 -132
- package/dist/components/CheckYourAnswers/CheckYourAnswers.js +142 -106
- package/dist/components/CheckYourAnswers/CheckYourAnswers.test.js +941 -563
- package/dist/components/CheckYourAnswers/index.js +1 -1
- package/dist/components/CollectionPage/CollectionPage.js +66 -75
- package/dist/components/CollectionPage/CollectionPage.test.js +369 -318
- package/dist/components/CollectionPage/index.js +1 -1
- package/dist/components/CollectionSummary/BannerStrip.js +15 -15
- package/dist/components/CollectionSummary/BannerStrip.test.js +79 -83
- package/dist/components/CollectionSummary/CollectionSummary.js +131 -109
- package/dist/components/CollectionSummary/CollectionSummary.test.js +180 -198
- package/dist/components/CollectionSummary/Confirmation.js +13 -15
- package/dist/components/CollectionSummary/Confirmation.test.js +63 -68
- package/dist/components/CollectionSummary/RenderListView.js +63 -46
- package/dist/components/CollectionSummary/RenderListView.scss +9 -0
- package/dist/components/CollectionSummary/RenderListView.test.js +120 -84
- package/dist/components/CollectionSummary/SummaryCard.js +157 -121
- package/dist/components/CollectionSummary/SummaryCard.test.js +1000 -970
- package/dist/components/CollectionSummary/SummaryCardDetails.js +94 -103
- package/dist/components/CollectionSummary/SummaryCardDetails.test.js +195 -187
- package/dist/components/CollectionSummary/SummaryCardValidationContext.js +36 -31
- package/dist/components/CollectionSummary/SummaryCardValidationContext.test.js +76 -64
- package/dist/components/CollectionSummary/index.js +1 -1
- package/dist/components/FormComponent/Collection.js +117 -80
- package/dist/components/FormComponent/Collection.test.js +1082 -910
- package/dist/components/FormComponent/Container.js +38 -43
- package/dist/components/FormComponent/Container.test.js +411 -379
- package/dist/components/FormComponent/FormComponent.js +74 -71
- package/dist/components/FormComponent/FormComponent.test.js +415 -354
- package/dist/components/FormComponent/helpers/addLabel.js +7 -4
- package/dist/components/FormComponent/helpers/getComponentDisabled.js +1 -1
- package/dist/components/FormComponent/helpers/getComponentDisabled.test.js +8 -8
- package/dist/components/FormComponent/helpers/getComponentError.js +5 -3
- package/dist/components/FormComponent/helpers/getComponentError.test.js +15 -15
- package/dist/components/FormComponent/helpers/getComponentFieldSet.js +4 -3
- package/dist/components/FormComponent/helpers/getComponentFieldSet.test.js +7 -7
- package/dist/components/FormComponent/helpers/index.js +5 -5
- package/dist/components/FormComponent/index.js +1 -1
- package/dist/components/FormPage/FormPage.js +87 -71
- package/dist/components/FormPage/FormPage.test.js +170 -133
- package/dist/components/FormPage/index.js +1 -1
- package/dist/components/FormRenderer/FormRenderer.js +198 -153
- package/dist/components/FormRenderer/FormRenderer.test.js +1116 -731
- package/dist/components/FormRenderer/handlers/cyaAction.js +3 -3
- package/dist/components/FormRenderer/handlers/getPageId.js +3 -1
- package/dist/components/FormRenderer/handlers/getPageId.test.js +15 -15
- package/dist/components/FormRenderer/handlers/handlers.test.js +33 -33
- package/dist/components/FormRenderer/handlers/index.js +2 -2
- package/dist/components/FormRenderer/handlers/navigate.js +4 -4
- package/dist/components/FormRenderer/handlers/submissionError.js +1 -1
- package/dist/components/FormRenderer/helpers/canActionProceed.js +1 -1
- package/dist/components/FormRenderer/helpers/canActionProceed.test.js +16 -16
- package/dist/components/FormRenderer/helpers/canCYASubmit.js +3 -1
- package/dist/components/FormRenderer/helpers/canCYASubmit.test.js +21 -17
- package/dist/components/FormRenderer/helpers/cleanHiddenNestedData.js +30 -27
- package/dist/components/FormRenderer/helpers/cleanHiddenNestedData.test.js +21 -21
- package/dist/components/FormRenderer/helpers/getCYA.js +7 -5
- package/dist/components/FormRenderer/helpers/getCYA.test.js +12 -12
- package/dist/components/FormRenderer/helpers/getFormState.js +8 -6
- package/dist/components/FormRenderer/helpers/getFormState.test.js +11 -11
- package/dist/components/FormRenderer/helpers/getNextPageId.js +32 -18
- package/dist/components/FormRenderer/helpers/getNextPageId.test.js +68 -68
- package/dist/components/FormRenderer/helpers/getPage.js +4 -2
- package/dist/components/FormRenderer/helpers/getPage.test.js +12 -12
- package/dist/components/FormRenderer/helpers/getRelevantPages.js +11 -8
- package/dist/components/FormRenderer/helpers/getRelevantPages.test.js +15 -15
- package/dist/components/FormRenderer/helpers/getSubmissionStatus.js +13 -12
- package/dist/components/FormRenderer/helpers/getSubmissionStatus.test.js +98 -104
- package/dist/components/FormRenderer/helpers/getUpdatedSectionStates.js +64 -65
- package/dist/components/FormRenderer/helpers/getUpdatedSectionStates.test.js +79 -72
- package/dist/components/FormRenderer/helpers/index.js +2 -2
- package/dist/components/FormRenderer/index.js +1 -1
- package/dist/components/FormRenderer/onCYAAction.js +54 -61
- package/dist/components/FormRenderer/onCYAAction.test.js +153 -165
- package/dist/components/FormRenderer/onPageAction.js +41 -45
- package/dist/components/FormRenderer/onPageAction.test.js +210 -225
- package/dist/components/FormRenderer/onTaskAction.js +15 -11
- package/dist/components/FormRenderer/onTaskAction.test.js +89 -94
- package/dist/components/PageActions/ActionButton.js +16 -13
- package/dist/components/PageActions/ActionButton.test.js +79 -57
- package/dist/components/PageActions/PageActions.js +11 -11
- package/dist/components/PageActions/PageActions.test.js +116 -87
- package/dist/components/PageActions/index.js +1 -1
- package/dist/components/SummaryList/GroupAction.js +21 -13
- package/dist/components/SummaryList/GroupAction.test.js +37 -41
- package/dist/components/SummaryList/RowAction.js +17 -12
- package/dist/components/SummaryList/RowAction.test.js +37 -41
- package/dist/components/SummaryList/SummaryList.js +28 -23
- package/dist/components/SummaryList/SummaryList.test.js +206 -179
- package/dist/components/SummaryList/SummaryListHeadingRow.js +6 -8
- package/dist/components/SummaryList/SummaryListHeadingRowWithAction.js +5 -7
- package/dist/components/SummaryList/SummaryListRow.js +6 -8
- package/dist/components/SummaryList/SummaryListTitleRow.js +5 -7
- package/dist/components/SummaryList/helpers/getGroupActionAttributes.js +6 -4
- package/dist/components/SummaryList/helpers/getGroupActionAttributes.test.js +24 -24
- package/dist/components/SummaryList/helpers/getRowActionAttributes.js +6 -4
- package/dist/components/SummaryList/helpers/getRowActionAttributes.test.js +24 -24
- package/dist/components/SummaryList/helpers/index.js +2 -2
- package/dist/components/SummaryList/index.js +1 -1
- package/dist/components/TaskList/Task.js +30 -20
- package/dist/components/TaskList/Task.test.js +77 -84
- package/dist/components/TaskList/TaskList.js +84 -53
- package/dist/components/TaskList/TaskList.test.js +150 -150
- package/dist/components/TaskList/TaskState.js +6 -8
- package/dist/components/TaskList/TaskState.test.js +49 -56
- package/dist/components/TaskList/index.js +1 -1
- package/dist/components/index.js +8 -8
- package/dist/context/HooksContext/HooksContext.js +81 -58
- package/dist/context/HooksContext/HooksContext.test.js +36 -27
- package/dist/context/HooksContext/index.js +4 -3
- package/dist/context/ValidationContext/ValidationContext.js +95 -44
- package/dist/context/ValidationContext/ValidationContext.test.js +70 -58
- package/dist/context/ValidationContext/index.js +4 -3
- package/dist/context/index.js +3 -3
- package/dist/hooks/index.js +11 -10
- package/dist/hooks/useAxios.js +41 -15
- package/dist/hooks/useGetRequest.js +98 -62
- package/dist/hooks/useHooks.js +3 -1
- package/dist/hooks/useRefData.js +41 -28
- package/dist/hooks/useValidation.js +3 -1
- package/dist/index.js +15 -14
- package/dist/models/CollectionLabels.js +1 -1
- package/dist/models/ComponentTypes.js +25 -25
- package/dist/models/EventTypes.js +4 -4
- package/dist/models/FormPages.js +4 -4
- package/dist/models/FormTypes.js +8 -8
- package/dist/models/HubFormats.js +3 -3
- package/dist/models/PageAction.js +38 -44
- package/dist/models/TaskStates.js +28 -29
- package/dist/models/index.js +10 -10
- package/dist/setupTests.js +32 -31
- package/dist/utils/CheckYourAnswers/getCYAAction.js +5 -5
- package/dist/utils/CheckYourAnswers/getCYAAction.test.js +55 -53
- package/dist/utils/CheckYourAnswers/getCYACollectionChangeAction.js +27 -17
- package/dist/utils/CheckYourAnswers/getCYACollectionChangeAction.test.js +36 -34
- package/dist/utils/CheckYourAnswers/getCYACollectionDeleteAction.js +34 -20
- package/dist/utils/CheckYourAnswers/getCYACollectionDeleteAction.test.js +45 -43
- package/dist/utils/CheckYourAnswers/getCYARow.js +10 -8
- package/dist/utils/CheckYourAnswers/getCYARow.test.js +87 -87
- package/dist/utils/CheckYourAnswers/getCYARowForGroup.js +25 -19
- package/dist/utils/CheckYourAnswers/getCYARowForGroup.test.js +17 -16
- package/dist/utils/CheckYourAnswers/getCYARowsForCollection.js +45 -39
- package/dist/utils/CheckYourAnswers/getCYARowsForCollection.test.js +75 -72
- package/dist/utils/CheckYourAnswers/getCYARowsForCollectionPage.js +105 -100
- package/dist/utils/CheckYourAnswers/getCYARowsForCollectionPage.test.js +182 -218
- package/dist/utils/CheckYourAnswers/getCYARowsForContainer.js +21 -26
- package/dist/utils/CheckYourAnswers/getCYARowsForContainer.test.js +106 -112
- package/dist/utils/CheckYourAnswers/getCYARowsForPage.js +21 -15
- package/dist/utils/CheckYourAnswers/getCYARowsForPage.test.js +83 -77
- package/dist/utils/CheckYourAnswers/getSummaryListRowForDetails.js +13 -13
- package/dist/utils/CheckYourAnswers/getSummaryListRowForDetails.test.js +19 -14
- package/dist/utils/CheckYourAnswers/index.js +2 -2
- package/dist/utils/CheckYourAnswers/showComponentCYA.js +6 -6
- package/dist/utils/CheckYourAnswers/showComponentCYA.test.js +26 -26
- package/dist/utils/CollectionPage/addCollectionPageEntry.js +3 -3
- package/dist/utils/CollectionPage/addCollectionPageEntry.test.js +6 -6
- package/dist/utils/CollectionPage/duplicateCollectionPageActiveEntry.js +3 -3
- package/dist/utils/CollectionPage/duplicateCollectionPageActiveEntry.test.js +22 -21
- package/dist/utils/CollectionPage/duplicateCollectionPageEntry.js +24 -14
- package/dist/utils/CollectionPage/duplicateCollectionPageEntry.test.js +43 -52
- package/dist/utils/CollectionPage/getCollectionPageActiveId.js +3 -3
- package/dist/utils/CollectionPage/getCollectionPageActiveId.test.js +11 -11
- package/dist/utils/CollectionPage/getCollectionPageActiveIndex.js +12 -7
- package/dist/utils/CollectionPage/getCollectionPageActiveIndex.test.js +23 -23
- package/dist/utils/CollectionPage/getCollectionPageData.js +13 -8
- package/dist/utils/CollectionPage/getCollectionPageData.test.js +20 -20
- package/dist/utils/CollectionPage/getErrorsForCollection.js +26 -25
- package/dist/utils/CollectionPage/getErrorsForCollection.test.js +23 -21
- package/dist/utils/CollectionPage/getQuickEditPage.js +32 -37
- package/dist/utils/CollectionPage/getQuickEditPage.test.js +22 -18
- package/dist/utils/CollectionPage/index.js +2 -2
- package/dist/utils/CollectionPage/mergeCollectionPages.js +42 -37
- package/dist/utils/CollectionPage/mergeCollectionPages.test.js +18 -48
- package/dist/utils/CollectionPage/removeCollectionPageEntry.js +7 -5
- package/dist/utils/CollectionPage/removeCollectionPageEntry.test.js +11 -11
- package/dist/utils/CollectionPage/setCollectionPageData.js +19 -12
- package/dist/utils/CollectionPage/setCollectionPageData.test.js +26 -26
- package/dist/utils/Component/addShowWhen.js +8 -4
- package/dist/utils/Component/addShowWhen.test.js +38 -38
- package/dist/utils/Component/applyToComponentTree.js +20 -19
- package/dist/utils/Component/applyToComponentTree.test.js +33 -28
- package/dist/utils/Component/cleanAttributes.js +13 -10
- package/dist/utils/Component/cleanAttributes.test.js +18 -17
- package/dist/utils/Component/elevateNestedComponents.js +7 -6
- package/dist/utils/Component/elevateNestedComponents.test.js +34 -34
- package/dist/utils/Component/getComponent.js +97 -90
- package/dist/utils/Component/getComponentTests/getComponent.autocomplete.test.js +18 -19
- package/dist/utils/Component/getComponentTests/getComponent.calculation.test.js +63 -50
- package/dist/utils/Component/getComponentTests/getComponent.checkboxes.test.js +49 -40
- package/dist/utils/Component/getComponentTests/getComponent.date.test.js +40 -30
- package/dist/utils/Component/getComponentTests/getComponent.details.test.js +19 -21
- package/dist/utils/Component/getComponentTests/getComponent.email.test.js +23 -18
- package/dist/utils/Component/getComponentTests/getComponent.file.test.js +27 -22
- package/dist/utils/Component/getComponentTests/getComponent.heading.test.js +11 -12
- package/dist/utils/Component/getComponentTests/getComponent.html.test.js +16 -18
- package/dist/utils/Component/getComponentTests/getComponent.insetText.test.js +9 -10
- package/dist/utils/Component/getComponentTests/getComponent.list.test.js +16 -18
- package/dist/utils/Component/getComponentTests/getComponent.multifile.test.js +27 -23
- package/dist/utils/Component/getComponentTests/getComponent.nested.test.js +175 -155
- package/dist/utils/Component/getComponentTests/getComponent.paragraph.test.js +16 -18
- package/dist/utils/Component/getComponentTests/getComponent.phoneNumber.test.js +23 -18
- package/dist/utils/Component/getComponentTests/getComponent.radios.test.js +73 -58
- package/dist/utils/Component/getComponentTests/getComponent.select.test.js +23 -18
- package/dist/utils/Component/getComponentTests/getComponent.text.test.js +23 -18
- package/dist/utils/Component/getComponentTests/getComponent.textArea.test.js +41 -34
- package/dist/utils/Component/getComponentTests/getComponent.time.test.js +32 -23
- package/dist/utils/Component/getComponentTests/getComponent.unknown.test.js +3 -3
- package/dist/utils/Component/getComponentTests/getComponent.warningText.test.js +9 -10
- package/dist/utils/Component/getDefaultValue.js +9 -7
- package/dist/utils/Component/getDefaultValue.test.js +13 -13
- package/dist/utils/Component/getDefaultValueFromConfig.js +24 -24
- package/dist/utils/Component/getDefaultValueFromConfig.test.js +32 -32
- package/dist/utils/Component/index.js +2 -2
- package/dist/utils/Component/isEditable.js +4 -2
- package/dist/utils/Component/isEditable.test.js +15 -14
- package/dist/utils/Component/optionIsSelected.js +4 -2
- package/dist/utils/Component/optionIsSelected.test.js +12 -12
- package/dist/utils/Component/setupContainerComponentsPath.js +31 -29
- package/dist/utils/Component/setupContainerComponentsPath.test.js +16 -16
- package/dist/utils/Component/showComponent.js +4 -3
- package/dist/utils/Component/showComponent.test.js +29 -29
- package/dist/utils/Component/wrapInFormGroup.js +4 -4
- package/dist/utils/Condition/index.js +2 -2
- package/dist/utils/Condition/meetsAllConditions.js +9 -9
- package/dist/utils/Condition/meetsAllConditions.test.js +21 -21
- package/dist/utils/Condition/meetsCondition.js +31 -20
- package/dist/utils/Condition/meetsCondition.test.js +403 -403
- package/dist/utils/Condition/meetsOneCondition.js +6 -6
- package/dist/utils/Condition/meetsOneCondition.test.js +17 -17
- package/dist/utils/Condition/setupConditions.js +19 -14
- package/dist/utils/Condition/setupConditions.test.js +8 -8
- package/dist/utils/Container/getEditableComponents.js +6 -4
- package/dist/utils/Container/getEditableComponents.test.js +46 -44
- package/dist/utils/Container/index.js +2 -2
- package/dist/utils/Container/setupNesting.js +22 -16
- package/dist/utils/Container/setupNesting.test.js +31 -28
- package/dist/utils/Container/showContainer.js +8 -4
- package/dist/utils/Container/showContainer.test.js +31 -31
- package/dist/utils/Data/applyFormula.js +50 -40
- package/dist/utils/Data/applyFormula.test.js +26 -26
- package/dist/utils/Data/deleteValues.js +8 -4
- package/dist/utils/Data/deleteValues.test.js +11 -11
- package/dist/utils/Data/getAutocompleteSource.js +29 -20
- package/dist/utils/Data/getAutocompleteSource.test.js +87 -81
- package/dist/utils/Data/getDataPath.js +30 -20
- package/dist/utils/Data/getDataPath.test.js +20 -20
- package/dist/utils/Data/getOptions.js +34 -27
- package/dist/utils/Data/getOptions.test.js +28 -28
- package/dist/utils/Data/getSourceData.js +19 -6
- package/dist/utils/Data/getSourceData.test.js +81 -85
- package/dist/utils/Data/index.js +2 -2
- package/dist/utils/Data/nestInRefdataOptions.js +16 -9
- package/dist/utils/Data/nestInRefdataOptions.test.js +17 -17
- package/dist/utils/Data/refDataToOptions.js +15 -11
- package/dist/utils/Data/refDataToOptions.test.js +20 -20
- package/dist/utils/Data/setDataItem.js +8 -7
- package/dist/utils/Data/setDataItem.test.js +38 -38
- package/dist/utils/Data/setupFormData.js +22 -14
- package/dist/utils/Data/setupFormData.test.js +51 -52
- package/dist/utils/Data/setupRefDataUrlForComponent.js +28 -21
- package/dist/utils/Data/setupRefDataUrlForComponent.test.js +28 -28
- package/dist/utils/FormPage/applyConditionalProperties.js +10 -6
- package/dist/utils/FormPage/applyConditionalProperties.test.js +19 -16
- package/dist/utils/FormPage/getConditionalText.js +4 -4
- package/dist/utils/FormPage/getConditionalText.test.js +35 -35
- package/dist/utils/FormPage/getFormPage.js +17 -16
- package/dist/utils/FormPage/getFormPage.test.js +48 -49
- package/dist/utils/FormPage/getFormPages.js +13 -8
- package/dist/utils/FormPage/getFormPages.test.js +25 -22
- package/dist/utils/FormPage/getPageActions.js +17 -10
- package/dist/utils/FormPage/getPageActions.test.js +33 -33
- package/dist/utils/FormPage/getParagraphFromText.js +7 -5
- package/dist/utils/FormPage/getParagraphFromText.test.js +7 -7
- package/dist/utils/FormPage/index.js +5 -3
- package/dist/utils/FormPage/showFormPage.js +8 -4
- package/dist/utils/FormPage/showFormPage.test.js +33 -33
- package/dist/utils/FormPage/showFormPageCYA.js +3 -3
- package/dist/utils/FormPage/showFormPageCYA.test.js +9 -9
- package/dist/utils/FormPage/useComponent.js +28 -21
- package/dist/utils/FormPage/useComponent.test.js +80 -78
- package/dist/utils/Format/formatData.js +1 -1
- package/dist/utils/Format/formatData.test.js +19 -19
- package/dist/utils/Format/formatDataForComponent.js +7 -6
- package/dist/utils/Format/formatDataForComponent.test.js +78 -50
- package/dist/utils/Format/formatDataForForm.js +8 -6
- package/dist/utils/Format/formatDataForForm.test.js +17 -14
- package/dist/utils/Format/formatDataForPage.js +5 -4
- package/dist/utils/Format/formatDataForPage.test.js +25 -20
- package/dist/utils/Format/index.js +2 -2
- package/dist/utils/Hub/getFormHub.js +2 -2
- package/dist/utils/Hub/getFormHub.test.js +32 -29
- package/dist/utils/Hub/index.js +2 -2
- package/dist/utils/Meta/constants.js +2 -2
- package/dist/utils/Meta/documents/getDocuments.js +4 -1
- package/dist/utils/Meta/documents/getDocuments.test.js +17 -25
- package/dist/utils/Meta/documents/index.js +2 -2
- package/dist/utils/Meta/documents/setDocumentsForField.js +17 -15
- package/dist/utils/Meta/documents/setDocumentsForField.test.js +35 -69
- package/dist/utils/Meta/index.js +2 -2
- package/dist/utils/Operate/checkValueIsTruthy.js +4 -4
- package/dist/utils/Operate/checkValueIsTruthy.test.js +17 -17
- package/dist/utils/Operate/deleteValueInFormData.js +3 -3
- package/dist/utils/Operate/deleteValueInFormData.test.js +15 -15
- package/dist/utils/Operate/getFirstOf.js +8 -8
- package/dist/utils/Operate/getFirstOf.test.js +33 -33
- package/dist/utils/Operate/getIndexOfMatchingValueIn.js +12 -12
- package/dist/utils/Operate/getIndexOfMatchingValueIn.test.js +53 -47
- package/dist/utils/Operate/getLength.js +11 -11
- package/dist/utils/Operate/getLength.test.js +19 -19
- package/dist/utils/Operate/index.js +2 -2
- package/dist/utils/Operate/persistValueInFormData.js +6 -6
- package/dist/utils/Operate/persistValueInFormData.test.js +21 -23
- package/dist/utils/Operate/runPageOperations.js +9 -9
- package/dist/utils/Operate/runPageOperations.test.js +37 -36
- package/dist/utils/Operate/setValueInFormData.js +5 -5
- package/dist/utils/Operate/setValueInFormData.test.js +17 -17
- package/dist/utils/Operate/shouldRun.js +8 -8
- package/dist/utils/Operate/shouldRun.test.js +28 -22
- package/dist/utils/Validate/additional/conditionallyPermittedChange.js +1 -1
- package/dist/utils/Validate/additional/conditionallyPermittedChange.test.js +15 -15
- package/dist/utils/Validate/additional/conditionallyRequired.js +5 -4
- package/dist/utils/Validate/additional/conditionallyRequired.test.js +19 -19
- package/dist/utils/Validate/additional/index.js +8 -8
- package/dist/utils/Validate/additional/index.test.js +22 -22
- package/dist/utils/Validate/additional/mustBeAfter.js +3 -3
- package/dist/utils/Validate/additional/mustBeAfter.test.js +41 -41
- package/dist/utils/Validate/additional/mustBeBefore.js +3 -3
- package/dist/utils/Validate/additional/mustBeBefore.test.js +29 -29
- package/dist/utils/Validate/additional/mustBeEarlierDateTime.js +14 -9
- package/dist/utils/Validate/additional/mustBeEarlierDateTime.test.js +42 -38
- package/dist/utils/Validate/additional/mustBeGreaterThan.js +2 -2
- package/dist/utils/Validate/additional/mustBeGreaterThan.test.js +19 -19
- package/dist/utils/Validate/additional/mustBeInTheFuture.js +4 -4
- package/dist/utils/Validate/additional/mustBeInTheFuture.test.js +13 -13
- package/dist/utils/Validate/additional/mustBeInThePast.js +5 -5
- package/dist/utils/Validate/additional/mustBeInThePast.test.js +13 -13
- package/dist/utils/Validate/additional/mustBeLessThan.js +2 -2
- package/dist/utils/Validate/additional/mustBeLessThan.test.js +18 -18
- package/dist/utils/Validate/additional/mustBeLongerThan.js +1 -1
- package/dist/utils/Validate/additional/mustBeLongerThan.test.js +17 -17
- package/dist/utils/Validate/additional/mustBeNumbersOnly.js +2 -2
- package/dist/utils/Validate/additional/mustBeNumbersOnly.test.js +21 -21
- package/dist/utils/Validate/additional/mustBeOneOf.js +1 -1
- package/dist/utils/Validate/additional/mustBeOneOf.test.js +13 -13
- package/dist/utils/Validate/additional/mustBeShorterThan.js +1 -1
- package/dist/utils/Validate/additional/mustBeShorterThan.test.js +17 -17
- package/dist/utils/Validate/additional/mustBeUniqueInCollection.js +5 -5
- package/dist/utils/Validate/additional/mustBeUniqueInCollection.test.js +40 -36
- package/dist/utils/Validate/additional/mustEnterAtLeastOne.js +5 -3
- package/dist/utils/Validate/additional/mustEnterAtLeastOne.test.js +17 -15
- package/dist/utils/Validate/additional/mustHaveLessThanDecimalPlaces.js +1 -1
- package/dist/utils/Validate/additional/mustHaveLessThanDecimalPlaces.test.js +13 -13
- package/dist/utils/Validate/additional/mustNotContainSql.js +4 -3
- package/dist/utils/Validate/additional/mustNotContainSql.test.js +15 -15
- package/dist/utils/Validate/additional/mustSelectOnlyOne.js +5 -3
- package/dist/utils/Validate/additional/mustSelectOnlyOne.test.js +27 -29
- package/dist/utils/Validate/additional/utils.js +24 -11
- package/dist/utils/Validate/index.js +2 -2
- package/dist/utils/Validate/validateCollection.js +27 -21
- package/dist/utils/Validate/validateCollection.test.js +77 -85
- package/dist/utils/Validate/validateComponent.js +23 -22
- package/dist/utils/Validate/validateComponent.test.js +165 -188
- package/dist/utils/Validate/validateContainer.js +21 -16
- package/dist/utils/Validate/validateContainer.test.js +56 -62
- package/dist/utils/Validate/validateDate.js +23 -17
- package/dist/utils/Validate/validateDate.test.js +32 -31
- package/dist/utils/Validate/validateEmail.js +9 -7
- package/dist/utils/Validate/validateEmail.test.js +26 -26
- package/dist/utils/Validate/validateMultifile.js +7 -5
- package/dist/utils/Validate/validateMultifile.test.js +18 -17
- package/dist/utils/Validate/validatePage.js +24 -20
- package/dist/utils/Validate/validatePage.test.js +215 -227
- package/dist/utils/Validate/validateRegex.js +8 -5
- package/dist/utils/Validate/validateRegex.test.js +17 -17
- package/dist/utils/Validate/validateRequired.js +7 -5
- package/dist/utils/Validate/validateRequired.test.js +19 -19
- package/dist/utils/Validate/validateTextArea.js +7 -5
- package/dist/utils/Validate/validateTextArea.test.js +21 -21
- package/dist/utils/Validate/validateTime.js +19 -12
- package/dist/utils/Validate/validateTime.test.js +27 -27
- package/dist/utils/index.js +10 -8
- package/package.json +1 -1
|
@@ -1,65 +1,64 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
3
4
|
var _react = require("@testing-library/react");
|
|
4
5
|
var _Confirmation = _interopRequireWildcard(require("./Confirmation"));
|
|
5
|
-
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
6
|
-
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" !=
|
|
6
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
7
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
7
8
|
// Global imports.
|
|
8
9
|
|
|
9
10
|
// Local imports.
|
|
10
11
|
|
|
11
12
|
/* eslint-disable no-plusplus */
|
|
12
13
|
|
|
13
|
-
describe('components.CollectionSummary.Confirmation', ()
|
|
14
|
-
|
|
15
|
-
|
|
14
|
+
describe('components.CollectionSummary.Confirmation', function () {
|
|
15
|
+
var onConfirmCalls = 0;
|
|
16
|
+
var ON_CONFIRM = function ON_CONFIRM() {
|
|
16
17
|
onConfirmCalls += 1;
|
|
17
18
|
};
|
|
18
|
-
|
|
19
|
-
|
|
19
|
+
var onCancelCalls = 0;
|
|
20
|
+
var ON_CANCEL = function ON_CANCEL() {
|
|
20
21
|
onCancelCalls += 1;
|
|
21
22
|
};
|
|
22
|
-
beforeEach(()
|
|
23
|
+
beforeEach(function () {
|
|
23
24
|
onConfirmCalls = 0;
|
|
24
25
|
onCancelCalls = 0;
|
|
25
26
|
});
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
27
|
+
var ID = 'testId';
|
|
28
|
+
var MESSAGE = 'Confirmation message';
|
|
29
|
+
var LABEL = 'Confirmation label';
|
|
30
|
+
var checkSetup = function checkSetup(container) {
|
|
31
|
+
var withChildren = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
32
|
+
var childIndex = 0;
|
|
33
|
+
var confirmation = container.children[0];
|
|
33
34
|
expect(confirmation.classList).toContain(_Confirmation.DEFAULT_CLASS);
|
|
34
|
-
|
|
35
|
+
var heading = confirmation.children[childIndex++];
|
|
35
36
|
expect(heading.tagName).toEqual('H2');
|
|
36
|
-
|
|
37
|
-
|
|
37
|
+
var children = withChildren ? confirmation.children[childIndex++] : null;
|
|
38
|
+
var confirmButton = confirmation.children[childIndex++];
|
|
38
39
|
expect(confirmButton.tagName).toEqual('BUTTON');
|
|
39
|
-
|
|
40
|
+
var cancelButton = confirmation.children[childIndex++];
|
|
40
41
|
expect(cancelButton.tagName).toEqual('BUTTON');
|
|
41
42
|
return {
|
|
42
|
-
heading,
|
|
43
|
-
confirmButton,
|
|
44
|
-
cancelButton,
|
|
45
|
-
children
|
|
43
|
+
heading: heading,
|
|
44
|
+
confirmButton: confirmButton,
|
|
45
|
+
cancelButton: cancelButton,
|
|
46
|
+
children: children
|
|
46
47
|
};
|
|
47
48
|
};
|
|
48
|
-
it('should render correctly', ()
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
cancelButton
|
|
62
|
-
} = checkSetup(container);
|
|
49
|
+
it('should render correctly', function () {
|
|
50
|
+
var _render = (0, _react.render)( /*#__PURE__*/React.createElement(_Confirmation.default, {
|
|
51
|
+
id: ID,
|
|
52
|
+
message: MESSAGE,
|
|
53
|
+
confirmLabel: LABEL,
|
|
54
|
+
onConfirm: ON_CONFIRM,
|
|
55
|
+
onCancel: ON_CANCEL
|
|
56
|
+
})),
|
|
57
|
+
container = _render.container;
|
|
58
|
+
var _checkSetup = checkSetup(container),
|
|
59
|
+
heading = _checkSetup.heading,
|
|
60
|
+
confirmButton = _checkSetup.confirmButton,
|
|
61
|
+
cancelButton = _checkSetup.cancelButton;
|
|
63
62
|
expect(heading.textContent).toEqual(MESSAGE);
|
|
64
63
|
expect(confirmButton.textContent).toEqual(LABEL);
|
|
65
64
|
_react.fireEvent.click(confirmButton, {});
|
|
@@ -67,40 +66,36 @@ describe('components.CollectionSummary.Confirmation', () => {
|
|
|
67
66
|
_react.fireEvent.click(cancelButton, {});
|
|
68
67
|
expect(onCancelCalls).toEqual(1);
|
|
69
68
|
});
|
|
70
|
-
it('should use the default message if one is not provided', ()
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
heading
|
|
81
|
-
} = checkSetup(container);
|
|
69
|
+
it('should use the default message if one is not provided', function () {
|
|
70
|
+
var _render2 = (0, _react.render)( /*#__PURE__*/React.createElement(_Confirmation.default, {
|
|
71
|
+
id: ID,
|
|
72
|
+
confirmLabel: LABEL,
|
|
73
|
+
onConfirm: ON_CONFIRM,
|
|
74
|
+
onCancel: ON_CANCEL
|
|
75
|
+
})),
|
|
76
|
+
container = _render2.container;
|
|
77
|
+
var _checkSetup2 = checkSetup(container),
|
|
78
|
+
heading = _checkSetup2.heading;
|
|
82
79
|
expect(heading.textContent).toEqual(_Confirmation.DEFAULT_MESSAGE);
|
|
83
80
|
});
|
|
84
|
-
it('should use the default label if one is not provided', ()
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
const confirmButton = checkSetup(container).confirmButton;
|
|
81
|
+
it('should use the default label if one is not provided', function () {
|
|
82
|
+
var _render3 = (0, _react.render)( /*#__PURE__*/React.createElement(_Confirmation.default, {
|
|
83
|
+
id: ID,
|
|
84
|
+
onConfirm: ON_CONFIRM,
|
|
85
|
+
onCancel: ON_CANCEL
|
|
86
|
+
})),
|
|
87
|
+
container = _render3.container;
|
|
88
|
+
var confirmButton = checkSetup(container).confirmButton;
|
|
93
89
|
expect(confirmButton.textContent).toEqual(_Confirmation.DEFAULT_CONFIRM_LABEL);
|
|
94
90
|
});
|
|
95
|
-
it('should render children correctly', ()
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
const child = checkSetup(container, true).children;
|
|
91
|
+
it('should render children correctly', function () {
|
|
92
|
+
var _render4 = (0, _react.render)( /*#__PURE__*/React.createElement(_Confirmation.default, {
|
|
93
|
+
id: ID,
|
|
94
|
+
onConfirm: ON_CONFIRM,
|
|
95
|
+
onCancel: ON_CANCEL
|
|
96
|
+
}, /*#__PURE__*/React.createElement("p", null, "A child"))),
|
|
97
|
+
container = _render4.container;
|
|
98
|
+
var child = checkSetup(container, true).children;
|
|
104
99
|
expect(child.tagName).toEqual('P');
|
|
105
100
|
expect(child.textContent).toEqual('A child');
|
|
106
101
|
});
|
|
@@ -7,47 +7,54 @@ exports.default = exports.DEFAULT_TITLE = exports.DEFAULT_LIST_CLASS = exports.D
|
|
|
7
7
|
var _copReactComponents = require("@ukhomeoffice/cop-react-components");
|
|
8
8
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
9
9
|
var _react = _interopRequireDefault(require("react"));
|
|
10
|
+
var _BannerStrip = _interopRequireDefault(require("./BannerStrip"));
|
|
10
11
|
var _utils = _interopRequireDefault(require("../../utils"));
|
|
11
12
|
var _getSummaryListRowForDetails = _interopRequireDefault(require("../../utils/CheckYourAnswers/getSummaryListRowForDetails"));
|
|
12
13
|
var _Condition = _interopRequireDefault(require("../../utils/Condition"));
|
|
13
14
|
require("./RenderListView.scss");
|
|
14
|
-
function _interopRequireDefault(
|
|
15
|
-
|
|
16
|
-
|
|
15
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
16
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
17
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
18
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
19
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
20
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
21
|
+
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); } // Global imports.
|
|
17
22
|
// Local imports.
|
|
18
|
-
|
|
19
23
|
// Styles.
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
const classes = _copReactComponents.Utils.classBuilder(DEFAULT_CLASS, classModifiers);
|
|
40
|
-
const listClass = _copReactComponents.Utils.classBuilder(DEFAULT_LIST_CLASS);
|
|
24
|
+
var DEFAULT_CLASS = exports.DEFAULT_CLASS = 'govuk-summary-card';
|
|
25
|
+
var DEFAULT_LIST_CLASS = exports.DEFAULT_LIST_CLASS = 'govuk-summary-list';
|
|
26
|
+
var DEFAULT_TITLE = exports.DEFAULT_TITLE = 'Item';
|
|
27
|
+
var DEFAULT_CHANGE_BUTTON_LABEL = exports.DEFAULT_CHANGE_BUTTON_LABEL = 'Change';
|
|
28
|
+
var DEFAULT_DELETE_BUTTON_LABEL = exports.DEFAULT_DELETE_BUTTON_LABEL = 'Delete';
|
|
29
|
+
var DEFAULT_CHANGE_BUTTON_CLASS = exports.DEFAULT_CHANGE_BUTTON_CLASS = 'secondary';
|
|
30
|
+
var DEFAULT_DELETE_BUTTON_CLASS = exports.DEFAULT_DELETE_BUTTON_CLASS = 'warning';
|
|
31
|
+
var RenderListView = function RenderListView(_ref) {
|
|
32
|
+
var _config$changeAction, _config$deleteAction, _masterPage$childPage;
|
|
33
|
+
var id = _ref.id,
|
|
34
|
+
entryData = _ref.entryData,
|
|
35
|
+
config = _ref.config,
|
|
36
|
+
onFullEdit = _ref.onFullEdit,
|
|
37
|
+
onDelete = _ref.onDelete,
|
|
38
|
+
masterPage = _ref.masterPage,
|
|
39
|
+
classModifiers = _ref.classModifiers,
|
|
40
|
+
optionalFieldPlaceholder = _ref.optionalFieldPlaceholder;
|
|
41
|
+
var classes = _copReactComponents.Utils.classBuilder(DEFAULT_CLASS, classModifiers, config.className);
|
|
42
|
+
var listClass = _copReactComponents.Utils.classBuilder(DEFAULT_LIST_CLASS);
|
|
41
43
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
42
44
|
className: classes(),
|
|
43
45
|
id: id
|
|
44
46
|
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
45
47
|
className: classes('title-wrapper', [], 'dark')
|
|
48
|
+
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
49
|
+
className: classes('title-content')
|
|
46
50
|
}, /*#__PURE__*/_react.default.createElement("h2", {
|
|
47
51
|
className: classes('title')
|
|
48
|
-
}, _copReactComponents.Utils.interpolateString(config.title || DEFAULT_TITLE, {
|
|
49
|
-
...entryData,
|
|
52
|
+
}, _copReactComponents.Utils.interpolateString(config.title || DEFAULT_TITLE, _objectSpread(_objectSpread({}, entryData), {}, {
|
|
50
53
|
index: entryData.index + 1
|
|
54
|
+
}))), config.banners && /*#__PURE__*/_react.default.createElement(_BannerStrip.default, {
|
|
55
|
+
id: "BannerStrip".concat(entryData.id),
|
|
56
|
+
banners: config.banners,
|
|
57
|
+
formData: entryData
|
|
51
58
|
})), /*#__PURE__*/_react.default.createElement("ul", {
|
|
52
59
|
className: classes('actions')
|
|
53
60
|
}, /*#__PURE__*/_react.default.createElement("li", {
|
|
@@ -55,36 +62,44 @@ const RenderListView = _ref => {
|
|
|
55
62
|
}, config.changeAction && typeof onFullEdit === 'function' && /*#__PURE__*/_react.default.createElement("button", {
|
|
56
63
|
type: "button",
|
|
57
64
|
className: "govuk-link govuk-link-button",
|
|
58
|
-
onClick: ()
|
|
59
|
-
|
|
60
|
-
|
|
65
|
+
onClick: function onClick() {
|
|
66
|
+
return onFullEdit(config.changeAction.page, entryData.id);
|
|
67
|
+
},
|
|
68
|
+
"aria-label": _copReactComponents.Utils.interpolateString("".concat(((_config$changeAction = config.changeAction) === null || _config$changeAction === void 0 ? void 0 : _config$changeAction.label) || DEFAULT_CHANGE_BUTTON_LABEL, " ").concat(config.title || DEFAULT_TITLE), _objectSpread(_objectSpread({}, entryData), {}, {
|
|
61
69
|
index: entryData.index + 1
|
|
62
|
-
})
|
|
70
|
+
}))
|
|
63
71
|
}, config.changeAction.label || DEFAULT_CHANGE_BUTTON_LABEL)), /*#__PURE__*/_react.default.createElement("li", {
|
|
64
72
|
className: classes('action')
|
|
65
73
|
}, config.deleteAction && typeof onDelete === 'function' && /*#__PURE__*/_react.default.createElement(_copReactComponents.Button, {
|
|
66
|
-
id:
|
|
67
|
-
onClick: ()
|
|
74
|
+
id: "".concat(id, ".deleteButton"),
|
|
75
|
+
onClick: function onClick() {
|
|
76
|
+
return onDelete(entryData);
|
|
77
|
+
},
|
|
68
78
|
classModifiers: config.deleteAction.classModifiers || DEFAULT_DELETE_BUTTON_CLASS,
|
|
69
|
-
"aria-label": _copReactComponents.Utils.interpolateString(
|
|
70
|
-
...entryData,
|
|
79
|
+
"aria-label": _copReactComponents.Utils.interpolateString("".concat(((_config$deleteAction = config.deleteAction) === null || _config$deleteAction === void 0 ? void 0 : _config$deleteAction.label) || DEFAULT_DELETE_BUTTON_LABEL, " ").concat(config.title || DEFAULT_TITLE), _objectSpread(_objectSpread({}, entryData), {}, {
|
|
71
80
|
index: entryData.index + 1
|
|
72
|
-
})
|
|
81
|
+
}))
|
|
73
82
|
}, config.deleteAction.label || DEFAULT_DELETE_BUTTON_LABEL)))), /*#__PURE__*/_react.default.createElement("div", {
|
|
74
83
|
className: classes('content')
|
|
75
84
|
}, /*#__PURE__*/_react.default.createElement("dl", {
|
|
76
85
|
className: listClass()
|
|
77
|
-
}, masterPage
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
86
|
+
}, masterPage === null || masterPage === void 0 || (_masterPage$childPage = masterPage.childPages) === null || _masterPage$childPage === void 0 ? void 0 : _masterPage$childPage.flatMap(function (childPage) {
|
|
87
|
+
var _childPage$summaryLay;
|
|
88
|
+
var elevatedComponents = childPage.components.map(function (component) {
|
|
89
|
+
return _utils.default.Component.elevateNested([component], entryData);
|
|
90
|
+
}).flat().filter(Boolean);
|
|
91
|
+
return (_childPage$summaryLay = childPage.summaryLayout) === null || _childPage$summaryLay === void 0 || (_childPage$summaryLay = _childPage$summaryLay.sections) === null || _childPage$summaryLay === void 0 ? void 0 : _childPage$summaryLay.flatMap(function (section) {
|
|
92
|
+
var filteredColumns = section.columns.filter(function (column) {
|
|
93
|
+
return _Condition.default.meetsAll(column, _objectSpread(_objectSpread({}, childPage.formData), entryData));
|
|
94
|
+
});
|
|
95
|
+
var summaryFields = filteredColumns.flatMap(function (column) {
|
|
96
|
+
return column.fields || [];
|
|
97
|
+
});
|
|
85
98
|
if (summaryFields.length) {
|
|
86
|
-
return summaryFields.flatMap(fieldId
|
|
87
|
-
|
|
99
|
+
return summaryFields.flatMap(function (fieldId) {
|
|
100
|
+
var component = elevatedComponents.find(function (comp) {
|
|
101
|
+
return comp.fieldId === fieldId;
|
|
102
|
+
});
|
|
88
103
|
if (!component) {
|
|
89
104
|
return null;
|
|
90
105
|
}
|
|
@@ -102,6 +117,8 @@ RenderListView.propTypes = {
|
|
|
102
117
|
index: _propTypes.default.number.isRequired
|
|
103
118
|
}).isRequired,
|
|
104
119
|
config: _propTypes.default.shape({
|
|
120
|
+
className: _propTypes.default.string,
|
|
121
|
+
banners: _propTypes.default.arrayOf(_propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.shape({})])),
|
|
105
122
|
title: _propTypes.default.string,
|
|
106
123
|
changeAction: _propTypes.default.shape({
|
|
107
124
|
label: _propTypes.default.string,
|
|
@@ -183,6 +183,10 @@ $govuk-font-family: 'Roboto', arial, sans-serif;
|
|
|
183
183
|
&--deleting-summary-card {
|
|
184
184
|
background-color: #FCF0EE;
|
|
185
185
|
}
|
|
186
|
+
|
|
187
|
+
&.error {
|
|
188
|
+
border-left: 7px solid red;
|
|
189
|
+
}
|
|
186
190
|
}
|
|
187
191
|
|
|
188
192
|
.govuk-summary-card__title-wrapper {
|
|
@@ -213,6 +217,11 @@ $govuk-font-family: 'Roboto', arial, sans-serif;
|
|
|
213
217
|
}
|
|
214
218
|
}
|
|
215
219
|
|
|
220
|
+
.govuk-summary-card__title-content {
|
|
221
|
+
display: flex;
|
|
222
|
+
flex-direction: column;
|
|
223
|
+
}
|
|
224
|
+
|
|
216
225
|
.govuk-summary-card__actions {
|
|
217
226
|
@include govuk-typography-responsive($size: 19);
|
|
218
227
|
@include govuk-typography-weight-bold;
|