@orchestrator-ui/orchestrator-ui-components 2.1.0 → 2.1.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.
@@ -1,12 +1,12 @@
1
1
 
2
- > @orchestrator-ui/orchestrator-ui-components@2.1.0 build
2
+ > @orchestrator-ui/orchestrator-ui-components@2.1.1 build
3
3
  > npm run generate-version && tsup src/index.ts
4
4
 
5
5
 
6
- > @orchestrator-ui/orchestrator-ui-components@2.1.0 generate-version
6
+ > @orchestrator-ui/orchestrator-ui-components@2.1.1 generate-version
7
7
  > node -p "'export const ORCHESTRATOR_UI_LIBRARY_VERSION = ' + JSON.stringify(require('./package.json').version) + ';'" > src/configuration/version.ts && prettier --write src/configuration/version.ts
8
8
 
9
- src/configuration/version.ts 55ms
9
+ src/configuration/version.ts 57ms
10
10
  CLI Building entry: src/index.ts
11
11
  CLI Using tsconfig: tsconfig.build.json
12
12
  CLI tsup v8.1.0
@@ -16,6 +16,6 @@ src/configuration/version.ts 55ms
16
16
  DTS Build start
17
17
  ESM dist/index.js 1.88 MB
18
18
  ESM dist/index.js.map 3.42 MB
19
- ESM ⚡️ Build success in 1363ms
20
- DTS ⚡️ Build success in 20354ms
21
- DTS dist/index.d.ts 183.06 KB
19
+ ESM ⚡️ Build success in 1436ms
20
+ DTS ⚡️ Build success in 21652ms
21
+ DTS dist/index.d.ts 183.17 KB
@@ -1,5 +1,5 @@
1
1
 
2
- > @orchestrator-ui/orchestrator-ui-components@2.1.0 lint
2
+ > @orchestrator-ui/orchestrator-ui-components@2.1.1 lint
3
3
  > eslint "src/**/*.ts*"
4
4
 
5
5
 
@@ -1,41 +1,41 @@
1
1
 
2
- > @orchestrator-ui/orchestrator-ui-components@2.1.0 test
2
+ > @orchestrator-ui/orchestrator-ui-components@2.1.1 test
3
3
  > jest
4
4
 
5
- PASS Wfo-UI Tests src/components/WfoSubscription/utils/utils.spec.ts
6
5
  PASS Wfo-UI Tests src/components/WfoForms/formFields/utils.spec.ts
6
+ PASS Wfo-UI Tests src/components/WfoSubscription/utils/utils.spec.ts
7
+ PASS Wfo-UI Tests src/utils/date.spec.ts
7
8
  PASS Wfo-UI Tests src/components/WfoTree/treeUtils.spec.ts
8
9
  PASS Wfo-UI Tests src/pages/processes/timelineUtils.spec.ts
10
+ PASS Wfo-UI Tests src/components/WfoTable/WfoTable/WfoGroupedTable/utils.spec.ts
9
11
  PASS Wfo-UI Tests src/utils/string.spec.ts
10
- PASS Wfo-UI Tests src/utils/date.spec.ts
11
12
  PASS Wfo-UI Tests src/utils/getProductNamesFromProcess.spec.ts
12
- PASS Wfo-UI Tests src/components/WfoTable/WfoTable/WfoGroupedTable/utils.spec.ts
13
13
  PASS Wfo-UI Tests src/components/WfoTable/WfoTableWithFilter/updateQueryString.spec.ts
14
14
  PASS Wfo-UI Tests src/components/WfoTable/utils/tableConfigPersistence.spec.ts
15
- PASS Wfo-UI Tests src/rtk/utils.spec.ts
16
15
  PASS Wfo-UI Tests src/components/WfoTable/utils/tableUtils.spec.ts
17
- PASS Wfo-UI Tests src/components/WfoPageTemplate/WfoSidebar/utils/menuItemIsAllowed.spec.ts
16
+ PASS Wfo-UI Tests src/rtk/utils.spec.ts
18
17
  PASS Wfo-UI Tests src/utils/resultFlattener.spec.ts
