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