@k-int/stripes-kint-components 2.8.1 → 3.0.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/CHANGELOG.md +16 -1
- package/es/index.js +54 -12
- package/es/lib/ActionList/ActionList.js +11 -5
- package/es/lib/ActionList/ActionListFieldArray.js +147 -77
- package/es/lib/CustomProperties/Config/CustomPropertiesLookup.js +43 -31
- package/es/lib/CustomProperties/Config/CustomPropertiesLookup.test.js +17 -14
- package/es/lib/CustomProperties/Config/CustomPropertiesSettings.js +67 -47
- package/es/lib/CustomProperties/Config/CustomPropertiesSettings.test.js +17 -24
- package/es/lib/CustomProperties/Config/CustomPropertyForm.js +91 -70
- package/es/lib/CustomProperties/Config/CustomPropertyForm.test.js +53 -36
- package/es/lib/CustomProperties/Config/CustomPropertyView.js +50 -31
- package/es/lib/CustomProperties/Config/CustomPropertyView.test.js +13 -14
- package/es/lib/CustomProperties/Edit/CustomPropertiesEdit.js +6 -0
- package/es/lib/CustomProperties/Edit/CustomPropertiesEdit.test.js +8 -12
- package/es/lib/CustomProperties/Edit/CustomPropertiesEditCtx.js +22 -24
- package/es/lib/CustomProperties/Edit/CustomPropertiesEditCtx.test.js +9 -12
- package/es/lib/CustomProperties/Edit/CustomPropertiesListField.js +62 -13
- package/es/lib/CustomProperties/Edit/CustomPropertiesListField.test.js +12 -13
- package/es/lib/CustomProperties/Edit/CustomPropertyField.js +91 -44
- package/es/lib/CustomProperties/Edit/CustomPropertyField.test.js +80 -73
- package/es/lib/CustomProperties/Edit/CustomPropertyFormCard.js +31 -32
- package/es/lib/CustomProperties/Edit/CustomPropertyFormCard.test.js +26 -24
- package/es/lib/CustomProperties/Edit/testResources.js +73 -908
- package/es/lib/CustomProperties/Filter/CustomPropertiesFilter.js +21 -29
- package/es/lib/CustomProperties/Filter/CustomPropertiesFilter.test.js +12 -10
- package/es/lib/CustomProperties/Filter/CustomPropertiesFilterField.js +38 -39
- package/es/lib/CustomProperties/Filter/CustomPropertiesFilterField.test.js +28 -13
- package/es/lib/CustomProperties/Filter/CustomPropertiesFilterFieldArray.js +29 -44
- package/es/lib/CustomProperties/Filter/CustomPropertiesFilterFieldArray.test.js +6 -6
- package/es/lib/CustomProperties/Filter/CustomPropertiesFilterForm.js +16 -10
- package/es/lib/CustomProperties/Filter/CustomPropertiesFilterForm.test.js +12 -12
- package/es/lib/CustomProperties/Filter/CustomPropertiesRule.js +20 -11
- package/es/lib/CustomProperties/Filter/CustomPropertiesRule.test.js +4 -3
- package/es/lib/CustomProperties/Filter/testResources.js +37 -233
- package/es/lib/CustomProperties/Filter/useOperators.js +69 -27
- package/es/lib/CustomProperties/Filter/useParseActiveFilterStrings.js +3 -2
- package/es/lib/CustomProperties/Filter/useValueProps.js +7 -2
- package/es/lib/CustomProperties/View/CustomPropertiesView.js +6 -0
- package/es/lib/CustomProperties/View/CustomPropertiesView.test.js +4 -3
- package/es/lib/CustomProperties/View/CustomPropertiesViewCtx.js +13 -19
- package/es/lib/CustomProperties/View/CustomPropertiesViewCtx.test.js +4 -10
- package/es/lib/CustomProperties/View/CustomPropertyCard.js +34 -51
- package/es/lib/EditableRefdataCategoryList/EditableRefdataCategoryList.js +38 -28
- package/es/lib/EditableRefdataList/EditableRefdataList.js +44 -32
- package/es/lib/EditableSettingsList/EditableSettingsList.js +11 -1
- package/es/lib/EditableSettingsList/EditableSettingsListFieldArray.js +10 -0
- package/es/lib/EditableSettingsList/SettingField/EditSettingValue.js +19 -11
- package/es/lib/EditableSettingsList/SettingField/EditSettingValue.test.js +9 -8
- package/es/lib/EditableSettingsList/SettingField/RenderSettingValue.js +21 -9
- package/es/lib/EditableSettingsList/SettingField/RenderSettingValue.test.js +1 -0
- package/es/lib/EditableSettingsList/SettingField/SettingField.js +83 -16
- package/es/lib/EditableSettingsList/SettingField/SettingField.test.js +138 -65
- package/es/lib/FormModal/FormModal.js +14 -9
- package/es/lib/FormattedKintMessage/FormattedKintMessage.js +91 -0
- package/es/lib/FormattedKintMessage/index.js +15 -0
- package/es/lib/IconSelect/IconSelect.js +18 -12
- package/es/lib/NoResultsMessage/NoResultsMessage.js +13 -2
- package/es/lib/RichSelect/RichSelect.js +13 -34
- package/es/lib/SASQLookupComponent/SASQLookupComponent.js +16 -5
- package/es/lib/SASQLookupComponent/TableBody/TableBody.js +11 -1
- package/es/lib/SettingPage/SettingPage.js +12 -13
- package/es/lib/SettingPage/SettingPagePane.js +12 -20
- package/es/lib/hooks/__mocks__/index.js +46 -0
- package/es/lib/hooks/index.js +24 -8
- package/es/lib/hooks/settingsHooks/useSettings.js +22 -17
- package/es/lib/hooks/useIntlKey.js +34 -0
- package/es/lib/hooks/useIntlKeyStore.js +84 -0
- package/es/lib/hooks/useKintIntl.js +93 -0
- package/es/lib/utils/index.js +48 -4
- package/es/lib/utils/parseErrorResponse.js +91 -0
- package/es/lib/utils/validators.js +76 -59
- package/jest.config.js +4 -1
- package/junit.xml +157 -656
- package/package.json +54 -33
- package/src/artifacts/coverage-jest/lcov-report/ActionList/ActionList.js.html +56 -8
- package/src/artifacts/coverage-jest/lcov-report/ActionList/ActionListFieldArray.js.html +394 -64
- package/src/artifacts/coverage-jest/lcov-report/ActionList/index.html +10 -10
- package/src/artifacts/coverage-jest/lcov-report/ActionList/index.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Config/CustomPropertiesLookup.js.html +187 -52
- package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Config/CustomPropertiesSettings.js.html +372 -87
- package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Config/CustomPropertyForm.js.html +293 -74
- package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Config/CustomPropertyView.js.html +126 -54
- package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Config/index.html +45 -60
- package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Config/index.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Edit/CustomPropertiesEdit.js.html +23 -5
- package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Edit/CustomPropertiesEditCtx.js.html +59 -47
- package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Edit/CustomPropertiesListField.js.html +259 -97
- package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Edit/CustomPropertyField.js.html +399 -105
- package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Edit/CustomPropertyFormCard.js.html +41 -68
- package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Edit/index.html +57 -57
- package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Edit/index.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Edit/testResources.js.html +67 -688
- package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Filter/CustomPropertiesFilter.js.html +92 -53
- package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Filter/CustomPropertiesFilterField.js.html +103 -64
- package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Filter/CustomPropertiesFilterFieldArray.js.html +54 -63
- package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Filter/CustomPropertiesFilterForm.js.html +49 -16
- package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Filter/CustomPropertiesRule.js.html +69 -18
- package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Filter/index.html +89 -89
- package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Filter/index.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Filter/testResources.js.html +33 -786
- package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Filter/useOperators.js.html +46 -46
- package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Filter/useParseActiveFilterStrings.js.html +45 -36
- package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Filter/useValueProps.js.html +43 -28
- package/src/artifacts/coverage-jest/lcov-report/CustomProperties/View/CustomPropertiesView.js.html +20 -2
- package/src/artifacts/coverage-jest/lcov-report/CustomProperties/View/CustomPropertiesViewCtx.js.html +50 -41
- package/src/artifacts/coverage-jest/lcov-report/CustomProperties/View/CustomPropertyCard.js.html +54 -75
- package/src/artifacts/coverage-jest/lcov-report/CustomProperties/View/index.html +24 -24
- package/src/artifacts/coverage-jest/lcov-report/CustomProperties/View/index.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/CustomProperties/View/testResources.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/CustomProperties/index.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/CustomProperties/index.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/{hooks/useAvailableCustomProperties.js.html → CycleButton/CycleButton.js.html} +62 -50
- package/src/artifacts/coverage-jest/lcov-report/CycleButton/index.html +131 -0
- package/src/artifacts/coverage-jest/lcov-report/CycleButton/index.js.html +88 -0
- package/src/artifacts/coverage-jest/lcov-report/EditableRefdataCategoryList/EditableRefdataCategoryList.js.html +664 -0
- package/src/artifacts/coverage-jest/lcov-report/EditableRefdataCategoryList/index.html +131 -0
- package/src/artifacts/coverage-jest/lcov-report/EditableRefdataCategoryList/index.js.html +88 -0
- package/src/artifacts/coverage-jest/lcov-report/EditableRefdataList/EditableRefdataList.js.html +264 -39
- package/src/artifacts/coverage-jest/lcov-report/EditableRefdataList/index.html +9 -9
- package/src/artifacts/coverage-jest/lcov-report/EditableRefdataList/index.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/EditableSettingsList/EditableSettingsList.js.html +41 -14
- package/src/artifacts/coverage-jest/lcov-report/EditableSettingsList/EditableSettingsListFieldArray.js.html +45 -6
- package/src/artifacts/coverage-jest/lcov-report/EditableSettingsList/SettingField/EditSettingValue.js.html +47 -11
- package/src/artifacts/coverage-jest/lcov-report/EditableSettingsList/SettingField/RenderSettingValue.js.html +65 -14
- package/src/artifacts/coverage-jest/lcov-report/EditableSettingsList/SettingField/SettingField.js.html +154 -31
- package/src/artifacts/coverage-jest/lcov-report/EditableSettingsList/SettingField/index.html +26 -26
- package/src/artifacts/coverage-jest/lcov-report/EditableSettingsList/SettingField/index.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/EditableSettingsList/index.html +18 -18
- package/src/artifacts/coverage-jest/lcov-report/EditableSettingsList/index.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/FormModal/FormModal.js.html +35 -17
- package/src/artifacts/coverage-jest/lcov-report/FormModal/index.html +15 -15
- package/src/artifacts/coverage-jest/lcov-report/FormModal/index.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/FormattedKintMessage/FormattedKintMessage.js.html +247 -0
- package/src/artifacts/coverage-jest/lcov-report/FormattedKintMessage/index.html +131 -0
- package/src/artifacts/coverage-jest/lcov-report/FormattedKintMessage/index.js.html +88 -0
- package/src/artifacts/coverage-jest/lcov-report/{CustomProperties/Config/CustomPropertiesView.js.html → IconSelect/IconSelect.js.html} +158 -257
- package/src/artifacts/coverage-jest/lcov-report/IconSelect/index.html +131 -0
- package/src/artifacts/coverage-jest/lcov-report/IconSelect/index.js.html +88 -0
- package/src/artifacts/coverage-jest/lcov-report/NoResultsMessage/NoResultsMessage.js.html +48 -6
- package/src/artifacts/coverage-jest/lcov-report/NoResultsMessage/index.html +7 -7
- package/src/artifacts/coverage-jest/lcov-report/NoResultsMessage/index.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/QueryTypedown/QueryTypedown.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/QueryTypedown/index.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/QueryTypedown/index.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/RefdataButtons/RefdataButtons.js.html +3 -3
- package/src/artifacts/coverage-jest/lcov-report/RefdataButtons/index.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/RefdataButtons/index.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/{CustomProperties/Config/testResources.js.html → RichSelect/RichSelect.js.html} +256 -334
- package/src/artifacts/coverage-jest/lcov-report/RichSelect/index.html +146 -0
- package/src/artifacts/coverage-jest/lcov-report/RichSelect/index.js.html +91 -0
- package/src/artifacts/coverage-jest/lcov-report/RichSelect/useSelectedOption.js.html +127 -0
- package/src/artifacts/coverage-jest/lcov-report/SASQLookupComponent/SASQLookupComponent.js.html +52 -7
- package/src/artifacts/coverage-jest/lcov-report/SASQLookupComponent/TableBody/TableBody.js.html +31 -4
- package/src/artifacts/coverage-jest/lcov-report/SASQLookupComponent/TableBody/index.html +3 -3
- package/src/artifacts/coverage-jest/lcov-report/SASQLookupComponent/TableBody/index.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/SASQLookupComponent/index.html +7 -7
- package/src/artifacts/coverage-jest/lcov-report/SASQLookupComponent/index.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/SASQRoute/SASQRoute.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/SASQRoute/index.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/SASQRoute/index.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/SASQViewComponent/SASQViewComponent.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/SASQViewComponent/index.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/SASQViewComponent/index.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/SearchField/SearchField.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/SearchField/index.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/SearchField/index.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/SettingPage/SettingPage.js.html +24 -27
- package/src/artifacts/coverage-jest/lcov-report/SettingPage/SettingPagePane.js.html +47 -17
- package/src/artifacts/coverage-jest/lcov-report/SettingPage/index.html +22 -22
- package/src/artifacts/coverage-jest/lcov-report/SettingPage/index.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/Typedown/Typedown.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/Typedown/index.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/Typedown/index.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/constants/customProperties.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/constants/eventCodes.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/constants/index.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/contexts/SettingsContext.js.html +2 -2
- package/src/artifacts/coverage-jest/lcov-report/contexts/index.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/contexts/index.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/favicon.png +0 -0
- package/src/artifacts/coverage-jest/lcov-report/hooks/index.html +142 -97
- package/src/artifacts/coverage-jest/lcov-report/hooks/index.js.html +13 -4
- package/src/artifacts/coverage-jest/lcov-report/hooks/settingsHooks/index.html +35 -20
- package/src/artifacts/coverage-jest/lcov-report/hooks/settingsHooks/index.js.html +5 -2
- package/src/artifacts/coverage-jest/lcov-report/hooks/settingsHooks/useAppSettings.js.html +7 -7
- package/src/artifacts/coverage-jest/lcov-report/hooks/settingsHooks/useSettingSection.js.html +7 -7
- package/src/artifacts/coverage-jest/lcov-report/hooks/settingsHooks/useSettings.js.html +61 -22
- package/src/artifacts/coverage-jest/lcov-report/hooks/typedownHooks/index.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/hooks/typedownHooks/index.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/hooks/typedownHooks/useTypedown.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/hooks/typedownHooks/useTypedownData.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/hooks/typedownHooks/useTypedownToggle.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/hooks/useActiveElement.js.html +7 -7
- package/src/artifacts/coverage-jest/lcov-report/hooks/useCustomProperties.js.html +19 -22
- package/src/artifacts/coverage-jest/lcov-report/hooks/useHelperApp.js.html +7 -7
- package/src/artifacts/coverage-jest/lcov-report/hooks/useIntlKey.js.html +151 -0
- package/src/artifacts/coverage-jest/lcov-report/{utils/renderHelpText.js.html → hooks/useIntlKeyStore.js.html} +71 -38
- package/src/artifacts/coverage-jest/lcov-report/hooks/useInvalidateRefdata.js.html +7 -7
- package/src/artifacts/coverage-jest/lcov-report/hooks/useKintIntl.js.html +238 -0
- package/src/artifacts/coverage-jest/lcov-report/hooks/useKiwtFieldArray.js.html +7 -7
- package/src/artifacts/coverage-jest/lcov-report/hooks/useKiwtSASQuery.js.html +9 -9
- package/src/artifacts/coverage-jest/lcov-report/hooks/useLocalStorageState.js.html +7 -7
- package/src/artifacts/coverage-jest/lcov-report/hooks/useMutateCustomProperties.js.html +23 -11
- package/src/artifacts/coverage-jest/lcov-report/hooks/useMutateRefdataCategory.js.html +274 -0
- package/src/artifacts/coverage-jest/lcov-report/hooks/useMutateRefdataValue.js.html +19 -10
- package/src/artifacts/coverage-jest/lcov-report/hooks/useQIndex.js.html +7 -7
- package/src/artifacts/coverage-jest/lcov-report/hooks/useRefdata.js.html +9 -9
- package/src/artifacts/coverage-jest/lcov-report/hooks/useTemplates.js.html +7 -7
- package/src/artifacts/coverage-jest/lcov-report/index.html +205 -130
- package/src/artifacts/coverage-jest/lcov-report/sort-arrow-sprite.png +0 -0
- package/src/artifacts/coverage-jest/lcov-report/utils/buildUrl.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/utils/generateKiwtQuery.js.html +2 -2
- package/src/artifacts/coverage-jest/lcov-report/utils/generateKiwtQueryParams.js.html +2 -2
- package/src/artifacts/coverage-jest/lcov-report/utils/groupCustomPropertiesByCtx.js.html +7 -7
- package/src/artifacts/coverage-jest/lcov-report/utils/highlightString.js.html +3 -3
- package/src/artifacts/coverage-jest/lcov-report/utils/index.html +34 -34
- package/src/artifacts/coverage-jest/lcov-report/utils/index.js.html +42 -3
- package/src/artifacts/coverage-jest/lcov-report/utils/matchString.js.html +2 -2
- package/src/artifacts/coverage-jest/lcov-report/utils/parseErrorResponse.js.html +139 -0
- package/src/artifacts/coverage-jest/lcov-report/utils/refdataOptions.js.html +5 -2
- package/src/artifacts/coverage-jest/lcov-report/utils/refdataQueryKey.js.html +2 -2
- package/src/artifacts/coverage-jest/lcov-report/utils/selectorSafe.js.html +2 -2
- package/src/artifacts/coverage-jest/lcov-report/utils/sortByLabel.js.html +2 -2
- package/src/artifacts/coverage-jest/lcov-report/utils/toCamelCase.js.html +2 -2
- package/src/artifacts/coverage-jest/lcov-report/utils/typedownQueryKey.js.html +2 -2
- package/src/artifacts/coverage-jest/lcov-report/utils/validators.js.html +128 -80
- package/src/artifacts/coverage-jest/lcov.info +2603 -2086
- package/src/index.js +12 -4
- package/src/lib/ActionList/ActionList.js +9 -3
- package/src/lib/ActionList/ActionListFieldArray.js +115 -37
- package/src/lib/ActionList/README.md +2 -1
- package/src/lib/CustomProperties/Config/CustomPropertiesLookup.js +60 -16
- package/src/lib/CustomProperties/Config/CustomPropertiesLookup.test.js +14 -4
- package/src/lib/CustomProperties/Config/CustomPropertiesSettings.js +109 -34
- package/src/lib/CustomProperties/Config/CustomPropertiesSettings.test.js +16 -9
- package/src/lib/CustomProperties/Config/CustomPropertyForm.js +131 -58
- package/src/lib/CustomProperties/Config/CustomPropertyForm.test.js +52 -33
- package/src/lib/CustomProperties/Config/CustomPropertyView.js +71 -47
- package/src/lib/CustomProperties/Config/CustomPropertyView.test.js +8 -6
- package/src/lib/CustomProperties/Config/README.md +33 -28
- package/src/lib/CustomProperties/Edit/CustomPropertiesEdit.js +6 -0
- package/src/lib/CustomProperties/Edit/CustomPropertiesEdit.test.js +7 -3
- package/src/lib/CustomProperties/Edit/CustomPropertiesEditCtx.js +23 -19
- package/src/lib/CustomProperties/Edit/CustomPropertiesEditCtx.test.js +5 -3
- package/src/lib/CustomProperties/Edit/CustomPropertiesListField.js +65 -11
- package/src/lib/CustomProperties/Edit/CustomPropertiesListField.test.js +10 -8
- package/src/lib/CustomProperties/Edit/CustomPropertyField.js +115 -21
- package/src/lib/CustomProperties/Edit/CustomPropertyField.test.js +59 -60
- package/src/lib/CustomProperties/Edit/CustomPropertyFormCard.js +24 -33
- package/src/lib/CustomProperties/Edit/CustomPropertyFormCard.test.js +20 -27
- package/src/lib/CustomProperties/Edit/testResources.js +46 -1047
- package/src/lib/CustomProperties/Filter/CustomPropertiesFilter.js +22 -22
- package/src/lib/CustomProperties/Filter/CustomPropertiesFilter.test.js +12 -8
- package/src/lib/CustomProperties/Filter/CustomPropertiesFilterField.js +44 -31
- package/src/lib/CustomProperties/Filter/CustomPropertiesFilterField.test.js +26 -13
- package/src/lib/CustomProperties/Filter/CustomPropertiesFilterFieldArray.js +33 -36
- package/src/lib/CustomProperties/Filter/CustomPropertiesFilterFieldArray.test.js +3 -3
- package/src/lib/CustomProperties/Filter/CustomPropertiesFilterForm.js +19 -8
- package/src/lib/CustomProperties/Filter/CustomPropertiesFilterForm.test.js +9 -12
- package/src/lib/CustomProperties/Filter/CustomPropertiesRule.js +22 -5
- package/src/lib/CustomProperties/Filter/CustomPropertiesRule.test.js +3 -1
- package/src/lib/CustomProperties/Filter/testResources.js +14 -265
- package/src/lib/CustomProperties/Filter/useOperators.js +20 -20
- package/src/lib/CustomProperties/Filter/useParseActiveFilterStrings.js +2 -2
- package/src/lib/CustomProperties/Filter/useValueProps.js +8 -3
- package/src/lib/CustomProperties/View/CustomPropertiesView.js +6 -0
- package/src/lib/CustomProperties/View/CustomPropertiesView.test.js +2 -1
- package/src/lib/CustomProperties/View/CustomPropertiesViewCtx.js +15 -13
- package/src/lib/CustomProperties/View/CustomPropertiesViewCtx.test.js +2 -5
- package/src/lib/CustomProperties/View/CustomPropertyCard.js +36 -43
- package/src/lib/EditableRefdataCategoryList/EditableRefdataCategoryList.js +47 -28
- package/src/lib/EditableRefdataList/EditableRefdataList.js +58 -33
- package/src/lib/EditableSettingsList/EditableSettingsList.js +10 -1
- package/src/lib/EditableSettingsList/EditableSettingsListFieldArray.js +14 -1
- package/src/lib/EditableSettingsList/SettingField/EditSettingValue.js +17 -5
- package/src/lib/EditableSettingsList/SettingField/EditSettingValue.test.js +9 -8
- package/src/lib/EditableSettingsList/SettingField/RenderSettingValue.js +24 -7
- package/src/lib/EditableSettingsList/SettingField/RenderSettingValue.test.js +1 -0
- package/src/lib/EditableSettingsList/SettingField/SettingField.js +57 -16
- package/src/lib/EditableSettingsList/SettingField/SettingField.test.js +14 -19
- package/src/lib/FormModal/FormModal.js +15 -9
- package/src/lib/FormattedKintMessage/FormattedKintMessage.js +54 -0
- package/src/lib/FormattedKintMessage/index.js +1 -0
- package/src/lib/IconSelect/IconSelect.js +17 -8
- package/src/lib/NoResultsMessage/NoResultsMessage.js +15 -1
- package/src/lib/RichSelect/RichSelect.js +16 -36
- package/src/lib/SASQLookupComponent/SASQLookupComponent.js +17 -2
- package/src/lib/SASQLookupComponent/TableBody/TableBody.js +10 -1
- package/src/lib/SettingPage/SettingPage.js +12 -13
- package/src/lib/SettingPage/SettingPagePane.js +16 -6
- package/src/lib/hooks/__mocks__/index.js +17 -0
- package/src/lib/hooks/index.js +3 -1
- package/src/lib/hooks/settingsHooks/useSettings.js +25 -12
- package/src/lib/hooks/useIntlKey.js +22 -0
- package/src/lib/hooks/useIntlKeyStore.js +38 -0
- package/src/lib/hooks/useKintIntl.js +51 -0
- package/src/lib/utils/index.js +14 -1
- package/src/lib/utils/parseErrorResponse.js +18 -0
- package/src/lib/utils/validators.js +57 -41
- package/styles/RichSelect.css +7 -4
- package/test/helpers/test-implementor-translations.json +80 -0
- package/test/helpers/translationsProperties.js +6 -1
- package/test/jest/customProperties.js +166 -0
- package/test/jest/helpers/KintHarness.js +1 -1
- package/test/jest/helpers/renderWithKintHarness.js +2 -1
- package/test/jest/index.js +8 -0
- package/test/jest/refdata.js +471 -0
- package/test/jest/resolver.js +29 -0
- package/translations/stripes-kint-components/ar.json +1 -122
- package/translations/stripes-kint-components/cs_CZ.json +1 -122
- package/translations/stripes-kint-components/de.json +1 -122
- package/translations/stripes-kint-components/en.json +1 -148
- package/translations/stripes-kint-components/es.json +1 -122
- package/translations/stripes-kint-components/hi_IN.json +1 -122
- package/translations/stripes-kint-components/hu.json +1 -122
- package/translations/stripes-kint-components/it_IT.json +1 -122
- package/translations/stripes-kint-components/ja.json +1 -122
- package/translations/stripes-kint-components/ko.json +1 -122
- package/translations/stripes-kint-components/pt_PT.json +1 -122
- package/translations/stripes-kint-components/ru.json +1 -122
- package/translations/stripes-kint-components/sv.json +1 -122
- package/translations/stripes-kint-components/zh_CN.json +1 -122
- package/es/lib/CustomProperties/Config/testResources.js +0 -198
- package/es/lib/hooks/useAvailableCustomProperties.js +0 -73
- package/es/lib/utils/renderHelpText.js +0 -80
- package/src/lib/CustomProperties/Config/testResources.js +0 -236
- package/src/lib/hooks/useAvailableCustomProperties.js +0 -40
- package/src/lib/utils/renderHelpText.js +0 -27
|
@@ -11,8 +11,6 @@ var _react = _interopRequireWildcard(require("react"));
|
|
|
11
11
|
|
|
12
12
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
13
13
|
|
|
14
|
-
var _reactIntl = require("react-intl");
|
|
15
|
-
|
|
16
14
|
var _components = require("@folio/stripes/components");
|
|
17
15
|
|
|
18
16
|
var _core = require("@folio/stripes/core");
|
|
@@ -23,6 +21,8 @@ var _ActionList = _interopRequireDefault(require("../ActionList"));
|
|
|
23
21
|
|
|
24
22
|
var _validators = require("../utils/validators");
|
|
25
23
|
|
|
24
|
+
var _utils = require("../utils");
|
|
25
|
+
|
|
26
26
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
27
27
|
|
|
28
28
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
@@ -58,16 +58,20 @@ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
|
58
58
|
var propTypes = {
|
|
59
59
|
afterQueryCalls: _propTypes.default.object,
|
|
60
60
|
catchQueryCalls: _propTypes.default.object,
|
|
61
|
+
intlKey: _propTypes.default.string,
|
|
62
|
+
intlNS: _propTypes.default.string,
|
|
61
63
|
label: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.node]),
|
|
62
64
|
labelOverrides: _propTypes.default.object,
|
|
63
65
|
refdataEndpoint: _propTypes.default.string
|
|
64
66
|
};
|
|
65
67
|
|
|
66
68
|
var EditableRefdataCategoryList = function EditableRefdataCategoryList(_ref) {
|
|
67
|
-
var
|
|
69
|
+
var _deleteModal$refdata2;
|
|
68
70
|
|
|
69
71
|
var afterQueryCalls = _ref.afterQueryCalls,
|
|
70
72
|
catchQueryCalls = _ref.catchQueryCalls,
|
|
73
|
+
passedIntlKey = _ref.intlKey,
|
|
74
|
+
passedIntlNS = _ref.intlNS,
|
|
71
75
|
label = _ref.label,
|
|
72
76
|
_ref$labelOverrides = _ref.labelOverrides,
|
|
73
77
|
labelOverrides = _ref$labelOverrides === void 0 ? {} : _ref$labelOverrides,
|
|
@@ -75,7 +79,7 @@ var EditableRefdataCategoryList = function EditableRefdataCategoryList(_ref) {
|
|
|
75
79
|
|
|
76
80
|
/* A component that allows for editing of refdata categories */
|
|
77
81
|
var callout = (0, _react.useContext)(_core.CalloutContext);
|
|
78
|
-
var
|
|
82
|
+
var kintIntl = (0, _hooks.useKintIntl)(passedIntlKey, passedIntlNS); // fetch refdata values
|
|
79
83
|
|
|
80
84
|
var _useRefdata = (0, _hooks.useRefdata)({
|
|
81
85
|
endpoint: refdataEndpoint,
|
|
@@ -136,17 +140,17 @@ var EditableRefdataCategoryList = function EditableRefdataCategoryList(_ref) {
|
|
|
136
140
|
switch (_context.prev = _context.next) {
|
|
137
141
|
case 0:
|
|
138
142
|
_context.next = 2;
|
|
139
|
-
return err.response
|
|
143
|
+
return (0, _utils.parseErrorResponse)(err.response);
|
|
140
144
|
|
|
141
145
|
case 2:
|
|
142
146
|
errorResp = _context.sent;
|
|
143
147
|
callout.sendCallout({
|
|
144
|
-
message:
|
|
145
|
-
id:
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
148
|
+
message: kintIntl.formatKintMessage({
|
|
149
|
+
id: 'refdataCategory.deleteRefdataCategory.errorMessage',
|
|
150
|
+
overrideValue: labelOverrides === null || labelOverrides === void 0 ? void 0 : labelOverrides.deleteError
|
|
151
|
+
}, {
|
|
152
|
+
label: deleteModal === null || deleteModal === void 0 ? void 0 : (_deleteModal$refdata = deleteModal.refdata) === null || _deleteModal$refdata === void 0 ? void 0 : _deleteModal$refdata.label,
|
|
153
|
+
error: errorResp === null || errorResp === void 0 ? void 0 : errorResp.message
|
|
150
154
|
}),
|
|
151
155
|
type: 'error'
|
|
152
156
|
});
|
|
@@ -193,8 +197,9 @@ var EditableRefdataCategoryList = function EditableRefdataCategoryList(_ref) {
|
|
|
193
197
|
if (!(rowData !== null && rowData !== void 0 && (_rowData$values = rowData.values) !== null && _rowData$values !== void 0 && _rowData$values.length)) {
|
|
194
198
|
actionArray.push({
|
|
195
199
|
name: 'delete',
|
|
196
|
-
label:
|
|
197
|
-
id:
|
|
200
|
+
label: kintIntl.formatKintMessage({
|
|
201
|
+
id: 'delete',
|
|
202
|
+
overrideValue: labelOverrides === null || labelOverrides === void 0 ? void 0 : labelOverrides.delete
|
|
198
203
|
}),
|
|
199
204
|
icon: 'trash',
|
|
200
205
|
callback: function callback(data) {
|
|
@@ -204,8 +209,9 @@ var EditableRefdataCategoryList = function EditableRefdataCategoryList(_ref) {
|
|
|
204
209
|
});
|
|
205
210
|
},
|
|
206
211
|
ariaLabel: function ariaLabel(data) {
|
|
207
|
-
return
|
|
208
|
-
id: '
|
|
212
|
+
return kintIntl.formatKintMessage({
|
|
213
|
+
id: 'refdataCategory.deleteAriaLabel',
|
|
214
|
+
overrideValue: labelOverrides === null || labelOverrides === void 0 ? void 0 : labelOverrides.deleteAriaLabel
|
|
209
215
|
}, {
|
|
210
216
|
label: data === null || data === void 0 ? void 0 : data.label
|
|
211
217
|
});
|
|
@@ -220,11 +226,13 @@ var EditableRefdataCategoryList = function EditableRefdataCategoryList(_ref) {
|
|
|
220
226
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_ActionList.default, {
|
|
221
227
|
actionAssigner: actionAssigner,
|
|
222
228
|
columnMapping: {
|
|
223
|
-
desc:
|
|
224
|
-
id:
|
|
229
|
+
desc: kintIntl.formatKintMessage({
|
|
230
|
+
id: 'refdataCategory.refdataCategory',
|
|
231
|
+
overrideValue: labelOverrides === null || labelOverrides === void 0 ? void 0 : labelOverrides.refdataCategory
|
|
225
232
|
}),
|
|
226
|
-
values:
|
|
227
|
-
id:
|
|
233
|
+
values: kintIntl.formatKintMessage({
|
|
234
|
+
id: 'refdataCategory.noOfValues',
|
|
235
|
+
overrideValue: labelOverrides === null || labelOverrides === void 0 ? void 0 : labelOverrides.noOfValues
|
|
228
236
|
})
|
|
229
237
|
},
|
|
230
238
|
contentData: contentData,
|
|
@@ -251,17 +259,19 @@ var EditableRefdataCategoryList = function EditableRefdataCategoryList(_ref) {
|
|
|
251
259
|
},
|
|
252
260
|
visibleFields: ['desc', 'values']
|
|
253
261
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.ConfirmationModal, {
|
|
254
|
-
confirmLabel:
|
|
255
|
-
id:
|
|
262
|
+
confirmLabel: kintIntl.formatKintMessage({
|
|
263
|
+
id: 'delete',
|
|
264
|
+
overrideValue: labelOverrides === null || labelOverrides === void 0 ? void 0 : labelOverrides.delete
|
|
256
265
|
}),
|
|
257
|
-
heading:
|
|
258
|
-
id:
|
|
266
|
+
heading: kintIntl.formatKintMessage({
|
|
267
|
+
id: 'refdataCategory.deleteRefdataCategory',
|
|
268
|
+
overrideValue: labelOverrides === null || labelOverrides === void 0 ? void 0 : labelOverrides.deleteRefdataCategory
|
|
259
269
|
}),
|
|
260
|
-
message:
|
|
261
|
-
id:
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
270
|
+
message: kintIntl.formatKintMessage({
|
|
271
|
+
id: 'refdataCategory.deleteRefdataCategory.confirmMessage',
|
|
272
|
+
overrideValue: labelOverrides === null || labelOverrides === void 0 ? void 0 : labelOverrides.deleteRefdataCategoryMessage
|
|
273
|
+
}, {
|
|
274
|
+
name: deleteModal === null || deleteModal === void 0 ? void 0 : (_deleteModal$refdata2 = deleteModal.refdata) === null || _deleteModal$refdata2 === void 0 ? void 0 : _deleteModal$refdata2.desc
|
|
265
275
|
}),
|
|
266
276
|
onCancel: function onCancel() {
|
|
267
277
|
return setDeleteModal({
|
|
@@ -11,8 +11,6 @@ var _react = _interopRequireWildcard(require("react"));
|
|
|
11
11
|
|
|
12
12
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
13
13
|
|
|
14
|
-
var _reactIntl = require("react-intl");
|
|
15
|
-
|
|
16
14
|
var _components = require("@folio/stripes/components");
|
|
17
15
|
|
|
18
16
|
var _core = require("@folio/stripes/core");
|
|
@@ -23,6 +21,8 @@ var _ActionList = _interopRequireDefault(require("../ActionList"));
|
|
|
23
21
|
|
|
24
22
|
var _validators = require("../utils/validators");
|
|
25
23
|
|
|
24
|
+
var _utils = require("../utils");
|
|
25
|
+
|
|
26
26
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
27
27
|
|
|
28
28
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
@@ -59,17 +59,21 @@ var propTypes = {
|
|
|
59
59
|
afterQueryCalls: _propTypes.default.object,
|
|
60
60
|
catchQueryCalls: _propTypes.default.object,
|
|
61
61
|
desc: _propTypes.default.string,
|
|
62
|
+
intlKey: _propTypes.default.string,
|
|
63
|
+
intlNS: _propTypes.default.string,
|
|
62
64
|
label: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.node]),
|
|
63
65
|
labelOverrides: _propTypes.default.object,
|
|
64
66
|
refdataEndpoint: _propTypes.default.string
|
|
65
67
|
};
|
|
66
68
|
|
|
67
69
|
var EditableRefdataList = function EditableRefdataList(_ref) {
|
|
68
|
-
var
|
|
70
|
+
var _deleteModal$refdata2;
|
|
69
71
|
|
|
70
72
|
var afterQueryCalls = _ref.afterQueryCalls,
|
|
71
73
|
catchQueryCalls = _ref.catchQueryCalls,
|
|
72
74
|
desc = _ref.desc,
|
|
75
|
+
passedIntlKey = _ref.intlKey,
|
|
76
|
+
passedIntlNS = _ref.intlNS,
|
|
73
77
|
label = _ref.label,
|
|
74
78
|
_ref$labelOverrides = _ref.labelOverrides,
|
|
75
79
|
labelOverrides = _ref$labelOverrides === void 0 ? {} : _ref$labelOverrides,
|
|
@@ -77,7 +81,7 @@ var EditableRefdataList = function EditableRefdataList(_ref) {
|
|
|
77
81
|
|
|
78
82
|
/* A component that allows for editing of refdata values */
|
|
79
83
|
var callout = (0, _react.useContext)(_core.CalloutContext);
|
|
80
|
-
var
|
|
84
|
+
var kintIntl = (0, _hooks.useKintIntl)(passedIntlKey, passedIntlNS); // fetch refdata values
|
|
81
85
|
|
|
82
86
|
var _useRefdata = (0, _hooks.useRefdata)({
|
|
83
87
|
desc: desc,
|
|
@@ -149,17 +153,17 @@ var EditableRefdataList = function EditableRefdataList(_ref) {
|
|
|
149
153
|
switch (_context.prev = _context.next) {
|
|
150
154
|
case 0:
|
|
151
155
|
_context.next = 2;
|
|
152
|
-
return err.response
|
|
156
|
+
return (0, _utils.parseErrorResponse)(err.response);
|
|
153
157
|
|
|
154
158
|
case 2:
|
|
155
159
|
errorResp = _context.sent;
|
|
156
160
|
callout.sendCallout({
|
|
157
|
-
message:
|
|
158
|
-
id:
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
161
|
+
message: kintIntl.formatKintMessage({
|
|
162
|
+
id: 'refdata.deleteRefdataValue.errorMessage',
|
|
163
|
+
overrideValue: labelOverrides === null || labelOverrides === void 0 ? void 0 : labelOverrides.deleteError
|
|
164
|
+
}, {
|
|
165
|
+
label: deleteModal === null || deleteModal === void 0 ? void 0 : (_deleteModal$refdata = deleteModal.refdata) === null || _deleteModal$refdata === void 0 ? void 0 : _deleteModal$refdata.label,
|
|
166
|
+
error: errorResp === null || errorResp === void 0 ? void 0 : errorResp.message
|
|
163
167
|
}),
|
|
164
168
|
type: 'error'
|
|
165
169
|
});
|
|
@@ -201,16 +205,18 @@ var EditableRefdataList = function EditableRefdataList(_ref) {
|
|
|
201
205
|
var actionAssigner = function actionAssigner() {
|
|
202
206
|
var actionArray = [{
|
|
203
207
|
name: 'edit',
|
|
204
|
-
label:
|
|
205
|
-
id:
|
|
208
|
+
label: kintIntl.formatKintMessage({
|
|
209
|
+
id: 'edit',
|
|
210
|
+
overrideValue: labelOverrides === null || labelOverrides === void 0 ? void 0 : labelOverrides.edit
|
|
206
211
|
}),
|
|
207
212
|
icon: 'edit',
|
|
208
213
|
callback: function callback(data) {
|
|
209
214
|
return editRefdataValue(data);
|
|
210
215
|
},
|
|
211
216
|
ariaLabel: function ariaLabel(data) {
|
|
212
|
-
return
|
|
213
|
-
id: '
|
|
217
|
+
return kintIntl.formatKintMessage({
|
|
218
|
+
id: 'refdata.editAriaLabel',
|
|
219
|
+
overrideValue: labelOverrides === null || labelOverrides === void 0 ? void 0 : labelOverrides.editAriaLabel
|
|
214
220
|
}, {
|
|
215
221
|
label: data === null || data === void 0 ? void 0 : data.label
|
|
216
222
|
});
|
|
@@ -220,8 +226,9 @@ var EditableRefdataList = function EditableRefdataList(_ref) {
|
|
|
220
226
|
if (!(refdata !== null && refdata !== void 0 && refdata.internal)) {
|
|
221
227
|
actionArray.push({
|
|
222
228
|
name: 'delete',
|
|
223
|
-
label:
|
|
224
|
-
id:
|
|
229
|
+
label: kintIntl.formatKintMessage({
|
|
230
|
+
id: 'delete',
|
|
231
|
+
overrideValue: labelOverrides === null || labelOverrides === void 0 ? void 0 : labelOverrides.delete
|
|
225
232
|
}),
|
|
226
233
|
icon: 'trash',
|
|
227
234
|
callback: function callback(data) {
|
|
@@ -231,8 +238,9 @@ var EditableRefdataList = function EditableRefdataList(_ref) {
|
|
|
231
238
|
});
|
|
232
239
|
},
|
|
233
240
|
ariaLabel: function ariaLabel(data) {
|
|
234
|
-
return
|
|
235
|
-
id: '
|
|
241
|
+
return kintIntl.formatKintMessage({
|
|
242
|
+
id: 'refdata.deleteAriaLabel',
|
|
243
|
+
overrideValue: labelOverrides === null || labelOverrides === void 0 ? void 0 : labelOverrides.deleteAriaLabel
|
|
236
244
|
}, {
|
|
237
245
|
label: data === null || data === void 0 ? void 0 : data.label
|
|
238
246
|
});
|
|
@@ -247,11 +255,13 @@ var EditableRefdataList = function EditableRefdataList(_ref) {
|
|
|
247
255
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_ActionList.default, {
|
|
248
256
|
actionAssigner: actionAssigner,
|
|
249
257
|
columnMapping: {
|
|
250
|
-
label:
|
|
251
|
-
id:
|
|
258
|
+
label: kintIntl.formatKintMessage({
|
|
259
|
+
id: 'refdata.label',
|
|
260
|
+
overrideValue: labelOverrides === null || labelOverrides === void 0 ? void 0 : labelOverrides.label
|
|
252
261
|
}),
|
|
253
|
-
value:
|
|
254
|
-
id:
|
|
262
|
+
value: kintIntl.formatKintMessage({
|
|
263
|
+
id: 'refdata.value',
|
|
264
|
+
overrideValue: labelOverrides === null || labelOverrides === void 0 ? void 0 : labelOverrides.value
|
|
255
265
|
})
|
|
256
266
|
},
|
|
257
267
|
contentData: contentData,
|
|
@@ -276,17 +286,19 @@ var EditableRefdataList = function EditableRefdataList(_ref) {
|
|
|
276
286
|
},
|
|
277
287
|
visibleFields: ['label', 'value']
|
|
278
288
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.ConfirmationModal, {
|
|
279
|
-
confirmLabel:
|
|
280
|
-
id:
|
|
289
|
+
confirmLabel: kintIntl.formatKintMessage({
|
|
290
|
+
id: 'delete',
|
|
291
|
+
overrideValue: labelOverrides === null || labelOverrides === void 0 ? void 0 : labelOverrides.delete
|
|
281
292
|
}),
|
|
282
|
-
heading:
|
|
283
|
-
id:
|
|
293
|
+
heading: kintIntl.formatKintMessage({
|
|
294
|
+
id: 'refdata.deleteRefdataValue',
|
|
295
|
+
overrideValue: labelOverrides === null || labelOverrides === void 0 ? void 0 : labelOverrides.deleteRefdataValue
|
|
284
296
|
}),
|
|
285
|
-
message:
|
|
286
|
-
id:
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
297
|
+
message: kintIntl.formatKintMessage({
|
|
298
|
+
id: 'refdata.deleteRefdataValue.confirmMessage',
|
|
299
|
+
overrideValue: labelOverrides === null || labelOverrides === void 0 ? void 0 : labelOverrides.deleteRefdataValueMessage
|
|
300
|
+
}, {
|
|
301
|
+
name: deleteModal === null || deleteModal === void 0 ? void 0 : (_deleteModal$refdata2 = deleteModal.refdata) === null || _deleteModal$refdata2 === void 0 ? void 0 : _deleteModal$refdata2.label
|
|
290
302
|
}),
|
|
291
303
|
onCancel: function onCancel() {
|
|
292
304
|
return setDeleteModal({
|
|
@@ -24,7 +24,11 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
|
|
|
24
24
|
var EditableSettingsList = function EditableSettingsList(_ref) {
|
|
25
25
|
var data = _ref.data,
|
|
26
26
|
initialValues = _ref.initialValues,
|
|
27
|
+
passedIntlKey = _ref.intlKey,
|
|
28
|
+
passedIntlNS = _ref.intlNS,
|
|
27
29
|
label = _ref.label,
|
|
30
|
+
_ref$labelOverrides = _ref.labelOverrides,
|
|
31
|
+
labelOverrides = _ref$labelOverrides === void 0 ? {} : _ref$labelOverrides,
|
|
28
32
|
onSave = _ref.onSave;
|
|
29
33
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactFinalForm.Form, {
|
|
30
34
|
enableReinitialize: true,
|
|
@@ -43,7 +47,10 @@ var EditableSettingsList = function EditableSettingsList(_ref) {
|
|
|
43
47
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactFinalFormArrays.FieldArray, {
|
|
44
48
|
component: _EditableSettingsListFieldArray.default,
|
|
45
49
|
data: data,
|
|
50
|
+
intlKey: passedIntlKey,
|
|
51
|
+
intlNS: passedIntlNS,
|
|
46
52
|
label: label,
|
|
53
|
+
labelOverrides: labelOverrides,
|
|
47
54
|
name: "settings",
|
|
48
55
|
onSave: onSave
|
|
49
56
|
})
|
|
@@ -58,7 +65,10 @@ EditableSettingsList.propTypes = {
|
|
|
58
65
|
refdatavalues: _propTypes.default.arrayOf(_propTypes.default.object)
|
|
59
66
|
}),
|
|
60
67
|
initialValues: _propTypes.default.object,
|
|
61
|
-
|
|
68
|
+
intlKey: _propTypes.default.string,
|
|
69
|
+
intlNS: _propTypes.default.string,
|
|
70
|
+
label: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.node, _propTypes.default.object]),
|
|
71
|
+
labelOverrides: _propTypes.default.object
|
|
62
72
|
};
|
|
63
73
|
var _default = EditableSettingsList;
|
|
64
74
|
exports.default = _default;
|
|
@@ -26,6 +26,10 @@ function _defineProperty(obj, key, value) { if (key in obj) { Object.definePrope
|
|
|
26
26
|
var EditableSettingsListFieldArray = function EditableSettingsListFieldArray(_ref) {
|
|
27
27
|
var data = _ref.data,
|
|
28
28
|
fields = _ref.fields,
|
|
29
|
+
passedIntlKey = _ref.intlKey,
|
|
30
|
+
passedIntlNS = _ref.intlNS,
|
|
31
|
+
_ref$labelOverrides = _ref.labelOverrides,
|
|
32
|
+
labelOverrides = _ref$labelOverrides === void 0 ? {} : _ref$labelOverrides,
|
|
29
33
|
onSave = _ref.onSave;
|
|
30
34
|
|
|
31
35
|
var handleSave = function handleSave(index) {
|
|
@@ -37,6 +41,9 @@ var EditableSettingsListFieldArray = function EditableSettingsListFieldArray(_re
|
|
|
37
41
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactFinalForm.Field, {
|
|
38
42
|
component: _SettingField.SettingField,
|
|
39
43
|
"data-testid": "editableSettingsListFieldArray[".concat(i, "]"),
|
|
44
|
+
intlKey: passedIntlKey,
|
|
45
|
+
intlNS: passedIntlNS,
|
|
46
|
+
labelOverrides: labelOverrides,
|
|
40
47
|
name: setting,
|
|
41
48
|
onSave: function onSave() {
|
|
42
49
|
return handleSave(i);
|
|
@@ -50,6 +57,9 @@ var EditableSettingsListFieldArray = function EditableSettingsListFieldArray(_re
|
|
|
50
57
|
|
|
51
58
|
EditableSettingsListFieldArray.propTypes = {
|
|
52
59
|
fields: _propTypes.default.object,
|
|
60
|
+
intlKey: _propTypes.default.string,
|
|
61
|
+
intlNS: _propTypes.default.string,
|
|
62
|
+
labelOverrides: _propTypes.default.object,
|
|
53
63
|
onSave: _propTypes.default.func,
|
|
54
64
|
data: _propTypes.default.shape({
|
|
55
65
|
refdatavalues: _propTypes.default.arrayOf(_propTypes.default.object)
|
|
@@ -9,14 +9,14 @@ var _react = _interopRequireDefault(require("react"));
|
|
|
9
9
|
|
|
10
10
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
11
11
|
|
|
12
|
-
var _reactIntl = require("react-intl");
|
|
13
|
-
|
|
14
12
|
var _reactFinalForm = require("react-final-form");
|
|
15
13
|
|
|
16
14
|
var _components = require("@folio/stripes/components");
|
|
17
15
|
|
|
18
16
|
var _RefdataButtons = _interopRequireDefault(require("../../RefdataButtons"));
|
|
19
17
|
|
|
18
|
+
var _hooks = require("../../hooks");
|
|
19
|
+
|
|
20
20
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
21
21
|
|
|
22
22
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
@@ -34,16 +34,20 @@ function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToAr
|
|
|
34
34
|
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
|
|
35
35
|
|
|
36
36
|
var EditSettingValue = function EditSettingValue(props) {
|
|
37
|
-
var
|
|
38
|
-
|
|
37
|
+
var setting = props.currentSetting,
|
|
38
|
+
input = props.input,
|
|
39
|
+
passedIntlKey = props.intlKey,
|
|
40
|
+
passedIntlNS = props.intlNS,
|
|
41
|
+
_props$labelOverrides = props.labelOverrides,
|
|
42
|
+
labelOverrides = _props$labelOverrides === void 0 ? {} : _props$labelOverrides,
|
|
39
43
|
refdata = props.refdata,
|
|
40
44
|
templates = props.templates;
|
|
41
|
-
var
|
|
42
|
-
var fieldLabel =
|
|
43
|
-
id: '
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
45
|
+
var kintIntl = (0, _hooks.useKintIntl)(passedIntlKey, passedIntlNS);
|
|
46
|
+
var fieldLabel = kintIntl.formatKintMessage({
|
|
47
|
+
id: 'settings.valueFor',
|
|
48
|
+
overrideValue: labelOverrides === null || labelOverrides === void 0 ? void 0 : labelOverrides.valueFor
|
|
49
|
+
}, {
|
|
50
|
+
name: setting.key
|
|
47
51
|
});
|
|
48
52
|
|
|
49
53
|
switch (setting.settingType) {
|
|
@@ -117,11 +121,15 @@ var EditSettingValue = function EditSettingValue(props) {
|
|
|
117
121
|
|
|
118
122
|
EditSettingValue.propTypes = {
|
|
119
123
|
currentSetting: _propTypes.default.shape({
|
|
120
|
-
settingType: _propTypes.default.string
|
|
124
|
+
settingType: _propTypes.default.string,
|
|
125
|
+
key: _propTypes.default.string
|
|
121
126
|
}),
|
|
122
127
|
input: _propTypes.default.shape({
|
|
123
128
|
name: _propTypes.default.string
|
|
124
129
|
}),
|
|
130
|
+
intlKey: _propTypes.default.string,
|
|
131
|
+
intlNS: _propTypes.default.string,
|
|
132
|
+
labelOverrides: _propTypes.default.object,
|
|
125
133
|
refdata: _propTypes.default.arrayOf(_propTypes.default.object),
|
|
126
134
|
templates: _propTypes.default.arrayOf(_propTypes.default.shape({
|
|
127
135
|
name: _propTypes.default.string,
|
|
@@ -15,6 +15,7 @@ var _jsxRuntime = require("react/jsx-runtime");
|
|
|
15
15
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
16
16
|
|
|
17
17
|
var onSubmit = jest.fn();
|
|
18
|
+
jest.mock('../../hooks');
|
|
18
19
|
var stringSetting = {
|
|
19
20
|
id: '12345',
|
|
20
21
|
key: 'testSettingKey',
|
|
@@ -101,7 +102,7 @@ describe('EditSettingValue', function () {
|
|
|
101
102
|
var _renderComponent = renderComponent,
|
|
102
103
|
getByRole = _renderComponent.getByRole;
|
|
103
104
|
expect(getByRole('textbox', {
|
|
104
|
-
name: 'Value for setting
|
|
105
|
+
name: 'Value for setting testSettingKey'
|
|
105
106
|
}));
|
|
106
107
|
});
|
|
107
108
|
});
|
|
@@ -127,7 +128,7 @@ describe('EditSettingValue', function () {
|
|
|
127
128
|
var _renderComponent2 = renderComponent,
|
|
128
129
|
getByRole = _renderComponent2.getByRole;
|
|
129
130
|
expect(getByRole('textbox', {
|
|
130
|
-
name: 'Value for setting
|
|
131
|
+
name: 'Value for setting testSettingKey'
|
|
131
132
|
})).toHaveDisplayValue('diku-shared');
|
|
132
133
|
});
|
|
133
134
|
});
|
|
@@ -241,7 +242,7 @@ describe('EditSettingValue', function () {
|
|
|
241
242
|
var _renderComponent7 = renderComponent,
|
|
242
243
|
getByRole = _renderComponent7.getByRole;
|
|
243
244
|
expect(getByRole('combobox', {
|
|
244
|
-
name: 'Value for setting
|
|
245
|
+
name: 'Value for setting testSettingKey'
|
|
245
246
|
}));
|
|
246
247
|
});
|
|
247
248
|
test('renders the expected refdata options', function () {
|
|
@@ -312,7 +313,7 @@ describe('EditSettingValue', function () {
|
|
|
312
313
|
var _renderComponent10 = renderComponent,
|
|
313
314
|
getByRole = _renderComponent10.getByRole;
|
|
314
315
|
expect(getByRole('combobox', {
|
|
315
|
-
name: 'Value for setting
|
|
316
|
+
name: 'Value for setting testSettingKey'
|
|
316
317
|
})).toHaveDisplayValue('Test refdata value');
|
|
317
318
|
});
|
|
318
319
|
});
|
|
@@ -337,7 +338,7 @@ describe('EditSettingValue', function () {
|
|
|
337
338
|
var _renderComponent11 = renderComponent,
|
|
338
339
|
getByRole = _renderComponent11.getByRole;
|
|
339
340
|
expect(getByRole('combobox', {
|
|
340
|
-
name: 'Value for setting
|
|
341
|
+
name: 'Value for setting testSettingKey'
|
|
341
342
|
}));
|
|
342
343
|
});
|
|
343
344
|
test('renders the expected template options', function () {
|
|
@@ -358,7 +359,7 @@ describe('EditSettingValue', function () {
|
|
|
358
359
|
var _renderComponent13 = renderComponent,
|
|
359
360
|
getByRole = _renderComponent13.getByRole;
|
|
360
361
|
expect(getByRole('combobox', {
|
|
361
|
-
name: 'Value for setting
|
|
362
|
+
name: 'Value for setting testSettingKey'
|
|
362
363
|
})).toHaveDisplayValue('');
|
|
363
364
|
});
|
|
364
365
|
});
|
|
@@ -385,7 +386,7 @@ describe('EditSettingValue', function () {
|
|
|
385
386
|
var _renderComponent14 = renderComponent,
|
|
386
387
|
getByRole = _renderComponent14.getByRole;
|
|
387
388
|
expect(getByRole('combobox', {
|
|
388
|
-
name: 'Value for setting
|
|
389
|
+
name: 'Value for setting testSettingKey'
|
|
389
390
|
}));
|
|
390
391
|
});
|
|
391
392
|
test('renders the expected template options', function () {
|
|
@@ -406,7 +407,7 @@ describe('EditSettingValue', function () {
|
|
|
406
407
|
var _renderComponent16 = renderComponent,
|
|
407
408
|
getByRole = _renderComponent16.getByRole;
|
|
408
409
|
expect(getByRole('combobox', {
|
|
409
|
-
name: 'Value for setting
|
|
410
|
+
name: 'Value for setting testSettingKey'
|
|
410
411
|
})).toHaveDisplayValue('Test template');
|
|
411
412
|
});
|
|
412
413
|
});
|
|
@@ -5,24 +5,28 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
7
|
|
|
8
|
-
var
|
|
8
|
+
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
9
9
|
|
|
10
|
-
var
|
|
11
|
-
|
|
12
|
-
var _jsxRuntime = require("react/jsx-runtime");
|
|
10
|
+
var _hooks = require("../../hooks");
|
|
13
11
|
|
|
14
12
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
15
13
|
|
|
16
14
|
var RenderSettingValue = function RenderSettingValue(props) {
|
|
17
15
|
var setting = props.currentSetting,
|
|
16
|
+
passedIntlKey = props.intlKey,
|
|
17
|
+
passedIntlNS = props.intlNS,
|
|
18
|
+
_props$labelOverrides = props.labelOverrides,
|
|
19
|
+
labelOverrides = _props$labelOverrides === void 0 ? {} : _props$labelOverrides,
|
|
18
20
|
refdata = props.refdata,
|
|
19
21
|
templates = props.templates;
|
|
20
|
-
var
|
|
21
|
-
var NoCurrentValue =
|
|
22
|
-
id:
|
|
22
|
+
var kintIntl = (0, _hooks.useKintIntl)(passedIntlKey, passedIntlNS);
|
|
23
|
+
var NoCurrentValue = kintIntl.formatKintMessage({
|
|
24
|
+
id: 'settings.noCurrentValue',
|
|
25
|
+
overrideValue: labelOverrides === null || labelOverrides === void 0 ? void 0 : labelOverrides.noCurrentValue
|
|
23
26
|
});
|
|
24
|
-
var defaultText = "[".concat(
|
|
25
|
-
id: '
|
|
27
|
+
var defaultText = "[".concat(kintIntl.formatKintMessage({
|
|
28
|
+
id: 'settings.default',
|
|
29
|
+
overrideValue: labelOverrides === null || labelOverrides === void 0 ? void 0 : labelOverrides.default
|
|
26
30
|
}), "]");
|
|
27
31
|
|
|
28
32
|
switch (setting.settingType) {
|
|
@@ -85,5 +89,13 @@ var RenderSettingValue = function RenderSettingValue(props) {
|
|
|
85
89
|
}
|
|
86
90
|
};
|
|
87
91
|
|
|
92
|
+
RenderSettingValue.propTypes = {
|
|
93
|
+
currentSetting: _propTypes.default.object,
|
|
94
|
+
intlKey: _propTypes.default.string,
|
|
95
|
+
intlNS: _propTypes.default.string,
|
|
96
|
+
labelOverrides: _propTypes.default.object,
|
|
97
|
+
refdata: _propTypes.default.arrayOf(_propTypes.default.object),
|
|
98
|
+
templates: _propTypes.default.arrayOf(_propTypes.default.object)
|
|
99
|
+
};
|
|
88
100
|
var _default = RenderSettingValue;
|
|
89
101
|
exports.default = _default;
|
|
@@ -20,6 +20,7 @@ function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try
|
|
|
20
20
|
|
|
21
21
|
function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
|
|
22
22
|
|
|
23
|
+
jest.mock('../../hooks');
|
|
23
24
|
var stringSetting = {
|
|
24
25
|
id: '12345',
|
|
25
26
|
key: 'testSettingKey',
|