19
- PASS Wfo-UI Tests src/messages/getTranslationMessages.spec.ts
18
+ PASS Wfo-UI Tests src/components/WfoPageTemplate/WfoSidebar/utils/menuItemIsAllowed.spec.ts
20
19
  PASS Wfo-UI Tests src/utils/getEnvironmentVariables.spec.ts
21
20
  PASS Wfo-UI Tests src/utils/getToastMessage.spec.ts
21
+ PASS Wfo-UI Tests src/messages/getTranslationMessages.spec.ts
22
22
  PASS Wfo-UI Tests src/utils/toSortedObjectKeys.spec.ts
23
23
  PASS Wfo-UI Tests src/utils/optionalArray.spec.ts
24
24
  PASS Wfo-UI Tests src/components/WfoTable/utils/columns.spec.ts
25
25
  PASS Wfo-UI Tests src/utils/filterData.spec.ts
26
- PASS Wfo-UI Tests src/utils/getTokenName.spec.ts
27
26
  PASS Wfo-UI Tests src/components/WfoWorkflowSteps/stepListUtils.spec.ts
28
- PASS Wfo-UI Tests src/utils/onlyUnique.spec.ts
27
+ PASS Wfo-UI Tests src/utils/getTokenName.spec.ts
29
28
  PASS Wfo-UI Tests src/utils/environmentVariables.spec.ts
29
+ PASS Wfo-UI Tests src/utils/onlyUnique.spec.ts
30
30
  PASS Wfo-UI Tests src/utils/uuid.spec.ts
31
- PASS Wfo-UI Tests src/utils/getTypedFieldFromObject.spec.ts
32
31
  PASS Wfo-UI Tests src/utils/cacheTag.spec.ts
33
- PASS Wfo-UI Tests src/utils/getQueryVariablesForExport.spec.ts
32
+ PASS Wfo-UI Tests src/utils/getTypedFieldFromObject.spec.ts
34
33
  PASS Wfo-UI Tests src/components/WfoPageTemplate/WfoPageHeader/utils/toHexColorWithOpacity.spec.ts
35
- PASS Wfo-UI Tests src/components/WfoTable/WfoTable/utils.spec.ts (7.109 s)
34
+ PASS Wfo-UI Tests src/utils/getQueryVariablesForExport.spec.ts
35
+ PASS Wfo-UI Tests src/components/WfoTable/WfoTable/utils.spec.ts (8.103 s)
36
36
 
37
37
  Test Suites: 31 passed, 31 total
38
38
  Tests: 190 passed, 190 total
39
39
  Snapshots: 0 total
40
- Time: 10.671 s
40
+ Time: 11.675 s
41
41
  Ran all test suites.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,13 @@
1
1
  # @orchestrator-ui/orchestrator-ui-components
2
2
 
3
+ ## 2.1.1
4
+
5
+ ### Patch Changes
6
+
7
+ - 648badb: 1423 Handles not_authenticated errors from graphql endpoints. Adds accessTokenExpiresAt and refreshTokenExpiresAt to WfoSession
8
+ - f5138d3: 1406 Added sorting for new tasks and workflow dropdowns
9
+ - 223888a: 1363 - Making the title use all space available. Moves the subtitle around to show above the children (action buttons) on small screens
10
+
3
11
  ## 2.1.0
4
12
 
5
13
  ### Minor Changes
package/dist/index.d.ts CHANGED
@@ -66,7 +66,7 @@ declare type WfoGraphqlErrorsMeta = {
66
66
  };
67
67
  declare const prepareHeaders: (headers: Headers) => Promise<Headers>;
68
68
  declare const handlePromiseErrorWithCallback: <T>(promise: Promise<unknown>, status: HttpStatus, callbackAction: (json: T) => void) => Promise<unknown>;
69
- declare const handleGraphqlMetaErrors: (meta: WfoGraphqlErrorsMeta) => void;
69
+ declare const handleGraphqlMetaErrors: (meta: WfoGraphqlErrorsMeta, responseHasInvalidData?: boolean | undefined) => void;
70
70
  declare const catchErrorResponse: (response: Response, authActive: boolean) => Promise<any>;
