@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
|
@@ -12,13 +12,13 @@ var _jsxRuntime = require("react/jsx-runtime");
|
|
|
12
12
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
13
13
|
// A default option for CustProp view pane, with the ability to override labels for fields
|
|
14
14
|
const CustomPropertyView = _ref => {
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
helpPopovers,
|
|
18
|
-
intlKey
|
|
19
|
-
intlNS
|
|
20
|
-
labelOverrides =
|
|
21
|
-
|
|
15
|
+
var _customProperty$ctx, _customProperty$categ, _customProperty$categ2;
|
|
16
|
+
let customProperty = _ref.customProperty,
|
|
17
|
+
helpPopovers = _ref.helpPopovers,
|
|
18
|
+
passedIntlKey = _ref.intlKey,
|
|
19
|
+
passedIntlNS = _ref.intlNS,
|
|
20
|
+
_ref$labelOverrides = _ref.labelOverrides,
|
|
21
|
+
labelOverrides = _ref$labelOverrides === void 0 ? {} : _ref$labelOverrides;
|
|
22
22
|
const kintIntl = (0, _hooks.useKintIntl)(passedIntlKey, passedIntlNS);
|
|
23
23
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
24
24
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_components.Row, {
|
|
@@ -28,12 +28,12 @@ const CustomPropertyView = _ref => {
|
|
|
28
28
|
label: /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
29
29
|
children: [kintIntl.formatKintMessage({
|
|
30
30
|
id: 'customProperties.label',
|
|
31
|
-
overrideValue: labelOverrides
|
|
32
|
-
}), helpPopovers
|
|
33
|
-
content: helpPopovers
|
|
31
|
+
overrideValue: labelOverrides === null || labelOverrides === void 0 ? void 0 : labelOverrides.label
|
|
32
|
+
}), helpPopovers !== null && helpPopovers !== void 0 && helpPopovers.label ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.InfoPopover, {
|
|
33
|
+
content: helpPopovers === null || helpPopovers === void 0 ? void 0 : helpPopovers.label
|
|
34
34
|
}) : null]
|
|
35
35
|
}),
|
|
36
|
-
value: customProperty
|
|
36
|
+
value: customProperty === null || customProperty === void 0 ? void 0 : customProperty.label
|
|
37
37
|
})
|
|
38
38
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Col, {
|
|
39
39
|
xs: 6,
|
|
@@ -41,12 +41,12 @@ const CustomPropertyView = _ref => {
|
|
|
41
41
|
label: /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
42
42
|
children: [kintIntl.formatKintMessage({
|
|
43
43
|
id: 'customProperties.name',
|
|
44
|
-
overrideValue: labelOverrides
|
|
45
|
-
}), helpPopovers
|
|
46
|
-
content: helpPopovers
|
|
44
|
+
overrideValue: labelOverrides === null || labelOverrides === void 0 ? void 0 : labelOverrides.name
|
|
45
|
+
}), helpPopovers !== null && helpPopovers !== void 0 && helpPopovers.name ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.InfoPopover, {
|
|
46
|
+
content: helpPopovers === null || helpPopovers === void 0 ? void 0 : helpPopovers.name
|
|
47
47
|
}) : null]
|
|
48
48
|
}),
|
|
49
|
-
value: customProperty
|
|
49
|
+
value: customProperty === null || customProperty === void 0 ? void 0 : customProperty.name
|
|
50
50
|
})
|
|
51
51
|
})]
|
|
52
52
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Row, {
|
|
@@ -55,9 +55,9 @@ const CustomPropertyView = _ref => {
|
|
|
55
55
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.KeyValue, {
|
|
56
56
|
label: kintIntl.formatKintMessage({
|
|
57
57
|
id: 'customProperties.description',
|
|
58
|
-
overrideValue: labelOverrides
|
|
58
|
+
overrideValue: labelOverrides === null || labelOverrides === void 0 ? void 0 : labelOverrides.description
|
|
59
59
|
}),
|
|
60
|
-
value: customProperty
|
|
60
|
+
value: customProperty === null || customProperty === void 0 ? void 0 : customProperty.description
|
|
61
61
|
})
|
|
62
62
|
})
|
|
63
63
|
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_components.Row, {
|
|
@@ -66,11 +66,11 @@ const CustomPropertyView = _ref => {
|
|
|
66
66
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.KeyValue, {
|
|
67
67
|
label: kintIntl.formatKintMessage({
|
|
68
68
|
id: 'customProperties.primary',
|
|
69
|
-
overrideValue: labelOverrides
|
|
69
|
+
overrideValue: labelOverrides === null || labelOverrides === void 0 ? void 0 : labelOverrides.primary
|
|
70
70
|
}),
|
|
71
71
|
value: kintIntl.formatKintMessage({
|
|
72
|
-
id: customProperty
|
|
73
|
-
overrideValue: customProperty
|
|
72
|
+
id: customProperty !== null && customProperty !== void 0 && customProperty.primary ? 'yes' : 'no',
|
|
73
|
+
overrideValue: customProperty !== null && customProperty !== void 0 && customProperty.primary ? labelOverrides.yes : labelOverrides.no
|
|
74
74
|
})
|
|
75
75
|
})
|
|
76
76
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Col, {
|
|
@@ -78,11 +78,11 @@ const CustomPropertyView = _ref => {
|
|
|
78
78
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.KeyValue, {
|
|
79
79
|
label: kintIntl.formatKintMessage({
|
|
80
80
|
id: 'customProperties.retired',
|
|
81
|
-
overrideValue: labelOverrides
|
|
81
|
+
overrideValue: labelOverrides === null || labelOverrides === void 0 ? void 0 : labelOverrides.retired
|
|
82
82
|
}),
|
|
83
83
|
value: kintIntl.formatKintMessage({
|
|
84
|
-
id: customProperty
|
|
85
|
-
overrideValue: customProperty
|
|
84
|
+
id: customProperty !== null && customProperty !== void 0 && customProperty.retired ? 'yes' : 'no',
|
|
85
|
+
overrideValue: customProperty !== null && customProperty !== void 0 && customProperty.retired ? labelOverrides.yes : labelOverrides.no
|
|
86
86
|
})
|
|
87
87
|
})
|
|
88
88
|
})]
|
|
@@ -92,20 +92,20 @@ const CustomPropertyView = _ref => {
|
|
|
92
92
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.KeyValue, {
|
|
93
93
|
label: kintIntl.formatKintMessage({
|
|
94
94
|
id: 'customProperties.weight',
|
|
95
|
-
overrideValue: labelOverrides
|
|
95
|
+
overrideValue: labelOverrides === null || labelOverrides === void 0 ? void 0 : labelOverrides.weight
|
|
96
96
|
}),
|
|
97
|
-
value: customProperty
|
|
97
|
+
value: customProperty === null || customProperty === void 0 ? void 0 : customProperty.weight
|
|
98
98
|
})
|
|
99
99
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Col, {
|
|
100
100
|
xs: 6,
|
|
101
101
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.KeyValue, {
|
|
102
102
|
label: kintIntl.formatKintMessage({
|
|
103
103
|
id: 'customProperties.defaultVisibility',
|
|
104
|
-
overrideValue: labelOverrides
|
|
104
|
+
overrideValue: labelOverrides === null || labelOverrides === void 0 ? void 0 : labelOverrides.defaultVisibility
|
|
105
105
|
}),
|
|
106
106
|
value: kintIntl.formatKintMessage({
|
|
107
|
-
id: customProperty
|
|
108
|
-
overrideValue: customProperty
|
|
107
|
+
id: customProperty !== null && customProperty !== void 0 && customProperty.defaultInternal ? 'customProperties.internalTrue' : 'customProperties.internalFalse',
|
|
108
|
+
overrideValue: customProperty !== null && customProperty !== void 0 && customProperty.defaultInternal ? labelOverrides.internalTrue : labelOverrides.internalFalse
|
|
109
109
|
})
|
|
110
110
|
})
|
|
111
111
|
})]
|
|
@@ -116,35 +116,35 @@ const CustomPropertyView = _ref => {
|
|
|
116
116
|
label: /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
117
117
|
children: [kintIntl.formatKintMessage({
|
|
118
118
|
id: 'customProperties.ctx',
|
|
119
|
-
overrideValue: labelOverrides
|
|
120
|
-
}), helpPopovers
|
|
121
|
-
content: helpPopovers
|
|
119
|
+
overrideValue: labelOverrides === null || labelOverrides === void 0 ? void 0 : labelOverrides.ctx
|
|
120
|
+
}), helpPopovers !== null && helpPopovers !== void 0 && helpPopovers.ctx ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.InfoPopover, {
|
|
121
|
+
content: helpPopovers === null || helpPopovers === void 0 ? void 0 : helpPopovers.ctx
|
|
122
122
|
}) : null]
|
|
123
123
|
}),
|
|
124
|
-
value: customProperty
|
|
124
|
+
value: (_customProperty$ctx = customProperty === null || customProperty === void 0 ? void 0 : customProperty.ctx) !== null && _customProperty$ctx !== void 0 ? _customProperty$ctx : /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.NoValue, {})
|
|
125
125
|
})
|
|
126
126
|
})
|
|
127
127
|
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_components.Row, {
|
|
128
128
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Col, {
|
|
129
129
|
xs: 6,
|
|
130
|
-
children: customProperty
|
|
130
|
+
children: (customProperty === null || customProperty === void 0 ? void 0 : customProperty.type) && /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.KeyValue, {
|
|
131
131
|
label: kintIntl.formatKintMessage({
|
|
132
132
|
id: 'customProperties.type',
|
|
133
|
-
overrideValue: labelOverrides
|
|
133
|
+
overrideValue: labelOverrides === null || labelOverrides === void 0 ? void 0 : labelOverrides.type
|
|
134
134
|
}),
|
|
135
135
|
value: kintIntl.formatKintMessage({
|
|
136
|
-
id:
|
|
137
|
-
overrideValue: labelOverrides
|
|
136
|
+
id: "customProperties.type.".concat(customProperty === null || customProperty === void 0 ? void 0 : customProperty.type),
|
|
137
|
+
overrideValue: labelOverrides === null || labelOverrides === void 0 ? void 0 : labelOverrides[customProperty === null || customProperty === void 0 ? void 0 : customProperty.type]
|
|
138
138
|
})
|
|
139
139
|
})
|
|
140
140
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Col, {
|
|
141
141
|
xs: 6,
|
|
142
|
-
children: (customProperty
|
|
142
|
+
children: ((customProperty === null || customProperty === void 0 ? void 0 : customProperty.type) === _customProperties.REFDATA_CLASS_NAME || (customProperty === null || customProperty === void 0 ? void 0 : customProperty.type) === _customProperties.MULTI_REFDATA_CLASS_NAME) && /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.KeyValue, {
|
|
143
143
|
label: kintIntl.formatKintMessage({
|
|
144
144
|
id: 'customProperties.category',
|
|
145
|
-
overrideValue: labelOverrides
|
|
145
|
+
overrideValue: labelOverrides === null || labelOverrides === void 0 ? void 0 : labelOverrides.category
|
|
146
146
|
}),
|
|
147
|
-
value: customProperty
|
|
147
|
+
value: (_customProperty$categ = customProperty === null || customProperty === void 0 || (_customProperty$categ2 = customProperty.category) === null || _customProperty$categ2 === void 0 ? void 0 : _customProperty$categ2.desc) !== null && _customProperty$categ !== void 0 ? _customProperty$categ : /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.NoValue, {})
|
|
148
148
|
})
|
|
149
149
|
})]
|
|
150
150
|
})]
|
|
@@ -13,7 +13,7 @@ describe('CustomPropertyView', () => {
|
|
|
13
13
|
beforeEach(() => {
|
|
14
14
|
(0, _jest.renderWithKintHarness)(/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactRouterDom.MemoryRouter, {
|
|
15
15
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_CustomPropertyView.default, {
|
|
16
|
-
customProperty: _customProperties.default
|
|
16
|
+
customProperty: _customProperties.default === null || _customProperties.default === void 0 ? void 0 : _customProperties.default.find(cp => cp.name === 'Eligible authors')
|
|
17
17
|
})
|
|
18
18
|
}));
|
|
19
19
|
});
|
|
@@ -9,15 +9,15 @@ var _CustomPropertiesEditCtx = _interopRequireDefault(require("./CustomPropertie
|
|
|
9
9
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
10
10
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
11
11
|
const CustomPropertiesEdit = _ref => {
|
|
12
|
-
let
|
|
13
|
-
contexts = [],
|
|
14
|
-
customPropertiesEndpoint,
|
|
15
|
-
id,
|
|
16
|
-
intlKey
|
|
17
|
-
intlNS
|
|
18
|
-
labelOverrides =
|
|
19
|
-
|
|
20
|
-
|
|
12
|
+
let _ref$contexts = _ref.contexts,
|
|
13
|
+
contexts = _ref$contexts === void 0 ? [] : _ref$contexts,
|
|
14
|
+
customPropertiesEndpoint = _ref.customPropertiesEndpoint,
|
|
15
|
+
id = _ref.id,
|
|
16
|
+
passedIntlKey = _ref.intlKey,
|
|
17
|
+
passedIntlNS = _ref.intlNS,
|
|
18
|
+
_ref$labelOverrides = _ref.labelOverrides,
|
|
19
|
+
labelOverrides = _ref$labelOverrides === void 0 ? {} : _ref$labelOverrides,
|
|
20
|
+
nameOverride = _ref.nameOverride;
|
|
21
21
|
return contexts.map(ctx => /*#__PURE__*/(0, _jsxRuntime.jsx)(_CustomPropertiesEditCtx.default, {
|
|
22
22
|
ctx,
|
|
23
23
|
customPropertiesEndpoint,
|
|
@@ -26,7 +26,7 @@ const CustomPropertiesEdit = _ref => {
|
|
|
26
26
|
intlNS: passedIntlNS,
|
|
27
27
|
labelOverrides,
|
|
28
28
|
nameOverride
|
|
29
|
-
},
|
|
29
|
+
}, "customPropertiesEdit-".concat(ctx)));
|
|
30
30
|
};
|
|
31
31
|
CustomPropertiesEdit.propTypes = {
|
|
32
32
|
contexts: _propTypes.default.arrayOf(_propTypes.default.string),
|
|
@@ -22,9 +22,8 @@ describe('CustomPropertiesEdit', () => {
|
|
|
22
22
|
}));
|
|
23
23
|
});
|
|
24
24
|
it('renders CustomPropertiesEditCtx component ', () => {
|
|
25
|
-
const
|
|
26
|
-
getAllByText
|
|
27
|
-
} = renderComponent;
|
|
25
|
+
const _renderComponent = renderComponent,
|
|
26
|
+
getAllByText = _renderComponent.getAllByText;
|
|
28
27
|
(0, _react2.waitFor)(() => expect(getAllByText('CustomPropertiesEditCtx')).toBeInTheDocument());
|
|
29
28
|
});
|
|
30
29
|
});
|
|
@@ -11,15 +11,14 @@ 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 CustomPropertiesEditCtx = _ref => {
|
|
14
|
-
let
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
labelOverrides = {},
|
|
21
|
-
nameOverride
|
|
22
|
-
} = _ref;
|
|
14
|
+
let ctx = _ref.ctx,
|
|
15
|
+
customPropertiesEndpoint = _ref.customPropertiesEndpoint,
|
|
16
|
+
id = _ref.id,
|
|
17
|
+
passedIntlKey = _ref.intlKey,
|
|
18
|
+
passedIntlNS = _ref.intlNS,
|
|
19
|
+
_ref$labelOverrides = _ref.labelOverrides,
|
|
20
|
+
labelOverrides = _ref$labelOverrides === void 0 ? {} : _ref$labelOverrides,
|
|
21
|
+
nameOverride = _ref.nameOverride;
|
|
23
22
|
const kintIntl = (0, _hooks.useKintIntl)(passedIntlKey, passedIntlNS);
|
|
24
23
|
|
|
25
24
|
// Deal with all the possible label override options
|
|
@@ -35,7 +34,7 @@ const CustomPropertiesEditCtx = _ref => {
|
|
|
35
34
|
// Chain formatKintMessages together using provided fallbackMessage to
|
|
36
35
|
// allow for "If override or translation exists, use it, else use default"
|
|
37
36
|
return kintIntl.formatKintMessage({
|
|
38
|
-
id:
|
|
37
|
+
id: "customProperties.ctx.".concat(ctx),
|
|
39
38
|
overrideValue: labelOverrides[ctx],
|
|
40
39
|
fallbackMessage: kintIntl.formatKintMessage({
|
|
41
40
|
id: 'customProperties.defaultTitle',
|
|
@@ -47,25 +46,24 @@ const CustomPropertiesEditCtx = _ref => {
|
|
|
47
46
|
ctx
|
|
48
47
|
});
|
|
49
48
|
};
|
|
50
|
-
const {
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
});
|
|
49
|
+
const _useCustProps = (0, _hooks.useCustProps)({
|
|
50
|
+
ctx,
|
|
51
|
+
endpoint: customPropertiesEndpoint,
|
|
52
|
+
options: {
|
|
53
|
+
filters: [{
|
|
54
|
+
path: 'retired',
|
|
55
|
+
comparator: '!=',
|
|
56
|
+
value: 'true'
|
|
57
|
+
}]
|
|
58
|
+
}
|
|
59
|
+
}),
|
|
60
|
+
custprops = _useCustProps.custprops,
|
|
61
|
+
isLoading = _useCustProps.isLoading;
|
|
64
62
|
if (isLoading) {
|
|
65
63
|
return null;
|
|
66
64
|
}
|
|
67
65
|
return custprops.length > 0 && /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Accordion, {
|
|
68
|
-
id:
|
|
66
|
+
id: "".concat(id, "-accordion-").concat(ctx),
|
|
69
67
|
label: getAccordionLabel(),
|
|
70
68
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_CustomPropertiesListField.default, {
|
|
71
69
|
ctx: ctx,
|
|
@@ -73,7 +71,7 @@ const CustomPropertiesEditCtx = _ref => {
|
|
|
73
71
|
intlKey: passedIntlKey,
|
|
74
72
|
intlNS: passedIntlNS,
|
|
75
73
|
labelOverrides: labelOverrides,
|
|
76
|
-
name: nameOverride
|
|
74
|
+
name: nameOverride !== null && nameOverride !== void 0 ? nameOverride : 'customProperties'
|
|
77
75
|
})
|
|
78
76
|
});
|
|
79
77
|
};
|
|
@@ -23,9 +23,8 @@ describe('CustomPropertiesEditCtx', () => {
|
|
|
23
23
|
}));
|
|
24
24
|
});
|
|
25
25
|
it('renders CustomPropertiesListField component ', () => {
|
|
26
|
-
const
|
|
27
|
-
getAllByText
|
|
28
|
-
} = renderComponent;
|
|
26
|
+
const _renderComponent = renderComponent,
|
|
27
|
+
getAllByText = _renderComponent.getAllByText;
|
|
29
28
|
(0, _react2.waitFor)(() => expect(getAllByText('CustomPropertiesListField')).toBeInTheDocument());
|
|
30
29
|
});
|
|
31
30
|
});
|
|
@@ -12,25 +12,42 @@ var _components = require("@folio/stripes/components");
|
|
|
12
12
|
var _hooks = require("../../hooks");
|
|
13
13
|
var _CustomPropertyFormCard = _interopRequireDefault(require("./CustomPropertyFormCard"));
|
|
14
14
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
15
|
+
const _excluded = ["ctx", "customProperties", "intlKey", "intlNS", "labelOverrides"];
|
|
15
16
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
17
|
+
function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
|
|
18
|
+
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; }
|
|
19
|
+
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; }
|
|
20
|
+
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; }
|
|
21
|
+
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; }
|
|
22
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
|
23
|
+
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); }
|
|
24
|
+
function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }
|
|
25
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
26
|
+
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
|
|
27
|
+
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
28
|
+
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
29
|
+
function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
|
|
16
30
|
const CustomPropertiesList = _ref => {
|
|
17
|
-
let
|
|
18
|
-
availableCustomProperties = [],
|
|
19
|
-
input
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
labelOverrides = {},
|
|
27
|
-
meta
|
|
28
|
-
pristine
|
|
29
|
-
}
|
|
30
|
-
} = _ref;
|
|
31
|
+
let _ref$availableCustomP = _ref.availableCustomProperties,
|
|
32
|
+
availableCustomProperties = _ref$availableCustomP === void 0 ? [] : _ref$availableCustomP,
|
|
33
|
+
_ref$input = _ref.input,
|
|
34
|
+
name = _ref$input.name,
|
|
35
|
+
onChange = _ref$input.onChange,
|
|
36
|
+
value = _ref$input.value,
|
|
37
|
+
passedIntlKey = _ref.intlKey,
|
|
38
|
+
passedIntlNS = _ref.intlNS,
|
|
39
|
+
_ref$labelOverrides = _ref.labelOverrides,
|
|
40
|
+
labelOverrides = _ref$labelOverrides === void 0 ? {} : _ref$labelOverrides,
|
|
41
|
+
pristine = _ref.meta.pristine;
|
|
31
42
|
const kintIntl = (0, _hooks.useKintIntl)(passedIntlKey, passedIntlNS);
|
|
32
|
-
const
|
|
33
|
-
|
|
43
|
+
const _useState = (0, _react.useState)([]),
|
|
44
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
45
|
+
customProperties = _useState2[0],
|
|
46
|
+
setCustomProperties = _useState2[1]; // This is the list of customProperties we're currently displaying for edit.
|
|
47
|
+
const _useState3 = (0, _react.useState)(false),
|
|
48
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
49
|
+
dirtying = _useState4[0],
|
|
50
|
+
setDirtying = _useState4[1];
|
|
34
51
|
(0, _react.useEffect)(() => {
|
|
35
52
|
// When the user loads this form, we want to init the list of customProperties
|
|
36
53
|
// we're displaying (state.customProperties) with the list of customProperties that have been set
|
|
@@ -47,18 +64,17 @@ const CustomPropertiesList = _ref => {
|
|
|
47
64
|
}
|
|
48
65
|
}, [availableCustomProperties, dirtying, pristine, value]);
|
|
49
66
|
const handleDeleteCustomProperty = (customProperty, i) => {
|
|
50
|
-
|
|
67
|
+
var _value$customProperty, _value$customProperty2;
|
|
68
|
+
const currentValue = (_value$customProperty = (_value$customProperty2 = value[customProperty.value]) === null || _value$customProperty2 === void 0 ? void 0 : _value$customProperty2[0]) !== null && _value$customProperty !== void 0 ? _value$customProperty : {};
|
|
51
69
|
const newCustomProperties = [...customProperties];
|
|
52
70
|
newCustomProperties.splice(i, 1);
|
|
53
71
|
setCustomProperties(newCustomProperties);
|
|
54
72
|
setDirtying(true);
|
|
55
|
-
onChange({
|
|
56
|
-
|
|
57
|
-
[customProperty.value]: [{
|
|
58
|
-
...currentValue,
|
|
73
|
+
onChange(_objectSpread(_objectSpread({}, value), {}, {
|
|
74
|
+
[customProperty.value]: [_objectSpread(_objectSpread({}, currentValue), {}, {
|
|
59
75
|
_delete: true
|
|
60
|
-
}]
|
|
61
|
-
});
|
|
76
|
+
})]
|
|
77
|
+
}));
|
|
62
78
|
};
|
|
63
79
|
const renderCustomProperties = customPropertyType => {
|
|
64
80
|
// This is necessary to track individually since "index" will span primary/optional for a given set
|
|
@@ -82,7 +98,7 @@ const CustomPropertiesList = _ref => {
|
|
|
82
98
|
onChange,
|
|
83
99
|
setCustomProperties,
|
|
84
100
|
value
|
|
85
|
-
},
|
|
101
|
+
}, "customPropertyField-".concat(customProperty.value));
|
|
86
102
|
}).filter(cp => cp !== undefined);
|
|
87
103
|
};
|
|
88
104
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
@@ -131,20 +147,20 @@ const CustomPropertiesList = _ref => {
|
|
|
131
147
|
});
|
|
132
148
|
};
|
|
133
149
|
const CustomPropertiesListField = _ref2 => {
|
|
134
|
-
let
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
labelOverrides = {},
|
|
140
|
-
|
|
141
|
-
} = _ref2;
|
|
150
|
+
let ctx = _ref2.ctx,
|
|
151
|
+
customProperties = _ref2.customProperties,
|
|
152
|
+
passedIntlKey = _ref2.intlKey,
|
|
153
|
+
passedIntlNS = _ref2.intlNS,
|
|
154
|
+
_ref2$labelOverrides = _ref2.labelOverrides,
|
|
155
|
+
labelOverrides = _ref2$labelOverrides === void 0 ? {} : _ref2$labelOverrides,
|
|
156
|
+
fieldProps = _objectWithoutProperties(_ref2, _excluded);
|
|
142
157
|
const fieldRef = (0, _react.useRef)();
|
|
143
158
|
const kintIntl = (0, _hooks.useKintIntl)(passedIntlKey, passedIntlNS);
|
|
144
159
|
|
|
145
160
|
// Map customProperties to bring together the options and the definition values
|
|
146
|
-
const availableCustomProperties = customProperties
|
|
147
|
-
|
|
161
|
+
const availableCustomProperties = customProperties === null || customProperties === void 0 ? void 0 : customProperties.map(customProperty => {
|
|
162
|
+
var _customProperty$categ;
|
|
163
|
+
let options = customProperty === null || customProperty === void 0 || (_customProperty$categ = customProperty.category) === null || _customProperty$categ === void 0 ? void 0 : _customProperty$categ.values;
|
|
148
164
|
if (options) {
|
|
149
165
|
// order by label, add notSet option afterwards
|
|
150
166
|
options = (0, _orderBy.default)(options, 'label');
|
|
@@ -166,9 +182,8 @@ const CustomPropertiesListField = _ref2 => {
|
|
|
166
182
|
defaultInternal: customProperty.defaultInternal
|
|
167
183
|
};
|
|
168
184
|
});
|
|
169
|
-
const
|
|
170
|
-
initialValues
|
|
171
|
-
} = (0, _reactFinalForm.useFormState)();
|
|
185
|
+
const _useFormState = (0, _reactFinalForm.useFormState)(),
|
|
186
|
+
initialValues = _useFormState.initialValues;
|
|
172
187
|
const getInitialValue = () => {
|
|
173
188
|
const cps = {};
|
|
174
189
|
(customProperties || []).filter(cp => cp.primary)
|
|
@@ -183,31 +198,29 @@ const CustomPropertiesListField = _ref2 => {
|
|
|
183
198
|
// IMPORTANT -- All customproperty ctx sections are adding to the same "initialValue" field
|
|
184
199
|
// Ensure that we don't already have initialValues for this particular set before setting them,
|
|
185
200
|
// to ensure no looping behaviour
|
|
186
|
-
if (Object.keys(cps).every(key =>
|
|
201
|
+
if (Object.keys(cps).every(key => {
|
|
202
|
+
var _initialValues$custom;
|
|
203
|
+
return ((_initialValues$custom = initialValues.customProperties) === null || _initialValues$custom === void 0 ? void 0 : _initialValues$custom[key]) !== undefined;
|
|
204
|
+
})) {
|
|
187
205
|
return initialValues.customProperties;
|
|
188
206
|
}
|
|
189
207
|
|
|
190
208
|
// Ensure that if we already had these values in initialvalues they're not overwritten
|
|
191
|
-
return {
|
|
192
|
-
...cps,
|
|
193
|
-
...initialValues.customProperties
|
|
194
|
-
};
|
|
209
|
+
return _objectSpread(_objectSpread({}, cps), initialValues.customProperties);
|
|
195
210
|
};
|
|
196
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactFinalForm.Field, {
|
|
197
|
-
...fieldProps,
|
|
211
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactFinalForm.Field, _objectSpread(_objectSpread({}, fieldProps), {}, {
|
|
198
212
|
initialValue: getInitialValue(),
|
|
199
213
|
render: p => {
|
|
200
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)(CustomPropertiesList, {
|
|
214
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(CustomPropertiesList, _objectSpread({
|
|
201
215
|
ref: fieldRef,
|
|
202
216
|
availableCustomProperties: availableCustomProperties,
|
|
203
217
|
ctx: ctx,
|
|
204
218
|
intlKey: passedIntlKey,
|
|
205
219
|
intlNS: passedIntlNS,
|
|
206
|
-
labelOverrides: labelOverrides
|
|
207
|
-
|
|
208
|
-
});
|
|
220
|
+
labelOverrides: labelOverrides
|
|
221
|
+
}, p));
|
|
209
222
|
}
|
|
210
|
-
});
|
|
223
|
+
}));
|
|
211
224
|
};
|
|
212
225
|
CustomPropertiesListField.propTypes = {
|
|
213
226
|
ctx: _propTypes.default.string,
|
|
@@ -33,15 +33,13 @@ describe('CustomPropertiesListField', () => {
|
|
|
33
33
|
await (0, _stripesErmTesting.KeyValue)('Optional properties').exists();
|
|
34
34
|
});
|
|
35
35
|
it('renders CustomPropertyFormCard component ', () => {
|
|
36
|
-
const
|
|
37
|
-
getAllByText
|
|
38
|
-
} = renderComponent;
|
|
36
|
+
const _renderComponent = renderComponent,
|
|
37
|
+
getAllByText = _renderComponent.getAllByText;
|
|
39
38
|
(0, _react2.waitFor)(() => expect(getAllByText('CustomPropertyFormCard')).toBeInTheDocument());
|
|
40
39
|
});
|
|
41
40
|
it('renders CustomPropertiesList component ', () => {
|
|
42
|
-
const
|
|
43
|
-
getAllByText
|
|
44
|
-
} = renderComponent;
|
|
41
|
+
const _renderComponent2 = renderComponent,
|
|
42
|
+
getAllByText = _renderComponent2.getAllByText;
|
|
45
43
|
(0, _react2.waitFor)(() => expect(getAllByText('CustomPropertiesList')).toBeInTheDocument());
|
|
46
44
|
});
|
|
47
45
|
test('renders the Add property button', async () => {
|