@k-int/stripes-kint-components 2.8.1 → 3.0.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.
Files changed (328) hide show
  1. package/CHANGELOG.md +16 -1
  2. package/es/index.js +54 -12
  3. package/es/lib/ActionList/ActionList.js +11 -5
  4. package/es/lib/ActionList/ActionListFieldArray.js +147 -77
  5. package/es/lib/CustomProperties/Config/CustomPropertiesLookup.js +43 -31
  6. package/es/lib/CustomProperties/Config/CustomPropertiesLookup.test.js +17 -14
  7. package/es/lib/CustomProperties/Config/CustomPropertiesSettings.js +67 -47
  8. package/es/lib/CustomProperties/Config/CustomPropertiesSettings.test.js +17 -24
  9. package/es/lib/CustomProperties/Config/CustomPropertyForm.js +91 -70
  10. package/es/lib/CustomProperties/Config/CustomPropertyForm.test.js +53 -36
  11. package/es/lib/CustomProperties/Config/CustomPropertyView.js +50 -31
  12. package/es/lib/CustomProperties/Config/CustomPropertyView.test.js +13 -14
  13. package/es/lib/CustomProperties/Edit/CustomPropertiesEdit.js +6 -0
  14. package/es/lib/CustomProperties/Edit/CustomPropertiesEdit.test.js +8 -12
  15. package/es/lib/CustomProperties/Edit/CustomPropertiesEditCtx.js +22 -24
  16. package/es/lib/CustomProperties/Edit/CustomPropertiesEditCtx.test.js +9 -12
  17. package/es/lib/CustomProperties/Edit/CustomPropertiesListField.js +62 -13
  18. package/es/lib/CustomProperties/Edit/CustomPropertiesListField.test.js +12 -13
  19. package/es/lib/CustomProperties/Edit/CustomPropertyField.js +91 -44
  20. package/es/lib/CustomProperties/Edit/CustomPropertyField.test.js +80 -73
  21. package/es/lib/CustomProperties/Edit/CustomPropertyFormCard.js +31 -32
  22. package/es/lib/CustomProperties/Edit/CustomPropertyFormCard.test.js +26 -24
  23. package/es/lib/CustomProperties/Edit/testResources.js +73 -908
  24. package/es/lib/CustomProperties/Filter/CustomPropertiesFilter.js +21 -29
  25. package/es/lib/CustomProperties/Filter/CustomPropertiesFilter.test.js +12 -10
  26. package/es/lib/CustomProperties/Filter/CustomPropertiesFilterField.js +38 -39
  27. package/es/lib/CustomProperties/Filter/CustomPropertiesFilterField.test.js +28 -13
  28. package/es/lib/CustomProperties/Filter/CustomPropertiesFilterFieldArray.js +29 -44
  29. package/es/lib/CustomProperties/Filter/CustomPropertiesFilterFieldArray.test.js +6 -6
  30. package/es/lib/CustomProperties/Filter/CustomPropertiesFilterForm.js +16 -10
  31. package/es/lib/CustomProperties/Filter/CustomPropertiesFilterForm.test.js +12 -12
  32. package/es/lib/CustomProperties/Filter/CustomPropertiesRule.js +20 -11
  33. package/es/lib/CustomProperties/Filter/CustomPropertiesRule.test.js +4 -3
  34. package/es/lib/CustomProperties/Filter/testResources.js +37 -233
  35. package/es/lib/CustomProperties/Filter/useOperators.js +69 -27
  36. package/es/lib/CustomProperties/Filter/useParseActiveFilterStrings.js +3 -2
  37. package/es/lib/CustomProperties/Filter/useValueProps.js +7 -2
  38. package/es/lib/CustomProperties/View/CustomPropertiesView.js +6 -0
  39. package/es/lib/CustomProperties/View/CustomPropertiesView.test.js +4 -3
  40. package/es/lib/CustomProperties/View/CustomPropertiesViewCtx.js +13 -19
  41. package/es/lib/CustomProperties/View/CustomPropertiesViewCtx.test.js +4 -10
  42. package/es/lib/CustomProperties/View/CustomPropertyCard.js +34 -51
  43. package/es/lib/EditableRefdataCategoryList/EditableRefdataCategoryList.js +38 -28
  44. package/es/lib/EditableRefdataList/EditableRefdataList.js +44 -32
  45. package/es/lib/EditableSettingsList/EditableSettingsList.js +11 -1
  46. package/es/lib/EditableSettingsList/EditableSettingsListFieldArray.js +10 -0
  47. package/es/lib/EditableSettingsList/SettingField/EditSettingValue.js +19 -11
  48. package/es/lib/EditableSettingsList/SettingField/EditSettingValue.test.js +9 -8
  49. package/es/lib/EditableSettingsList/SettingField/RenderSettingValue.js +21 -9
  50. package/es/lib/EditableSettingsList/SettingField/RenderSettingValue.test.js +1 -0
  51. package/es/lib/EditableSettingsList/SettingField/SettingField.js +83 -16
  52. package/es/lib/EditableSettingsList/SettingField/SettingField.test.js +138 -65
  53. package/es/lib/FormModal/FormModal.js +14 -9
  54. package/es/lib/FormattedKintMessage/FormattedKintMessage.js +91 -0
  55. package/es/lib/FormattedKintMessage/index.js +15 -0
  56. package/es/lib/IconSelect/IconSelect.js +18 -12
  57. package/es/lib/NoResultsMessage/NoResultsMessage.js +13 -2
  58. package/es/lib/RichSelect/RichSelect.js +13 -34
  59. package/es/lib/SASQLookupComponent/SASQLookupComponent.js +16 -5
  60. package/es/lib/SASQLookupComponent/TableBody/TableBody.js +11 -1
  61. package/es/lib/SettingPage/SettingPage.js +12 -13
  62. package/es/lib/SettingPage/SettingPagePane.js +12 -20
  63. package/es/lib/hooks/__mocks__/index.js +46 -0
  64. package/es/lib/hooks/index.js +24 -8
  65. package/es/lib/hooks/settingsHooks/useSettings.js +22 -17
  66. package/es/lib/hooks/useIntlKey.js +34 -0
  67. package/es/lib/hooks/useIntlKeyStore.js +84 -0
  68. package/es/lib/hooks/useKintIntl.js +93 -0
  69. package/es/lib/utils/index.js +48 -4
  70. package/es/lib/utils/parseErrorResponse.js +91 -0
  71. package/es/lib/utils/validators.js +76 -59
  72. package/jest.config.js +4 -1
  73. package/junit.xml +157 -656
  74. package/package.json +54 -33
  75. package/src/artifacts/coverage-jest/lcov-report/ActionList/ActionList.js.html +56 -8
  76. package/src/artifacts/coverage-jest/lcov-report/ActionList/ActionListFieldArray.js.html +394 -64
  77. package/src/artifacts/coverage-jest/lcov-report/ActionList/index.html +10 -10
  78. package/src/artifacts/coverage-jest/lcov-report/ActionList/index.js.html +1 -1
  79. package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Config/CustomPropertiesLookup.js.html +187 -52
  80. package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Config/CustomPropertiesSettings.js.html +372 -87
  81. package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Config/CustomPropertyForm.js.html +293 -74
  82. package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Config/CustomPropertyView.js.html +126 -54
  83. package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Config/index.html +45 -60
  84. package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Config/index.js.html +1 -1
  85. package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Edit/CustomPropertiesEdit.js.html +23 -5
  86. package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Edit/CustomPropertiesEditCtx.js.html +59 -47
  87. package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Edit/CustomPropertiesListField.js.html +259 -97
  88. package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Edit/CustomPropertyField.js.html +399 -105
  89. package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Edit/CustomPropertyFormCard.js.html +41 -68
  90. package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Edit/index.html +57 -57
  91. package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Edit/index.js.html +1 -1
  92. package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Edit/testResources.js.html +67 -688
  93. package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Filter/CustomPropertiesFilter.js.html +92 -53
  94. package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Filter/CustomPropertiesFilterField.js.html +103 -64
  95. package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Filter/CustomPropertiesFilterFieldArray.js.html +54 -63
  96. package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Filter/CustomPropertiesFilterForm.js.html +49 -16
  97. package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Filter/CustomPropertiesRule.js.html +69 -18
  98. package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Filter/index.html +89 -89
  99. package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Filter/index.js.html +1 -1
  100. package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Filter/testResources.js.html +33 -786
  101. package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Filter/useOperators.js.html +46 -46
  102. package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Filter/useParseActiveFilterStrings.js.html +45 -36
  103. package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Filter/useValueProps.js.html +43 -28
  104. package/src/artifacts/coverage-jest/lcov-report/CustomProperties/View/CustomPropertiesView.js.html +20 -2
  105. package/src/artifacts/coverage-jest/lcov-report/CustomProperties/View/CustomPropertiesViewCtx.js.html +50 -41
  106. package/src/artifacts/coverage-jest/lcov-report/CustomProperties/View/CustomPropertyCard.js.html +54 -75
  107. package/src/artifacts/coverage-jest/lcov-report/CustomProperties/View/index.html +24 -24
  108. package/src/artifacts/coverage-jest/lcov-report/CustomProperties/View/index.js.html +1 -1
  109. package/src/artifacts/coverage-jest/lcov-report/CustomProperties/View/testResources.js.html +1 -1
  110. package/src/artifacts/coverage-jest/lcov-report/CustomProperties/index.html +1 -1
  111. package/src/artifacts/coverage-jest/lcov-report/CustomProperties/index.js.html +1 -1
  112. package/src/artifacts/coverage-jest/lcov-report/{hooks/useAvailableCustomProperties.js.html → CycleButton/CycleButton.js.html} +62 -50
  113. package/src/artifacts/coverage-jest/lcov-report/CycleButton/index.html +131 -0
  114. package/src/artifacts/coverage-jest/lcov-report/CycleButton/index.js.html +88 -0
  115. package/src/artifacts/coverage-jest/lcov-report/EditableRefdataCategoryList/EditableRefdataCategoryList.js.html +664 -0
  116. package/src/artifacts/coverage-jest/lcov-report/EditableRefdataCategoryList/index.html +131 -0
  117. package/src/artifacts/coverage-jest/lcov-report/EditableRefdataCategoryList/index.js.html +88 -0
  118. package/src/artifacts/coverage-jest/lcov-report/EditableRefdataList/EditableRefdataList.js.html +264 -39
  119. package/src/artifacts/coverage-jest/lcov-report/EditableRefdataList/index.html +9 -9
  120. package/src/artifacts/coverage-jest/lcov-report/EditableRefdataList/index.js.html +1 -1
  121. package/src/artifacts/coverage-jest/lcov-report/EditableSettingsList/EditableSettingsList.js.html +41 -14
  122. package/src/artifacts/coverage-jest/lcov-report/EditableSettingsList/EditableSettingsListFieldArray.js.html +45 -6
  123. package/src/artifacts/coverage-jest/lcov-report/EditableSettingsList/SettingField/EditSettingValue.js.html +47 -11
  124. package/src/artifacts/coverage-jest/lcov-report/EditableSettingsList/SettingField/RenderSettingValue.js.html +65 -14
  125. package/src/artifacts/coverage-jest/lcov-report/EditableSettingsList/SettingField/SettingField.js.html +154 -31
  126. package/src/artifacts/coverage-jest/lcov-report/EditableSettingsList/SettingField/index.html +26 -26
  127. package/src/artifacts/coverage-jest/lcov-report/EditableSettingsList/SettingField/index.js.html +1 -1
  128. package/src/artifacts/coverage-jest/lcov-report/EditableSettingsList/index.html +18 -18
  129. package/src/artifacts/coverage-jest/lcov-report/EditableSettingsList/index.js.html +1 -1
  130. package/src/artifacts/coverage-jest/lcov-report/FormModal/FormModal.js.html +35 -17
  131. package/src/artifacts/coverage-jest/lcov-report/FormModal/index.html +15 -15
  132. package/src/artifacts/coverage-jest/lcov-report/FormModal/index.js.html +1 -1
  133. package/src/artifacts/coverage-jest/lcov-report/FormattedKintMessage/FormattedKintMessage.js.html +247 -0
  134. package/src/artifacts/coverage-jest/lcov-report/FormattedKintMessage/index.html +131 -0
  135. package/src/artifacts/coverage-jest/lcov-report/FormattedKintMessage/index.js.html +88 -0
  136. package/src/artifacts/coverage-jest/lcov-report/{CustomProperties/Config/CustomPropertiesView.js.html → IconSelect/IconSelect.js.html} +158 -257
  137. package/src/artifacts/coverage-jest/lcov-report/IconSelect/index.html +131 -0
  138. package/src/artifacts/coverage-jest/lcov-report/IconSelect/index.js.html +88 -0
  139. package/src/artifacts/coverage-jest/lcov-report/NoResultsMessage/NoResultsMessage.js.html +48 -6
  140. package/src/artifacts/coverage-jest/lcov-report/NoResultsMessage/index.html +7 -7
  141. package/src/artifacts/coverage-jest/lcov-report/NoResultsMessage/index.js.html +1 -1
  142. package/src/artifacts/coverage-jest/lcov-report/QueryTypedown/QueryTypedown.js.html +1 -1
  143. package/src/artifacts/coverage-jest/lcov-report/QueryTypedown/index.html +1 -1
  144. package/src/artifacts/coverage-jest/lcov-report/QueryTypedown/index.js.html +1 -1
  145. package/src/artifacts/coverage-jest/lcov-report/RefdataButtons/RefdataButtons.js.html +3 -3
  146. package/src/artifacts/coverage-jest/lcov-report/RefdataButtons/index.html +1 -1
  147. package/src/artifacts/coverage-jest/lcov-report/RefdataButtons/index.js.html +1 -1
  148. package/src/artifacts/coverage-jest/lcov-report/{CustomProperties/Config/testResources.js.html → RichSelect/RichSelect.js.html} +256 -334
  149. package/src/artifacts/coverage-jest/lcov-report/RichSelect/index.html +146 -0
  150. package/src/artifacts/coverage-jest/lcov-report/RichSelect/index.js.html +91 -0
  151. package/src/artifacts/coverage-jest/lcov-report/RichSelect/useSelectedOption.js.html +127 -0
  152. package/src/artifacts/coverage-jest/lcov-report/SASQLookupComponent/SASQLookupComponent.js.html +52 -7
  153. package/src/artifacts/coverage-jest/lcov-report/SASQLookupComponent/TableBody/TableBody.js.html +31 -4
  154. package/src/artifacts/coverage-jest/lcov-report/SASQLookupComponent/TableBody/index.html +3 -3
  155. package/src/artifacts/coverage-jest/lcov-report/SASQLookupComponent/TableBody/index.js.html +1 -1
  156. package/src/artifacts/coverage-jest/lcov-report/SASQLookupComponent/index.html +7 -7
  157. package/src/artifacts/coverage-jest/lcov-report/SASQLookupComponent/index.js.html +1 -1
  158. package/src/artifacts/coverage-jest/lcov-report/SASQRoute/SASQRoute.js.html +1 -1
  159. package/src/artifacts/coverage-jest/lcov-report/SASQRoute/index.html +1 -1
  160. package/src/artifacts/coverage-jest/lcov-report/SASQRoute/index.js.html +1 -1
  161. package/src/artifacts/coverage-jest/lcov-report/SASQViewComponent/SASQViewComponent.js.html +1 -1
  162. package/src/artifacts/coverage-jest/lcov-report/SASQViewComponent/index.html +1 -1
  163. package/src/artifacts/coverage-jest/lcov-report/SASQViewComponent/index.js.html +1 -1
  164. package/src/artifacts/coverage-jest/lcov-report/SearchField/SearchField.js.html +1 -1
  165. package/src/artifacts/coverage-jest/lcov-report/SearchField/index.html +1 -1
  166. package/src/artifacts/coverage-jest/lcov-report/SearchField/index.js.html +1 -1
  167. package/src/artifacts/coverage-jest/lcov-report/SettingPage/SettingPage.js.html +24 -27
  168. package/src/artifacts/coverage-jest/lcov-report/SettingPage/SettingPagePane.js.html +47 -17
  169. package/src/artifacts/coverage-jest/lcov-report/SettingPage/index.html +22 -22
  170. package/src/artifacts/coverage-jest/lcov-report/SettingPage/index.js.html +1 -1
  171. package/src/artifacts/coverage-jest/lcov-report/Typedown/Typedown.js.html +1 -1
  172. package/src/artifacts/coverage-jest/lcov-report/Typedown/index.html +1 -1
  173. package/src/artifacts/coverage-jest/lcov-report/Typedown/index.js.html +1 -1
  174. package/src/artifacts/coverage-jest/lcov-report/constants/customProperties.js.html +1 -1
  175. package/src/artifacts/coverage-jest/lcov-report/constants/eventCodes.js.html +1 -1
  176. package/src/artifacts/coverage-jest/lcov-report/constants/index.html +1 -1
  177. package/src/artifacts/coverage-jest/lcov-report/contexts/SettingsContext.js.html +2 -2
  178. package/src/artifacts/coverage-jest/lcov-report/contexts/index.html +1 -1
  179. package/src/artifacts/coverage-jest/lcov-report/contexts/index.js.html +1 -1
  180. package/src/artifacts/coverage-jest/lcov-report/favicon.png +0 -0
  181. package/src/artifacts/coverage-jest/lcov-report/hooks/index.html +142 -97
  182. package/src/artifacts/coverage-jest/lcov-report/hooks/index.js.html +13 -4
  183. package/src/artifacts/coverage-jest/lcov-report/hooks/settingsHooks/index.html +35 -20
  184. package/src/artifacts/coverage-jest/lcov-report/hooks/settingsHooks/index.js.html +5 -2
  185. package/src/artifacts/coverage-jest/lcov-report/hooks/settingsHooks/useAppSettings.js.html +7 -7
  186. package/src/artifacts/coverage-jest/lcov-report/hooks/settingsHooks/useSettingSection.js.html +7 -7
  187. package/src/artifacts/coverage-jest/lcov-report/hooks/settingsHooks/useSettings.js.html +61 -22
  188. package/src/artifacts/coverage-jest/lcov-report/hooks/typedownHooks/index.html +1 -1
  189. package/src/artifacts/coverage-jest/lcov-report/hooks/typedownHooks/index.js.html +1 -1
  190. package/src/artifacts/coverage-jest/lcov-report/hooks/typedownHooks/useTypedown.js.html +1 -1
  191. package/src/artifacts/coverage-jest/lcov-report/hooks/typedownHooks/useTypedownData.js.html +1 -1
  192. package/src/artifacts/coverage-jest/lcov-report/hooks/typedownHooks/useTypedownToggle.js.html +1 -1
  193. package/src/artifacts/coverage-jest/lcov-report/hooks/useActiveElement.js.html +7 -7
  194. package/src/artifacts/coverage-jest/lcov-report/hooks/useCustomProperties.js.html +19 -22
  195. package/src/artifacts/coverage-jest/lcov-report/hooks/useHelperApp.js.html +7 -7
  196. package/src/artifacts/coverage-jest/lcov-report/hooks/useIntlKey.js.html +151 -0
  197. package/src/artifacts/coverage-jest/lcov-report/{utils/renderHelpText.js.html → hooks/useIntlKeyStore.js.html} +71 -38
  198. package/src/artifacts/coverage-jest/lcov-report/hooks/useInvalidateRefdata.js.html +7 -7
  199. package/src/artifacts/coverage-jest/lcov-report/hooks/useKintIntl.js.html +238 -0
  200. package/src/artifacts/coverage-jest/lcov-report/hooks/useKiwtFieldArray.js.html +7 -7
  201. package/src/artifacts/coverage-jest/lcov-report/hooks/useKiwtSASQuery.js.html +9 -9
  202. package/src/artifacts/coverage-jest/lcov-report/hooks/useLocalStorageState.js.html +7 -7
  203. package/src/artifacts/coverage-jest/lcov-report/hooks/useMutateCustomProperties.js.html +23 -11
  204. package/src/artifacts/coverage-jest/lcov-report/hooks/useMutateRefdataCategory.js.html +274 -0
  205. package/src/artifacts/coverage-jest/lcov-report/hooks/useMutateRefdataValue.js.html +19 -10
  206. package/src/artifacts/coverage-jest/lcov-report/hooks/useQIndex.js.html +7 -7
  207. package/src/artifacts/coverage-jest/lcov-report/hooks/useRefdata.js.html +9 -9
  208. package/src/artifacts/coverage-jest/lcov-report/hooks/useTemplates.js.html +7 -7
  209. package/src/artifacts/coverage-jest/lcov-report/index.html +205 -130
  210. package/src/artifacts/coverage-jest/lcov-report/sort-arrow-sprite.png +0 -0
  211. package/src/artifacts/coverage-jest/lcov-report/utils/buildUrl.js.html +1 -1
  212. package/src/artifacts/coverage-jest/lcov-report/utils/generateKiwtQuery.js.html +2 -2
  213. package/src/artifacts/coverage-jest/lcov-report/utils/generateKiwtQueryParams.js.html +2 -2
  214. package/src/artifacts/coverage-jest/lcov-report/utils/groupCustomPropertiesByCtx.js.html +7 -7
  215. package/src/artifacts/coverage-jest/lcov-report/utils/highlightString.js.html +3 -3
  216. package/src/artifacts/coverage-jest/lcov-report/utils/index.html +34 -34
  217. package/src/artifacts/coverage-jest/lcov-report/utils/index.js.html +42 -3
  218. package/src/artifacts/coverage-jest/lcov-report/utils/matchString.js.html +2 -2
  219. package/src/artifacts/coverage-jest/lcov-report/utils/parseErrorResponse.js.html +139 -0
  220. package/src/artifacts/coverage-jest/lcov-report/utils/refdataOptions.js.html +5 -2
  221. package/src/artifacts/coverage-jest/lcov-report/utils/refdataQueryKey.js.html +2 -2
  222. package/src/artifacts/coverage-jest/lcov-report/utils/selectorSafe.js.html +2 -2
  223. package/src/artifacts/coverage-jest/lcov-report/utils/sortByLabel.js.html +2 -2
  224. package/src/artifacts/coverage-jest/lcov-report/utils/toCamelCase.js.html +2 -2
  225. package/src/artifacts/coverage-jest/lcov-report/utils/typedownQueryKey.js.html +2 -2
  226. package/src/artifacts/coverage-jest/lcov-report/utils/validators.js.html +128 -80
  227. package/src/artifacts/coverage-jest/lcov.info +2603 -2086
  228. package/src/index.js +12 -4
  229. package/src/lib/ActionList/ActionList.js +9 -3
  230. package/src/lib/ActionList/ActionListFieldArray.js +115 -37
  231. package/src/lib/ActionList/README.md +2 -1
  232. package/src/lib/CustomProperties/Config/CustomPropertiesLookup.js +60 -16
  233. package/src/lib/CustomProperties/Config/CustomPropertiesLookup.test.js +14 -4
  234. package/src/lib/CustomProperties/Config/CustomPropertiesSettings.js +109 -34
  235. package/src/lib/CustomProperties/Config/CustomPropertiesSettings.test.js +16 -9
  236. package/src/lib/CustomProperties/Config/CustomPropertyForm.js +131 -58
  237. package/src/lib/CustomProperties/Config/CustomPropertyForm.test.js +52 -33
  238. package/src/lib/CustomProperties/Config/CustomPropertyView.js +71 -47
  239. package/src/lib/CustomProperties/Config/CustomPropertyView.test.js +8 -6
  240. package/src/lib/CustomProperties/Config/README.md +33 -28
  241. package/src/lib/CustomProperties/Edit/CustomPropertiesEdit.js +6 -0
  242. package/src/lib/CustomProperties/Edit/CustomPropertiesEdit.test.js +7 -3
  243. package/src/lib/CustomProperties/Edit/CustomPropertiesEditCtx.js +23 -19
  244. package/src/lib/CustomProperties/Edit/CustomPropertiesEditCtx.test.js +5 -3
  245. package/src/lib/CustomProperties/Edit/CustomPropertiesListField.js +65 -11
  246. package/src/lib/CustomProperties/Edit/CustomPropertiesListField.test.js +10 -8
  247. package/src/lib/CustomProperties/Edit/CustomPropertyField.js +115 -21
  248. package/src/lib/CustomProperties/Edit/CustomPropertyField.test.js +59 -60
  249. package/src/lib/CustomProperties/Edit/CustomPropertyFormCard.js +24 -33
  250. package/src/lib/CustomProperties/Edit/CustomPropertyFormCard.test.js +20 -27
  251. package/src/lib/CustomProperties/Edit/testResources.js +46 -1047
  252. package/src/lib/CustomProperties/Filter/CustomPropertiesFilter.js +22 -22
  253. package/src/lib/CustomProperties/Filter/CustomPropertiesFilter.test.js +12 -8
  254. package/src/lib/CustomProperties/Filter/CustomPropertiesFilterField.js +44 -31
  255. package/src/lib/CustomProperties/Filter/CustomPropertiesFilterField.test.js +26 -13
  256. package/src/lib/CustomProperties/Filter/CustomPropertiesFilterFieldArray.js +33 -36
  257. package/src/lib/CustomProperties/Filter/CustomPropertiesFilterFieldArray.test.js +3 -3
  258. package/src/lib/CustomProperties/Filter/CustomPropertiesFilterForm.js +19 -8
  259. package/src/lib/CustomProperties/Filter/CustomPropertiesFilterForm.test.js +9 -12
  260. package/src/lib/CustomProperties/Filter/CustomPropertiesRule.js +22 -5
  261. package/src/lib/CustomProperties/Filter/CustomPropertiesRule.test.js +3 -1
  262. package/src/lib/CustomProperties/Filter/testResources.js +14 -265
  263. package/src/lib/CustomProperties/Filter/useOperators.js +20 -20
  264. package/src/lib/CustomProperties/Filter/useParseActiveFilterStrings.js +2 -2
  265. package/src/lib/CustomProperties/Filter/useValueProps.js +8 -3
  266. package/src/lib/CustomProperties/View/CustomPropertiesView.js +6 -0
  267. package/src/lib/CustomProperties/View/CustomPropertiesView.test.js +2 -1
  268. package/src/lib/CustomProperties/View/CustomPropertiesViewCtx.js +15 -13
  269. package/src/lib/CustomProperties/View/CustomPropertiesViewCtx.test.js +2 -5
  270. package/src/lib/CustomProperties/View/CustomPropertyCard.js +36 -43
  271. package/src/lib/EditableRefdataCategoryList/EditableRefdataCategoryList.js +47 -28
  272. package/src/lib/EditableRefdataList/EditableRefdataList.js +58 -33
  273. package/src/lib/EditableSettingsList/EditableSettingsList.js +10 -1
  274. package/src/lib/EditableSettingsList/EditableSettingsListFieldArray.js +14 -1
  275. package/src/lib/EditableSettingsList/SettingField/EditSettingValue.js +17 -5
  276. package/src/lib/EditableSettingsList/SettingField/EditSettingValue.test.js +9 -8
  277. package/src/lib/EditableSettingsList/SettingField/RenderSettingValue.js +24 -7
  278. package/src/lib/EditableSettingsList/SettingField/RenderSettingValue.test.js +1 -0
  279. package/src/lib/EditableSettingsList/SettingField/SettingField.js +57 -16
  280. package/src/lib/EditableSettingsList/SettingField/SettingField.test.js +14 -19
  281. package/src/lib/FormModal/FormModal.js +15 -9
  282. package/src/lib/FormattedKintMessage/FormattedKintMessage.js +54 -0
  283. package/src/lib/FormattedKintMessage/index.js +1 -0
  284. package/src/lib/IconSelect/IconSelect.js +17 -8
  285. package/src/lib/NoResultsMessage/NoResultsMessage.js +15 -1
  286. package/src/lib/RichSelect/RichSelect.js +16 -36
  287. package/src/lib/SASQLookupComponent/SASQLookupComponent.js +17 -2
  288. package/src/lib/SASQLookupComponent/TableBody/TableBody.js +10 -1
  289. package/src/lib/SettingPage/SettingPage.js +12 -13
  290. package/src/lib/SettingPage/SettingPagePane.js +16 -6
  291. package/src/lib/hooks/__mocks__/index.js +17 -0
  292. package/src/lib/hooks/index.js +3 -1
  293. package/src/lib/hooks/settingsHooks/useSettings.js +25 -12
  294. package/src/lib/hooks/useIntlKey.js +22 -0
  295. package/src/lib/hooks/useIntlKeyStore.js +38 -0
  296. package/src/lib/hooks/useKintIntl.js +51 -0
  297. package/src/lib/utils/index.js +14 -1
  298. package/src/lib/utils/parseErrorResponse.js +18 -0
  299. package/src/lib/utils/validators.js +57 -41
  300. package/styles/RichSelect.css +7 -4
  301. package/test/helpers/test-implementor-translations.json +80 -0
  302. package/test/helpers/translationsProperties.js +6 -1
  303. package/test/jest/customProperties.js +166 -0
  304. package/test/jest/helpers/KintHarness.js +1 -1
  305. package/test/jest/helpers/renderWithKintHarness.js +2 -1
  306. package/test/jest/index.js +8 -0
  307. package/test/jest/refdata.js +471 -0
  308. package/test/jest/resolver.js +29 -0
  309. package/translations/stripes-kint-components/ar.json +1 -122
  310. package/translations/stripes-kint-components/cs_CZ.json +1 -122
  311. package/translations/stripes-kint-components/de.json +1 -122
  312. package/translations/stripes-kint-components/en.json +1 -148
  313. package/translations/stripes-kint-components/es.json +1 -122
  314. package/translations/stripes-kint-components/hi_IN.json +1 -122
  315. package/translations/stripes-kint-components/hu.json +1 -122
  316. package/translations/stripes-kint-components/it_IT.json +1 -122
  317. package/translations/stripes-kint-components/ja.json +1 -122
  318. package/translations/stripes-kint-components/ko.json +1 -122
  319. package/translations/stripes-kint-components/pt_PT.json +1 -122
  320. package/translations/stripes-kint-components/ru.json +1 -122
  321. package/translations/stripes-kint-components/sv.json +1 -122
  322. package/translations/stripes-kint-components/zh_CN.json +1 -122
  323. package/es/lib/CustomProperties/Config/testResources.js +0 -198
  324. package/es/lib/hooks/useAvailableCustomProperties.js +0 -73
  325. package/es/lib/utils/renderHelpText.js +0 -80
  326. package/src/lib/CustomProperties/Config/testResources.js +0 -236
  327. package/src/lib/hooks/useAvailableCustomProperties.js +0 -40
  328. package/src/lib/utils/renderHelpText.js +0 -27
