@k-int/stripes-kint-components 2.8.2 → 3.0.1
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 +18 -3
- package/es/index.js +48 -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 +64 -46
- 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 +87 -43
- 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 +35 -27
- package/es/lib/EditableRefdataList/EditableRefdataList.js +41 -31
- 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 +40 -4
- package/es/lib/utils/parseErrorResponse.js +1 -1
- 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 +11 -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 +106 -33
- 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 +101 -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 +45 -27
- package/src/lib/EditableRefdataList/EditableRefdataList.js +56 -32
- 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 +11 -1
- package/src/lib/utils/parseErrorResponse.js +1 -1
- 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
|
@@ -7,10 +7,10 @@ exports.default = void 0;
|
|
|
7
7
|
|
|
8
8
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
9
9
|
|
|
10
|
-
var _reactIntl = require("react-intl");
|
|
11
|
-
|
|
12
10
|
var _components = require("@folio/stripes/components");
|
|
13
11
|
|
|
12
|
+
var _hooks = require("../../hooks");
|
|
13
|
+
|
|
14
14
|
var _customProperties = require("../../constants/customProperties");
|
|
15
15
|
|
|
16
16
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
@@ -19,20 +19,24 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
|
|
|
19
19
|
|
|
20
20
|
// A default option for CustProp view pane, with the ability to override labels for fields
|
|
21
21
|
var CustomPropertyView = function CustomPropertyView(_ref) {
|
|
22
|
-
var
|
|
22
|
+
var _customProperty$ctx, _customProperty$categ, _customProperty$categ2;
|
|
23
23
|
|
|
24
24
|
var customProperty = _ref.customProperty,
|
|
25
25
|
helpPopovers = _ref.helpPopovers,
|
|
26
|
+
passedIntlKey = _ref.intlKey,
|
|
27
|
+
passedIntlNS = _ref.intlNS,
|
|
26
28
|
_ref$labelOverrides = _ref.labelOverrides,
|
|
27
29
|
labelOverrides = _ref$labelOverrides === void 0 ? {} : _ref$labelOverrides;
|
|
30
|
+
var kintIntl = (0, _hooks.useKintIntl)(passedIntlKey, passedIntlNS);
|
|
28
31
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
29
32
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_components.Row, {
|
|
30
33
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Col, {
|
|
31
34
|
xs: 6,
|
|
32
35
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.KeyValue, {
|
|
33
36
|
label: /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
34
|
-
children: [
|
|
35
|
-
id:
|
|
37
|
+
children: [kintIntl.formatKintMessage({
|
|
38
|
+
id: 'customProperties.label',
|
|
39
|
+
overrideValue: labelOverrides === null || labelOverrides === void 0 ? void 0 : labelOverrides.label
|
|
36
40
|
}), helpPopovers !== null && helpPopovers !== void 0 && helpPopovers.label ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.InfoPopover, {
|
|
37
41
|
content: helpPopovers === null || helpPopovers === void 0 ? void 0 : helpPopovers.label
|
|
38
42
|
}) : null]
|
|
@@ -43,8 +47,9 @@ var CustomPropertyView = function CustomPropertyView(_ref) {
|
|
|
43
47
|
xs: 6,
|
|
44
48
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.KeyValue, {
|
|
45
49
|
label: /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
46
|
-
children: [
|
|
47
|
-
id:
|
|
50
|
+
children: [kintIntl.formatKintMessage({
|
|
51
|
+
id: 'customProperties.name',
|
|
52
|
+
overrideValue: labelOverrides === null || labelOverrides === void 0 ? void 0 : labelOverrides.name
|
|
48
53
|
}), helpPopovers !== null && helpPopovers !== void 0 && helpPopovers.name ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.InfoPopover, {
|
|
49
54
|
content: helpPopovers === null || helpPopovers === void 0 ? void 0 : helpPopovers.name
|
|
50
55
|
}) : null]
|
|
@@ -56,8 +61,9 @@ var CustomPropertyView = function CustomPropertyView(_ref) {
|
|
|
56
61
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Col, {
|
|
57
62
|
xs: 12,
|
|
58
63
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.KeyValue, {
|
|
59
|
-
label:
|
|
60
|
-
id:
|
|
64
|
+
label: kintIntl.formatKintMessage({
|
|
65
|
+
id: 'customProperties.description',
|
|
66
|
+
overrideValue: labelOverrides === null || labelOverrides === void 0 ? void 0 : labelOverrides.description
|
|
61
67
|
}),
|
|
62
68
|
value: customProperty === null || customProperty === void 0 ? void 0 : customProperty.description
|
|
63
69
|
})
|
|
@@ -66,21 +72,25 @@ var CustomPropertyView = function CustomPropertyView(_ref) {
|
|
|
66
72
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Col, {
|
|
67
73
|
xs: 6,
|
|
68
74
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.KeyValue, {
|
|
69
|
-
label:
|
|
70
|
-
id:
|
|
75
|
+
label: kintIntl.formatKintMessage({
|
|
76
|
+
id: 'customProperties.primary',
|
|
77
|
+
overrideValue: labelOverrides === null || labelOverrides === void 0 ? void 0 : labelOverrides.primary
|
|
71
78
|
}),
|
|
72
|
-
value:
|
|
73
|
-
id: customProperty !== null && customProperty !== void 0 && customProperty.primary ? '
|
|
79
|
+
value: kintIntl.formatKintMessage({
|
|
80
|
+
id: customProperty !== null && customProperty !== void 0 && customProperty.primary ? 'yes' : 'no',
|
|
81
|
+
overrideValue: customProperty !== null && customProperty !== void 0 && customProperty.primary ? labelOverrides.yes : labelOverrides.no
|
|
74
82
|
})
|
|
75
83
|
})
|
|
76
84
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Col, {
|
|
77
85
|
xs: 6,
|
|
78
86
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.KeyValue, {
|
|
79
|
-
label:
|
|
80
|
-
id:
|
|
87
|
+
label: kintIntl.formatKintMessage({
|
|
88
|
+
id: 'customProperties.retired',
|
|
89
|
+
overrideValue: labelOverrides === null || labelOverrides === void 0 ? void 0 : labelOverrides.retired
|
|
81
90
|
}),
|
|
82
|
-
value:
|
|
83
|
-
id: customProperty !== null && customProperty !== void 0 && customProperty.retired ? '
|
|
91
|
+
value: kintIntl.formatKintMessage({
|
|
92
|
+
id: customProperty !== null && customProperty !== void 0 && customProperty.retired ? 'yes' : 'no',
|
|
93
|
+
overrideValue: customProperty !== null && customProperty !== void 0 && customProperty.retired ? labelOverrides.yes : labelOverrides.no
|
|
84
94
|
})
|
|
85
95
|
})
|
|
86
96
|
})]
|
|
@@ -88,19 +98,22 @@ var CustomPropertyView = function CustomPropertyView(_ref) {
|
|
|
88
98
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Col, {
|
|
89
99
|
xs: 6,
|
|
90
100
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.KeyValue, {
|
|
91
|
-
label:
|
|
92
|
-
id:
|
|
101
|
+
label: kintIntl.formatKintMessage({
|
|
102
|
+
id: 'customProperties.weight',
|
|
103
|
+
overrideValue: labelOverrides === null || labelOverrides === void 0 ? void 0 : labelOverrides.weight
|
|
93
104
|
}),
|
|
94
105
|
value: customProperty === null || customProperty === void 0 ? void 0 : customProperty.weight
|
|
95
106
|
})
|
|
96
107
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Col, {
|
|
97
108
|
xs: 6,
|
|
98
109
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.KeyValue, {
|
|
99
|
-
label:
|
|
100
|
-
id:
|
|
110
|
+
label: kintIntl.formatKintMessage({
|
|
111
|
+
id: 'customProperties.defaultVisibility',
|
|
112
|
+
overrideValue: labelOverrides === null || labelOverrides === void 0 ? void 0 : labelOverrides.defaultVisibility
|
|
101
113
|
}),
|
|
102
|
-
value:
|
|
103
|
-
id: customProperty !== null && customProperty !== void 0 && customProperty.defaultInternal ? '
|
|
114
|
+
value: kintIntl.formatKintMessage({
|
|
115
|
+
id: customProperty !== null && customProperty !== void 0 && customProperty.defaultInternal ? 'customProperties.internalTrue' : 'customProperties.internalFalse',
|
|
116
|
+
overrideValue: customProperty !== null && customProperty !== void 0 && customProperty.defaultInternal ? labelOverrides.internalTrue : labelOverrides.internalFalse
|
|
104
117
|
})
|
|
105
118
|
})
|
|
106
119
|
})]
|
|
@@ -109,8 +122,9 @@ var CustomPropertyView = function CustomPropertyView(_ref) {
|
|
|
109
122
|
xs: 6,
|
|
110
123
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.KeyValue, {
|
|
111
124
|
label: /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
112
|
-
children: [
|
|
113
|
-
id:
|
|
125
|
+
children: [kintIntl.formatKintMessage({
|
|
126
|
+
id: 'customProperties.ctx',
|
|
127
|
+
overrideValue: labelOverrides === null || labelOverrides === void 0 ? void 0 : labelOverrides.ctx
|
|
114
128
|
}), helpPopovers !== null && helpPopovers !== void 0 && helpPopovers.ctx ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.InfoPopover, {
|
|
115
129
|
content: helpPopovers === null || helpPopovers === void 0 ? void 0 : helpPopovers.ctx
|
|
116
130
|
}) : null]
|
|
@@ -122,18 +136,21 @@ var CustomPropertyView = function CustomPropertyView(_ref) {
|
|
|
122
136
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Col, {
|
|
123
137
|
xs: 6,
|
|
124
138
|
children: (customProperty === null || customProperty === void 0 ? void 0 : customProperty.type) && /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.KeyValue, {
|
|
125
|
-
label:
|
|
126
|
-
id:
|
|
139
|
+
label: kintIntl.formatKintMessage({
|
|
140
|
+
id: 'customProperties.type',
|
|
141
|
+
overrideValue: labelOverrides === null || labelOverrides === void 0 ? void 0 : labelOverrides.type
|
|
127
142
|
}),
|
|
128
|
-
value:
|
|
129
|
-
id: "
|
|
143
|
+
value: kintIntl.formatKintMessage({
|
|
144
|
+
id: "customProperties.type.".concat(customProperty === null || customProperty === void 0 ? void 0 : customProperty.type),
|
|
145
|
+
overrideValue: labelOverrides === null || labelOverrides === void 0 ? void 0 : labelOverrides[customProperty === null || customProperty === void 0 ? void 0 : customProperty.type]
|
|
130
146
|
})
|
|
131
147
|
})
|
|
132
148
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Col, {
|
|
133
149
|
xs: 6,
|
|
134
150
|
children: ((customProperty === null || customProperty === void 0 ? void 0 : customProperty.type) === _customProperties.REFDATA_CLASS_NAME || (customProperty === null || customProperty === void 0 ? void 0 : customProperty.type) === _customProperties.MULTI_REFDATA_CLASS_NAME) && /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.KeyValue, {
|
|
135
|
-
label:
|
|
136
|
-
id:
|
|
151
|
+
label: kintIntl.formatKintMessage({
|
|
152
|
+
id: 'customProperties.category',
|
|
153
|
+
overrideValue: labelOverrides === null || labelOverrides === void 0 ? void 0 : labelOverrides.category
|
|
137
154
|
}),
|
|
138
155
|
value: (_customProperty$categ = customProperty === null || customProperty === void 0 ? void 0 : (_customProperty$categ2 = customProperty.category) === null || _customProperty$categ2 === void 0 ? void 0 : _customProperty$categ2.desc) !== null && _customProperty$categ !== void 0 ? _customProperty$categ : /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.NoValue, {})
|
|
139
156
|
})
|
|
@@ -159,6 +176,8 @@ CustomPropertyView.propTypes = {
|
|
|
159
176
|
})
|
|
160
177
|
}),
|
|
161
178
|
helpPopovers: _propTypes.default.object,
|
|
179
|
+
intlKey: _propTypes.default.string,
|
|
180
|
+
intlNS: _propTypes.default.string,
|
|
162
181
|
labelOverrides: _propTypes.default.object
|
|
163
182
|
};
|
|
164
183
|
var _default = CustomPropertyView;
|
|
@@ -10,11 +10,11 @@ var _reactRouterDom = require("react-router-dom");
|
|
|
10
10
|
|
|
11
11
|
var _stripesTesting = require("@folio/stripes-testing");
|
|
12
12
|
|
|
13
|
-
var
|
|
13
|
+
var _CustomPropertyView = _interopRequireDefault(require("./CustomPropertyView"));
|
|
14
14
|
|
|
15
|
-
var
|
|
15
|
+
var _customProperties = _interopRequireDefault(require("../../../../test/jest/customProperties"));
|
|
16
16
|
|
|
17
|
-
var
|
|
17
|
+
var _jest = require("../../../../test/jest");
|
|
18
18
|
|
|
19
19
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
20
20
|
|
|
@@ -26,16 +26,15 @@ function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try
|
|
|
26
26
|
|
|
27
27
|
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); }); }; }
|
|
28
28
|
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
32
|
-
|
|
33
|
-
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
34
|
-
|
|
29
|
+
jest.mock('../../hooks');
|
|
35
30
|
describe('CustomPropertyView', function () {
|
|
36
31
|
beforeEach(function () {
|
|
37
|
-
(0,
|
|
38
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_CustomPropertyView.default,
|
|
32
|
+
(0, _jest.renderWithKintHarness)( /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactRouterDom.MemoryRouter, {
|
|
33
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_CustomPropertyView.default, {
|
|
34
|
+
customProperty: _customProperties.default === null || _customProperties.default === void 0 ? void 0 : _customProperties.default.find(function (cp) {
|
|
35
|
+
return cp.name === 'Eligible authors';
|
|
36
|
+
})
|
|
37
|
+
})
|
|
39
38
|
}));
|
|
40
39
|
});
|
|
41
40
|
test('displays expected label value', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
|
@@ -106,13 +105,13 @@ describe('CustomPropertyView', function () {
|
|
|
106
105
|
}
|
|
107
106
|
}, _callee4);
|
|
108
107
|
})));
|
|
109
|
-
test('displays expected
|
|
108
|
+
test('displays expected Retired value', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5() {
|
|
110
109
|
return _regeneratorRuntime().wrap(function _callee5$(_context5) {
|
|
111
110
|
while (1) {
|
|
112
111
|
switch (_context5.prev = _context5.next) {
|
|
113
112
|
case 0:
|
|
114
113
|
_context5.next = 2;
|
|
115
|
-
return (0, _stripesTesting.KeyValue)('
|
|
114
|
+
return (0, _stripesTesting.KeyValue)('Retired').has({
|
|
116
115
|
value: 'No'
|
|
117
116
|
});
|
|
118
117
|
|
|
@@ -123,7 +122,7 @@ describe('CustomPropertyView', function () {
|
|
|
123
122
|
}
|
|
124
123
|
}, _callee5);
|
|
125
124
|
})));
|
|
126
|
-
test('displays expected
|
|
125
|
+
test('displays expected Weight value', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee6() {
|
|
127
126
|
return _regeneratorRuntime().wrap(function _callee6$(_context6) {
|
|
128
127
|
while (1) {
|
|
129
128
|
switch (_context6.prev = _context6.next) {
|
|
@@ -18,6 +18,8 @@ var CustomPropertiesEdit = function CustomPropertiesEdit(_ref) {
|
|
|
18
18
|
contexts = _ref$contexts === void 0 ? [] : _ref$contexts,
|
|
19
19
|
customPropertiesEndpoint = _ref.customPropertiesEndpoint,
|
|
20
20
|
id = _ref.id,
|
|
21
|
+
passedIntlKey = _ref.intlKey,
|
|
22
|
+
passedIntlNS = _ref.intlNS,
|
|
21
23
|
_ref$labelOverrides = _ref.labelOverrides,
|
|
22
24
|
labelOverrides = _ref$labelOverrides === void 0 ? {} : _ref$labelOverrides,
|
|
23
25
|
nameOverride = _ref.nameOverride;
|
|
@@ -26,6 +28,8 @@ var CustomPropertiesEdit = function CustomPropertiesEdit(_ref) {
|
|
|
26
28
|
ctx: ctx,
|
|
27
29
|
customPropertiesEndpoint: customPropertiesEndpoint,
|
|
28
30
|
id: id,
|
|
31
|
+
intlKey: passedIntlKey,
|
|
32
|
+
intlNS: passedIntlNS,
|
|
29
33
|
labelOverrides: labelOverrides,
|
|
30
34
|
nameOverride: nameOverride
|
|
31
35
|
}, "customPropertiesEdit-".concat(ctx));
|
|
@@ -36,6 +40,8 @@ CustomPropertiesEdit.propTypes = {
|
|
|
36
40
|
contexts: _propTypes.default.arrayOf(_propTypes.default.string),
|
|
37
41
|
customPropertiesEndpoint: _propTypes.default.string,
|
|
38
42
|
id: _propTypes.default.string,
|
|
43
|
+
intlKey: _propTypes.default.string,
|
|
44
|
+
intlNS: _propTypes.default.string,
|
|
39
45
|
labelOverrides: _propTypes.default.object,
|
|
40
46
|
nameOverride: _propTypes.default.string
|
|
41
47
|
};
|
|
@@ -8,22 +8,14 @@ var _react2 = require("@testing-library/react");
|
|
|
8
8
|
|
|
9
9
|
var _reactRouterDom = require("react-router-dom");
|
|
10
10
|
|
|
11
|
-
var _helpers = require("../../../../test/jest/helpers");
|
|
12
|
-
|
|
13
|
-
var _testResources = require("./testResources");
|
|
14
|
-
|
|
15
11
|
var _CustomPropertiesEdit = _interopRequireDefault(require("./CustomPropertiesEdit"));
|
|
16
12
|
|
|
13
|
+
var _jest = require("../../../../test/jest");
|
|
14
|
+
|
|
17
15
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
18
16
|
|
|
19
17
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
20
18
|
|
|
21
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
22
|
-
|
|
23
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
24
|
-
|
|
25
|
-
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
26
|
-
|
|
27
19
|
jest.mock('./CustomPropertiesEditCtx', function () {
|
|
28
20
|
return function () {
|
|
29
21
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
@@ -34,8 +26,12 @@ jest.mock('./CustomPropertiesEditCtx', function () {
|
|
|
34
26
|
describe('CustomPropertiesEdit', function () {
|
|
35
27
|
var renderComponent;
|
|
36
28
|
beforeEach(function () {
|
|
37
|
-
renderComponent = (0,
|
|
38
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_CustomPropertiesEdit.default,
|
|
29
|
+
renderComponent = (0, _jest.renderWithKintHarness)( /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactRouterDom.MemoryRouter, {
|
|
30
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_CustomPropertiesEdit.default, {
|
|
31
|
+
contexts: ['isNull', 'OpenAccess'],
|
|
32
|
+
customPropertiesEndpoint: "erm/custprops",
|
|
33
|
+
id: "supplementaryProperties"
|
|
34
|
+
})
|
|
39
35
|
}));
|
|
40
36
|
});
|
|
41
37
|
it('renders CustomPropertiesEditCtx component ', function () {
|
|
@@ -7,8 +7,6 @@ exports.default = void 0;
|
|
|
7
7
|
|
|
8
8
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
9
9
|
|
|
10
|
-
var _reactIntl = require("react-intl");
|
|
11
|
-
|
|
12
10
|
var _components = require("@folio/stripes/components");
|
|
13
11
|
|
|
14
12
|
var _CustomPropertiesListField = _interopRequireDefault(require("./CustomPropertiesListField"));
|
|
@@ -23,39 +21,35 @@ var CustomPropertiesEditCtx = function CustomPropertiesEditCtx(_ref) {
|
|
|
23
21
|
var ctx = _ref.ctx,
|
|
24
22
|
customPropertiesEndpoint = _ref.customPropertiesEndpoint,
|
|
25
23
|
id = _ref.id,
|
|
24
|
+
passedIntlKey = _ref.intlKey,
|
|
25
|
+
passedIntlNS = _ref.intlNS,
|
|
26
26
|
_ref$labelOverrides = _ref.labelOverrides,
|
|
27
27
|
labelOverrides = _ref$labelOverrides === void 0 ? {} : _ref$labelOverrides,
|
|
28
28
|
nameOverride = _ref.nameOverride;
|
|
29
|
+
var kintIntl = (0, _hooks.useKintIntl)(passedIntlKey, passedIntlNS); // Deal with all the possible label override options
|
|
29
30
|
|
|
30
|
-
// Deal with all the possible label override options
|
|
31
31
|
var getAccordionLabel = function getAccordionLabel() {
|
|
32
|
-
var _labelOverrides$defau;
|
|
33
|
-
|
|
34
32
|
// Special case for null context
|
|
35
33
|
if (ctx === 'isNull') {
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
id: "stripes-kint-components.customProperties"
|
|
34
|
+
return kintIntl.formatKintMessage({
|
|
35
|
+
id: 'customProperties',
|
|
36
|
+
overrideValue: labelOverrides.noContext
|
|
40
37
|
});
|
|
41
|
-
} //
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
if (labelOverrides[ctx]) {
|
|
45
|
-
return labelOverrides[ctx];
|
|
46
|
-
} // Label override for default title, taking ctx into account
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
if (labelOverrides.defaultTitle && typeof labelOverrides.defaultTitle === 'function') {
|
|
50
|
-
return labelOverrides.defaultTitle(ctx);
|
|
51
|
-
} // Label override for default title or finally built in default
|
|
38
|
+
} // Chain formatKintMessages together using provided fallbackMessage to
|
|
39
|
+
// allow for "If override or translation exists, use it, else use default"
|
|
52
40
|
|
|
53
41
|
|
|
54
|
-
return
|
|
55
|
-
id: "
|
|
56
|
-
|
|
42
|
+
return kintIntl.formatKintMessage({
|
|
43
|
+
id: "customProperties.ctx.".concat(ctx),
|
|
44
|
+
overrideValue: labelOverrides[ctx],
|
|
45
|
+
fallbackMessage: kintIntl.formatKintMessage({
|
|
46
|
+
id: 'customProperties.defaultTitle',
|
|
47
|
+
overrideValue: labelOverrides.defaultTitle
|
|
48
|
+
}, {
|
|
57
49
|
ctx: ctx
|
|
58
|
-
}
|
|
50
|
+
})
|
|
51
|
+
}, {
|
|
52
|
+
ctx: ctx
|
|
59
53
|
});
|
|
60
54
|
};
|
|
61
55
|
|
|
@@ -84,6 +78,8 @@ var CustomPropertiesEditCtx = function CustomPropertiesEditCtx(_ref) {
|
|
|
84
78
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_CustomPropertiesListField.default, {
|
|
85
79
|
ctx: ctx,
|
|
86
80
|
customProperties: custprops,
|
|
81
|
+
intlKey: passedIntlKey,
|
|
82
|
+
intlNS: passedIntlNS,
|
|
87
83
|
labelOverrides: labelOverrides,
|
|
88
84
|
name: nameOverride !== null && nameOverride !== void 0 ? nameOverride : 'customProperties'
|
|
89
85
|
})
|
|
@@ -94,6 +90,8 @@ CustomPropertiesEditCtx.propTypes = {
|
|
|
94
90
|
ctx: _propTypes.default.string,
|
|
95
91
|
customPropertiesEndpoint: _propTypes.default.string,
|
|
96
92
|
id: _propTypes.default.string,
|
|
93
|
+
intlKey: _propTypes.default.string,
|
|
94
|
+
intlNS: _propTypes.default.string,
|
|
97
95
|
labelOverrides: _propTypes.default.object,
|
|
98
96
|
nameOverride: _propTypes.default.string
|
|
99
97
|
};
|
|
@@ -8,22 +8,14 @@ var _react2 = require("@testing-library/react");
|
|
|
8
8
|
|
|
9
9
|
var _reactRouterDom = require("react-router-dom");
|
|
10
10
|
|
|
11
|
-
var _helpers = require("../../../../test/jest/helpers");
|
|
12
|
-
|
|
13
|
-
var _testResources = require("./testResources");
|
|
14
|
-
|
|
15
11
|
var _CustomPropertiesEditCtx = _interopRequireDefault(require("./CustomPropertiesEditCtx"));
|
|
16
12
|
|
|
13
|
+
var _jest = require("../../../../test/jest");
|
|
14
|
+
|
|
17
15
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
18
16
|
|
|
19
17
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
20
18
|
|
|
21
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
22
|
-
|
|
23
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
24
|
-
|
|
25
|
-
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
26
|
-
|
|
27
19
|
jest.mock('./CustomPropertiesListField', function () {
|
|
28
20
|
return function () {
|
|
29
21
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
@@ -31,11 +23,16 @@ jest.mock('./CustomPropertiesListField', function () {
|
|
|
31
23
|
});
|
|
32
24
|
};
|
|
33
25
|
});
|
|
26
|
+
jest.mock('../../hooks');
|
|
34
27
|
describe('CustomPropertiesEditCtx', function () {
|
|
35
28
|
var renderComponent;
|
|
36
29
|
beforeEach(function () {
|
|
37
|
-
renderComponent = (0,
|
|
38
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_CustomPropertiesEditCtx.default,
|
|
30
|
+
renderComponent = (0, _jest.renderWithKintHarness)( /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactRouterDom.MemoryRouter, {
|
|
31
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_CustomPropertiesEditCtx.default, {
|
|
32
|
+
ctx: "OpenAccess",
|
|
33
|
+
customPropertiesEndpoint: "erm/custprops",
|
|
34
|
+
id: "supplementaryProperties"
|
|
35
|
+
})
|
|
39
36
|
}));
|
|
40
37
|
});
|
|
41
38
|
it('renders CustomPropertiesListField component ', function () {
|
|
@@ -13,15 +13,13 @@ var _reactFinalForm = require("react-final-form");
|
|
|
13
13
|
|
|
14
14
|
var _components = require("@folio/stripes/components");
|
|
15
15
|
|
|
16
|
-
var _reactIntl = require("react-intl");
|
|
17
|
-
|
|
18
16
|
var _hooks = require("../../hooks");
|
|
19
17
|
|
|
20
18
|
var _CustomPropertyFormCard = _interopRequireDefault(require("./CustomPropertyFormCard"));
|
|
21
19
|
|
|
22
20
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
23
21
|
|
|
24
|
-
var _excluded = ["ctx", "customProperties", "labelOverrides"];
|
|
22
|
+
var _excluded = ["ctx", "customProperties", "intlKey", "intlNS", "labelOverrides"];
|
|
25
23
|
|
|
26
24
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
27
25
|
|
|
@@ -56,17 +54,18 @@ function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Sy
|
|
|
56
54
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
57
55
|
|
|
58
56
|
var CustomPropertiesList = function CustomPropertiesList(_ref) {
|
|
59
|
-
var _labelOverrides$prima, _labelOverrides$optio, _labelOverrides$addPr;
|
|
60
|
-
|
|
61
57
|
var _ref$availableCustomP = _ref.availableCustomProperties,
|
|
62
58
|
availableCustomProperties = _ref$availableCustomP === void 0 ? [] : _ref$availableCustomP,
|
|
63
59
|
_ref$input = _ref.input,
|
|
64
60
|
name = _ref$input.name,
|
|
65
61
|
onChange = _ref$input.onChange,
|
|
66
62
|
value = _ref$input.value,
|
|
63
|
+
passedIntlKey = _ref.intlKey,
|
|
64
|
+
passedIntlNS = _ref.intlNS,
|
|
67
65
|
_ref$labelOverrides = _ref.labelOverrides,
|
|
68
66
|
labelOverrides = _ref$labelOverrides === void 0 ? {} : _ref$labelOverrides,
|
|
69
67
|
pristine = _ref.meta.pristine;
|
|
68
|
+
var kintIntl = (0, _hooks.useKintIntl)(passedIntlKey, passedIntlNS);
|
|
70
69
|
|
|
71
70
|
var _useState = (0, _react.useState)([]),
|
|
72
71
|
_useState2 = _slicedToArray(_useState, 2),
|
|
@@ -129,6 +128,8 @@ var CustomPropertiesList = function CustomPropertiesList(_ref) {
|
|
|
129
128
|
handleDeleteCustomProperty: handleDeleteCustomProperty,
|
|
130
129
|
index: index,
|
|
131
130
|
internalPropertyCounter: internalPropertyCounter,
|
|
131
|
+
intlKey: passedIntlKey,
|
|
132
|
+
intlNS: passedIntlNS,
|
|
132
133
|
labelOverrides: labelOverrides,
|
|
133
134
|
name: name,
|
|
134
135
|
onChange: onChange,
|
|
@@ -145,16 +146,28 @@ var CustomPropertiesList = function CustomPropertiesList(_ref) {
|
|
|
145
146
|
var customProperty = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
146
147
|
return customProperty.primary;
|
|
147
148
|
}) && /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.KeyValue, {
|
|
148
|
-
label:
|
|
149
|
-
|
|
149
|
+
label: /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Headline, {
|
|
150
|
+
margin: "x-small",
|
|
151
|
+
size: "large",
|
|
152
|
+
tag: "h4",
|
|
153
|
+
children: kintIntl.formatKintMessage({
|
|
154
|
+
id: 'customProperties.primaryProperties',
|
|
155
|
+
overrideValue: labelOverrides.primaryProperties
|
|
156
|
+
})
|
|
150
157
|
}),
|
|
151
158
|
value: renderCustomProperties('primary')
|
|
152
159
|
}), availableCustomProperties.some(function () {
|
|
153
160
|
var customProperty = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
154
161
|
return !customProperty.primary;
|
|
155
162
|
}) && /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.KeyValue, {
|
|
156
|
-
label:
|
|
157
|
-
|
|
163
|
+
label: /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Headline, {
|
|
164
|
+
margin: "x-small",
|
|
165
|
+
size: "large",
|
|
166
|
+
tag: "h4",
|
|
167
|
+
children: kintIntl.formatKintMessage({
|
|
168
|
+
id: 'customProperties.optionalProperties',
|
|
169
|
+
overrideValue: labelOverrides.optionalProperties
|
|
170
|
+
})
|
|
158
171
|
}),
|
|
159
172
|
value: renderCustomProperties('optional')
|
|
160
173
|
}), availableCustomProperties.some(function () {
|
|
@@ -166,8 +179,9 @@ var CustomPropertiesList = function CustomPropertiesList(_ref) {
|
|
|
166
179
|
setCustomProperties([].concat(_toConsumableArray(customProperties), [{}]));
|
|
167
180
|
setDirtying(true);
|
|
168
181
|
},
|
|
169
|
-
children:
|
|
170
|
-
id:
|
|
182
|
+
children: kintIntl.formatKintMessage({
|
|
183
|
+
id: 'customProperties.addProperty',
|
|
184
|
+
overrideValue: labelOverrides.addProperty
|
|
171
185
|
})
|
|
172
186
|
})]
|
|
173
187
|
});
|
|
@@ -176,11 +190,40 @@ var CustomPropertiesList = function CustomPropertiesList(_ref) {
|
|
|
176
190
|
var CustomPropertiesListField = function CustomPropertiesListField(_ref2) {
|
|
177
191
|
var ctx = _ref2.ctx,
|
|
178
192
|
customProperties = _ref2.customProperties,
|
|
179
|
-
|
|
193
|
+
passedIntlKey = _ref2.intlKey,
|
|
194
|
+
passedIntlNS = _ref2.intlNS,
|
|
195
|
+
_ref2$labelOverrides = _ref2.labelOverrides,
|
|
196
|
+
labelOverrides = _ref2$labelOverrides === void 0 ? {} : _ref2$labelOverrides,
|
|
180
197
|
fieldProps = _objectWithoutProperties(_ref2, _excluded);
|
|
181
198
|
|
|
182
199
|
var fieldRef = (0, _react.useRef)();
|
|
183
|
-
var
|
|
200
|
+
var kintIntl = (0, _hooks.useKintIntl)(passedIntlKey, passedIntlNS); // Map customProperties to bring together the options and the definition values
|
|
201
|
+
|
|
202
|
+
var availableCustomProperties = customProperties === null || customProperties === void 0 ? void 0 : customProperties.map(function (customProperty) {
|
|
203
|
+
var _customProperty$categ;
|
|
204
|
+
|
|
205
|
+
var options = customProperty === null || customProperty === void 0 ? void 0 : (_customProperty$categ = customProperty.category) === null || _customProperty$categ === void 0 ? void 0 : _customProperty$categ.values;
|
|
206
|
+
|
|
207
|
+
if (options) {
|
|
208
|
+
options = [{
|
|
209
|
+
label: kintIntl.formatKintMessage({
|
|
210
|
+
id: 'notSet',
|
|
211
|
+
overrideValue: labelOverrides.notSet
|
|
212
|
+
}),
|
|
213
|
+
value: ''
|
|
214
|
+
}].concat(_toConsumableArray(options));
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
return {
|
|
218
|
+
description: customProperty.description,
|
|
219
|
+
label: customProperty.label,
|
|
220
|
+
primary: customProperty.primary,
|
|
221
|
+
type: customProperty.type,
|
|
222
|
+
options: options,
|
|
223
|
+
value: customProperty.name,
|
|
224
|
+
defaultInternal: customProperty.defaultInternal
|
|
225
|
+
};
|
|
226
|
+
});
|
|
184
227
|
|
|
185
228
|
var _useFormState = (0, _reactFinalForm.useFormState)(),
|
|
186
229
|
initialValues = _useFormState.initialValues;
|
|
@@ -218,6 +261,8 @@ var CustomPropertiesListField = function CustomPropertiesListField(_ref2) {
|
|
|
218
261
|
ref: fieldRef,
|
|
219
262
|
availableCustomProperties: availableCustomProperties,
|
|
220
263
|
ctx: ctx,
|
|
264
|
+
intlKey: passedIntlKey,
|
|
265
|
+
intlNS: passedIntlNS,
|
|
221
266
|
labelOverrides: labelOverrides
|
|
222
267
|
}, p));
|
|
223
268
|
}
|
|
@@ -227,6 +272,8 @@ var CustomPropertiesListField = function CustomPropertiesListField(_ref2) {
|
|
|
227
272
|
CustomPropertiesListField.propTypes = {
|
|
228
273
|
ctx: _propTypes.default.string,
|
|
229
274
|
customProperties: _propTypes.default.arrayOf(_propTypes.default.object),
|
|
275
|
+
intlKey: _propTypes.default.string,
|
|
276
|
+
intlNS: _propTypes.default.string,
|
|
230
277
|
labelOverrides: _propTypes.default.object
|
|
231
278
|
};
|
|
232
279
|
CustomPropertiesList.propTypes = {
|
|
@@ -237,6 +284,8 @@ CustomPropertiesList.propTypes = {
|
|
|
237
284
|
value: _propTypes.default.oneOfType([_propTypes.default.object, _propTypes.default.string]),
|
|
238
285
|
onChange: _propTypes.default.func
|
|
239
286
|
}),
|
|
287
|
+
intlKey: _propTypes.default.string,
|
|
288
|
+
intlNS: _propTypes.default.string,
|
|
240
289
|
labelOverrides: _propTypes.default.object,
|
|
241
290
|
meta: _propTypes.default.object
|
|
242
291
|
};
|