@checkstack/ui 1.1.3 → 1.1.4
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,5 +1,11 @@
|
|
|
1
1
|
# @checkstack/ui
|
|
2
2
|
|
|
3
|
+
## 1.1.4
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- c0c0ed2: Fix LDAP group-to-role mapping not assigning roles on login. The LDAP search now explicitly requests the `memberOf` operational attribute, which is not returned by default. Also fixes array flattening that discarded multi-valued group memberships, and adds case-insensitive DN comparison for group matching. The test LDAP environment now uses `groupOfUniqueNames` to enable the memberOf overlay. Additionally, the DynamicForm validation no longer blocks saving when optional array fields (like group mappings) are empty.
|
|
8
|
+
|
|
3
9
|
## 1.1.3
|
|
4
10
|
|
|
5
11
|
### Patch Changes
|
package/package.json
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@checkstack/ui",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.4",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "src/index.ts",
|
|
6
6
|
"dependencies": {
|
|
7
|
-
"@checkstack/common": "0.6.
|
|
8
|
-
"@checkstack/frontend-api": "0.3.
|
|
7
|
+
"@checkstack/common": "0.6.4",
|
|
8
|
+
"@checkstack/frontend-api": "0.3.8",
|
|
9
9
|
"@monaco-editor/react": "^4.7.0",
|
|
10
10
|
"@radix-ui/react-accordion": "^1.2.12",
|
|
11
11
|
"@radix-ui/react-dialog": "^1.1.15",
|
|
@@ -30,9 +30,9 @@
|
|
|
30
30
|
"typescript": "^5.0.0",
|
|
31
31
|
"@types/react": "^18.2.0",
|
|
32
32
|
"@testing-library/react": "^16.0.0",
|
|
33
|
-
"@checkstack/test-utils-frontend": "0.0.
|
|
34
|
-
"@checkstack/tsconfig": "0.0.
|
|
35
|
-
"@checkstack/scripts": "0.1.
|
|
33
|
+
"@checkstack/test-utils-frontend": "0.0.4",
|
|
34
|
+
"@checkstack/tsconfig": "0.0.4",
|
|
35
|
+
"@checkstack/scripts": "0.1.2"
|
|
36
36
|
},
|
|
37
37
|
"scripts": {
|
|
38
38
|
"typecheck": "tsc --noEmit",
|
|
@@ -155,13 +155,23 @@ describe("isValueEmpty", () => {
|
|
|
155
155
|
});
|
|
156
156
|
|
|
157
157
|
describe("arrays", () => {
|
|
158
|
-
it("treats empty array as
|
|
159
|
-
expect(isValueEmpty([], arraySchema)).toBe(
|
|
158
|
+
it("treats empty array as valid when no minItems specified", () => {
|
|
159
|
+
expect(isValueEmpty([], arraySchema)).toBe(false);
|
|
160
|
+
});
|
|
161
|
+
|
|
162
|
+
it("treats empty array as empty when minItems > 0", () => {
|
|
163
|
+
const requiredArraySchema: JsonSchemaProperty = { type: "array", minItems: 1 } as JsonSchemaProperty;
|
|
164
|
+
expect(isValueEmpty([], requiredArraySchema)).toBe(true);
|
|
160
165
|
});
|
|
161
166
|
|
|
162
167
|
it("treats non-empty array as not empty", () => {
|
|
163
168
|
expect(isValueEmpty([1, 2, 3], arraySchema)).toBe(false);
|
|
164
169
|
});
|
|
170
|
+
|
|
171
|
+
it("treats non-empty array as not empty even with minItems", () => {
|
|
172
|
+
const requiredArraySchema: JsonSchemaProperty = { type: "array", minItems: 1 } as JsonSchemaProperty;
|
|
173
|
+
expect(isValueEmpty([1], requiredArraySchema)).toBe(false);
|
|
174
|
+
});
|
|
165
175
|
});
|
|
166
176
|
|
|
167
177
|
describe("objects", () => {
|
|
@@ -48,8 +48,13 @@ export function isValueEmpty(
|
|
|
48
48
|
): boolean {
|
|
49
49
|
if (val === undefined || val === null) return true;
|
|
50
50
|
if (typeof val === "string" && val.trim() === "") return true;
|
|
51
|
-
// For arrays,
|
|
52
|
-
if (Array.isArray(val) && val.length === 0)
|
|
51
|
+
// For arrays, only consider empty if schema requires minimum items
|
|
52
|
+
if (Array.isArray(val) && val.length === 0) {
|
|
53
|
+
const minItems = (propSchema as JsonSchemaProperty & { minItems?: number }).minItems;
|
|
54
|
+
if (minItems !== undefined && minItems > 0) return true;
|
|
55
|
+
// Empty arrays are valid by default (e.g., optional mappings lists)
|
|
56
|
+
return false;
|
|
57
|
+
}
|
|
53
58
|
// For objects (nested schemas), recursively check required fields
|
|
54
59
|
if (propSchema.type === "object" && propSchema.properties) {
|
|
55
60
|
const objVal = val as Record<string, unknown>;
|