@k-int/stripes-kint-components 5.25.0 → 5.25.2

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 CHANGED
@@ -1,3 +1,18 @@
1
+ ## [5.25.2](https://gitlab.com/knowledge-integration/folio/stripes-kint-components/compare/v5.25.1...v5.25.2) (2025-09-12)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * use endpoint (itemEndpoint ?? endpoint) in viewQueryPromise in SASQViewComponent ([47d39f7](https://gitlab.com/knowledge-integration/folio/stripes-kint-components/commit/47d39f729940fb16ccd2b6eed44039d052c31148))
7
+
8
+ ## [5.25.1](https://gitlab.com/knowledge-integration/folio/stripes-kint-components/compare/v5.25.0...v5.25.1) (2025-08-27)
9
+
10
+
11
+ ### Bug Fixes
12
+
13
+ * **deprecationWarnings:** Add deprecation warnings to mod-config hooks and components ([716b3cf](https://gitlab.com/knowledge-integration/folio/stripes-kint-components/commit/716b3cf999635dc8e01ef19afeab043012d63907))
14
+ * **deps:** update dependency zustand to v5 ([bfd0134](https://gitlab.com/knowledge-integration/folio/stripes-kint-components/commit/bfd013486176db77c94c5db77dd6bbda661d17b9))
15
+
1
16
  # [5.25.0](https://gitlab.com/knowledge-integration/folio/stripes-kint-components/compare/v5.24.1...v5.25.0) (2025-08-06)
2
17
 
3
18
 
@@ -390,6 +390,7 @@ const ActionListFieldArray = /*#__PURE__*/(0, _react.forwardRef)((_ref2, ref) =>
390
390
  className: _ActionListFieldArray.default.headerText,
391
391
  children: label
392
392
  }), !hideCreateButton && /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Button, {
393
+ buttonStyle: "primary",
393
394
  disabled: !!editing || !createCallback,
394
395
  marginBottom0: true,
395
396
  onClick: handleClickCreate,
@@ -64,7 +64,7 @@ const SASQViewComponent = /*#__PURE__*/(0, _react.forwardRef)((_ref, ref) => {
64
64
  return viewQueryPromise({
65
65
  ky,
66
66
  resourceId: match?.params?.id,
67
- endpoint: fetchParameters.endpoint
67
+ endpoint
68
68
  });
69
69
  }, {
70
70
  enabled: !!match?.params?.id,
@@ -4,6 +4,7 @@ var _react = require("react");
4
4
  var _react2 = require("@folio/jest-config-stripes/testing-library/react");
5
5
  var _stripesErmTesting = require("@folio/stripes-erm-testing");
6
6
  var _SearchKeyControl = _interopRequireDefault(require("./SearchKeyControl"));
7
+ var _jest = require("../../../test/jest");
7
8
  var _jsxRuntime = require("react/jsx-runtime");
8
9
  function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
9
10
  const mockUseQIndex = jest.fn();
@@ -17,7 +18,7 @@ describe('SearchKeyControl', () => {
17
18
  mockUseQIndex.mockImplementation(() => {
18
19
  return (0, _react.useState)();
19
20
  });
20
- (0, _stripesErmTesting.renderWithIntl)(/*#__PURE__*/(0, _jsxRuntime.jsx)(_SearchKeyControl.default, {
21
+ (0, _jest.renderWithKintHarness)(/*#__PURE__*/(0, _jsxRuntime.jsx)(_SearchKeyControl.default, {
21
22
  options: [{
22
23
  label: 'Opt 1',
23
24
  key: 'opt1'
@@ -89,7 +90,7 @@ describe('SearchKeyControl', () => {
89
90
  mockUseQIndex.mockImplementation(() => {
90
91
  return (0, _react.useState)('opt1,opt3');
91
92
  });
92
- (0, _stripesErmTesting.renderWithIntl)(/*#__PURE__*/(0, _jsxRuntime.jsx)(_SearchKeyControl.default, {
93
+ (0, _jest.renderWithKintHarness)(/*#__PURE__*/(0, _jsxRuntime.jsx)(_SearchKeyControl.default, {
93
94
  options: [{
94
95
  label: 'Opt 1',
95
96
  key: 'opt1'
@@ -11,6 +11,9 @@ var _jsxRuntime = require("react/jsx-runtime");
11
11
  function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
12
12
  /*
13
13
  * API is similar to ConfigManager
14
+ *
15
+ * DEPRECATED -- As far as I can see this is now unused anyway
16
+ * KInt modules are swapping to AppSettings instead of mod-settings, so no centralised components should be needed
14
17
  */const SettingsFormContainer = _ref => {
15
18
  let {
16
19
  ConfigFormComponent,
@@ -24,6 +27,8 @@ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e
24
27
  // We don't use this currently but it's here for future reference
25
28
  ...rest
26
29
  } = _ref;
30
+ // eslint-disable-next-line no-console
31
+ console.warn('SettingsFormContainer is deprecated, as it utilises mod-config');
27
32
  const callout = (0, _core.useCallout)();
28
33
  const kintIntl = (0, _hooks.useKintIntl)(passedIntlKey, passedIntlNS);
29
34
 
@@ -10,6 +10,8 @@ var _core = require("@folio/stripes/core");
10
10
  var _utils = require("../utils");
11
11
  var _endpoints = require("../constants/endpoints");
12
12
  function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
13
+ // DEPRECATED -- As far as I can see this is now unused anyway
14
+ // KInt modules are swapping to AppSettings instead of mod-settings, so no centralised components should be needed
13
15
  const useModConfigEntries = _ref => {
14
16
  let {
15
17
  configName,
@@ -17,6 +19,8 @@ const useModConfigEntries = _ref => {
17
19
  namespaceAppend,
18
20
  queryParams
19
21
  } = _ref;
22
+ // eslint-disable-next-line no-console
23
+ console.warn('useModConfigEntries is deprecated, as it utilises mod-config');
20
24
  const ky = (0, _core.useOkapiKy)();
21
25
  const query = `?query=(module=${moduleName} and configName=${configName})`;
22
26
  const path = `${_endpoints.MOD_SETTINGS_ENDPOINT}${query}`;
@@ -9,12 +9,16 @@ var _core = require("@folio/stripes/core");
9
9
  var _utils = require("../utils");
10
10
  var _endpoints = require("../constants/endpoints");
11
11
  // This will simply take in some information and decide whether to mutate via POST or via PUT
12
+ // DEPRECATED -- As far as I can see this is now unused anyway
13
+ // KInt modules are swapping to AppSettings instead of mod-settings, so no centralised components should be needed
12
14
  const useMutateModConfigEntry = _ref => {
13
15
  let {
14
16
  configName,
15
17
  moduleName,
16
18
  id
17
19
  } = _ref;
20
+ // eslint-disable-next-line no-console
21
+ console.warn('useMutateModConfigEntry is deprecated, as it utilises mod-config');
18
22
  const ky = (0, _core.useOkapiKy)();
19
23
  const queryClient = (0, _reactQuery.useQueryClient)();
20
24
  const baseNamespace = (0, _utils.modConfigEntriesQueryKey)({
@@ -0,0 +1,40 @@
1
+ "use strict";
2
+
3
+ var _generateKiwtQuery = _interopRequireDefault(require("../generateKiwtQuery"));
4
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
5
+ // FIXME we need to test more than this
6
+ describe('generateKiwtQueryParams', () => {
7
+ describe('generateKiwtQueryParams nested group filters', () => {
8
+ test('EXAMPLE nested AND shape', () => {
9
+ expect((0, _generateKiwtQuery.default)({
10
+ filters: [{
11
+ groupValues: {
12
+ AND: [{
13
+ path: 'wobble',
14
+ value: 'test'
15
+ }, {
16
+ groupValues: {
17
+ OR: [{
18
+ value: 'test2'
19
+ }, {
20
+ path: 'sup',
21
+ value: 'test3'
22
+ }, {
23
+ groupValues: {
24
+ AND: [{
25
+ value: 'test4'
26
+ }, {
27
+ path: 'help',
28
+ comparator: '!=',
29
+ value: 'false'
30
+ }]
31
+ }
32
+ }]
33
+ }
34
+ }]
35
+ }
36
+ }]
37
+ }, {}, false)).toEqual('?filters=wobble==test&&(test2||sup==test3||(test4&&help!=false))&stats=true');
38
+ });
39
+ });
40
+ });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@k-int/stripes-kint-components",
3
- "version": "5.25.0",
3
+ "version": "5.25.2",
4
4
  "description": "Stripes Component library for K-Int specific applications",
5
5
  "sideEffects": [
6
6
  "*.css"
@@ -25,7 +25,7 @@
25
25
  "@rehooks/local-storage": "^2.4.4",
26
26
  "compose-function": "^3.0.3",
27
27
  "react-resize-detector": "^11.0.0",
28
- "zustand": "^4.0.0"
28
+ "zustand": "^5.0.0"
29
29
  },
30
30
  "devDependencies": {
31
31
  "@babel/cli": "^7.18.10",
@@ -66,10 +66,8 @@
66
66
  "react-dom": "^18.2.0",
67
67
  "react-intl": "^6.4.4 || ^7.1.5",
68
68
  "react-query": "^3.6.0",
69
- "react-redux": "^9.0.0",
70
69
  "react-router": "^5.2.0",
71
70
  "react-router-dom": "^5.2.0",
72
- "redux": "^5.0.0",
73
71
  "redux-observable": "^2.0.0",
74
72
  "regenerator-runtime": "^0.14.0",
75
73
  "rxjs": "^7.0.0",
@@ -421,6 +421,7 @@ const ActionListFieldArray = forwardRef(({
421
421
  </Headline>
422
422
  {!hideCreateButton &&
423
423
  <Button
424
+ buttonStyle="primary"
424
425
  disabled={!!editing || !createCallback}
425
426
  marginBottom0
426
427
  onClick={handleClickCreate}
@@ -14,8 +14,7 @@ const SASQViewComponent = forwardRef(
14
14
  location,
15
15
  match,
16
16
  path,
17
- viewQueryPromise = ({ endpoint, ky, resourceId }) =>
18
- ky.get(`${endpoint}/${resourceId}`).json(),
17
+ viewQueryPromise = ({ endpoint, ky, resourceId }) => ky.get(`${endpoint}/${resourceId}`).json(),
19
18
  viewResponseTransform = (response) => response,
20
19
  ViewComponent,
21
20
  viewQueryNamespaceGenerator = ({
@@ -54,7 +53,7 @@ const SASQViewComponent = forwardRef(
54
53
  return viewQueryPromise({
55
54
  ky,
56
55
  resourceId: match?.params?.id,
57
- endpoint: fetchParameters.endpoint,
56
+ endpoint,
58
57
  });
59
58
  },
60
59
  {
@@ -1,9 +1,10 @@
1
1
  import { useState } from 'react';
2
2
 
3
3
  import { waitFor } from '@folio/jest-config-stripes/testing-library/react';
4
- import { renderWithIntl, Checkbox } from '@folio/stripes-erm-testing';
4
+ import { Checkbox } from '@folio/stripes-erm-testing';
5
5
 
6
6
  import SearchKeyControl from './SearchKeyControl';
7
+ import { renderWithKintHarness } from '../../../test/jest';
7
8
 
8
9
  const mockUseQIndex = jest.fn();
9
10
 
@@ -19,7 +20,7 @@ describe('SearchKeyControl', () => {
19
20
  return useState();
20
21
  });
21
22
 
22
- renderWithIntl(
23
+ renderWithKintHarness(
23
24
  <SearchKeyControl
24
25
  options={[
25
26
  {
@@ -87,7 +88,7 @@ describe('SearchKeyControl', () => {
87
88
  return useState('opt1,opt3');
88
89
  });
89
90
 
90
- renderWithIntl(
91
+ renderWithKintHarness(
91
92
  <SearchKeyControl
92
93
  options={[
93
94
  {
@@ -5,6 +5,9 @@ import { useKintIntl, useModConfigEntries, useMutateModConfigEntry } from '../ho
5
5
 
6
6
  /*
7
7
  * API is similar to ConfigManager
8
+ *
9
+ * DEPRECATED -- As far as I can see this is now unused anyway
10
+ * KInt modules are swapping to AppSettings instead of mod-settings, so no centralised components should be needed
8
11
  */
9
12
  const SettingsFormContainer = ({
10
13
  ConfigFormComponent,
@@ -17,6 +20,9 @@ const SettingsFormContainer = ({
17
20
  scope, // We don't use this currently but it's here for future reference
18
21
  ...rest
19
22
  }) => {
23
+ // eslint-disable-next-line no-console
24
+ console.warn('SettingsFormContainer is deprecated, as it utilises mod-config');
25
+
20
26
  const callout = useCallout();
21
27
  const kintIntl = useKintIntl(passedIntlKey, passedIntlNS);
22
28
 
@@ -5,12 +5,17 @@ import { useOkapiKy } from '@folio/stripes/core';
5
5
  import { modConfigEntriesQueryKey, parseModConfigEntry } from '../utils';
6
6
  import { MOD_SETTINGS_ENDPOINT } from '../constants/endpoints';
7
7
 
8
+ // DEPRECATED -- As far as I can see this is now unused anyway
9
+ // KInt modules are swapping to AppSettings instead of mod-settings, so no centralised components should be needed
8
10
  const useModConfigEntries = ({
9
11
  configName,
10
12
  moduleName,
11
13
  namespaceAppend,
12
14
  queryParams
13
15
  }) => {
16
+ // eslint-disable-next-line no-console
17
+ console.warn('useModConfigEntries is deprecated, as it utilises mod-config');
18
+
14
19
  const ky = useOkapiKy();
15
20
 
16
21
  const query = `?query=(module=${moduleName} and configName=${configName})`;
@@ -6,11 +6,16 @@ import { modConfigEntriesQueryKey } from '../utils';
6
6
  import { MOD_SETTINGS_ENDPOINT } from '../constants/endpoints';
7
7
 
8
8
  // This will simply take in some information and decide whether to mutate via POST or via PUT
9
+ // DEPRECATED -- As far as I can see this is now unused anyway
10
+ // KInt modules are swapping to AppSettings instead of mod-settings, so no centralised components should be needed
9
11
  const useMutateModConfigEntry = ({
10
12
  configName,
11
13
  moduleName,
12
14
  id
13
15
  }) => {
16
+ // eslint-disable-next-line no-console
17
+ console.warn('useMutateModConfigEntry is deprecated, as it utilises mod-config');
18
+
14
19
  const ky = useOkapiKy();
15
20
  const queryClient = useQueryClient();
16
21
 
@@ -0,0 +1,27 @@
1
+ import generateKiwtQuery from '../generateKiwtQuery';
2
+
3
+ // FIXME we need to test more than this
4
+ describe('generateKiwtQueryParams', () => {
5
+ describe('generateKiwtQueryParams nested group filters', () => {
6
+ test('EXAMPLE nested AND shape', () => {
7
+ expect(generateKiwtQuery({
8
+ filters: [{
9
+ groupValues: {
10
+ AND: [
11
+ { path: 'wobble', value: 'test' },
12
+ {
13
+ groupValues: {
14
+ OR: [
15
+ { value: 'test2' },
16
+ { path: 'sup', value: 'test3' },
17
+ { groupValues: { AND: [{ value: 'test4' }, { path: 'help', comparator: '!=', value: 'false' }] } },
18
+ ]
19
+ }
20
+ },
21
+ ]
22
+ }
23
+ }]
24
+ }, {}, false)).toEqual('?filters=wobble==test&&(test2||sup==test3||(test4&&help!=false))&stats=true');
25
+ });
26
+ });
27
+ });