@k-int/stripes-kint-components 5.31.3 → 5.32.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +15 -0
- 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 +33 -26
- package/es/lib/ActionList/ActionListFieldArray.js +119 -103
- package/es/lib/ButtonTypedown/ButtonTypedown.js +72 -17
- package/es/lib/ComboButton/ComboButton.js +47 -42
- package/es/lib/CustomProperties/Config/CustomPropertiesLookup.js +17 -11
- package/es/lib/CustomProperties/Config/CustomPropertiesSettings.js +46 -42
- package/es/lib/CustomProperties/Config/CustomPropertyForm.js +58 -58
- package/es/lib/CustomProperties/Config/CustomPropertyForm.test.js +8 -4
- package/es/lib/CustomProperties/Config/CustomPropertyView.js +33 -32
- package/es/lib/CustomProperties/Config/CustomPropertyView.test.js +1 -1
- package/es/lib/CustomProperties/Edit/CustomPropertiesEdit.js +1 -1
- package/es/lib/CustomProperties/Edit/CustomPropertiesEditCtx.js +3 -3
- package/es/lib/CustomProperties/Edit/CustomPropertiesListField.js +35 -29
- package/es/lib/CustomProperties/Edit/CustomPropertyField.js +59 -61
- package/es/lib/CustomProperties/Edit/CustomPropertyField.test.js +20 -20
- package/es/lib/CustomProperties/Edit/CustomPropertyFormCard.js +2 -2
- package/es/lib/CustomProperties/Edit/CustomPropertyFormCard.test.js +1 -1
- package/es/lib/CustomProperties/Edit/testResources.js +12 -11
- package/es/lib/CustomProperties/Filter/CustomPropertiesFilter.js +33 -22
- package/es/lib/CustomProperties/Filter/CustomPropertiesFilterField.js +37 -24
- package/es/lib/CustomProperties/Filter/CustomPropertiesFilterField.test.js +1 -1
- package/es/lib/CustomProperties/Filter/CustomPropertiesFilterFieldArray.js +6 -6
- package/es/lib/CustomProperties/Filter/CustomPropertiesFilterForm.js +6 -3
- package/es/lib/CustomProperties/Filter/CustomPropertiesFilterForm.test.js +8 -4
- package/es/lib/CustomProperties/Filter/CustomPropertiesRule.js +19 -15
- package/es/lib/CustomProperties/Filter/testResources.js +2 -1
- package/es/lib/CustomProperties/Filter/useParseActiveFilterStrings.js +2 -1
- package/es/lib/CustomProperties/View/CustomPropertiesView.js +1 -1
- package/es/lib/CustomProperties/View/CustomPropertiesViewCtx.js +26 -18
- package/es/lib/CustomProperties/View/CustomPropertiesViewCtx.test.js +6 -3
- package/es/lib/CustomProperties/View/CustomPropertyCard.js +11 -7
- package/es/lib/CycleButton/CycleButton.js +17 -9
- package/es/lib/FormModal/FormModal.js +32 -24
- package/es/lib/FormattedKintMessage/FormattedKintMessage.js +30 -23
- package/es/lib/IconSelect/IconSelect.js +32 -22
- package/es/lib/NoResultsMessage/NoResultsMessage.js +5 -4
- package/es/lib/NumberField/NumberField.js +25 -17
- package/es/lib/NumberField/NumberField.test.js +7 -6
- package/es/lib/QueryTypedown/QueryTypedown.js +15 -8
- package/es/lib/RefdataButtons/RefdataButtons.js +9 -6
- package/es/lib/ResponsiveButtonGroup/ResponsiveButtonGroup.js +60 -48
- package/es/lib/ResponsiveButtonGroup/useResponsiveButtonGroupSizing.js +6 -5
- package/es/lib/RichSelect/RichSelect.js +36 -31
- package/es/lib/RichSelect/useSelectedOption.js +2 -1
- package/es/lib/SASQLookupComponent/SASQLookupComponent.js +94 -91
- package/es/lib/SASQLookupComponent/SASQLookupComponent.test.js +532 -0
- package/es/lib/SASQLookupComponent/TableBody/TableBody.js +58 -43
- package/es/lib/SASQLookupComponent/TableBody/TableBody.test.js +257 -0
- package/es/lib/SASQLookupComponent/__mocks__/SASQLookupComponent.js +33 -0
- package/es/lib/SASQLookupComponent/__mocks__/SASQLookupComponentRender.js +24 -0
- package/es/lib/SASQLookupComponent/__mocks__/index.js +20 -0
- package/es/lib/SASQRoute/SASQRoute.js +29 -25
- package/es/lib/SASQRoute/SASQRoute.test.js +269 -0
- package/es/lib/SASQViewComponent/SASQViewComponent.js +76 -68
- package/es/lib/SASQViewComponent/SASQViewComponent.test.js +108 -0
- package/es/lib/SASQViewComponent/__mocks__/SASQViewComponent.js +19 -0
- package/es/lib/SASQViewComponent/__mocks__/SASQViewComponentRender.js +19 -0
- package/es/lib/SASQViewComponent/__mocks__/index.js +20 -0
- package/es/lib/SearchField/SearchField.js +13 -7
- package/es/lib/SearchKeyControl/SearchKeyControl.js +13 -8
- package/es/lib/SearchKeyControl/SearchKeyControl.test.js +6 -2
- package/es/lib/Settings/EditableRefdataCategoryList/EditableRefdataCategoryList.js +46 -30
- package/es/lib/Settings/EditableRefdataList/EditableRefdataList.js +43 -33
- package/es/lib/Settings/EditableSettingsList/EditableSettingsListFieldArray/EditableSettingsListFieldArray.js +12 -8
- package/es/lib/Settings/EditableSettingsList/SettingField/EditSettingValue/EditSettingValue.js +20 -13
- package/es/lib/Settings/EditableSettingsList/SettingField/RenderSettingValue/RenderSettingValue.js +12 -10
- package/es/lib/Settings/EditableSettingsList/SettingField/SettingField.js +15 -10
- package/es/lib/Settings/EditableSettingsList/SettingField/SettingField.test.js +3 -3
- package/es/lib/Settings/RefdataCategoriesSettings/RefdataCategoriesSettings.js +26 -19
- package/es/lib/Settings/SettingPage/SettingPagePane/SettingPagePane.js +2 -2
- package/es/lib/Settings/Settings/Settings.js +158 -0
- package/es/lib/Settings/Settings/index.js +13 -0
- package/es/lib/Settings/SettingsFormContainer/SettingsFormContainer.js +35 -30
- package/es/lib/Settings/StaticSettingsField/StaticSettingsField.js +8 -5
- package/es/lib/Settings/StaticSettingsField/StaticSettingsFieldComponent/StaticSettingsFieldComponent.js +22 -18
- package/es/lib/Settings/hooks/staticSettingsPages/useSettingCallout/useSettingCallout.js +2 -2
- package/es/lib/Settings/hooks/staticSettingsPages/useSettingsSectionInitalValues/useSettingsSectionInitalValues.js +1 -1
- package/es/lib/Settings/hooks/staticSettingsPages/useStaticSettingsSection.js +7 -3
- package/es/lib/Settings/hooks/useAppSettings/useAppSettings.js +11 -7
- package/es/lib/Settings/hooks/useSettingSection/useSettingSection.js +22 -16
- package/es/lib/Settings/hooks/useSettings/useSettings.js +69 -63
- package/es/lib/Tags/Tags.js +8 -5
- package/es/lib/Tags/hooks/useTags.js +1 -1
- package/es/lib/Tags/hooks/useTagsEnabled.js +3 -2
- package/es/lib/Tags/tagsConfig.js +1 -1
- package/es/lib/Typedown/Typedown.js +31 -21
- package/es/lib/hooks/__mocks__/index.js +7 -3
- package/es/lib/hooks/intlHooks/useIntlKeyStore/useIntlKeyStore.js +26 -20
- package/es/lib/hooks/intlHooks/useKintIntl/useKintIntl.js +34 -24
- package/es/lib/hooks/typedownHooks/useTypedown.js +12 -11
- package/es/lib/hooks/typedownHooks/useTypedownToggle.js +2 -2
- package/es/lib/hooks/useActionListRef.js +1 -1
- package/es/lib/hooks/useActiveElement.js +1 -1
- package/es/lib/hooks/useCustomProperties.js +10 -6
- package/es/lib/hooks/useHelperApp.js +16 -13
- package/es/lib/hooks/useKiwtFieldArray.js +8 -7
- package/es/lib/hooks/useKiwtSASQuery.js +19 -15
- package/es/lib/hooks/useLocalPageStore.js +10 -7
- package/es/lib/hooks/useModConfigEntries.js +2 -2
- package/es/lib/hooks/useMutateCustomProperties/useMutateCustomProperties.js +17 -10
- package/es/lib/hooks/useMutateGeneric/useMutateGeneric.js +2 -2
- package/es/lib/hooks/useMutateModConfigEntry.js +2 -2
- package/es/lib/hooks/useMutateRefdataCategory/useMutateRefdataCategory.js +21 -15
- package/es/lib/hooks/useMutateRefdataValue/useMutateRefdataValue.js +23 -16
- package/es/lib/hooks/usePrevNextPagination.js +19 -17
- package/es/lib/hooks/useQIndex.js +14 -11
- package/es/lib/hooks/useRefdata.js +3 -3
- package/es/lib/hooks/useStandaloneSASQQueryParameter/useStandaloneSASQQueryParameter.js +13 -9
- package/es/lib/hooks/useTemplates.js +4 -4
- package/es/lib/utils/buildUrl.js +3 -2
- 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 +107 -94
- package/es/lib/utils/groupCustomPropertiesByCtx.js +9 -5
- package/es/lib/utils/matchString.js +7 -5
- package/es/lib/utils/parseErrorResponse.js +7 -3
- package/es/lib/utils/selectorSafe.js +3 -2
- package/es/lib/utils/sortByLabel.js +3 -2
- package/es/lib/validators/validators.js +9 -6
- package/package.json +5 -1
- package/src/artifacts/coverage-jest/ActionList/ActionList.js.html +4 -4
- package/src/artifacts/coverage-jest/ActionList/ActionListFieldArray.js.html +10 -10
- 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 +217 -25
- package/src/artifacts/coverage-jest/ButtonTypedown/index.html +17 -17
- package/src/artifacts/coverage-jest/ButtonTypedown/index.js.html +1 -1
- package/src/artifacts/coverage-jest/ComboButton/ComboButton.js.html +3 -3
- 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 +3 -3
- package/src/artifacts/coverage-jest/CustomProperties/Config/CustomPropertiesSettings.js.html +6 -6
- package/src/artifacts/coverage-jest/CustomProperties/Config/CustomPropertyForm.js.html +3 -3
- package/src/artifacts/coverage-jest/CustomProperties/Config/CustomPropertyView.js.html +3 -3
- 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 +3 -3
- package/src/artifacts/coverage-jest/CustomProperties/Edit/CustomPropertiesEditCtx.js.html +3 -3
- package/src/artifacts/coverage-jest/CustomProperties/Edit/CustomPropertiesListField.js.html +5 -5
- package/src/artifacts/coverage-jest/CustomProperties/Edit/CustomPropertyField.js.html +3 -3
- package/src/artifacts/coverage-jest/CustomProperties/Edit/CustomPropertyFormCard.js.html +3 -3
- 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 +3 -3
- package/src/artifacts/coverage-jest/CustomProperties/Filter/CustomPropertiesFilterField.js.html +3 -3
- package/src/artifacts/coverage-jest/CustomProperties/Filter/CustomPropertiesFilterFieldArray.js.html +3 -3
- package/src/artifacts/coverage-jest/CustomProperties/Filter/CustomPropertiesFilterForm.js.html +3 -3
- package/src/artifacts/coverage-jest/CustomProperties/Filter/CustomPropertiesRule.js.html +4 -4
- 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 +3 -3
- package/src/artifacts/coverage-jest/CustomProperties/Filter/useParseActiveFilterStrings.js.html +2 -2
- package/src/artifacts/coverage-jest/CustomProperties/Filter/useValueProps.js.html +3 -3
- package/src/artifacts/coverage-jest/CustomProperties/View/CustomPropertiesView.js.html +3 -3
- package/src/artifacts/coverage-jest/CustomProperties/View/CustomPropertiesViewCtx.js.html +3 -3
- package/src/artifacts/coverage-jest/CustomProperties/View/CustomPropertyCard.js.html +3 -3
- 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 +3 -3
- 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 +2 -2
- 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/FormModal/FormModal.js.html +3 -3
- 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 +3 -3
- 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 +3 -3
- 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 +3 -3
- 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 +3 -3
- 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 +3 -3
- package/src/artifacts/coverage-jest/QueryTypedown/index.html +1 -1
- package/src/artifacts/coverage-jest/QueryTypedown/index.js.html +1 -1
- package/src/artifacts/coverage-jest/RefdataButtons/RefdataButtons.js.html +3 -3
- 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 +6 -6
- 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 +2 -2
- package/src/artifacts/coverage-jest/RichSelect/RichSelect.js.html +3 -3
- 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 +2 -2
- package/src/artifacts/coverage-jest/SASQLookupComponent/SASQLookupComponent.js.html +146 -149
- package/src/artifacts/coverage-jest/SASQLookupComponent/TableBody/TableBody.js.html +74 -65
- package/src/artifacts/coverage-jest/SASQLookupComponent/TableBody/index.html +21 -21
- package/src/artifacts/coverage-jest/SASQLookupComponent/TableBody/index.js.html +1 -1
- package/src/artifacts/coverage-jest/SASQLookupComponent/index.html +21 -21
- package/src/artifacts/coverage-jest/SASQLookupComponent/index.js.html +1 -1
- package/src/artifacts/coverage-jest/SASQRoute/SASQRoute.js.html +43 -43
- package/src/artifacts/coverage-jest/SASQRoute/index.html +21 -21
- package/src/artifacts/coverage-jest/SASQRoute/index.js.html +1 -1
- package/src/artifacts/coverage-jest/SASQViewComponent/SASQViewComponent.js.html +42 -42
- package/src/artifacts/coverage-jest/SASQViewComponent/index.html +21 -21
- package/src/artifacts/coverage-jest/SASQViewComponent/index.js.html +1 -1
- package/src/artifacts/coverage-jest/SearchField/SearchField.js.html +4 -4
- 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 +3 -3
- 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 +4 -4
- 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 +4 -4
- 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 +3 -3
- package/src/artifacts/coverage-jest/Settings/EditableSettingsList/EditableSettingsListFieldArray/EditableSettingsListFieldArray.js.html +5 -5
- 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 +3 -3
- 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 +3 -3
- 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 +3 -3
- 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 +4 -4
- 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 +3 -3
- package/src/artifacts/coverage-jest/Settings/SettingPage/SettingPagePane/SettingPagePane.js.html +3 -3
- 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 +643 -0
- package/src/artifacts/coverage-jest/Settings/Settings/index.html +131 -0
- package/src/artifacts/coverage-jest/Settings/Settings/index.js.html +88 -0
- package/src/artifacts/coverage-jest/Settings/SettingsFormContainer/SettingsFormContainer.js.html +3 -3
- 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 +3 -3
- package/src/artifacts/coverage-jest/Settings/StaticSettingsField/StaticSettingsFieldComponent/StaticSettingsFieldComponent.js.html +2 -2
- package/src/artifacts/coverage-jest/Settings/StaticSettingsField/StaticSettingsFieldComponent/index.html +1 -1
- package/src/artifacts/coverage-jest/Settings/StaticSettingsField/StaticSettingsFieldComponent/index.js.html +1 -1
- package/src/artifacts/coverage-jest/Settings/StaticSettingsField/index.html +1 -1
- 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 +5 -5
- package/src/artifacts/coverage-jest/Settings/contexts/SettingsContext.js.html +2 -2
- 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 +2 -2
- 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 +2 -2
- package/src/artifacts/coverage-jest/Settings/hooks/staticSettingsPages/useStaticSettingsSection.js.html +2 -2
- 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 +2 -2
- 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 +2 -2
- package/src/artifacts/coverage-jest/Settings/hooks/useSettings/index.html +12 -12
- package/src/artifacts/coverage-jest/Settings/hooks/useSettings/index.js.html +1 -1
- package/src/artifacts/coverage-jest/Settings/hooks/useSettings/useSettings.js.html +33 -15
- 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 +3 -3
- 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 +2 -2
- package/src/artifacts/coverage-jest/Tags/hooks/useTagsEnabled.js.html +8 -8
- 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 +5 -5
- package/src/artifacts/coverage-jest/Typedown/Typedown.js.html +15 -6
- 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 +1006 -839
- package/src/artifacts/coverage-jest/constants/comparators.js.html +1 -1
- package/src/artifacts/coverage-jest/constants/customProperties.js.html +12 -12
- package/src/artifacts/coverage-jest/constants/endpoints.js.html +4 -4
- package/src/artifacts/coverage-jest/constants/eventCodes.js.html +4 -4
- package/src/artifacts/coverage-jest/constants/index.html +1 -1
- package/src/artifacts/coverage-jest/constants/pagination.js.html +6 -6
- package/src/artifacts/coverage-jest/hooks/index.html +51 -51
- 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 +8 -8
- 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 +12 -12
- 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 +10 -10
- 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 +2 -2
- package/src/artifacts/coverage-jest/hooks/typedownHooks/useTypedownData.js.html +2 -2
- package/src/artifacts/coverage-jest/hooks/typedownHooks/useTypedownToggle.js.html +2 -2
- package/src/artifacts/coverage-jest/hooks/useActionListRef.js.html +2 -2
- package/src/artifacts/coverage-jest/hooks/useActiveElement.js.html +2 -2
- package/src/artifacts/coverage-jest/hooks/useCustomProperties.js.html +3 -3
- package/src/artifacts/coverage-jest/hooks/useHelperApp.js.html +2 -2
- 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 +2 -2
- package/src/artifacts/coverage-jest/hooks/useKiwtSASQuery.js.html +48 -48
- package/src/artifacts/coverage-jest/hooks/useLocalPageStore.js.html +3 -3
- package/src/artifacts/coverage-jest/hooks/useLocalStorageState.js.html +22 -22
- package/src/artifacts/coverage-jest/hooks/useModConfigEntries.js.html +3 -3
- package/src/artifacts/coverage-jest/hooks/useMutateCustomProperties/index.html +1 -1
- package/src/artifacts/coverage-jest/hooks/useMutateCustomProperties/index.js.html +1 -1
- package/src/artifacts/coverage-jest/hooks/useMutateCustomProperties/useMutateCustomProperties.js.html +2 -2
- package/src/artifacts/coverage-jest/hooks/useMutateGeneric/index.html +1 -1
- package/src/artifacts/coverage-jest/hooks/useMutateGeneric/index.js.html +5 -2
- package/src/artifacts/coverage-jest/hooks/useMutateGeneric/useMutateGeneric.js.html +2 -2
- package/src/artifacts/coverage-jest/hooks/useMutateModConfigEntry.js.html +2 -2
- package/src/artifacts/coverage-jest/hooks/useMutateRefdataCategory/index.html +1 -1
- package/src/artifacts/coverage-jest/hooks/useMutateRefdataCategory/index.js.html +1 -1
- package/src/artifacts/coverage-jest/hooks/useMutateRefdataCategory/useMutateRefdataCategory.js.html +2 -2
- package/src/artifacts/coverage-jest/hooks/useMutateRefdataValue/index.html +1 -1
- package/src/artifacts/coverage-jest/hooks/useMutateRefdataValue/index.js.html +1 -1
- package/src/artifacts/coverage-jest/hooks/useMutateRefdataValue/useMutateRefdataValue.js.html +2 -2
- package/src/artifacts/coverage-jest/hooks/usePrevNextPagination.js.html +68 -68
- package/src/artifacts/coverage-jest/hooks/useQIndex.js.html +28 -28
- package/src/artifacts/coverage-jest/hooks/useRefdata.js.html +3 -3
- package/src/artifacts/coverage-jest/hooks/useSASQQueryMeta.js.html +2 -2
- 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 +2 -2
- package/src/artifacts/coverage-jest/hooks/useTemplates.js.html +2 -2
- package/src/artifacts/coverage-jest/index.html +115 -100
- package/src/artifacts/coverage-jest/utils/buildUrl.js.html +34 -34
- 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 +67 -67
- 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/highlightString.js.html +3 -3
- package/src/artifacts/coverage-jest/utils/index.html +22 -22
- package/src/artifacts/coverage-jest/utils/index.js.html +1 -1
- package/src/artifacts/coverage-jest/utils/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/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 +8 -8
- package/src/lib/ButtonTypedown/ButtonTypedown.js +77 -13
- package/src/lib/SASQLookupComponent/SASQLookupComponent.js +3 -4
- package/src/lib/SASQLookupComponent/SASQLookupComponent.test.js +495 -0
- package/src/lib/SASQLookupComponent/TableBody/TableBody.js +6 -3
- package/src/lib/SASQLookupComponent/TableBody/TableBody.test.js +247 -0
- package/src/lib/SASQLookupComponent/__mocks__/SASQLookupComponent.js +31 -0
- package/src/lib/SASQLookupComponent/__mocks__/SASQLookupComponentRender.js +20 -0
- package/src/lib/SASQLookupComponent/__mocks__/index.js +2 -0
- package/src/lib/SASQRoute/SASQRoute.test.js +281 -0
- package/src/lib/SASQViewComponent/SASQViewComponent.test.js +114 -0
- package/src/lib/SASQViewComponent/__mocks__/SASQViewComponent.js +13 -0
- package/src/lib/SASQViewComponent/__mocks__/SASQViewComponentRender.js +17 -0
- package/src/lib/SASQViewComponent/__mocks__/index.js +2 -0
- package/src/lib/Settings/EditableSettingsList/EditableSettingsListFieldArray/EditableSettingsListFieldArray.js +1 -1
- package/src/lib/Settings/Settings/Settings.js +186 -0
- package/src/lib/Settings/Settings/index.js +1 -0
- package/src/lib/Settings/hooks/useSettings/useSettings.js +13 -7
- package/src/lib/Typedown/Typedown.js +4 -1
- package/src/lib/hooks/useMutateGeneric/index.js +1 -1
- package/styles/TypeDown.css +2 -2
- package/test/helpers/test-implementor-translations.json +2 -1
- package/test/helpers/translationsProperties.js +1 -1
- package/test/jest/setupTests.js +1 -1
|
@@ -12,19 +12,28 @@ var _useParseActiveFilterStrings = _interopRequireDefault(require("./useParseAct
|
|
|
12
12
|
var _CustomPropertiesFilterForm = _interopRequireDefault(require("./CustomPropertiesFilterForm"));
|
|
13
13
|
var _customProperties = require("../../constants/customProperties");
|
|
14
14
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
15
|
+
const _excluded = ["customProperties"];
|
|
15
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); }
|
|
22
|
+
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; }
|
|
23
|
+
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; }
|
|
16
24
|
const CustomPropertiesFilter = _ref => {
|
|
25
|
+
var _parsedFilterData$num, _parsedFilterData$num2;
|
|
17
26
|
let {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
27
|
+
activeFilters: {
|
|
28
|
+
customProperties: custPropFilters
|
|
29
|
+
},
|
|
30
|
+
customPropertiesEndpoint,
|
|
31
|
+
filterHandlers,
|
|
32
|
+
intlKey: passedIntlKey,
|
|
33
|
+
intlNS: passedIntlNS,
|
|
34
|
+
labelOverrides = {}
|
|
35
|
+
} = _ref,
|
|
36
|
+
restOfFilters = _objectWithoutProperties(_ref.activeFilters, _excluded);
|
|
28
37
|
const [editingFilters, setEditingFilters] = (0, _react.useState)(false);
|
|
29
38
|
const openEditModal = () => setEditingFilters(true);
|
|
30
39
|
const closeEditModal = () => setEditingFilters(false);
|
|
@@ -73,30 +82,32 @@ const CustomPropertiesFilter = _ref => {
|
|
|
73
82
|
filters = []
|
|
74
83
|
} = values;
|
|
75
84
|
const filterStrings = filters.filter(filter => filter.rules).map(filter => {
|
|
76
|
-
|
|
77
|
-
const
|
|
78
|
-
|
|
85
|
+
var _custprops$filter$, _custprops$filter;
|
|
86
|
+
const relevantCustomProperty = (_custprops$filter$ = custprops === null || custprops === void 0 || (_custprops$filter = custprops.filter(cp => cp.name === filter.customProperty)) === null || _custprops$filter === void 0 ? void 0 : _custprops$filter[0]) !== null && _custprops$filter$ !== void 0 ? _custprops$filter$ : {};
|
|
87
|
+
const filterByValueId = (relevantCustomProperty === null || relevantCustomProperty === void 0 ? void 0 : relevantCustomProperty.type) === _customProperties.MULTI_REFDATA_CLASS_NAME || (relevantCustomProperty === null || relevantCustomProperty === void 0 ? void 0 : relevantCustomProperty.type) === _customProperties.REFDATA_CLASS_NAME;
|
|
88
|
+
return filter.rules.map(rule => {
|
|
89
|
+
var _rule$value;
|
|
90
|
+
return "customProperties.".concat(filter.customProperty, ".value").concat(filterByValueId ? '.id' : '').concat(rule.operator).concat((_rule$value = rule.value) !== null && _rule$value !== void 0 ? _rule$value : '');
|
|
91
|
+
}).join('||');
|
|
79
92
|
});
|
|
80
|
-
filterHandlers.state({
|
|
81
|
-
...restOfFilters,
|
|
93
|
+
filterHandlers.state(_objectSpread(_objectSpread({}, restOfFilters), {}, {
|
|
82
94
|
customProperties: filterStrings
|
|
83
|
-
});
|
|
95
|
+
}));
|
|
84
96
|
setEditingFilters(false);
|
|
85
97
|
return Promise.resolve();
|
|
86
98
|
};
|
|
87
99
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_components.Accordion, {
|
|
88
100
|
closedByDefault: true,
|
|
89
|
-
displayClearButton: (parsedFilterData
|
|
101
|
+
displayClearButton: ((_parsedFilterData$num = parsedFilterData === null || parsedFilterData === void 0 ? void 0 : parsedFilterData.numberOfFilters) !== null && _parsedFilterData$num !== void 0 ? _parsedFilterData$num : 0) > 0,
|
|
90
102
|
header: _components.FilterAccordionHeader,
|
|
91
103
|
id: "clickable-custprop-filter",
|
|
92
104
|
label: kintIntl.formatKintMessage({
|
|
93
105
|
id: 'customProperties',
|
|
94
106
|
overrideValue: labelOverrides.customProperties
|
|
95
107
|
}),
|
|
96
|
-
onClearFilter: () => filterHandlers.state({
|
|
97
|
-
...restOfFilters,
|
|
108
|
+
onClearFilter: () => filterHandlers.state(_objectSpread(_objectSpread({}, restOfFilters), {}, {
|
|
98
109
|
customProperties: []
|
|
99
|
-
}),
|
|
110
|
+
})),
|
|
100
111
|
separator: false,
|
|
101
112
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Layout, {
|
|
102
113
|
className: "padding-bottom-gutter",
|
|
@@ -104,12 +115,12 @@ const CustomPropertiesFilter = _ref => {
|
|
|
104
115
|
id: 'customProperty.filtersApplied',
|
|
105
116
|
overrideValue: labelOverrides.filtersApplied
|
|
106
117
|
}, {
|
|
107
|
-
count: parsedFilterData
|
|
118
|
+
count: (_parsedFilterData$num2 = parsedFilterData === null || parsedFilterData === void 0 ? void 0 : parsedFilterData.numberOfFilters) !== null && _parsedFilterData$num2 !== void 0 ? _parsedFilterData$num2 : 0
|
|
108
119
|
})
|
|
109
120
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_CustomPropertiesFilterForm.default, {
|
|
110
121
|
customProperties: custprops,
|
|
111
122
|
editingFilters: editingFilters,
|
|
112
|
-
filters: parsedFilterData
|
|
123
|
+
filters: parsedFilterData === null || parsedFilterData === void 0 ? void 0 : parsedFilterData.filters,
|
|
113
124
|
handlers: {
|
|
114
125
|
closeEditModal,
|
|
115
126
|
openEditModal
|
|
@@ -14,7 +14,13 @@ var _CustomPropertiesRule = _interopRequireDefault(require("./CustomPropertiesRu
|
|
|
14
14
|
var _hooks = require("../../hooks");
|
|
15
15
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
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 CustomPropertiesFilterField = _ref => {
|
|
23
|
+
var _customProperties$fin, _customProperties$fin2, _fields$value$index2;
|
|
18
24
|
let {
|
|
19
25
|
customProperties = [],
|
|
20
26
|
fields,
|
|
@@ -37,24 +43,25 @@ const CustomPropertiesFilterField = _ref => {
|
|
|
37
43
|
const kintIntl = (0, _hooks.useKintIntl)(passedIntlKey, passedIntlNS);
|
|
38
44
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
39
45
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactFinalForm.Field, {
|
|
40
|
-
id:
|
|
46
|
+
id: "input-custprop-".concat(index),
|
|
41
47
|
label: kintIntl.formatKintMessage({
|
|
42
48
|
id: 'customProperty',
|
|
43
49
|
overrideValue: labelOverrides.customProperty
|
|
44
50
|
}),
|
|
45
|
-
name:
|
|
51
|
+
name: "".concat(name, ".customProperty"),
|
|
46
52
|
placeholder: " ",
|
|
47
53
|
render: fieldProps => {
|
|
48
|
-
|
|
54
|
+
var _Object$entries;
|
|
55
|
+
const sortedGroupedCustProps = (_Object$entries = Object.entries(groupedCustomProperties)) === null || _Object$entries === void 0 ? void 0 : _Object$entries.sort((a, b) => {
|
|
49
56
|
if (a[0] === 'isNull') return -1; // Make sure noContext is at top
|
|
50
57
|
|
|
51
58
|
if (a[0].toLowerCase() < b[0].toLowerCase()) return -1;
|
|
52
59
|
if (a[0].toLowerCase() > b[0].toLowerCase()) return 1;
|
|
53
60
|
return 0;
|
|
54
61
|
});
|
|
55
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_components.Select, {
|
|
56
|
-
autoFocus: true
|
|
57
|
-
|
|
62
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_components.Select, _objectSpread(_objectSpread({
|
|
63
|
+
autoFocus: true
|
|
64
|
+
}, fieldProps), {}, {
|
|
58
65
|
placeholder: null // placeholder default causes issues
|
|
59
66
|
,
|
|
60
67
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("option", {
|
|
@@ -75,19 +82,22 @@ const CustomPropertiesFilterField = _ref => {
|
|
|
75
82
|
}) : v.label
|
|
76
83
|
}, v.id);
|
|
77
84
|
})
|
|
78
|
-
},
|
|
85
|
+
}, "custom-property-optgroup-".concat(key));
|
|
79
86
|
})]
|
|
80
|
-
});
|
|
87
|
+
}));
|
|
81
88
|
},
|
|
82
89
|
required: true,
|
|
83
90
|
validate: _validators.required
|
|
84
91
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
85
|
-
"data-testid":
|
|
86
|
-
id:
|
|
92
|
+
"data-testid": "selected-custprop-name-".concat(index),
|
|
93
|
+
id: "selected-custprop-name-".concat(index),
|
|
87
94
|
style: {
|
|
88
95
|
display: 'none'
|
|
89
96
|
},
|
|
90
|
-
children: customProperties.find(t =>
|
|
97
|
+
children: (_customProperties$fin = (_customProperties$fin2 = customProperties.find(t => {
|
|
98
|
+
var _fields$value$index;
|
|
99
|
+
return t.name === ((_fields$value$index = fields.value[index]) === null || _fields$value$index === void 0 ? void 0 : _fields$value$index.customProperty);
|
|
100
|
+
})) === null || _customProperties$fin2 === void 0 ? void 0 : _customProperties$fin2.label) !== null && _customProperties$fin !== void 0 ? _customProperties$fin : ''
|
|
91
101
|
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_components.Row, {
|
|
92
102
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Col, {
|
|
93
103
|
xs: 2
|
|
@@ -115,26 +125,29 @@ const CustomPropertiesFilterField = _ref => {
|
|
|
115
125
|
xs: 2
|
|
116
126
|
})]
|
|
117
127
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactFinalFormArrays.FieldArray, {
|
|
118
|
-
name:
|
|
128
|
+
name: "".concat(name, ".rules"),
|
|
119
129
|
children: _ref3 => {
|
|
120
130
|
let {
|
|
121
131
|
fields: ruleFields
|
|
122
132
|
} = _ref3;
|
|
123
|
-
return ruleFields.map((ruleFieldName, ruleFieldIndex) =>
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
+
return ruleFields.map((ruleFieldName, ruleFieldIndex) => {
|
|
134
|
+
var _values$filters$index;
|
|
135
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_CustomPropertiesRule.default, {
|
|
136
|
+
ariaLabelledby: "selected-custprop-name-".concat(index),
|
|
137
|
+
clearRuleValue: () => change("filters[".concat(index, "].rules[").concat(ruleFieldIndex, "].value"), ''),
|
|
138
|
+
custPropDefinition: customProperties.find(t => t.name === fields.value[index].customProperty),
|
|
139
|
+
index: ruleFieldIndex,
|
|
140
|
+
labelOverrides: labelOverrides,
|
|
141
|
+
name: ruleFieldName,
|
|
142
|
+
onDelete: () => ruleFields.remove(ruleFieldIndex),
|
|
143
|
+
value: (_values$filters$index = values.filters[index]) === null || _values$filters$index === void 0 ? void 0 : _values$filters$index.rules[ruleFieldIndex]
|
|
144
|
+
}, ruleFieldName);
|
|
145
|
+
});
|
|
133
146
|
}
|
|
134
147
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Button, {
|
|
135
148
|
"data-test-add-rule-btn": true,
|
|
136
|
-
disabled: !fields.value[index]
|
|
137
|
-
onClick: () => push(
|
|
149
|
+
disabled: !((_fields$value$index2 = fields.value[index]) !== null && _fields$value$index2 !== void 0 && _fields$value$index2.customProperty),
|
|
150
|
+
onClick: () => push("".concat(name, ".rules")),
|
|
138
151
|
children: kintIntl.formatKintMessage({
|
|
139
152
|
id: 'addRule',
|
|
140
153
|
overrideValue: labelOverrides.addRule
|
|
@@ -36,7 +36,7 @@ const CustomPropertiesFilterFieldArray = _ref => {
|
|
|
36
36
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
37
37
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Card, {
|
|
38
38
|
headerEnd: /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Tooltip, {
|
|
39
|
-
id:
|
|
39
|
+
id: "custom-property-filter-card-delete-[".concat(index, "]-tooltip"),
|
|
40
40
|
text: kintIntl.formatKintMessage({
|
|
41
41
|
id: 'customProperty.removeFilter',
|
|
42
42
|
overrideValue: labelOverrides.removeFilter
|
|
@@ -52,7 +52,7 @@ const CustomPropertiesFilterFieldArray = _ref => {
|
|
|
52
52
|
ref: ref,
|
|
53
53
|
"aria-labelledby": ariaIds.text,
|
|
54
54
|
icon: "trash",
|
|
55
|
-
id:
|
|
55
|
+
id: "custom-property-filter-card-delete-[".concat(index, "]"),
|
|
56
56
|
onClick: () => fields.remove(index)
|
|
57
57
|
});
|
|
58
58
|
}
|
|
@@ -72,15 +72,15 @@ const CustomPropertiesFilterFieldArray = _ref => {
|
|
|
72
72
|
index: index,
|
|
73
73
|
labelOverrides: labelOverrides,
|
|
74
74
|
name: name
|
|
75
|
-
},
|
|
76
|
-
},
|
|
75
|
+
}, "custom-property-filter-field-".concat(name, "[").concat(index, "]"))
|
|
76
|
+
}, "custom-property-filter-card[".concat(index, "]")), index < fields.value.length - 1 && /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Layout, {
|
|
77
77
|
className: "textCentered",
|
|
78
78
|
children: kintIntl.formatKintMessage({
|
|
79
79
|
id: 'AND',
|
|
80
80
|
overrideValue: labelOverrides.AND
|
|
81
81
|
})
|
|
82
|
-
},
|
|
83
|
-
},
|
|
82
|
+
}, "custom-property-filter[".concat(index, "]-AND"))]
|
|
83
|
+
}, "custom-property-filter-card[".concat(index, "]-container"));
|
|
84
84
|
});
|
|
85
85
|
}
|
|
86
86
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Button, {
|
|
@@ -12,6 +12,11 @@ var _CustomPropertiesFilterFieldArray = _interopRequireDefault(require("./Custom
|
|
|
12
12
|
var _hooks = require("../../hooks");
|
|
13
13
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
14
14
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
15
|
+
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; }
|
|
16
|
+
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; }
|
|
17
|
+
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; }
|
|
18
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
|
19
|
+
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); }
|
|
15
20
|
const CustomPropertyFiltersForm = _ref => {
|
|
16
21
|
let {
|
|
17
22
|
customProperties,
|
|
@@ -57,9 +62,7 @@ const CustomPropertyFiltersForm = _ref => {
|
|
|
57
62
|
open: editingFilters,
|
|
58
63
|
size: 'medium'
|
|
59
64
|
},
|
|
60
|
-
mutators: {
|
|
61
|
-
..._finalFormArrays.default
|
|
62
|
-
},
|
|
65
|
+
mutators: _objectSpread({}, _finalFormArrays.default),
|
|
63
66
|
onSubmit: onSubmit,
|
|
64
67
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_CustomPropertiesFilterFieldArray.default, {
|
|
65
68
|
customProperties: customProperties,
|
|
@@ -7,6 +7,11 @@ var _testResources = require("./testResources");
|
|
|
7
7
|
var _jest = require("../../../../test/jest");
|
|
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
|
jest.mock('../../hooks');
|
|
11
16
|
jest.mock('./CustomPropertiesFilterFieldArray', () => () => /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
12
17
|
children: "CustomPropertiesFilterFieldArray"
|
|
@@ -15,10 +20,9 @@ const onSubmit = jest.fn();
|
|
|
15
20
|
describe('CustomPropertyFiltersForm', () => {
|
|
16
21
|
let renderComponent;
|
|
17
22
|
beforeEach(() => {
|
|
18
|
-
renderComponent = (0, _jest.renderWithKintHarness)(/*#__PURE__*/(0, _jsxRuntime.jsx)(_CustomPropertiesFilterForm.default, {
|
|
19
|
-
onSubmit: onSubmit
|
|
20
|
-
|
|
21
|
-
}));
|
|
23
|
+
renderComponent = (0, _jest.renderWithKintHarness)(/*#__PURE__*/(0, _jsxRuntime.jsx)(_CustomPropertiesFilterForm.default, _objectSpread({
|
|
24
|
+
onSubmit: onSubmit
|
|
25
|
+
}, _testResources.data)));
|
|
22
26
|
});
|
|
23
27
|
it('renders CustomPropertiesFilterFieldArray component ', () => {
|
|
24
28
|
const {
|
|
@@ -15,6 +15,11 @@ var _useOperators = _interopRequireDefault(require("./useOperators"));
|
|
|
15
15
|
var _hooks = require("../../hooks");
|
|
16
16
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
17
17
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
18
|
+
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; }
|
|
19
|
+
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; }
|
|
20
|
+
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; }
|
|
21
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
|
22
|
+
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); }
|
|
18
23
|
const propTypes = {
|
|
19
24
|
ariaLabelledby: _propTypes.default.string.isRequired,
|
|
20
25
|
clearRuleValue: _propTypes.default.func.isRequired,
|
|
@@ -51,7 +56,7 @@ const CustomPropertiesRule = _ref => {
|
|
|
51
56
|
const operators = (0, _useOperators.default)(custPropDefinition.type, passedIntlKey, passedIntlNS, labelOverrides);
|
|
52
57
|
const valueProps = (0, _useValueProps.default)(custPropDefinition, passedIntlKey, passedIntlNS, labelOverrides);
|
|
53
58
|
const kintIntl = (0, _hooks.useKintIntl)(passedIntlKey, passedIntlNS);
|
|
54
|
-
const selectedOperator = operators.find(o => o.value === value
|
|
59
|
+
const selectedOperator = operators.find(o => o.value === (value === null || value === void 0 ? void 0 : value.operator));
|
|
55
60
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_components.Row, {
|
|
56
61
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Col, {
|
|
57
62
|
xs: 2,
|
|
@@ -65,7 +70,7 @@ const CustomPropertiesRule = _ref => {
|
|
|
65
70
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Col, {
|
|
66
71
|
xs: 4,
|
|
67
72
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactFinalForm.Field, {
|
|
68
|
-
name:
|
|
73
|
+
name: "".concat(name, ".operator"),
|
|
69
74
|
validate: _validators.required,
|
|
70
75
|
children: _ref2 => {
|
|
71
76
|
let {
|
|
@@ -73,33 +78,32 @@ const CustomPropertiesRule = _ref => {
|
|
|
73
78
|
meta
|
|
74
79
|
} = _ref2;
|
|
75
80
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Select
|
|
76
|
-
/* We don't want to jump focus to it when we open a brand new filter, only on a brand new rule */, {
|
|
77
|
-
autoFocus: index !== 0
|
|
78
|
-
|
|
79
|
-
"aria-labelledby":
|
|
81
|
+
/* We don't want to jump focus to it when we open a brand new filter, only on a brand new rule */, _objectSpread(_objectSpread({
|
|
82
|
+
autoFocus: index !== 0
|
|
83
|
+
}, input), {}, {
|
|
84
|
+
"aria-labelledby": "".concat(ariaLabelledby, "-rule-column-header-comparator"),
|
|
80
85
|
dataOptions: operators,
|
|
81
|
-
error: meta
|
|
86
|
+
error: (meta === null || meta === void 0 ? void 0 : meta.touched) && (meta === null || meta === void 0 ? void 0 : meta.error),
|
|
82
87
|
onChange: e => {
|
|
83
88
|
input.onChange(e);
|
|
84
89
|
const newlySelectedOperator = operators.find(o => o.value === e.target.value);
|
|
85
|
-
if (newlySelectedOperator
|
|
90
|
+
if (newlySelectedOperator !== null && newlySelectedOperator !== void 0 && newlySelectedOperator.noValueAllowed) {
|
|
86
91
|
clearRuleValue();
|
|
87
92
|
}
|
|
88
93
|
},
|
|
89
94
|
placeholder: " ",
|
|
90
95
|
required: true
|
|
91
|
-
});
|
|
96
|
+
}));
|
|
92
97
|
}
|
|
93
98
|
})
|
|
94
99
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Col, {
|
|
95
100
|
xs: 4,
|
|
96
|
-
children: selectedOperator
|
|
97
|
-
"aria-labelledby":
|
|
98
|
-
name:
|
|
101
|
+
children: selectedOperator !== null && selectedOperator !== void 0 && selectedOperator.noValueAllowed ? null : /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactFinalForm.Field, _objectSpread({
|
|
102
|
+
"aria-labelledby": "".concat(ariaLabelledby, "-rule-column-header-value"),
|
|
103
|
+
name: "".concat(name, ".value"),
|
|
99
104
|
required: true,
|
|
100
|
-
validate: _validators.required
|
|
101
|
-
|
|
102
|
-
})
|
|
105
|
+
validate: _validators.required
|
|
106
|
+
}, valueProps))
|
|
103
107
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Col, {
|
|
104
108
|
xs: 2,
|
|
105
109
|
children: index ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Tooltip, {
|
|
@@ -5,8 +5,9 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.filterHandlers = exports.data = exports.activeFilters = void 0;
|
|
7
7
|
var _jest = require("../../../../test/jest");
|
|
8
|
+
var _refdata$find;
|
|
8
9
|
const activeFilters = exports.activeFilters = {
|
|
9
|
-
'customProperties': [
|
|
10
|
+
'customProperties': ["customProperties.AuthorIdentification.value==".concat(_jest.refdata === null || _jest.refdata === void 0 || (_refdata$find = _jest.refdata.find(rdc => rdc.desc === 'AuthIdent')) === null || _refdata$find === void 0 || (_refdata$find = _refdata$find.values) === null || _refdata$find === void 0 || (_refdata$find = _refdata$find.find(rdv => rdv.value === 'email_domain')) === null || _refdata$find === void 0 ? void 0 : _refdata$find.id)]
|
|
10
11
|
};
|
|
11
12
|
const filterHandlers = exports.filterHandlers = {
|
|
12
13
|
'state': () => ({}),
|
|
@@ -13,13 +13,14 @@ const useParseActiveFilterStrings = function (filterStrings, passedIntlKey, pass
|
|
|
13
13
|
const filters = filterStrings.map(filter => {
|
|
14
14
|
let customProperty;
|
|
15
15
|
const rules = filter.split('||').map(ruleString => {
|
|
16
|
+
var _operators$find;
|
|
16
17
|
// ruleString is constructed in this.handleSubmit passed to CustomPropertyFiltersForm
|
|
17
18
|
// and has shape "customProperties.foo.value!=42"
|
|
18
19
|
// OR customProperties.foo.value.id==1234, so make sure to disregard the .id
|
|
19
20
|
const [customPropertyPath, rule] = ruleString.split('.value');
|
|
20
21
|
const idSafeRule = rule.replace('.id', '');
|
|
21
22
|
customProperty = customPropertyPath.replace('customProperties.', '');
|
|
22
|
-
const operator = operators.find(o => idSafeRule.startsWith(o))
|
|
23
|
+
const operator = (_operators$find = operators.find(o => idSafeRule.startsWith(o))) !== null && _operators$find !== void 0 ? _operators$find : '';
|
|
23
24
|
const value = idSafeRule.substring(operator.length);
|
|
24
25
|
numberOfFilters += 1;
|
|
25
26
|
return {
|
|
@@ -26,7 +26,7 @@ const CustomPropertiesView = _ref => {
|
|
|
26
26
|
intlKey: passedIntlKey,
|
|
27
27
|
intlNS: passedIntlNS,
|
|
28
28
|
labelOverrides
|
|
29
|
-
},
|
|
29
|
+
}, "customPropertiesView-".concat(ctx)));
|
|
30
30
|
};
|
|
31
31
|
CustomPropertiesView.propTypes = {
|
|
32
32
|
contexts: _propTypes.default.arrayOf(_propTypes.default.string),
|
|
@@ -11,6 +11,7 @@ var _CustomPropertyCard = _interopRequireDefault(require("./CustomPropertyCard")
|
|
|
11
11
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
12
12
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
13
13
|
const CustomPropertiesViewCtx = _ref => {
|
|
14
|
+
var _custprops$filter$len, _custprops$filter;
|
|
14
15
|
let {
|
|
15
16
|
ctx,
|
|
16
17
|
customProperties = [],
|
|
@@ -35,7 +36,7 @@ const CustomPropertiesViewCtx = _ref => {
|
|
|
35
36
|
// Chain formatKintMessages together using provided fallbackMessage to
|
|
36
37
|
// allow for "If override or translation exists, use it, else use default"
|
|
37
38
|
return kintIntl.formatKintMessage({
|
|
38
|
-
id:
|
|
39
|
+
id: "customProperties.ctx.".concat(ctx),
|
|
39
40
|
overrideValue: labelOverrides[ctx],
|
|
40
41
|
fallbackMessage: kintIntl.formatKintMessage({
|
|
41
42
|
id: 'customProperties.defaultTitle',
|
|
@@ -79,21 +80,25 @@ const CustomPropertiesViewCtx = _ref => {
|
|
|
79
80
|
closedByDefault: true,
|
|
80
81
|
displayWhenClosed: /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Spinner, {}),
|
|
81
82
|
displayWhenOpen: /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Spinner, {}),
|
|
82
|
-
id:
|
|
83
|
+
id: "".concat(id, "-accordion-").concat(ctx),
|
|
83
84
|
label: getAccordionLabel(),
|
|
84
85
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Spinner, {})
|
|
85
86
|
});
|
|
86
87
|
}
|
|
87
|
-
const countSetProperties = primary =>
|
|
88
|
-
|
|
89
|
-
return (
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
88
|
+
const countSetProperties = primary => {
|
|
89
|
+
var _Object$entries$filte, _Object$entries;
|
|
90
|
+
return (_Object$entries$filte = (_Object$entries = Object.entries(customProperties)) === null || _Object$entries === void 0 || (_Object$entries = _Object$entries.filter(_ref2 => {
|
|
91
|
+
var _cp$, _cp$2, _cp$3;
|
|
92
|
+
let [_key, cp] = _ref2;
|
|
93
|
+
return (((_cp$ = cp[0]) === null || _cp$ === void 0 || (_cp$ = _cp$.type) === null || _cp$ === void 0 ? void 0 : _cp$.ctx) === ctx || ctx === 'isNull' && !((_cp$2 = cp[0]) !== null && _cp$2 !== void 0 && (_cp$2 = _cp$2.type) !== null && _cp$2 !== void 0 && _cp$2.ctx)) &&
|
|
94
|
+
// Either the ctx string matches, or isNull matches blank
|
|
95
|
+
((_cp$3 = cp[0]) === null || _cp$3 === void 0 || (_cp$3 = _cp$3.type) === null || _cp$3 === void 0 ? void 0 : _cp$3.primary) === primary // Only count non-primary set custprops
|
|
96
|
+
;
|
|
97
|
+
})) === null || _Object$entries === void 0 ? void 0 : _Object$entries.length) !== null && _Object$entries$filte !== void 0 ? _Object$entries$filte : 0;
|
|
98
|
+
};
|
|
94
99
|
|
|
95
100
|
// We need to display any set properties, along with any non-set primary properties
|
|
96
|
-
const primaryCount = custprops
|
|
101
|
+
const primaryCount = (_custprops$filter$len = custprops === null || custprops === void 0 || (_custprops$filter = custprops.filter(cp => cp.primary === true)) === null || _custprops$filter === void 0 ? void 0 : _custprops$filter.length) !== null && _custprops$filter$len !== void 0 ? _custprops$filter$len : 0;
|
|
97
102
|
const optionalCount = countSetProperties(false);
|
|
98
103
|
const setPrimaryCount = countSetProperties(true);
|
|
99
104
|
return primaryCount + optionalCount > 0 && /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Accordion, {
|
|
@@ -104,15 +109,18 @@ const CustomPropertiesViewCtx = _ref => {
|
|
|
104
109
|
displayWhenOpen: /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Badge, {
|
|
105
110
|
children: setPrimaryCount + optionalCount
|
|
106
111
|
}),
|
|
107
|
-
id:
|
|
112
|
+
id: "".concat(id, "-accordion-").concat(ctx),
|
|
108
113
|
label: getAccordionLabel(),
|
|
109
|
-
children: custprops.map((cp, index) =>
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
114
|
+
children: custprops.map((cp, index) => {
|
|
115
|
+
var _customProperties$cp$;
|
|
116
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_CustomPropertyCard.default, {
|
|
117
|
+
ctx: ctx,
|
|
118
|
+
customProperty: customProperties === null || customProperties === void 0 || (_customProperties$cp$ = customProperties[cp.name]) === null || _customProperties$cp$ === void 0 ? void 0 : _customProperties$cp$[0],
|
|
119
|
+
customPropertyDefinition: cp,
|
|
120
|
+
index: index,
|
|
121
|
+
labelOverrides: labelOverrides
|
|
122
|
+
}, "custom-property-card-".concat(ctx, "[").concat(index, "]"));
|
|
123
|
+
})
|
|
116
124
|
});
|
|
117
125
|
};
|
|
118
126
|
CustomPropertiesViewCtx.propTypes = {
|
|
@@ -8,6 +8,11 @@ var _CustomPropertiesViewCtx = _interopRequireDefault(require("./CustomPropertie
|
|
|
8
8
|
var _jest = require("../../../../test/jest");
|
|
9
9
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
10
10
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
11
|
+
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; }
|
|
12
|
+
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; }
|
|
13
|
+
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; }
|
|
14
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
|
15
|
+
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); }
|
|
11
16
|
jest.mock('../../hooks');
|
|
12
17
|
jest.mock('./CustomPropertyCard', () => () => /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
13
18
|
children: "CustomPropertyCard"
|
|
@@ -16,9 +21,7 @@ describe('CustomPropertiesViewCtx', () => {
|
|
|
16
21
|
let renderComponent;
|
|
17
22
|
beforeEach(() => {
|
|
18
23
|
renderComponent = (0, _jest.renderWithKintHarness)(/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactRouterDom.MemoryRouter, {
|
|
19
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_CustomPropertiesViewCtx.default, {
|
|
20
|
-
..._testResources.data
|
|
21
|
-
})
|
|
24
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_CustomPropertiesViewCtx.default, _objectSpread({}, _testResources.data))
|
|
22
25
|
}));
|
|
23
26
|
});
|
|
24
27
|
it('renders CustomPropertyCard component ', () => {
|
|
@@ -29,8 +29,9 @@ const CustomPropertyCard = _ref => {
|
|
|
29
29
|
if (!toDisplay) {
|
|
30
30
|
return null;
|
|
31
31
|
}
|
|
32
|
-
const internalFalse = customProperty
|
|
32
|
+
const internalFalse = (customProperty === null || customProperty === void 0 ? void 0 : customProperty.internal) === false || (customProperty === null || customProperty === void 0 ? void 0 : customProperty.internal) === undefined && customPropertyDefinition.defaultInternal === false;
|
|
33
33
|
const renderValue = () => {
|
|
34
|
+
var _customProperty$value, _customProperty$value2, _customProperty$value3, _customProperty$value4;
|
|
34
35
|
if (!customProperty) {
|
|
35
36
|
return kintIntl.formatKintMessage({
|
|
36
37
|
id: 'notSet',
|
|
@@ -40,11 +41,14 @@ const CustomPropertyCard = _ref => {
|
|
|
40
41
|
switch (customPropertyDefinition.type) {
|
|
41
42
|
case CUSTPROP_TYPES.MULTI_REFDATA_CLASS_NAME:
|
|
42
43
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.List, {
|
|
43
|
-
items: customProperty.value
|
|
44
|
+
items: (_customProperty$value = customProperty.value) === null || _customProperty$value === void 0 ? void 0 : _customProperty$value.map(item => {
|
|
45
|
+
var _item$label;
|
|
46
|
+
return (_item$label = item === null || item === void 0 ? void 0 : item.label) !== null && _item$label !== void 0 ? _item$label : item === null || item === void 0 ? void 0 : item.value;
|
|
47
|
+
}),
|
|
44
48
|
listStyle: "bullets"
|
|
45
49
|
});
|
|
46
50
|
case CUSTPROP_TYPES.REFDATA_CLASS_NAME:
|
|
47
|
-
return customProperty.value
|
|
51
|
+
return (_customProperty$value2 = (_customProperty$value3 = customProperty.value) === null || _customProperty$value3 === void 0 ? void 0 : _customProperty$value3.label) !== null && _customProperty$value2 !== void 0 ? _customProperty$value2 : (_customProperty$value4 = customProperty.value) === null || _customProperty$value4 === void 0 ? void 0 : _customProperty$value4.value;
|
|
48
52
|
case CUSTPROP_TYPES.DECIMAL_CLASS_NAME:
|
|
49
53
|
case CUSTPROP_TYPES.INTEGER_CLASS_NAME:
|
|
50
54
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactIntl.FormattedNumber, {
|
|
@@ -72,7 +76,7 @@ const CustomPropertyCard = _ref => {
|
|
|
72
76
|
content: customPropertyDefinition.description
|
|
73
77
|
}) : null]
|
|
74
78
|
}),
|
|
75
|
-
id:
|
|
79
|
+
id: "customproperty-card-".concat(index),
|
|
76
80
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_components.Row, {
|
|
77
81
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Col, {
|
|
78
82
|
xs: 6,
|
|
@@ -83,7 +87,7 @@ const CustomPropertyCard = _ref => {
|
|
|
83
87
|
}),
|
|
84
88
|
children: renderValue()
|
|
85
89
|
})
|
|
86
|
-
}), customProperty
|
|
90
|
+
}), customProperty !== null && customProperty !== void 0 && customProperty.note ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Col, {
|
|
87
91
|
xs: 6,
|
|
88
92
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.KeyValue, {
|
|
89
93
|
label: kintIntl.formatKintMessage({
|
|
@@ -118,7 +122,7 @@ const CustomPropertyCard = _ref => {
|
|
|
118
122
|
id: 'customProperties.publicNote',
|
|
119
123
|
overrideValue: labelOverrides.publicNote
|
|
120
124
|
}),
|
|
121
|
-
children: customProperty
|
|
125
|
+
children: customProperty !== null && customProperty !== void 0 && customProperty.publicNote ? /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
122
126
|
style: {
|
|
123
127
|
whiteSpace: 'pre-wrap'
|
|
124
128
|
},
|
|
@@ -127,7 +131,7 @@ const CustomPropertyCard = _ref => {
|
|
|
127
131
|
})
|
|
128
132
|
})]
|
|
129
133
|
})]
|
|
130
|
-
},
|
|
134
|
+
}, "customPropertyCard-".concat(ctx, "[").concat(index, "]"));
|
|
131
135
|
};
|
|
132
136
|
CustomPropertyCard.propTypes = {
|
|
133
137
|
ctx: _propTypes.default.string,
|