@k-int/stripes-kint-components 5.34.0 → 5.35.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/lib/CustomProperties/Config/CustomPropertiesSettings.js +32 -1
- package/es/lib/NoResultsMessage/NoResultsMessage.js +28 -10
- package/es/lib/SASQLookupComponent/SASQLookupComponent.js +109 -60
- package/es/lib/SASQLookupComponent/SASQLookupComponent.test.js +11 -0
- package/es/lib/SASQLookupComponent/TableBody/TableBody.js +6 -0
- package/es/lib/hooks/index.js +8 -0
- package/es/lib/hooks/useMutateTemplates/index.js +13 -0
- package/es/lib/hooks/useMutateTemplates/useMutateTemplates.js +45 -0
- package/es/lib/utils/parseErrorResponse.js +6 -1
- 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 +136 -10
- 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 +19 -19
- 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 +70 -13
- package/src/artifacts/coverage-jest/NoResultsMessage/index.html +3 -3
- package/src/artifacts/coverage-jest/NoResultsMessage/index.js.html +1 -1
- package/src/artifacts/coverage-jest/NumberField/NumberField.js.html +1 -1
- package/src/artifacts/coverage-jest/NumberField/index.html +1 -1
- package/src/artifacts/coverage-jest/NumberField/index.js.html +1 -1
- package/src/artifacts/coverage-jest/QueryTypedown/QueryTypedown.js.html +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 +298 -136
- package/src/artifacts/coverage-jest/SASQLookupComponent/TableBody/TableBody.js.html +12 -3
- 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 +16 -16
- package/src/artifacts/coverage-jest/SASQLookupComponent/index.js.html +1 -1
- package/src/artifacts/coverage-jest/SASQRoute/SASQRoute.js.html +1 -1
- package/src/artifacts/coverage-jest/SASQRoute/index.html +1 -1
- package/src/artifacts/coverage-jest/SASQRoute/index.js.html +1 -1
- package/src/artifacts/coverage-jest/SASQViewComponent/SASQViewComponent.js.html +1 -1
- package/src/artifacts/coverage-jest/SASQViewComponent/index.html +1 -1
- package/src/artifacts/coverage-jest/SASQViewComponent/index.js.html +1 -1
- package/src/artifacts/coverage-jest/SearchField/SearchField.js.html +1 -1
- package/src/artifacts/coverage-jest/SearchField/index.html +1 -1
- package/src/artifacts/coverage-jest/SearchField/index.js.html +1 -1
- package/src/artifacts/coverage-jest/SearchKeyControl/SearchKeyControl.js.html +1 -1
- package/src/artifacts/coverage-jest/SearchKeyControl/index.html +1 -1
- package/src/artifacts/coverage-jest/SearchKeyControl/index.js.html +1 -1
- package/src/artifacts/coverage-jest/Settings/EditableRefdataCategoryList/EditableRefdataCategoryList.js.html +1 -1
- package/src/artifacts/coverage-jest/Settings/EditableRefdataCategoryList/index.html +1 -1
- package/src/artifacts/coverage-jest/Settings/EditableRefdataCategoryList/index.js.html +1 -1
- package/src/artifacts/coverage-jest/Settings/EditableRefdataList/EditableRefdataList.js.html +1 -1
- package/src/artifacts/coverage-jest/Settings/EditableRefdataList/index.html +1 -1
- package/src/artifacts/coverage-jest/Settings/EditableRefdataList/index.js.html +1 -1
- package/src/artifacts/coverage-jest/Settings/EditableSettingsList/EditableSettingsList.js.html +1 -1
- package/src/artifacts/coverage-jest/Settings/EditableSettingsList/EditableSettingsListFieldArray/EditableSettingsListFieldArray.js.html +1 -1
- package/src/artifacts/coverage-jest/Settings/EditableSettingsList/EditableSettingsListFieldArray/index.html +1 -1
- package/src/artifacts/coverage-jest/Settings/EditableSettingsList/EditableSettingsListFieldArray/index.js.html +1 -1
- package/src/artifacts/coverage-jest/Settings/EditableSettingsList/SettingField/EditSettingValue/EditSettingValue.js.html +1 -1
- package/src/artifacts/coverage-jest/Settings/EditableSettingsList/SettingField/EditSettingValue/index.html +1 -1
- package/src/artifacts/coverage-jest/Settings/EditableSettingsList/SettingField/EditSettingValue/index.js.html +1 -1
- package/src/artifacts/coverage-jest/Settings/EditableSettingsList/SettingField/RenderSettingValue/RenderSettingValue.js.html +1 -1
- package/src/artifacts/coverage-jest/Settings/EditableSettingsList/SettingField/RenderSettingValue/index.html +1 -1
- package/src/artifacts/coverage-jest/Settings/EditableSettingsList/SettingField/RenderSettingValue/index.js.html +1 -1
- package/src/artifacts/coverage-jest/Settings/EditableSettingsList/SettingField/SettingField.js.html +1 -1
- package/src/artifacts/coverage-jest/Settings/EditableSettingsList/SettingField/index.html +1 -1
- package/src/artifacts/coverage-jest/Settings/EditableSettingsList/SettingField/index.js.html +1 -1
- package/src/artifacts/coverage-jest/Settings/EditableSettingsList/index.html +1 -1
- package/src/artifacts/coverage-jest/Settings/EditableSettingsList/index.js.html +1 -1
- package/src/artifacts/coverage-jest/Settings/RefdataCategoriesSettings/RefdataCategoriesSettings.js.html +1 -1
- package/src/artifacts/coverage-jest/Settings/RefdataCategoriesSettings/index.html +1 -1
- package/src/artifacts/coverage-jest/Settings/RefdataCategoriesSettings/index.js.html +1 -1
- package/src/artifacts/coverage-jest/Settings/SettingPage/SettingPage.js.html +1 -1
- package/src/artifacts/coverage-jest/Settings/SettingPage/SettingPagePane/SettingPagePane.js.html +1 -1
- package/src/artifacts/coverage-jest/Settings/SettingPage/SettingPagePane/index.html +1 -1
- package/src/artifacts/coverage-jest/Settings/SettingPage/SettingPagePane/index.js.html +1 -1
- package/src/artifacts/coverage-jest/Settings/SettingPage/index.html +1 -1
- package/src/artifacts/coverage-jest/Settings/SettingPage/index.js.html +1 -1
- package/src/artifacts/coverage-jest/Settings/Settings/Settings.js.html +1 -1
- package/src/artifacts/coverage-jest/Settings/Settings/index.html +1 -1
- package/src/artifacts/coverage-jest/Settings/Settings/index.js.html +1 -1
- package/src/artifacts/coverage-jest/Settings/SettingsFormContainer/SettingsFormContainer.js.html +1 -1
- package/src/artifacts/coverage-jest/Settings/SettingsFormContainer/index.html +1 -1
- package/src/artifacts/coverage-jest/Settings/SettingsFormContainer/index.js.html +1 -1
- package/src/artifacts/coverage-jest/Settings/StaticSettingsField/StaticSettingsField.js.html +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 +1 -1
- package/src/artifacts/coverage-jest/Settings/hooks/useSettings/index.js.html +1 -1
- package/src/artifacts/coverage-jest/Settings/hooks/useSettings/useSettings.js.html +1 -1
- package/src/artifacts/coverage-jest/Settings/index.html +1 -1
- package/src/artifacts/coverage-jest/Settings/index.js.html +1 -1
- package/src/artifacts/coverage-jest/Tags/Tags.js.html +1 -1
- package/src/artifacts/coverage-jest/Tags/hooks/index.html +1 -1
- package/src/artifacts/coverage-jest/Tags/hooks/index.js.html +1 -1
- package/src/artifacts/coverage-jest/Tags/hooks/useTags.js.html +1 -1
- package/src/artifacts/coverage-jest/Tags/hooks/useTagsEnabled.js.html +1 -1
- package/src/artifacts/coverage-jest/Tags/index.html +1 -1
- package/src/artifacts/coverage-jest/Tags/index.js.html +1 -1
- package/src/artifacts/coverage-jest/Tags/tagsConfig.js.html +1 -1
- package/src/artifacts/coverage-jest/Typedown/Typedown.js.html +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 +418 -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 +8 -2
- 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 +11 -11
- 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 +9 -9
- package/src/artifacts/coverage-jest/hooks/typedownHooks/index.html +1 -1
- package/src/artifacts/coverage-jest/hooks/typedownHooks/index.js.html +1 -1
- package/src/artifacts/coverage-jest/hooks/typedownHooks/useTypedown.js.html +1 -1
- package/src/artifacts/coverage-jest/hooks/typedownHooks/useTypedownData.js.html +1 -1
- package/src/artifacts/coverage-jest/hooks/typedownHooks/useTypedownToggle.js.html +1 -1
- package/src/artifacts/coverage-jest/hooks/useActionListRef.js.html +1 -1
- package/src/artifacts/coverage-jest/hooks/useActiveElement.js.html +1 -1
- package/src/artifacts/coverage-jest/hooks/useCustProps.js.html +1 -1
- package/src/artifacts/coverage-jest/hooks/useCustomProperties.js.html +1 -1
- package/src/artifacts/coverage-jest/hooks/useHelperApp.js.html +1 -1
- package/src/artifacts/coverage-jest/hooks/useInvalidateRefdata/index.html +1 -1
- package/src/artifacts/coverage-jest/hooks/useInvalidateRefdata/index.js.html +1 -1
- package/src/artifacts/coverage-jest/hooks/useInvalidateRefdata/useInvalidateRefdata.js.html +1 -1
- package/src/artifacts/coverage-jest/hooks/useKiwtFieldArray.js.html +1 -1
- package/src/artifacts/coverage-jest/hooks/useKiwtSASQuery.js.html +16 -16
- 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/useMutateTemplates/index.html +131 -0
- package/src/artifacts/coverage-jest/hooks/useMutateTemplates/index.js.html +88 -0
- package/src/artifacts/coverage-jest/hooks/useMutateTemplates/useMutateTemplates.js.html +217 -0
- package/src/artifacts/coverage-jest/hooks/useParallelBatchFetch.js.html +1 -1
- package/src/artifacts/coverage-jest/hooks/usePrevNextPagination.js.html +37 -37
- package/src/artifacts/coverage-jest/hooks/useQIndex.js.html +9 -9
- 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 +50 -35
- package/src/artifacts/coverage-jest/utils/buildUrl.js.html +12 -12
- 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 +3 -3
- package/src/artifacts/coverage-jest/utils/generateKiwtQueryParams/generateKiwtQueryParams.js.html +19 -19
- 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 +13 -13
- package/src/artifacts/coverage-jest/utils/index.js.html +1 -1
- package/src/artifacts/coverage-jest/utils/matchString/index.html +1 -1
- package/src/artifacts/coverage-jest/utils/matchString/index.js.html +1 -1
- package/src/artifacts/coverage-jest/utils/matchString/matchString.js.html +1 -1
- package/src/artifacts/coverage-jest/utils/modConfigEntriesQueryKey.js.html +1 -1
- package/src/artifacts/coverage-jest/utils/parseErrorResponse.js.html +26 -8
- 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 +1 -1
- package/src/artifacts/coverage-jest/utils/stringStyling/highlightString.js.html +1 -1
- package/src/artifacts/coverage-jest/utils/stringStyling/index.html +1 -1
- package/src/artifacts/coverage-jest/utils/stringStyling/index.js.html +1 -1
- package/src/artifacts/coverage-jest/utils/toCamelCase.js.html +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/CustomProperties/Config/CustomPropertiesSettings.js +42 -0
- package/src/lib/NoResultsMessage/NoResultsMessage.js +29 -10
- package/src/lib/NoResultsMessage/README.md +16 -13
- package/src/lib/SASQLookupComponent/README.md +12 -0
- package/src/lib/SASQLookupComponent/SASQLookupComponent.js +127 -73
- package/src/lib/SASQLookupComponent/SASQLookupComponent.test.js +13 -1
- package/src/lib/SASQLookupComponent/TableBody/TableBody.js +4 -1
- package/src/lib/SASQRoute/README.md +6 -1
- package/src/lib/hooks/index.js +2 -0
- package/src/lib/hooks/useMutateTemplates/index.js +1 -0
- package/src/lib/hooks/useMutateTemplates/useMutateTemplates.js +44 -0
- package/src/lib/utils/parseErrorResponse.js +7 -1
- package/styles/NoResultsMessage.css +1 -0
- package/styles/SASQLookupComponent.css +15 -0
|
@@ -2,17 +2,27 @@ import React from 'react';
|
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
3
|
import { FormattedMessage } from 'react-intl';
|
|
4
4
|
import { Button, Icon } from '@folio/stripes/components';
|
|
5
|
-
import css from '../../../styles/NoResultsMessage.css';
|
|
6
5
|
import { useKintIntl } from '../hooks';
|
|
7
6
|
|
|
7
|
+
import css from '../../../styles/NoResultsMessage.css';
|
|
8
|
+
|
|
8
9
|
const NoResultsMessage = ({
|
|
10
|
+
className,
|
|
11
|
+
error,
|
|
12
|
+
filters,
|
|
13
|
+
filterPaneIsVisible,
|
|
9
14
|
icon: userIcon,
|
|
15
|
+
iconPresets: {
|
|
16
|
+
noTerms: noTermsIcon,
|
|
17
|
+
noTermsWhenFilterPane: noTermsWhenFilterPaneIcon,
|
|
18
|
+
noResults: noResultsIcon,
|
|
19
|
+
isLoading: isLoadingIcon,
|
|
20
|
+
error: errorIcon,
|
|
21
|
+
} = {},
|
|
10
22
|
intlKey: passedIntlKey,
|
|
11
23
|
intlNS: passedIntlNS,
|
|
12
24
|
isLoading,
|
|
13
25
|
isError,
|
|
14
|
-
error,
|
|
15
|
-
filterPaneIsVisible,
|
|
16
26
|
label: userLabel,
|
|
17
27
|
labelOverrides = {},
|
|
18
28
|
searchTerm,
|
|
@@ -23,28 +33,28 @@ const NoResultsMessage = ({
|
|
|
23
33
|
let icon = 'search';
|
|
24
34
|
let label = <FormattedMessage id="stripes-smart-components.sas.noResults.default" values={{ searchTerm }} />;
|
|
25
35
|
|
|
26
|
-
if (!isLoading && !searchTerm) {
|
|
36
|
+
if (!isLoading && !searchTerm && !filters) {
|
|
27
37
|
// No search term and not loading
|
|
28
|
-
icon = filterPaneIsVisible ? 'arrow-left' : null;
|
|
38
|
+
icon = noTermsIcon ?? (filterPaneIsVisible ? (noTermsWhenFilterPaneIcon ?? 'arrow-left') : null);
|
|
29
39
|
label = <FormattedMessage id="stripes-smart-components.sas.noResults.noTerms" />;
|
|
30
40
|
} else if (!isLoading) {
|
|
31
41
|
// Search term but not loading
|
|
32
|
-
icon = 'search';
|
|
42
|
+
icon = noResultsIcon ?? 'search';
|
|
33
43
|
label = <FormattedMessage id="stripes-smart-components.sas.noResults.noResults" />;
|
|
34
44
|
} else if (isLoading) {
|
|
35
45
|
// Loading
|
|
36
|
-
icon = 'spinner-ellipsis';
|
|
46
|
+
icon = isLoadingIcon ?? 'spinner-ellipsis';
|
|
37
47
|
label = <FormattedMessage id="stripes-smart-components.sas.noResults.loading" />;
|
|
38
48
|
} else if (isError) {
|
|
39
49
|
// Request failure
|
|
40
|
-
icon = 'exclamation-circle';
|
|
50
|
+
icon = errorIcon ?? 'exclamation-circle';
|
|
41
51
|
label = error?.message;
|
|
42
52
|
}
|
|
43
53
|
|
|
44
54
|
return (
|
|
45
|
-
<div className={css.noResultsMessage}>
|
|
55
|
+
<div className={`${className} ${css.noResultsMessage}`}>
|
|
46
56
|
<div className={css.noResultsMessageLabelWrap}>
|
|
47
|
-
{(
|
|
57
|
+
{(userIcon || icon) &&
|
|
48
58
|
<Icon
|
|
49
59
|
icon={userIcon ?? icon}
|
|
50
60
|
iconRootClass={css.noResultsMessageIcon}
|
|
@@ -72,9 +82,18 @@ const NoResultsMessage = ({
|
|
|
72
82
|
};
|
|
73
83
|
|
|
74
84
|
NoResultsMessage.propTypes = {
|
|
85
|
+
className: PropTypes.string,
|
|
75
86
|
error: PropTypes.object,
|
|
87
|
+
filters: PropTypes.string,
|
|
76
88
|
filterPaneIsVisible: PropTypes.bool.isRequired,
|
|
77
89
|
icon: PropTypes.string,
|
|
90
|
+
iconPresets: PropTypes.shape({
|
|
91
|
+
noTerms: PropTypes.string,
|
|
92
|
+
noTermsWhenFilterPane: PropTypes.string,
|
|
93
|
+
noResults: PropTypes.string,
|
|
94
|
+
isLoading: PropTypes.string,
|
|
95
|
+
error: PropTypes.string,
|
|
96
|
+
}),
|
|
78
97
|
intlKey: PropTypes.string,
|
|
79
98
|
intlNS: PropTypes.string,
|
|
80
99
|
isLoading: PropTypes.bool,
|
|
@@ -66,16 +66,19 @@ export default MyDataView;
|
|
|
66
66
|
|
|
67
67
|
## Props
|
|
68
68
|
|
|
69
|
-
| **Prop** | **Type** | **Required** | **Description**
|
|
70
|
-
|
|
71
|
-
| `
|
|
72
|
-
| `
|
|
73
|
-
| `
|
|
74
|
-
| `
|
|
75
|
-
| `
|
|
76
|
-
| `
|
|
77
|
-
| `
|
|
78
|
-
| `
|
|
79
|
-
| `
|
|
80
|
-
| `
|
|
81
|
-
| `
|
|
69
|
+
| **Prop** | **Type** | **Required** | **Description** |
|
|
70
|
+
|-----------------------|--------------------------|--------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
|
|
71
|
+
| `className` | `string` | ✕ | Allows the passing of additional CSS characteristics to the noResultsMessage |
|
|
72
|
+
| `filters ` | `string` | ✕ | The current filters. Used alongside searchTerm to differentiate between "no results for search" and "no search term entered" messages. |
|
|
73
|
+
| `filterPaneIsVisible` | `boolean` | ✓ | Indicates if the associated filter pane is currently visible. Controls the display of the "Show Filters" button. |
|
|
74
|
+
| `toggleFilterPane` | `() => void` | ✓ | Callback function invoked when the "Show Filters" button is clicked. Typically used to toggle the filter pane's visibility. |
|
|
75
|
+
| `error` | `object` | ✕ | An error object (e.g., from `react-query`) containing details of a failed request. Its `message` property will be displayed if `isError` is `true`. |
|
|
76
|
+
| `icon` | `string` | ✕ | An optional custom icon string (from `@folio/stripes/components/Icon`) to override the default icon based on the message state. |
|
|
77
|
+
| `iconPresets` | `object` | ✕ | An optional object containing keys: `noTerms`, `noTermsWhenFilterPane`, `noResults`, `isLoading` and `error`. Each key is optional and allows direcet overriding of one of the states NoResultsMessage is configured to output |
|
|
78
|
+
| `intlKey` | `string` | ✕ | A base internationalization key used by the internal `useKintIntl` hook to resolve localized messages. |
|
|
79
|
+
| `intlNS` | `string` | ✕ | An internationalization namespace used by the internal `useKintIntl` hook. |
|
|
80
|
+
| `isLoading` | `boolean` | ✕ | When `true`, indicates that data is currently being loaded, displaying a loading message. |
|
|
81
|
+
| `isError` | `boolean` | ✕ | When `true`, indicates an error occurred during data fetching, displaying an error message. |
|
|
82
|
+
| `label` | `string`, `node`, `func` | ✕ | An optional custom label to override all default message content. |
|
|
83
|
+
| `labelOverrides` | `object` | ✕ | An object for overriding specific parts of the default labels, such as `{ noResultsLabel: 'No records found' }` or `{ showFilters: 'View Filters' }`. |
|
|
84
|
+
| `searchTerm` | `string` | ✕ | The current search query string. Used alongside filters to differentiate between "no results for search" and "no search term entered" messages. |
|
|
@@ -178,3 +178,15 @@ export default LookupWithRefExample;
|
|
|
178
178
|
Using `forwardRef` and `useImperativeHandle`, the component exposes certain query properties and generated query parameters to parent components.
|
|
179
179
|
|
|
180
180
|
This design enables **SASQLookupComponent** to serve as a robust and flexible foundation for building data lookup views with advanced filtering, search, and pagination functionalities.
|
|
181
|
+
|
|
182
|
+
## Use in Settings
|
|
183
|
+
|
|
184
|
+
In Settings, often a "search and filter" experience is wanted, but with 2 panes instead of 3. In order to facilitate this,
|
|
185
|
+
SASQRoute (via SASQLookupComponent) exposes a set of props.
|
|
186
|
+
|
|
187
|
+
- `hasFilterPane`. This defaults to true, if set to false it will _instead_ default to rendering a search bar at the
|
|
188
|
+
top of the main pane. It will additionally render any passed FilterHeaderComponent and FilterComponent.
|
|
189
|
+
- `noSearchField`. In order to prevent rendering of the search bar, set this to false.
|
|
190
|
+
|
|
191
|
+
In this way a SASQRoute can be set up to be purely routing with no search/filter, or with search and filter in the main
|
|
192
|
+
body for settings.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import {
|
|
2
|
-
forwardRef,
|
|
2
|
+
forwardRef, useCallback,
|
|
3
3
|
useEffect,
|
|
4
4
|
useImperativeHandle,
|
|
5
5
|
useMemo,
|
|
@@ -38,6 +38,8 @@ import {
|
|
|
38
38
|
import TableBody from './TableBody';
|
|
39
39
|
import SearchKeyControl from '../SearchKeyControl';
|
|
40
40
|
|
|
41
|
+
import css from '../../../styles/SASQLookupComponent.css';
|
|
42
|
+
|
|
41
43
|
const SASQLookupComponent = forwardRef((props, ref) => {
|
|
42
44
|
const {
|
|
43
45
|
children,
|
|
@@ -60,9 +62,7 @@ const SASQLookupComponent = forwardRef((props, ref) => {
|
|
|
60
62
|
if (passedId) {
|
|
61
63
|
queryNamespace.push(passedId);
|
|
62
64
|
}
|
|
63
|
-
queryNamespace.push('viewAll');
|
|
64
|
-
queryNamespace.push(query);
|
|
65
|
-
queryNamespace.push(currentPage);
|
|
65
|
+
queryNamespace.push('viewAll', query, currentPage);
|
|
66
66
|
|
|
67
67
|
return queryNamespace;
|
|
68
68
|
},
|
|
@@ -78,6 +78,7 @@ const SASQLookupComponent = forwardRef((props, ref) => {
|
|
|
78
78
|
rowNavigation = true, // Default navigation onRowClick
|
|
79
79
|
sasqProps,
|
|
80
80
|
searchableIndexes = [],
|
|
81
|
+
SearchComponent: PassedSearchComponent,
|
|
81
82
|
searchFieldAriaLabel,
|
|
82
83
|
searchFieldProps = {},
|
|
83
84
|
} = props;
|
|
@@ -194,6 +195,53 @@ const SASQLookupComponent = forwardRef((props, ref) => {
|
|
|
194
195
|
queryParams,
|
|
195
196
|
}));
|
|
196
197
|
|
|
198
|
+
const InternalSearchComponent = useCallback(({
|
|
199
|
+
disableReset,
|
|
200
|
+
resetAll,
|
|
201
|
+
searchHandlers,
|
|
202
|
+
searchValue
|
|
203
|
+
}) => (
|
|
204
|
+
<>
|
|
205
|
+
<SearchField
|
|
206
|
+
ariaLabel={searchFieldAriaLabel}
|
|
207
|
+
autoFocus
|
|
208
|
+
id={`sasq-search-field-${id}`}
|
|
209
|
+
name="query"
|
|
210
|
+
onChange={(e) => {
|
|
211
|
+
if (e.target?.value) {
|
|
212
|
+
searchHandlers.query(e); // SASQ needs the whole event here
|
|
213
|
+
} else {
|
|
214
|
+
searchHandlers.reset();
|
|
215
|
+
}
|
|
216
|
+
}}
|
|
217
|
+
onClear={searchHandlers.reset}
|
|
218
|
+
value={searchValue.query}
|
|
219
|
+
{...searchFieldProps}
|
|
220
|
+
/>
|
|
221
|
+
{searchableIndexes?.length > 0 && (
|
|
222
|
+
<SearchKeyControl options={searchableIndexes} />
|
|
223
|
+
)}
|
|
224
|
+
<Button
|
|
225
|
+
buttonStyle="primary"
|
|
226
|
+
disabled={!searchValue.query}
|
|
227
|
+
fullWidth
|
|
228
|
+
type="submit"
|
|
229
|
+
>
|
|
230
|
+
<FormattedMessage id="stripes-smart-components.search" />
|
|
231
|
+
</Button>
|
|
232
|
+
<Button
|
|
233
|
+
buttonStyle="none"
|
|
234
|
+
disabled={disableReset}
|
|
235
|
+
id="clickable-reset-all"
|
|
236
|
+
onClick={resetAll}
|
|
237
|
+
>
|
|
238
|
+
<Icon icon="times-circle-solid">
|
|
239
|
+
<FormattedMessage id="stripes-smart-components.resetAll" />
|
|
240
|
+
</Icon>
|
|
241
|
+
</Button>
|
|
242
|
+
</>
|
|
243
|
+
), [id, searchFieldAriaLabel, searchFieldProps, searchableIndexes]);
|
|
244
|
+
|
|
197
245
|
return (
|
|
198
246
|
<SearchAndSortQuery
|
|
199
247
|
initialSearchState={{ query: '' }}
|
|
@@ -260,6 +308,8 @@ const SASQLookupComponent = forwardRef((props, ref) => {
|
|
|
260
308
|
return null;
|
|
261
309
|
};
|
|
262
310
|
|
|
311
|
+
const SearchComponent = PassedSearchComponent ?? InternalSearchComponent;
|
|
312
|
+
|
|
263
313
|
return (
|
|
264
314
|
<PersistedPaneset
|
|
265
315
|
appId={namespace}
|
|
@@ -291,49 +341,17 @@ const SASQLookupComponent = forwardRef((props, ref) => {
|
|
|
291
341
|
>
|
|
292
342
|
<form onSubmit={onSubmitSearch}>
|
|
293
343
|
<FilterPaneHeaderComponent />
|
|
294
|
-
{!noSearchField &&
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
if (e.target?.value) {
|
|
303
|
-
searchHandlers.query(e); // SASQ needs the whole event here
|
|
304
|
-
} else {
|
|
305
|
-
searchHandlers.reset();
|
|
306
|
-
}
|
|
307
|
-
}}
|
|
308
|
-
onClear={searchHandlers.reset}
|
|
309
|
-
value={searchValue.query}
|
|
310
|
-
{...searchFieldProps}
|
|
311
|
-
/>
|
|
312
|
-
{searchableIndexes?.length > 0 && (
|
|
313
|
-
<SearchKeyControl options={searchableIndexes} />
|
|
314
|
-
)}
|
|
315
|
-
<Button
|
|
316
|
-
buttonStyle="primary"
|
|
317
|
-
disabled={!searchValue.query}
|
|
318
|
-
fullWidth
|
|
319
|
-
type="submit"
|
|
320
|
-
>
|
|
321
|
-
<FormattedMessage id="stripes-smart-components.search" />
|
|
322
|
-
</Button>
|
|
323
|
-
<Button
|
|
324
|
-
buttonStyle="none"
|
|
325
|
-
disabled={disableReset}
|
|
326
|
-
id="clickable-reset-all"
|
|
327
|
-
onClick={resetAll}
|
|
328
|
-
>
|
|
329
|
-
<Icon icon="times-circle-solid">
|
|
330
|
-
<FormattedMessage id="stripes-smart-components.resetAll" />
|
|
331
|
-
</Icon>
|
|
332
|
-
</Button>
|
|
333
|
-
</>
|
|
334
|
-
)}
|
|
344
|
+
{!noSearchField &&
|
|
345
|
+
<SearchComponent
|
|
346
|
+
disableReset={disableReset}
|
|
347
|
+
resetAll={resetAll}
|
|
348
|
+
searchHandlers={searchHandlers}
|
|
349
|
+
searchValue={searchValue}
|
|
350
|
+
/>
|
|
351
|
+
}
|
|
335
352
|
<FilterComponent
|
|
336
|
-
activeFilters={activeFilters
|
|
353
|
+
activeFilters={activeFilters}
|
|
354
|
+
data={data}
|
|
337
355
|
filterChanged={filterChanged}
|
|
338
356
|
filterHandlers={getFilterHandlers()}
|
|
339
357
|
resetAll={resetAll}
|
|
@@ -363,33 +381,68 @@ const SASQLookupComponent = forwardRef((props, ref) => {
|
|
|
363
381
|
)}
|
|
364
382
|
{...restOfMainPaneProps}
|
|
365
383
|
>
|
|
366
|
-
<
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
}
|
|
392
|
-
|
|
384
|
+
<div className={css.mainPaneContainer}>
|
|
385
|
+
{!hasFilterPane &&
|
|
386
|
+
<div className={css.controlsContainer}>
|
|
387
|
+
<form onSubmit={onSubmitSearch}>
|
|
388
|
+
<FilterPaneHeaderComponent />
|
|
389
|
+
{!noSearchField &&
|
|
390
|
+
<SearchComponent
|
|
391
|
+
disableReset={disableReset}
|
|
392
|
+
resetAll={resetAll}
|
|
393
|
+
searchHandlers={searchHandlers}
|
|
394
|
+
searchValue={searchValue}
|
|
395
|
+
/>
|
|
396
|
+
}
|
|
397
|
+
<FilterComponent
|
|
398
|
+
activeFilters={activeFilters}
|
|
399
|
+
data={data}
|
|
400
|
+
filterChanged={filterChanged}
|
|
401
|
+
filterHandlers={getFilterHandlers()}
|
|
402
|
+
resetAll={resetAll}
|
|
403
|
+
searchChanged={searchChanged}
|
|
404
|
+
searchHandlers={getSearchHandlers()}
|
|
405
|
+
searchValue={searchValue}
|
|
406
|
+
/>
|
|
407
|
+
</form>
|
|
408
|
+
</div>
|
|
409
|
+
}
|
|
410
|
+
<div className={css.bodyContainer}>
|
|
411
|
+
<Body
|
|
412
|
+
data={data}
|
|
413
|
+
filterPaneVisible={filterPaneVisible}
|
|
414
|
+
intlKey={passedIntlKey}
|
|
415
|
+
intlNS={passedIntlNS}
|
|
416
|
+
labelOverrides={labelOverrides}
|
|
417
|
+
noResultsProps={{
|
|
418
|
+
...noResultsProps,
|
|
419
|
+
iconPresets: {
|
|
420
|
+
noTermsWhenFilterPane: hasFilterPane ? null : 'arrow-up',
|
|
421
|
+
...noResultsProps.iconPresets,
|
|
422
|
+
},
|
|
423
|
+
}}
|
|
424
|
+
query={query}
|
|
425
|
+
rowNavigation={rowNavigation}
|
|
426
|
+
toggleFilterPane={toggleFilterPane}
|
|
427
|
+
{...restOfQueryProps}
|
|
428
|
+
{...sasqRenderProps}
|
|
429
|
+
/*
|
|
430
|
+
* This is insane, it looks like SASQProps `initialSortState`
|
|
431
|
+
* needs to be passed through to MCL, as it relies on MCL calling the initial
|
|
432
|
+
* sort handler. Passing through SASQProps.
|
|
433
|
+
*/
|
|
434
|
+
{...sasqProps}
|
|
435
|
+
// pass down all props handed to us except mclProps (pass those down below with our extra prev/next goodies)
|
|
436
|
+
{...{
|
|
437
|
+
...props,
|
|
438
|
+
mclProps: {
|
|
439
|
+
...paginationMCLProps,
|
|
440
|
+
...mclProps,
|
|
441
|
+
},
|
|
442
|
+
}}
|
|
443
|
+
/>
|
|
444
|
+
</div>
|
|
445
|
+
</div>
|
|
393
446
|
</Pane>
|
|
394
447
|
{children}
|
|
395
448
|
</PersistedPaneset>
|
|
@@ -431,6 +484,7 @@ SASQLookupComponent.propTypes = {
|
|
|
431
484
|
label: PropTypes.string,
|
|
432
485
|
})
|
|
433
486
|
),
|
|
487
|
+
SearchComponent: PropTypes.oneOfType([PropTypes.func, PropTypes.node]),
|
|
434
488
|
searchFieldAriaLabel: PropTypes.string,
|
|
435
489
|
searchFieldProps: PropTypes.object,
|
|
436
490
|
};
|
|
@@ -203,7 +203,18 @@ describe('SASQLookupComponent', () => {
|
|
|
203
203
|
testLabel: 'with filter pane disabled',
|
|
204
204
|
props: {
|
|
205
205
|
...baseSASQLookupProps,
|
|
206
|
-
hasFilterPane: false
|
|
206
|
+
hasFilterPane: false,
|
|
207
|
+
},
|
|
208
|
+
expectQueryFire: false,
|
|
209
|
+
expectedSearchField :true,
|
|
210
|
+
expectedFilterPane: false,
|
|
211
|
+
},
|
|
212
|
+
{
|
|
213
|
+
testLabel: 'with filter pane disabled (and no search)',
|
|
214
|
+
props: {
|
|
215
|
+
...baseSASQLookupProps,
|
|
216
|
+
hasFilterPane: false,
|
|
217
|
+
noSearchField: true,
|
|
207
218
|
},
|
|
208
219
|
expectQueryFire: false,
|
|
209
220
|
expectedSearchField :false,
|
|
@@ -392,6 +403,7 @@ describe('SASQLookupComponent', () => {
|
|
|
392
403
|
beforeEach(async () => {
|
|
393
404
|
mockKy.mockClear();
|
|
394
405
|
await waitFor(async () => {
|
|
406
|
+
await SearchField().fillIn(''); // Needed to avoid flakiness
|
|
395
407
|
await SearchField().fillIn('some test query');
|
|
396
408
|
await Button('Search').click();
|
|
397
409
|
});
|
|
@@ -98,13 +98,15 @@ const TableBody = ({
|
|
|
98
98
|
<NoResultsComponent
|
|
99
99
|
{...{
|
|
100
100
|
error,
|
|
101
|
+
filters: query.filters, // Separate out filters as per "searchTerm" below
|
|
101
102
|
filterPaneIsVisible: filterPaneVisible,
|
|
102
103
|
intlKey: passedIntlKey,
|
|
103
104
|
intlNS: passedIntlNS,
|
|
104
105
|
isError,
|
|
105
106
|
isLoading,
|
|
106
107
|
labelOverrides,
|
|
107
|
-
|
|
108
|
+
query, // Passing the whole query object just in case
|
|
109
|
+
searchTerm: query.query, // Here for compatibility, probably better to just use "query" prop
|
|
108
110
|
toggleFilterPane,
|
|
109
111
|
...noResultsProps, // Anything passed in directly takes precedence
|
|
110
112
|
}}
|
|
@@ -141,6 +143,7 @@ TableBody.propTypes = {
|
|
|
141
143
|
location: PropTypes.object,
|
|
142
144
|
match: PropTypes.object,
|
|
143
145
|
mclProps: PropTypes.object,
|
|
146
|
+
noResultsProps: PropTypes.object,
|
|
144
147
|
onSort: PropTypes.func,
|
|
145
148
|
path: PropTypes.string.isRequired,
|
|
146
149
|
query: PropTypes.object,
|
|
@@ -83,4 +83,9 @@ In this example, **SASQRoute**:
|
|
|
83
83
|
4. **Customizability:**
|
|
84
84
|
By overriding default sub-components (`SASQLookupComponent` and `SASQViewComponent`), and by providing custom functions for route paths (`getPathLookup` and `getPathView`), developers can tailor the routing and display behavior to match specific application needs.
|
|
85
85
|
|
|
86
|
-
This comprehensive setup provided by **SASQRoute** allows for a rapid configuration of complex layouts involving data lookup and detailed views, reducing boilerplate and ensuring consistency across the application.
|
|
86
|
+
This comprehensive setup provided by **SASQRoute** allows for a rapid configuration of complex layouts involving data lookup and detailed views, reducing boilerplate and ensuring consistency across the application.
|
|
87
|
+
|
|
88
|
+
## Use in Settings
|
|
89
|
+
|
|
90
|
+
In Settings, often a "search and filter" experience is wanted, but with 2 panes instead of 3. In order to facilitate this,
|
|
91
|
+
SASQRoute (via SASQLookupComponent) exposes a set of props. See SASQLookupComponent README for details.
|
package/src/lib/hooks/index.js
CHANGED
|
@@ -19,6 +19,8 @@ export { default as useMutateRefdataCategory } from './useMutateRefdataCategory'
|
|
|
19
19
|
export { default as useMutateCustomProperties } from './useMutateCustomProperties';
|
|
20
20
|
export { default as useMutateModConfigEntry } from './useMutateModConfigEntry';
|
|
21
21
|
|
|
22
|
+
export { default as useMutateTemplates } from './useMutateTemplates';
|
|
23
|
+
|
|
22
24
|
export { default as usePrevNextPagination } from './usePrevNextPagination';
|
|
23
25
|
export { default as useStandaloneSASQQueryParameter } from './useStandaloneSASQQueryParameter';
|
|
24
26
|
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from './useMutateTemplates';
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import noop from 'lodash/noop';
|
|
2
|
+
|
|
3
|
+
import useInvalidateRefdata from '../useInvalidateRefdata';
|
|
4
|
+
import useMutateGeneric from '../useMutateGeneric';
|
|
5
|
+
|
|
6
|
+
const useMutateTemplates = ({
|
|
7
|
+
afterQueryCalls: {
|
|
8
|
+
delete: afterQueryDelete = noop,
|
|
9
|
+
post: afterQueryPost = noop,
|
|
10
|
+
put: afterQueryPut = noop,
|
|
11
|
+
} = {},
|
|
12
|
+
endpoint,
|
|
13
|
+
...mutateGenericProps
|
|
14
|
+
}) => {
|
|
15
|
+
const invalidateRefdata = useInvalidateRefdata();
|
|
16
|
+
|
|
17
|
+
return useMutateGeneric({
|
|
18
|
+
afterQueryCalls: {
|
|
19
|
+
delete: (res) => {
|
|
20
|
+
invalidateRefdata()
|
|
21
|
+
.then(() => {
|
|
22
|
+
afterQueryDelete(res);
|
|
23
|
+
});
|
|
24
|
+
},
|
|
25
|
+
post: (res) => {
|
|
26
|
+
invalidateRefdata()
|
|
27
|
+
.then(() => {
|
|
28
|
+
afterQueryPost(res);
|
|
29
|
+
});
|
|
30
|
+
},
|
|
31
|
+
put: (res) => {
|
|
32
|
+
invalidateRefdata()
|
|
33
|
+
.then(() => {
|
|
34
|
+
afterQueryPut(res);
|
|
35
|
+
});
|
|
36
|
+
},
|
|
37
|
+
},
|
|
38
|
+
endpoint,
|
|
39
|
+
queryKey: ['stripes-kint-components', 'useMutateTemplates'],
|
|
40
|
+
...mutateGenericProps
|
|
41
|
+
});
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
export default useMutateTemplates;
|
|
@@ -9,7 +9,13 @@ const parseErrorResponse = async (responseObj) => {
|
|
|
9
9
|
const contentType = [...(responseObj?.headers ?? [])]?.find(header => header[0]?.toLowerCase() === 'content-type')?.[1] ?? 'application/text';
|
|
10
10
|
|
|
11
11
|
if (contentType.includes('json')) {
|
|
12
|
-
|
|
12
|
+
const parsed = await responseObj.json();
|
|
13
|
+
|
|
14
|
+
errorResp = {
|
|
15
|
+
code,
|
|
16
|
+
...parsed,
|
|
17
|
+
message: parsed?.message || parsed?.errors?.[0]?.message || 'something went wrong'
|
|
18
|
+
};
|
|
13
19
|
} else {
|
|
14
20
|
try {
|
|
15
21
|
errorResp = { code, message: await responseObj.text() };
|