@k-int/stripes-kint-components 5.36.0 → 5.37.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 +14 -0
- package/README.md +23 -8
- package/es/__mocks__/@folio/stripes/components.js +7 -3
- package/es/__mocks__/@folio/stripes/core.js +6 -4
- package/es/__mocks__/@folio/stripes/smart-components.js +6 -4
- package/es/__mocks__/react-query.js +6 -4
- package/es/__mocks__/react-router-dom.js +6 -6
- package/es/lib/ActionList/ActionList.js +38 -30
- package/es/lib/ActionList/ActionListFieldArray.js +131 -122
- package/es/lib/ButtonTypedown/ButtonTypedown.js +39 -41
- package/es/lib/ComboButton/ComboButton.js +66 -57
- package/es/lib/CustomProperties/Config/CustomPropertiesLookup.js +62 -46
- package/es/lib/CustomProperties/Config/CustomPropertiesLookup.test.js +4 -6
- package/es/lib/CustomProperties/Config/CustomPropertiesSettings.js +153 -135
- package/es/lib/CustomProperties/Config/CustomPropertiesSettings.test.js +4 -6
- package/es/lib/CustomProperties/Config/CustomPropertyForm.js +83 -81
- package/es/lib/CustomProperties/Config/CustomPropertyForm.test.js +32 -40
- package/es/lib/CustomProperties/Config/CustomPropertyView.js +39 -39
- package/es/lib/CustomProperties/Config/CustomPropertyView.test.js +1 -1
- package/es/lib/CustomProperties/Edit/CustomPropertiesEdit.js +10 -10
- package/es/lib/CustomProperties/Edit/CustomPropertiesEdit.test.js +2 -3
- package/es/lib/CustomProperties/Edit/CustomPropertiesEditCtx.js +24 -26
- package/es/lib/CustomProperties/Edit/CustomPropertiesEditCtx.test.js +2 -3
- package/es/lib/CustomProperties/Edit/CustomPropertiesListField.js +62 -49
- package/es/lib/CustomProperties/Edit/CustomPropertiesListField.test.js +4 -6
- package/es/lib/CustomProperties/Edit/CustomPropertyField.js +75 -79
- package/es/lib/CustomProperties/Edit/CustomPropertyField.test.js +30 -35
- package/es/lib/CustomProperties/Edit/CustomPropertyFormCard.js +19 -22
- package/es/lib/CustomProperties/Edit/CustomPropertyFormCard.test.js +7 -10
- package/es/lib/CustomProperties/Edit/testResources.js +12 -11
- package/es/lib/CustomProperties/Filter/CustomPropertiesFilter.js +67 -51
- package/es/lib/CustomProperties/Filter/CustomPropertiesFilter.test.js +2 -3
- package/es/lib/CustomProperties/Filter/CustomPropertiesFilterField.js +62 -47
- package/es/lib/CustomProperties/Filter/CustomPropertiesFilterField.test.js +4 -7
- package/es/lib/CustomProperties/Filter/CustomPropertiesFilterFieldArray.js +16 -24
- package/es/lib/CustomProperties/Filter/CustomPropertiesFilterFieldArray.test.js +2 -3
- package/es/lib/CustomProperties/Filter/CustomPropertiesFilterForm.js +17 -16
- package/es/lib/CustomProperties/Filter/CustomPropertiesFilterForm.test.js +10 -7
- package/es/lib/CustomProperties/Filter/CustomPropertiesRule.js +35 -35
- package/es/lib/CustomProperties/Filter/testResources.js +2 -1
- package/es/lib/CustomProperties/Filter/useOperators.js +6 -8
- package/es/lib/CustomProperties/Filter/useParseActiveFilterStrings.js +12 -2
- package/es/lib/CustomProperties/Filter/useValueProps.js +6 -8
- package/es/lib/CustomProperties/View/CustomPropertiesView.js +10 -10
- package/es/lib/CustomProperties/View/CustomPropertiesView.test.js +2 -3
- package/es/lib/CustomProperties/View/CustomPropertiesViewCtx.js +67 -52
- package/es/lib/CustomProperties/View/CustomPropertiesViewCtx.test.js +8 -6
- package/es/lib/CustomProperties/View/CustomPropertyCard.js +20 -16
- package/es/lib/CycleButton/CycleButton.js +28 -14
- package/es/lib/FieldLabel/FieldLabel.js +5 -9
- package/es/lib/Files/FileUploader/FileUploader.js +41 -40
- package/es/lib/Files/FileView/FileView.js +11 -14
- package/es/lib/Files/useFileHandlers.js +63 -68
- package/es/lib/FormModal/FormModal.js +38 -38
- package/es/lib/FormattedKintMessage/FormattedKintMessage.js +29 -24
- package/es/lib/IconSelect/IconSelect.js +60 -44
- package/es/lib/NoResultsMessage/NoResultsMessage.js +31 -31
- package/es/lib/NumberField/NumberField.js +39 -19
- package/es/lib/NumberField/NumberField.test.js +19 -10
- package/es/lib/QueryTypedown/QueryTypedown.js +34 -12
- package/es/lib/RefdataButtons/RefdataButtons.js +14 -14
- package/es/lib/ResponsiveButtonGroup/ResponsiveButtonGroup.js +75 -68
- package/es/lib/ResponsiveButtonGroup/useResponsiveButtonGroupSizing.js +30 -16
- package/es/lib/RichSelect/RichSelect.js +74 -58
- package/es/lib/RichSelect/useSelectedOption.js +12 -2
- package/es/lib/SASQLookupComponent/SASQLookupComponent.js +195 -188
- package/es/lib/SASQLookupComponent/SASQLookupComponent.test.js +81 -95
- package/es/lib/SASQLookupComponent/TableBody/TableBody.js +68 -48
- package/es/lib/SASQLookupComponent/TableBody/TableBody.test.js +37 -34
- package/es/lib/SASQLookupComponent/__mocks__/SASQLookupComponent.js +4 -5
- package/es/lib/SASQLookupComponent/__mocks__/SASQLookupComponentRender.js +1 -3
- package/es/lib/SASQRoute/SASQRoute.js +34 -29
- package/es/lib/SASQRoute/SASQRoute.test.js +34 -42
- package/es/lib/SASQViewComponent/SASQViewComponent.js +69 -66
- package/es/lib/SASQViewComponent/SASQViewComponent.test.js +13 -12
- package/es/lib/SearchField/SearchField.js +12 -8
- package/es/lib/SearchKeyControl/SearchKeyControl.js +46 -31
- package/es/lib/SearchKeyControl/SearchKeyControl.test.js +6 -2
- package/es/lib/Settings/EditableRefdataCategoryList/EditableRefdataCategoryList.js +124 -103
- package/es/lib/Settings/EditableRefdataList/EditableRefdataList.js +120 -107
- package/es/lib/Settings/EditableSettingsList/EditableSettingsList.js +12 -16
- package/es/lib/Settings/EditableSettingsList/EditableSettingsListFieldArray/EditableSettingsListFieldArray.js +45 -31
- package/es/lib/Settings/EditableSettingsList/EditableSettingsListFieldArray/EditableSettingsListFieldArray.test.js +6 -9
- package/es/lib/Settings/EditableSettingsList/SettingField/EditSettingValue/EditSettingValue.js +20 -14
- package/es/lib/Settings/EditableSettingsList/SettingField/EditSettingValue/EditSettingValue.test.js +32 -48
- package/es/lib/Settings/EditableSettingsList/SettingField/RenderSettingValue/RenderSettingValue.js +19 -19
- package/es/lib/Settings/EditableSettingsList/SettingField/RenderSettingValue/RenderSettingValue.test.js +24 -36
- package/es/lib/Settings/EditableSettingsList/SettingField/SettingField.js +48 -45
- package/es/lib/Settings/EditableSettingsList/SettingField/SettingField.test.js +9 -12
- package/es/lib/Settings/RefdataCategoriesSettings/RefdataCategoriesSettings.js +50 -38
- package/es/lib/Settings/SettingPage/SettingPage.js +17 -19
- package/es/lib/Settings/SettingPage/SettingPagePane/SettingPagePane.js +6 -8
- package/es/lib/Settings/Settings/Settings.js +33 -42
- package/es/lib/Settings/SettingsFormContainer/SettingsFormContainer.js +47 -45
- package/es/lib/Settings/StaticSettingsField/StaticSettingsField.js +13 -5
- package/es/lib/Settings/StaticSettingsField/StaticSettingsFieldComponent/StaticSettingsFieldComponent.js +38 -19
- package/es/lib/Settings/hooks/staticSettingsPages/useSettingCallout/useSettingCallout.js +13 -17
- package/es/lib/Settings/hooks/staticSettingsPages/useSettingsSectionInitalValues/useSettingsSectionInitalValues.js +6 -10
- package/es/lib/Settings/hooks/staticSettingsPages/useStaticSettingsSection.js +20 -20
- package/es/lib/Settings/hooks/useAppSettings/useAppSettings.js +18 -15
- package/es/lib/Settings/hooks/useSettingSection/useSettingSection.js +27 -26
- package/es/lib/Settings/hooks/useSettings/useSettings.js +95 -99
- package/es/lib/Tags/Tags.js +37 -38
- package/es/lib/Tags/Tags.test.js +12 -18
- package/es/lib/Tags/hooks/useTags.js +1 -1
- package/es/lib/Tags/hooks/useTagsEnabled.js +13 -14
- package/es/lib/Tags/tagsConfig.js +1 -1
- package/es/lib/Typedown/Typedown.js +128 -78
- package/es/lib/hooks/__mocks__/index.js +7 -3
- package/es/lib/hooks/__mocks__/useMutateGeneric.js +22 -0
- package/es/lib/hooks/intlHooks/useIntlKeyStore/useIntlKeyStore.js +24 -20
- package/es/lib/hooks/intlHooks/useKintIntl/useKintIntl.js +33 -25
- package/es/lib/hooks/typedownHooks/useTypedown.js +55 -37
- package/es/lib/hooks/typedownHooks/useTypedownData.js +15 -7
- package/es/lib/hooks/typedownHooks/useTypedownToggle.js +15 -7
- package/es/lib/hooks/useActionListRef.js +11 -2
- package/es/lib/hooks/useActiveElement.js +11 -2
- package/es/lib/hooks/useCustProps.js +45 -37
- package/es/lib/hooks/useCustomProperties.js +21 -18
- package/es/lib/hooks/useHelperApp.js +33 -15
- package/es/lib/hooks/useKiwtFieldArray.js +22 -14
- package/es/lib/hooks/useKiwtSASQuery.js +37 -28
- package/es/lib/hooks/useLocalPageStore.js +10 -7
- package/es/lib/hooks/useLocalStorageState.js +13 -2
- package/es/lib/hooks/useModConfigEntries.js +12 -15
- package/es/lib/hooks/useMutateCustomProperties/useMutateCustomProperties.js +16 -11
- package/es/lib/hooks/useMutateCustomProperties/useMutateCustomProperties.test.js +51 -0
- package/es/lib/hooks/useMutateGeneric/useMutateGeneric.js +70 -48
- package/es/lib/hooks/useMutateGeneric/useMutateGeneric.test.js +192 -0
- package/es/lib/hooks/useMutateModConfigEntry.js +5 -7
- package/es/lib/hooks/useMutateRefdataCategory/useMutateRefdataCategory.js +23 -16
- package/es/lib/hooks/useMutateRefdataCategory/useMutateRefdataCategory.test.js +69 -0
- package/es/lib/hooks/useMutateRefdataValue/useMutateRefdataValue.js +25 -17
- package/es/lib/hooks/useMutateRefdataValue/useMutateRefdataValue.test.js +95 -0
- package/es/lib/hooks/useMutateTemplates/useMutateTemplates.js +21 -13
- package/es/lib/hooks/useMutateTemplates/useMutateTemplates.test.js +34 -0
- package/es/lib/hooks/useParallelBatchFetch.js +61 -38
- package/es/lib/hooks/usePrevNextPagination.js +46 -32
- package/es/lib/hooks/useQIndex.js +23 -11
- package/es/lib/hooks/useRefdata.js +11 -13
- package/es/lib/hooks/useSASQQueryMeta.js +2 -3
- package/es/lib/hooks/useStandaloneSASQQueryParameter/useStandaloneSASQQueryParameter.js +18 -19
- package/es/lib/hooks/useTemplates.js +9 -12
- package/es/lib/utils/buildUrl.js +3 -2
- package/es/lib/utils/downloadBlob.js +12 -8
- package/es/lib/utils/filterParsers/deparseKiwtQueryFilters.js +5 -5
- package/es/lib/utils/filterParsers/parseKiwtQueryFilters.js +2 -2
- package/es/lib/utils/filterParsers/parseKiwtQueryGroups.js +5 -4
- package/es/lib/utils/filterParsers/parseKiwtQueryString.js +1 -1
- package/es/lib/utils/generateKiwtQueryParams/generateKiwtQueryParams.js +78 -102
- package/es/lib/utils/generateKiwtQueryParams/generateKiwtQueryParams.test.js +322 -29
- package/es/lib/utils/groupCustomPropertiesByCtx.js +9 -5
- package/es/lib/utils/matchString/matchString.js +7 -5
- package/es/lib/utils/matchString/matchString.test.js +26 -7
- package/es/lib/utils/modConfigEntriesQueryKey.js +4 -5
- package/es/lib/utils/parseErrorResponse.js +18 -8
- package/es/lib/utils/selectorSafe.js +3 -2
- package/es/lib/utils/sortByLabel.js +3 -2
- package/es/lib/utils/stringStyling/boldString.js +13 -4
- package/es/lib/utils/stringStyling/boldString.test.js +4 -5
- package/es/lib/utils/stringStyling/highlightString.js +13 -4
- package/es/lib/utils/stringStyling/highlightString.test.js +4 -5
- package/es/lib/validators/validators.js +8 -7
- package/package.json +1 -1
- package/src/artifacts/coverage-jest/ActionList/ActionList.js.html +1 -1
- package/src/artifacts/coverage-jest/ActionList/ActionListFieldArray.js.html +1 -1
- package/src/artifacts/coverage-jest/ActionList/index.html +1 -1
- package/src/artifacts/coverage-jest/ActionList/index.js.html +1 -1
- package/src/artifacts/coverage-jest/ButtonTypedown/ButtonTypedown.js.html +1 -1
- package/src/artifacts/coverage-jest/ButtonTypedown/index.html +1 -1
- package/src/artifacts/coverage-jest/ButtonTypedown/index.js.html +1 -1
- package/src/artifacts/coverage-jest/ComboButton/ComboButton.js.html +1 -1
- package/src/artifacts/coverage-jest/ComboButton/index.html +1 -1
- package/src/artifacts/coverage-jest/ComboButton/index.js.html +1 -1
- package/src/artifacts/coverage-jest/CustomProperties/Config/CustomPropertiesLookup.js.html +1 -1
- package/src/artifacts/coverage-jest/CustomProperties/Config/CustomPropertiesSettings.js.html +1 -1
- package/src/artifacts/coverage-jest/CustomProperties/Config/CustomPropertyForm.js.html +1 -1
- package/src/artifacts/coverage-jest/CustomProperties/Config/CustomPropertyView.js.html +1 -1
- package/src/artifacts/coverage-jest/CustomProperties/Config/index.html +1 -1
- package/src/artifacts/coverage-jest/CustomProperties/Config/index.js.html +1 -1
- package/src/artifacts/coverage-jest/CustomProperties/Edit/CustomPropertiesEdit.js.html +1 -1
- package/src/artifacts/coverage-jest/CustomProperties/Edit/CustomPropertiesEditCtx.js.html +1 -1
- package/src/artifacts/coverage-jest/CustomProperties/Edit/CustomPropertiesListField.js.html +1 -1
- package/src/artifacts/coverage-jest/CustomProperties/Edit/CustomPropertyField.js.html +1 -1
- package/src/artifacts/coverage-jest/CustomProperties/Edit/CustomPropertyFormCard.js.html +1 -1
- package/src/artifacts/coverage-jest/CustomProperties/Edit/index.html +1 -1
- package/src/artifacts/coverage-jest/CustomProperties/Edit/index.js.html +1 -1
- package/src/artifacts/coverage-jest/CustomProperties/Edit/testResources.js.html +1 -1
- package/src/artifacts/coverage-jest/CustomProperties/Filter/CustomPropertiesFilter.js.html +1 -1
- package/src/artifacts/coverage-jest/CustomProperties/Filter/CustomPropertiesFilterField.js.html +1 -1
- package/src/artifacts/coverage-jest/CustomProperties/Filter/CustomPropertiesFilterFieldArray.js.html +1 -1
- package/src/artifacts/coverage-jest/CustomProperties/Filter/CustomPropertiesFilterForm.js.html +1 -1
- package/src/artifacts/coverage-jest/CustomProperties/Filter/CustomPropertiesRule.js.html +1 -1
- package/src/artifacts/coverage-jest/CustomProperties/Filter/index.html +1 -1
- package/src/artifacts/coverage-jest/CustomProperties/Filter/index.js.html +1 -1
- package/src/artifacts/coverage-jest/CustomProperties/Filter/testResources.js.html +1 -1
- package/src/artifacts/coverage-jest/CustomProperties/Filter/useOperators.js.html +1 -1
- package/src/artifacts/coverage-jest/CustomProperties/Filter/useParseActiveFilterStrings.js.html +1 -1
- package/src/artifacts/coverage-jest/CustomProperties/Filter/useValueProps.js.html +1 -1
- package/src/artifacts/coverage-jest/CustomProperties/View/CustomPropertiesView.js.html +1 -1
- package/src/artifacts/coverage-jest/CustomProperties/View/CustomPropertiesViewCtx.js.html +1 -1
- package/src/artifacts/coverage-jest/CustomProperties/View/CustomPropertyCard.js.html +1 -1
- package/src/artifacts/coverage-jest/CustomProperties/View/index.html +1 -1
- package/src/artifacts/coverage-jest/CustomProperties/View/index.js.html +1 -1
- package/src/artifacts/coverage-jest/CustomProperties/View/testResources.js.html +1 -1
- package/src/artifacts/coverage-jest/CustomProperties/index.html +1 -1
- package/src/artifacts/coverage-jest/CustomProperties/index.js.html +1 -1
- package/src/artifacts/coverage-jest/CycleButton/CycleButton.js.html +1 -1
- package/src/artifacts/coverage-jest/CycleButton/index.html +1 -1
- package/src/artifacts/coverage-jest/CycleButton/index.js.html +1 -1
- package/src/artifacts/coverage-jest/FieldLabel/FieldLabel.js.html +1 -1
- package/src/artifacts/coverage-jest/FieldLabel/index.html +1 -1
- package/src/artifacts/coverage-jest/FieldLabel/index.js.html +1 -1
- package/src/artifacts/coverage-jest/Files/FileUploader/FileUploader.js.html +1 -1
- package/src/artifacts/coverage-jest/Files/FileUploader/index.html +1 -1
- package/src/artifacts/coverage-jest/Files/FileUploader/index.js.html +1 -1
- package/src/artifacts/coverage-jest/Files/FileView/FileView.js.html +1 -1
- package/src/artifacts/coverage-jest/Files/FileView/index.html +1 -1
- package/src/artifacts/coverage-jest/Files/FileView/index.js.html +1 -1
- package/src/artifacts/coverage-jest/Files/index.html +1 -1
- package/src/artifacts/coverage-jest/Files/index.js.html +1 -1
- package/src/artifacts/coverage-jest/Files/useFileHandlers.js.html +1 -1
- package/src/artifacts/coverage-jest/FormModal/FormModal.js.html +1 -1
- package/src/artifacts/coverage-jest/FormModal/index.html +1 -1
- package/src/artifacts/coverage-jest/FormModal/index.js.html +1 -1
- package/src/artifacts/coverage-jest/FormattedKintMessage/FormattedKintMessage.js.html +1 -1
- package/src/artifacts/coverage-jest/FormattedKintMessage/index.html +1 -1
- package/src/artifacts/coverage-jest/FormattedKintMessage/index.js.html +1 -1
- package/src/artifacts/coverage-jest/IconSelect/IconSelect.js.html +1 -1
- package/src/artifacts/coverage-jest/IconSelect/index.html +1 -1
- package/src/artifacts/coverage-jest/IconSelect/index.js.html +1 -1
- package/src/artifacts/coverage-jest/NoResultsMessage/NoResultsMessage.js.html +1 -1
- package/src/artifacts/coverage-jest/NoResultsMessage/index.html +1 -1
- package/src/artifacts/coverage-jest/NoResultsMessage/index.js.html +1 -1
- package/src/artifacts/coverage-jest/NumberField/NumberField.js.html +1 -1
- package/src/artifacts/coverage-jest/NumberField/index.html +1 -1
- package/src/artifacts/coverage-jest/NumberField/index.js.html +1 -1
- package/src/artifacts/coverage-jest/QueryTypedown/QueryTypedown.js.html +24 -9
- package/src/artifacts/coverage-jest/QueryTypedown/index.html +13 -13
- package/src/artifacts/coverage-jest/QueryTypedown/index.js.html +1 -1
- package/src/artifacts/coverage-jest/RefdataButtons/RefdataButtons.js.html +1 -1
- package/src/artifacts/coverage-jest/RefdataButtons/index.html +1 -1
- package/src/artifacts/coverage-jest/RefdataButtons/index.js.html +1 -1
- package/src/artifacts/coverage-jest/ResponsiveButtonGroup/ResponsiveButtonGroup.js.html +1 -1
- package/src/artifacts/coverage-jest/ResponsiveButtonGroup/index.html +1 -1
- package/src/artifacts/coverage-jest/ResponsiveButtonGroup/index.js.html +1 -1
- package/src/artifacts/coverage-jest/ResponsiveButtonGroup/useResponsiveButtonGroupSizing.js.html +1 -1
- package/src/artifacts/coverage-jest/RichSelect/RichSelect.js.html +1 -1
- package/src/artifacts/coverage-jest/RichSelect/index.html +1 -1
- package/src/artifacts/coverage-jest/RichSelect/index.js.html +1 -1
- package/src/artifacts/coverage-jest/RichSelect/useSelectedOption.js.html +1 -1
- package/src/artifacts/coverage-jest/SASQLookupComponent/SASQLookupComponent.js.html +30 -30
- package/src/artifacts/coverage-jest/SASQLookupComponent/TableBody/TableBody.js.html +1 -1
- package/src/artifacts/coverage-jest/SASQLookupComponent/TableBody/index.html +1 -1
- package/src/artifacts/coverage-jest/SASQLookupComponent/TableBody/index.js.html +1 -1
- package/src/artifacts/coverage-jest/SASQLookupComponent/index.html +1 -1
- package/src/artifacts/coverage-jest/SASQLookupComponent/index.js.html +1 -1
- package/src/artifacts/coverage-jest/SASQRoute/SASQRoute.js.html +1 -1
- package/src/artifacts/coverage-jest/SASQRoute/index.html +1 -1
- package/src/artifacts/coverage-jest/SASQRoute/index.js.html +1 -1
- package/src/artifacts/coverage-jest/SASQViewComponent/SASQViewComponent.js.html +1 -1
- package/src/artifacts/coverage-jest/SASQViewComponent/index.html +1 -1
- package/src/artifacts/coverage-jest/SASQViewComponent/index.js.html +1 -1
- package/src/artifacts/coverage-jest/SearchField/SearchField.js.html +1 -1
- package/src/artifacts/coverage-jest/SearchField/index.html +1 -1
- package/src/artifacts/coverage-jest/SearchField/index.js.html +1 -1
- package/src/artifacts/coverage-jest/SearchKeyControl/SearchKeyControl.js.html +1 -1
- package/src/artifacts/coverage-jest/SearchKeyControl/index.html +1 -1
- package/src/artifacts/coverage-jest/SearchKeyControl/index.js.html +1 -1
- package/src/artifacts/coverage-jest/Settings/EditableRefdataCategoryList/EditableRefdataCategoryList.js.html +1 -1
- package/src/artifacts/coverage-jest/Settings/EditableRefdataCategoryList/index.html +1 -1
- package/src/artifacts/coverage-jest/Settings/EditableRefdataCategoryList/index.js.html +1 -1
- package/src/artifacts/coverage-jest/Settings/EditableRefdataList/EditableRefdataList.js.html +1 -1
- package/src/artifacts/coverage-jest/Settings/EditableRefdataList/index.html +1 -1
- package/src/artifacts/coverage-jest/Settings/EditableRefdataList/index.js.html +1 -1
- package/src/artifacts/coverage-jest/Settings/EditableSettingsList/EditableSettingsList.js.html +1 -1
- package/src/artifacts/coverage-jest/Settings/EditableSettingsList/EditableSettingsListFieldArray/EditableSettingsListFieldArray.js.html +1 -1
- package/src/artifacts/coverage-jest/Settings/EditableSettingsList/EditableSettingsListFieldArray/index.html +1 -1
- package/src/artifacts/coverage-jest/Settings/EditableSettingsList/EditableSettingsListFieldArray/index.js.html +1 -1
- package/src/artifacts/coverage-jest/Settings/EditableSettingsList/SettingField/EditSettingValue/EditSettingValue.js.html +1 -1
- package/src/artifacts/coverage-jest/Settings/EditableSettingsList/SettingField/EditSettingValue/index.html +1 -1
- package/src/artifacts/coverage-jest/Settings/EditableSettingsList/SettingField/EditSettingValue/index.js.html +1 -1
- package/src/artifacts/coverage-jest/Settings/EditableSettingsList/SettingField/RenderSettingValue/RenderSettingValue.js.html +1 -1
- package/src/artifacts/coverage-jest/Settings/EditableSettingsList/SettingField/RenderSettingValue/index.html +1 -1
- package/src/artifacts/coverage-jest/Settings/EditableSettingsList/SettingField/RenderSettingValue/index.js.html +1 -1
- package/src/artifacts/coverage-jest/Settings/EditableSettingsList/SettingField/SettingField.js.html +1 -1
- package/src/artifacts/coverage-jest/Settings/EditableSettingsList/SettingField/index.html +1 -1
- package/src/artifacts/coverage-jest/Settings/EditableSettingsList/SettingField/index.js.html +1 -1
- package/src/artifacts/coverage-jest/Settings/EditableSettingsList/index.html +1 -1
- package/src/artifacts/coverage-jest/Settings/EditableSettingsList/index.js.html +1 -1
- package/src/artifacts/coverage-jest/Settings/RefdataCategoriesSettings/RefdataCategoriesSettings.js.html +1 -1
- package/src/artifacts/coverage-jest/Settings/RefdataCategoriesSettings/index.html +1 -1
- package/src/artifacts/coverage-jest/Settings/RefdataCategoriesSettings/index.js.html +1 -1
- package/src/artifacts/coverage-jest/Settings/SettingPage/SettingPage.js.html +1 -1
- package/src/artifacts/coverage-jest/Settings/SettingPage/SettingPagePane/SettingPagePane.js.html +1 -1
- package/src/artifacts/coverage-jest/Settings/SettingPage/SettingPagePane/index.html +1 -1
- package/src/artifacts/coverage-jest/Settings/SettingPage/SettingPagePane/index.js.html +1 -1
- package/src/artifacts/coverage-jest/Settings/SettingPage/index.html +1 -1
- package/src/artifacts/coverage-jest/Settings/SettingPage/index.js.html +1 -1
- package/src/artifacts/coverage-jest/Settings/Settings/Settings.js.html +1 -1
- package/src/artifacts/coverage-jest/Settings/Settings/index.html +1 -1
- package/src/artifacts/coverage-jest/Settings/Settings/index.js.html +1 -1
- package/src/artifacts/coverage-jest/Settings/SettingsFormContainer/SettingsFormContainer.js.html +1 -1
- package/src/artifacts/coverage-jest/Settings/SettingsFormContainer/index.html +1 -1
- package/src/artifacts/coverage-jest/Settings/SettingsFormContainer/index.js.html +1 -1
- package/src/artifacts/coverage-jest/Settings/StaticSettingsField/StaticSettingsField.js.html +23 -8
- package/src/artifacts/coverage-jest/Settings/StaticSettingsField/StaticSettingsFieldComponent/StaticSettingsFieldComponent.js.html +60 -6
- package/src/artifacts/coverage-jest/Settings/StaticSettingsField/StaticSettingsFieldComponent/index.html +10 -10
- package/src/artifacts/coverage-jest/Settings/StaticSettingsField/StaticSettingsFieldComponent/index.js.html +1 -1
- package/src/artifacts/coverage-jest/Settings/StaticSettingsField/index.html +13 -13
- package/src/artifacts/coverage-jest/Settings/StaticSettingsField/index.js.html +1 -1
- package/src/artifacts/coverage-jest/Settings/constants/index.html +1 -1
- package/src/artifacts/coverage-jest/Settings/constants/index.js.html +1 -1
- package/src/artifacts/coverage-jest/Settings/constants/queryKeys.js.html +1 -1
- package/src/artifacts/coverage-jest/Settings/contexts/SettingsContext.js.html +1 -1
- package/src/artifacts/coverage-jest/Settings/contexts/index.html +1 -1
- package/src/artifacts/coverage-jest/Settings/contexts/index.js.html +1 -1
- package/src/artifacts/coverage-jest/Settings/hooks/index.html +1 -1
- package/src/artifacts/coverage-jest/Settings/hooks/index.js.html +1 -1
- package/src/artifacts/coverage-jest/Settings/hooks/staticSettingsPages/index.html +1 -1
- package/src/artifacts/coverage-jest/Settings/hooks/staticSettingsPages/index.js.html +1 -1
- package/src/artifacts/coverage-jest/Settings/hooks/staticSettingsPages/useSettingCallout/index.html +1 -1
- package/src/artifacts/coverage-jest/Settings/hooks/staticSettingsPages/useSettingCallout/index.js.html +1 -1
- package/src/artifacts/coverage-jest/Settings/hooks/staticSettingsPages/useSettingCallout/useSettingCallout.js.html +1 -1
- package/src/artifacts/coverage-jest/Settings/hooks/staticSettingsPages/useSettingsSectionInitalValues/index.html +1 -1
- package/src/artifacts/coverage-jest/Settings/hooks/staticSettingsPages/useSettingsSectionInitalValues/index.js.html +1 -1
- package/src/artifacts/coverage-jest/Settings/hooks/staticSettingsPages/useSettingsSectionInitalValues/useSettingsSectionInitalValues.js.html +1 -1
- package/src/artifacts/coverage-jest/Settings/hooks/staticSettingsPages/useStaticSettingsSection.js.html +1 -1
- package/src/artifacts/coverage-jest/Settings/hooks/useAppSettings/index.html +1 -1
- package/src/artifacts/coverage-jest/Settings/hooks/useAppSettings/index.js.html +1 -1
- package/src/artifacts/coverage-jest/Settings/hooks/useAppSettings/useAppSettings.js.html +1 -1
- package/src/artifacts/coverage-jest/Settings/hooks/useSettingSection/index.html +1 -1
- package/src/artifacts/coverage-jest/Settings/hooks/useSettingSection/index.js.html +1 -1
- package/src/artifacts/coverage-jest/Settings/hooks/useSettingSection/useSettingSection.js.html +1 -1
- package/src/artifacts/coverage-jest/Settings/hooks/useSettings/index.html +1 -1
- package/src/artifacts/coverage-jest/Settings/hooks/useSettings/index.js.html +1 -1
- package/src/artifacts/coverage-jest/Settings/hooks/useSettings/useSettings.js.html +1 -1
- package/src/artifacts/coverage-jest/Settings/index.html +1 -1
- package/src/artifacts/coverage-jest/Settings/index.js.html +1 -1
- package/src/artifacts/coverage-jest/Tags/Tags.js.html +1 -1
- package/src/artifacts/coverage-jest/Tags/hooks/index.html +1 -1
- package/src/artifacts/coverage-jest/Tags/hooks/index.js.html +1 -1
- package/src/artifacts/coverage-jest/Tags/hooks/useTags.js.html +1 -1
- package/src/artifacts/coverage-jest/Tags/hooks/useTagsEnabled.js.html +1 -1
- package/src/artifacts/coverage-jest/Tags/index.html +1 -1
- package/src/artifacts/coverage-jest/Tags/index.js.html +1 -1
- package/src/artifacts/coverage-jest/Tags/tagsConfig.js.html +1 -1
- package/src/artifacts/coverage-jest/Typedown/Typedown.js.html +136 -7
- package/src/artifacts/coverage-jest/Typedown/index.html +3 -3
- package/src/artifacts/coverage-jest/Typedown/index.js.html +1 -1
- package/src/artifacts/coverage-jest/cobertura-coverage.xml +542 -529
- package/src/artifacts/coverage-jest/constants/comparators.js.html +1 -1
- package/src/artifacts/coverage-jest/constants/customProperties.js.html +1 -1
- package/src/artifacts/coverage-jest/constants/endpoints.js.html +1 -1
- package/src/artifacts/coverage-jest/constants/eventCodes.js.html +1 -1
- package/src/artifacts/coverage-jest/constants/index.html +1 -1
- package/src/artifacts/coverage-jest/constants/pagination.js.html +1 -1
- package/src/artifacts/coverage-jest/hooks/index.html +1 -1
- package/src/artifacts/coverage-jest/hooks/index.js.html +1 -1
- package/src/artifacts/coverage-jest/hooks/intlHooks/index.html +1 -1
- package/src/artifacts/coverage-jest/hooks/intlHooks/index.js.html +1 -1
- package/src/artifacts/coverage-jest/hooks/intlHooks/useIntlKey/index.html +1 -1
- package/src/artifacts/coverage-jest/hooks/intlHooks/useIntlKey/index.js.html +1 -1
- package/src/artifacts/coverage-jest/hooks/intlHooks/useIntlKey/useIntlKey.js.html +7 -7
- package/src/artifacts/coverage-jest/hooks/intlHooks/useIntlKeyStore/index.html +1 -1
- package/src/artifacts/coverage-jest/hooks/intlHooks/useIntlKeyStore/index.js.html +1 -1
- package/src/artifacts/coverage-jest/hooks/intlHooks/useIntlKeyStore/useIntlKeyStore.js.html +6 -6
- package/src/artifacts/coverage-jest/hooks/intlHooks/useKintIntl/index.html +1 -1
- package/src/artifacts/coverage-jest/hooks/intlHooks/useKintIntl/index.js.html +1 -1
- package/src/artifacts/coverage-jest/hooks/intlHooks/useKintIntl/useKintIntl.js.html +6 -6
- package/src/artifacts/coverage-jest/hooks/typedownHooks/index.html +1 -1
- package/src/artifacts/coverage-jest/hooks/typedownHooks/index.js.html +1 -1
- package/src/artifacts/coverage-jest/hooks/typedownHooks/useTypedown.js.html +1 -1
- package/src/artifacts/coverage-jest/hooks/typedownHooks/useTypedownData.js.html +1 -1
- package/src/artifacts/coverage-jest/hooks/typedownHooks/useTypedownToggle.js.html +1 -1
- package/src/artifacts/coverage-jest/hooks/useActionListRef.js.html +1 -1
- package/src/artifacts/coverage-jest/hooks/useActiveElement.js.html +1 -1
- package/src/artifacts/coverage-jest/hooks/useCustProps.js.html +1 -1
- package/src/artifacts/coverage-jest/hooks/useCustomProperties.js.html +1 -1
- package/src/artifacts/coverage-jest/hooks/useHelperApp.js.html +1 -1
- package/src/artifacts/coverage-jest/hooks/useInvalidateRefdata/index.html +1 -1
- package/src/artifacts/coverage-jest/hooks/useInvalidateRefdata/index.js.html +1 -1
- package/src/artifacts/coverage-jest/hooks/useInvalidateRefdata/useInvalidateRefdata.js.html +2 -2
- package/src/artifacts/coverage-jest/hooks/useKiwtFieldArray.js.html +1 -1
- package/src/artifacts/coverage-jest/hooks/useKiwtSASQuery.js.html +9 -9
- package/src/artifacts/coverage-jest/hooks/useLocalPageStore.js.html +1 -1
- package/src/artifacts/coverage-jest/hooks/useLocalStorageState.js.html +5 -5
- package/src/artifacts/coverage-jest/hooks/useModConfigEntries.js.html +1 -1
- package/src/artifacts/coverage-jest/hooks/useMutateCustomProperties/index.html +17 -17
- package/src/artifacts/coverage-jest/hooks/useMutateCustomProperties/index.js.html +1 -1
- package/src/artifacts/coverage-jest/hooks/useMutateCustomProperties/useMutateCustomProperties.js.html +16 -16
- package/src/artifacts/coverage-jest/hooks/useMutateGeneric/index.html +21 -21
- package/src/artifacts/coverage-jest/hooks/useMutateGeneric/index.js.html +1 -1
- package/src/artifacts/coverage-jest/hooks/useMutateGeneric/useMutateGeneric.js.html +93 -93
- package/src/artifacts/coverage-jest/hooks/useMutateModConfigEntry.js.html +1 -1
- package/src/artifacts/coverage-jest/hooks/useMutateRefdataCategory/index.html +21 -21
- package/src/artifacts/coverage-jest/hooks/useMutateRefdataCategory/index.js.html +1 -1
- package/src/artifacts/coverage-jest/hooks/useMutateRefdataCategory/useMutateRefdataCategory.js.html +40 -40
- package/src/artifacts/coverage-jest/hooks/useMutateRefdataValue/index.html +21 -21
- package/src/artifacts/coverage-jest/hooks/useMutateRefdataValue/index.js.html +1 -1
- package/src/artifacts/coverage-jest/hooks/useMutateRefdataValue/useMutateRefdataValue.js.html +44 -44
- package/src/artifacts/coverage-jest/hooks/useMutateTemplates/index.html +21 -21
- package/src/artifacts/coverage-jest/hooks/useMutateTemplates/index.js.html +1 -1
- package/src/artifacts/coverage-jest/hooks/useMutateTemplates/useMutateTemplates.js.html +38 -38
- package/src/artifacts/coverage-jest/hooks/useParallelBatchFetch.js.html +1 -1
- package/src/artifacts/coverage-jest/hooks/usePrevNextPagination.js.html +20 -20
- package/src/artifacts/coverage-jest/hooks/useQIndex.js.html +8 -8
- package/src/artifacts/coverage-jest/hooks/useRefdata.js.html +1 -1
- package/src/artifacts/coverage-jest/hooks/useSASQQueryMeta.js.html +1 -1
- package/src/artifacts/coverage-jest/hooks/useStandaloneSASQQueryParameter/index.html +1 -1
- package/src/artifacts/coverage-jest/hooks/useStandaloneSASQQueryParameter/index.js.html +1 -1
- package/src/artifacts/coverage-jest/hooks/useStandaloneSASQQueryParameter/useStandaloneSASQQueryParameter.js.html +1 -1
- package/src/artifacts/coverage-jest/hooks/useTemplates.js.html +1 -1
- package/src/artifacts/coverage-jest/index.html +95 -95
- package/src/artifacts/coverage-jest/utils/buildUrl.js.html +1 -1
- package/src/artifacts/coverage-jest/utils/downloadBlob.js.html +2 -2
- package/src/artifacts/coverage-jest/utils/filterParsers/deparseKiwtQueryFilters.js.html +3 -3
- package/src/artifacts/coverage-jest/utils/filterParsers/index.html +1 -1
- package/src/artifacts/coverage-jest/utils/filterParsers/index.js.html +1 -1
- package/src/artifacts/coverage-jest/utils/filterParsers/parseKiwtQueryFilters.js.html +3 -3
- package/src/artifacts/coverage-jest/utils/filterParsers/parseKiwtQueryGroups.js.html +2 -2
- package/src/artifacts/coverage-jest/utils/filterParsers/parseKiwtQueryString.js.html +5 -5
- package/src/artifacts/coverage-jest/utils/generateKiwtQuery.js.html +7 -7
- package/src/artifacts/coverage-jest/utils/generateKiwtQueryParams/generateKiwtQueryParams.js.html +125 -125
- package/src/artifacts/coverage-jest/utils/generateKiwtQueryParams/index.html +21 -21
- package/src/artifacts/coverage-jest/utils/generateKiwtQueryParams/index.js.html +1 -1
- package/src/artifacts/coverage-jest/utils/groupCustomPropertiesByCtx.js.html +2 -2
- package/src/artifacts/coverage-jest/utils/index.html +5 -5
- package/src/artifacts/coverage-jest/utils/index.js.html +1 -1
- package/src/artifacts/coverage-jest/utils/matchString/index.html +1 -1
- package/src/artifacts/coverage-jest/utils/matchString/index.js.html +1 -1
- package/src/artifacts/coverage-jest/utils/matchString/matchString.js.html +2 -2
- package/src/artifacts/coverage-jest/utils/modConfigEntriesQueryKey.js.html +2 -2
- package/src/artifacts/coverage-jest/utils/parseErrorResponse.js.html +2 -2
- package/src/artifacts/coverage-jest/utils/parseModConfigEntry.js.html +2 -2
- package/src/artifacts/coverage-jest/utils/refdataOptions.js.html +1 -1
- package/src/artifacts/coverage-jest/utils/refdataQueryKey/index.html +1 -1
- package/src/artifacts/coverage-jest/utils/refdataQueryKey/index.js.html +1 -1
- package/src/artifacts/coverage-jest/utils/refdataQueryKey/refdataQueryKey.js.html +2 -2
- package/src/artifacts/coverage-jest/utils/selectorSafe.js.html +2 -2
- package/src/artifacts/coverage-jest/utils/sortByLabel.js.html +2 -2
- package/src/artifacts/coverage-jest/utils/stringStyling/boldString.js.html +2 -2
- package/src/artifacts/coverage-jest/utils/stringStyling/highlightString.js.html +2 -2
- package/src/artifacts/coverage-jest/utils/stringStyling/index.html +1 -1
- package/src/artifacts/coverage-jest/utils/stringStyling/index.js.html +1 -1
- package/src/artifacts/coverage-jest/utils/toCamelCase.js.html +2 -2
- package/src/artifacts/coverage-jest/utils/typedownQueryKey.js.html +2 -2
- package/src/artifacts/coverage-jest/validators/index.html +1 -1
- package/src/artifacts/coverage-jest/validators/index.js.html +1 -1
- package/src/artifacts/coverage-jest/validators/validators.js.html +1 -1
- package/src/lib/QueryTypedown/QueryTypedown.js +7 -2
- package/src/lib/QueryTypedown/README.md +7 -6
- package/src/lib/Settings/StaticSettingsField/StaticSettingsField.js +6 -1
- package/src/lib/Settings/StaticSettingsField/StaticSettingsFieldComponent/StaticSettingsFieldComponent.js +18 -0
- package/src/lib/Typedown/README.md +27 -1
- package/src/lib/Typedown/Typedown.js +47 -4
- package/src/lib/hooks/__mocks__/useMutateGeneric.js +14 -0
- package/src/lib/hooks/useMutateCustomProperties/useMutateCustomProperties.test.js +65 -0
- package/src/lib/hooks/useMutateGeneric/useMutateGeneric.test.js +194 -0
- package/src/lib/hooks/useMutateRefdataCategory/useMutateRefdataCategory.test.js +76 -0
- package/src/lib/hooks/useMutateRefdataValue/useMutateRefdataValue.test.js +93 -0
- package/src/lib/hooks/useMutateTemplates/useMutateTemplates.test.js +33 -0
- package/src/lib/utils/generateKiwtQueryParams/generateKiwtQueryParams.test.js +248 -17
|
@@ -14,29 +14,33 @@ var _NumberField = _interopRequireDefault(require("../../NumberField"));
|
|
|
14
14
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
15
15
|
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
|
|
16
16
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
17
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
18
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
19
|
+
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
20
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
|
21
|
+
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
17
22
|
const CustomPropertyField = _ref => {
|
|
18
|
-
let
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
labelOverrides = {},
|
|
27
|
-
name,
|
|
28
|
-
onChange,
|
|
29
|
-
value,
|
|
30
|
-
setCustomProperties
|
|
31
|
-
} = _ref;
|
|
23
|
+
let availableCustomProperties = _ref.availableCustomProperties,
|
|
24
|
+
customProperty = _ref.customProperty,
|
|
25
|
+
customPropertyType = _ref.customPropertyType,
|
|
26
|
+
customProperties = _ref.customProperties,
|
|
27
|
+
index = _ref.index,
|
|
28
|
+
passedIntlKey = _ref.intlKey,
|
|
29
|
+
passedIntlNS = _ref.intlNS,
|
|
30
|
+
_ref$labelOverrides = _ref.labelOverrides,
|
|
31
|
+
labelOverrides = _ref$labelOverrides === void 0 ? {} : _ref$labelOverrides,
|
|
32
|
+
name = _ref.name,
|
|
33
|
+
onChange = _ref.onChange,
|
|
34
|
+
value = _ref.value,
|
|
35
|
+
setCustomProperties = _ref.setCustomProperties;
|
|
32
36
|
const kintIntl = (0, _hooks.useKintIntl)(passedIntlKey, passedIntlNS);
|
|
33
37
|
// Set up the validator for the customProperty
|
|
34
38
|
const customPropertyValidator = (fieldValue, allValues) => {
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
39
|
+
var _allValues$customProp, _allValues$customProp2;
|
|
40
|
+
const _ref2 = (_allValues$customProp = allValues === null || allValues === void 0 || (_allValues$customProp2 = allValues.customProperties) === null || _allValues$customProp2 === void 0 || (_allValues$customProp2 = _allValues$customProp2[customProperty === null || customProperty === void 0 ? void 0 : customProperty.value]) === null || _allValues$customProp2 === void 0 ? void 0 : _allValues$customProp2[0]) !== null && _allValues$customProp !== void 0 ? _allValues$customProp : {},
|
|
41
|
+
note = _ref2.note,
|
|
42
|
+
publicNote = _ref2.publicNote,
|
|
43
|
+
currentValue = _ref2.value;
|
|
40
44
|
if (note && !currentValue || publicNote && !currentValue) {
|
|
41
45
|
if (customProperty.type === CUSTOM_PROPERTY_TYPES.DECIMAL_CLASS_NAME || customProperty.type === CUSTOM_PROPERTY_TYPES.INTEGER_CLASS_NAME) {
|
|
42
46
|
return kintIntl.formatKintMessage({
|
|
@@ -79,7 +83,9 @@ const CustomPropertyField = _ref => {
|
|
|
79
83
|
return availableCustomProperties.find(cp => cp.value === customPropertyValue);
|
|
80
84
|
};
|
|
81
85
|
const renderCustomPropertyName = () => {
|
|
86
|
+
var _customPropertyValue$;
|
|
82
87
|
const unsetCustomProperties = availableCustomProperties.filter(t => {
|
|
88
|
+
var _custPropValue$;
|
|
83
89
|
// Only optional properties can be set
|
|
84
90
|
if (t.primary) return false;
|
|
85
91
|
const custPropValue = value[t.value];
|
|
@@ -88,16 +94,16 @@ const CustomPropertyField = _ref => {
|
|
|
88
94
|
if (custPropValue === undefined) return true;
|
|
89
95
|
|
|
90
96
|
// The customProperty is set but is marked for deletion. Allow reuse.
|
|
91
|
-
if (custPropValue[0]
|
|
97
|
+
if ((_custPropValue$ = custPropValue[0]) !== null && _custPropValue$ !== void 0 && _custPropValue$._delete) return true;
|
|
92
98
|
return false;
|
|
93
99
|
});
|
|
94
100
|
const customPropertyValue = value[customProperty.value];
|
|
95
|
-
const id = customPropertyValue
|
|
101
|
+
const id = customPropertyValue === null || customPropertyValue === void 0 || (_customPropertyValue$ = customPropertyValue[0]) === null || _customPropertyValue$ === void 0 ? void 0 : _customPropertyValue$.id;
|
|
96
102
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Select, {
|
|
97
103
|
autoFocus: !id,
|
|
98
104
|
dataOptions: [customProperty, ...unsetCustomProperties] // The selected customProperty, and the available unset customProperties
|
|
99
105
|
,
|
|
100
|
-
id:
|
|
106
|
+
id: "edit-customproperty-".concat(index, "-name"),
|
|
101
107
|
label: kintIntl.formatKintMessage({
|
|
102
108
|
id: 'customProperties.name',
|
|
103
109
|
overrideValue: labelOverrides.name
|
|
@@ -115,35 +121,33 @@ const CustomPropertyField = _ref => {
|
|
|
115
121
|
// We do this by 1) marking the current customProperty for deletion and 2) initing
|
|
116
122
|
// the new customProperty to an empty object.
|
|
117
123
|
const currentValue = value[customProperty.value] ? value[customProperty.value][0] : {};
|
|
118
|
-
onChange({
|
|
119
|
-
...value,
|
|
124
|
+
onChange(_objectSpread(_objectSpread({}, value), {}, {
|
|
120
125
|
[customProperty.value]: [{
|
|
121
126
|
id: currentValue.id,
|
|
122
127
|
_delete: true
|
|
123
128
|
}],
|
|
124
129
|
[newValue]: [{}]
|
|
125
|
-
});
|
|
130
|
+
}));
|
|
126
131
|
},
|
|
127
132
|
required: true,
|
|
128
133
|
value: customProperty.value
|
|
129
134
|
});
|
|
130
135
|
};
|
|
131
136
|
const renderCustomPropertyValue = () => {
|
|
137
|
+
var _customProperty$optio;
|
|
132
138
|
const currentValue = value[customProperty.value] ? value[customProperty.value][0] : {};
|
|
133
139
|
const min = Number.MIN_SAFE_INTEGER;
|
|
134
140
|
const max = Number.MAX_SAFE_INTEGER;
|
|
135
141
|
|
|
136
142
|
// Default change handler
|
|
137
143
|
let handleChange = e => {
|
|
138
|
-
onChange({
|
|
139
|
-
|
|
140
|
-
[customProperty.value]: [{
|
|
141
|
-
...currentValue,
|
|
144
|
+
onChange(_objectSpread(_objectSpread({}, value), {}, {
|
|
145
|
+
[customProperty.value]: [_objectSpread(_objectSpread({}, currentValue), {}, {
|
|
142
146
|
_delete: e.target.value === '',
|
|
143
147
|
// Delete customProperty if removing the value.
|
|
144
148
|
value: e.target.value // send down the number for integers and decimal types
|
|
145
|
-
}]
|
|
146
|
-
});
|
|
149
|
+
})]
|
|
150
|
+
}));
|
|
147
151
|
};
|
|
148
152
|
// Figure out which component we're rendering and specify its unique props.
|
|
149
153
|
let fieldProps;
|
|
@@ -153,27 +157,25 @@ const CustomPropertyField = _ref => {
|
|
|
153
157
|
component: _components.Select,
|
|
154
158
|
// don't order dataOptions here, notSet should always be first in list
|
|
155
159
|
dataOptions: customProperty.options,
|
|
156
|
-
format: v => v
|
|
160
|
+
format: v => v === null || v === void 0 ? void 0 : v.value
|
|
157
161
|
};
|
|
158
162
|
break;
|
|
159
163
|
case CUSTOM_PROPERTY_TYPES.MULTI_REFDATA_CLASS_NAME:
|
|
160
164
|
fieldProps = {
|
|
161
165
|
component: _components.MultiSelection,
|
|
162
166
|
// The "not set" value is not relevant for a multi select
|
|
163
|
-
dataOptions: (0, _orderBy.default)(customProperty.options
|
|
167
|
+
dataOptions: (0, _orderBy.default)((_customProperty$optio = customProperty.options) === null || _customProperty$optio === void 0 ? void 0 : _customProperty$optio.filter(opt => !!(opt !== null && opt !== void 0 && opt.value)), 'label'),
|
|
164
168
|
renderToOverlay: true // FIXME Switch to usePortal for stripes v10
|
|
165
169
|
};
|
|
166
170
|
// MultiSelection passes the changed array as a value not an event
|
|
167
171
|
handleChange = refdataArray => {
|
|
168
|
-
onChange({
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
...currentValue,
|
|
172
|
-
_delete: refdataArray?.length === 0 ? true : undefined,
|
|
172
|
+
onChange(_objectSpread(_objectSpread({}, value), {}, {
|
|
173
|
+
[customProperty.value]: [_objectSpread(_objectSpread({}, currentValue), {}, {
|
|
174
|
+
_delete: (refdataArray === null || refdataArray === void 0 ? void 0 : refdataArray.length) === 0 ? true : undefined,
|
|
173
175
|
// Delete customProperty if removing all values.
|
|
174
176
|
value: refdataArray
|
|
175
|
-
}]
|
|
176
|
-
});
|
|
177
|
+
})]
|
|
178
|
+
}));
|
|
177
179
|
};
|
|
178
180
|
break;
|
|
179
181
|
case CUSTOM_PROPERTY_TYPES.INTEGER_CLASS_NAME:
|
|
@@ -185,15 +187,13 @@ const CustomPropertyField = _ref => {
|
|
|
185
187
|
step: 'any'
|
|
186
188
|
};
|
|
187
189
|
handleChange = e => {
|
|
188
|
-
onChange({
|
|
189
|
-
|
|
190
|
-
[customProperty.value]: [{
|
|
191
|
-
...currentValue,
|
|
190
|
+
onChange(_objectSpread(_objectSpread({}, value), {}, {
|
|
191
|
+
[customProperty.value]: [_objectSpread(_objectSpread({}, currentValue), {}, {
|
|
192
192
|
_delete: e.target.value === '' ? true : undefined,
|
|
193
193
|
// Delete customProperty if removing the value.
|
|
194
194
|
value: e.target.value
|
|
195
|
-
}]
|
|
196
|
-
});
|
|
195
|
+
})]
|
|
196
|
+
}));
|
|
197
197
|
};
|
|
198
198
|
break;
|
|
199
199
|
case CUSTOM_PROPERTY_TYPES.TEXT_CLASS_NAME:
|
|
@@ -216,30 +216,28 @@ const CustomPropertyField = _ref => {
|
|
|
216
216
|
};
|
|
217
217
|
break;
|
|
218
218
|
}
|
|
219
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactFinalForm.Field, {
|
|
219
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactFinalForm.Field, _objectSpread({
|
|
220
220
|
"data-test-customproperty-value": true,
|
|
221
|
-
id:
|
|
221
|
+
id: "edit-customproperty-".concat(index, "-value"),
|
|
222
222
|
label: kintIntl.formatKintMessage({
|
|
223
223
|
id: 'customProperties.value',
|
|
224
224
|
overrideValue: labelOverrides.value
|
|
225
225
|
}),
|
|
226
|
-
name:
|
|
226
|
+
name: "".concat(name, ".").concat(customProperty.value, "[0].value"),
|
|
227
227
|
onChange: handleChange,
|
|
228
228
|
required: !customProperty.primary,
|
|
229
|
-
validate: (fieldValue, allValues) => customPropertyValidator(fieldValue, allValues)
|
|
230
|
-
|
|
231
|
-
});
|
|
229
|
+
validate: (fieldValue, allValues) => customPropertyValidator(fieldValue, allValues)
|
|
230
|
+
}, fieldProps));
|
|
232
231
|
};
|
|
233
232
|
const renderCustomPropertyVisibility = () => {
|
|
234
|
-
|
|
233
|
+
var _value$customProperty, _value$customProperty2, _customPropertyObject;
|
|
234
|
+
const customPropertyObject = (_value$customProperty = (_value$customProperty2 = value[customProperty.value]) === null || _value$customProperty2 === void 0 ? void 0 : _value$customProperty2[0]) !== null && _value$customProperty !== void 0 ? _value$customProperty : {};
|
|
235
235
|
const handleChange = e => {
|
|
236
|
-
onChange({
|
|
237
|
-
|
|
238
|
-
[customProperty.value]: [{
|
|
239
|
-
...customPropertyObject,
|
|
236
|
+
onChange(_objectSpread(_objectSpread({}, value), {}, {
|
|
237
|
+
[customProperty.value]: [_objectSpread(_objectSpread({}, customPropertyObject), {}, {
|
|
240
238
|
internal: e.target.value
|
|
241
|
-
}]
|
|
242
|
-
});
|
|
239
|
+
})]
|
|
240
|
+
}));
|
|
243
241
|
};
|
|
244
242
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Select, {
|
|
245
243
|
"data-test-customproperty-visibility": true,
|
|
@@ -256,57 +254,55 @@ const CustomPropertyField = _ref => {
|
|
|
256
254
|
overrideValue: labelOverrides.internalFalse
|
|
257
255
|
})
|
|
258
256
|
}],
|
|
259
|
-
id:
|
|
257
|
+
id: "edit-customproperty-".concat(index, "-visibility"),
|
|
260
258
|
label: kintIntl.formatKintMessage({
|
|
261
259
|
id: 'customProperties.visibility',
|
|
262
260
|
overrideValue: labelOverrides.visibility
|
|
263
261
|
}),
|
|
264
262
|
onChange: handleChange,
|
|
265
|
-
value: customPropertyObject
|
|
263
|
+
value: (_customPropertyObject = customPropertyObject === null || customPropertyObject === void 0 ? void 0 : customPropertyObject.internal) !== null && _customPropertyObject !== void 0 ? _customPropertyObject : customProperty.defaultInternal
|
|
266
264
|
});
|
|
267
265
|
};
|
|
268
266
|
const renderCustomPropertyNoteInternal = () => {
|
|
269
|
-
|
|
267
|
+
var _value$customProperty3, _value$customProperty4;
|
|
268
|
+
const customPropertyObject = (_value$customProperty3 = (_value$customProperty4 = value[customProperty.value]) === null || _value$customProperty4 === void 0 ? void 0 : _value$customProperty4[0]) !== null && _value$customProperty3 !== void 0 ? _value$customProperty3 : {};
|
|
270
269
|
const handleChange = e => {
|
|
271
|
-
onChange({
|
|
272
|
-
|
|
273
|
-
[customProperty.value]: [{
|
|
274
|
-
...customPropertyObject,
|
|
270
|
+
onChange(_objectSpread(_objectSpread({}, value), {}, {
|
|
271
|
+
[customProperty.value]: [_objectSpread(_objectSpread({}, customPropertyObject), {}, {
|
|
275
272
|
note: e.target.value
|
|
276
|
-
}]
|
|
277
|
-
});
|
|
273
|
+
})]
|
|
274
|
+
}));
|
|
278
275
|
};
|
|
279
276
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.TextArea, {
|
|
280
277
|
"data-test-customproperty-note": true,
|
|
281
|
-
id:
|
|
278
|
+
id: "edit-customproperty-".concat(index, "-internal-note"),
|
|
282
279
|
label: kintIntl.formatKintMessage({
|
|
283
280
|
id: 'customProperties.internalNote',
|
|
284
281
|
overrideValue: labelOverrides.internalNote
|
|
285
282
|
}),
|
|
286
283
|
onChange: handleChange,
|
|
287
|
-
value: customPropertyObject
|
|
284
|
+
value: customPropertyObject === null || customPropertyObject === void 0 ? void 0 : customPropertyObject.note
|
|
288
285
|
});
|
|
289
286
|
};
|
|
290
287
|
const renderCustomPropertyNotePublic = () => {
|
|
291
|
-
|
|
288
|
+
var _value$customProperty5, _value$customProperty6;
|
|
289
|
+
const customPropertyObject = (_value$customProperty5 = (_value$customProperty6 = value[customProperty.value]) === null || _value$customProperty6 === void 0 ? void 0 : _value$customProperty6[0]) !== null && _value$customProperty5 !== void 0 ? _value$customProperty5 : {};
|
|
292
290
|
const handleChange = e => {
|
|
293
|
-
onChange({
|
|
294
|
-
|
|
295
|
-
[customProperty.value]: [{
|
|
296
|
-
...customPropertyObject,
|
|
291
|
+
onChange(_objectSpread(_objectSpread({}, value), {}, {
|
|
292
|
+
[customProperty.value]: [_objectSpread(_objectSpread({}, customPropertyObject), {}, {
|
|
297
293
|
publicNote: e.target.value
|
|
298
|
-
}]
|
|
299
|
-
});
|
|
294
|
+
})]
|
|
295
|
+
}));
|
|
300
296
|
};
|
|
301
297
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.TextArea, {
|
|
302
298
|
"data-test-customproperty-public-note": true,
|
|
303
|
-
id:
|
|
299
|
+
id: "edit-customproperty-".concat(index, "-public-note"),
|
|
304
300
|
label: kintIntl.formatKintMessage({
|
|
305
301
|
id: 'customProperties.publicNote',
|
|
306
302
|
overrideValue: labelOverrides.publicNote
|
|
307
303
|
}),
|
|
308
304
|
onChange: handleChange,
|
|
309
|
-
value: customPropertyObject
|
|
305
|
+
value: customPropertyObject === null || customPropertyObject === void 0 ? void 0 : customPropertyObject.publicNote
|
|
310
306
|
});
|
|
311
307
|
};
|
|
312
308
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_jsxRuntime.Fragment, {
|
|
@@ -7,15 +7,20 @@ var _jest = require("../../../../test/jest");
|
|
|
7
7
|
var _testResources = require("./testResources");
|
|
8
8
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
9
9
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
10
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
11
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
12
|
+
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
13
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
|
14
|
+
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
10
15
|
const onSubmit = jest.fn();
|
|
11
16
|
jest.mock('../../hooks');
|
|
12
17
|
const onChange = () => {};
|
|
13
18
|
const setCustomProperties = () => {};
|
|
14
|
-
const authIdentCustom = _jest.availableCustomProperties
|
|
15
|
-
const decimalCustProp = _jest.availableCustomProperties
|
|
16
|
-
const integerCustProp = _jest.availableCustomProperties
|
|
17
|
-
const dateCustProp = _jest.availableCustomProperties
|
|
18
|
-
const multiRefdataCustProp = _jest.availableCustomProperties
|
|
19
|
+
const authIdentCustom = _jest.availableCustomProperties === null || _jest.availableCustomProperties === void 0 ? void 0 : _jest.availableCustomProperties.find(cp => cp.value === 'AuthorIdentification');
|
|
20
|
+
const decimalCustProp = _jest.availableCustomProperties === null || _jest.availableCustomProperties === void 0 ? void 0 : _jest.availableCustomProperties.find(cp => cp.value === 'decimal');
|
|
21
|
+
const integerCustProp = _jest.availableCustomProperties === null || _jest.availableCustomProperties === void 0 ? void 0 : _jest.availableCustomProperties.find(cp => cp.value === 'integer');
|
|
22
|
+
const dateCustProp = _jest.availableCustomProperties === null || _jest.availableCustomProperties === void 0 ? void 0 : _jest.availableCustomProperties.find(cp => cp.value === 'date');
|
|
23
|
+
const multiRefdataCustProp = _jest.availableCustomProperties === null || _jest.availableCustomProperties === void 0 ? void 0 : _jest.availableCustomProperties.find(cp => cp.value === 'MultiRefdata');
|
|
19
24
|
const defaultProps = {
|
|
20
25
|
availableCustomProperties: _jest.availableCustomProperties,
|
|
21
26
|
customProperties: _jest.customProperties,
|
|
@@ -33,30 +38,26 @@ describe('CustomPropertyField', () => {
|
|
|
33
38
|
renderComponent = (0, _jest.renderWithKintHarness)(/*#__PURE__*/(0, _jsxRuntime.jsx)(_stripesErmTesting.TestForm, {
|
|
34
39
|
initialValues: _testResources.initialValues,
|
|
35
40
|
onSubmit: onSubmit,
|
|
36
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_CustomPropertyField.default, {
|
|
37
|
-
...defaultProps,
|
|
41
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_CustomPropertyField.default, _objectSpread(_objectSpread({}, defaultProps), {}, {
|
|
38
42
|
customProperty: authIdentCustom,
|
|
39
43
|
index: 0
|
|
40
|
-
})
|
|
44
|
+
}))
|
|
41
45
|
}));
|
|
42
|
-
const
|
|
43
|
-
getByTestId
|
|
44
|
-
} = renderComponent;
|
|
46
|
+
const _renderComponent = renderComponent,
|
|
47
|
+
getByTestId = _renderComponent.getByTestId;
|
|
45
48
|
expect(getByTestId('customPropertyField')).toBeInTheDocument();
|
|
46
49
|
});
|
|
47
50
|
it('Displays expected value(s) label ', () => {
|
|
48
|
-
const
|
|
49
|
-
getByText
|
|
50
|
-
} = renderComponent;
|
|
51
|
+
const _renderComponent2 = renderComponent,
|
|
52
|
+
getByText = _renderComponent2.getByText;
|
|
51
53
|
expect(getByText('Value(s)')).toBeInTheDocument();
|
|
52
54
|
});
|
|
53
55
|
test('Displays expected Value(s) dropdown values ', () => {
|
|
54
56
|
(0, _stripesErmTesting.MultiSelect)('Value(s)').select(['Not set', 'ORCID', 'Ringgold ID', 'Email Domain', 'Over IP Range', 'FOR ID', 'Other', 'Over Institute']);
|
|
55
57
|
});
|
|
56
58
|
it('Displays expected Internal note label ', () => {
|
|
57
|
-
const
|
|
58
|
-
getByText
|
|
59
|
-
} = renderComponent;
|
|
59
|
+
const _renderComponent3 = renderComponent,
|
|
60
|
+
getByText = _renderComponent3.getByText;
|
|
60
61
|
expect(getByText('Internal note')).toBeInTheDocument();
|
|
61
62
|
});
|
|
62
63
|
test('Displays expected internal note value', async () => {
|
|
@@ -69,9 +70,8 @@ describe('CustomPropertyField', () => {
|
|
|
69
70
|
await (0, _stripesErmTesting.Select)('Visibility').choose('Public');
|
|
70
71
|
});
|
|
71
72
|
it('Displays expected Public note label ', () => {
|
|
72
|
-
const
|
|
73
|
-
getByText
|
|
74
|
-
} = renderComponent;
|
|
73
|
+
const _renderComponent4 = renderComponent,
|
|
74
|
+
getByText = _renderComponent4.getByText;
|
|
75
75
|
expect(getByText('Public note')).toBeInTheDocument();
|
|
76
76
|
});
|
|
77
77
|
test('Displays expected public note value', async () => {
|
|
@@ -85,11 +85,10 @@ describe('CustomPropertyField', () => {
|
|
|
85
85
|
renderComponent = (0, _jest.renderWithKintHarness)(/*#__PURE__*/(0, _jsxRuntime.jsx)(_stripesErmTesting.TestForm, {
|
|
86
86
|
initialValues: _testResources.initialValues,
|
|
87
87
|
onSubmit: onSubmit,
|
|
88
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_CustomPropertyField.default, {
|
|
89
|
-
...defaultProps,
|
|
88
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_CustomPropertyField.default, _objectSpread(_objectSpread({}, defaultProps), {}, {
|
|
90
89
|
customProperty: decimalCustProp,
|
|
91
90
|
index: 2
|
|
92
|
-
})
|
|
91
|
+
}))
|
|
93
92
|
}));
|
|
94
93
|
});
|
|
95
94
|
test('Displays expected Decimal field', async () => {
|
|
@@ -103,11 +102,10 @@ describe('CustomPropertyField', () => {
|
|
|
103
102
|
renderComponent = (0, _jest.renderWithKintHarness)(/*#__PURE__*/(0, _jsxRuntime.jsx)(_stripesErmTesting.TestForm, {
|
|
104
103
|
initialValues: _testResources.initialValues,
|
|
105
104
|
onSubmit: onSubmit,
|
|
106
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_CustomPropertyField.default, {
|
|
107
|
-
...defaultProps,
|
|
105
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_CustomPropertyField.default, _objectSpread(_objectSpread({}, defaultProps), {}, {
|
|
108
106
|
customProperty: integerCustProp,
|
|
109
107
|
index: 3
|
|
110
|
-
})
|
|
108
|
+
}))
|
|
111
109
|
}));
|
|
112
110
|
});
|
|
113
111
|
test('Displays expected integer Field', async () => {
|
|
@@ -123,20 +121,18 @@ describe('CustomPropertyField', () => {
|
|
|
123
121
|
renderComponent = (0, _jest.renderWithKintHarness)(/*#__PURE__*/(0, _jsxRuntime.jsx)(_stripesErmTesting.TestForm, {
|
|
124
122
|
initialValues: _testResources.initialValues,
|
|
125
123
|
onSubmit: onSubmit,
|
|
126
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_CustomPropertyField.default, {
|
|
127
|
-
...defaultProps,
|
|
124
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_CustomPropertyField.default, _objectSpread(_objectSpread({}, defaultProps), {}, {
|
|
128
125
|
customProperty: multiRefdataCustProp,
|
|
129
126
|
index: 4
|
|
130
|
-
})
|
|
127
|
+
}))
|
|
131
128
|
}));
|
|
132
129
|
});
|
|
133
130
|
test('Displays expected multi-select Refdata Field', async () => {
|
|
134
131
|
await (0, _stripesErmTesting.MultiSelect)('Value(s)').exists();
|
|
135
132
|
});
|
|
136
133
|
it('Displays expected value(s) label ', () => {
|
|
137
|
-
const
|
|
138
|
-
getByText
|
|
139
|
-
} = renderComponent;
|
|
134
|
+
const _renderComponent5 = renderComponent,
|
|
135
|
+
getByText = _renderComponent5.getByText;
|
|
140
136
|
expect(getByText('Value(s)')).toBeInTheDocument();
|
|
141
137
|
});
|
|
142
138
|
test('renders multi-select Refdata values', async () => {
|
|
@@ -150,11 +146,10 @@ describe('CustomPropertyField', () => {
|
|
|
150
146
|
renderComponent = (0, _jest.renderWithKintHarness)(/*#__PURE__*/(0, _jsxRuntime.jsx)(_stripesErmTesting.TestForm, {
|
|
151
147
|
initialValues: _testResources.initialValues,
|
|
152
148
|
onSubmit: onSubmit,
|
|
153
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_CustomPropertyField.default, {
|
|
154
|
-
...defaultProps,
|
|
149
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_CustomPropertyField.default, _objectSpread(_objectSpread({}, defaultProps), {}, {
|
|
155
150
|
customProperty: dateCustProp,
|
|
156
151
|
index: 5
|
|
157
|
-
})
|
|
152
|
+
}))
|
|
158
153
|
}));
|
|
159
154
|
});
|
|
160
155
|
test('renders values DatePicker', async () => {
|
|
@@ -11,22 +11,21 @@ var _hooks = require("../../hooks");
|
|
|
11
11
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
12
12
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
13
13
|
const CustomPropertyFormCard = _ref => {
|
|
14
|
-
let
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
labelOverrides = {},
|
|
25
|
-
name,
|
|
26
|
-
onChange,
|
|
27
|
-
setCustomProperties,
|
|
28
|
-
value
|
|
29
|
-
} = _ref;
|
|
14
|
+
let availableCustomProperties = _ref.availableCustomProperties,
|
|
15
|
+
customProperty = _ref.customProperty,
|
|
16
|
+
customPropertyType = _ref.customPropertyType,
|
|
17
|
+
customProperties = _ref.customProperties,
|
|
18
|
+
handleDeleteCustomProperty = _ref.handleDeleteCustomProperty,
|
|
19
|
+
index = _ref.index,
|
|
20
|
+
internalPropertyCounter = _ref.internalPropertyCounter,
|
|
21
|
+
passedIntlKey = _ref.intlKey,
|
|
22
|
+
passedIntlNS = _ref.intlNS,
|
|
23
|
+
_ref$labelOverrides = _ref.labelOverrides,
|
|
24
|
+
labelOverrides = _ref$labelOverrides === void 0 ? {} : _ref$labelOverrides,
|
|
25
|
+
name = _ref.name,
|
|
26
|
+
onChange = _ref.onChange,
|
|
27
|
+
setCustomProperties = _ref.setCustomProperties,
|
|
28
|
+
value = _ref.value;
|
|
30
29
|
const kintIntl = (0, _hooks.useKintIntl)(passedIntlKey, passedIntlNS);
|
|
31
30
|
const getHeader = () => {
|
|
32
31
|
if (customPropertyType === 'optional') {
|
|
@@ -57,18 +56,16 @@ const CustomPropertyFormCard = _ref => {
|
|
|
57
56
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Card, {
|
|
58
57
|
"data-testid": "custom-property-form-card",
|
|
59
58
|
headerEnd: customPropertyType === 'optional' ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Tooltip, {
|
|
60
|
-
id:
|
|
59
|
+
id: "customProperty-".concat(customProperty.value, "-").concat(index),
|
|
61
60
|
text: getTooltipText(),
|
|
62
61
|
children: _ref2 => {
|
|
63
|
-
let
|
|
64
|
-
|
|
65
|
-
ariaIds
|
|
66
|
-
} = _ref2;
|
|
62
|
+
let ref = _ref2.ref,
|
|
63
|
+
ariaIds = _ref2.ariaIds;
|
|
67
64
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.IconButton, {
|
|
68
65
|
ref: ref,
|
|
69
66
|
"aria-labelledby": ariaIds.text,
|
|
70
67
|
icon: "trash",
|
|
71
|
-
id:
|
|
68
|
+
id: "edit-customproperty-".concat(index, "-delete"),
|
|
72
69
|
onClick: () => handleDeleteCustomProperty(customProperty, index)
|
|
73
70
|
});
|
|
74
71
|
}
|
|
@@ -11,7 +11,7 @@ jest.mock('../../hooks');
|
|
|
11
11
|
jest.mock('./CustomPropertyField', () => () => /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
12
12
|
children: "CustomPropertyField"
|
|
13
13
|
}));
|
|
14
|
-
const customProperty = _customProperties.availableCustomProperties
|
|
14
|
+
const customProperty = _customProperties.availableCustomProperties === null || _customProperties.availableCustomProperties === void 0 ? void 0 : _customProperties.availableCustomProperties.find(cp => cp.value === 'AuthorIdentification');
|
|
15
15
|
const onChange = jest.fn();
|
|
16
16
|
const setCustomProperties = jest.fn();
|
|
17
17
|
describe('CustomPropertyFormCard', () => {
|
|
@@ -31,21 +31,18 @@ describe('CustomPropertyFormCard', () => {
|
|
|
31
31
|
}));
|
|
32
32
|
});
|
|
33
33
|
it('displays Author Identification card heading ', () => {
|
|
34
|
-
const
|
|
35
|
-
getByText
|
|
36
|
-
} = renderComponent;
|
|
34
|
+
const _renderComponent = renderComponent,
|
|
35
|
+
getByText = _renderComponent.getByText;
|
|
37
36
|
expect(getByText('Author Identification')).toBeInTheDocument();
|
|
38
37
|
});
|
|
39
38
|
it('renders CustomPropertyField component ', () => {
|
|
40
|
-
const
|
|
41
|
-
getByText
|
|
42
|
-
} = renderComponent;
|
|
39
|
+
const _renderComponent2 = renderComponent,
|
|
40
|
+
getByText = _renderComponent2.getByText;
|
|
43
41
|
expect(getByText('CustomPropertyField')).toBeInTheDocument();
|
|
44
42
|
});
|
|
45
43
|
it('renders CustomPropertyFormCard by its test ID ', () => {
|
|
46
|
-
const
|
|
47
|
-
getByTestId
|
|
48
|
-
} = renderComponent;
|
|
44
|
+
const _renderComponent3 = renderComponent,
|
|
45
|
+
getByTestId = _renderComponent3.getByTestId;
|
|
49
46
|
expect(getByTestId('custom-property-form-card')).toBeInTheDocument();
|
|
50
47
|
});
|
|
51
48
|
});
|
|
@@ -5,22 +5,23 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.value = exports.initialValues = void 0;
|
|
7
7
|
var _jest = require("../../../../test/jest");
|
|
8
|
-
|
|
9
|
-
const
|
|
8
|
+
var _agreementStatusRefda, _agreementStatusRefda2, _licenseAmendmentStat;
|
|
9
|
+
const agreementStatusRefdata = _jest.refdata === null || _jest.refdata === void 0 ? void 0 : _jest.refdata.find(rdc => rdc.desc === 'SubscriptionAgreement.AgreementStatus');
|
|
10
|
+
const licenseAmendmentStatusRefdata = _jest.refdata === null || _jest.refdata === void 0 ? void 0 : _jest.refdata.find(rdc => rdc.desc === 'LicenseAmendmentStatus.Status');
|
|
10
11
|
const value = exports.value = {
|
|
11
12
|
AuthorIdentification: [{
|
|
12
13
|
id: 2,
|
|
13
14
|
internal: true,
|
|
14
15
|
publicNote: 'this is a public note',
|
|
15
16
|
note: 'this is an internal note',
|
|
16
|
-
value: agreementStatusRefdata
|
|
17
|
-
type: _jest.customProperties
|
|
17
|
+
value: agreementStatusRefdata === null || agreementStatusRefdata === void 0 || (_agreementStatusRefda = agreementStatusRefdata.values) === null || _agreementStatusRefda === void 0 ? void 0 : _agreementStatusRefda.find(rdv => rdv.value === 'active'),
|
|
18
|
+
type: _jest.customProperties === null || _jest.customProperties === void 0 ? void 0 : _jest.customProperties.find(cp => cp.name === 'AuthorIdentification')
|
|
18
19
|
}],
|
|
19
20
|
Test: [{
|
|
20
21
|
id: 4,
|
|
21
22
|
internal: true,
|
|
22
|
-
value: agreementStatusRefdata
|
|
23
|
-
type: _jest.customProperties
|
|
23
|
+
value: agreementStatusRefdata === null || agreementStatusRefdata === void 0 || (_agreementStatusRefda2 = agreementStatusRefdata.values) === null || _agreementStatusRefda2 === void 0 ? void 0 : _agreementStatusRefda2.find(rdv => rdv.value === 'active'),
|
|
24
|
+
type: _jest.customProperties === null || _jest.customProperties === void 0 ? void 0 : _jest.customProperties.find(cp => cp.name === 'Test')
|
|
24
25
|
}],
|
|
25
26
|
decimal: [{
|
|
26
27
|
id: 8,
|
|
@@ -28,7 +29,7 @@ const value = exports.value = {
|
|
|
28
29
|
note: 'decimal',
|
|
29
30
|
internal: true,
|
|
30
31
|
value: 1,
|
|
31
|
-
type: _jest.customProperties
|
|
32
|
+
type: _jest.customProperties === null || _jest.customProperties === void 0 ? void 0 : _jest.customProperties.find(cp => cp.name === 'decimal')
|
|
32
33
|
}],
|
|
33
34
|
integer: [{
|
|
34
35
|
id: 6,
|
|
@@ -36,7 +37,7 @@ const value = exports.value = {
|
|
|
36
37
|
note: 'Integer',
|
|
37
38
|
internal: true,
|
|
38
39
|
value: 1,
|
|
39
|
-
type: _jest.customProperties
|
|
40
|
+
type: _jest.customProperties === null || _jest.customProperties === void 0 ? void 0 : _jest.customProperties.find(cp => cp.name === 'integer')
|
|
40
41
|
}],
|
|
41
42
|
text: [{
|
|
42
43
|
id: 7,
|
|
@@ -44,15 +45,15 @@ const value = exports.value = {
|
|
|
44
45
|
note: 'text',
|
|
45
46
|
internal: true,
|
|
46
47
|
value: 'text',
|
|
47
|
-
type: _jest.customProperties
|
|
48
|
+
type: _jest.customProperties === null || _jest.customProperties === void 0 ? void 0 : _jest.customProperties.find(cp => cp.name === 'text')
|
|
48
49
|
}],
|
|
49
50
|
Refdata: [{
|
|
50
51
|
id: 5,
|
|
51
52
|
publicNote: 'refdata',
|
|
52
53
|
note: 'refdata',
|
|
53
54
|
internal: true,
|
|
54
|
-
value: licenseAmendmentStatusRefdata
|
|
55
|
-
type: _jest.customProperties
|
|
55
|
+
value: licenseAmendmentStatusRefdata === null || licenseAmendmentStatusRefdata === void 0 || (_licenseAmendmentStat = licenseAmendmentStatusRefdata.values) === null || _licenseAmendmentStat === void 0 ? void 0 : _licenseAmendmentStat.find(rdv => rdv.value === 'current'),
|
|
56
|
+
type: _jest.customProperties === null || _jest.customProperties === void 0 ? void 0 : _jest.customProperties.find(cp => cp.name === 'Refdata')
|
|
56
57
|
}]
|
|
57
58
|
};
|
|
58
59
|
const initialValues = exports.initialValues = {
|