@balena/ui-shared-components 15.2.8-build-renovate-virtua-aee6a7b863067b778d02e49c68558c2262a30e27-1 → 15.2.8-build-persistent-filters-catch-invalid-url-params-af9e281cfe85b50e34220e08c6c0c41e0d30f78a-1
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.
|
@@ -45,9 +45,16 @@ export const loadRulesFromUrl = (searchLocation, schema, navigate) => {
|
|
|
45
45
|
ignoreQueryPrefix: true,
|
|
46
46
|
strictNullHandling: true,
|
|
47
47
|
}) || {};
|
|
48
|
+
let hasInvalidSignatures = false;
|
|
48
49
|
const rules = (Array.isArray(parsed) ? parsed : Object.values(parsed))
|
|
49
50
|
.filter(isQueryStringFilterRuleset)
|
|
50
51
|
.map((r) => {
|
|
52
|
+
if (hasInvalidSignatures) {
|
|
53
|
+
// When we have already found an invalid signature,
|
|
54
|
+
// there is no point to continue parsing the rest
|
|
55
|
+
// so we return early.
|
|
56
|
+
return;
|
|
57
|
+
}
|
|
51
58
|
if (!Array.isArray(r)) {
|
|
52
59
|
r = [r];
|
|
53
60
|
}
|
|
@@ -102,6 +109,8 @@ export const loadRulesFromUrl = (searchLocation, schema, navigate) => {
|
|
|
102
109
|
// In case of invalid signatures, remove search params to avoid Errors.
|
|
103
110
|
if (isSignaturesInvalid) {
|
|
104
111
|
navigate === null || navigate === void 0 ? void 0 : navigate({ search: '' }, { replace: true });
|
|
112
|
+
hasInvalidSignatures = true;
|
|
113
|
+
return;
|
|
105
114
|
}
|
|
106
115
|
if (signatures[0].operator === FULL_TEXT_SLUG) {
|
|
107
116
|
// TODO: listFilterQuery serializes the already escaped value and this
|
|
@@ -112,6 +121,11 @@ export const loadRulesFromUrl = (searchLocation, schema, navigate) => {
|
|
|
112
121
|
return createFilter(schema, signatures);
|
|
113
122
|
})
|
|
114
123
|
.filter((f) => !!f);
|
|
124
|
+
if (hasInvalidSignatures) {
|
|
125
|
+
// When we have found an invalid signature, we clear the url search params
|
|
126
|
+
// and return no filters, even if some of them were successfully parsed.
|
|
127
|
+
return [];
|
|
128
|
+
}
|
|
115
129
|
return rules;
|
|
116
130
|
};
|
|
117
131
|
export const PersistentFilters = (_a) => {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@balena/ui-shared-components",
|
|
3
|
-
"version": "15.2.8-build-
|
|
3
|
+
"version": "15.2.8-build-persistent-filters-catch-invalid-url-params-af9e281cfe85b50e34220e08c6c0c41e0d30f78a-1",
|
|
4
4
|
"main": "./dist/index.js",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"files": [
|
|
@@ -53,7 +53,7 @@
|
|
|
53
53
|
"rimraf": "^6.0.0",
|
|
54
54
|
"ts-jest": "^29.2.5",
|
|
55
55
|
"typescript": "^5.9.2",
|
|
56
|
-
"virtua": "^0.
|
|
56
|
+
"virtua": "^0.37.3",
|
|
57
57
|
"zxcvbn": "^4.4.2"
|
|
58
58
|
},
|
|
59
59
|
"devDependencies": {
|
|
@@ -135,7 +135,7 @@
|
|
|
135
135
|
},
|
|
136
136
|
"homepage": "https://github.com/balena-io/ui-shared-components#readme",
|
|
137
137
|
"versionist": {
|
|
138
|
-
"publishedAt": "2025-11-
|
|
138
|
+
"publishedAt": "2025-11-21T15:07:27.651Z"
|
|
139
139
|
},
|
|
140
140
|
"overrides": {
|
|
141
141
|
"storybook": "$storybook",
|