@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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@orchestrator-ui/orchestrator-ui-components",
3
- "version": "6.0.0",
3
+ "version": "6.1.0",
4
4
  "license": "Apache-2.0",
5
5
  "description": "Library of UI Components used to display the workflow orchestrator frontend",
6
6
  "author": {
@@ -1 +1 @@
1
- export const ORCHESTRATOR_UI_LIBRARY_VERSION = '6.0.0';
1
+ export const ORCHESTRATOR_UI_LIBRARY_VERSION = '6.1.0';
@@ -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
- <path
17
- fill={color}
18
- 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"
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
  );
@@ -291,7 +291,8 @@
291
291
  "metadata": "Metadata",
292
292
  "note": "Note",
293
293
  "customerFullname": "Customer",
294
- "customerShortcode": "Customer abbr"
294
+ "customerShortcode": "Customer abbr",
295
+ "actions": "Actions"
295
296
  },
296
297
  "detail": {
297
298
  "title": "Subscriptions",
@@ -288,7 +288,8 @@
288
288
  "note": "Notitie",
289
289
  "metadata": "Metadata",
290
290
  "customerFullname": "Klant",
291
- "customerShortcode": "Klantafkorting"
291
+ "customerShortcode": "Klantafkorting",
292
+ "actions": "Acties"
292
293
  },
293
294
  "detail": {
294
295
  "title": "Subscriptions",
@@ -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 : {});