@@ -9,8 +9,6 @@ var _react = require("react");
9
9
 
10
10
  var _propTypes = _interopRequireDefault(require("prop-types"));
11
11
 
12
- var _reactIntl = require("react-intl");
13
-
14
12
  var _components = require("@folio/stripes/components");
15
13
 
16
14
  var _reactFinalForm = require("react-final-form");
@@ -44,10 +42,10 @@ function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Sy
44
42
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
45
43
 
46
44
  var CustomPropertiesLookup = function CustomPropertiesLookup(_ref) {
47
- var _labelOverrides$label, _labelOverrides$prima, _labelOverrides$ctx, _labelOverrides$weigh, _labelOverrides$type, _labelOverrides$categ;
48
-
49
45
  var contextFilterOptions = _ref.contextFilterOptions,
50
46
  endpoint = _ref.customPropertiesEndpoint,
47
+ passedIntlKey = _ref.intlKey,
48
+ passedIntlNS = _ref.intlNS,
51
49
  _ref$labelOverrides = _ref.labelOverrides,
52
50
  labelOverrides = _ref$labelOverrides === void 0 ? {} : _ref$labelOverrides,
53
51
  mclProps = _ref.mclProps,
@@ -94,6 +92,7 @@ var CustomPropertiesLookup = function CustomPropertiesLookup(_ref) {
94
92
  searchTerm = _useState6[0],
95
93
  setSearchTerm = _useState6[1];
96
94
 
95
+ var kintIntl = (0, _hooks.useKintIntl)(passedIntlKey, passedIntlNS);
97
96
  return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
98
97
  children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactFinalForm.Form, {
99
98
  enableReinitialize: true,
@@ -102,14 +101,16 @@ var CustomPropertiesLookup = function CustomPropertiesLookup(_ref) {
102
101
  return handleSearch(searchTerm);
103
102
  },
104
103
  children: function children(_ref2) {
105
- var _labelOverrides$searc;
106
-
107
104
  var handleSubmit = _ref2.handleSubmit;
108
105
  return /*#__PURE__*/(0, _jsxRuntime.jsxs)("form", {
109
106
  className: _CustomProperties.default.lookupSearchContainer,
110
107
  onSubmit: handleSubmit,
111
108
  children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_SearchField.default, {
112
- ariaLabel: (_labelOverrides$searc = labelOverrides.searchAriaLabel) !== null && _labelOverrides$searc !== void 0 ? _labelOverrides$searc : 'custom-property-search-field',
109
+ ariaLabel: kintIntl.formatKintMessage({
110
+ id: 'customProperties.config.searchAriaLabel',
111
+ overrideValue: labelOverrides.searchAriaLabel,
112
+ fallbackMessage: 'custom-property-search-field'
113
+ }),
113
114
  className: _CustomProperties.default.lookupSearch,
114
115
  marginBottom0: true,
115
116
  onChange: function onChange(e) {
@@ -121,8 +122,9 @@ var CustomPropertiesLookup = function CustomPropertiesLookup(_ref) {
121
122
  buttonStyle: "primary",
122
123
  marginBottom0: true,
123
124
  type: "submit",
124
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactIntl.FormattedMessage, {
125
- id: "stripes-kint-components.search"
125
+ children: kintIntl.formatKintMessage({
126
+ id: 'search',
127
+ overrideValue: labelOverrides.search
126
128
  })
127
129
  })]
128
130
  });
@@ -132,8 +134,9 @@ var CustomPropertiesLookup = function CustomPropertiesLookup(_ref) {
132
134
  xs: 6,
133
135
  children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Select, {
134
136
  dataOptions: contextFilterOptions,
135
- label: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactIntl.FormattedMessage, {
136
- id: "stripes-kint-components.customProperties.ctx"
137
+ label: kintIntl.formatKintMessage({
138
+ id: 'customProperties.ctx',
139
+ overrideValue: labelOverrides.ctx
137
140
  }),
138
141
  onChange: function onChange(e) {
139
142
  setSelectedContext(e.target.value);
@@ -143,43 +146,50 @@ var CustomPropertiesLookup = function CustomPropertiesLookup(_ref) {
143
146
  })
144
147
  }), isLoading ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Spinner, {}) : /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.MultiColumnList, _objectSpread({
145
148
  columnMapping: {
146
- 'label': (_labelOverrides$label = labelOverrides === null || labelOverrides === void 0 ? void 0 : labelOverrides.label) !== null && _labelOverrides$label !== void 0 ? _labelOverrides$label : /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactIntl.FormattedMessage, {
147
- id: "stripes-kint-components.customProperties.label"
149
+ 'label': kintIntl.formatKintMessage({
150
+ id: 'customProperties.label',
151
+ overrideValue: labelOverrides.label
148
152
  }),
149
- 'primary': (_labelOverrides$prima = labelOverrides === null || labelOverrides === void 0 ? void 0 : labelOverrides.primary) !== null && _labelOverrides$prima !== void 0 ? _labelOverrides$prima : /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactIntl.FormattedMessage, {
150
- id: "stripes-kint-components.customProperties.primary"
153
+ 'primary': kintIntl.formatKintMessage({
154
+ id: 'customProperties.primary',
155
+ overrideValue: labelOverrides.primary
151
156
  }),
152
- 'ctx': (_labelOverrides$ctx = labelOverrides === null || labelOverrides === void 0 ? void 0 : labelOverrides.ctx) !== null && _labelOverrides$ctx !== void 0 ? _labelOverrides$ctx : /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactIntl.FormattedMessage, {
153
- id: "stripes-kint-components.customProperties.ctx"
157
+ 'ctx': kintIntl.formatKintMessage({
158
+ id: 'customProperties.ctx',
159
+ overrideValue: labelOverrides.ctx
154
160
  }),
155
- 'weight': (_labelOverrides$weigh = labelOverrides === null || labelOverrides === void 0 ? void 0 : labelOverrides.weight) !== null && _labelOverrides$weigh !== void 0 ? _labelOverrides$weigh : /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactIntl.FormattedMessage, {
156
- id: "stripes-kint-components.customProperties.weight"
161
+ 'weight': kintIntl.formatKintMessage({
162
+ id: 'customProperties.weight',
163
+ overrideValue: labelOverrides.weight
157
164
  }),
158
- 'type': (_labelOverrides$type = labelOverrides === null || labelOverrides === void 0 ? void 0 : labelOverrides.type) !== null && _labelOverrides$type !== void 0 ? _labelOverrides$type : /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactIntl.FormattedMessage, {
159
- id: "stripes-kint-components.customProperties.type"
165
+ 'type': kintIntl.formatKintMessage({
166
+ id: 'customProperties.type',
167
+ overrideValue: labelOverrides.type
160
168
  }),
161
- 'category': (_labelOverrides$categ = labelOverrides === null || labelOverrides === void 0 ? void 0 : labelOverrides.category) !== null && _labelOverrides$categ !== void 0 ? _labelOverrides$categ : /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactIntl.FormattedMessage, {
162
- id: "stripes-kint-components.customProperties.category"
169
+ 'category': kintIntl.formatKintMessage({
170
+ id: 'customProperties.category',
171
+ overrideValue: labelOverrides.category
163
172
  })
164
173
  },
165
174
  contentData: custprops,
166
175
  formatter: {
167
176
  primary: function primary(data) {
168
177
  if (data !== null && data !== void 0 && data.primary) {
169
- return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactIntl.FormattedMessage, {
170
- id: "stripes-kint-components.yes"
178
+ return kintIntl.formatKintMessage({
179
+ id: 'yes',
180
+ overrideValue: labelOverrides.yes
171
181
  });
172
182
  } else {
173
- return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactIntl.FormattedMessage, {
174
- id: "stripes-kint-components.no"
183
+ return kintIntl.formatKintMessage({
184
+ id: 'no',
185
+ overrideValue: labelOverrides.no
175
186
  });
176
187
  }
177
188
  },
178
189
  type: function type(data) {
179
- var _labelOverrides$data$;
180
-
181
- return (_labelOverrides$data$ = labelOverrides === null || labelOverrides === void 0 ? void 0 : labelOverrides[data === null || data === void 0 ? void 0 : data.type]) !== null && _labelOverrides$data$ !== void 0 ? _labelOverrides$data$ : /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactIntl.FormattedMessage, {
182
- id: "stripes-kint-components.customProperties.type.".concat(data === null || data === void 0 ? void 0 : data.type)
190
+ return kintIntl.formatKintMessage({
191
+ id: "customProperties.type.".concat(data === null || data === void 0 ? void 0 : data.type),
192
+ overrideValue: labelOverrides === null || labelOverrides === void 0 ? void 0 : labelOverrides[data === null || data === void 0 ? void 0 : data.type]
183
193
  });
184
194
  },
185
195
  category: function category(data) {
@@ -200,6 +210,8 @@ CustomPropertiesLookup.propTypes = {
200
210
  label: _propTypes.default.oneOfType([_propTypes.default.element, _propTypes.default.string])
201
211
  })),
202
212
  customPropertiesEndpoint: _propTypes.default.string,
213
+ intlKey: _propTypes.default.string,
214
+ intlNS: _propTypes.default.string,
203
215
  labelOverrides: _propTypes.default.object,
204
216
  mclProps: _propTypes.default.object,
205
217
  onSelectCustomProperty: _propTypes.default.func,
@@ -6,22 +6,15 @@ require("@folio/stripes-erm-components/test/jest/__mock__");
6
6
 
7
7
  var _reactRouterDom = require("react-router-dom");
8
8
 
9
- var _helpers = require("../../../../test/jest/helpers");
10
-
11
- var _testResources = require("./testResources");
12
-
13
9
  var _CustomPropertiesLookup = _interopRequireDefault(require("./CustomPropertiesLookup"));
14
10
 
11
+ var _renderWithKintHarness = _interopRequireDefault(require("../../../../test/jest/helpers/renderWithKintHarness"));
12
+
15
13
  var _jsxRuntime = require("react/jsx-runtime");
16
14
 
17
15
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
18
16
 
19
- function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
20
-
21
- function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
22
-
23
- function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
24
-
17
+ jest.mock('../../hooks');
25
18
  jest.mock('../../SearchField', function () {
26
19
  return function () {
27
20
  return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
@@ -32,17 +25,27 @@ jest.mock('../../SearchField', function () {
32
25
  describe('CustomPropertiesLookup', function () {
33
26
  var renderComponent;
34
27
  beforeEach(function () {
35
- renderComponent = (0, _helpers.renderWithKintHarness)( /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactRouterDom.MemoryRouter, {
36
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_CustomPropertiesLookup.default, _objectSpread(_objectSpread({}, _testResources.custPropLookup), {}, {
28
+ renderComponent = (0, _renderWithKintHarness.default)( /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactRouterDom.MemoryRouter, {
29
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_CustomPropertiesLookup.default, {
30
+ contextFilterOptions: [{
31
+ 'value': '',
32
+ 'label': 'All'
33
+ }, {
34
+ 'value': 'isNull',
35
+ 'label': 'None'
36
+ }],
37
+ customPropertiesEndpoint: "erm/custprops",
38
+ onSelectCustomProperty: function onSelectCustomProperty() {
39
+ return {};
40
+ },
37
41
  visibleColumns: ['label', 'primary', 'ctx', 'weight', 'type', 'category']
38
- }))
42
+ })
39
43
  }));
40
44
  });
41
45
  it('renders expected options', function () {
42
46
  var _renderComponent = renderComponent,
43
47
  getByText = _renderComponent.getByText;
44
48
  expect(getByText('All')).toBeInTheDocument();
45
- expect(getByText('OpenAccess')).toBeInTheDocument();
46
49
  expect(getByText('None')).toBeInTheDocument();
47
50
  });
48
51
  it('renders SearchField component ', function () {
@@ -13,8 +13,6 @@ var _propTypes = _interopRequireDefault(require("prop-types"));
13
13
 
14
14
  var _composeFunction = _interopRequireDefault(require("compose-function"));
15
15
 
16
- var _reactIntl = require("react-intl");
17
-
18
16
  var _reactQuery = require("react-query");
19
17
 
20
18
  var _components = require("@folio/stripes/components");
@@ -31,6 +29,8 @@ var _CustomPropertyForm = _interopRequireDefault(require("./CustomPropertyForm")
31
29
 
32
30
  var _hooks = require("../../hooks");
33
31
 
32
+ var _utils = require("../../utils");
33
+
34
34
  var _jsxRuntime = require("react/jsx-runtime");
35
35
 
36
36
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
@@ -64,19 +64,20 @@ var CREATING = 'create';
64
64
  var VIEWING = 'view'; // A default option for setting up panes manually
65
65
 
66
66
  var CustomPropertiesSettings = function CustomPropertiesSettings(_ref) {
67
- var _labelOverrides$paneT, _ref3, _renderViewPaneTitle, _customProperty$categ, _labelOverrides$modal, _labelOverrides$modal2, _labelOverrides$confi;
67
+ var _customProperty$label, _customProperty$label2, _customProperty$categ, _customProperty$label3, _customProperty$label4;
68
68
 
69
69
  var afterQueryCalls = _ref.afterQueryCalls,
70
70
  catchQueryCalls = _ref.catchQueryCalls,
71
71
  contextFilterOptions = _ref.contextFilterOptions,
72
72
  customPropertiesEndpoint = _ref.customPropertiesEndpoint,
73
73
  helpPopovers = _ref.helpPopovers,
74
+ passedIntlKey = _ref.intlKey,
75
+ passedIntlNS = _ref.intlNS,
74
76
  _ref$labelOverrides = _ref.labelOverrides,
75
77
  labelOverrides = _ref$labelOverrides === void 0 ? {} : _ref$labelOverrides,
76
78
  refdataEndpoint = _ref.refdataEndpoint;
77
79
  var callout = (0, _react.useContext)(_core.CalloutContext);
78
80
  var queryClient = (0, _reactQuery.useQueryClient)();
79
- var intl = (0, _reactIntl.useIntl)();
80
81
 
81
82
  var _useState = (0, _react.useState)(),
82
83
  _useState2 = _slicedToArray(_useState, 2),
@@ -95,8 +96,9 @@ var CustomPropertiesSettings = function CustomPropertiesSettings(_ref) {
95
96
  var _useState5 = (0, _react.useState)(VIEWING),
96
97
  _useState6 = _slicedToArray(_useState5, 2),
97
98
  mode = _useState6[0],
98
- setMode = _useState6[1]; // Default props that need hooks are hard
99
+ setMode = _useState6[1];
99
100
 
101
+ var kintIntl = (0, _hooks.useKintIntl)(passedIntlKey, passedIntlNS); // Default props that need hooks are hard
100
102
 
101
103
  var renderContextFilterOptions = contextFilterOptions;
102
104
 
@@ -109,18 +111,13 @@ var CustomPropertiesSettings = function CustomPropertiesSettings(_ref) {
109
111
  renderContextFilterOptions = [{
110
112
  value: '',
111
113
  // empty string is all custoprop contexts
112
- label: intl.formatMessage({
113
- id: 'stripes-kint-components.customProperties.all'
114
+ label: kintIntl.formatKintMessage({
115
+ id: 'customProperties.config.all',
116
+ overrideValue: labelOverrides === null || labelOverrides === void 0 ? void 0 : labelOverrides.all
114
117
  })
115
118
  }];
116
119
  }
117
120
 
118
- var renderViewPaneTitle = labelOverrides === null || labelOverrides === void 0 ? void 0 : labelOverrides.viewPaneTitle;
119
-
120
- if (renderViewPaneTitle instanceof Function) {
121
- renderViewPaneTitle = renderViewPaneTitle(customProperty);
122
- }
123
-
124
121
  var _useMutateCustomPrope = (0, _hooks.useMutateCustomProperties)({
125
122
  afterQueryCalls: {
126
123
  put: function put(res) {
@@ -162,17 +159,17 @@ var CustomPropertiesSettings = function CustomPropertiesSettings(_ref) {
162
159
  switch (_context.prev = _context.next) {
163
160
  case 0:
164
161
  _context.next = 2;
165
- return err.response.json();
162
+ return (0, _utils.parseErrorResponse)(err.response);
166
163
 
167
164
  case 2:
168
165
  errorResp = _context.sent;
169
166
  callout.sendCallout({
170
- message: labelOverrides !== null && labelOverrides !== void 0 && labelOverrides.deleteError ? labelOverrides.deleteError(errorResp === null || errorResp === void 0 ? void 0 : errorResp.message, customProperty) : /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactIntl.FormattedMessage, {
171
- id: "stripes-kint-components.customPropertiesSettings.deleteCustomProperty.errorMessage",
172
- values: {
173
- error: errorResp === null || errorResp === void 0 ? void 0 : errorResp.message,
174
- label: customProperty === null || customProperty === void 0 ? void 0 : customProperty.label
175
- }
167
+ message: kintIntl.formatKintMessage({
168
+ id: 'customProperties.config.delete.errorMessage',
169
+ overrideValue: labelOverrides === null || labelOverrides === void 0 ? void 0 : labelOverrides.deleteError
170
+ }, {
171
+ error: errorResp === null || errorResp === void 0 ? void 0 : errorResp.message,
172
+ label: customProperty === null || customProperty === void 0 ? void 0 : customProperty.label
176
173
  }),
177
174
  type: 'error'
178
175
  });
@@ -230,17 +227,20 @@ var CustomPropertiesSettings = function CustomPropertiesSettings(_ref) {
230
227
  return setMode(CREATING);
231
228
  } // TODO do we need to clear form here too?
232
229
  ,
233
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactIntl.FormattedMessage, {
234
- id: "stripes-kint-components.new"
230
+ children: kintIntl.formatKintMessage({
231
+ id: 'new',
232
+ overrideValue: labelOverrides === null || labelOverrides === void 0 ? void 0 : labelOverrides.new
235
233
  })
236
234
  }),
237
- paneTitle: (_labelOverrides$paneT = labelOverrides.paneTitle) !== null && _labelOverrides$paneT !== void 0 ? _labelOverrides$paneT : /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactIntl.FormattedMessage, {
238
- id: "stripes-kint-components.customProperties"
239
- }) // This should be configurable?
240
- ,
235
+ paneTitle: kintIntl.formatKintMessage({
236
+ id: 'customProperties',
237
+ overrideValue: labelOverrides.paneTitle
238
+ }),
241
239
  children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_CustomPropertiesLookup.default, {
242
240
  contextFilterOptions: renderContextFilterOptions,
243
241
  customPropertiesEndpoint: customPropertiesEndpoint,
242
+ intlKey: passedIntlKey,
243
+ intlNS: passedIntlNS,
244
244
  labelOverrides: labelOverrides,
245
245
  onSelectCustomProperty: function onSelectCustomProperty(_e, cp) {
246
246
  return setCustomProperty(cp);
@@ -257,11 +257,12 @@ var CustomPropertiesSettings = function CustomPropertiesSettings(_ref) {
257
257
  },
258
258
  children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Icon, {
259
259
  icon: "edit",
260
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactIntl.FormattedMessage, {
261
- id: "stripes-kint-components.edit"
260
+ children: kintIntl.formatKintMessage({
261
+ id: 'edit',
262
+ overrideValue: labelOverrides === null || labelOverrides === void 0 ? void 0 : labelOverrides.edit
262
263
  })
263
264
  })
264
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Button, {
265
+ }, "".concat(customProperty.name, "-action-edit")), /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Button, {
265
266
  buttonStyle: "dropdownItem",
266
267
  marginBottom0: true,
267
268
  onClick: function onClick() {
@@ -270,11 +271,12 @@ var CustomPropertiesSettings = function CustomPropertiesSettings(_ref) {
270
271
  },
271
272
  children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Icon, {
272
273
  icon: "trash",
273
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactIntl.FormattedMessage, {
274
- id: "stripes-kint-components.delete"
274
+ children: kintIntl.formatKintMessage({
275
+ id: 'delete',
276
+ overrideValue: labelOverrides === null || labelOverrides === void 0 ? void 0 : labelOverrides.delete
275
277
  })
276
278
  })
277
- })];
279
+ }, "".concat(customProperty.name, "-action-delete"))];
278
280
  },
279
281
  defaultWidth: "fill",
280
282
  dismissible: true,
@@ -282,10 +284,18 @@ var CustomPropertiesSettings = function CustomPropertiesSettings(_ref) {
282
284
  onClose: function onClose() {
283
285
  return setCustomProperty();
284
286
  },
285
- paneTitle: (_ref3 = (_renderViewPaneTitle = renderViewPaneTitle) !== null && _renderViewPaneTitle !== void 0 ? _renderViewPaneTitle : customProperty === null || customProperty === void 0 ? void 0 : customProperty.label) !== null && _ref3 !== void 0 ? _ref3 : customProperty === null || customProperty === void 0 ? void 0 : customProperty.name,
287
+ paneTitle: kintIntl.formatKintMessage({
288
+ id: 'customProperties.config.viewPaneTitle',
289
+ overrideValue: labelOverrides === null || labelOverrides === void 0 ? void 0 : labelOverrides.viewPaneTitle,
290
+ fallbackMessage: (_customProperty$label = customProperty === null || customProperty === void 0 ? void 0 : customProperty.label) !== null && _customProperty$label !== void 0 ? _customProperty$label : customProperty === null || customProperty === void 0 ? void 0 : customProperty.name
291
+ }, {
292
+ name: (_customProperty$label2 = customProperty === null || customProperty === void 0 ? void 0 : customProperty.label) !== null && _customProperty$label2 !== void 0 ? _customProperty$label2 : customProperty === null || customProperty === void 0 ? void 0 : customProperty.name
293
+ }),
286
294
  children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_CustomPropertyView.default, {
287
295
  customProperty: customProperty,
288
296
  helpPopovers: helpPopovers,
297
+ intlKey: passedIntlKey,
298
+ intlNS: passedIntlNS,
289
299
  labelOverrides: labelOverrides
290
300
  })
291
301
  }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_FormModal.default, {
@@ -303,10 +313,14 @@ var CustomPropertiesSettings = function CustomPropertiesSettings(_ref) {
303
313
  }),
304
314
  modalProps: {
305
315
  dismissible: true,
306
- label: mode === CREATING ? (_labelOverrides$modal = labelOverrides === null || labelOverrides === void 0 ? void 0 : labelOverrides.modalTitleNew) !== null && _labelOverrides$modal !== void 0 ? _labelOverrides$modal : /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactIntl.FormattedMessage, {
307
- id: "stripes-kint-components.customProperty.newModal"
308
- }) : (_labelOverrides$modal2 = labelOverrides === null || labelOverrides === void 0 ? void 0 : labelOverrides.modalTitleEdit) !== null && _labelOverrides$modal2 !== void 0 ? _labelOverrides$modal2 : /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactIntl.FormattedMessage, {
309
- id: "stripes-kint-components.customProperty.editModal"
316
+ label: mode === CREATING ? kintIntl.formatKintMessage({
317
+ id: 'customProperties.config.newModal',
318
+ overrideValue: labelOverrides === null || labelOverrides === void 0 ? void 0 : labelOverrides.newModalTitle
319
+ }) : kintIntl.formatKintMessage({
320
+ id: 'customProperties.config.editModal',
321
+ overrideValue: labelOverrides === null || labelOverrides === void 0 ? void 0 : labelOverrides.editModalTitle
322
+ }, {
323
+ name: (_customProperty$label3 = customProperty === null || customProperty === void 0 ? void 0 : customProperty.label) !== null && _customProperty$label3 !== void 0 ? _customProperty$label3 : customProperty === null || customProperty === void 0 ? void 0 : customProperty.name
310
324
  }),
311
325
  onClose: function onClose() {
312
326
  return setMode(VIEWING);
@@ -317,6 +331,8 @@ var CustomPropertiesSettings = function CustomPropertiesSettings(_ref) {
317
331
  children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_CustomPropertyForm.default, {
318
332
  contextFilterOptions: renderContextFilterOptions,
319
333
  helpPopovers: helpPopovers,
334
+ intlKey: passedIntlKey,
335
+ intlNS: passedIntlNS,
320
336
  labelOverrides: labelOverrides,
321
337
  refdata: refdata.map(function (rdc) {
322
338
  return {
@@ -327,18 +343,20 @@ var CustomPropertiesSettings = function CustomPropertiesSettings(_ref) {
327
343
  })
328
344
  }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.ConfirmationModal, {
329
345
  buttonStyle: "danger",
330
- confirmLabel: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactIntl.FormattedMessage, {
331
- id: "stripes-kint-components.delete"
346
+ confirmLabel: kintIntl.formatKintMessage({
347
+ id: 'delete',
348
+ overrideValue: labelOverrides === null || labelOverrides === void 0 ? void 0 : labelOverrides.delete
332
349
  }),
333
- heading: (_labelOverrides$confi = labelOverrides === null || labelOverrides === void 0 ? void 0 : labelOverrides.confirmHeading) !== null && _labelOverrides$confi !== void 0 ? _labelOverrides$confi : /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactIntl.FormattedMessage, {
334
- id: "stripes-kint-components.customProperties.delete.confirmHeading"
350
+ heading: kintIntl.formatKintMessage({
351
+ id: 'customProperties.config.delete.confirmHeading',
352
+ overrideValue: labelOverrides === null || labelOverrides === void 0 ? void 0 : labelOverrides.confirmHeading
335
353
  }),
336
- id: "delete-job-confirmation",
337
- message: labelOverrides !== null && labelOverrides !== void 0 && labelOverrides.confirmMessage ? labelOverrides.confirmMessage(customProperty) : /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactIntl.FormattedMessage, {
338
- id: "stripes-kint-components.customProperties.delete.confirmMessage",
339
- values: {
340
- name: customProperty === null || customProperty === void 0 ? void 0 : customProperty.name
341
- }
354
+ id: "delete-custprop-confirmation",
355
+ message: kintIntl.formatKintMessage({
356
+ id: 'customProperties.config.delete.confirmMessage',
357
+ overrideValue: labelOverrides === null || labelOverrides === void 0 ? void 0 : labelOverrides.confirmMessage
358
+ }, {
359
+ name: (_customProperty$label4 = customProperty === null || customProperty === void 0 ? void 0 : customProperty.label) !== null && _customProperty$label4 !== void 0 ? _customProperty$label4 : customProperty === null || customProperty === void 0 ? void 0 : customProperty.name
342
360
  }),
343
361
  onCancel: function onCancel() {
344
362
  return setDeleteModal(false);
@@ -362,6 +380,8 @@ CustomPropertiesSettings.propTypes = {
362
380
  })),
363
381
  customPropertiesEndpoint: _propTypes.default.string,
364
382
  helpPopovers: _propTypes.default.object,
383
+ intlKey: _propTypes.default.string,
384
+ intlNS: _propTypes.default.string,
365
385
  labelOverrides: _propTypes.default.object,
366
386
  refdataEndpoint: _propTypes.default.string
367
387
  };
@@ -10,12 +10,10 @@ var _stripesTesting = require("@folio/stripes-testing");
10
10
 
11
11
  var _reactRouterDom = require("react-router-dom");
12
12
 
13
- var _helpers = require("../../../../test/jest/helpers");
14
-
15
- var _testResources = require("./testResources");
16
-
17
13
  var _CustomPropertiesSettings = _interopRequireDefault(require("./CustomPropertiesSettings"));
18
14
 
15
+ var _jest = require("../../../../test/jest");
16
+
19
17
  var _jsxRuntime = require("react/jsx-runtime");
20
18
 
21
19
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
@@ -26,22 +24,7 @@ function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try
26
24
 
27
25
  function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
28
26
 
29
- function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
30
-
31
- function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
32
-
33
- function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
34
-
35
- jest.mock('../../hooks', function () {
36
- return {
37
- useRefdata: function useRefdata() {
38
- return [];
39
- },
40
- useMutateCustomProperties: function useMutateCustomProperties() {
41
- return [];
42
- }
43
- };
44
- });
27
+ jest.mock('../../hooks');
45
28
  jest.mock('../../FormModal/FormModal', function () {
46
29
  return function () {
47
30
  return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
@@ -59,8 +42,18 @@ jest.mock('./CustomPropertiesLookup', function () {
59
42
  describe('CustomPropertiesSettings', function () {
60
43
  var renderComponent;
61
44
  beforeEach(function () {
62
- renderComponent = (0, _helpers.renderWithKintHarness)( /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactRouterDom.MemoryRouter, {
63
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_CustomPropertiesSettings.default, _objectSpread({}, _testResources.custPropsSettings))
45
+ renderComponent = (0, _jest.renderWithKintHarness)( /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactRouterDom.MemoryRouter, {
46
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_CustomPropertiesSettings.default, {
47
+ contextFilterOptions: [{
48
+ 'value': '',
49
+ 'label': 'All'
50
+ }, {
51
+ 'value': 'isNull',
52
+ 'label': 'None'
53
+ }],
54
+ customPropertiesEndpoint: "erm/custprops",
55
+ refdataEndpoint: "erm/refdata"
56
+ })
64
57
  }));
65
58
  });
66
59
  it('renders FormModal component ', function () {
@@ -94,7 +87,7 @@ describe('CustomPropertiesSettings', function () {
94
87
  switch (_context2.prev = _context2.next) {
95
88
  case 0:
96
89
  _context2.next = 2;
97
- return (0, _stripesTesting.Pane)('Supplementary properties').is({
90
+ return (0, _stripesTesting.Pane)('Custom properties').is({
98
91
  visible: true
99
92
  });
100
93
 
@@ -111,7 +104,7 @@ describe('CustomPropertiesSettings', function () {
111
104
  switch (_context3.prev = _context3.next) {
112
105
  case 0:
113
106
  _context3.next = 2;
114
- return (0, _stripesTesting.PaneHeader)('Supplementary properties').is({
107
+ return (0, _stripesTesting.PaneHeader)('Custom properties').is({
115
108
  visible: true
116
109
  });
117
110