@k-int/stripes-kint-components 5.29.0 → 5.30.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +14 -0
- package/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/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 +23 -35
- 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 +14 -17
- 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 +18 -26
- 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/TableBody/TableBody.js +42 -52
- package/es/lib/SASQRoute/SASQRoute.js +25 -29
- package/es/lib/SASQViewComponent/SASQViewComponent.js +68 -76
- 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/EditableSettingsList.js +26 -8
- package/es/lib/Settings/EditableSettingsList/EditableSettingsListFieldArray/EditableSettingsListFieldArray.js +31 -33
- package/es/lib/Settings/EditableSettingsList/EditableSettingsListFieldArray/EditableSettingsListFieldArray.test.js +8 -2
- package/es/lib/Settings/EditableSettingsList/SettingField/EditSettingValue/EditSettingValue.js +17 -23
- package/es/lib/Settings/EditableSettingsList/SettingField/EditSettingValue/EditSettingValue.test.js +29 -44
- package/es/lib/Settings/EditableSettingsList/SettingField/RenderSettingValue/RenderSettingValue.js +10 -12
- package/es/lib/Settings/EditableSettingsList/SettingField/SettingField.js +50 -29
- package/es/lib/Settings/EditableSettingsList/SettingField/SettingField.test.js +5 -3
- package/es/lib/Settings/RefdataCategoriesSettings/RefdataCategoriesSettings.js +19 -26
- package/es/lib/Settings/SettingPage/SettingPage.js +3 -0
- package/es/lib/Settings/SettingPage/SettingPagePane/SettingPagePane.js +2 -2
- package/es/lib/Settings/SettingsFormContainer/SettingsFormContainer.js +30 -35
- package/es/lib/Settings/StaticSettingsField/StaticSettingsField.js +8 -65
- package/es/lib/Settings/StaticSettingsField/StaticSettingsFieldComponent/StaticSettingsFieldComponent.js +60 -0
- package/es/lib/Settings/StaticSettingsField/StaticSettingsFieldComponent/index.js +13 -0
- package/es/lib/Settings/StaticSettingsField/index.js +8 -1
- package/es/lib/Settings/constants/queryKeys.js +10 -1
- 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 +17 -17
- package/es/lib/Settings/hooks/useSettings/useSettings.js +60 -60
- package/es/lib/Settings/index.js +9 -2
- package/es/lib/Tags/Tags.js +5 -8
- package/es/lib/Tags/hooks/useTags.js +1 -1
- package/es/lib/Tags/hooks/useTagsEnabled.js +34 -4
- package/es/lib/Tags/tagsConfig.js +1 -1
- package/es/lib/Typedown/Typedown.js +21 -28
- package/es/lib/constants/endpoints.js +7 -2
- 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 +2 -2
- 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/matchString.js +5 -7
- 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/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/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 +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 +1 -1
- 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 +94 -28
- package/src/artifacts/coverage-jest/Settings/EditableSettingsList/EditableSettingsListFieldArray/EditableSettingsListFieldArray.js.html +50 -44
- package/src/artifacts/coverage-jest/Settings/EditableSettingsList/EditableSettingsListFieldArray/index.html +19 -19
- 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 +20 -11
- package/src/artifacts/coverage-jest/Settings/EditableSettingsList/SettingField/EditSettingValue/index.html +5 -5
- 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 +118 -31
- package/src/artifacts/coverage-jest/Settings/EditableSettingsList/SettingField/index.html +19 -19
- package/src/artifacts/coverage-jest/Settings/EditableSettingsList/SettingField/index.js.html +1 -1
- package/src/artifacts/coverage-jest/Settings/EditableSettingsList/index.html +15 -15
- 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 +5 -2
- 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/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 +18 -198
- package/src/artifacts/coverage-jest/Settings/StaticSettingsField/StaticSettingsFieldComponent/StaticSettingsFieldComponent.js.html +211 -0
- package/src/artifacts/coverage-jest/Settings/StaticSettingsField/StaticSettingsFieldComponent/index.html +131 -0
- package/src/artifacts/coverage-jest/Settings/StaticSettingsField/StaticSettingsFieldComponent/index.js.html +88 -0
- package/src/artifacts/coverage-jest/Settings/StaticSettingsField/index.html +19 -19
- package/src/artifacts/coverage-jest/Settings/StaticSettingsField/index.js.html +6 -3
- package/src/artifacts/coverage-jest/Settings/constants/index.html +17 -17
- package/src/artifacts/coverage-jest/Settings/constants/index.js.html +1 -1
- package/src/artifacts/coverage-jest/Settings/constants/queryKeys.js.html +43 -10
- 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 +13 -13
- package/src/artifacts/coverage-jest/Settings/hooks/useSettingSection/index.js.html +1 -1
- package/src/artifacts/coverage-jest/Settings/hooks/useSettingSection/useSettingSection.js.html +21 -9
- 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 +2 -2
- package/src/artifacts/coverage-jest/Tags/Tags.js.html +1 -1
- package/src/artifacts/coverage-jest/Tags/hooks/index.html +15 -15
- 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 +150 -12
- 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 +231 -156
- 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 +23 -5
- package/src/artifacts/coverage-jest/constants/eventCodes.js.html +1 -1
- package/src/artifacts/coverage-jest/constants/index.html +5 -5
- 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 +1 -1
- 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 +1 -1
- 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 +1 -1
- 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 +1 -1
- package/src/artifacts/coverage-jest/hooks/useLocalPageStore.js.html +1 -1
- package/src/artifacts/coverage-jest/hooks/useLocalStorageState.js.html +1 -1
- 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 +1 -1
- package/src/artifacts/coverage-jest/hooks/useQIndex.js.html +1 -1
- 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 +89 -74
- 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/highlightString.js.html +1 -1
- package/src/artifacts/coverage-jest/utils/index.html +1 -1
- package/src/artifacts/coverage-jest/utils/index.js.html +1 -1
- package/src/artifacts/coverage-jest/utils/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 +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/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/EditableSettingsList/EditableSettingsList.js +42 -20
- package/src/lib/Settings/EditableSettingsList/EditableSettingsListFieldArray/EditableSettingsListFieldArray.js +27 -25
- package/src/lib/Settings/EditableSettingsList/EditableSettingsListFieldArray/EditableSettingsListFieldArray.test.js +2 -0
- package/src/lib/Settings/EditableSettingsList/SettingField/EditSettingValue/EditSettingValue.js +9 -6
- package/src/lib/Settings/EditableSettingsList/SettingField/EditSettingValue/EditSettingValue.test.js +29 -44
- package/src/lib/Settings/EditableSettingsList/SettingField/SettingField.js +49 -20
- package/src/lib/Settings/EditableSettingsList/SettingField/SettingField.test.js +2 -0
- package/src/lib/Settings/SettingPage/SettingPage.js +1 -0
- package/src/lib/Settings/StaticSettingsField/StaticSettingsField.js +8 -68
- package/src/lib/Settings/StaticSettingsField/StaticSettingsFieldComponent/StaticSettingsFieldComponent.js +42 -0
- package/src/lib/Settings/StaticSettingsField/StaticSettingsFieldComponent/index.js +1 -0
- package/src/lib/Settings/StaticSettingsField/index.js +2 -1
- package/src/lib/Settings/constants/queryKeys.js +12 -1
- package/src/lib/Settings/hooks/useSettingSection/useSettingSection.js +6 -2
- package/src/lib/Settings/index.js +1 -1
- package/src/lib/Tags/hooks/useTagsEnabled.js +51 -5
- package/src/lib/constants/endpoints.js +7 -1
|
@@ -115,7 +115,7 @@ export default sortByLabel;
|
|
|
115
115
|
<div class='footer quiet pad2 space-top1 center small'>
|
|
116
116
|
Code coverage generated by
|
|
117
117
|
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
|
|
118
|
-
at 2025-
|
|
118
|
+
at 2025-12-10T12:12:10.913Z
|
|
119
119
|
</div>
|
|
120
120
|
<script src="../prettify.js"></script>
|
|
121
121
|
<script>
|
|
@@ -112,7 +112,7 @@ export default toCamelCase;
|
|
|
112
112
|
<div class='footer quiet pad2 space-top1 center small'>
|
|
113
113
|
Code coverage generated by
|
|
114
114
|
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
|
|
115
|
-
at 2025-
|
|
115
|
+
at 2025-12-10T12:12:10.913Z
|
|
116
116
|
</div>
|
|
117
117
|
<script src="../prettify.js"></script>
|
|
118
118
|
<script>
|
|
@@ -97,7 +97,7 @@ export default typedownQueryKey;
|
|
|
97
97
|
<div class='footer quiet pad2 space-top1 center small'>
|
|
98
98
|
Code coverage generated by
|
|
99
99
|
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
|
|
100
|
-
at 2025-
|
|
100
|
+
at 2025-12-10T12:12:10.913Z
|
|
101
101
|
</div>
|
|
102
102
|
<script src="../prettify.js"></script>
|
|
103
103
|
<script>
|
|
@@ -116,7 +116,7 @@
|
|
|
116
116
|
<div class='footer quiet pad2 space-top1 center small'>
|
|
117
117
|
Code coverage generated by
|
|
118
118
|
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
|
|
119
|
-
at 2025-
|
|
119
|
+
at 2025-12-10T12:12:10.913Z
|
|
120
120
|
</div>
|
|
121
121
|
<script src="../prettify.js"></script>
|
|
122
122
|
<script>
|
|
@@ -73,7 +73,7 @@
|
|
|
73
73
|
<div class='footer quiet pad2 space-top1 center small'>
|
|
74
74
|
Code coverage generated by
|
|
75
75
|
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
|
|
76
|
-
at 2025-
|
|
76
|
+
at 2025-12-10T12:12:10.913Z
|
|
77
77
|
</div>
|
|
78
78
|
<script src="../prettify.js"></script>
|
|
79
79
|
<script>
|
|
@@ -355,7 +355,7 @@ export {
|
|
|
355
355
|
<div class='footer quiet pad2 space-top1 center small'>
|
|
356
356
|
Code coverage generated by
|
|
357
357
|
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
|
|
358
|
-
at 2025-
|
|
358
|
+
at 2025-12-10T12:12:10.913Z
|
|
359
359
|
</div>
|
|
360
360
|
<script src="../prettify.js"></script>
|
|
361
361
|
<script>
|
|
@@ -6,16 +6,28 @@ import arrayMutators from 'final-form-arrays';
|
|
|
6
6
|
import EditableSettingsListFieldArray from './EditableSettingsListFieldArray';
|
|
7
7
|
|
|
8
8
|
const EditableSettingsList = ({
|
|
9
|
-
allowEdit = true, // A
|
|
10
|
-
data,
|
|
9
|
+
allowEdit = true, // A global boolean permission to turn on/off editing of all appSettings in the frontend
|
|
11
10
|
initialValues,
|
|
12
11
|
intlKey: passedIntlKey,
|
|
13
12
|
intlNS: passedIntlNS,
|
|
14
13
|
label,
|
|
15
14
|
labelOverrides = {},
|
|
16
15
|
onSave,
|
|
17
|
-
render // Experimental idea, allow unique rendering per setting?
|
|
16
|
+
render, // Experimental idea, allow unique rendering per setting?
|
|
17
|
+
settingData
|
|
18
18
|
}) => {
|
|
19
|
+
// Fake the form save... this is super bad I know, but it's very old code and the plan is to get rid of this component
|
|
20
|
+
// Because it's in a single Form even though each setting really requires it's own form. It'd be more work to unpick that
|
|
21
|
+
// without accidentally causing some backwards compatibility issues I think. So for now we fake it
|
|
22
|
+
|
|
23
|
+
let settingToSave;
|
|
24
|
+
const handleFormSubmit = async (_values) => {
|
|
25
|
+
return onSave(settingToSave).then((res) => {
|
|
26
|
+
settingToSave = undefined;
|
|
27
|
+
return res;
|
|
28
|
+
});
|
|
29
|
+
};
|
|
30
|
+
|
|
19
31
|
return (
|
|
20
32
|
<Form
|
|
21
33
|
enableReinitialize
|
|
@@ -23,25 +35,35 @@ const EditableSettingsList = ({
|
|
|
23
35
|
keepDirtyOnReinitialize
|
|
24
36
|
mutators={arrayMutators}
|
|
25
37
|
navigationCheck
|
|
26
|
-
onSubmit={
|
|
38
|
+
onSubmit={handleFormSubmit}
|
|
27
39
|
subscription={{ value: true }}
|
|
28
40
|
>
|
|
29
|
-
{({ handleSubmit }) =>
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
41
|
+
{({ handleSubmit }) => {
|
|
42
|
+
// Set up the setting we want to save, then trigger handleSubmit so we get "submitting" in the form.
|
|
43
|
+
// Yes this is ugly
|
|
44
|
+
const handleSave = async (setting) => {
|
|
45
|
+
settingToSave = setting;
|
|
46
|
+
return handleSubmit();
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
return (
|
|
50
|
+
<form onSubmit={handleSubmit}>
|
|
51
|
+
<FieldArray
|
|
52
|
+
key="editable-setting-list-field-array"
|
|
53
|
+
allowEdit={allowEdit}
|
|
54
|
+
component={EditableSettingsListFieldArray}
|
|
55
|
+
intlKey={passedIntlKey}
|
|
56
|
+
intlNS={passedIntlNS}
|
|
57
|
+
label={label}
|
|
58
|
+
labelOverrides={labelOverrides}
|
|
59
|
+
name="settings"
|
|
60
|
+
onSave={handleSave}
|
|
61
|
+
render={render}
|
|
62
|
+
settingData={settingData}
|
|
63
|
+
/>
|
|
64
|
+
</form>
|
|
65
|
+
);
|
|
66
|
+
}}
|
|
45
67
|
</Form>
|
|
46
68
|
);
|
|
47
69
|
};
|
|
@@ -7,7 +7,6 @@ import { SettingField } from '../SettingField';
|
|
|
7
7
|
|
|
8
8
|
const EditableSettingsListField = ({
|
|
9
9
|
allowEdit,
|
|
10
|
-
data,
|
|
11
10
|
fields,
|
|
12
11
|
handleSave,
|
|
13
12
|
index,
|
|
@@ -15,20 +14,25 @@ const EditableSettingsListField = ({
|
|
|
15
14
|
intlNS,
|
|
16
15
|
labelOverrides,
|
|
17
16
|
render,
|
|
18
|
-
setting
|
|
17
|
+
setting,
|
|
18
|
+
settingData: passedSettingData,
|
|
19
19
|
}) => {
|
|
20
20
|
// Handle editing or not at this level
|
|
21
21
|
const [editing, setEditing] = useState(false);
|
|
22
|
+
// This is really grim.
|
|
23
|
+
// Set up whether this setting is submitting or not.
|
|
24
|
+
// Submitting in the form level applies to ALL
|
|
25
|
+
const [settingSubmitting, setSettingSubmitting] = useState(false);
|
|
26
|
+
|
|
22
27
|
|
|
23
28
|
const settingData = useMemo(() => ({
|
|
24
|
-
currentSetting:
|
|
25
|
-
...
|
|
26
|
-
}), [
|
|
29
|
+
currentSetting: passedSettingData.settings[index],
|
|
30
|
+
...passedSettingData,
|
|
31
|
+
}), [index, passedSettingData]);
|
|
27
32
|
|
|
28
33
|
const DefaultField = useCallback(() => {
|
|
29
34
|
return (
|
|
30
35
|
<Field
|
|
31
|
-
key={setting}
|
|
32
36
|
allowEdit={allowEdit}
|
|
33
37
|
component={SettingField}
|
|
34
38
|
data-testid={`editableSettingsListFieldArray[${index}]`}
|
|
@@ -36,17 +40,23 @@ const EditableSettingsListField = ({
|
|
|
36
40
|
intlKey={intlKey}
|
|
37
41
|
intlNS={intlNS}
|
|
38
42
|
labelOverrides={labelOverrides}
|
|
39
|
-
name={setting}
|
|
40
|
-
onSave={
|
|
43
|
+
name={`${setting}.value`}
|
|
44
|
+
onSave={handleSave}
|
|
45
|
+
parse={v => v}
|
|
41
46
|
setEditing={setEditing}
|
|
47
|
+
setSettingSubmitting={setSettingSubmitting}
|
|
42
48
|
settingData={settingData}
|
|
49
|
+
settingSubmitting={settingSubmitting}
|
|
43
50
|
/>
|
|
44
51
|
);
|
|
45
|
-
}, [allowEdit, editing, handleSave, index, intlKey, intlNS, labelOverrides, setting, settingData]);
|
|
52
|
+
}, [allowEdit, editing, handleSave, index, intlKey, intlNS, labelOverrides, setting, settingData, settingSubmitting]);
|
|
53
|
+
|
|
54
|
+
if (!render || render instanceof Function) {
|
|
55
|
+
return <DefaultField key={`${setting}-default-field`} />;
|
|
56
|
+
}
|
|
46
57
|
|
|
47
58
|
return render({
|
|
48
59
|
allowEdit,
|
|
49
|
-
data,
|
|
50
60
|
DefaultField,
|
|
51
61
|
editing,
|
|
52
62
|
fields,
|
|
@@ -55,47 +65,39 @@ const EditableSettingsListField = ({
|
|
|
55
65
|
intlKey,
|
|
56
66
|
intlNS,
|
|
57
67
|
setEditing,
|
|
68
|
+
setSettingSubmitting,
|
|
58
69
|
setting,
|
|
59
70
|
settingData,
|
|
60
71
|
SettingFieldComponent: SettingField,
|
|
72
|
+
settingSubmitting
|
|
61
73
|
});
|
|
62
74
|
};
|
|
63
75
|
|
|
64
76
|
const EditableSettingsListFieldArray = ({
|
|
65
77
|
allowEdit: passedAllowEdit = true,
|
|
66
|
-
data: passedData,
|
|
67
78
|
fields: passedFields,
|
|
68
79
|
intlKey: passedIntlKey,
|
|
69
80
|
intlNS: passedIntlNS,
|
|
70
81
|
labelOverrides = {},
|
|
71
82
|
onSave,
|
|
72
|
-
render
|
|
73
|
-
|
|
74
|
-
}) => {
|
|
75
|
-
return (
|
|
76
|
-
<DefaultField />
|
|
77
|
-
);
|
|
78
|
-
}
|
|
83
|
+
render,
|
|
84
|
+
settingData
|
|
79
85
|
}) => {
|
|
80
|
-
const handleSave = (index) => {
|
|
81
|
-
const setting = passedFields.value[index];
|
|
82
|
-
return onSave(setting);
|
|
83
|
-
};
|
|
84
|
-
|
|
85
86
|
return (
|
|
86
87
|
passedFields.map((setting, i) => {
|
|
87
88
|
return (
|
|
88
89
|
<EditableSettingsListField
|
|
90
|
+
key={setting}
|
|
89
91
|
allowEdit={passedAllowEdit}
|
|
90
|
-
data={passedData}
|
|
91
92
|
fields={passedFields}
|
|
92
|
-
handleSave={
|
|
93
|
+
handleSave={onSave}
|
|
93
94
|
index={i}
|
|
94
95
|
intlKey={passedIntlKey}
|
|
95
96
|
intlNS={passedIntlNS}
|
|
96
97
|
labelOverrides={labelOverrides}
|
|
97
98
|
render={render}
|
|
98
99
|
setting={setting}
|
|
100
|
+
settingData={settingData}
|
|
99
101
|
/>
|
|
100
102
|
);
|
|
101
103
|
})
|
|
@@ -74,6 +74,7 @@ describe('EditableSettingsListFieldArray', () => {
|
|
|
74
74
|
<FieldArray
|
|
75
75
|
component={EditableSettingsListFieldArray}
|
|
76
76
|
name="settings"
|
|
77
|
+
settingData={{ settings }}
|
|
77
78
|
/>
|
|
78
79
|
</TestForm>
|
|
79
80
|
);
|
|
@@ -96,6 +97,7 @@ describe('EditableSettingsListFieldArray', () => {
|
|
|
96
97
|
<FieldArray
|
|
97
98
|
component={EditableSettingsListFieldArray}
|
|
98
99
|
name="settings"
|
|
100
|
+
settingData={{ settings: multipleSettings }}
|
|
99
101
|
/>
|
|
100
102
|
</TestForm>
|
|
101
103
|
);
|
package/src/lib/Settings/EditableSettingsList/SettingField/EditSettingValue/EditSettingValue.js
CHANGED
|
@@ -1,28 +1,31 @@
|
|
|
1
|
+
import { useMemo } from 'react';
|
|
2
|
+
|
|
1
3
|
import PropTypes from 'prop-types';
|
|
2
4
|
|
|
3
5
|
import { useKintIntl } from '../../../../hooks';
|
|
4
|
-
import
|
|
6
|
+
import { StaticSettingsFieldComponent } from '../../../StaticSettingsField';
|
|
5
7
|
|
|
6
8
|
const EditSettingValue = ({
|
|
7
9
|
currentSetting: setting,
|
|
8
|
-
input,
|
|
9
10
|
intlKey: passedIntlKey,
|
|
10
11
|
intlNS: passedIntlNS,
|
|
11
12
|
labelOverrides = {},
|
|
13
|
+
name,
|
|
12
14
|
...props
|
|
13
15
|
}) => {
|
|
14
16
|
const kintIntl = useKintIntl(passedIntlKey, passedIntlNS);
|
|
15
17
|
|
|
16
|
-
const fieldLabel = kintIntl.formatKintMessage({
|
|
18
|
+
const fieldLabel = useMemo(() => kintIntl.formatKintMessage({
|
|
17
19
|
id: 'settings.valueFor',
|
|
18
20
|
overrideValue: labelOverrides?.valueFor
|
|
19
|
-
}, { name: setting.key });
|
|
21
|
+
}, { name: setting.key }), [kintIntl, labelOverrides?.valueFor, setting.key]);
|
|
20
22
|
|
|
21
23
|
return (
|
|
22
|
-
<
|
|
24
|
+
<StaticSettingsFieldComponent
|
|
25
|
+
key={`static-render-function-${name}`}
|
|
23
26
|
aria-label={fieldLabel}
|
|
24
27
|
autofocus
|
|
25
|
-
name={
|
|
28
|
+
name={name}
|
|
26
29
|
setting={setting}
|
|
27
30
|
{...props}
|
|
28
31
|
/>
|
package/src/lib/Settings/EditableSettingsList/SettingField/EditSettingValue/EditSettingValue.test.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { Field } from 'react-final-form';
|
|
1
2
|
import { TestForm } from '@folio/stripes-erm-testing';
|
|
2
3
|
|
|
3
4
|
import EditSettingValue from './EditSettingValue';
|
|
@@ -103,11 +104,10 @@ describe('EditSettingValue', () => {
|
|
|
103
104
|
initialValues={{}}
|
|
104
105
|
onSubmit={onSubmit}
|
|
105
106
|
>
|
|
106
|
-
<
|
|
107
|
+
<Field
|
|
108
|
+
component={EditSettingValue}
|
|
107
109
|
currentSetting={stringSetting}
|
|
108
|
-
|
|
109
|
-
name: 'test'
|
|
110
|
-
}}
|
|
110
|
+
name="test"
|
|
111
111
|
/>
|
|
112
112
|
</TestForm>
|
|
113
113
|
);
|
|
@@ -124,17 +124,14 @@ describe('EditSettingValue', () => {
|
|
|
124
124
|
renderComponent = renderWithKintHarness(
|
|
125
125
|
<TestForm
|
|
126
126
|
initialValues={{
|
|
127
|
-
test:
|
|
128
|
-
value: stringSetting.value
|
|
129
|
-
}
|
|
127
|
+
test: stringSetting.value
|
|
130
128
|
}}
|
|
131
129
|
onSubmit={onSubmit}
|
|
132
130
|
>
|
|
133
|
-
<
|
|
131
|
+
<Field
|
|
132
|
+
component={EditSettingValue}
|
|
134
133
|
currentSetting={stringSetting}
|
|
135
|
-
|
|
136
|
-
name: 'test'
|
|
137
|
-
}}
|
|
134
|
+
name="test"
|
|
138
135
|
/>
|
|
139
136
|
</TestForm>
|
|
140
137
|
);
|
|
@@ -159,11 +156,10 @@ describe('EditSettingValue', () => {
|
|
|
159
156
|
initialValues={{}}
|
|
160
157
|
onSubmit={onSubmit}
|
|
161
158
|
>
|
|
162
|
-
<
|
|
159
|
+
<Field
|
|
160
|
+
component={EditSettingValue}
|
|
163
161
|
currentSetting={refdataSetting}
|
|
164
|
-
|
|
165
|
-
name: 'test'
|
|
166
|
-
}}
|
|
162
|
+
name="test"
|
|
167
163
|
refdata={refdata}
|
|
168
164
|
/>
|
|
169
165
|
</TestForm>
|
|
@@ -190,17 +186,14 @@ describe('EditSettingValue', () => {
|
|
|
190
186
|
renderComponent = renderWithKintHarness(
|
|
191
187
|
<TestForm
|
|
192
188
|
initialValues={{
|
|
193
|
-
test:
|
|
194
|
-
value: refdataSetting.value
|
|
195
|
-
}
|
|
189
|
+
test: refdataSetting.value
|
|
196
190
|
}}
|
|
197
191
|
onSubmit={onSubmit}
|
|
198
192
|
>
|
|
199
|
-
<
|
|
193
|
+
<Field
|
|
194
|
+
component={EditSettingValue}
|
|
200
195
|
currentSetting={refdataSetting}
|
|
201
|
-
|
|
202
|
-
name: 'test'
|
|
203
|
-
}}
|
|
196
|
+
name="test"
|
|
204
197
|
refdata={refdata}
|
|
205
198
|
/>
|
|
206
199
|
</TestForm>
|
|
@@ -230,11 +223,10 @@ describe('EditSettingValue', () => {
|
|
|
230
223
|
initialValues={{}}
|
|
231
224
|
onSubmit={onSubmit}
|
|
232
225
|
>
|
|
233
|
-
<
|
|
226
|
+
<Field
|
|
227
|
+
component={EditSettingValue}
|
|
234
228
|
currentSetting={refdataSetting}
|
|
235
|
-
|
|
236
|
-
name: 'test'
|
|
237
|
-
}}
|
|
229
|
+
name="test"
|
|
238
230
|
refdata={moreRefdata}
|
|
239
231
|
/>
|
|
240
232
|
</TestForm>
|
|
@@ -262,17 +254,14 @@ describe('EditSettingValue', () => {
|
|
|
262
254
|
renderComponent = renderWithKintHarness(
|
|
263
255
|
<TestForm
|
|
264
256
|
initialValues={{
|
|
265
|
-
test:
|
|
266
|
-
value: refdataSetting.value
|
|
267
|
-
}
|
|
257
|
+
test: refdataSetting.value
|
|
268
258
|
}}
|
|
269
259
|
onSubmit={onSubmit}
|
|
270
260
|
>
|
|
271
|
-
<
|
|
261
|
+
<Field
|
|
262
|
+
component={EditSettingValue}
|
|
272
263
|
currentSetting={refdataSetting}
|
|
273
|
-
|
|
274
|
-
name: 'test'
|
|
275
|
-
}}
|
|
264
|
+
name="test"
|
|
276
265
|
refdata={moreRefdata}
|
|
277
266
|
/>
|
|
278
267
|
</TestForm>
|
|
@@ -305,11 +294,10 @@ describe('EditSettingValue', () => {
|
|
|
305
294
|
initialValues={{}}
|
|
306
295
|
onSubmit={onSubmit}
|
|
307
296
|
>
|
|
308
|
-
<
|
|
297
|
+
<Field
|
|
298
|
+
component={EditSettingValue}
|
|
309
299
|
currentSetting={templateSetting}
|
|
310
|
-
|
|
311
|
-
name: 'test'
|
|
312
|
-
}}
|
|
300
|
+
name="test"
|
|
313
301
|
templates={templates}
|
|
314
302
|
/>
|
|
315
303
|
</TestForm>
|
|
@@ -339,17 +327,14 @@ describe('EditSettingValue', () => {
|
|
|
339
327
|
renderComponent = renderWithKintHarness(
|
|
340
328
|
<TestForm
|
|
341
329
|
initialValues={{
|
|
342
|
-
test:
|
|
343
|
-
value: templateSetting.value
|
|
344
|
-
}
|
|
330
|
+
test: templateSetting.value
|
|
345
331
|
}}
|
|
346
332
|
onSubmit={onSubmit}
|
|
347
333
|
>
|
|
348
|
-
<
|
|
334
|
+
<Field
|
|
335
|
+
component={EditSettingValue}
|
|
349
336
|
currentSetting={templateSetting}
|
|
350
|
-
|
|
351
|
-
name: 'test'
|
|
352
|
-
}}
|
|
337
|
+
name="test"
|
|
353
338
|
templates={templates}
|
|
354
339
|
/>
|
|
355
340
|
</TestForm>
|
|
@@ -1,10 +1,12 @@
|
|
|
1
|
-
import { useContext } from 'react';
|
|
1
|
+
import { useCallback, useContext, useMemo } from 'react';
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
|
+
import { useFormState } from 'react-final-form';
|
|
3
4
|
|
|
4
5
|
import {
|
|
5
6
|
Button,
|
|
6
7
|
Card,
|
|
7
8
|
InfoPopover,
|
|
9
|
+
Spinner,
|
|
8
10
|
} from '@folio/stripes/components';
|
|
9
11
|
|
|
10
12
|
import EditSettingValue from './EditSettingValue';
|
|
@@ -22,16 +24,25 @@ const SettingField = (settingFieldProps) => {
|
|
|
22
24
|
intlKey: passedIntlKey,
|
|
23
25
|
intlNS: passedIntlNS,
|
|
24
26
|
labelOverrides = {},
|
|
27
|
+
name,
|
|
25
28
|
onSave,
|
|
26
29
|
setEditing,
|
|
27
30
|
settingData: {
|
|
28
31
|
currentSetting
|
|
29
|
-
} = {}
|
|
32
|
+
} = {},
|
|
33
|
+
setSettingSubmitting,
|
|
34
|
+
settingSubmitting,
|
|
30
35
|
} = settingFieldProps;
|
|
31
36
|
|
|
32
37
|
const kintIntl = useKintIntl(passedIntlKey, passedIntlNS);
|
|
33
38
|
const { refdataEndpoint, templateEndpoint } = useContext(SettingsContext);
|
|
34
39
|
|
|
40
|
+
const {
|
|
41
|
+
submitting,
|
|
42
|
+
invalid,
|
|
43
|
+
values
|
|
44
|
+
} = useFormState();
|
|
45
|
+
|
|
35
46
|
const {
|
|
36
47
|
0: {
|
|
37
48
|
values: refdata = []
|
|
@@ -53,7 +64,7 @@ const SettingField = (settingFieldProps) => {
|
|
|
53
64
|
}
|
|
54
65
|
});
|
|
55
66
|
|
|
56
|
-
const renderHelpText = (helpTextId) => {
|
|
67
|
+
const renderHelpText = useCallback((helpTextId) => {
|
|
57
68
|
return (
|
|
58
69
|
<div className={renderHelpTextCSS.help}>
|
|
59
70
|
{
|
|
@@ -74,9 +85,9 @@ const SettingField = (settingFieldProps) => {
|
|
|
74
85
|
}
|
|
75
86
|
</div>
|
|
76
87
|
);
|
|
77
|
-
};
|
|
88
|
+
}, [kintIntl]);
|
|
78
89
|
|
|
79
|
-
const renderEditButton = () => {
|
|
90
|
+
const renderEditButton = useCallback(() => {
|
|
80
91
|
const EditText = editing ?
|
|
81
92
|
kintIntl.formatKintMessage({
|
|
82
93
|
id: 'save'
|
|
@@ -85,36 +96,51 @@ const SettingField = (settingFieldProps) => {
|
|
|
85
96
|
id: 'edit'
|
|
86
97
|
});
|
|
87
98
|
if (allowEdit) {
|
|
99
|
+
// This is unbelievably gross... this stems from this all being in a single FieldArray.
|
|
100
|
+
// We should aim to set this up in an ActionList as soon as possible
|
|
101
|
+
const settingToSave = values.settings?.find(s => s.id === currentSetting.id);
|
|
102
|
+
|
|
88
103
|
return (
|
|
89
104
|
<Button
|
|
105
|
+
disabled={editing && (submitting || invalid)}
|
|
90
106
|
marginBottom0
|
|
91
107
|
onClick={(e) => {
|
|
92
108
|
e.preventDefault();
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
109
|
+
if (editing) {
|
|
110
|
+
setSettingSubmitting(true);
|
|
111
|
+
// We want to track that JUST this setting is being edited,
|
|
112
|
+
// since "Submitting" is relevant for any and all submits
|
|
113
|
+
// I hate this
|
|
114
|
+
return onSave(settingToSave)
|
|
115
|
+
.then(() => {
|
|
116
|
+
setEditing(false);
|
|
117
|
+
setSettingSubmitting(false);
|
|
118
|
+
});
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
return setEditing(true);
|
|
98
122
|
}}
|
|
99
123
|
>
|
|
124
|
+
{(submitting && settingSubmitting) ? <Spinner /> : null}
|
|
100
125
|
{EditText}
|
|
101
126
|
</Button>
|
|
102
127
|
);
|
|
103
128
|
}
|
|
104
129
|
return null;
|
|
105
|
-
};
|
|
130
|
+
}, [allowEdit, currentSetting.id, editing, invalid, kintIntl, onSave, setEditing, setSettingSubmitting, settingSubmitting, submitting, values.settings]);
|
|
106
131
|
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
132
|
+
const RenderFunction = useMemo(() => {
|
|
133
|
+
if (editing === false) {
|
|
134
|
+
return RenderSettingValue;
|
|
135
|
+
} else {
|
|
136
|
+
return EditSettingValue;
|
|
137
|
+
}
|
|
138
|
+
}, [editing]);
|
|
113
139
|
|
|
114
|
-
const id = `settings.${toCamelCase(currentSetting.section)}.${toCamelCase(currentSetting.key)}.help
|
|
140
|
+
const id = useMemo(() => `settings.${toCamelCase(currentSetting.section)}.${toCamelCase(currentSetting.key)}.help`, [currentSetting.key, currentSetting.section]);
|
|
115
141
|
|
|
116
142
|
|
|
117
|
-
const renderHeaderStart = () => {
|
|
143
|
+
const renderHeaderStart = useCallback(() => {
|
|
118
144
|
const settingName = Object.keys(currentSetting).length > 0 ?
|
|
119
145
|
kintIntl.formatKintMessage({
|
|
120
146
|
id: `settings.${toCamelCase(currentSetting.section)}.${toCamelCase(currentSetting.key)}`
|
|
@@ -130,16 +156,19 @@ const SettingField = (settingFieldProps) => {
|
|
|
130
156
|
{settingName}
|
|
131
157
|
</>
|
|
132
158
|
);
|
|
133
|
-
};
|
|
159
|
+
}, [currentSetting, id, kintIntl, renderHelpText]);
|
|
134
160
|
|
|
135
161
|
return (
|
|
136
162
|
<Card
|
|
163
|
+
key={`setting-edit-card-${name}`}
|
|
137
164
|
headerEnd={renderEditButton()}
|
|
138
165
|
headerStart={renderHeaderStart()}
|
|
139
166
|
roundedBorder
|
|
140
167
|
>
|
|
141
168
|
<RenderFunction
|
|
169
|
+
key={`setting-render-function-${name}`}
|
|
142
170
|
currentSetting={currentSetting}
|
|
171
|
+
disabled={submitting}
|
|
143
172
|
intlKey={passedIntlKey}
|
|
144
173
|
intlNS={passedIntlNS}
|
|
145
174
|
labelOverrides={labelOverrides}
|
|
@@ -26,6 +26,7 @@ const setting = {
|
|
|
26
26
|
};
|
|
27
27
|
|
|
28
28
|
const setEditing = jest.fn();
|
|
29
|
+
const setSettingSubmitting = jest.fn();
|
|
29
30
|
|
|
30
31
|
let renderComponent;
|
|
31
32
|
describe('SettingField', () => {
|
|
@@ -63,6 +64,7 @@ describe('SettingField', () => {
|
|
|
63
64
|
name="test"
|
|
64
65
|
onSave={onSave}
|
|
65
66
|
setEditing={setEditing}
|
|
67
|
+
setSettingSubmitting={setSettingSubmitting}
|
|
66
68
|
settingData={{
|
|
67
69
|
currentSetting: setting
|
|
68
70
|
}}
|