@orchestrator-ui/orchestrator-ui-components 8.4.4 → 8.5.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.
Files changed (69) hide show
  1. package/.turbo/turbo-build.log +8 -8
  2. package/.turbo/turbo-lint.log +1 -1
  3. package/.turbo/turbo-test.log +7 -7
  4. package/CHANGELOG.md +17 -0
  5. package/dist/index.d.ts +1890 -562
  6. package/dist/index.js +3814 -2103
  7. package/dist/index.js.map +1 -1
  8. package/package.json +5 -4
  9. package/src/components/WfoPydanticForm/WfoPydanticForm.tsx +23 -1
  10. package/src/components/WfoSearchBar/WfoSearchField.tsx +0 -1
  11. package/src/components/WfoSearchPage/WfoFilterGroup/WfoFilterGroup.tsx +5 -5
  12. package/src/components/WfoSearchPage/WfoSearch/WfoSearch.tsx +12 -5
  13. package/src/components/WfoSearchPage/constants.ts +0 -4
  14. package/src/components/WfoSearchPage/utils.ts +75 -20
  15. package/src/components/WfoSubscription/WfoSubscriptionActions/WfoSubscriptionActionExpandableMenuItem.tsx +36 -18
  16. package/src/components/WfoSubscription/WfoSubscriptionActions/WfoSubscriptionActionsMenuItem.tsx +38 -2
  17. package/src/components/WfoSubscription/utils/index.ts +3 -0
  18. package/src/components/WfoSubscription/utils/utils.spec.ts +39 -4
  19. package/src/components/WfoSubscription/utils/utils.ts +10 -4
  20. package/src/components/WfoTable/WfoStructuredSearchTable/WfoAddGroupAction.tsx +19 -0
  21. package/src/components/WfoTable/WfoStructuredSearchTable/WfoAddRuleAction.tsx +23 -0
  22. package/src/components/WfoTable/WfoStructuredSearchTable/WfoCombinatorSelector.tsx +30 -0
  23. package/src/components/WfoTable/WfoStructuredSearchTable/WfoExpandingSearchRow.tsx +38 -0
  24. package/src/components/WfoTable/WfoStructuredSearchTable/WfoFieldSelector.tsx +84 -0
  25. package/src/components/WfoTable/WfoStructuredSearchTable/WfoFilterBuilder.tsx +189 -0
  26. package/src/components/WfoTable/WfoStructuredSearchTable/WfoOperatorSelector.tsx +33 -0
  27. package/src/components/WfoTable/WfoStructuredSearchTable/WfoRangeEditor.tsx +64 -0
  28. package/src/components/WfoTable/WfoStructuredSearchTable/WfoRemoveGroupAction.tsx +21 -0
  29. package/src/components/WfoTable/WfoStructuredSearchTable/WfoRemoveRuleAction.tsx +20 -0
  30. package/src/components/WfoTable/WfoStructuredSearchTable/WfoRule.tsx +16 -0
  31. package/src/components/WfoTable/WfoStructuredSearchTable/WfoRuleGroup.tsx +73 -0
  32. package/src/components/WfoTable/WfoStructuredSearchTable/WfoStructuredSearchTable.tsx +323 -0
  33. package/src/components/WfoTable/WfoStructuredSearchTable/WfoValueEditor.tsx +159 -0
  34. package/src/components/WfoTable/WfoStructuredSearchTable/index.ts +2 -0
  35. package/src/components/WfoTable/WfoStructuredSearchTable/styles.ts +146 -0
  36. package/src/components/WfoTable/WfoTable/WfoDragHandler.tsx +4 -2
  37. package/src/components/WfoTable/index.ts +2 -6
  38. package/src/components/WfoTitleWithWebsocketBadge/WfoTitleWithWebsocketBadge.tsx +14 -6
  39. package/src/components/WfoWorkflowSteps/WfoStep/WfoStep.tsx +1 -0
  40. package/src/components/WfoWorkflowSteps/WfoStepList/WfoStepList.tsx +3 -0
  41. package/src/components/WfoWorkflowSteps/WfoWorkflowStepList/WfoWorkflowStepList.tsx +32 -12
  42. package/src/components/WfoWorkflowUserGuide/WfoPageWithUserGuide.tsx +38 -0
  43. package/src/components/WfoWorkflowUserGuide/WfoWorkflowGuideExpandablePanel.tsx +151 -0
  44. package/src/components/WfoWorkflowUserGuide/index.ts +2 -0
  45. package/src/components/WfoWorkflowUserGuide/styles.ts +87 -0
  46. package/src/components/index.ts +1 -0
  47. package/src/configuration/version.ts +1 -1
  48. package/src/contexts/OrchestratorConfigContext.tsx +1 -0
  49. package/src/hooks/index.ts +1 -0
  50. package/src/hooks/usePathAutoComplete.ts +3 -4
  51. package/src/hooks/useSearch.ts +20 -15
  52. package/src/hooks/useSearchPagination.ts +11 -8
  53. package/src/hooks/useUrlParams.ts +3 -5
  54. package/src/icons/WfoTrashFilled.tsx +13 -0
  55. package/src/icons/WfoXMarkSmall.tsx +2 -2
  56. package/src/icons/index.ts +1 -0
  57. package/src/messages/en-GB.json +94 -8
  58. package/src/messages/nl-NL.json +23 -5
  59. package/src/pages/WfoSearchPocPage.tsx +402 -0
  60. package/src/pages/index.ts +1 -0
  61. package/src/pages/processes/WfoProcessDetail.tsx +10 -10
  62. package/src/pages/processes/WfoProcessDetailPage.tsx +1 -0
  63. package/src/pages/processes/WfoStartProcessPage.tsx +15 -19
  64. package/src/rtk/api.ts +1 -0
  65. package/src/rtk/endpoints/index.ts +1 -0
  66. package/src/rtk/endpoints/search.ts +45 -10
  67. package/src/rtk/endpoints/workflowGuides.ts +25 -0
  68. package/src/types/search.ts +21 -5
  69. package/src/types/types.ts +10 -1
