@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
|
@@ -9,8 +9,6 @@ var _react = require("react");
|
|
|
9
9
|
|
|
10
10
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
11
11
|
|
|
12
|
-
var _reactIntl = require("react-intl");
|
|
13
|
-
|
|
14
12
|
var _reactFinalForm = require("react-final-form");
|
|
15
13
|
|
|
16
14
|
var _components = require("@folio/stripes/components");
|
|
@@ -19,6 +17,8 @@ var _validators = require("../../utils/validators");
|
|
|
19
17
|
|
|
20
18
|
var _customProperties = require("../../constants/customProperties");
|
|
21
19
|
|
|
20
|
+
var _hooks = require("../../hooks");
|
|
21
|
+
|
|
22
22
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
23
23
|
|
|
24
24
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
@@ -44,10 +44,10 @@ function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Sy
|
|
|
44
44
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
45
45
|
|
|
46
46
|
var CustomPropertyForm = function CustomPropertyForm(_ref) {
|
|
47
|
-
var _labelOverrides$DECIM, _labelOverrides$INTEG, _labelOverrides$TEXT_, _labelOverrides$REFDA, _labelOverrides$MULTI, _labelOverrides$DATE_, _labelOverrides$type, _labelOverrides$categ, _labelOverrides$label, _labelOverrides$name, _labelOverrides$descr, _labelOverrides$ctx, _labelOverrides$weigh, _labelOverrides$prima2, _labelOverrides$retir, _labelOverrides$defau;
|
|
48
|
-
|
|
49
47
|
var contextFilterOptions = _ref.contextFilterOptions,
|
|
50
48
|
helpPopovers = _ref.helpPopovers,
|
|
49
|
+
passedIntlKey = _ref.intlKey,
|
|
50
|
+
passedIntlNS = _ref.intlNS,
|
|
51
51
|
_ref$labelOverrides = _ref.labelOverrides,
|
|
52
52
|
labelOverrides = _ref$labelOverrides === void 0 ? {} : _ref$labelOverrides,
|
|
53
53
|
refdata = _ref.refdata;
|
|
@@ -58,7 +58,7 @@ var CustomPropertyForm = function CustomPropertyForm(_ref) {
|
|
|
58
58
|
var _useForm = (0, _reactFinalForm.useForm)(),
|
|
59
59
|
change = _useForm.change;
|
|
60
60
|
|
|
61
|
-
var
|
|
61
|
+
var kintIntl = (0, _hooks.useKintIntl)(passedIntlKey, passedIntlNS);
|
|
62
62
|
|
|
63
63
|
var booleanToString = function booleanToString(booleanValue) {
|
|
64
64
|
return booleanValue === null || booleanValue === void 0 ? void 0 : booleanValue.toString();
|
|
@@ -94,21 +94,20 @@ var CustomPropertyForm = function CustomPropertyForm(_ref) {
|
|
|
94
94
|
if (!filterValue || exactMatch) {
|
|
95
95
|
return null;
|
|
96
96
|
} else {
|
|
97
|
-
return
|
|
98
|
-
id:
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
97
|
+
return kintIntl.formatKintMessage({
|
|
98
|
+
id: 'customProperties.ctx.addContext',
|
|
99
|
+
overrideValue: labelOverrides === null || labelOverrides === void 0 ? void 0 : labelOverrides.addCtx
|
|
100
|
+
}, {
|
|
101
|
+
value: filterValue
|
|
102
102
|
});
|
|
103
103
|
}
|
|
104
104
|
};
|
|
105
105
|
|
|
106
106
|
var primaryRetiredValidator = function primaryRetiredValidator(_v, allValues) {
|
|
107
107
|
if (allValues.primary && allValues.retired) {
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
id: "stripes-kint-components.errors.primaryRetired"
|
|
108
|
+
return kintIntl.formatKintMessage({
|
|
109
|
+
id: 'customProperties.errors.primaryRetired',
|
|
110
|
+
overrideValue: labelOverrides === null || labelOverrides === void 0 ? void 0 : labelOverrides.primaryRetired
|
|
112
111
|
});
|
|
113
112
|
}
|
|
114
113
|
|
|
@@ -125,40 +124,47 @@ var CustomPropertyForm = function CustomPropertyForm(_ref) {
|
|
|
125
124
|
label: '',
|
|
126
125
|
value: ''
|
|
127
126
|
}, {
|
|
128
|
-
label:
|
|
129
|
-
id: "
|
|
127
|
+
label: kintIntl.formatKintMessage({
|
|
128
|
+
id: "customProperties.type.".concat(_customProperties.DECIMAL_CLASS_NAME),
|
|
129
|
+
overrideValue: labelOverrides === null || labelOverrides === void 0 ? void 0 : labelOverrides[_customProperties.DECIMAL_CLASS_NAME]
|
|
130
130
|
}),
|
|
131
131
|
value: _customProperties.DECIMAL_CLASS_NAME
|
|
132
132
|
}, {
|
|
133
|
-
label:
|
|
134
|
-
id: "
|
|
133
|
+
label: kintIntl.formatKintMessage({
|
|
134
|
+
id: "customProperties.type.".concat(_customProperties.INTEGER_CLASS_NAME),
|
|
135
|
+
overrideValue: labelOverrides === null || labelOverrides === void 0 ? void 0 : labelOverrides[_customProperties.INTEGER_CLASS_NAME]
|
|
135
136
|
}),
|
|
136
137
|
value: _customProperties.INTEGER_CLASS_NAME
|
|
137
138
|
}, {
|
|
138
|
-
label:
|
|
139
|
-
id: "
|
|
139
|
+
label: kintIntl.formatKintMessage({
|
|
140
|
+
id: "customProperties.type.".concat(_customProperties.TEXT_CLASS_NAME),
|
|
141
|
+
overrideValue: labelOverrides === null || labelOverrides === void 0 ? void 0 : labelOverrides[_customProperties.TEXT_CLASS_NAME]
|
|
140
142
|
}),
|
|
141
143
|
value: _customProperties.TEXT_CLASS_NAME
|
|
142
144
|
}, {
|
|
143
|
-
label:
|
|
144
|
-
id: "
|
|
145
|
+
label: kintIntl.formatKintMessage({
|
|
146
|
+
id: "customProperties.type.".concat(_customProperties.REFDATA_CLASS_NAME),
|
|
147
|
+
overrideValue: labelOverrides === null || labelOverrides === void 0 ? void 0 : labelOverrides[_customProperties.REFDATA_CLASS_NAME]
|
|
145
148
|
}),
|
|
146
149
|
value: _customProperties.REFDATA_CLASS_NAME
|
|
147
150
|
}, {
|
|
148
|
-
label:
|
|
149
|
-
id: "
|
|
151
|
+
label: kintIntl.formatKintMessage({
|
|
152
|
+
id: "customProperties.type.".concat(_customProperties.MULTI_REFDATA_CLASS_NAME),
|
|
153
|
+
overrideValue: labelOverrides === null || labelOverrides === void 0 ? void 0 : labelOverrides[_customProperties.MULTI_REFDATA_CLASS_NAME]
|
|
150
154
|
}),
|
|
151
155
|
value: _customProperties.MULTI_REFDATA_CLASS_NAME
|
|
152
156
|
}, {
|
|
153
|
-
label:
|
|
154
|
-
id: "
|
|
157
|
+
label: kintIntl.formatKintMessage({
|
|
158
|
+
id: "customProperties.type.".concat(_customProperties.DATE_CLASS_NAME),
|
|
159
|
+
overrideValue: labelOverrides === null || labelOverrides === void 0 ? void 0 : labelOverrides[_customProperties.DATE_CLASS_NAME]
|
|
155
160
|
}),
|
|
156
161
|
value: _customProperties.DATE_CLASS_NAME
|
|
157
162
|
}],
|
|
158
|
-
disabled: values
|
|
163
|
+
disabled: !!(values !== null && values !== void 0 && values.id),
|
|
159
164
|
label: /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
160
|
-
children: [
|
|
161
|
-
id:
|
|
165
|
+
children: [kintIntl.formatKintMessage({
|
|
166
|
+
id: 'customProperties.type',
|
|
167
|
+
overrideValue: labelOverrides === null || labelOverrides === void 0 ? void 0 : labelOverrides.type
|
|
162
168
|
}), helpPopovers !== null && helpPopovers !== void 0 && helpPopovers.type ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.InfoPopover, {
|
|
163
169
|
content: helpPopovers === null || helpPopovers === void 0 ? void 0 : helpPopovers.type
|
|
164
170
|
}) : null]
|
|
@@ -175,10 +181,11 @@ var CustomPropertyForm = function CustomPropertyForm(_ref) {
|
|
|
175
181
|
label: '',
|
|
176
182
|
value: ''
|
|
177
183
|
}].concat(_toConsumableArray(refdata)),
|
|
178
|
-
disabled: values
|
|
184
|
+
disabled: !!(values !== null && values !== void 0 && values.id),
|
|
179
185
|
label: /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
180
|
-
children: [
|
|
181
|
-
id:
|
|
186
|
+
children: [kintIntl.formatKintMessage({
|
|
187
|
+
id: 'customProperties.category',
|
|
188
|
+
overrideValue: labelOverrides === null || labelOverrides === void 0 ? void 0 : labelOverrides.category
|
|
182
189
|
}), helpPopovers !== null && helpPopovers !== void 0 && helpPopovers.category ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.InfoPopover, {
|
|
183
190
|
content: helpPopovers === null || helpPopovers === void 0 ? void 0 : helpPopovers.category
|
|
184
191
|
}) : null]
|
|
@@ -195,8 +202,9 @@ var CustomPropertyForm = function CustomPropertyForm(_ref) {
|
|
|
195
202
|
component: _components.TextField,
|
|
196
203
|
id: "custom-prop-label",
|
|
197
204
|
label: /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
198
|
-
children: [
|
|
199
|
-
id:
|
|
205
|
+
children: [kintIntl.formatKintMessage({
|
|
206
|
+
id: 'customProperties.label',
|
|
207
|
+
overrideValue: labelOverrides === null || labelOverrides === void 0 ? void 0 : labelOverrides.label
|
|
200
208
|
}), helpPopovers !== null && helpPopovers !== void 0 && helpPopovers.label ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.InfoPopover, {
|
|
201
209
|
content: helpPopovers === null || helpPopovers === void 0 ? void 0 : helpPopovers.label
|
|
202
210
|
}) : null]
|
|
@@ -211,8 +219,9 @@ var CustomPropertyForm = function CustomPropertyForm(_ref) {
|
|
|
211
219
|
component: _components.TextField,
|
|
212
220
|
id: "custom-prop-name",
|
|
213
221
|
label: /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
214
|
-
children: [
|
|
215
|
-
id:
|
|
222
|
+
children: [kintIntl.formatKintMessage({
|
|
223
|
+
id: 'customProperties.name',
|
|
224
|
+
overrideValue: labelOverrides === null || labelOverrides === void 0 ? void 0 : labelOverrides.name
|
|
216
225
|
}), helpPopovers !== null && helpPopovers !== void 0 && helpPopovers.name ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.InfoPopover, {
|
|
217
226
|
content: helpPopovers === null || helpPopovers === void 0 ? void 0 : helpPopovers.name
|
|
218
227
|
}) : null]
|
|
@@ -221,8 +230,9 @@ var CustomPropertyForm = function CustomPropertyForm(_ref) {
|
|
|
221
230
|
required: true,
|
|
222
231
|
validate: function validate(v) {
|
|
223
232
|
if (v && v.length) {
|
|
224
|
-
return /^[a-z][a-z0-9]*$/i.test(v) ? undefined :
|
|
225
|
-
id:
|
|
233
|
+
return /^[a-z][a-z0-9]*$/i.test(v) ? undefined : kintIntl.formatKintMessage({
|
|
234
|
+
id: 'errors.hasNonAlphaName',
|
|
235
|
+
overrideValue: labelOverrides === null || labelOverrides === void 0 ? void 0 : labelOverrides.hasNonAlphaName
|
|
226
236
|
});
|
|
227
237
|
}
|
|
228
238
|
|
|
@@ -237,14 +247,16 @@ var CustomPropertyForm = function CustomPropertyForm(_ref) {
|
|
|
237
247
|
component: _components.TextArea,
|
|
238
248
|
id: "custom-prop-description",
|
|
239
249
|
label: /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
240
|
-
children: [
|
|
241
|
-
id:
|
|
250
|
+
children: [kintIntl.formatKintMessage({
|
|
251
|
+
id: 'customProperties.description',
|
|
252
|
+
overrideValue: labelOverrides === null || labelOverrides === void 0 ? void 0 : labelOverrides.description
|
|
242
253
|
}), helpPopovers !== null && helpPopovers !== void 0 && helpPopovers.description ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.InfoPopover, {
|
|
243
254
|
content: helpPopovers === null || helpPopovers === void 0 ? void 0 : helpPopovers.description
|
|
244
255
|
}) : null]
|
|
245
256
|
}),
|
|
246
257
|
name: "description",
|
|
247
|
-
required: true
|
|
258
|
+
required: true // FIXME I think the required Validator might pose translation problems
|
|
259
|
+
,
|
|
248
260
|
validate: _validators.required
|
|
249
261
|
})
|
|
250
262
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Col, {
|
|
@@ -256,12 +268,14 @@ var CustomPropertyForm = function CustomPropertyForm(_ref) {
|
|
|
256
268
|
}],
|
|
257
269
|
component: _components.MultiSelection,
|
|
258
270
|
dataOptions: contextOptions,
|
|
259
|
-
emptyMessage:
|
|
260
|
-
id: '
|
|
271
|
+
emptyMessage: kintIntl.formatKintMessage({
|
|
272
|
+
id: 'customProperties.noCtxFound',
|
|
273
|
+
overrideValue: labelOverrides === null || labelOverrides === void 0 ? void 0 : labelOverrides.noCtxFound
|
|
261
274
|
}),
|
|
262
275
|
label: /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
263
|
-
children: [
|
|
264
|
-
id:
|
|
276
|
+
children: [kintIntl.formatKintMessage({
|
|
277
|
+
id: 'customProperties.ctx',
|
|
278
|
+
overrideValue: labelOverrides === null || labelOverrides === void 0 ? void 0 : labelOverrides.ctx
|
|
265
279
|
}), helpPopovers !== null && helpPopovers !== void 0 && helpPopovers.ctx ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.InfoPopover, {
|
|
266
280
|
content: helpPopovers === null || helpPopovers === void 0 ? void 0 : helpPopovers.ctx
|
|
267
281
|
}) : null]
|
|
@@ -273,11 +287,6 @@ var CustomPropertyForm = function CustomPropertyForm(_ref) {
|
|
|
273
287
|
} else {
|
|
274
288
|
change('ctx', undefined);
|
|
275
289
|
}
|
|
276
|
-
},
|
|
277
|
-
validate: function validate(value) {
|
|
278
|
-
return (value === null || value === void 0 ? void 0 : value.length) > 1 ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactIntl.FormattedMessage, {
|
|
279
|
-
id: "stripes-kint-components.customProperties.ctx.error.moreThanOne"
|
|
280
|
-
}) : null;
|
|
281
290
|
}
|
|
282
291
|
})
|
|
283
292
|
})]
|
|
@@ -288,8 +297,9 @@ var CustomPropertyForm = function CustomPropertyForm(_ref) {
|
|
|
288
297
|
component: _components.TextField,
|
|
289
298
|
id: "custom-prop-weight",
|
|
290
299
|
label: /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
291
|
-
children: [
|
|
292
|
-
id:
|
|
300
|
+
children: [kintIntl.formatKintMessage({
|
|
301
|
+
id: 'customProperties.weight',
|
|
302
|
+
overrideValue: labelOverrides === null || labelOverrides === void 0 ? void 0 : labelOverrides.weight
|
|
293
303
|
}), helpPopovers !== null && helpPopovers !== void 0 && helpPopovers.weight ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.InfoPopover, {
|
|
294
304
|
content: helpPopovers === null || helpPopovers === void 0 ? void 0 : helpPopovers.weight
|
|
295
305
|
}) : null]
|
|
@@ -304,20 +314,23 @@ var CustomPropertyForm = function CustomPropertyForm(_ref) {
|
|
|
304
314
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactFinalForm.Field, {
|
|
305
315
|
component: _components.Select,
|
|
306
316
|
dataOptions: [{
|
|
307
|
-
label:
|
|
308
|
-
id: '
|
|
317
|
+
label: kintIntl.formatKintMessage({
|
|
318
|
+
id: 'yes',
|
|
319
|
+
overrideValue: labelOverrides === null || labelOverrides === void 0 ? void 0 : labelOverrides.yes
|
|
309
320
|
}),
|
|
310
321
|
value: 'true'
|
|
311
322
|
}, {
|
|
312
|
-
label:
|
|
313
|
-
id: '
|
|
323
|
+
label: kintIntl.formatKintMessage({
|
|
324
|
+
id: 'no',
|
|
325
|
+
overrideValue: labelOverrides === null || labelOverrides === void 0 ? void 0 : labelOverrides.no
|
|
314
326
|
}),
|
|
315
327
|
value: 'false'
|
|
316
328
|
}],
|
|
317
329
|
format: booleanToString,
|
|
318
330
|
label: /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
319
|
-
children: [
|
|
320
|
-
id:
|
|
331
|
+
children: [kintIntl.formatKintMessage({
|
|
332
|
+
id: 'customProperties.primary',
|
|
333
|
+
overrideValue: labelOverrides === null || labelOverrides === void 0 ? void 0 : labelOverrides.primary
|
|
321
334
|
}), helpPopovers !== null && helpPopovers !== void 0 && helpPopovers.primary ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.InfoPopover, {
|
|
322
335
|
content: helpPopovers === null || helpPopovers === void 0 ? void 0 : helpPopovers.primary
|
|
323
336
|
}) : null]
|
|
@@ -332,20 +345,23 @@ var CustomPropertyForm = function CustomPropertyForm(_ref) {
|
|
|
332
345
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactFinalForm.Field, {
|
|
333
346
|
component: _components.Select,
|
|
334
347
|
dataOptions: [{
|
|
335
|
-
label:
|
|
336
|
-
id: '
|
|
348
|
+
label: kintIntl.formatKintMessage({
|
|
349
|
+
id: 'yes',
|
|
350
|
+
overrideValue: labelOverrides === null || labelOverrides === void 0 ? void 0 : labelOverrides.yes
|
|
337
351
|
}),
|
|
338
352
|
value: 'true'
|
|
339
353
|
}, {
|
|
340
|
-
label:
|
|
341
|
-
id: '
|
|
354
|
+
label: kintIntl.formatKintMessage({
|
|
355
|
+
id: 'no',
|
|
356
|
+
overrideValue: labelOverrides === null || labelOverrides === void 0 ? void 0 : labelOverrides.no
|
|
342
357
|
}),
|
|
343
358
|
value: 'false'
|
|
344
359
|
}],
|
|
345
360
|
format: booleanToString,
|
|
346
361
|
label: /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
347
|
-
children: [
|
|
348
|
-
id:
|
|
362
|
+
children: [kintIntl.formatKintMessage({
|
|
363
|
+
id: 'customProperties.retired',
|
|
364
|
+
overrideValue: labelOverrides === null || labelOverrides === void 0 ? void 0 : labelOverrides.retired
|
|
349
365
|
}), helpPopovers !== null && helpPopovers !== void 0 && helpPopovers.retired ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.InfoPopover, {
|
|
350
366
|
content: helpPopovers === null || helpPopovers === void 0 ? void 0 : helpPopovers.retired
|
|
351
367
|
}) : null]
|
|
@@ -360,20 +376,23 @@ var CustomPropertyForm = function CustomPropertyForm(_ref) {
|
|
|
360
376
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactFinalForm.Field, {
|
|
361
377
|
component: _components.Select,
|
|
362
378
|
dataOptions: [{
|
|
363
|
-
label:
|
|
364
|
-
id: '
|
|
379
|
+
label: kintIntl.formatKintMessage({
|
|
380
|
+
id: 'customProperties.internalTrue',
|
|
381
|
+
overrideValue: labelOverrides === null || labelOverrides === void 0 ? void 0 : labelOverrides.internalTrue
|
|
365
382
|
}),
|
|
366
383
|
value: 'true'
|
|
367
384
|
}, {
|
|
368
|
-
label:
|
|
369
|
-
id: '
|
|
385
|
+
label: kintIntl.formatKintMessage({
|
|
386
|
+
id: 'customProperties.internalFalse',
|
|
387
|
+
overrideValue: labelOverrides === null || labelOverrides === void 0 ? void 0 : labelOverrides.internalFalse
|
|
370
388
|
}),
|
|
371
389
|
value: 'false'
|
|
372
390
|
}],
|
|
373
391
|
format: booleanToString,
|
|
374
392
|
label: /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
375
|
-
children: [
|
|
376
|
-
id:
|
|
393
|
+
children: [kintIntl.formatKintMessage({
|
|
394
|
+
id: 'customProperties.defaultVisibility',
|
|
395
|
+
overrideValue: labelOverrides === null || labelOverrides === void 0 ? void 0 : labelOverrides.defaultVisibility
|
|
377
396
|
}), helpPopovers !== null && helpPopovers !== void 0 && helpPopovers.defaultVisibility ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.InfoPopover, {
|
|
378
397
|
content: helpPopovers === null || helpPopovers === void 0 ? void 0 : helpPopovers.defaultVisibility
|
|
379
398
|
}) : null]
|
|
@@ -391,6 +410,8 @@ var CustomPropertyForm = function CustomPropertyForm(_ref) {
|
|
|
391
410
|
CustomPropertyForm.propTypes = {
|
|
392
411
|
contextFilterOptions: _propTypes.default.arrayOf(_propTypes.default.object),
|
|
393
412
|
helpPopovers: _propTypes.default.object,
|
|
413
|
+
intlKey: _propTypes.default.string,
|
|
414
|
+
intlNS: _propTypes.default.string,
|
|
394
415
|
labelOverrides: _propTypes.default.object,
|
|
395
416
|
refdata: _propTypes.default.arrayOf(_propTypes.default.object)
|
|
396
417
|
};
|
|
@@ -10,12 +10,14 @@ var _stripesTesting = require("@folio/stripes-testing");
|
|
|
10
10
|
|
|
11
11
|
var _helpers = require("@folio/stripes-erm-components/test/jest/helpers");
|
|
12
12
|
|
|
13
|
-
var
|
|
14
|
-
|
|
15
|
-
var _testResources = require("./testResources");
|
|
13
|
+
var _refdata = _interopRequireDefault(require("../../../../test/jest/refdata"));
|
|
16
14
|
|
|
17
15
|
var _CustomPropertyForm = _interopRequireDefault(require("./CustomPropertyForm"));
|
|
18
16
|
|
|
17
|
+
var _customProperties = _interopRequireDefault(require("../../../../test/jest/customProperties"));
|
|
18
|
+
|
|
19
|
+
var _jest = require("../../../../test/jest");
|
|
20
|
+
|
|
19
21
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
20
22
|
|
|
21
23
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
@@ -26,22 +28,55 @@ function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try
|
|
|
26
28
|
|
|
27
29
|
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
30
|
|
|
31
|
+
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; }
|
|
32
|
+
|
|
33
|
+
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; }
|
|
34
|
+
|
|
35
|
+
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; }
|
|
36
|
+
|
|
37
|
+
var initialValues = _objectSpread(_objectSpread({}, _customProperties.default === null || _customProperties.default === void 0 ? void 0 : _customProperties.default.find(function (cp) {
|
|
38
|
+
return cp.name === 'test';
|
|
39
|
+
})), {}, {
|
|
40
|
+
// Just massage the type/ctx value to be of the shape the form expects
|
|
41
|
+
type: 'Decimal',
|
|
42
|
+
ctx: [{
|
|
43
|
+
value: 'OpenAccess',
|
|
44
|
+
label: 'OpenAccess'
|
|
45
|
+
}]
|
|
46
|
+
});
|
|
47
|
+
|
|
29
48
|
var onSubmit = jest.fn();
|
|
49
|
+
jest.mock('../../hooks');
|
|
30
50
|
describe('CustomPropertyForm', function () {
|
|
31
51
|
var renderComponent;
|
|
32
52
|
beforeEach(function () {
|
|
33
|
-
renderComponent = (0,
|
|
34
|
-
initialValues:
|
|
53
|
+
renderComponent = (0, _jest.renderWithKintHarness)( /*#__PURE__*/(0, _jsxRuntime.jsx)(_helpers.TestForm, {
|
|
54
|
+
initialValues: initialValues,
|
|
35
55
|
onSubmit: onSubmit,
|
|
36
56
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_CustomPropertyForm.default, {
|
|
37
|
-
contextFilterOptions:
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
57
|
+
contextFilterOptions: [{
|
|
58
|
+
'value': '',
|
|
59
|
+
'label': 'All'
|
|
60
|
+
}, {
|
|
61
|
+
'value': 'OpenAccess',
|
|
62
|
+
'label': 'OpenAccess'
|
|
63
|
+
}, {
|
|
64
|
+
'value': 'test',
|
|
65
|
+
'label': 'test'
|
|
66
|
+
}, {
|
|
67
|
+
'value': 'isNull',
|
|
68
|
+
'label': 'None'
|
|
69
|
+
}],
|
|
70
|
+
refdata: _refdata.default.map(function (rdc) {
|
|
71
|
+
return {
|
|
72
|
+
label: rdc.desc,
|
|
73
|
+
value: rdc.id
|
|
74
|
+
};
|
|
75
|
+
})
|
|
41
76
|
})
|
|
42
77
|
}));
|
|
43
78
|
});
|
|
44
|
-
it('Displays expected
|
|
79
|
+
it('Displays expected label ', function () {
|
|
45
80
|
var _renderComponent = renderComponent,
|
|
46
81
|
getByText = _renderComponent.getByText;
|
|
47
82
|
expect(getByText('Label')).toBeInTheDocument();
|
|
@@ -151,11 +186,11 @@ describe('CustomPropertyForm', function () {
|
|
|
151
186
|
}
|
|
152
187
|
}, _callee4);
|
|
153
188
|
})));
|
|
154
|
-
test('renders the expected value in the
|
|
189
|
+
test('renders the expected value in the Retired dropdown', function () {
|
|
155
190
|
var _renderComponent9 = renderComponent,
|
|
156
191
|
getByRole = _renderComponent9.getByRole;
|
|
157
192
|
expect(getByRole('combobox', {
|
|
158
|
-
name: '
|
|
193
|
+
name: 'Retired'
|
|
159
194
|
})).toHaveDisplayValue('No');
|
|
160
195
|
});
|
|
161
196
|
test('renders the expected value in the Default visibility dropdown', function () {
|
|
@@ -172,29 +207,11 @@ describe('CustomPropertyForm', function () {
|
|
|
172
207
|
name: 'Primary'
|
|
173
208
|
})).toHaveDisplayValue('Yes');
|
|
174
209
|
});
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
var _renderComponent13 = renderComponent,
|
|
182
|
-
getByText = _renderComponent13.getByText;
|
|
183
|
-
expect(getByText('Refdata (multi-select)')).toBeInTheDocument();
|
|
184
|
-
});
|
|
185
|
-
it('Displays expected Refdata option ', function () {
|
|
186
|
-
var _renderComponent14 = renderComponent,
|
|
187
|
-
getByText = _renderComponent14.getByText;
|
|
188
|
-
expect(getByText('Refdata')).toBeInTheDocument();
|
|
189
|
-
});
|
|
190
|
-
it('Displays expected Text option ', function () {
|
|
191
|
-
var _renderComponent15 = renderComponent,
|
|
192
|
-
getByText = _renderComponent15.getByText;
|
|
193
|
-
expect(getByText('Text')).toBeInTheDocument();
|
|
194
|
-
});
|
|
195
|
-
it('Displays expected Integer option ', function () {
|
|
196
|
-
var _renderComponent16 = renderComponent,
|
|
197
|
-
getByText = _renderComponent16.getByText;
|
|
198
|
-
expect(getByText('Integer')).toBeInTheDocument();
|
|
210
|
+
['Decimal', 'Refdata (multi-select)', 'Refdata', 'Text', 'Integer'].forEach(function (type) {
|
|
211
|
+
return it("Displays expected ".concat(type, " option"), function () {
|
|
212
|
+
var _renderComponent12 = renderComponent,
|
|
213
|
+
getByText = _renderComponent12.getByText;
|
|
214
|
+
expect(getByText(type)).toBeInTheDocument();
|
|
215
|
+
});
|
|
199
216
|
});
|
|
200
217
|
});
|