@k-int/stripes-kint-components 3.2.2 → 3.2.3
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 +3 -0
- package/es/lib/ActionList/ActionListFieldArray.js +2 -2
- package/es/lib/CustomProperties/Config/CustomPropertiesLookup.js +2 -2
- package/es/lib/CustomProperties/Config/CustomPropertiesSettings.js +22 -24
- package/es/lib/CustomProperties/Config/CustomPropertiesSettings.test.js +26 -32
- package/es/lib/CustomProperties/Config/CustomPropertyForm.js +2 -2
- package/es/lib/CustomProperties/Config/CustomPropertyForm.test.js +39 -47
- package/es/lib/CustomProperties/Config/CustomPropertyView.test.js +82 -100
- package/es/lib/CustomProperties/Edit/CustomPropertiesListField.js +2 -2
- package/es/lib/CustomProperties/Edit/CustomPropertiesListField.test.js +22 -28
- package/es/lib/CustomProperties/Edit/CustomPropertyField.js +1 -1
- package/es/lib/CustomProperties/Edit/CustomPropertyField.test.js +69 -85
- package/es/lib/CustomProperties/Filter/CustomPropertiesFilter.js +2 -2
- package/es/lib/CustomProperties/Filter/CustomPropertiesFilter.test.js +26 -32
- package/es/lib/CustomProperties/Filter/CustomPropertiesFilterField.js +2 -2
- package/es/lib/CustomProperties/Filter/CustomPropertiesFilterFieldArray.test.js +15 -19
- package/es/lib/CustomProperties/Filter/CustomPropertiesFilterForm.test.js +17 -21
- package/es/lib/CustomProperties/Filter/CustomPropertiesRule.test.js +129 -161
- package/es/lib/CustomProperties/Filter/useParseActiveFilterStrings.js +2 -2
- package/es/lib/CustomProperties/View/CustomPropertiesViewCtx.js +2 -2
- package/es/lib/CustomProperties/View/CustomPropertyCard.js +2 -2
- package/es/lib/CycleButton/CycleButton.js +2 -2
- package/es/lib/EditableRefdataCategoryList/EditableRefdataCategoryList.js +22 -24
- package/es/lib/EditableRefdataList/EditableRefdataList.js +25 -27
- package/es/lib/EditableSettingsList/EditableSettingsListFieldArray.test.js +44 -50
- package/es/lib/EditableSettingsList/SettingField/EditSettingValue.js +1 -1
- package/es/lib/EditableSettingsList/SettingField/RenderSettingValue.test.js +139 -163
- package/es/lib/EditableSettingsList/SettingField/SettingField.js +9 -9
- package/es/lib/EditableSettingsList/SettingField/SettingField.test.js +117 -133
- package/es/lib/IconSelect/IconSelect.js +2 -2
- package/es/lib/QueryTypedown/QueryTypedown.js +2 -2
- package/es/lib/ResponsiveButtonGroup/ResponsiveButtonGroup.js +1 -1
- package/es/lib/ResponsiveButtonGroup/useResponsiveButtonGroupSizing.js +2 -2
- package/es/lib/RichSelect/RichSelect.js +2 -2
- package/es/lib/RichSelect/useSelectedOption.js +2 -2
- package/es/lib/SASQLookupComponent/SASQLookupComponent.js +2 -2
- package/es/lib/Typedown/Typedown.js +2 -2
- package/es/lib/hooks/settingsHooks/useAppSettings.js +1 -1
- package/es/lib/hooks/settingsHooks/useSettings.js +1 -1
- package/es/lib/hooks/typedownHooks/useTypedownData.js +2 -2
- package/es/lib/hooks/typedownHooks/useTypedownToggle.js +2 -2
- package/es/lib/hooks/useActiveElement.js +2 -2
- package/es/lib/hooks/useHelperApp.js +2 -2
- package/es/lib/hooks/useKiwtFieldArray.js +2 -2
- package/es/lib/hooks/useKiwtSASQuery.js +2 -2
- package/es/lib/hooks/useLocalStorageState.js +2 -2
- package/es/lib/hooks/useMutateCustomProperties.js +23 -29
- package/es/lib/hooks/useMutateRefdataCategory.js +21 -25
- package/es/lib/hooks/useMutateRefdataValue.js +30 -34
- package/es/lib/hooks/useQIndex.js +2 -2
- package/es/lib/hooks/useSASQQueryMeta.js +1 -1
- package/es/lib/utils/generateKiwtQueryParams.js +2 -2
- package/es/lib/utils/groupCustomPropertiesByCtx.js +1 -1
- package/es/lib/utils/highlightString.js +2 -2
- package/es/lib/utils/parseErrorResponse.js +42 -44
- package/junit.xml +1492 -222
- package/package.json +1 -1
- package/src/artifacts/coverage-jest/lcov-report/ActionList/ActionList.js.html +12 -3
- package/src/artifacts/coverage-jest/lcov-report/ActionList/ActionListFieldArray.js.html +53 -14
- package/src/artifacts/coverage-jest/lcov-report/ActionList/index.html +8 -8
- package/src/artifacts/coverage-jest/lcov-report/ActionList/index.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Config/CustomPropertiesLookup.js.html +42 -42
- package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Config/CustomPropertiesSettings.js.html +166 -88
- package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Config/CustomPropertyForm.js.html +58 -58
- package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Config/CustomPropertyView.js.html +27 -27
- package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Config/index.html +53 -53
- package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Config/index.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Edit/CustomPropertiesEdit.js.html +17 -17
- package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Edit/CustomPropertiesEditCtx.js.html +26 -26
- package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Edit/CustomPropertiesListField.js.html +90 -90
- package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Edit/CustomPropertyField.js.html +116 -116
- package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Edit/CustomPropertyFormCard.js.html +26 -26
- package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Edit/index.html +64 -64
- package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Edit/index.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Edit/testResources.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Filter/CustomPropertiesFilter.js.html +31 -31
- package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Filter/CustomPropertiesFilterField.js.html +48 -48
- package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Filter/CustomPropertiesFilterFieldArray.js.html +20 -20
- package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Filter/CustomPropertiesFilterForm.js.html +17 -17
- package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Filter/CustomPropertiesRule.js.html +43 -43
- package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Filter/index.html +96 -96
- package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Filter/index.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Filter/testResources.js.html +5 -5
- package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Filter/useOperators.js.html +35 -35
- package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Filter/useParseActiveFilterStrings.js.html +37 -37
- package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Filter/useValueProps.js.html +35 -35
- package/src/artifacts/coverage-jest/lcov-report/CustomProperties/View/CustomPropertiesView.js.html +14 -14
- package/src/artifacts/coverage-jest/lcov-report/CustomProperties/View/CustomPropertiesViewCtx.js.html +43 -43
- package/src/artifacts/coverage-jest/lcov-report/CustomProperties/View/CustomPropertyCard.js.html +5 -5
- package/src/artifacts/coverage-jest/lcov-report/CustomProperties/View/index.html +31 -31
- package/src/artifacts/coverage-jest/lcov-report/CustomProperties/View/index.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/CustomProperties/View/testResources.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/CustomProperties/index.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/CustomProperties/index.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/CycleButton/CycleButton.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/CycleButton/index.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/CycleButton/index.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/EditableRefdataCategoryList/EditableRefdataCategoryList.js.html +96 -9
- package/src/artifacts/coverage-jest/lcov-report/EditableRefdataCategoryList/index.html +9 -9
- package/src/artifacts/coverage-jest/lcov-report/EditableRefdataCategoryList/index.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/EditableRefdataList/EditableRefdataList.js.html +152 -29
- package/src/artifacts/coverage-jest/lcov-report/EditableRefdataList/index.html +9 -9
- package/src/artifacts/coverage-jest/lcov-report/EditableRefdataList/index.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/EditableSettingsList/EditableSettingsList.js.html +13 -4
- package/src/artifacts/coverage-jest/lcov-report/EditableSettingsList/EditableSettingsListFieldArray.js.html +29 -20
- package/src/artifacts/coverage-jest/lcov-report/EditableSettingsList/SettingField/EditSettingValue.js.html +37 -37
- package/src/artifacts/coverage-jest/lcov-report/EditableSettingsList/SettingField/RenderSettingValue.js.html +62 -62
- package/src/artifacts/coverage-jest/lcov-report/EditableSettingsList/SettingField/SettingField.js.html +85 -70
- package/src/artifacts/coverage-jest/lcov-report/EditableSettingsList/SettingField/index.html +43 -43
- package/src/artifacts/coverage-jest/lcov-report/EditableSettingsList/SettingField/index.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/EditableSettingsList/index.html +21 -21
- package/src/artifacts/coverage-jest/lcov-report/EditableSettingsList/index.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/FormModal/FormModal.js.html +30 -30
- package/src/artifacts/coverage-jest/lcov-report/FormModal/index.html +21 -21
- package/src/artifacts/coverage-jest/lcov-report/FormModal/index.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/FormattedKintMessage/FormattedKintMessage.js.html +3 -3
- package/src/artifacts/coverage-jest/lcov-report/FormattedKintMessage/index.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/FormattedKintMessage/index.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/IconSelect/IconSelect.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/IconSelect/index.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/IconSelect/index.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/NoResultsMessage/NoResultsMessage.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/NoResultsMessage/index.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/NoResultsMessage/index.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/QueryTypedown/QueryTypedown.js.html +23 -8
- package/src/artifacts/coverage-jest/lcov-report/QueryTypedown/index.html +7 -7
- package/src/artifacts/coverage-jest/lcov-report/QueryTypedown/index.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/RefdataButtons/RefdataButtons.js.html +52 -52
- package/src/artifacts/coverage-jest/lcov-report/RefdataButtons/index.html +21 -21
- package/src/artifacts/coverage-jest/lcov-report/RefdataButtons/index.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/ResponsiveButtonGroup/ResponsiveButtonGroup.js.html +11 -2
- package/src/artifacts/coverage-jest/lcov-report/ResponsiveButtonGroup/index.html +9 -9
- package/src/artifacts/coverage-jest/lcov-report/ResponsiveButtonGroup/index.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/ResponsiveButtonGroup/useResponsiveButtonGroupSizing.js.html +58 -10
- package/src/artifacts/coverage-jest/lcov-report/RichSelect/RichSelect.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/RichSelect/index.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/RichSelect/index.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/RichSelect/useSelectedOption.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/SASQLookupComponent/SASQLookupComponent.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/SASQLookupComponent/TableBody/TableBody.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/SASQLookupComponent/TableBody/index.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/SASQLookupComponent/TableBody/index.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/SASQLookupComponent/index.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/SASQLookupComponent/index.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/SASQRoute/SASQRoute.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/SASQRoute/index.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/SASQRoute/index.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/SASQViewComponent/SASQViewComponent.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/SASQViewComponent/index.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/SASQViewComponent/index.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/SearchField/SearchField.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/SearchField/index.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/SearchField/index.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/SettingPage/SettingPage.js.html +16 -4
- package/src/artifacts/coverage-jest/lcov-report/SettingPage/SettingPagePane.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/SettingPage/index.html +3 -3
- package/src/artifacts/coverage-jest/lcov-report/SettingPage/index.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/Typedown/Typedown.js.html +20 -8
- package/src/artifacts/coverage-jest/lcov-report/Typedown/index.html +3 -3
- package/src/artifacts/coverage-jest/lcov-report/Typedown/index.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/constants/customProperties.js.html +12 -12
- package/src/artifacts/coverage-jest/lcov-report/constants/eventCodes.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/constants/index.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/contexts/SettingsContext.js.html +2 -2
- package/src/artifacts/coverage-jest/lcov-report/contexts/index.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/contexts/index.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/hooks/index.html +34 -34
- package/src/artifacts/coverage-jest/lcov-report/hooks/index.js.html +2 -5
- package/src/artifacts/coverage-jest/lcov-report/hooks/typedownHooks/index.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/hooks/typedownHooks/index.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/hooks/typedownHooks/useTypedown.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/hooks/typedownHooks/useTypedownData.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/hooks/typedownHooks/useTypedownToggle.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/hooks/useActiveElement.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/hooks/useCustomProperties.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/hooks/useHelperApp.js.html +30 -18
- package/src/artifacts/coverage-jest/lcov-report/hooks/useIntlKey.js.html +24 -24
- package/src/artifacts/coverage-jest/lcov-report/hooks/useIntlKeyStore.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/hooks/useInvalidateRefdata.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/hooks/useKintIntl.js.html +38 -38
- package/src/artifacts/coverage-jest/lcov-report/hooks/useKiwtFieldArray.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/hooks/useKiwtSASQuery.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/hooks/useLocalStorageState.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/hooks/useMutateCustomProperties.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/hooks/useMutateRefdataCategory.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/hooks/useMutateRefdataValue.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/hooks/useQIndex.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/hooks/useRefdata.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/hooks/useSASQQueryMeta.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/hooks/useTemplates.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/index.html +161 -146
- package/src/artifacts/coverage-jest/lcov-report/settingsHooks/index.html +161 -0
- package/src/artifacts/coverage-jest/lcov-report/settingsHooks/index.js.html +94 -0
- package/src/artifacts/coverage-jest/lcov-report/settingsHooks/useAppSettings.js.html +292 -0
- package/src/artifacts/coverage-jest/lcov-report/settingsHooks/useSettingSection.js.html +211 -0
- package/src/artifacts/coverage-jest/lcov-report/settingsHooks/useSettings.js.html +466 -0
- package/src/artifacts/coverage-jest/lcov-report/utils/buildUrl.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/utils/generateKiwtQuery.js.html +2 -2
- package/src/artifacts/coverage-jest/lcov-report/utils/generateKiwtQueryParams.js.html +4 -4
- package/src/artifacts/coverage-jest/lcov-report/utils/groupCustomPropertiesByCtx.js.html +22 -22
- package/src/artifacts/coverage-jest/lcov-report/utils/highlightString.js.html +3 -3
- package/src/artifacts/coverage-jest/lcov-report/utils/index.html +42 -57
- package/src/artifacts/coverage-jest/lcov-report/utils/index.js.html +2 -35
- package/src/artifacts/coverage-jest/lcov-report/utils/matchString.js.html +2 -2
- package/src/artifacts/coverage-jest/lcov-report/utils/parseErrorResponse.js.html +2 -2
- package/src/artifacts/coverage-jest/lcov-report/utils/parseKiwtQueryGroups.js.html +161 -80
- package/src/artifacts/coverage-jest/lcov-report/utils/refdataOptions.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/utils/refdataQueryKey.js.html +2 -2
- package/src/artifacts/coverage-jest/lcov-report/utils/selectorSafe.js.html +45 -3
- package/src/artifacts/coverage-jest/lcov-report/utils/sortByLabel.js.html +2 -2
- package/src/artifacts/coverage-jest/lcov-report/utils/toCamelCase.js.html +16 -16
- package/src/artifacts/coverage-jest/lcov-report/utils/typedownQueryKey.js.html +2 -2
- package/src/artifacts/coverage-jest/lcov-report/validators/index.html +131 -0
- package/src/artifacts/coverage-jest/lcov-report/validators/index.js.html +88 -0
- package/src/artifacts/coverage-jest/lcov-report/validators/validators.js.html +370 -0
- package/src/artifacts/coverage-jest/lcov.info +1843 -1735
- package/src/lib/CustomProperties/View/CustomPropertyCard.js +3 -3
|
@@ -25,28 +25,28 @@
|
|
|
25
25
|
<div class='fl pad1y space-right2'>
|
|
26
26
|
<span class="strong">0% </span>
|
|
27
27
|
<span class="quiet">Statements</span>
|
|
28
|
-
<span class='fraction'>0/
|
|
28
|
+
<span class='fraction'>0/39</span>
|
|
29
29
|
</div>
|
|
30
30
|
|
|
31
31
|
|
|
32
32
|
<div class='fl pad1y space-right2'>
|
|
33
33
|
<span class="strong">0% </span>
|
|
34
34
|
<span class="quiet">Branches</span>
|
|
35
|
-
<span class='fraction'>0/
|
|
35
|
+
<span class='fraction'>0/24</span>
|
|
36
36
|
</div>
|
|
37
37
|
|
|
38
38
|
|
|
39
39
|
<div class='fl pad1y space-right2'>
|
|
40
40
|
<span class="strong">0% </span>
|
|
41
41
|
<span class="quiet">Functions</span>
|
|
42
|
-
<span class='fraction'>0/
|
|
42
|
+
<span class='fraction'>0/16</span>
|
|
43
43
|
</div>
|
|
44
44
|
|
|
45
45
|
|
|
46
46
|
<div class='fl pad1y space-right2'>
|
|
47
47
|
<span class="strong">0% </span>
|
|
48
48
|
<span class="quiet">Lines</span>
|
|
49
|
-
<span class='fraction'>0/
|
|
49
|
+
<span class='fraction'>0/38</span>
|
|
50
50
|
</div>
|
|
51
51
|
|
|
52
52
|
|
|
@@ -256,7 +256,36 @@
|
|
|
256
256
|
<a name='L191'></a><a href='#L191'>191</a>
|
|
257
257
|
<a name='L192'></a><a href='#L192'>192</a>
|
|
258
258
|
<a name='L193'></a><a href='#L193'>193</a>
|
|
259
|
-
<a name='L194'></a><a href='#L194'>194</a
|
|
259
|
+
<a name='L194'></a><a href='#L194'>194</a>
|
|
260
|
+
<a name='L195'></a><a href='#L195'>195</a>
|
|
261
|
+
<a name='L196'></a><a href='#L196'>196</a>
|
|
262
|
+
<a name='L197'></a><a href='#L197'>197</a>
|
|
263
|
+
<a name='L198'></a><a href='#L198'>198</a>
|
|
264
|
+
<a name='L199'></a><a href='#L199'>199</a>
|
|
265
|
+
<a name='L200'></a><a href='#L200'>200</a>
|
|
266
|
+
<a name='L201'></a><a href='#L201'>201</a>
|
|
267
|
+
<a name='L202'></a><a href='#L202'>202</a>
|
|
268
|
+
<a name='L203'></a><a href='#L203'>203</a>
|
|
269
|
+
<a name='L204'></a><a href='#L204'>204</a>
|
|
270
|
+
<a name='L205'></a><a href='#L205'>205</a>
|
|
271
|
+
<a name='L206'></a><a href='#L206'>206</a>
|
|
272
|
+
<a name='L207'></a><a href='#L207'>207</a>
|
|
273
|
+
<a name='L208'></a><a href='#L208'>208</a>
|
|
274
|
+
<a name='L209'></a><a href='#L209'>209</a>
|
|
275
|
+
<a name='L210'></a><a href='#L210'>210</a>
|
|
276
|
+
<a name='L211'></a><a href='#L211'>211</a>
|
|
277
|
+
<a name='L212'></a><a href='#L212'>212</a>
|
|
278
|
+
<a name='L213'></a><a href='#L213'>213</a>
|
|
279
|
+
<a name='L214'></a><a href='#L214'>214</a>
|
|
280
|
+
<a name='L215'></a><a href='#L215'>215</a>
|
|
281
|
+
<a name='L216'></a><a href='#L216'>216</a>
|
|
282
|
+
<a name='L217'></a><a href='#L217'>217</a>
|
|
283
|
+
<a name='L218'></a><a href='#L218'>218</a>
|
|
284
|
+
<a name='L219'></a><a href='#L219'>219</a>
|
|
285
|
+
<a name='L220'></a><a href='#L220'>220</a>
|
|
286
|
+
<a name='L221'></a><a href='#L221'>221</a>
|
|
287
|
+
<a name='L222'></a><a href='#L222'>222</a>
|
|
288
|
+
<a name='L223'></a><a href='#L223'>223</a></td><td class="line-coverage quiet"><span class="cline-any cline-neutral"> </span>
|
|
260
289
|
<span class="cline-any cline-neutral"> </span>
|
|
261
290
|
<span class="cline-any cline-neutral"> </span>
|
|
262
291
|
<span class="cline-any cline-neutral"> </span>
|
|
@@ -281,6 +310,11 @@
|
|
|
281
310
|
<span class="cline-any cline-neutral"> </span>
|
|
282
311
|
<span class="cline-any cline-neutral"> </span>
|
|
283
312
|
<span class="cline-any cline-neutral"> </span>
|
|
313
|
+
<span class="cline-any cline-neutral"> </span>
|
|
314
|
+
<span class="cline-any cline-neutral"> </span>
|
|
315
|
+
<span class="cline-any cline-neutral"> </span>
|
|
316
|
+
<span class="cline-any cline-neutral"> </span>
|
|
317
|
+
<span class="cline-any cline-neutral"> </span>
|
|
284
318
|
<span class="cline-any cline-no"> </span>
|
|
285
319
|
<span class="cline-any cline-neutral"> </span>
|
|
286
320
|
<span class="cline-any cline-neutral"> </span>
|
|
@@ -291,10 +325,26 @@
|
|
|
291
325
|
<span class="cline-any cline-neutral"> </span>
|
|
292
326
|
<span class="cline-any cline-neutral"> </span>
|
|
293
327
|
<span class="cline-any cline-neutral"> </span>
|
|
328
|
+
<span class="cline-any cline-neutral"> </span>
|
|
329
|
+
<span class="cline-any cline-neutral"> </span>
|
|
330
|
+
<span class="cline-any cline-neutral"> </span>
|
|
331
|
+
<span class="cline-any cline-neutral"> </span>
|
|
332
|
+
<span class="cline-any cline-neutral"> </span>
|
|
333
|
+
<span class="cline-any cline-neutral"> </span>
|
|
334
|
+
<span class="cline-any cline-neutral"> </span>
|
|
335
|
+
<span class="cline-any cline-neutral"> </span>
|
|
336
|
+
<span class="cline-any cline-neutral"> </span>
|
|
337
|
+
<span class="cline-any cline-neutral"> </span>
|
|
338
|
+
<span class="cline-any cline-neutral"> </span>
|
|
294
339
|
<span class="cline-any cline-no"> </span>
|
|
295
340
|
<span class="cline-any cline-no"> </span>
|
|
296
341
|
<span class="cline-any cline-neutral"> </span>
|
|
297
342
|
<span class="cline-any cline-neutral"> </span>
|
|
343
|
+
<span class="cline-any cline-neutral"> </span>
|
|
344
|
+
<span class="cline-any cline-neutral"> </span>
|
|
345
|
+
<span class="cline-any cline-no"> </span>
|
|
346
|
+
<span class="cline-any cline-neutral"> </span>
|
|
347
|
+
<span class="cline-any cline-neutral"> </span>
|
|
298
348
|
<span class="cline-any cline-no"> </span>
|
|
299
349
|
<span class="cline-any cline-neutral"> </span>
|
|
300
350
|
<span class="cline-any cline-neutral"> </span>
|
|
@@ -406,8 +456,16 @@
|
|
|
406
456
|
<span class="cline-any cline-neutral"> </span>
|
|
407
457
|
<span class="cline-any cline-no"> </span>
|
|
408
458
|
<span class="cline-any cline-neutral"> </span>
|
|
459
|
+
<span class="cline-any cline-neutral"> </span>
|
|
460
|
+
<span class="cline-any cline-neutral"> </span>
|
|
461
|
+
<span class="cline-any cline-no"> </span>
|
|
462
|
+
<span class="cline-any cline-neutral"> </span>
|
|
463
|
+
<span class="cline-any cline-neutral"> </span>
|
|
409
464
|
<span class="cline-any cline-no"> </span>
|
|
410
465
|
<span class="cline-any cline-neutral"> </span>
|
|
466
|
+
<span class="cline-any cline-neutral"> </span>
|
|
467
|
+
<span class="cline-any cline-neutral"> </span>
|
|
468
|
+
<span class="cline-any cline-neutral"> </span>
|
|
411
469
|
<span class="cline-any cline-no"> </span>
|
|
412
470
|
<span class="cline-any cline-neutral"> </span>
|
|
413
471
|
<span class="cline-any cline-neutral"> </span>
|
|
@@ -458,12 +516,17 @@ import { CalloutContext } from '@folio/stripes/core';
|
|
|
458
516
|
import { useKintIntl, useMutateRefdataCategory, useRefdata } from '../hooks';
|
|
459
517
|
|
|
460
518
|
import ActionList from '../ActionList';
|
|
461
|
-
import { required } from '../
|
|
519
|
+
import { required } from '../validators';
|
|
462
520
|
import { parseErrorResponse } from '../utils';
|
|
463
521
|
|
|
464
522
|
const propTypes = <span class="cstat-no" title="statement not covered" >{</span>
|
|
465
523
|
afterQueryCalls: PropTypes.object,
|
|
466
524
|
catchQueryCalls: PropTypes.object,
|
|
525
|
+
displayConditions: PropTypes.shape({
|
|
526
|
+
create: PropTypes.bool,
|
|
527
|
+
delete: PropTypes.bool,
|
|
528
|
+
view: PropTypes.bool,
|
|
529
|
+
}),
|
|
467
530
|
intlKey: PropTypes.string,
|
|
468
531
|
intlNS: PropTypes.string,
|
|
469
532
|
label: PropTypes.oneOfType([
|
|
@@ -477,6 +540,17 @@ const propTypes = <span class="cstat-no" title="statement not covered" >{</span>
|
|
|
477
540
|
const EditableRefdataCategoryList = <span class="cstat-no" title="statement not covered" ><span class="fstat-no" title="function not covered" >({</span></span>
|
|
478
541
|
afterQueryCalls,
|
|
479
542
|
catchQueryCalls,
|
|
543
|
+
/*
|
|
544
|
+
* Set of extra booleans for controlling access to actions
|
|
545
|
+
* create/delete (View should be handled externally)
|
|
546
|
+
* This will not overwrite "internal" behaviour, ie setting
|
|
547
|
+
* delete to 'true' here would still not render a delete button
|
|
548
|
+
* for a refdata category that has refdata values.
|
|
549
|
+
*/
|
|
550
|
+
displayConditions = <span class="branch-0 cbranch-no" title="branch not covered" >{</span>
|
|
551
|
+
create: true,
|
|
552
|
+
delete: true,
|
|
553
|
+
},
|
|
480
554
|
intlKey: passedIntlKey,
|
|
481
555
|
intlNS: passedIntlNS,
|
|
482
556
|
label,
|
|
@@ -486,6 +560,11 @@ const EditableRefdataCategoryList = <span class="cstat-no" title="statement not
|
|
|
486
560
|
/* A component that allows for editing of refdata categories */
|
|
487
561
|
const callout = <span class="cstat-no" title="statement not covered" >useContext(CalloutContext);</span>
|
|
488
562
|
const kintIntl = <span class="cstat-no" title="statement not covered" >useKintIntl(passedIntlKey, passedIntlNS);</span>
|
|
563
|
+
|
|
564
|
+
const {
|
|
565
|
+
create: createCondition = <span class="branch-0 cbranch-no" title="branch not covered" >true,</span>
|
|
566
|
+
delete: deleteCondition = <span class="branch-0 cbranch-no" title="branch not covered" >true,</span>
|
|
567
|
+
} = <span class="cstat-no" title="statement not covered" >displayConditions;</span>
|
|
489
568
|
|
|
490
569
|
// fetch refdata values
|
|
491
570
|
const { data: refdata = <span class="branch-0 cbranch-no" title="branch not covered" >[],</span> isLoading: isRefdataLoading } = <span class="cstat-no" title="statement not covered" >useRefdata({</span>
|
|
@@ -560,7 +639,7 @@ const EditableRefdataCategoryList = <span class="cstat-no" title="statement not
|
|
|
560
639
|
const actionAssigner = <span class="cstat-no" title="statement not covered" ><span class="fstat-no" title="function not covered" >(r</span>owData) => {</span>
|
|
561
640
|
const actionArray = <span class="cstat-no" title="statement not covered" >[];</span>
|
|
562
641
|
|
|
563
|
-
<span class="cstat-no" title="statement not covered" > if (!rowData?.values?.length) {</span>
|
|
642
|
+
<span class="cstat-no" title="statement not covered" > if (!rowData?.values?.length && deleteCondition) {</span>
|
|
564
643
|
<span class="cstat-no" title="statement not covered" > actionArray.push({</span>
|
|
565
644
|
name: 'delete',
|
|
566
645
|
label: kintIntl.formatKintMessage({
|
|
@@ -599,10 +678,18 @@ const EditableRefdataCategoryList = <span class="cstat-no" title="statement not
|
|
|
599
678
|
creatableFields={{
|
|
600
679
|
values: <span class="fstat-no" title="function not covered" >()</span> => <span class="cstat-no" title="statement not covered" >false</span>
|
|
601
680
|
}}
|
|
602
|
-
createCallback={
|
|
681
|
+
createCallback={!createCondition ?
|
|
682
|
+
null :
|
|
683
|
+
<span class="fstat-no" title="function not covered" > (d</span>ata) => <span class="cstat-no" title="statement not covered" >createRefdataCategory(data)</span>
|
|
684
|
+
}
|
|
603
685
|
formatter={{
|
|
604
686
|
values: <span class="fstat-no" title="function not covered" >(r</span>owData) => <span class="cstat-no" title="statement not covered" >rowData?.values?.length</span>
|
|
605
687
|
}}
|
|
688
|
+
/* Hide actions column when no permissions, or no deletable refdata categories */
|
|
689
|
+
hideActionsColumn={
|
|
690
|
+
(!createCondition && !deleteCondition) ||
|
|
691
|
+
!contentData?.find(<span class="fstat-no" title="function not covered" >cd</span> => <span class="cstat-no" title="statement not covered" >cd?.values?.length === 0)</span>
|
|
692
|
+
}
|
|
606
693
|
label={label}
|
|
607
694
|
validateFields={{
|
|
608
695
|
desc: <span class="fstat-no" title="function not covered" >()</span> => <span class="cstat-no" title="statement not covered" >required</span>
|
|
@@ -649,7 +736,7 @@ export default EditableRefdataCategoryList;
|
|
|
649
736
|
<div class='footer quiet pad2 space-top1 center small'>
|
|
650
737
|
Code coverage generated by
|
|
651
738
|
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
|
|
652
|
-
at 2023-
|
|
739
|
+
at 2023-03-21T17:34:57.995Z
|
|
653
740
|
</div>
|
|
654
741
|
<script src="../prettify.js"></script>
|
|
655
742
|
<script>
|
|
@@ -25,28 +25,28 @@
|
|
|
25
25
|
<div class='fl pad1y space-right2'>
|
|
26
26
|
<span class="strong">0% </span>
|
|
27
27
|
<span class="quiet">Statements</span>
|
|
28
|
-
<span class='fraction'>0/
|
|
28
|
+
<span class='fraction'>0/39</span>
|
|
29
29
|
</div>
|
|
30
30
|
|
|
31
31
|
|
|
32
32
|
<div class='fl pad1y space-right2'>
|
|
33
33
|
<span class="strong">0% </span>
|
|
34
34
|
<span class="quiet">Branches</span>
|
|
35
|
-
<span class='fraction'>0/
|
|
35
|
+
<span class='fraction'>0/24</span>
|
|
36
36
|
</div>
|
|
37
37
|
|
|
38
38
|
|
|
39
39
|
<div class='fl pad1y space-right2'>
|
|
40
40
|
<span class="strong">0% </span>
|
|
41
41
|
<span class="quiet">Functions</span>
|
|
42
|
-
<span class='fraction'>0/
|
|
42
|
+
<span class='fraction'>0/16</span>
|
|
43
43
|
</div>
|
|
44
44
|
|
|
45
45
|
|
|
46
46
|
<div class='fl pad1y space-right2'>
|
|
47
47
|
<span class="strong">0% </span>
|
|
48
48
|
<span class="quiet">Lines</span>
|
|
49
|
-
<span class='fraction'>0/
|
|
49
|
+
<span class='fraction'>0/38</span>
|
|
50
50
|
</div>
|
|
51
51
|
|
|
52
52
|
|
|
@@ -84,13 +84,13 @@
|
|
|
84
84
|
<div class="chart"><div class="cover-fill" style="width: 0%"></div><div class="cover-empty" style="width: 100%"></div></div>
|
|
85
85
|
</td>
|
|
86
86
|
<td data-value="0" class="pct low">0%</td>
|
|
87
|
-
<td data-value="
|
|
87
|
+
<td data-value="39" class="abs low">0/39</td>
|
|
88
88
|
<td data-value="0" class="pct low">0%</td>
|
|
89
|
-
<td data-value="
|
|
89
|
+
<td data-value="24" class="abs low">0/24</td>
|
|
90
90
|
<td data-value="0" class="pct low">0%</td>
|
|
91
|
-
<td data-value="
|
|
91
|
+
<td data-value="16" class="abs low">0/16</td>
|
|
92
92
|
<td data-value="0" class="pct low">0%</td>
|
|
93
|
-
<td data-value="
|
|
93
|
+
<td data-value="38" class="abs low">0/38</td>
|
|
94
94
|
</tr>
|
|
95
95
|
|
|
96
96
|
<tr>
|
|
@@ -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 2023-
|
|
119
|
+
at 2023-03-21T17:34:57.995Z
|
|
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 2023-
|
|
76
|
+
at 2023-03-21T17:34:57.995Z
|
|
77
77
|
</div>
|
|
78
78
|
<script src="../prettify.js"></script>
|
|
79
79
|
<script>
|
package/src/artifacts/coverage-jest/lcov-report/EditableRefdataList/EditableRefdataList.js.html
CHANGED
|
@@ -25,28 +25,28 @@
|
|
|
25
25
|
<div class='fl pad1y space-right2'>
|
|
26
26
|
<span class="strong">0% </span>
|
|
27
27
|
<span class="quiet">Statements</span>
|
|
28
|
-
<span class='fraction'>0/
|
|
28
|
+
<span class='fraction'>0/45</span>
|
|
29
29
|
</div>
|
|
30
30
|
|
|
31
31
|
|
|
32
32
|
<div class='fl pad1y space-right2'>
|
|
33
33
|
<span class="strong">0% </span>
|
|
34
34
|
<span class="quiet">Branches</span>
|
|
35
|
-
<span class='fraction'>0/
|
|
35
|
+
<span class='fraction'>0/35</span>
|
|
36
36
|
</div>
|
|
37
37
|
|
|
38
38
|
|
|
39
39
|
<div class='fl pad1y space-right2'>
|
|
40
40
|
<span class="strong">0% </span>
|
|
41
41
|
<span class="quiet">Functions</span>
|
|
42
|
-
<span class='fraction'>0/
|
|
42
|
+
<span class='fraction'>0/16</span>
|
|
43
43
|
</div>
|
|
44
44
|
|
|
45
45
|
|
|
46
46
|
<div class='fl pad1y space-right2'>
|
|
47
47
|
<span class="strong">0% </span>
|
|
48
48
|
<span class="quiet">Lines</span>
|
|
49
|
-
<span class='fraction'>0/
|
|
49
|
+
<span class='fraction'>0/44</span>
|
|
50
50
|
</div>
|
|
51
51
|
|
|
52
52
|
|
|
@@ -278,7 +278,48 @@
|
|
|
278
278
|
<a name='L213'></a><a href='#L213'>213</a>
|
|
279
279
|
<a name='L214'></a><a href='#L214'>214</a>
|
|
280
280
|
<a name='L215'></a><a href='#L215'>215</a>
|
|
281
|
-
<a name='L216'></a><a href='#L216'>216</a
|
|
281
|
+
<a name='L216'></a><a href='#L216'>216</a>
|
|
282
|
+
<a name='L217'></a><a href='#L217'>217</a>
|
|
283
|
+
<a name='L218'></a><a href='#L218'>218</a>
|
|
284
|
+
<a name='L219'></a><a href='#L219'>219</a>
|
|
285
|
+
<a name='L220'></a><a href='#L220'>220</a>
|
|
286
|
+
<a name='L221'></a><a href='#L221'>221</a>
|
|
287
|
+
<a name='L222'></a><a href='#L222'>222</a>
|
|
288
|
+
<a name='L223'></a><a href='#L223'>223</a>
|
|
289
|
+
<a name='L224'></a><a href='#L224'>224</a>
|
|
290
|
+
<a name='L225'></a><a href='#L225'>225</a>
|
|
291
|
+
<a name='L226'></a><a href='#L226'>226</a>
|
|
292
|
+
<a name='L227'></a><a href='#L227'>227</a>
|
|
293
|
+
<a name='L228'></a><a href='#L228'>228</a>
|
|
294
|
+
<a name='L229'></a><a href='#L229'>229</a>
|
|
295
|
+
<a name='L230'></a><a href='#L230'>230</a>
|
|
296
|
+
<a name='L231'></a><a href='#L231'>231</a>
|
|
297
|
+
<a name='L232'></a><a href='#L232'>232</a>
|
|
298
|
+
<a name='L233'></a><a href='#L233'>233</a>
|
|
299
|
+
<a name='L234'></a><a href='#L234'>234</a>
|
|
300
|
+
<a name='L235'></a><a href='#L235'>235</a>
|
|
301
|
+
<a name='L236'></a><a href='#L236'>236</a>
|
|
302
|
+
<a name='L237'></a><a href='#L237'>237</a>
|
|
303
|
+
<a name='L238'></a><a href='#L238'>238</a>
|
|
304
|
+
<a name='L239'></a><a href='#L239'>239</a>
|
|
305
|
+
<a name='L240'></a><a href='#L240'>240</a>
|
|
306
|
+
<a name='L241'></a><a href='#L241'>241</a>
|
|
307
|
+
<a name='L242'></a><a href='#L242'>242</a>
|
|
308
|
+
<a name='L243'></a><a href='#L243'>243</a>
|
|
309
|
+
<a name='L244'></a><a href='#L244'>244</a>
|
|
310
|
+
<a name='L245'></a><a href='#L245'>245</a>
|
|
311
|
+
<a name='L246'></a><a href='#L246'>246</a>
|
|
312
|
+
<a name='L247'></a><a href='#L247'>247</a>
|
|
313
|
+
<a name='L248'></a><a href='#L248'>248</a>
|
|
314
|
+
<a name='L249'></a><a href='#L249'>249</a>
|
|
315
|
+
<a name='L250'></a><a href='#L250'>250</a>
|
|
316
|
+
<a name='L251'></a><a href='#L251'>251</a>
|
|
317
|
+
<a name='L252'></a><a href='#L252'>252</a>
|
|
318
|
+
<a name='L253'></a><a href='#L253'>253</a>
|
|
319
|
+
<a name='L254'></a><a href='#L254'>254</a>
|
|
320
|
+
<a name='L255'></a><a href='#L255'>255</a>
|
|
321
|
+
<a name='L256'></a><a href='#L256'>256</a>
|
|
322
|
+
<a name='L257'></a><a href='#L257'>257</a></td><td class="line-coverage quiet"><span class="cline-any cline-neutral"> </span>
|
|
282
323
|
<span class="cline-any cline-neutral"> </span>
|
|
283
324
|
<span class="cline-any cline-neutral"> </span>
|
|
284
325
|
<span class="cline-any cline-neutral"> </span>
|
|
@@ -304,6 +345,12 @@
|
|
|
304
345
|
<span class="cline-any cline-neutral"> </span>
|
|
305
346
|
<span class="cline-any cline-neutral"> </span>
|
|
306
347
|
<span class="cline-any cline-neutral"> </span>
|
|
348
|
+
<span class="cline-any cline-neutral"> </span>
|
|
349
|
+
<span class="cline-any cline-neutral"> </span>
|
|
350
|
+
<span class="cline-any cline-neutral"> </span>
|
|
351
|
+
<span class="cline-any cline-neutral"> </span>
|
|
352
|
+
<span class="cline-any cline-neutral"> </span>
|
|
353
|
+
<span class="cline-any cline-neutral"> </span>
|
|
307
354
|
<span class="cline-any cline-no"> </span>
|
|
308
355
|
<span class="cline-any cline-neutral"> </span>
|
|
309
356
|
<span class="cline-any cline-neutral"> </span>
|
|
@@ -315,6 +362,25 @@
|
|
|
315
362
|
<span class="cline-any cline-neutral"> </span>
|
|
316
363
|
<span class="cline-any cline-neutral"> </span>
|
|
317
364
|
<span class="cline-any cline-neutral"> </span>
|
|
365
|
+
<span class="cline-any cline-neutral"> </span>
|
|
366
|
+
<span class="cline-any cline-neutral"> </span>
|
|
367
|
+
<span class="cline-any cline-neutral"> </span>
|
|
368
|
+
<span class="cline-any cline-neutral"> </span>
|
|
369
|
+
<span class="cline-any cline-neutral"> </span>
|
|
370
|
+
<span class="cline-any cline-neutral"> </span>
|
|
371
|
+
<span class="cline-any cline-neutral"> </span>
|
|
372
|
+
<span class="cline-any cline-neutral"> </span>
|
|
373
|
+
<span class="cline-any cline-neutral"> </span>
|
|
374
|
+
<span class="cline-any cline-neutral"> </span>
|
|
375
|
+
<span class="cline-any cline-neutral"> </span>
|
|
376
|
+
<span class="cline-any cline-neutral"> </span>
|
|
377
|
+
<span class="cline-any cline-neutral"> </span>
|
|
378
|
+
<span class="cline-any cline-neutral"> </span>
|
|
379
|
+
<span class="cline-any cline-neutral"> </span>
|
|
380
|
+
<span class="cline-any cline-neutral"> </span>
|
|
381
|
+
<span class="cline-any cline-no"> </span>
|
|
382
|
+
<span class="cline-any cline-neutral"> </span>
|
|
383
|
+
<span class="cline-any cline-neutral"> </span>
|
|
318
384
|
<span class="cline-any cline-no"> </span>
|
|
319
385
|
<span class="cline-any cline-no"> </span>
|
|
320
386
|
<span class="cline-any cline-neutral"> </span>
|
|
@@ -394,6 +460,9 @@
|
|
|
394
460
|
<span class="cline-any cline-no"> </span>
|
|
395
461
|
<span class="cline-any cline-no"> </span>
|
|
396
462
|
<span class="cline-any cline-neutral"> </span>
|
|
463
|
+
<span class="cline-any cline-no"> </span>
|
|
464
|
+
<span class="cline-any cline-no"> </span>
|
|
465
|
+
<span class="cline-any cline-neutral"> </span>
|
|
397
466
|
<span class="cline-any cline-neutral"> </span>
|
|
398
467
|
<span class="cline-any cline-neutral"> </span>
|
|
399
468
|
<span class="cline-any cline-neutral"> </span>
|
|
@@ -411,6 +480,7 @@
|
|
|
411
480
|
<span class="cline-any cline-neutral"> </span>
|
|
412
481
|
<span class="cline-any cline-neutral"> </span>
|
|
413
482
|
<span class="cline-any cline-neutral"> </span>
|
|
483
|
+
<span class="cline-any cline-neutral"> </span>
|
|
414
484
|
<span class="cline-any cline-no"> </span>
|
|
415
485
|
<span class="cline-any cline-no"> </span>
|
|
416
486
|
<span class="cline-any cline-neutral"> </span>
|
|
@@ -450,12 +520,18 @@
|
|
|
450
520
|
<span class="cline-any cline-neutral"> </span>
|
|
451
521
|
<span class="cline-any cline-no"> </span>
|
|
452
522
|
<span class="cline-any cline-neutral"> </span>
|
|
523
|
+
<span class="cline-any cline-neutral"> </span>
|
|
524
|
+
<span class="cline-any cline-neutral"> </span>
|
|
525
|
+
<span class="cline-any cline-neutral"> </span>
|
|
526
|
+
<span class="cline-any cline-neutral"> </span>
|
|
527
|
+
<span class="cline-any cline-no"> </span>
|
|
453
528
|
<span class="cline-any cline-no"> </span>
|
|
454
529
|
<span class="cline-any cline-neutral"> </span>
|
|
455
530
|
<span class="cline-any cline-no"> </span>
|
|
456
531
|
<span class="cline-any cline-neutral"> </span>
|
|
457
532
|
<span class="cline-any cline-neutral"> </span>
|
|
458
533
|
<span class="cline-any cline-neutral"> </span>
|
|
534
|
+
<span class="cline-any cline-neutral"> </span>
|
|
459
535
|
<span class="cline-any cline-no"> </span>
|
|
460
536
|
<span class="cline-any cline-neutral"> </span>
|
|
461
537
|
<span class="cline-any cline-neutral"> </span>
|
|
@@ -479,6 +555,12 @@
|
|
|
479
555
|
<span class="cline-any cline-neutral"> </span>
|
|
480
556
|
<span class="cline-any cline-neutral"> </span>
|
|
481
557
|
<span class="cline-any cline-neutral"> </span>
|
|
558
|
+
<span class="cline-any cline-neutral"> </span>
|
|
559
|
+
<span class="cline-any cline-neutral"> </span>
|
|
560
|
+
<span class="cline-any cline-neutral"> </span>
|
|
561
|
+
<span class="cline-any cline-neutral"> </span>
|
|
562
|
+
<span class="cline-any cline-neutral"> </span>
|
|
563
|
+
<span class="cline-any cline-neutral"> </span>
|
|
482
564
|
<span class="cline-any cline-no"> </span>
|
|
483
565
|
<span class="cline-any cline-neutral"> </span>
|
|
484
566
|
<span class="cline-any cline-no"> </span>
|
|
@@ -502,13 +584,19 @@ import { CalloutContext } from '@folio/stripes/core';
|
|
|
502
584
|
import { useKintIntl, useMutateRefdataValue, useRefdata } from '../hooks';
|
|
503
585
|
|
|
504
586
|
import ActionList from '../ActionList';
|
|
505
|
-
import { required } from '../
|
|
506
|
-
import { parseErrorResponse } from '../utils';
|
|
587
|
+
import { required } from '../validators';
|
|
588
|
+
import { parseErrorResponse, selectorSafe } from '../utils';
|
|
507
589
|
|
|
508
590
|
const propTypes = <span class="cstat-no" title="statement not covered" >{</span>
|
|
509
591
|
afterQueryCalls: PropTypes.object,
|
|
592
|
+
allowSpecial: PropTypes.bool,
|
|
510
593
|
catchQueryCalls: PropTypes.object,
|
|
511
594
|
desc: PropTypes.string,
|
|
595
|
+
displayConditions: PropTypes.shape({
|
|
596
|
+
create: PropTypes.bool,
|
|
597
|
+
delete: PropTypes.bool,
|
|
598
|
+
view: PropTypes.bool,
|
|
599
|
+
}),
|
|
512
600
|
intlKey: PropTypes.string,
|
|
513
601
|
intlNS: PropTypes.string,
|
|
514
602
|
label: PropTypes.oneOfType([
|
|
@@ -521,14 +609,33 @@ const propTypes = <span class="cstat-no" title="statement not covered" >{</span>
|
|
|
521
609
|
|
|
522
610
|
const EditableRefdataList = <span class="cstat-no" title="statement not covered" ><span class="fstat-no" title="function not covered" >({</span></span>
|
|
523
611
|
afterQueryCalls,
|
|
612
|
+
allowSpecial = <span class="branch-0 cbranch-no" title="branch not covered" >false,</span> // special characters will be directly stripped out of the value before it is sent to the backend
|
|
524
613
|
catchQueryCalls,
|
|
525
614
|
desc,
|
|
615
|
+
/*
|
|
616
|
+
* Set of extra booleans for controlling access to actions
|
|
617
|
+
* edit/create/delete (View should be handled externally)
|
|
618
|
+
* This will not overwrite "internal" behaviour, ie setting
|
|
619
|
+
* delete to 'true' here would still not render a delete button
|
|
620
|
+
* for an internal refdata value
|
|
621
|
+
*/
|
|
622
|
+
displayConditions = <span class="branch-0 cbranch-no" title="branch not covered" >{</span>
|
|
623
|
+
create: true,
|
|
624
|
+
edit: true,
|
|
625
|
+
delete: true,
|
|
626
|
+
},
|
|
526
627
|
intlKey: passedIntlKey,
|
|
527
628
|
intlNS: passedIntlNS,
|
|
528
629
|
label,
|
|
529
630
|
labelOverrides = <span class="branch-0 cbranch-no" title="branch not covered" >{},</span> // An object containing translation alternatives
|
|
530
631
|
refdataEndpoint
|
|
531
632
|
}) => {
|
|
633
|
+
const {
|
|
634
|
+
create: createCondition = <span class="branch-0 cbranch-no" title="branch not covered" >true,</span>
|
|
635
|
+
delete: deleteCondition = <span class="branch-0 cbranch-no" title="branch not covered" >true,</span>
|
|
636
|
+
edit: editCondition = <span class="branch-0 cbranch-no" title="branch not covered" >true</span>
|
|
637
|
+
} = <span class="cstat-no" title="statement not covered" >displayConditions;</span>
|
|
638
|
+
|
|
532
639
|
/* A component that allows for editing of refdata values */
|
|
533
640
|
const callout = <span class="cstat-no" title="statement not covered" >useContext(CalloutContext);</span>
|
|
534
641
|
const kintIntl = <span class="cstat-no" title="statement not covered" >useKintIntl(passedIntlKey, passedIntlNS);</span>
|
|
@@ -607,26 +714,30 @@ const EditableRefdataList = <span class="cstat-no" title="statement not covered"
|
|
|
607
714
|
|
|
608
715
|
// This is the function which will take a row in the table and assign the relevant actions to it
|
|
609
716
|
const actionAssigner = <span class="cstat-no" title="statement not covered" ><span class="fstat-no" title="function not covered" >()</span> => {</span>
|
|
610
|
-
const actionArray = <span class="cstat-no" title="statement not covered" >[
|
|
611
|
-
{
|
|
612
|
-
name: 'edit',
|
|
613
|
-
label: kintIntl.formatKintMessage({
|
|
614
|
-
id: 'edit',
|
|
615
|
-
overrideValue: labelOverrides?.edit
|
|
616
|
-
}),
|
|
617
|
-
icon: 'edit',
|
|
618
|
-
callback: <span class="fstat-no" title="function not covered" >(d</span>ata) => <span class="cstat-no" title="statement not covered" >editRefdataValue(data),</span>
|
|
619
|
-
ariaLabel: <span class="fstat-no" title="function not covered" >(d</span>ata) => <span class="cstat-no" title="statement not covered" >kintIntl.formatKintMessage(</span>
|
|
620
|
-
{
|
|
621
|
-
id: 'refdata.editAriaLabel',
|
|
622
|
-
overrideValue: labelOverrides?.editAriaLabel
|
|
623
|
-
},
|
|
624
|
-
{ label: data?.label }
|
|
625
|
-
),
|
|
626
|
-
}
|
|
627
|
-
];
|
|
717
|
+
const actionArray = <span class="cstat-no" title="statement not covered" >[];</span>
|
|
628
718
|
|
|
629
|
-
<span class="cstat-no" title="statement not covered" > if (
|
|
719
|
+
<span class="cstat-no" title="statement not covered" > if (editCondition) {</span>
|
|
720
|
+
<span class="cstat-no" title="statement not covered" > actionArray.push(</span>
|
|
721
|
+
{
|
|
722
|
+
name: 'edit',
|
|
723
|
+
label: kintIntl.formatKintMessage({
|
|
724
|
+
id: 'edit',
|
|
725
|
+
overrideValue: labelOverrides?.edit
|
|
726
|
+
}),
|
|
727
|
+
icon: 'edit',
|
|
728
|
+
callback: <span class="fstat-no" title="function not covered" >(d</span>ata) => <span class="cstat-no" title="statement not covered" >editRefdataValue(data),</span>
|
|
729
|
+
ariaLabel: <span class="fstat-no" title="function not covered" >(d</span>ata) => <span class="cstat-no" title="statement not covered" >kintIntl.formatKintMessage(</span>
|
|
730
|
+
{
|
|
731
|
+
id: 'refdata.editAriaLabel',
|
|
732
|
+
overrideValue: labelOverrides?.editAriaLabel
|
|
733
|
+
},
|
|
734
|
+
{ label: data?.label }
|
|
735
|
+
),
|
|
736
|
+
}
|
|
737
|
+
);
|
|
738
|
+
}
|
|
739
|
+
|
|
740
|
+
<span class="cstat-no" title="statement not covered" > if (!refdata?.internal && deleteCondition) {</span>
|
|
630
741
|
<span class="cstat-no" title="statement not covered" > actionArray.push({</span>
|
|
631
742
|
name: 'delete',
|
|
632
743
|
label: kintIntl.formatKintMessage({
|
|
@@ -665,13 +776,25 @@ const EditableRefdataList = <span class="cstat-no" title="statement not covered"
|
|
|
665
776
|
creatableFields={{
|
|
666
777
|
value: <span class="fstat-no" title="function not covered" >()</span> => <span class="cstat-no" title="statement not covered" >false</span>
|
|
667
778
|
}}
|
|
668
|
-
createCallback={
|
|
779
|
+
createCallback={
|
|
780
|
+
(!createCondition || refdata?.internal) ?
|
|
781
|
+
null :
|
|
782
|
+
<span class="fstat-no" title="function not covered" > (d</span>ata) => {
|
|
783
|
+
<span class="cstat-no" title="statement not covered" > if (allowSpecial) {</span>
|
|
784
|
+
<span class="cstat-no" title="statement not covered" > editRefdataValue(data);</span>
|
|
785
|
+
} else {
|
|
786
|
+
<span class="cstat-no" title="statement not covered" > editRefdataValue({ ...data, value: selectorSafe(data?.label)?.replaceAll('%20', ' ') });</span>
|
|
787
|
+
}
|
|
788
|
+
}
|
|
789
|
+
}
|
|
669
790
|
editableFields={{
|
|
670
791
|
value: <span class="fstat-no" title="function not covered" >()</span> => <span class="cstat-no" title="statement not covered" >false</span>
|
|
671
792
|
}}
|
|
793
|
+
hideActionsColumn={!deleteCondition && !editCondition}
|
|
794
|
+
hideCreateButton={!createCondition}
|
|
672
795
|
label={label}
|
|
673
796
|
validateFields={{
|
|
674
|
-
label:
|
|
797
|
+
label: required
|
|
675
798
|
}}
|
|
676
799
|
visibleFields={['label', 'value']}
|
|
677
800
|
/>
|
|
@@ -715,7 +838,7 @@ export default EditableRefdataList;
|
|
|
715
838
|
<div class='footer quiet pad2 space-top1 center small'>
|
|
716
839
|
Code coverage generated by
|
|
717
840
|
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
|
|
718
|
-
at 2023-
|
|
841
|
+
at 2023-03-21T17:34:57.995Z
|
|
719
842
|
</div>
|
|
720
843
|
<script src="../prettify.js"></script>
|
|
721
844
|
<script>
|