@k-int/stripes-kint-components 2.8.2 → 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 +15 -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 +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 +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 +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 +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 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
7
|
});
|
|
8
8
|
exports.default = void 0;
|
|
9
9
|
|
|
10
|
-
var _reactIntl = require("react-intl");
|
|
11
|
-
|
|
12
10
|
var CUSTPROP_TYPES = _interopRequireWildcard(require("../../constants/customProperties"));
|
|
13
11
|
|
|
12
|
+
var _hooks = require("../../hooks");
|
|
13
|
+
|
|
14
14
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
15
15
|
|
|
16
16
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
@@ -22,38 +22,53 @@ var REFDATA = CUSTPROP_TYPES.REFDATA_CLASS_NAME,
|
|
|
22
22
|
DATE = CUSTPROP_TYPES.DATE_CLASS_NAME,
|
|
23
23
|
TEXT = CUSTPROP_TYPES.TEXT_CLASS_NAME;
|
|
24
24
|
|
|
25
|
-
var useOperators = function useOperators(
|
|
26
|
-
var
|
|
27
|
-
|
|
28
|
-
var
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
});
|
|
32
|
-
};
|
|
33
|
-
|
|
25
|
+
var useOperators = function useOperators() {
|
|
26
|
+
var type = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
|
|
27
|
+
var passedIntlKey = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
|
|
28
|
+
var passedIntlNS = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;
|
|
29
|
+
var labelOverrides = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
|
|
30
|
+
var kintIntl = (0, _hooks.useKintIntl)(passedIntlKey, passedIntlNS);
|
|
34
31
|
var operators = [{
|
|
35
32
|
value: ' isSet',
|
|
36
|
-
label:
|
|
33
|
+
label: kintIntl.formatKintMessage({
|
|
34
|
+
id: 'operator.isSet',
|
|
35
|
+
overrideValue: labelOverrides.operatorIsSet
|
|
36
|
+
}),
|
|
37
37
|
noValueAllowed: true
|
|
38
38
|
}, {
|
|
39
39
|
value: ' isNotSet',
|
|
40
|
-
label:
|
|
40
|
+
label: kintIntl.formatKintMessage({
|
|
41
|
+
id: 'operator.isNotSet',
|
|
42
|
+
overrideValue: labelOverrides.operatorIsNotSet
|
|
43
|
+
}),
|
|
41
44
|
noValueAllowed: true
|
|
42
45
|
}];
|
|
43
46
|
|
|
44
47
|
if (!type || type === INTEGER || type === DECIMAL) {
|
|
45
48
|
operators.push({
|
|
46
49
|
value: '==',
|
|
47
|
-
label:
|
|
50
|
+
label: kintIntl.formatKintMessage({
|
|
51
|
+
id: 'operator.equals',
|
|
52
|
+
overrideValue: labelOverrides.operatorEquals
|
|
53
|
+
})
|
|
48
54
|
}, {
|
|
49
55
|
value: '!=',
|
|
50
|
-
label:
|
|
56
|
+
label: kintIntl.formatKintMessage({
|
|
57
|
+
id: 'operator.doesNotEqual',
|
|
58
|
+
overrideValue: labelOverrides.operatorDoesNotEqual
|
|
59
|
+
})
|
|
51
60
|
}, {
|
|
52
61
|
value: '>=',
|
|
53
|
-
label:
|
|
62
|
+
label: kintIntl.formatKintMessage({
|
|
63
|
+
id: 'operator.isGreaterThanOrEqual',
|
|
64
|
+
overrideValue: labelOverrides.operatorIsGreaterThanOrEqual
|
|
65
|
+
})
|
|
54
66
|
}, {
|
|
55
67
|
value: '<=',
|
|
56
|
-
label:
|
|
68
|
+
label: kintIntl.formatKintMessage({
|
|
69
|
+
id: 'operator.isLessThanOrEqual',
|
|
70
|
+
overrideValue: labelOverrides.operatorIsLessThanOrEqual
|
|
71
|
+
})
|
|
57
72
|
});
|
|
58
73
|
}
|
|
59
74
|
|
|
@@ -61,43 +76,70 @@ var useOperators = function useOperators(type) {
|
|
|
61
76
|
// Basically the same as the "number" types above, so no need to reassign if there is no type
|
|
62
77
|
operators.push({
|
|
63
78
|
value: '==',
|
|
64
|
-
label:
|
|
79
|
+
label: kintIntl.formatKintMessage({
|
|
80
|
+
id: 'operator.equals',
|
|
81
|
+
overrideValue: labelOverrides.operatorEquals
|
|
82
|
+
})
|
|
65
83
|
}, {
|
|
66
84
|
value: '!=',
|
|
67
|
-
label:
|
|
85
|
+
label: kintIntl.formatKintMessage({
|
|
86
|
+
id: 'operator.doesNotEqual',
|
|
87
|
+
overrideValue: labelOverrides.operatorDoesNotEqual
|
|
88
|
+
})
|
|
68
89
|
}, {
|
|
69
90
|
value: '>=',
|
|
70
|
-
label:
|
|
91
|
+
label: kintIntl.formatKintMessage({
|
|
92
|
+
id: 'operator.isOnOrAfter',
|
|
93
|
+
overrideValue: labelOverrides.operatorIsOnOrAfter
|
|
94
|
+
})
|
|
71
95
|
}, {
|
|
72
96
|
value: '<=',
|
|
73
|
-
label:
|
|
97
|
+
label: kintIntl.formatKintMessage({
|
|
98
|
+
id: 'operator.isOnOrBefore',
|
|
99
|
+
overrideValue: labelOverrides.operatorIsOnOrBefore
|
|
100
|
+
})
|
|
74
101
|
});
|
|
75
102
|
}
|
|
76
103
|
|
|
77
104
|
if (!type || type === REFDATA) {
|
|
78
105
|
operators.push({
|
|
79
106
|
value: '==',
|
|
80
|
-
label:
|
|
107
|
+
label: kintIntl.formatKintMessage({
|
|
108
|
+
id: 'operator.is',
|
|
109
|
+
overrideValue: labelOverrides.operatorIs
|
|
110
|
+
})
|
|
81
111
|
}, {
|
|
82
112
|
value: '!=',
|
|
83
|
-
label:
|
|
113
|
+
label: kintIntl.formatKintMessage({
|
|
114
|
+
id: 'operator.isNot',
|
|
115
|
+
overrideValue: labelOverrides.operatorIsNot
|
|
116
|
+
})
|
|
84
117
|
});
|
|
85
118
|
}
|
|
86
119
|
|
|
87
|
-
if (
|
|
120
|
+
if (type === MULTIREFDATA) {
|
|
88
121
|
operators.push({
|
|
89
122
|
value: '==',
|
|
90
|
-
label:
|
|
123
|
+
label: kintIntl.formatKintMessage({
|
|
124
|
+
id: 'operator.contains',
|
|
125
|
+
overrideValue: labelOverrides.operatorContains
|
|
126
|
+
})
|
|
91
127
|
});
|
|
92
128
|
}
|
|
93
129
|
|
|
94
130
|
if (!type || type === TEXT) {
|
|
95
131
|
operators.push({
|
|
96
132
|
value: '=~',
|
|
97
|
-
label:
|
|
133
|
+
label: kintIntl.formatKintMessage({
|
|
134
|
+
id: 'operator.contains',
|
|
135
|
+
overrideValue: labelOverrides.operatorContains
|
|
136
|
+
})
|
|
98
137
|
}, {
|
|
99
138
|
value: '!~',
|
|
100
|
-
label:
|
|
139
|
+
label: kintIntl.formatKintMessage({
|
|
140
|
+
id: 'operator.doesNotContain',
|
|
141
|
+
overrideValue: labelOverrides.operatorDoesNotContain
|
|
142
|
+
})
|
|
101
143
|
});
|
|
102
144
|
}
|
|
103
145
|
|
|
@@ -21,8 +21,9 @@ function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Sy
|
|
|
21
21
|
|
|
22
22
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
23
23
|
|
|
24
|
-
var useParseActiveFilterStrings = function useParseActiveFilterStrings(filterStrings) {
|
|
25
|
-
var
|
|
24
|
+
var useParseActiveFilterStrings = function useParseActiveFilterStrings(filterStrings, passedIntlKey, passedIntlNS) {
|
|
25
|
+
var labelOverrides = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
|
|
26
|
+
var operators = (0, _useOperators.default)(null, passedIntlKey, passedIntlNS, labelOverrides).map(function (o) {
|
|
26
27
|
return o.value;
|
|
27
28
|
});
|
|
28
29
|
var numberOfFilters = 0;
|
|
@@ -24,7 +24,8 @@ var REFDATA = CUSTPROP_TYPES.REFDATA_CLASS_NAME,
|
|
|
24
24
|
DATE = CUSTPROP_TYPES.DATE_CLASS_NAME,
|
|
25
25
|
TEXT = CUSTPROP_TYPES.TEXT_CLASS_NAME;
|
|
26
26
|
|
|
27
|
-
var useValueProps = function useValueProps(custPropDefinition) {
|
|
27
|
+
var useValueProps = function useValueProps(custPropDefinition, intlKey, intlNS) {
|
|
28
|
+
var labelOverrides = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
|
|
28
29
|
var props = {
|
|
29
30
|
validate: _validators.required
|
|
30
31
|
};
|
|
@@ -34,7 +35,11 @@ var useValueProps = function useValueProps(custPropDefinition) {
|
|
|
34
35
|
case DECIMAL:
|
|
35
36
|
props.component = _components.TextField;
|
|
36
37
|
props.type = 'number';
|
|
37
|
-
|
|
38
|
+
|
|
39
|
+
props.validate = function (value) {
|
|
40
|
+
return (0, _validators.invalidNumber)(value, intlKey, intlNS, labelOverrides);
|
|
41
|
+
};
|
|
42
|
+
|
|
38
43
|
break;
|
|
39
44
|
|
|
40
45
|
case REFDATA:
|
|
@@ -19,6 +19,8 @@ var CustomPropertiesView = function CustomPropertiesView(_ref) {
|
|
|
19
19
|
customProperties = _ref.customProperties,
|
|
20
20
|
customPropertiesEndpoint = _ref.customPropertiesEndpoint,
|
|
21
21
|
id = _ref.id,
|
|
22
|
+
passedIntlKey = _ref.intlKey,
|
|
23
|
+
passedIntlNS = _ref.intlNS,
|
|
22
24
|
_ref$labelOverrides = _ref.labelOverrides,
|
|
23
25
|
labelOverrides = _ref$labelOverrides === void 0 ? {} : _ref$labelOverrides;
|
|
24
26
|
return contexts.map(function (ctx) {
|
|
@@ -27,6 +29,8 @@ var CustomPropertiesView = function CustomPropertiesView(_ref) {
|
|
|
27
29
|
customProperties: customProperties,
|
|
28
30
|
customPropertiesEndpoint: customPropertiesEndpoint,
|
|
29
31
|
id: id,
|
|
32
|
+
intlKey: passedIntlKey,
|
|
33
|
+
intlNS: passedIntlNS,
|
|
30
34
|
labelOverrides: labelOverrides
|
|
31
35
|
}, "customPropertiesView-".concat(ctx));
|
|
32
36
|
});
|
|
@@ -37,6 +41,8 @@ CustomPropertiesView.propTypes = {
|
|
|
37
41
|
customProperties: _propTypes.default.object,
|
|
38
42
|
customPropertiesEndpoint: _propTypes.default.string,
|
|
39
43
|
id: _propTypes.default.string,
|
|
44
|
+
intlKey: _propTypes.default.string,
|
|
45
|
+
intlNS: _propTypes.default.string,
|
|
40
46
|
labelOverrides: _propTypes.default.object,
|
|
41
47
|
nameOverride: _propTypes.default.string
|
|
42
48
|
};
|
|
@@ -8,16 +8,17 @@ 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
11
|
var _testResources = require("./testResources");
|
|
14
12
|
|
|
15
13
|
var _CustomPropertiesView = _interopRequireDefault(require("./CustomPropertiesView"));
|
|
16
14
|
|
|
15
|
+
var _jest = require("../../../../test/jest");
|
|
16
|
+
|
|
17
17
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
18
18
|
|
|
19
19
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
20
20
|
|
|
21
|
+
jest.mock('../../hooks');
|
|
21
22
|
jest.mock('./CustomPropertiesViewCtx', function () {
|
|
22
23
|
return function () {
|
|
23
24
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
@@ -28,7 +29,7 @@ jest.mock('./CustomPropertiesViewCtx', function () {
|
|
|
28
29
|
describe('CustomPropertiesView', function () {
|
|
29
30
|
var renderComponent;
|
|
30
31
|
beforeEach(function () {
|
|
31
|
-
renderComponent = (0,
|
|
32
|
+
renderComponent = (0, _jest.renderWithKintHarness)( /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactRouterDom.MemoryRouter, {
|
|
32
33
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_CustomPropertiesView.default, {
|
|
33
34
|
contexts: _testResources.contexts,
|
|
34
35
|
customProperties: _testResources.customProperties,
|
|
@@ -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 _hooks = require("../../hooks");
|
|
@@ -39,38 +37,32 @@ var CustomPropertiesViewCtx = function CustomPropertiesViewCtx(_ref) {
|
|
|
39
37
|
customProperties = _ref$customProperties === void 0 ? [] : _ref$customProperties,
|
|
40
38
|
customPropertiesEndpoint = _ref.customPropertiesEndpoint,
|
|
41
39
|
id = _ref.id,
|
|
40
|
+
passedIntlKey = _ref.intlKey,
|
|
41
|
+
passedIntlNS = _ref.intlNS,
|
|
42
42
|
_ref$labelOverrides = _ref.labelOverrides,
|
|
43
43
|
labelOverrides = _ref$labelOverrides === void 0 ? {} : _ref$labelOverrides;
|
|
44
|
+
var kintIntl = (0, _hooks.useKintIntl)(passedIntlKey, passedIntlNS); // Deal with all the possible label override options
|
|
44
45
|
|
|
45
|
-
// Deal with all the possible label override options
|
|
46
46
|
var getAccordionLabel = function getAccordionLabel() {
|
|
47
|
-
var _labelOverrides$defau;
|
|
48
|
-
|
|
49
47
|
// Special case for null context
|
|
50
48
|
if (ctx === 'isNull') {
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
id: "stripes-kint-components.customProperties"
|
|
49
|
+
return kintIntl.formatKintMessage({
|
|
50
|
+
id: 'customProperties',
|
|
51
|
+
overrideValue: labelOverrides.noContext
|
|
55
52
|
});
|
|
56
53
|
} // Label overrides for specific contexts
|
|
57
54
|
|
|
58
55
|
|
|
59
56
|
if (labelOverrides[ctx]) {
|
|
60
57
|
return labelOverrides[ctx];
|
|
61
|
-
} // Label override for default title, taking ctx into account
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
if (labelOverrides.defaultTitle && typeof labelOverrides.defaultTitle === 'function') {
|
|
65
|
-
return labelOverrides.defaultTitle(ctx);
|
|
66
58
|
} // Label override for default title or finally built in default
|
|
67
59
|
|
|
68
60
|
|
|
69
|
-
return
|
|
70
|
-
id:
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
61
|
+
return kintIntl.formatKintMessage({
|
|
62
|
+
id: 'customProperties.defaultTitle',
|
|
63
|
+
overrideValue: labelOverrides.defaultTitle
|
|
64
|
+
}, {
|
|
65
|
+
ctx: ctx
|
|
74
66
|
});
|
|
75
67
|
};
|
|
76
68
|
|
|
@@ -160,6 +152,8 @@ CustomPropertiesViewCtx.propTypes = {
|
|
|
160
152
|
customProperties: _propTypes.default.object,
|
|
161
153
|
customPropertiesEndpoint: _propTypes.default.string,
|
|
162
154
|
id: _propTypes.default.string,
|
|
155
|
+
intlKey: _propTypes.default.string,
|
|
156
|
+
intlNS: _propTypes.default.string,
|
|
163
157
|
labelOverrides: _propTypes.default.object
|
|
164
158
|
};
|
|
165
159
|
var _default = CustomPropertiesViewCtx;
|
|
@@ -8,12 +8,12 @@ var _reactRouterDom = require("react-router-dom");
|
|
|
8
8
|
|
|
9
9
|
var _react2 = require("@testing-library/react");
|
|
10
10
|
|
|
11
|
-
var _helpers = require("../../../../test/jest/helpers");
|
|
12
|
-
|
|
13
11
|
var _testResources = require("./testResources");
|
|
14
12
|
|
|
15
13
|
var _CustomPropertiesViewCtx = _interopRequireDefault(require("./CustomPropertiesViewCtx"));
|
|
16
14
|
|
|
15
|
+
var _jest = require("../../../../test/jest");
|
|
16
|
+
|
|
17
17
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
18
18
|
|
|
19
19
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
@@ -24,13 +24,7 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
|
|
|
24
24
|
|
|
25
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
26
|
|
|
27
|
-
jest.mock('../../hooks'
|
|
28
|
-
return {
|
|
29
|
-
useCustomProperties: function useCustomProperties() {
|
|
30
|
-
return [];
|
|
31
|
-
}
|
|
32
|
-
};
|
|
33
|
-
});
|
|
27
|
+
jest.mock('../../hooks');
|
|
34
28
|
jest.mock('./CustomPropertyCard', function () {
|
|
35
29
|
return function () {
|
|
36
30
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
@@ -41,7 +35,7 @@ jest.mock('./CustomPropertyCard', function () {
|
|
|
41
35
|
describe('CustomPropertiesViewCtx', function () {
|
|
42
36
|
var renderComponent;
|
|
43
37
|
beforeEach(function () {
|
|
44
|
-
renderComponent = (0,
|
|
38
|
+
renderComponent = (0, _jest.renderWithKintHarness)( /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactRouterDom.MemoryRouter, {
|
|
45
39
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_CustomPropertiesViewCtx.default, _objectSpread({}, _testResources.data))
|
|
46
40
|
}));
|
|
47
41
|
});
|
|
@@ -15,6 +15,8 @@ var _components = require("@folio/stripes/components");
|
|
|
15
15
|
|
|
16
16
|
var CUSTPROP_TYPES = _interopRequireWildcard(require("../../constants/customProperties"));
|
|
17
17
|
|
|
18
|
+
var _hooks = require("../../hooks");
|
|
19
|
+
|
|
18
20
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
19
21
|
|
|
20
22
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
@@ -24,65 +26,32 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj &&
|
|
|
24
26
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
25
27
|
|
|
26
28
|
var CustomPropertyCard = function CustomPropertyCard(_ref) {
|
|
27
|
-
var _labelOverrides$value, _labelOverrides$inter3, _labelOverrides$visib, _labelOverrides$publi;
|
|
28
|
-
|
|
29
29
|
var ctx = _ref.ctx,
|
|
30
30
|
customProperty = _ref.customProperty,
|
|
31
31
|
_ref$customPropertyDe = _ref.customPropertyDefinition,
|
|
32
32
|
customPropertyDefinition = _ref$customPropertyDe === void 0 ? {} : _ref$customPropertyDe,
|
|
33
33
|
index = _ref.index,
|
|
34
|
+
passedIntlKey = _ref.intlKey,
|
|
35
|
+
passedIntlNS = _ref.intlNS,
|
|
34
36
|
_ref$labelOverrides = _ref.labelOverrides,
|
|
35
37
|
labelOverrides = _ref$labelOverrides === void 0 ? {} : _ref$labelOverrides;
|
|
36
|
-
// We only need to display primary and set properties
|
|
38
|
+
var kintIntl = (0, _hooks.useKintIntl)(passedIntlKey, passedIntlNS); // We only need to display primary and set properties
|
|
39
|
+
|
|
37
40
|
var toDisplay = !!(customPropertyDefinition.primary || customProperty);
|
|
38
41
|
|
|
39
42
|
if (!toDisplay) {
|
|
40
43
|
return null;
|
|
41
44
|
}
|
|
42
45
|
|
|
43
|
-
var internalFalse = (customProperty === null || customProperty === void 0 ? void 0 : customProperty.internal) === false || (customProperty === null || customProperty === void 0 ? void 0 : customProperty.internal) === undefined && customPropertyDefinition.defaultInternal === false;
|
|
44
|
-
|
|
45
|
-
var getRetiredCardTitle = function getRetiredCardTitle() {
|
|
46
|
-
var _labelOverrides$retir;
|
|
47
|
-
|
|
48
|
-
// Label override for default card title,
|
|
49
|
-
if (labelOverrides.retiredName && typeof labelOverrides.retiredName === 'function') {
|
|
50
|
-
return labelOverrides.retiredName(customPropertyDefinition.name);
|
|
51
|
-
} // Label override for default title or finally built in default
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
return (_labelOverrides$retir = labelOverrides.retiredName) !== null && _labelOverrides$retir !== void 0 ? _labelOverrides$retir : /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactIntl.FormattedMessage, {
|
|
55
|
-
id: "stripes-kint-components.customProperty.retiredName",
|
|
56
|
-
values: {
|
|
57
|
-
name: customPropertyDefinition.label
|
|
58
|
-
}
|
|
59
|
-
});
|
|
60
|
-
};
|
|
61
|
-
|
|
62
|
-
var getInternalLabel = function getInternalLabel() {
|
|
63
|
-
var _labelOverrides$inter2;
|
|
64
|
-
|
|
65
|
-
if (internalFalse) {
|
|
66
|
-
var _labelOverrides$inter;
|
|
67
|
-
|
|
68
|
-
return (_labelOverrides$inter = labelOverrides.internalFalse) !== null && _labelOverrides$inter !== void 0 ? _labelOverrides$inter : /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactIntl.FormattedMessage, {
|
|
69
|
-
id: "stripes-kint-components.customProperty.internalFalse"
|
|
70
|
-
});
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
return (_labelOverrides$inter2 = labelOverrides.internalTrue) !== null && _labelOverrides$inter2 !== void 0 ? _labelOverrides$inter2 : /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactIntl.FormattedMessage, {
|
|
74
|
-
id: "stripes-kint-components.customProperty.internalTrue"
|
|
75
|
-
});
|
|
76
|
-
};
|
|
46
|
+
var internalFalse = (customProperty === null || customProperty === void 0 ? void 0 : customProperty.internal) === false || (customProperty === null || customProperty === void 0 ? void 0 : customProperty.internal) === undefined && customPropertyDefinition.defaultInternal === false;
|
|
77
47
|
|
|
78
48
|
var renderValue = function renderValue() {
|
|
79
49
|
var _customProperty$value, _customProperty$value2, _customProperty$value3, _customProperty$value4;
|
|
80
50
|
|
|
81
51
|
if (!customProperty) {
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
id: "stripes-kint-components.customProperty.notSet"
|
|
52
|
+
return kintIntl.formatKintMessage({
|
|
53
|
+
id: 'notSet',
|
|
54
|
+
overrideValue: labelOverrides.notSet
|
|
86
55
|
});
|
|
87
56
|
}
|
|
88
57
|
|
|
@@ -120,7 +89,12 @@ var CustomPropertyCard = function CustomPropertyCard(_ref) {
|
|
|
120
89
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_components.Card, {
|
|
121
90
|
headerStart: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
122
91
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("strong", {
|
|
123
|
-
children: customPropertyDefinition.retired ?
|
|
92
|
+
children: customPropertyDefinition.retired ? kintIntl.formatKintMessage({
|
|
93
|
+
id: 'customProperty.retiredName',
|
|
94
|
+
overrideValue: labelOverrides.retiredName
|
|
95
|
+
}, {
|
|
96
|
+
name: customPropertyDefinition.label
|
|
97
|
+
}) : customPropertyDefinition.label
|
|
124
98
|
}), customPropertyDefinition.description ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.InfoPopover, {
|
|
125
99
|
content: customPropertyDefinition.description
|
|
126
100
|
}) : null]
|
|
@@ -130,16 +104,18 @@ var CustomPropertyCard = function CustomPropertyCard(_ref) {
|
|
|
130
104
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Col, {
|
|
131
105
|
xs: 6,
|
|
132
106
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.KeyValue, {
|
|
133
|
-
label:
|
|
134
|
-
id:
|
|
107
|
+
label: kintIntl.formatKintMessage({
|
|
108
|
+
id: 'valueOrValues',
|
|
109
|
+
overrideValue: labelOverrides.valueOrValues
|
|
135
110
|
}),
|
|
136
111
|
children: renderValue()
|
|
137
112
|
})
|
|
138
113
|
}), customProperty !== null && customProperty !== void 0 && customProperty.note ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Col, {
|
|
139
114
|
xs: 6,
|
|
140
115
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.KeyValue, {
|
|
141
|
-
label:
|
|
142
|
-
id:
|
|
116
|
+
label: kintIntl.formatKintMessage({
|
|
117
|
+
id: 'customProperties.internalNote',
|
|
118
|
+
overrideValue: labelOverrides.internalNote
|
|
143
119
|
}),
|
|
144
120
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
145
121
|
style: {
|
|
@@ -153,16 +129,21 @@ var CustomPropertyCard = function CustomPropertyCard(_ref) {
|
|
|
153
129
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Col, {
|
|
154
130
|
xs: 6,
|
|
155
131
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.KeyValue, {
|
|
156
|
-
label:
|
|
157
|
-
id:
|
|
132
|
+
label: kintIntl.formatKintMessage({
|
|
133
|
+
id: 'customProperties.visibility',
|
|
134
|
+
overrideValue: labelOverrides.visibility
|
|
158
135
|
}),
|
|
159
|
-
children:
|
|
136
|
+
children: kintIntl.formatKintMessage({
|
|
137
|
+
id: 'customProperties.internalFalse',
|
|
138
|
+
overrideValue: labelOverrides.internalFalse
|
|
139
|
+
})
|
|
160
140
|
})
|
|
161
141
|
}), internalFalse && /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Col, {
|
|
162
142
|
xs: 6,
|
|
163
143
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.KeyValue, {
|
|
164
|
-
label:
|
|
165
|
-
id:
|
|
144
|
+
label: kintIntl.formatKintMessage({
|
|
145
|
+
id: 'customProperties.publicNote',
|
|
146
|
+
overrideValue: labelOverrides.publicNote
|
|
166
147
|
}),
|
|
167
148
|
children: customProperty !== null && customProperty !== void 0 && customProperty.publicNote ? /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
168
149
|
style: {
|
|
@@ -181,6 +162,8 @@ CustomPropertyCard.propTypes = {
|
|
|
181
162
|
customProperty: _propTypes.default.object,
|
|
182
163
|
customPropertyDefinition: _propTypes.default.object,
|
|
183
164
|
index: _propTypes.default.number,
|
|
165
|
+
intlKey: _propTypes.default.string,
|
|
166
|
+
intlNS: _propTypes.default.string,
|
|
184
167
|
labelOverrides: _propTypes.default.object
|
|
185
168
|
};
|
|
186
169
|
var _default = CustomPropertyCard;
|
|
@@ -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");
|
|
@@ -60,16 +58,20 @@ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
|
60
58
|
var propTypes = {
|
|
61
59
|
afterQueryCalls: _propTypes.default.object,
|
|
62
60
|
catchQueryCalls: _propTypes.default.object,
|
|
61
|
+
intlKey: _propTypes.default.string,
|
|
62
|
+
intlNS: _propTypes.default.string,
|
|
63
63
|
label: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.node]),
|
|
64
64
|
labelOverrides: _propTypes.default.object,
|
|
65
65
|
refdataEndpoint: _propTypes.default.string
|
|
66
66
|
};
|
|
67
67
|
|
|
68
68
|
var EditableRefdataCategoryList = function EditableRefdataCategoryList(_ref) {
|
|
69
|
-
var
|
|
69
|
+
var _deleteModal$refdata2;
|
|
70
70
|
|
|
71
71
|
var afterQueryCalls = _ref.afterQueryCalls,
|
|
72
72
|
catchQueryCalls = _ref.catchQueryCalls,
|
|
73
|
+
passedIntlKey = _ref.intlKey,
|
|
74
|
+
passedIntlNS = _ref.intlNS,
|
|
73
75
|
label = _ref.label,
|
|
74
76
|
_ref$labelOverrides = _ref.labelOverrides,
|
|
75
77
|
labelOverrides = _ref$labelOverrides === void 0 ? {} : _ref$labelOverrides,
|
|
@@ -77,7 +79,7 @@ var EditableRefdataCategoryList = function EditableRefdataCategoryList(_ref) {
|
|
|
77
79
|
|
|
78
80
|
/* A component that allows for editing of refdata categories */
|
|
79
81
|
var callout = (0, _react.useContext)(_core.CalloutContext);
|
|
80
|
-
var
|
|
82
|
+
var kintIntl = (0, _hooks.useKintIntl)(passedIntlKey, passedIntlNS); // fetch refdata values
|
|
81
83
|
|
|
82
84
|
var _useRefdata = (0, _hooks.useRefdata)({
|
|
83
85
|
endpoint: refdataEndpoint,
|
|
@@ -143,12 +145,12 @@ var EditableRefdataCategoryList = function EditableRefdataCategoryList(_ref) {
|
|
|
143
145
|
case 2:
|
|
144
146
|
errorResp = _context.sent;
|
|
145
147
|
callout.sendCallout({
|
|
146
|
-
message:
|
|
147
|
-
id:
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
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
|
|
152
154
|
}),
|
|
153
155
|
type: 'error'
|
|
154
156
|
});
|
|
@@ -195,8 +197,9 @@ var EditableRefdataCategoryList = function EditableRefdataCategoryList(_ref) {
|
|
|
195
197
|
if (!(rowData !== null && rowData !== void 0 && (_rowData$values = rowData.values) !== null && _rowData$values !== void 0 && _rowData$values.length)) {
|
|
196
198
|
actionArray.push({
|
|
197
199
|
name: 'delete',
|
|
198
|
-
label:
|
|
199
|
-
id:
|
|
200
|
+
label: kintIntl.formatKintMessage({
|
|
201
|
+
id: 'delete',
|
|
202
|
+
overrideValue: labelOverrides === null || labelOverrides === void 0 ? void 0 : labelOverrides.delete
|
|
200
203
|
}),
|
|
201
204
|
icon: 'trash',
|
|
202
205
|
callback: function callback(data) {
|
|
@@ -206,8 +209,9 @@ var EditableRefdataCategoryList = function EditableRefdataCategoryList(_ref) {
|
|
|
206
209
|
});
|
|
207
210
|
},
|
|
208
211
|
ariaLabel: function ariaLabel(data) {
|
|
209
|
-
return
|
|
210
|
-
id: '
|
|
212
|
+
return kintIntl.formatKintMessage({
|
|
213
|
+
id: 'refdataCategory.deleteAriaLabel',
|
|
214
|
+
overrideValue: labelOverrides === null || labelOverrides === void 0 ? void 0 : labelOverrides.deleteAriaLabel
|
|
211
215
|
}, {
|
|
212
216
|
label: data === null || data === void 0 ? void 0 : data.label
|
|
213
217
|
});
|
|
@@ -222,11 +226,13 @@ var EditableRefdataCategoryList = function EditableRefdataCategoryList(_ref) {
|
|
|
222
226
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_ActionList.default, {
|
|
223
227
|
actionAssigner: actionAssigner,
|
|
224
228
|
columnMapping: {
|
|
225
|
-
desc:
|
|
226
|
-
id:
|
|
229
|
+
desc: kintIntl.formatKintMessage({
|
|
230
|
+
id: 'refdataCategory.refdataCategory',
|
|
231
|
+
overrideValue: labelOverrides === null || labelOverrides === void 0 ? void 0 : labelOverrides.refdataCategory
|
|
227
232
|
}),
|
|
228
|
-
values:
|
|
229
|
-
id:
|
|
233
|
+
values: kintIntl.formatKintMessage({
|
|
234
|
+
id: 'refdataCategory.noOfValues',
|
|
235
|
+
overrideValue: labelOverrides === null || labelOverrides === void 0 ? void 0 : labelOverrides.noOfValues
|
|
230
236
|
})
|
|
231
237
|
},
|
|
232
238
|
contentData: contentData,
|
|
@@ -253,17 +259,19 @@ var EditableRefdataCategoryList = function EditableRefdataCategoryList(_ref) {
|
|
|
253
259
|
},
|
|
254
260
|
visibleFields: ['desc', 'values']
|
|
255
261
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.ConfirmationModal, {
|
|
256
|
-
confirmLabel:
|
|
257
|
-
id:
|
|
262
|
+
confirmLabel: kintIntl.formatKintMessage({
|
|
263
|
+
id: 'delete',
|
|
264
|
+
overrideValue: labelOverrides === null || labelOverrides === void 0 ? void 0 : labelOverrides.delete
|
|
258
265
|
}),
|
|
259
|
-
heading:
|
|
260
|
-
id:
|
|
266
|
+
heading: kintIntl.formatKintMessage({
|
|
267
|
+
id: 'refdataCategory.deleteRefdataCategory',
|
|
268
|
+
overrideValue: labelOverrides === null || labelOverrides === void 0 ? void 0 : labelOverrides.deleteRefdataCategory
|
|
261
269
|
}),
|
|
262
|
-
message:
|
|
263
|
-
id:
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
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
|
|
267
275
|
}),
|
|
268
276
|
onCancel: function onCancel() {
|
|
269
277
|
return setDeleteModal({
|