@kineticdata/react 6.0.2 → 6.0.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 +86 -0
- package/lib/apis/core/submissions.js +2 -2
- package/lib/components/core/form/FormForm.js +3 -2
- package/lib/components/form/FormState.js +2 -1
- package/lib/components/form/tests/Form.test.js +1432 -1194
- package/lib/components/form/tests/components.js +71 -61
- package/lib/components/table/tests/Table.redux.test.js +162 -0
- package/lib/components/table/tests/Table.test.js +767 -0
- package/lib/components/table/tests/components.js +182 -0
- package/lib/components/task/builder/TreeBuilder.js +4 -1
- package/lib/components/task/builder/builder.redux.js +25 -13
- package/lib/components/task/builder/models.js +5 -0
- package/lib/components/task/workflows/WorkflowForm.js +90 -39
- package/package.json +2 -2
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
# Changelog for `@kineticdata/react`
|
|
2
|
+
|
|
3
|
+
When upgrading `@kineticdata/react` to a newer version, remember that all `@kineticdata/*` libraries must be on the same exact version. This is because each `@kineticdata/bundle-*` library has `@kineticdata/react` as a dependency, and if two different versions of `@kineticdata/react` are installed in a bundle, the bundle will never load because authentication happens in a different version of `@kineticdata/react` than the one used during rendering the packages.
|
|
4
|
+
|
|
5
|
+
Remember to always run `yarn install` after upgrading any dependency versions.
|
|
6
|
+
|
|
7
|
+
## 6.0.2 (November 6, 2023)
|
|
8
|
+
|
|
9
|
+
- Removed XSRF header setting from Request Interceptor
|
|
10
|
+
- Added SAML logout options
|
|
11
|
+
- Upgraded various `dependencies` to resolve vulnerabilities
|
|
12
|
+
- Updated the `react` and `react-dom` `peerDependencies` to `>=17.0.2` to support the latest versions of React
|
|
13
|
+
|
|
14
|
+
### Bundle Issues
|
|
15
|
+
|
|
16
|
+
One of the `dependencies` that was updated is `axios` whose latest version causes some issues with the latest `react-scripts`. If the bundle has a `craco.config.js` file, the following steps must be taken when upgrading to this version.
|
|
17
|
+
|
|
18
|
+
1. In `craco.config.js`, add the following function to the very end of the file:
|
|
19
|
+
|
|
20
|
+
```javascript
|
|
21
|
+
function getFileLoaderRule(rules) {
|
|
22
|
+
for (const rule of rules) {
|
|
23
|
+
if ('oneOf' in rule) {
|
|
24
|
+
const found = getFileLoaderRule(rule.oneOf);
|
|
25
|
+
if (found) {
|
|
26
|
+
return found;
|
|
27
|
+
}
|
|
28
|
+
} else if (rule.test === undefined && rule.type === 'asset/resource') {
|
|
29
|
+
return rule;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
2. In `craco.config.js`, add the following code inside the `configure` function of the `webpack` object:
|
|
36
|
+
|
|
37
|
+
```javascript
|
|
38
|
+
// Fix for CJS files not being treated as JavaScript files
|
|
39
|
+
// https://github.com/facebook/create-react-app/issues/11889#issuecomment-1114928008
|
|
40
|
+
const fileLoaderRule = getFileLoaderRule(webpackConfig.module.rules);
|
|
41
|
+
if (!fileLoaderRule) {
|
|
42
|
+
throw new Error('File loader not found');
|
|
43
|
+
}
|
|
44
|
+
fileLoaderRule.exclude.push(/\.cjs$/);
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
## 6.0.1 (September 20, 2023)
|
|
48
|
+
|
|
49
|
+
- Updated the `react` and `react-dom` `peerDependencies` to `^17.0.2` to support React v17
|
|
50
|
+
|
|
51
|
+
### Bundle Issues
|
|
52
|
+
|
|
53
|
+
It is recommended to upgrade the bundle's `react` and `react-dom` versions to `^17.0.2`. This upgrade should not have any breaking changes. To do so, update these two dependency versions in `bundle/packages/app/package.json` and the peer dependency versions in all of the `package.json` files of the other packages.
|
|
54
|
+
|
|
55
|
+
If you do upgrade `react` to v17, the following steps must also be taken if the bundle has testing configured:
|
|
56
|
+
|
|
57
|
+
1. In `bundle/package.json`, remove the `enzyme-adapter-react-16` dependency, and add the following dependency:
|
|
58
|
+
`"@wojtekmaj/enzyme-adapter-react-17": "^0.8.0"`
|
|
59
|
+
2. In `bundle/packages/app/src/setupTests.js`, change the `Adapter` import from `enzyme-adapter-react-16` to be from `@wojtekmaj/enzyme-adapter-react-17`.
|
|
60
|
+
|
|
61
|
+
## 6.0.0 (February 22, 2023)
|
|
62
|
+
|
|
63
|
+
- Removed all code related to Discussions
|
|
64
|
+
- Removed most `devDependencies`, which were move to the project root
|
|
65
|
+
|
|
66
|
+
### Bundle Issues
|
|
67
|
+
|
|
68
|
+
Because all discussions code was removed from the library, any bundles that are upgraded to this version must have all of their discussions code removed as well, since the various imports from this library that bundles used no longer exist.
|
|
69
|
+
|
|
70
|
+
We consolidated most of our `devDependencies` into the root of our project, of which `@kineticdata/react` is just one part. Any bundles upgrading to this version must add the following `devDependencies` to the `package.json` file in the root of their `bundle` folder:
|
|
71
|
+
|
|
72
|
+
```
|
|
73
|
+
"@babel/cli": "^7.23.0",
|
|
74
|
+
"@babel/runtime": "^7.23.2",
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
If you get the following error when trying to run your bundle:
|
|
78
|
+
`Uncaught Error: Cannot find module '@babel/runtime/helpers/esm/regeneratorRuntime'`
|
|
79
|
+
You will need to run the following commands in your `bundle` directory:
|
|
80
|
+
|
|
81
|
+
```
|
|
82
|
+
npx yarn-deduplicate --packages @babel/runtime -- yarn.lock
|
|
83
|
+
yarn install
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
The above step will always be required when first upgrading to a v6+ version of `@kineticdata/react`.
|
|
@@ -649,7 +649,7 @@ var importSubmissions = exports.importSubmissions = function importSubmissions(o
|
|
|
649
649
|
file = options.file,
|
|
650
650
|
_options$mode = options.mode,
|
|
651
651
|
mode = _options$mode === void 0 ? MODE_IMPORT : _options$mode,
|
|
652
|
-
|
|
652
|
+
signal = options.signal;
|
|
653
653
|
if (!kappSlug) {
|
|
654
654
|
throw new Error('importSubmissions failed! The option "kappSlug" is required.');
|
|
655
655
|
}
|
|
@@ -661,7 +661,7 @@ var importSubmissions = exports.importSubmissions = function importSubmissions(o
|
|
|
661
661
|
}
|
|
662
662
|
var path = "".concat(_helpers.bundle.apiLocation(), "/kapps/").concat(kappSlug, "/forms/").concat(formSlug, "/submissions?import");
|
|
663
663
|
return _axios["default"][modeToFn(mode)](path, file, {
|
|
664
|
-
|
|
664
|
+
signal: signal,
|
|
665
665
|
data: file,
|
|
666
666
|
params: (0, _http.paramBuilder)(options),
|
|
667
667
|
headers: (0, _objectSpread2["default"])((0, _objectSpread2["default"])({}, (0, _http.headerBuilder)(options)), {}, {
|
|
@@ -147,8 +147,9 @@ var fields = function fields(_ref5) {
|
|
|
147
147
|
var formSlug = _ref5.formSlug,
|
|
148
148
|
kappSlug = _ref5.kappSlug;
|
|
149
149
|
return function (_ref6) {
|
|
150
|
-
var form = _ref6.form
|
|
151
|
-
|
|
150
|
+
var form = _ref6.form,
|
|
151
|
+
kapp = _ref6.kapp;
|
|
152
|
+
return (!formSlug || form) && (!kappSlug || kapp) && [!!kappSlug && {
|
|
152
153
|
name: 'anonymous',
|
|
153
154
|
label: 'Anonymous',
|
|
154
155
|
type: 'checkbox',
|
|
@@ -6,8 +6,9 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.FormState = void 0;
|
|
7
7
|
var _store = require("../../store");
|
|
8
8
|
var selectFormState = function selectFormState(formState) {
|
|
9
|
+
var _formState$fields;
|
|
9
10
|
return {
|
|
10
|
-
dirty: formState.fields.some(function (field) {
|
|
11
|
+
dirty: (_formState$fields = formState.fields) === null || _formState$fields === void 0 ? void 0 : _formState$fields.some(function (field) {
|
|
11
12
|
return field.dirty;
|
|
12
13
|
}),
|
|
13
14
|
error: formState.error
|