71
71
  declare const orchestratorApi: _reduxjs_toolkit_query_react.Api<(args: any, api: _reduxjs_toolkit_query_react.BaseQueryApi, extraOptions: ExtraOptions) => {
72
72
  error?: undefined;
@@ -746,6 +746,8 @@ declare function useWithOrchestratorTheme<T>(getStylesFunction: (theme: WfoTheme
746
746
 
747
747
  declare type WfoSession = Session & {
748
748
  accessToken?: string;
749
+ accessTokenExpiresAt?: number;
750
+ refreshTokenExpiresAt?: number;
749
751
  profile?: WfoUserProfile;
750
752
  };
751
753
  declare type WfoUserProfile = {
@@ -2944,7 +2946,7 @@ declare const IPAM_IP_BLOCKS_ENDPOINT: string;
2944
2946
  declare const IPAM_FREE_SUBNETS_ENDPOINT: string;
2945
2947
  declare const SUBSCRIPTION_ACTIONS_ENDPOINT = "subscriptions/workflows";
2946
2948
 
2947
- declare const ORCHESTRATOR_UI_LIBRARY_VERSION = "2.1.0";
2949
+ declare const ORCHESTRATOR_UI_LIBRARY_VERSION = "2.1.1";
2948
2950
 
2949
2951
  declare const useGetTranslationMessages: (locale: string | undefined) => {
2950
2952
  pydanticForms: {
package/dist/index.js CHANGED
@@ -26792,7 +26792,7 @@ var PolicyResource = /* @__PURE__ */ ((PolicyResource2) => {
26792
26792
  })(PolicyResource || {});
26793
26793
 
26794
26794
  // src/configuration/version.ts
26795
- var ORCHESTRATOR_UI_LIBRARY_VERSION = "2.1.0";
26795
+ var ORCHESTRATOR_UI_LIBRARY_VERSION = "2.1.1";
26796
26796
 
26797
26797
  // src/types/types.ts
26798
26798
  var EngineStatus = /* @__PURE__ */ ((EngineStatus3) => {
@@ -32631,20 +32631,6 @@ var wfoGraphqlRequestBaseQuery = (options, authActive) => {
32631
32631
  variables,
32632
32632
  preparedHeaders
32633
32633
  );
32634
- if (errors2?.length && authActive) {
32635
- errors2.map((error) => {
32636
- if (error.extensions?.error_type === "not_authenticated") {
32637
- signOut();
32638
- }
32639
- });
32640
- }
32641
- if (!data && errors2) {
32642
- return {
32643
- data: null,
32644
- errors: errors2,
32645
- meta: { errors: [] }
32646
- };
32647
- }
32648
32634
  return {
32649
32635
  data,
32650
32636
  meta: { errors: errors2 }
@@ -32652,6 +32638,12 @@ var wfoGraphqlRequestBaseQuery = (options, authActive) => {
32652
32638
  } catch (error) {
32653
32639
  if (error instanceof ClientError) {
32654
32640
  const { request, response } = error;
32641
+ const errors2 = response.errors;
32642
+ if (authActive && errors2?.some(
32643
+ (error2) => error2.extensions?.error_type === "not_authenticated"
32644
+ )) {
32645
+ signOut();
32646
+ }
32655
32647
  const customErrors = options.customErrors ?? ((error2) => error2.response.errors);
32656
32648
  const customizedErrors = customErrors(error);
32657
32649
  return { error: customizedErrors, meta: { request, response } };
@@ -32695,8 +32687,8 @@ var handlePromiseErrorWithCallback = (promise, status, callbackAction) => {
32695
32687
  }
32696
32688
  });
32697
32689
  };
32698
- var handleGraphqlMetaErrors = (meta) => {
32699
- if (meta.errors && meta.errors.length > 0) {
32690
+ var handleGraphqlMetaErrors = (meta, responseHasInvalidData) => {
32691
+ if (responseHasInvalidData && meta.errors && meta.errors.length > 0) {
32700
32692
  throw meta.errors[0];
32701
32693
  }
32702
32694
  };
@@ -36525,18 +36517,20 @@ var WfoContentHeader = ({
36525
36517
  children
36526
36518
  }) => /* @__PURE__ */ jsxs38(Fragment2, { children: [
36527
36519
  /* @__PURE__ */ jsxs38(EuiFlexGroup, { children: [
36528
- /* @__PURE__ */ jsx54(EuiFlexItem, { children: /* @__PURE__ */ jsx54(
36529
- WfoRenderElementOrString,
36530
- {
36531
- renderString: (value) => /* @__PURE__ */ jsx54(EuiPageHeader, { pageTitle: value }),
36532
- children: title
36533
- }
36534
- ) }),
36535
- children && /* @__PURE__ */ jsx54(EuiFlexItem, { children: /* @__PURE__ */ jsx54(EuiFlexGroup, { justifyContent: "flexEnd", children: /* @__PURE__ */ jsx54(WfoRenderElementOrString, { children }) }) })
36536
- ] }),
36537
- subtitle && /* @__PURE__ */ jsxs38(Fragment2, { children: [
36538
- /* @__PURE__ */ jsx54(EuiSpacer, { size: "m" }),
36539
- /* @__PURE__ */ jsx54(WfoRenderElementOrString, { children: subtitle })
36520
+ /* @__PURE__ */ jsxs38(EuiFlexItem, { children: [
36521
+ /* @__PURE__ */ jsx54(
36522
+ WfoRenderElementOrString,
36523
+ {
36524
+ renderString: (value) => /* @__PURE__ */ jsx54(EuiPageHeader, { pageTitle: value }),
36525
+ children: title
36526
+ }
36527
+ ),
36528
+ subtitle && /* @__PURE__ */ jsxs38("div", { children: [
36529
+ /* @__PURE__ */ jsx54(EuiSpacer, { size: "m" }),
36530
+ /* @__PURE__ */ jsx54(WfoRenderElementOrString, { children: subtitle })
36531
+ ] })
36532
+ ] }),
36533
+ children && /* @__PURE__ */ jsx54(EuiFlexItem, { grow: 0, children: /* @__PURE__ */ jsx54(EuiFlexGroup, { justifyContent: "flexEnd", children: /* @__PURE__ */ jsx54(WfoRenderElementOrString, { children }) }) })
36540
36534
  ] }),
36541
36535
  /* @__PURE__ */ jsx54(EuiSpacer, { size: "l" })
36542
36536
  ] });
@@ -37623,15 +37617,15 @@ var WfoStartWorkflowButtonComboBox = () => {
37623
37617
  const { isEngineRunningNow } = useCheckEngineStatus();
37624
37618
  const { data } = useGetWorkflowOptionsQuery();
37625
37619
  const workflowOptions = data?.startOptions || [];
37626
- const comboBoxOptions = workflowOptions.map(
37627
- (option) => ({
37628
- data: {
37629
- workflowName: option.workflowName,
37630
- productId: option.productId
37631
- },
37632
- label: option.productName || ""
37633
- })
37634
- );
37620
+ const comboBoxOptions = [...workflowOptions].sort(
37621
+ (workflowA, workflowB) => workflowA.productName.localeCompare(workflowB.productName)
37622
+ ).map((option) => ({
37623
+ data: {
37624
+ workflowName: option.workflowName,
37625
+ productId: option.productId
37626
+ },
37627
+ label: option.productName || ""
37628
+ }));
37635
37629
  const handleOptionChange = async (selectedProduct) => {
37636
37630
  if (await isEngineRunningNow()) {
37637
37631
  const { workflowName, productId } = selectedProduct.data;
@@ -50187,14 +50181,12 @@ var WfoStartTaskButtonComboBox = () => {
50187
50181
  const { isEngineRunningNow } = useCheckEngineStatus();
50188
50182
  const { data } = useGetTaskOptionsQuery();
50189
50183
  const taskOptions = data?.startOptions || [];
50190
- const comboBoxOptions = taskOptions.map(
50191
- (option) => ({
50192
- data: {
50193
- workflowName: option.name
50194
- },
50195
- label: option.description || ""
50196
- })
50197
- );
50184
+ const comboBoxOptions = [...taskOptions].map((option) => ({
50185
+ data: {
50186
+ workflowName: option.name
50187
+ },
50188
+ label: option.description ?? option.name
50189
+ })).sort((taskA, taskB) => taskA.label.localeCompare(taskB.label));
50198
50190
  const handleOptionChange = async (selectedProduct) => {
50199
50191
  if (await isEngineRunningNow()) {
50200
50192
  const { workflowName } = selectedProduct.data;