@orchestrator-ui/orchestrator-ui-components 6.0.0 → 6.1.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.
- package/.turbo/turbo-build.log +6 -6
- package/.turbo/turbo-lint.log +1 -1
- package/.turbo/turbo-test.log +9 -9
- package/CHANGELOG.md +6 -0
- package/dist/index.d.ts +5 -2
- package/dist/index.js +30 -10
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/configuration/version.ts +1 -1
- package/src/icons/WfoPencil.tsx +23 -4
- package/src/messages/en-GB.json +2 -1
- package/src/messages/nl-NL.json +2 -1
- package/src/utils/optionalArray.spec.ts +27 -0
- package/src/utils/optionalArray.ts +5 -0
package/package.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const ORCHESTRATOR_UI_LIBRARY_VERSION = '6.
|
|
1
|
+
export const ORCHESTRATOR_UI_LIBRARY_VERSION = '6.1.0';
|
package/src/icons/WfoPencil.tsx
CHANGED
|
@@ -2,6 +2,13 @@ import React, { FC } from 'react';
|
|
|
2
2
|
|
|
3
3
|
import { WfoIconProps } from './WfoIconProps';
|
|
4
4
|
|
|
5
|
+
const Path = ({ color }: { color: string }) => (
|
|
6
|
+
<path
|
|
7
|
+
fill={color}
|
|
8
|
+
d="M13.3787,7.7928875 L16.2071,10.6213175 L7.82842,18.9999975 L5,18.9999975 L5,16.1715975 L13.3787,7.7928875 Z M18.4142,5.5857875 C19.1953,6.3668275 19.1953,7.6331575 18.4142,8.4142075 L17.6213,9.2071075 L14.7929,6.3786775 L15.5858,5.5857875 C16.3668,4.8047375 17.6332,4.8047375 18.4142,5.5857875 Z"
|
|
9
|
+
/>
|
|
10
|
+
);
|
|
11
|
+
|
|
5
12
|
export const WfoPencil: FC<WfoIconProps> = ({
|
|
6
13
|
width = 24,
|
|
7
14
|
height = 24,
|
|
@@ -13,9 +20,21 @@ export const WfoPencil: FC<WfoIconProps> = ({
|
|
|
13
20
|
height={height}
|
|
14
21
|
viewBox="0 0 24 24"
|
|
15
22
|
>
|
|
16
|
-
<
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
23
|
+
<Path color={color} />
|
|
24
|
+
</svg>
|
|
25
|
+
);
|
|
26
|
+
|
|
27
|
+
export const WfoPencilCompact: FC<WfoIconProps> = ({
|
|
28
|
+
width = 24,
|
|
29
|
+
height = 24,
|
|
30
|
+
color = '#000000',
|
|
31
|
+
}) => (
|
|
32
|
+
<svg
|
|
33
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
34
|
+
width={width}
|
|
35
|
+
height={height}
|
|
36
|
+
viewBox="5 5 14 14"
|
|
37
|
+
>
|
|
38
|
+
<Path color={color} />
|
|
20
39
|
</svg>
|
|
21
40
|
);
|
package/src/messages/en-GB.json
CHANGED
package/src/messages/nl-NL.json
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { toOptionalObjectProperty } from 'pydantic-forms';
|
|
2
|
+
|
|
1
3
|
import {
|
|
2
4
|
optionalArrayMapper,
|
|
3
5
|
toOptionalArrayEntries,
|
|
@@ -70,3 +72,28 @@ describe('optionalArrayMapper', () => {
|
|
|
70
72
|
expect(result).toEqual([]);
|
|
71
73
|
});
|
|
72
74
|
});
|
|
75
|
+
|
|
76
|
+
describe('toOptionalObjectProperty', () => {
|
|
77
|
+
const flatSchema = { const: 'CONST_VAL' };
|
|
78
|
+
function withSpread(addConstValue: boolean) {
|
|
79
|
+
return {
|
|
80
|
+
...(addConstValue && { const: flatSchema.const }),
|
|
81
|
+
};
|
|
82
|
+
}
|
|
83
|
+
function withHelper(addConstValue: boolean) {
|
|
84
|
+
return {
|
|
85
|
+
...toOptionalObjectProperty(
|
|
86
|
+
{ const: flatSchema.const },
|
|
87
|
+
addConstValue,
|
|
88
|
+
),
|
|
89
|
+
};
|
|
90
|
+
}
|
|
91
|
+
it('adds const when addConstValue = true', () => {
|
|
92
|
+
expect(withSpread(true)).toEqual(withHelper(true));
|
|
93
|
+
expect(withSpread(true)).toHaveProperty('const', 'CONST_VAL');
|
|
94
|
+
});
|
|
95
|
+
it('omits const when addConstValue = false', () => {
|
|
96
|
+
expect(withSpread(false)).toEqual(withHelper(false));
|
|
97
|
+
expect(withSpread(false)).not.toHaveProperty('const');
|
|
98
|
+
});
|
|
99
|
+
});
|
|
@@ -12,3 +12,8 @@ export const optionalArrayMapper = <T, U>(
|
|
|
12
12
|
data: T[] | undefined = [],
|
|
13
13
|
mapper: (input: T) => U,
|
|
14
14
|
): U[] => data.map(mapper);
|
|
15
|
+
|
|
16
|
+
export const toOptionalObjectProperty = <T extends object>(
|
|
17
|
+
entries: T,
|
|
18
|
+
condition: boolean,
|
|
19
|
+
): T | object => (condition ? entries : {});
|