@@ -5,3 +5,4 @@ export * from './startPage';
5
5
  export * from './subscriptions';
6
6
  export * from './tasks';
7
7
  export * from './workflows';
8
+ export * from './WfoSearchPocPage';
@@ -11,7 +11,6 @@ import {
11
11
  TimelineItem,
12
12
  WfoIsAllowedToRender,
13
13
  WfoLoading,
14
- WfoProcessListNoteEdit,
15
14
  WfoTimeline,
16
15
  WfoTitleWithWebsocketBadge,
17
16
  } from '@/components';
@@ -181,15 +180,16 @@ export const WfoProcessDetail = ({
181
180
  return (
182
181
  <>
183
182
  <WfoContentHeader
184
- title={<WfoTitleWithWebsocketBadge title={pageTitle} />}
185
- subtitle={
186
- <>
187
- <WfoProcessListNoteEdit processId={processDetail?.processId || ''} note={processDetail?.note || ''} />
188
- <WfoProductInformationWithLink
189
- productNames={productNames}
190
- workflowName={processDetail?.workflowName ?? ''}
191
- />
192
- </>
183
+ title={
184
+ <WfoTitleWithWebsocketBadge
185
+ title={pageTitle}
186
+ extraElement={
187
+ <WfoProductInformationWithLink
188
+ productNames={productNames}
189
+ workflowName={processDetail?.workflowName ?? ''}
190
+ />
191
+ }
192
+ />
193
193
  }
194
194
  >
195
195
  <WfoIsAllowedToRender resource={PolicyResource.PROCESS_RETRY}>
@@ -59,6 +59,7 @@ export const WfoProcessDetailPage = ({ processId }: WfoProcessDetailPageProps) =
59
59
  ref={stepListRef}
60
60
  lastStatus={processDetail.lastStatus}
61
61
  processId={processDetail.processId}
62
+ workflowName={processDetail.workflowName}
62
63
  steps={groupedSteps.flatMap((groupedStep) => groupedStep.steps)}
63
64
  traceBack={processDetail.traceback}
64
65
  userInputForm={processDetail.form}
@@ -6,7 +6,7 @@ import { useRouter } from 'next/router';
6
6
 
7
7
  import { EuiFlexGroup, EuiFlexItem, EuiHorizontalRule, EuiPanel, EuiText } from '@elastic/eui';
8
8
 
9
- import { WfoError, WfoLoading } from '@/components';
9
+ import { WfoError, WfoPageWithUserGuide } from '@/components';
10
10
  import { WfoPydanticForm } from '@/components/WfoPydanticForm';
11
11
  import { WfoStepStatusIcon } from '@/components/WfoWorkflowSteps';
12
12
  import { getWorkflowStepsStyles } from '@/components/WfoWorkflowSteps/styles';
@@ -140,25 +140,21 @@ export const WfoStartProcessPage = ({ processName, isTask = false }: WfoStartPro
140
140
  timelineItems={timeLineItems}
141
141
  isLoading={isLoading}
142
142
  >
143
- <EuiPanel
144
- css={{
145
- backgroundColor: theme.colors.backgroundBaseNeutral,
146
- marginTop: theme.base * 3,
147
- }}
148
- >
149
- <EuiFlexGroup css={getStepHeaderStyle(false)}>
150
- <WfoStepStatusIcon stepStatus={StepStatus.FORM} />
151
-
152
- <EuiFlexItem grow={0}>
153
- <EuiText css={stepListContentBoldTextStyle}>{t('userInput')}</EuiText>
154
- <EuiText>{t(isTask ? 'submitTaskFormLabel' : 'submitWorkflowFormLabel')}</EuiText>
155
- </EuiFlexItem>
156
- </EuiFlexGroup>
157
- <EuiHorizontalRule />
158
- {(hasError && <WfoError />) || (
143
+ <WfoPageWithUserGuide workflowName={processName}>
144
+ <EuiPanel css={{ backgroundColor: theme.colors.backgroundBaseNeutral }}>
145
+ <EuiFlexGroup gutterSize="none" css={getStepHeaderStyle(false)}>
146
+ <WfoStepStatusIcon stepStatus={StepStatus.FORM} />
147
+ <EuiFlexItem grow={0}>
148
+ <EuiText css={stepListContentBoldTextStyle}>{t('userInput')}</EuiText>
149
+ <EuiText>{t(isTask ? 'submitTaskFormLabel' : 'submitWorkflowFormLabel')}</EuiText>
150
+ </EuiFlexItem>
151
+ </EuiFlexGroup>
152
+ <EuiHorizontalRule />
153
+ {(hasError && <WfoError />) || (
159
154
  <WfoPydanticForm processName={processName} startProcessPayload={startProcessPayload} isTask={isTask} />
160
- ) || <WfoLoading />}
161
- </EuiPanel>
155
+ )}
156
+ </EuiPanel>
157
+ </WfoPageWithUserGuide>
162
158
  </WfoProcessDetail>
163
159
  );
164
160
  };
package/src/rtk/api.ts CHANGED
@@ -22,6 +22,7 @@ export enum HttpStatus {
22
22
  FormNotComplete = 510,
23
23
  BadGateway = 502,
24
24
  BadRequest = 400,
25
+ PreconditionFailed = 412,
25
26
  ServiceUnavailable = 503,
26
27
  Unauthorized = 401,
27
28
  Forbidden = 403,
@@ -20,3 +20,4 @@ export * from './forms';
20
20
  export * from './fileUpload';
21
21
  export * from './search';
22
22
  export * from './availability';
23
+ export * from './workflowGuides';
@@ -2,7 +2,7 @@ import { getEndpointPath } from '@/components/WfoSearchPage/utils';
2
2
  import { BaseQueryTypes, orchestratorApi } from '@/rtk';
3
3
  import {
4
4
  EntityKind,
5
- Group,
5
+ Filter,
6
6
  PaginatedSearchResults,
7
7
  PathAutocompleteResponse,
8
8
  RetrieverType,
@@ -10,14 +10,20 @@ import {
10
10
  } from '@/types';
11
11
 
12
12
  export interface SearchPayload {
13
+ order_by?: {
14
+ element: string;
15
+ direction: string;
16
+ };
17
+ response_columns: string[];
13
18
  entity_type: EntityKind;
14
19
  query: string;
15
- filters?: Group;
16
- limit?: number;
20
+ filters?: Filter;
21
+ limit?: number | number[];
17
22
  retriever?: RetrieverType;
23
+ cursor?: string;
18
24
  }
19
25
 
20
- export interface SearchPaginationPayload extends SearchPayload {
26
+ export interface SearchPaginationPayload extends Omit<SearchPayload, 'cursor'> {
21
27
  cursor: number;
22
28
  }
23
29
 
@@ -30,15 +36,39 @@ export interface SearchDefinitionsResponse {
30
36
 
31
37
  const searchApi = orchestratorApi.injectEndpoints({
32
38
  endpoints: (build) => ({
33
- search: build.mutation<PaginatedSearchResults, SearchPayload>({
34
- query: ({ entity_type, query, filters, limit, retriever }) => ({
35
- url: `search/${getEndpointPath(entity_type)}`,
39
+ search: build.query<PaginatedSearchResults, SearchPayload>({
40
+ query: ({ entity_type, query, filters, limit, retriever, response_columns, order_by, cursor }) => ({
41
+ url: `search/${getEndpointPath(entity_type)}${cursor ? `?cursor=${cursor}` : ''}`,
36
42
  method: 'POST',
37
- body: { query, filters, limit, retriever },
43
+ body: {
44
+ query,
45
+ filters,
46
+ limit: cursor ? undefined : limit,
47
+ retriever,
48
+ order_by: order_by && !query ? order_by : undefined,
49
+ response_columns,
50
+ },
38
51
  headers: {
39
52
  'Content-Type': 'application/json',
40
53
  },
41
54
  }),
55
+ serializeQueryArgs: ({ queryArgs, endpointName }) => {
56
+ // Strip cursor so every page of the same base search shares one cache entry.
57
+ const rest = { ...queryArgs };
58
+ delete rest.cursor;
59
+ return { endpointName, queryArgs: rest };
60
+ },
61
+ merge: (currentCache, newItems, { arg }) => {
62
+ if (!arg.cursor) {
63
+ Object.assign(currentCache, newItems);
64
+ return;
65
+ }
66
+ currentCache.data.push(...newItems.data);
67
+ currentCache.page_info = newItems.page_info;
68
+ currentCache.cursor = newItems.cursor;
69
+ currentCache.search_metadata = newItems.search_metadata;
70
+ },
71
+ forceRefetch: ({ currentArg, previousArg }) => currentArg?.cursor !== previousArg?.cursor,
42
72
  extraOptions: {
43
73
  baseQueryType: BaseQueryTypes.fetch,
44
74
  },
@@ -77,5 +107,10 @@ const searchApi = orchestratorApi.injectEndpoints({
77
107
  }),
78
108
  });
79
109
 
80
- export const { useSearchMutation, useSearchWithPaginationMutation, useSearchPathsQuery, useSearchDefinitionsQuery } =
81
- searchApi;
110
+ export const {
111
+ useSearchQuery,
112
+ useLazySearchQuery,
113
+ useSearchWithPaginationMutation,
114
+ useSearchPathsQuery,
115
+ useSearchDefinitionsQuery,
116
+ } = searchApi;
@@ -0,0 +1,25 @@
1
+ import { BaseQueryTypes, orchestratorApi } from '@/rtk';
2
+
3
+ export interface WorkflowGuideResponse {
4
+ content: string;
5
+ }
6
+
7
+ const workflowGuidesApi = orchestratorApi.injectEndpoints({
8
+ endpoints: (build) => ({
9
+ getWorkflowGuide: build.query<WorkflowGuideResponse, { workflowName: string }>({
10
+ query: ({ workflowName }) => ({
11
+ url: `surf/workflow_user_guides/${workflowName}`,
12
+ method: 'GET',
13
+ headers: {
14
+ 'Content-Type': 'application/json',
15
+ },
16
+ }),
17
+ transformResponse: (content: string): WorkflowGuideResponse => ({ content: content ?? '' }),
18
+ extraOptions: {
19
+ baseQueryType: BaseQueryTypes.fetch,
20
+ },
21
+ }),
22
+ }),
23
+ });
24
+
25
+ export const { useGetWorkflowGuideQuery } = workflowGuidesApi;
@@ -1,4 +1,9 @@
1
- export type EntityKind = 'SUBSCRIPTION' | 'PRODUCT' | 'WORKFLOW' | 'PROCESS';
1
+ export enum EntityKind {
2
+ SUBSCRIPTION = 'SUBSCRIPTION',
3
+ PRODUCT = 'PRODUCT',
4
+ WORKFLOW = 'WORKFLOW',
5
+ PROCESS = 'PROCESS',
6
+ }
2
7
 
3
8
  export enum RetrieverType {
4
9
  Auto = 'auto',
@@ -20,14 +25,20 @@ export interface SearchResult {
20
25
  score: number;
21
26
  perfect_match: number;
22
27
  matching_field?: MatchingField | null;
28
+ response_columns: Record<string, string | number | null>;
23
29
  }
24
30
 
25
31
  /** Paginated search results */
26
32
  export type PaginatedSearchResults = {
27
33
  data: SearchResult[];
34
+ cursor: {
35
+ total_items: number;
36
+ start_cursor: number;
37
+ end_cursor: number;
38
+ };
28
39
  page_info: {
29
40
  has_next_page: boolean;
30
- next_page_cursor: number | null;
41
+ next_page_cursor: string | null;
31
42
  };
32
43
  search_metadata: {
33
44
  search_type: string | null;
@@ -78,12 +89,17 @@ export type PathFilter = {
78
89
  | LtreeMatchesFilter;
79
90
  };
80
91
 
92
+ export interface OperatorDisplay {
93
+ symbol: string;
94
+ description: string;
95
+ }
96
+
81
97
  type ActionType = 'select';
82
98
 
83
99
  type BaseSearchParameters = {
84
100
  query?: string | null;
85
101
 
86
- filters?: PathFilter[] | Group | null;
102
+ filters?: PathFilter[] | Filter | null;
87
103
 
88
104
  action: ActionType;
89
105
  };
@@ -116,9 +132,9 @@ export type Condition = {
116
132
  condition: { op: string; value?: unknown };
117
133
  };
118
134
 
119
- export type Group = {
135
+ export type Filter = {
120
136
  op: 'AND' | 'OR';
121
- children: Array<Group | Condition>;
137
+ children: Array<Filter | Condition>;
122
138
  };
123
139
 
124
140
  export type value_schema = {
@@ -588,6 +588,7 @@ export type OrchestratorConfig = {
588
588
  useWebSockets: boolean;
589
589
  useThemeToggle: boolean;
590
590
  showWorkflowInformationLink: boolean;
591
+ showWorkflowUserGuide: boolean;
591
592
  enableSupportMenuItem: boolean;
592
593
  supportMenuItemUrl: string;
593
594
  enableAoStackStatus: boolean;
@@ -600,14 +601,21 @@ export enum ColorModes {
600
601
  DARK = 'DARK',
601
602
  }
602
603
 
604
+ export interface SubscriptionRelation {
605
+ subscription_id: string;
606
+ subscription_description: string;
607
+ }
608
+
609
+ // TODO: remove locked_relations and unterminated_in_use_by_subscriptions (UUID-only fields) when orchestrator-core 6.0.0 is released and only use the _detail variants
603
610
  export interface SubscriptionAction {
604
611
  name: string;
605
612
  description: string;
606
613
  reason?: string;
607
614
  usable_when?: string[];
608
615
  locked_relations?: string[];
609
- unterminated_parents?: string[];
616
+ locked_relations_detail?: SubscriptionRelation[];
610
617
  unterminated_in_use_by_subscriptions?: string[];
618
+ unterminated_in_use_by_subscriptions_detail?: SubscriptionRelation[];
611
619
  status?: string;
612
620
  action?: string;
613
621
  }
@@ -615,6 +623,7 @@ export interface SubscriptionAction {
615
623
  export type SubscriptionActions = {
616
624
  reason?: string;
617
625
  locked_relations?: string[];
626
+ locked_relations_detail?: SubscriptionRelation[];
618
627
  modify: SubscriptionAction[];
619
628
  terminate: SubscriptionAction[];
620
629
  system: SubscriptionAction[];