@orchestrator-ui/orchestrator-ui-components 1.13.1 → 1.13.2

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,5 +1,5 @@
1
1
 
2
- > @orchestrator-ui/orchestrator-ui-components@1.13.1 build
2
+ > @orchestrator-ui/orchestrator-ui-components@1.13.2 build
3
3
  > tsup src/index.ts --format esm --dts --tsconfig tsconfig.build.json
4
4
 
5
5
  CLI Building entry: src/index.ts
@@ -9,6 +9,6 @@
9
9
  ESM Build start
10
10
  DTS Build start
11
11
  ESM dist/index.js 2.13 MB
12
- ESM ⚡️ Build success in 720ms
13
- DTS ⚡️ Build success in 13364ms
14
- DTS dist/index.d.ts 162.39 KB
12
+ ESM ⚡️ Build success in 710ms
13
+ DTS ⚡️ Build success in 13470ms
14
+ DTS dist/index.d.ts 163.42 KB
@@ -1,5 +1,5 @@
1
1
 
2
- > @orchestrator-ui/orchestrator-ui-components@1.13.1 lint
2
+ > @orchestrator-ui/orchestrator-ui-components@1.13.2 lint
3
3
  > eslint "src/**/*.ts*"
4
4
 
5
5
 
@@ -1,36 +1,36 @@
1
1
 
2
- > @orchestrator-ui/orchestrator-ui-components@1.13.1 test
2
+ > @orchestrator-ui/orchestrator-ui-components@1.13.2 test
3
3
  > jest
4
4
 
5
5
  PASS Orchestrator UI Components Tests src/components/WfoForms/formFields/utils.spec.ts
6
6
  PASS Orchestrator UI Components Tests src/components/WfoSubscription/utils/utils.spec.ts
7
7
  PASS Orchestrator UI Components Tests src/utils/date.spec.ts
8
- PASS Orchestrator UI Components Tests src/utils/getProductNamesFromProcess.spec.ts
9
8
  PASS Orchestrator UI Components Tests src/pages/processes/timelineUtils.spec.ts
9
+ PASS Orchestrator UI Components Tests src/utils/getProductNamesFromProcess.spec.ts
10
10
  PASS Orchestrator UI Components Tests src/utils/string.spec.ts
11
- PASS Orchestrator UI Components Tests src/components/WfoTable/WfoDataGridTable/WfodataGridColumns.spec.ts
12
- PASS Orchestrator UI Components Tests src/components/WfoTable/WfoTableWithFilter/updateQueryString.spec.ts
13
11
  PASS Orchestrator UI Components Tests src/components/WfoTree/treeUtils.spec.ts
12
+ PASS Orchestrator UI Components Tests src/components/WfoTable/WfoTableWithFilter/updateQueryString.spec.ts
13
+ PASS Orchestrator UI Components Tests src/components/WfoTable/WfoDataGridTable/WfodataGridColumns.spec.ts
14
14
  PASS Orchestrator UI Components Tests src/components/WfoTable/utils/tableConfigPersistence.spec.ts
15
+ PASS Orchestrator UI Components Tests src/components/WfoTable/utils/tableUtils.spec.ts
15
16
  PASS Orchestrator UI Components Tests src/components/WfoTable/utils/mapSortableAndFilterableValuesToTableColumnConfig.spec.ts
16
17
  PASS Orchestrator UI Components Tests src/utils/resultFlattener.spec.ts
17
- PASS Orchestrator UI Components Tests src/components/WfoTable/utils/tableUtils.spec.ts
18
18
  PASS Orchestrator UI Components Tests src/messages/getTranslationMessages.spec.ts
19
- PASS Orchestrator UI Components Tests src/components/WfoTable/utils/columns.spec.ts
20
19
  PASS Orchestrator UI Components Tests src/utils/getToastMessage.spec.ts
21
- PASS Orchestrator UI Components Tests src/components/WfoWorkflowSteps/stepListUtils.spec.ts
20
+ PASS Orchestrator UI Components Tests src/utils/optionalArray.spec.ts
21
+ PASS Orchestrator UI Components Tests src/components/WfoTable/utils/columns.spec.ts
22
22
  PASS Orchestrator UI Components Tests src/utils/sortObjectKeys.spec.ts
23
+ PASS Orchestrator UI Components Tests src/components/WfoWorkflowSteps/stepListUtils.spec.ts
23
24
  PASS Orchestrator UI Components Tests src/utils/getTokenName.spec.ts
24
25
  PASS Orchestrator UI Components Tests src/utils/environmentVariables.spec.ts
25
26
  PASS Orchestrator UI Components Tests src/utils/onlyUnique.spec.ts
26
- PASS Orchestrator UI Components Tests src/utils/uuid.spec.ts
27
27
  PASS Orchestrator UI Components Tests src/utils/getTypedFieldFromObject.spec.ts
28
+ PASS Orchestrator UI Components Tests src/utils/uuid.spec.ts
28
29
  PASS Orchestrator UI Components Tests src/utils/getQueryVariablesForExport.spec.ts
29
- PASS Orchestrator UI Components Tests src/utils/toOptionalArrayEntry.spec.ts
30
30
  PASS Orchestrator UI Components Tests src/components/WfoPageTemplate/WfoPageHeader/utils/toHexColorWithOpacity.spec.ts
31
31
 
32
32
  Test Suites: 26 passed, 26 total
33
- Tests: 157 passed, 157 total
33
+ Tests: 159 passed, 159 total
34
34
  Snapshots: 0 total
35
- Time: 3.675 s
35
+ Time: 3.856 s
36
36
  Ran all test suites.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,12 @@
1
1
  # @orchestrator-ui/orchestrator-ui-components
2
2
 
3
+ ## 1.13.2
4
+
5
+ ### Patch Changes
6
+
7
+ - 43be47b: 565 Added a new summary card listing the 5 latest workflows for the user that is logged in
8
+ - 8b6e73d: 879 Makes SummaryCards on the start page overridable
9
+
3
10
  ## 1.13.1
4
11
 
5
12
  ### Patch Changes
package/dist/index.d.ts CHANGED
@@ -2483,6 +2483,32 @@ declare type CustomApiConfig = {
2483
2483
  declare type CustomApiSlice = Slice<CustomApiConfig[]>;
2484
2484
  declare const getCustomApiSlice: (customApis: CustomApiConfig[]) => CustomApiSlice;
2485
2485
 
2486
+ declare type SummaryCardListItem = {
2487
+ title: string;
2488
+ value: ReactNode;
2489
+ url?: string;
2490
+ };
2491
+
2492
+ declare type SummaryCardButtonConfig = {
2493
+ name: string;
2494
+ url: string;
2495
+ };
2496
+
2497
+ declare enum SummaryCardStatus {
2498
+ Success = "Success",
2499
+ Error = "Error",
2500
+ Neutral = "Neutral"
2501
+ }
2502
+ declare type SummaryCard = {
2503
+ headerTitle: string;
2504
+ headerValue: string | number;
2505
+ headerStatus: SummaryCardStatus;
2506
+ listTitle: string;
2507
+ listItems: SummaryCardListItem[];
2508
+ button?: SummaryCardButtonConfig;
2509
+ isLoading?: boolean;
2510
+ };
2511
+
2486
2512
  declare type ValueOverrideFunction = (fieldValue: FieldValue) => ReactNode;
2487
2513
  declare type ValueOverrideConfiguration = Record<string, ValueOverrideFunction>;
2488
2514
  declare type WfoSubscriptionDetailGeneralConfiguration = {
@@ -2490,6 +2516,9 @@ declare type WfoSubscriptionDetailGeneralConfiguration = {
2490
2516
  node: ReactNode;
2491
2517
  };
2492
2518
  declare type OrchestratorComponentOverride = {
2519
+ startPage?: {
2520
+ summaryCardConfigurationOverride?: (defaultItems: SummaryCard[]) => SummaryCard[];
2521
+ };
2493
2522
  subscriptionDetail?: {
2494
2523
  valueOverrides?: ValueOverrideConfiguration;
2495
2524
  generalSectionConfigurationOverride?: (defaultSections: WfoSubscriptionDetailGeneralConfiguration[], subscriptionDetail: SubscriptionDetail) => WfoSubscriptionDetailGeneralConfiguration[];
@@ -3008,6 +3037,11 @@ declare const useGetTranslationMessages: (locale: string | undefined) => {
3008
3037
  };
3009
3038
  };
3010
3039
  startPage: {
3040
+ myWorkflows: {
3041
+ buttonText: string;
3042
+ headerTitle: string;
3043
+ listTitle: string;
3044
+ };
3011
3045
  activeSubscriptions: {
3012
3046
  buttonText: string;
3013
3047
  headerTitle: string;
@@ -3470,6 +3504,11 @@ declare const useGetTranslationMessages: (locale: string | undefined) => {
3470
3504
  };
3471
3505
  };
3472
3506
  startPage: {
3507
+ myWorkflows: {
3508
+ buttonText: string;
3509
+ headerTitle: string;
3510
+ listTitle: string;
3511
+ };
3473
3512
  activeSubscriptions: {
3474
3513
  buttonText: string;
3475
3514
  headerTitle: string;
@@ -3644,5 +3683,6 @@ declare const snakeToHuman: (value: string) => string;
3644
3683
  declare const snakeToKebab: (value: string) => string;
3645
3684
 
3646
3685
  declare const toOptionalArrayEntry: <T>(data: T, condition: boolean) => [] | [T];
3686
+ declare const optionalArrayMapper: <T, U>(data: T[] | undefined, mapper: (input: T) => U) => U[];
3647
3687
 
3648
- export { ACTIVE_PROCESSES_LIST_TABLE_LOCAL_STORAGE_KEY, ACTIVE_TASKS_LIST_TABLE_LOCAL_STORAGE_KEY, AcceptField, type AcceptFieldProps, ApiClient, ApiClientContext, ApiClientContextProvider, type ApiClientContextProviderProps, type ApiContext, type AppDispatch, type AutoFieldsProps, BadgeType, BaseApiClient, type BaseGraphQlResult, BaseQueryTypes, BoolField, type BoolFieldProps, COMPLETED_PROCESSES_LIST_TABLE_LOCAL_STORAGE_KEY, COMPLETED_TASKS_LIST_TABLE_LOCAL_STORAGE_KEY, type CacheNames, type CacheOption, CacheTags, ColorModes, type ColumnConfig, type ConfirmDialogActions, ConfirmationDialogContext, ConfirmationDialogContextWrapper, ConfirmationDialogProvider, ConnectedSelectField, ContactPersonAutocomplete, ContactPersonNameField, type ContactPersonNameFieldProps, CreateForm, type CustomApiConfig, type Customer, type CustomerDescriptions, CustomerField, type CustomerFieldProps, type CustomersResult, DEFAULT_PAGE_SIZE, DEFAULT_PAGE_SIZES, type DataDisplayParams, type DataDisplayReturnValues, DateField, type DateFieldProps, DividerField, type DividerFieldProps, type EmailAddress, type EmailState, EngineStatus, Environment, ErrorField, type ErrorFieldProps, ErrorsField, type ErrorsFieldProps, type ExternalService, type FetchFilter, type FieldProps$1 as FieldProps, type FieldValue, type FilterQuery, type FixedInputDefinition, type Form, type FormNotCompleteResponse, type GraphQLPageInfo, type GraphQLSort, type GraphQlResultPage, type GraphQlSinglePage, type GraphqlFilter, type GraphqlQueryVariables, type GroupedStep, HIDDEN_KEYS, type HeaderBadgeProps, HttpStatus, type IPvAnyNetworkFieldProps, type ImsNode, ImsNodeIdField, type ImsNodeIdFieldProps, type ImsPort, type ImsPortFieldProps, ImsPortIdField, type InUseByRelation, type InitialOrchestratorStoreConfig, type InputForm, type IpBlock, IpNetworkField, type IpPrefix, LabelField, type LabelFieldProps, ListAddField, type ListAddFieldProps, ListDelField, type ListDelFieldProps, ListField, type ListFieldProps, ListSelectField, type ListSelectFieldProps, Locale, LocationCodeField, type LocationCodeFieldProps, LongTextField, type LongTextFieldProps, MAXIMUM_ITEMS_FOR_BULK_FETCHING, METADATA_PRODUCT_BLOCKS_TABLE_LOCAL_STORAGE_KEY, METADATA_PRODUCT_TABLE_LOCAL_STORAGE_KEY, METADATA_RESOURCE_TYPES_TABLE_LOCAL_STORAGE_KEY, METADATA_TASKS_TABLE_LOCAL_STORAGE_KEY, METADATA_WORKFLOWS_TABLE_LOCAL_STORAGE_KEY, type MetaDataTab, NUMBER_OF_ITEMS_REPRESENTING_ALL_ITEMS, NestField, type NestFieldProps, type NodeSubscription, type Nullable, NumField, type NumFieldProps, OptGroupField, type OptGroupFieldProps, type OrchestratorComponentOverride, type OrchestratorConfig, OrchestratorConfigContext, OrchestratorConfigProvider, type OrchestratorConfigProviderProps, PATH_METADATA, PATH_METADATA_PRODUCTS, PATH_METADATA_PRODUCT_BLOCKS, PATH_METADATA_RESOURCE_TYPES, PATH_METADATA_TASKS, PATH_METADATA_WORKFLOWS, PATH_SETTINGS, PATH_START, PATH_START_NEW_TASK, PATH_START_NEW_WORKFLOW, PATH_SUBSCRIPTIONS, PATH_TASKS, PATH_WORKFLOWS, type Pagination, type Policy, PolicyContext, PolicyContextProvider, type PolicyProviderProps, PolicyResource, PortMode, type Process, type ProcessDetail, type ProcessDetailResultRaw, ProcessDoneStatuses, type ProcessListExportItem, type ProcessListItem, type ProcessListResponse, type ProcessListResult, type ProcessListSummaryResponse, ProcessStatus, type ProcessStatusCounts, type ProcessStepsResult, type ProcessesDetailResult, type ProductBlockDefinition, type ProductBlockDefinitionsResult, type ProductBlockInstance, type ProductBlocksResponse, type ProductDefinition, type ProductDefinitionsResult, ProductField, type ProductFieldProps, ProductLifecycleStatus, ProductTag, type ProductsResponse, type ProductsSummary, type ProductsSummaryResponse, RENDER_ALL, RESOURCE_TYPE_FIELD_DESCRIPTION, RESOURCE_TYPE_FIELD_ID, RESOURCE_TYPE_FIELD_PRODUCT_BLOCKS, RESOURCE_TYPE_FIELD_TYPE, RadioField, type RadioFieldProps, type RelatedSubscription, RelatedSubscriptionsQuery, type RelatedSubscriptionsResponse, type RelatedSubscriptionsResult, RenderDirection, type ResourceTypeDefinition, type ResourceTypeDefinitionsResult, type ResourceTypesResponse, type RootState, STEP_STATE_HIDDEN_KEYS, SUBSCRIPTIONS_TABLE_LOCAL_STORAGE_KEY, type SelectFieldProps, type ServicePort, type ShowConfirmDialog, type ShowConfirmDialogType, type SortOption, SortOrder, type StartComboBoxOption, type StartOptionsResponse, type StartOptionsResult, type StartProcessStep, type Step, type StepListItem, type StepState, StepStatus, StoreProvider, type StoreProviderProps, type StoredTableConfig, SubmitField, type SubmitFieldProps, type Subscription, type SubscriptionAction, type SubscriptionDetail, type SubscriptionDetailProcess, type SubscriptionDetailResponse, type SubscriptionDetailResult, SubscriptionDetailTab, type SubscriptionDropdownOption, type SubscriptionDropdownOptionsResponse, type SubscriptionDropdownOptionsResult, SubscriptionField, type SubscriptionFieldProps, SubscriptionKeyValueBlock, type SubscriptionListItem, SubscriptionStatus, type SubscriptionSummary, SubscriptionSummaryField, type SubscriptionSummaryFieldProps, type SubscriptionsResult, SummaryField, type SummaryFieldProps, type TableColumnKeys, type TableConfig, TableSettingsModal, type TableSettingsModalProps, type TaskDefinition, type TaskDefinitionsResult, type TaskListItem, type TasksResponse, TextField, type TextFieldProps, type TimelineItem, TimelinePosition, TimestampField, type TimestampFieldProps, type ToastState, ToastTypes, type TranslationMessagesMap, type TreeBlock, TreeContext, type TreeContextType, TreeProvider, type TreeProviderProps, UnconnectedSelectField, type UserInputForm, UserInputFormWizard, UserInputFormWizardDeprecated, type ValidationError, type ValidationErrorContext, type ValueOverrideConfiguration, type ValueOverrideFunction, VlanField, type VlanFieldProps, WFO_STATUS_COLOR_FIELD, WfoArrowNarrowDown, WfoArrowNarrowUp, WfoArrowsExpand, WfoAuth, WfoBadge, type WfoBadgeProps, WfoBasicTable, type WfoBasicTableColumns, type WfoBasicTableColumnsWithControlColumns, type WfoBasicTableProps, WfoBell, WfoBreadcrumbs, WfoCheckmarkCircleFill, WfoChevronDown, WfoChevronUp, WfoCode, WfoCogFill, WfoContactEnvelopeFill, type WfoControlColumn, WfoCubeSolid, WfoDataGridTable, type WfoDataGridTableColumns, type WfoDataGridTableProps, type WfoDataSearch, type WfoDataSorting, WfoDateTime, type WfoDateTimeProps, WfoDropdownButton, WfoEngineStatusBadge, WfoEngineStatusButton, WfoEnvironmentBadge, WfoError, WfoErrorBoundary, type WfoEuiBasicTableColumn, WfoExpandableField, type WfoExpandableFieldProps, WfoExternalLink, WfoEyeFill, WfoFailedTasksBadge, type WfoFilterTab, WfoFilterTabs, type WfoFilterTabsProps, WfoFirstPartUUID, type WfoFirstUUIDPartProps, WfoFlushSettings, WfoHeaderBadge, type WfoIconProps, WfoInSyncField, WfoInformationModal, type WfoInformationModalProps, WfoInlineJson, type WfoInlineJsonProps, WfoInsyncIcon, WfoIsAllowedToRender, type WfoIsAllowedToRenderProps, WfoJsonCodeBlock, type WfoJsonCodeBlockProps, WfoKeyCell, type WfoKeyCellProps, WfoKeyValueTable, type WfoKeyValueTableDataType, type WfoKeyValueTableProps, WfoLoading, WfoLogoutIcon, WfoMenuItemLink, WfoMetadataPageLayout, WfoMinusCircleFill, WfoMinusCircleOutline, WfoModifySettings, WfoNoResults, WfoPageHeader, type WfoPageHeaderProps, WfoPageTemplate, type WfoPageTemplateProps, WfoPageUnauthorized, WfoPencil, WfoPencilAlt, WfoPlayCircle, WfoPlayFill, WfoPlusCircleFill, type WfoPolicyRenderFallbackProps, WfoPolicyRenderPageFallback, WfoProcessDetailPage, WfoProcessListSubscriptionsCell, WfoProcessRawData, WfoProcessStatusBadge, type WfoProcessStatusBadgeProps, WfoProcessSubscriptionDelta, WfoProcessesList, type WfoProcessesListProps, type WfoProcessesListSubscriptionsCellProps, WfoProcessesTimeline, WfoProductBlockBadge, type WfoProductBlockBadgeProps, WfoProductBlockKeyValueRow, type WfoProductBlockKeyValueRowProps, WfoProductBlocksPage, WfoProductStatusBadge, type WfoProductStatusBadgeProps, WfoProductsPage, WfoRefresh, WfoRelatedSubscriptions, WfoResetTextSearchIndexButton, WfoResourceTypesPage, WfoSearchField, type WfoSearchFieldProps, WfoSearchStrikethrough, type WfoSession, WfoSettingsModal, type WfoSettingsModalProps, WfoSettingsPage, WfoShare, WfoSideMenu, WfoSidebar, type WfoSidebarProps, WfoSortAsc, WfoSortButton, type WfoSortButtonProps, WfoSortButtons, type WfoSortButtonsProps, WfoSortDesc, WfoSortDirectionIcon, type WfoSortDirectionIconProps, WfoStartPage, WfoStartProcessPage, WfoStartTaskButtonComboBox, WfoStartWorkflowButtonComboBox, WfoStatistic, WfoStatus, WfoStatusColorField, type WfoStatusColorFieldProps, WfoStatusDotIcon, WfoStep, WfoStepList, WfoStepListHeader, type WfoStepListHeaderProps, type WfoStepListProps, type WfoStepListRef, type WfoStepProps, WfoStepStatusIcon, type WfoStepStatusIconProps, WfoSubmitModal, type WfoSubmitModalProps, WfoSubscription, WfoSubscriptionActions, type WfoSubscriptionActionsProps, type WfoSubscriptionDetailGeneralConfiguration, WfoSubscriptionDetailPage, WfoSubscriptionDetailTree, WfoSubscriptionGeneral, WfoSubscriptionListTab, WfoSubscriptionProductBlock, WfoSubscriptionStatusBadge, type WfoSubscriptionStatusBadgeProps, WfoSubscriptionsList, WfoSubscriptionsListPage, type WfoSubscriptionsListProps, type WfoTableColumns, type WfoTableColumnsWithExtraNonDataFields, type WfoTableControlColumnConfig, type WfoTableDataColumnConfig, WfoTableHeaderCell, type WfoTableHeaderCellProps, WfoTableWithFilter, type WfoTableWithFilterProps, WfoTasksListPage, WfoTasksListTabType, WfoTasksPage, WfoTextAnchor, WfoTimeline, type WfoTimelineProps, WfoToastsList, type WfoTreeNodeMap, type WfoUserProfile, WfoValueCell, type WfoValueCellProps, WfoViewList, WfoWarningTriangle, WfoWorkflowStepList, type WfoWorkflowStepListProps, WfoWorkflowTargetBadge, type WfoWorkflowTargetBadgeProps, WfoWorkflowsListPage, WfoWorkflowsListTabType, WfoWorkflowsPage, WfoXCircleFill, type WorkflowDefinition, type WorkflowDefinitionsResult, type WorkflowListItem, WorkflowTarget, type WorkflowsResponse, addToastMessage, calculateTimeDifference, camelToHuman, clearTableConfigFromLocalStorage, csvDownloadHandler, defaultOrchestratorTheme, defaultTasksListTabs, defaultWorkflowsListTabs, determineNewSortOrder, determinePageIndex, filterDataByCriteria, flattenArrayProps, formatDate, formatDateCetWithUtc, getApiClient, getConcatenatedPagedResult, getConcatenatedResult, getCsvFileNameWithDate, getCurrentBrowserLocale, getCustomApiSlice, getDataSortHandler, getDate, getFieldFromProductBlockInstanceValues, getFirstUuidPart, getInitialColumnOrder, getLastUncompletedProcess, getLatestTaskDate, getNumberValueFromEnvironmentVariable, getOrchestratorComponentOverrideSlice, getOrchestratorConfigSlice, getOrchestratorStore, getPageChangeHandler, getProductBlockTitle, getProductNamesFromProcess, getQueryStringHandler, getQueryVariablesForExport, getSortDirectionFromString, getStatusBadgeColor, getStepContent, getStyles, getTableConfigFromLocalStorage, getTasksListTabTypeFromString, getTypedFieldFromObject, getWfoBasicTableStyles, getWorkflowTargetColor, getWorkflowTargetIconContent, getWorkflowsListTabTypeFromString, graphQlWorkflowListMapper, handlePromiseErrorWithCallback, imsPortIdFieldStyling, initiateCsvFileDownload, ipPrefixTableFieldStyling, ipamStates, isToday, isUuid4, isValidLocalStorageTableConfig, localMomentToUtcTimestamp, mapColumnSortToEuiDataGridSorting, mapGraphQlSubscriptionsResultToPageInfo, mapGraphQlSubscriptionsResultToSubscriptionListItems, mapSortableAndFilterableValuesToTableColumnConfig, mapWorkflowDefinitionToWorkflowListItem, metaDataTabs, onlyUnique, orchestratorApi, parseDate, parseDateOrTimeRelativeToToday, parseDateRelativeToToday, parseDateToLocaleDateString, parseDateToLocaleDateTimeString, parseDateToLocaleTimeString, parseIsoString, prepareHeaders, processListQuery, processListSummaryQuery, processStepsQuery, productBlocksQuery, products, productsSummary, removeSuffix, removeToastMessage, renderEmptyElementWhenNotAllowedByPolicy, resourceTypesQuery, selectOrchestratorConfig, setTableConfigToLocalStorage, snakeToHuman, snakeToKebab, splitPrefixStyling, stop, subscriptionDetailQuery, subscriptionListTabs, subscriptionsDropdownOptionsQuery, tasksQuery, toOptionalArrayEntry, toastMessagesReducer, toastMessagesSlice, upperCaseFirstChar, urlPolicyMap, useCacheNames, useCheckEngineStatus, useClearCacheMutation, useDataDisplayParams, useFilterQueryWithRest, useGetCustomerQuery, useGetCustomersQuery, useGetEngineStatusQuery, useGetOrchestratorConfig, useGetProcessListQuery, useGetProcessListSummaryQuery, useGetProductBlocksQuery, useGetProductsQuery, useGetProductsSummaryQuery, useGetRelatedSubscriptionsQuery, useGetResourceTypesQuery, useGetSubscriptionDetailQuery, useGetSubscriptionsDropdownOptionsQuery, useGetTaskOptionsQuery, useGetTasksQuery, useGetTimeLineItemsQuery, useGetTranslationMessages, useGetWorkflowOptionsQuery, useGetWorkflowsQuery, useLazyGetProcessListQuery, useLazyGetProductBlocksQuery, useLazyGetProductsQuery, useLazyGetResourceTypesQuery, useLazyGetTasksQuery, useLazyGetWorkflowsQuery, useMutateProcess, useOrchestratorConfig, useOrchestratorTheme, usePolicy, useProcessStatusCountsQuery, useQueryWithFetch, useRawProcessDetails, useResetTextSearchIndexMutation, useSetEngineStatusMutation, useSetSubscriptionInSyncMutation, useShowToastMessage, useStoredTableConfig, useStreamMessagesQuery, useSubscriptionActions, useSubscriptionDetailValueOverride, useWfoSession, useWithOrchestratorTheme, utcTimestampToLocalMoment, workflowFieldMapper, workflowsQuery };
3688
+ export { ACTIVE_PROCESSES_LIST_TABLE_LOCAL_STORAGE_KEY, ACTIVE_TASKS_LIST_TABLE_LOCAL_STORAGE_KEY, AcceptField, type AcceptFieldProps, ApiClient, ApiClientContext, ApiClientContextProvider, type ApiClientContextProviderProps, type ApiContext, type AppDispatch, type AutoFieldsProps, BadgeType, BaseApiClient, type BaseGraphQlResult, BaseQueryTypes, BoolField, type BoolFieldProps, COMPLETED_PROCESSES_LIST_TABLE_LOCAL_STORAGE_KEY, COMPLETED_TASKS_LIST_TABLE_LOCAL_STORAGE_KEY, type CacheNames, type CacheOption, CacheTags, ColorModes, type ColumnConfig, type ConfirmDialogActions, ConfirmationDialogContext, ConfirmationDialogContextWrapper, ConfirmationDialogProvider, ConnectedSelectField, ContactPersonAutocomplete, ContactPersonNameField, type ContactPersonNameFieldProps, CreateForm, type CustomApiConfig, type Customer, type CustomerDescriptions, CustomerField, type CustomerFieldProps, type CustomersResult, DEFAULT_PAGE_SIZE, DEFAULT_PAGE_SIZES, type DataDisplayParams, type DataDisplayReturnValues, DateField, type DateFieldProps, DividerField, type DividerFieldProps, type EmailAddress, type EmailState, EngineStatus, Environment, ErrorField, type ErrorFieldProps, ErrorsField, type ErrorsFieldProps, type ExternalService, type FetchFilter, type FieldProps$1 as FieldProps, type FieldValue, type FilterQuery, type FixedInputDefinition, type Form, type FormNotCompleteResponse, type GraphQLPageInfo, type GraphQLSort, type GraphQlResultPage, type GraphQlSinglePage, type GraphqlFilter, type GraphqlQueryVariables, type GroupedStep, HIDDEN_KEYS, type HeaderBadgeProps, HttpStatus, type IPvAnyNetworkFieldProps, type ImsNode, ImsNodeIdField, type ImsNodeIdFieldProps, type ImsPort, type ImsPortFieldProps, ImsPortIdField, type InUseByRelation, type InitialOrchestratorStoreConfig, type InputForm, type IpBlock, IpNetworkField, type IpPrefix, LabelField, type LabelFieldProps, ListAddField, type ListAddFieldProps, ListDelField, type ListDelFieldProps, ListField, type ListFieldProps, ListSelectField, type ListSelectFieldProps, Locale, LocationCodeField, type LocationCodeFieldProps, LongTextField, type LongTextFieldProps, MAXIMUM_ITEMS_FOR_BULK_FETCHING, METADATA_PRODUCT_BLOCKS_TABLE_LOCAL_STORAGE_KEY, METADATA_PRODUCT_TABLE_LOCAL_STORAGE_KEY, METADATA_RESOURCE_TYPES_TABLE_LOCAL_STORAGE_KEY, METADATA_TASKS_TABLE_LOCAL_STORAGE_KEY, METADATA_WORKFLOWS_TABLE_LOCAL_STORAGE_KEY, type MetaDataTab, NUMBER_OF_ITEMS_REPRESENTING_ALL_ITEMS, NestField, type NestFieldProps, type NodeSubscription, type Nullable, NumField, type NumFieldProps, OptGroupField, type OptGroupFieldProps, type OrchestratorComponentOverride, type OrchestratorConfig, OrchestratorConfigContext, OrchestratorConfigProvider, type OrchestratorConfigProviderProps, PATH_METADATA, PATH_METADATA_PRODUCTS, PATH_METADATA_PRODUCT_BLOCKS, PATH_METADATA_RESOURCE_TYPES, PATH_METADATA_TASKS, PATH_METADATA_WORKFLOWS, PATH_SETTINGS, PATH_START, PATH_START_NEW_TASK, PATH_START_NEW_WORKFLOW, PATH_SUBSCRIPTIONS, PATH_TASKS, PATH_WORKFLOWS, type Pagination, type Policy, PolicyContext, PolicyContextProvider, type PolicyProviderProps, PolicyResource, PortMode, type Process, type ProcessDetail, type ProcessDetailResultRaw, ProcessDoneStatuses, type ProcessListExportItem, type ProcessListItem, type ProcessListResponse, type ProcessListResult, type ProcessListSummaryResponse, ProcessStatus, type ProcessStatusCounts, type ProcessStepsResult, type ProcessSummary, type ProcessesDetailResult, type ProductBlockDefinition, type ProductBlockDefinitionsResult, type ProductBlockInstance, type ProductBlocksResponse, type ProductDefinition, type ProductDefinitionsResult, ProductField, type ProductFieldProps, ProductLifecycleStatus, ProductTag, type ProductsResponse, type ProductsSummary, type ProductsSummaryResponse, RENDER_ALL, RESOURCE_TYPE_FIELD_DESCRIPTION, RESOURCE_TYPE_FIELD_ID, RESOURCE_TYPE_FIELD_PRODUCT_BLOCKS, RESOURCE_TYPE_FIELD_TYPE, RadioField, type RadioFieldProps, type RelatedSubscription, RelatedSubscriptionsQuery, type RelatedSubscriptionsResponse, type RelatedSubscriptionsResult, RenderDirection, type ResourceTypeDefinition, type ResourceTypeDefinitionsResult, type ResourceTypesResponse, type RootState, STEP_STATE_HIDDEN_KEYS, SUBSCRIPTIONS_TABLE_LOCAL_STORAGE_KEY, type SelectFieldProps, type ServicePort, type ShowConfirmDialog, type ShowConfirmDialogType, type SortOption, SortOrder, type StartComboBoxOption, type StartOptionsResponse, type StartOptionsResult, type StartProcessStep, type Step, type StepListItem, type StepState, StepStatus, StoreProvider, type StoreProviderProps, type StoredTableConfig, SubmitField, type SubmitFieldProps, type Subscription, type SubscriptionAction, type SubscriptionDetail, type SubscriptionDetailProcess, type SubscriptionDetailResponse, type SubscriptionDetailResult, SubscriptionDetailTab, type SubscriptionDropdownOption, type SubscriptionDropdownOptionsResponse, type SubscriptionDropdownOptionsResult, SubscriptionField, type SubscriptionFieldProps, SubscriptionKeyValueBlock, type SubscriptionListItem, SubscriptionStatus, type SubscriptionSummary, SubscriptionSummaryField, type SubscriptionSummaryFieldProps, type SubscriptionsResult, SummaryField, type SummaryFieldProps, type TableColumnKeys, type TableConfig, TableSettingsModal, type TableSettingsModalProps, type TaskDefinition, type TaskDefinitionsResult, type TaskListItem, type TasksResponse, TextField, type TextFieldProps, type TimelineItem, TimelinePosition, TimestampField, type TimestampFieldProps, type ToastState, ToastTypes, type TranslationMessagesMap, type TreeBlock, TreeContext, type TreeContextType, TreeProvider, type TreeProviderProps, UnconnectedSelectField, type UserInputForm, UserInputFormWizard, UserInputFormWizardDeprecated, type ValidationError, type ValidationErrorContext, type ValueOverrideConfiguration, type ValueOverrideFunction, VlanField, type VlanFieldProps, WFO_STATUS_COLOR_FIELD, WfoArrowNarrowDown, WfoArrowNarrowUp, WfoArrowsExpand, WfoAuth, WfoBadge, type WfoBadgeProps, WfoBasicTable, type WfoBasicTableColumns, type WfoBasicTableColumnsWithControlColumns, type WfoBasicTableProps, WfoBell, WfoBreadcrumbs, WfoCheckmarkCircleFill, WfoChevronDown, WfoChevronUp, WfoCode, WfoCogFill, WfoContactEnvelopeFill, type WfoControlColumn, WfoCubeSolid, WfoDataGridTable, type WfoDataGridTableColumns, type WfoDataGridTableProps, type WfoDataSearch, type WfoDataSorting, WfoDateTime, type WfoDateTimeProps, WfoDropdownButton, WfoEngineStatusBadge, WfoEngineStatusButton, WfoEnvironmentBadge, WfoError, WfoErrorBoundary, type WfoEuiBasicTableColumn, WfoExpandableField, type WfoExpandableFieldProps, WfoExternalLink, WfoEyeFill, WfoFailedTasksBadge, type WfoFilterTab, WfoFilterTabs, type WfoFilterTabsProps, WfoFirstPartUUID, type WfoFirstUUIDPartProps, WfoFlushSettings, WfoHeaderBadge, type WfoIconProps, WfoInSyncField, WfoInformationModal, type WfoInformationModalProps, WfoInlineJson, type WfoInlineJsonProps, WfoInsyncIcon, WfoIsAllowedToRender, type WfoIsAllowedToRenderProps, WfoJsonCodeBlock, type WfoJsonCodeBlockProps, WfoKeyCell, type WfoKeyCellProps, WfoKeyValueTable, type WfoKeyValueTableDataType, type WfoKeyValueTableProps, WfoLoading, WfoLogoutIcon, WfoMenuItemLink, WfoMetadataPageLayout, WfoMinusCircleFill, WfoMinusCircleOutline, WfoModifySettings, WfoNoResults, WfoPageHeader, type WfoPageHeaderProps, WfoPageTemplate, type WfoPageTemplateProps, WfoPageUnauthorized, WfoPencil, WfoPencilAlt, WfoPlayCircle, WfoPlayFill, WfoPlusCircleFill, type WfoPolicyRenderFallbackProps, WfoPolicyRenderPageFallback, WfoProcessDetailPage, WfoProcessListSubscriptionsCell, WfoProcessRawData, WfoProcessStatusBadge, type WfoProcessStatusBadgeProps, WfoProcessSubscriptionDelta, WfoProcessesList, type WfoProcessesListProps, type WfoProcessesListSubscriptionsCellProps, WfoProcessesTimeline, WfoProductBlockBadge, type WfoProductBlockBadgeProps, WfoProductBlockKeyValueRow, type WfoProductBlockKeyValueRowProps, WfoProductBlocksPage, WfoProductStatusBadge, type WfoProductStatusBadgeProps, WfoProductsPage, WfoRefresh, WfoRelatedSubscriptions, WfoResetTextSearchIndexButton, WfoResourceTypesPage, WfoSearchField, type WfoSearchFieldProps, WfoSearchStrikethrough, type WfoSession, WfoSettingsModal, type WfoSettingsModalProps, WfoSettingsPage, WfoShare, WfoSideMenu, WfoSidebar, type WfoSidebarProps, WfoSortAsc, WfoSortButton, type WfoSortButtonProps, WfoSortButtons, type WfoSortButtonsProps, WfoSortDesc, WfoSortDirectionIcon, type WfoSortDirectionIconProps, WfoStartPage, WfoStartProcessPage, WfoStartTaskButtonComboBox, WfoStartWorkflowButtonComboBox, WfoStatistic, WfoStatus, WfoStatusColorField, type WfoStatusColorFieldProps, WfoStatusDotIcon, WfoStep, WfoStepList, WfoStepListHeader, type WfoStepListHeaderProps, type WfoStepListProps, type WfoStepListRef, type WfoStepProps, WfoStepStatusIcon, type WfoStepStatusIconProps, WfoSubmitModal, type WfoSubmitModalProps, WfoSubscription, WfoSubscriptionActions, type WfoSubscriptionActionsProps, type WfoSubscriptionDetailGeneralConfiguration, WfoSubscriptionDetailPage, WfoSubscriptionDetailTree, WfoSubscriptionGeneral, WfoSubscriptionListTab, WfoSubscriptionProductBlock, WfoSubscriptionStatusBadge, type WfoSubscriptionStatusBadgeProps, WfoSubscriptionsList, WfoSubscriptionsListPage, type WfoSubscriptionsListProps, type WfoTableColumns, type WfoTableColumnsWithExtraNonDataFields, type WfoTableControlColumnConfig, type WfoTableDataColumnConfig, WfoTableHeaderCell, type WfoTableHeaderCellProps, WfoTableWithFilter, type WfoTableWithFilterProps, WfoTasksListPage, WfoTasksListTabType, WfoTasksPage, WfoTextAnchor, WfoTimeline, type WfoTimelineProps, WfoToastsList, type WfoTreeNodeMap, type WfoUserProfile, WfoValueCell, type WfoValueCellProps, WfoViewList, WfoWarningTriangle, WfoWorkflowStepList, type WfoWorkflowStepListProps, WfoWorkflowTargetBadge, type WfoWorkflowTargetBadgeProps, WfoWorkflowsListPage, WfoWorkflowsListTabType, WfoWorkflowsPage, WfoXCircleFill, type WorkflowDefinition, type WorkflowDefinitionsResult, type WorkflowListItem, WorkflowTarget, type WorkflowsResponse, addToastMessage, calculateTimeDifference, camelToHuman, clearTableConfigFromLocalStorage, csvDownloadHandler, defaultOrchestratorTheme, defaultTasksListTabs, defaultWorkflowsListTabs, determineNewSortOrder, determinePageIndex, filterDataByCriteria, flattenArrayProps, formatDate, formatDateCetWithUtc, getApiClient, getConcatenatedPagedResult, getConcatenatedResult, getCsvFileNameWithDate, getCurrentBrowserLocale, getCustomApiSlice, getDataSortHandler, getDate, getFieldFromProductBlockInstanceValues, getFirstUuidPart, getInitialColumnOrder, getLastUncompletedProcess, getLatestTaskDate, getNumberValueFromEnvironmentVariable, getOrchestratorComponentOverrideSlice, getOrchestratorConfigSlice, getOrchestratorStore, getPageChangeHandler, getProductBlockTitle, getProductNamesFromProcess, getQueryStringHandler, getQueryVariablesForExport, getSortDirectionFromString, getStatusBadgeColor, getStepContent, getStyles, getTableConfigFromLocalStorage, getTasksListTabTypeFromString, getTypedFieldFromObject, getWfoBasicTableStyles, getWorkflowTargetColor, getWorkflowTargetIconContent, getWorkflowsListTabTypeFromString, graphQlWorkflowListMapper, handlePromiseErrorWithCallback, imsPortIdFieldStyling, initiateCsvFileDownload, ipPrefixTableFieldStyling, ipamStates, isToday, isUuid4, isValidLocalStorageTableConfig, localMomentToUtcTimestamp, mapColumnSortToEuiDataGridSorting, mapGraphQlSubscriptionsResultToPageInfo, mapGraphQlSubscriptionsResultToSubscriptionListItems, mapSortableAndFilterableValuesToTableColumnConfig, mapWorkflowDefinitionToWorkflowListItem, metaDataTabs, onlyUnique, optionalArrayMapper, orchestratorApi, parseDate, parseDateOrTimeRelativeToToday, parseDateRelativeToToday, parseDateToLocaleDateString, parseDateToLocaleDateTimeString, parseDateToLocaleTimeString, parseIsoString, prepareHeaders, processListQuery, processListSummaryQuery, processStepsQuery, productBlocksQuery, products, productsSummary, removeSuffix, removeToastMessage, renderEmptyElementWhenNotAllowedByPolicy, resourceTypesQuery, selectOrchestratorConfig, setTableConfigToLocalStorage, snakeToHuman, snakeToKebab, splitPrefixStyling, stop, subscriptionDetailQuery, subscriptionListTabs, subscriptionsDropdownOptionsQuery, tasksQuery, toOptionalArrayEntry, toastMessagesReducer, toastMessagesSlice, upperCaseFirstChar, urlPolicyMap, useCacheNames, useCheckEngineStatus, useClearCacheMutation, useDataDisplayParams, useFilterQueryWithRest, useGetCustomerQuery, useGetCustomersQuery, useGetEngineStatusQuery, useGetOrchestratorConfig, useGetProcessListQuery, useGetProcessListSummaryQuery, useGetProductBlocksQuery, useGetProductsQuery, useGetProductsSummaryQuery, useGetRelatedSubscriptionsQuery, useGetResourceTypesQuery, useGetSubscriptionDetailQuery, useGetSubscriptionsDropdownOptionsQuery, useGetTaskOptionsQuery, useGetTasksQuery, useGetTimeLineItemsQuery, useGetTranslationMessages, useGetWorkflowOptionsQuery, useGetWorkflowsQuery, useLazyGetProcessListQuery, useLazyGetProductBlocksQuery, useLazyGetProductsQuery, useLazyGetResourceTypesQuery, useLazyGetTasksQuery, useLazyGetWorkflowsQuery, useMutateProcess, useOrchestratorConfig, useOrchestratorTheme, usePolicy, useProcessStatusCountsQuery, useQueryWithFetch, useRawProcessDetails, useResetTextSearchIndexMutation, useSetEngineStatusMutation, useSetSubscriptionInSyncMutation, useShowToastMessage, useStoredTableConfig, useStreamMessagesQuery, useSubscriptionActions, useSubscriptionDetailValueOverride, useWfoSession, useWithOrchestratorTheme, utcTimestampToLocalMoment, workflowFieldMapper, workflowsQuery };
package/dist/index.js CHANGED
@@ -44317,8 +44317,9 @@ var snakeToKebab = (value) => {
44317
44317
  return value.replace(/_/g, "-");
44318
44318
  };
44319
44319
 
44320
- // src/utils/toOptionalArrayEntry.ts
44320
+ // src/utils/optionalArray.ts
44321
44321
  var toOptionalArrayEntry = (data, condition) => condition ? [data] : [];
44322
+ var optionalArrayMapper = (data = [], mapper) => data.map(mapper);
44322
44323
 
44323
44324
  // src/components/WfoPageTemplate/WfoBreadcrumbs/WfoBreadcrumbs.tsx
44324
44325
  import { Fragment as Fragment3, jsx as jsx51, jsxs as jsxs36 } from "@emotion/react/jsx-runtime";
@@ -55621,12 +55622,121 @@ var subscriptionListSummaryApi = orchestratorApi.injectEndpoints({
55621
55622
  });
55622
55623
  var { useGetSubscriptionSummaryListQuery } = subscriptionListSummaryApi;
55623
55624
 
55625
+ // src/pages/startPage/mappers.ts
55626
+ var mapProcessSummaryToSummaryCardListItem = (processSummary) => ({
55627
+ title: processSummary.workflowName,
55628
+ value: formatDate(processSummary == null ? void 0 : processSummary.startedAt),
55629
+ url: `${PATH_WORKFLOWS}/${processSummary.processId}`
55630
+ });
55631
+ var mapSubscriptionSummaryToSummaryCardListItem = (subscription) => ({
55632
+ title: subscription.description,
55633
+ value: formatDate(subscription.startDate),
55634
+ url: `${PATH_SUBSCRIPTIONS}/${subscription.subscriptionId}`
55635
+ });
55636
+
55637
+ // src/pages/startPage/queryVariables.ts
55638
+ var baseQueryVariables = {
55639
+ first: 5,
55640
+ after: 0
55641
+ };
55642
+ var baseQueryVariablesForSubscription = __spreadProps(__spreadValues({}, baseQueryVariables), {
55643
+ sortBy: {
55644
+ field: "startDate",
55645
+ order: "DESC" /* DESC */
55646
+ }
55647
+ });
55648
+ var baseQueryVariablesForProcess = __spreadProps(__spreadValues({}, baseQueryVariables), {
55649
+ sortBy: {
55650
+ field: "startedAt",
55651
+ order: "DESC" /* DESC */
55652
+ }
55653
+ });
55654
+ var getTaskFilter = (isTask) => {
55655
+ return {
55656
+ // Todo: isTask is not a key of Process
55657
+ // However, backend still supports it. Field should not be a keyof ProcessListItem (or process)
55658
+ // https://github.com/workfloworchestrator/orchestrator-ui/issues/290
55659
+ // eslint-disable-next-line @typescript-eslint/ban-ts-comment
55660
+ // @ts-ignore waiting for fix in backend
55661
+ field: "isTask",
55662
+ value: isTask ? "true" : "false"
55663
+ };
55664
+ };
55665
+ var subscriptionsListSummaryQueryVariables = __spreadProps(__spreadValues({}, baseQueryVariablesForSubscription), {
55666
+ filterBy: [
55667
+ {
55668
+ field: "status",
55669
+ value: "Active"
55670
+ }
55671
+ ]
55672
+ });
55673
+ var outOfSyncSubscriptionsListSummaryQueryVariables = __spreadProps(__spreadValues({}, baseQueryVariablesForSubscription), {
55674
+ query: "insync:false",
55675
+ filterBy: [
55676
+ {
55677
+ field: "status",
55678
+ value: "Active-Provisioning"
55679
+ }
55680
+ ]
55681
+ });
55682
+ var getMyWorkflowListSummaryQueryVariables = (username) => __spreadProps(__spreadValues({}, baseQueryVariablesForProcess), {
55683
+ filterBy: [
55684
+ getTaskFilter(false),
55685
+ {
55686
+ field: "createdBy",
55687
+ value: username
55688
+ }
55689
+ ]
55690
+ });
55691
+ var activeWorkflowsListSummaryQueryVariables = __spreadProps(__spreadValues({}, baseQueryVariablesForProcess), {
55692
+ filterBy: [
55693
+ getTaskFilter(false),
55694
+ {
55695
+ field: "lastStatus",
55696
+ value: "created-running-suspended-waiting-failed-resumed-inconsistent_data-api_unavailable-awaiting_callback"
55697
+ }
55698
+ ]
55699
+ });
55700
+ var taskListSummaryQueryVariables = __spreadProps(__spreadValues({}, baseQueryVariablesForProcess), {
55701
+ filterBy: [
55702
+ getTaskFilter(true),
55703
+ {
55704
+ field: "lastStatus",
55705
+ value: "failed-inconsistent_data-api_unavailable"
55706
+ }
55707
+ ]
55708
+ });
55709
+ var productsSummaryQueryVariables = {
55710
+ first: 1e3,
55711
+ after: 0,
55712
+ sortBy: {
55713
+ field: "name",
55714
+ order: "ASC" /* ASC */
55715
+ }
55716
+ };
55717
+
55718
+ // src/pages/startPage/useStartPageSummaryCardConfigurationOverride.ts
55719
+ var useStartPageSummaryCardConfigurationOverride = () => {
55720
+ const overrideSummaryCards = useAppSelector(
55721
+ (state) => {
55722
+ var _a, _b;
55723
+ return (_b = (_a = state.orchestratorComponentOverride) == null ? void 0 : _a.startPage) == null ? void 0 : _b.summaryCardConfigurationOverride;
55724
+ }
55725
+ );
55726
+ return {
55727
+ overrideSummaryCards
55728
+ };
55729
+ };
55730
+
55624
55731
  // src/pages/startPage/WfoStartPage.tsx
55625
55732
  import { jsx as jsx175, jsxs as jsxs99 } from "@emotion/react/jsx-runtime";
55626
55733
  var WfoStartPage = () => {
55627
- var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k;
55734
+ var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j;
55628
55735
  const t = useTranslations54("startPage");
55736
+ const { overrideSummaryCards } = useStartPageSummaryCardConfigurationOverride();
55629
55737
  const { isAllowed } = usePolicy();
55738
+ const { session } = useWfoSession();
55739
+ const username = (_b = (_a = session == null ? void 0 : session.user) == null ? void 0 : _a.name) != null ? _b : "";
55630
55740
  const {
55631
55741
  data: subscriptionsSummaryResult,
55632
55742
  isLoading: subscriptionsSummaryIsFetching
@@ -55640,9 +55750,15 @@ var WfoStartPage = () => {
55640
55750
  outOfSyncSubscriptionsListSummaryQueryVariables
55641
55751
  );
55642
55752
  const {
55643
- data: processesSummaryResponse,
55644
- isFetching: processesSummaryIsFetching
55645
- } = useGetProcessListSummaryQuery(processListSummaryQueryVariables);
55753
+ data: activeWorkflowsSummaryResponse,
55754
+ isFetching: activeWorkflowsSummaryIsFetching
55755
+ } = useGetProcessListSummaryQuery(activeWorkflowsListSummaryQueryVariables);
55756
+ const {
55757
+ data: myWorkflowsSummaryResponse,
55758
+ isFetching: myWorkflowsSummaryIsFetching
55759
+ } = useGetProcessListSummaryQuery(
55760
+ getMyWorkflowListSummaryQueryVariables(username)
55761
+ );
55646
55762
  const {
55647
55763
  data: failedTasksSummaryResponse,
55648
55764
  isFetching: failedTasksSummaryIsFetching
@@ -55653,14 +55769,13 @@ var WfoStartPage = () => {
55653
55769
  } = useGetProductsSummaryQuery(productsSummaryQueryVariables);
55654
55770
  const latestActiveSubscriptionsSummaryCard = {
55655
55771
  headerTitle: t("activeSubscriptions.headerTitle"),
55656
- headerValue: (_a = subscriptionsSummaryResult == null ? void 0 : subscriptionsSummaryResult.pageInfo.totalItems) != null ? _a : 0,
55772
+ headerValue: (_c = subscriptionsSummaryResult == null ? void 0 : subscriptionsSummaryResult.pageInfo.totalItems) != null ? _c : 0,
55657
55773
  headerStatus: "Neutral" /* Neutral */,
55658
55774
  listTitle: t("activeSubscriptions.listTitle"),
55659
- listItems: (_b = subscriptionsSummaryResult == null ? void 0 : subscriptionsSummaryResult.subscriptions.map((subscription) => ({
55660
- title: subscription.description,
55661
- value: formatDate(subscription.startDate),
55662
- url: `${PATH_SUBSCRIPTIONS}/${subscription.subscriptionId}`
55663
- }))) != null ? _b : [],
55775
+ listItems: optionalArrayMapper(
55776
+ subscriptionsSummaryResult == null ? void 0 : subscriptionsSummaryResult.subscriptions,
55777
+ mapSubscriptionSummaryToSummaryCardListItem
55778
+ ),
55664
55779
  button: {
55665
55780
  name: t("activeSubscriptions.buttonText"),
55666
55781
  url: PATH_SUBSCRIPTIONS
@@ -55669,48 +55784,58 @@ var WfoStartPage = () => {
55669
55784
  };
55670
55785
  const latestOutOfSyncSubscriptionsSummaryCard = {
55671
55786
  headerTitle: t("outOfSyncSubscriptions.headerTitle"),
55672
- headerValue: (_c = outOfSyncSubscriptionsSummaryResult == null ? void 0 : outOfSyncSubscriptionsSummaryResult.pageInfo.totalItems) != null ? _c : 0,
55787
+ headerValue: (_d = outOfSyncSubscriptionsSummaryResult == null ? void 0 : outOfSyncSubscriptionsSummaryResult.pageInfo.totalItems) != null ? _d : 0,
55673
55788
  headerStatus: "Error" /* Error */,
55674
55789
  listTitle: t("outOfSyncSubscriptions.listTitle"),
55675
- listItems: (_d = outOfSyncSubscriptionsSummaryResult == null ? void 0 : outOfSyncSubscriptionsSummaryResult.subscriptions.map(
55676
- (subscription) => ({
55677
- title: subscription.description,
55678
- value: formatDate(subscription.startDate),
55679
- url: `${PATH_SUBSCRIPTIONS}/${subscription.subscriptionId}`
55680
- })
55681
- )) != null ? _d : [],
55790
+ listItems: optionalArrayMapper(
55791
+ outOfSyncSubscriptionsSummaryResult == null ? void 0 : outOfSyncSubscriptionsSummaryResult.subscriptions,
55792
+ mapSubscriptionSummaryToSummaryCardListItem
55793
+ ),
55682
55794
  button: {
55683
55795
  name: t("outOfSyncSubscriptions.buttonText"),
55684
55796
  url: `${PATH_SUBSCRIPTIONS}?activeTab=ALL&sortBy=field-startDate_order-ASC&queryString=status%3A%28provisioning%7Cactive%29+insync%3Afalse`
55685
55797
  },
55686
55798
  isLoading: outOfSyncsubscriptionsSummaryIsFetching
55687
55799
  };
55688
- const latestWorkflowsSummaryCard = {
55800
+ const activeWorkflowsSummaryCard = {
55689
55801
  headerTitle: t("activeWorkflows.headerTitle"),
55690
- headerValue: (_e = processesSummaryResponse == null ? void 0 : processesSummaryResponse.pageInfo.totalItems) != null ? _e : 0,
55802
+ headerValue: (_e = activeWorkflowsSummaryResponse == null ? void 0 : activeWorkflowsSummaryResponse.pageInfo.totalItems) != null ? _e : 0,
55691
55803
  headerStatus: "Success" /* Success */,
55692
55804
  listTitle: t("activeWorkflows.listTitle"),
55693
- listItems: (_f = processesSummaryResponse == null ? void 0 : processesSummaryResponse.processes.map((workflow) => ({
55694
- title: workflow.workflowName,
55695
- value: formatDate(workflow == null ? void 0 : workflow.startedAt),
55696
- url: `${PATH_WORKFLOWS}/${workflow.processId}`
55697
- }))) != null ? _f : [],
55805
+ listItems: optionalArrayMapper(
55806
+ activeWorkflowsSummaryResponse == null ? void 0 : activeWorkflowsSummaryResponse.processes,
55807
+ mapProcessSummaryToSummaryCardListItem
55808
+ ),
55698
55809
  button: {
55699
55810
  name: t("activeWorkflows.buttonText"),
55700
55811
  url: PATH_WORKFLOWS
55701
55812
  },
55702
- isLoading: processesSummaryIsFetching
55813
+ isLoading: activeWorkflowsSummaryIsFetching
55814
+ };
55815
+ const myWorkflowsSummaryCard = {
55816
+ headerTitle: t("myWorkflows.headerTitle"),
55817
+ headerValue: (_f = myWorkflowsSummaryResponse == null ? void 0 : myWorkflowsSummaryResponse.pageInfo.totalItems) != null ? _f : 0,
55818
+ headerStatus: "Success" /* Success */,
55819
+ listTitle: t("myWorkflows.listTitle"),
55820
+ listItems: optionalArrayMapper(
55821
+ myWorkflowsSummaryResponse == null ? void 0 : myWorkflowsSummaryResponse.processes,
55822
+ mapProcessSummaryToSummaryCardListItem
55823
+ ),
55824
+ button: username ? {
55825
+ name: t("myWorkflows.buttonText"),
55826
+ url: `${PATH_WORKFLOWS}?activeTab=COMPLETED&sortBy=field-lastModifiedAt_order-DESC&queryString=createdBy%3A${username}`
55827
+ } : void 0,
55828
+ isLoading: myWorkflowsSummaryIsFetching
55703
55829
  };
55704
55830
  const failedTasksSummaryCard = {
55705
55831
  headerTitle: t("failedTasks.headerTitle"),
55706
55832
  headerValue: (_g = failedTasksSummaryResponse == null ? void 0 : failedTasksSummaryResponse.pageInfo.totalItems) != null ? _g : 0,
55707
55833
  headerStatus: "Error" /* Error */,
55708
55834
  listTitle: t("failedTasks.listTitle"),
55709
- listItems: (_h = failedTasksSummaryResponse == null ? void 0 : failedTasksSummaryResponse.processes.map((task) => ({
55710
- title: task.workflowName,
55711
- value: formatDate(task == null ? void 0 : task.startedAt),
55712
- url: `${PATH_TASKS}/${task.processId}`
55713
- }))) != null ? _h : [],
55835
+ listItems: optionalArrayMapper(
55836
+ failedTasksSummaryResponse == null ? void 0 : failedTasksSummaryResponse.processes,
55837
+ mapProcessSummaryToSummaryCardListItem
55838
+ ),
55714
55839
  button: {
55715
55840
  name: t("failedTasks.buttonText"),
55716
55841
  url: PATH_TASKS
@@ -55719,10 +55844,10 @@ var WfoStartPage = () => {
55719
55844
  };
55720
55845
  const productsSummaryCard = {
55721
55846
  headerTitle: t("products.headerTitle"),
55722
- headerValue: (_i = productsSummaryResult == null ? void 0 : productsSummaryResult.pageInfo.totalItems) != null ? _i : 0,
55847
+ headerValue: (_h = productsSummaryResult == null ? void 0 : productsSummaryResult.pageInfo.totalItems) != null ? _h : 0,
55723
55848
  headerStatus: "Neutral" /* Neutral */,
55724
55849
  listTitle: t("products.listTitle"),
55725
- listItems: (_k = [...(_j = productsSummaryResult == null ? void 0 : productsSummaryResult.products) != null ? _j : []].sort(
55850
+ listItems: (_j = [...(_i = productsSummaryResult == null ? void 0 : productsSummaryResult.products) != null ? _i : []].sort(
55726
55851
  (left, right) => {
55727
55852
  var _a2, _b2;
55728
55853
  return ((_a2 = right.subscriptions.pageInfo.totalItems) != null ? _a2 : 0) - ((_b2 = left.subscriptions.pageInfo.totalItems) != null ? _b2 : 0);
@@ -55742,103 +55867,22 @@ var WfoStartPage = () => {
55742
55867
  ]
55743
55868
  }
55744
55869
  )
55745
- }))) != null ? _k : [],
55870
+ }))) != null ? _j : [],
55746
55871
  isLoading: productsSummaryIsFetching
55747
55872
  };
55748
- function getFailedTasksSummarycard() {
55749
- return isAllowed("/orchestrator/tasks/" /* NAVIGATION_TASKS */) ? [failedTasksSummaryCard] : [];
55750
- }
55751
55873
  const allowedSummaryCards = [
55752
- latestWorkflowsSummaryCard,
55753
- ...getFailedTasksSummarycard(),
55874
+ ...toOptionalArrayEntry(myWorkflowsSummaryCard, !!username),
55875
+ activeWorkflowsSummaryCard,
55876
+ ...toOptionalArrayEntry(
55877
+ failedTasksSummaryCard,
55878
+ isAllowed("/orchestrator/tasks/" /* NAVIGATION_TASKS */)
55879
+ ),
55754
55880
  latestOutOfSyncSubscriptionsSummaryCard,
55755
55881
  latestActiveSubscriptionsSummaryCard,
55756
55882
  productsSummaryCard
55757
55883
  ];
55758
- return /* @__PURE__ */ jsx175(EuiFlexItem33, { children: /* @__PURE__ */ jsx175(WfoSummaryCards, { summaryCards: allowedSummaryCards }) });
55759
- };
55760
- var subscriptionsListSummaryQueryVariables = {
55761
- first: 5,
55762
- after: 0,
55763
- sortBy: {
55764
- field: "startDate",
55765
- order: "DESC" /* DESC */
55766
- },
55767
- filterBy: [
55768
- {
55769
- field: "status",
55770
- value: "Active"
55771
- }
55772
- ]
55773
- };
55774
- var outOfSyncSubscriptionsListSummaryQueryVariables = {
55775
- first: 5,
55776
- after: 0,
55777
- sortBy: {
55778
- field: "startDate",
55779
- order: "ASC" /* ASC */
55780
- },
55781
- query: "insync:false",
55782
- filterBy: [
55783
- {
55784
- field: "status",
55785
- value: "Active-Provisioning"
55786
- }
55787
- ]
55788
- };
55789
- var processListSummaryQueryVariables = {
55790
- first: 5,
55791
- after: 0,
55792
- sortBy: {
55793
- field: "startedAt",
55794
- order: "DESC" /* DESC */
55795
- },
55796
- filterBy: [
55797
- {
55798
- // Todo: isTask is not a key of Process
55799
- // However, backend still supports it. Field should not be a keyof ProcessListItem (or process)
55800
- // https://github.com/workfloworchestrator/orchestrator-ui/issues/290
55801
- // eslint-disable-next-line @typescript-eslint/ban-ts-comment
55802
- // @ts-ignore waiting for fix in backend
55803
- field: "isTask",
55804
- value: "false"
55805
- },
55806
- {
55807
- field: "lastStatus",
55808
- value: "created-running-suspended-waiting-failed-resumed-inconsistent_data-api_unavailable-awaiting_callback"
55809
- }
55810
- ]
55811
- };
55812
- var taskListSummaryQueryVariables = {
55813
- first: 5,
55814
- after: 0,
55815
- sortBy: {
55816
- field: "startedAt",
55817
- order: "DESC" /* DESC */
55818
- },
55819
- filterBy: [
55820
- {
55821
- // Todo: isTask is not a key of Process
55822
- // However, backend still supports it. Field should not be a keyof ProcessListItem (or process)
55823
- // https://github.com/workfloworchestrator/orchestrator-ui/issues/290
55824
- // eslint-disable-next-line @typescript-eslint/ban-ts-comment
55825
- // @ts-ignore waiting for fix in backend
55826
- field: "isTask",
55827
- value: "true"
55828
- },
55829
- {
55830
- field: "lastStatus",
55831
- value: "failed-inconsistent_data-api_unavailable"
55832
- }
55833
- ]
55834
- };
55835
- var productsSummaryQueryVariables = {
55836
- first: 1e3,
55837
- after: 0,
55838
- sortBy: {
55839
- field: "name",
55840
- order: "ASC" /* ASC */
55841
- }
55884
+ const summaryCards = (overrideSummaryCards == null ? void 0 : overrideSummaryCards(allowedSummaryCards)) || allowedSummaryCards;
55885
+ return /* @__PURE__ */ jsx175(EuiFlexItem33, { children: /* @__PURE__ */ jsx175(WfoSummaryCards, { summaryCards }) });
55842
55886
  };
55843
55887
 
55844
55888
  // src/pages/subscriptions/WfoSubscriptionDetailPage.tsx
@@ -57579,6 +57623,11 @@ var en_GB_default = {
57579
57623
  }
57580
57624
  },
57581
57625
  startPage: {
57626
+ myWorkflows: {
57627
+ buttonText: "Show my completed workflows",
57628
+ headerTitle: "My completed workflows",
57629
+ listTitle: "My most recent workflows"
57630
+ },
57582
57631
  activeSubscriptions: {
57583
57632
  buttonText: "Show all active subscriptions",
57584
57633
  headerTitle: "Total active subscriptions",
@@ -57979,6 +58028,11 @@ var nl_NL_default = {
57979
58028
  }
57980
58029
  },
57981
58030
  startPage: {
58031
+ myWorkflows: {
58032
+ buttonText: "Toon mijn afgeronde workflows",
58033
+ headerTitle: "Mijn afgeronde workflows",
58034
+ listTitle: "Mijn recente afgeronde workflows"
58035
+ },
57982
58036
  activeSubscriptions: {
57983
58037
  buttonText: "Toon alle actieve subscriptions",
57984
58038
  headerTitle: "Totaal aantal actieve subscriptions",
@@ -58423,6 +58477,7 @@ export {
58423
58477
  mapWorkflowDefinitionToWorkflowListItem,
58424
58478
  metaDataTabs,
58425
58479
  onlyUnique,
58480
+ optionalArrayMapper,
58426
58481
  orchestratorApi,
58427
58482
  parseDate,
58428
58483
  parseDateOrTimeRelativeToToday,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@orchestrator-ui/orchestrator-ui-components",
3
- "version": "1.13.1",
3
+ "version": "1.13.2",
4
4
  "license": "Apache-2.0",
5
5
  "description": "Library of UI Components used to display the workflow orchestrator frontend",
6
6
  "author": {
@@ -372,6 +372,11 @@
372
372
  }
373
373
  },
374
374
  "startPage": {
375
+ "myWorkflows": {
376
+ "buttonText": "Show my completed workflows",
377
+ "headerTitle": "My completed workflows",
378
+ "listTitle": "My most recent workflows"
379
+ },
375
380
  "activeSubscriptions": {
376
381
  "buttonText": "Show all active subscriptions",
377
382
  "headerTitle": "Total active subscriptions",
@@ -370,6 +370,11 @@
370
370
  }
371
371
  },
372
372
  "startPage": {
373
+ "myWorkflows": {
374
+ "buttonText": "Toon mijn afgeronde workflows",
375
+ "headerTitle": "Mijn afgeronde workflows",
376
+ "listTitle": "Mijn recente afgeronde workflows"
377
+ },
373
378
  "activeSubscriptions": {
374
379
  "buttonText": "Toon alle actieve subscriptions",
375
380
  "headerTitle": "Totaal aantal actieve subscriptions",
@@ -11,24 +11,35 @@ import {
11
11
  WfoSummaryCards,
12
12
  } from '@/components/WfoSummary/WfoSummaryCards';
13
13
  import { PolicyResource } from '@/configuration';
14
- import { usePolicy } from '@/hooks';
14
+ import { usePolicy, useWfoSession } from '@/hooks';
15
15
  import {
16
16
  useGetProcessListSummaryQuery,
17
17
  useGetProductsSummaryQuery,
18
18
  } from '@/rtk';
19
19
  import { useGetSubscriptionSummaryListQuery } from '@/rtk/endpoints/subscriptionListSummary';
20
+ import { optionalArrayMapper, toOptionalArrayEntry } from '@/utils';
21
+
22
+ import {
23
+ mapProcessSummaryToSummaryCardListItem,
24
+ mapSubscriptionSummaryToSummaryCardListItem,
25
+ } from './mappers';
20
26
  import {
21
- GraphqlQueryVariables,
22
- Process,
23
- ProductsSummary,
24
- SortOrder,
25
- Subscription,
26
- } from '@/types';
27
- import { formatDate } from '@/utils';
27
+ activeWorkflowsListSummaryQueryVariables,
28
+ getMyWorkflowListSummaryQueryVariables,
29
+ outOfSyncSubscriptionsListSummaryQueryVariables,
30
+ productsSummaryQueryVariables,
31
+ subscriptionsListSummaryQueryVariables,
32
+ taskListSummaryQueryVariables,
33
+ } from './queryVariables';
34
+ import { useStartPageSummaryCardConfigurationOverride } from './useStartPageSummaryCardConfigurationOverride';
28
35
 
29
36
  export const WfoStartPage = () => {
30
37
  const t = useTranslations('startPage');
38
+ const { overrideSummaryCards } =
39
+ useStartPageSummaryCardConfigurationOverride();
31
40
  const { isAllowed } = usePolicy();
41
+ const { session } = useWfoSession();
42
+ const username = session?.user?.name ?? '';
32
43
 
33
44
  const {
34
45
  data: subscriptionsSummaryResult,
@@ -43,9 +54,16 @@ export const WfoStartPage = () => {
43
54
  outOfSyncSubscriptionsListSummaryQueryVariables,
44
55
  );
45
56
  const {
46
- data: processesSummaryResponse,
47
- isFetching: processesSummaryIsFetching,
48
- } = useGetProcessListSummaryQuery(processListSummaryQueryVariables);
57
+ data: activeWorkflowsSummaryResponse,
58
+ isFetching: activeWorkflowsSummaryIsFetching,
59
+ } = useGetProcessListSummaryQuery(activeWorkflowsListSummaryQueryVariables);
60
+
61
+ const {
62
+ data: myWorkflowsSummaryResponse,
63
+ isFetching: myWorkflowsSummaryIsFetching,
64
+ } = useGetProcessListSummaryQuery(
65
+ getMyWorkflowListSummaryQueryVariables(username),
66
+ );
49
67
 
50
68
  const {
51
69
  data: failedTasksSummaryResponse,
@@ -62,12 +80,10 @@ export const WfoStartPage = () => {
62
80
  headerValue: subscriptionsSummaryResult?.pageInfo.totalItems ?? 0,
63
81
  headerStatus: SummaryCardStatus.Neutral,
64
82
  listTitle: t('activeSubscriptions.listTitle'),
65
- listItems:
66
- subscriptionsSummaryResult?.subscriptions.map((subscription) => ({
67
- title: subscription.description,
68
- value: formatDate(subscription.startDate),
69
- url: `${PATH_SUBSCRIPTIONS}/${subscription.subscriptionId}`,
70
- })) ?? [],
83
+ listItems: optionalArrayMapper(
84
+ subscriptionsSummaryResult?.subscriptions,
85
+ mapSubscriptionSummaryToSummaryCardListItem,
86
+ ),
71
87
  button: {
72
88
  name: t('activeSubscriptions.buttonText'),
73
89
  url: PATH_SUBSCRIPTIONS,
@@ -81,14 +97,10 @@ export const WfoStartPage = () => {
81
97
  outOfSyncSubscriptionsSummaryResult?.pageInfo.totalItems ?? 0,
82
98
  headerStatus: SummaryCardStatus.Error,
83
99
  listTitle: t('outOfSyncSubscriptions.listTitle'),
84
- listItems:
85
- outOfSyncSubscriptionsSummaryResult?.subscriptions.map(
86
- (subscription) => ({
87
- title: subscription.description,
88
- value: formatDate(subscription.startDate),
89
- url: `${PATH_SUBSCRIPTIONS}/${subscription.subscriptionId}`,
90
- }),
91
- ) ?? [],
100
+ listItems: optionalArrayMapper(
101
+ outOfSyncSubscriptionsSummaryResult?.subscriptions,
102
+ mapSubscriptionSummaryToSummaryCardListItem,
103
+ ),
92
104
  button: {
93
105
  name: t('outOfSyncSubscriptions.buttonText'),
94
106
  url: `${PATH_SUBSCRIPTIONS}?activeTab=ALL&sortBy=field-startDate_order-ASC&queryString=status%3A%28provisioning%7Cactive%29+insync%3Afalse`,
@@ -96,22 +108,38 @@ export const WfoStartPage = () => {
96
108
  isLoading: outOfSyncsubscriptionsSummaryIsFetching,
97
109
  };
98
110
 
99
- const latestWorkflowsSummaryCard: SummaryCard = {
111
+ const activeWorkflowsSummaryCard: SummaryCard = {
100
112
  headerTitle: t('activeWorkflows.headerTitle'),
101
- headerValue: processesSummaryResponse?.pageInfo.totalItems ?? 0,
113
+ headerValue: activeWorkflowsSummaryResponse?.pageInfo.totalItems ?? 0,
102
114
  headerStatus: SummaryCardStatus.Success,
103
115
  listTitle: t('activeWorkflows.listTitle'),
104
- listItems:
105
- processesSummaryResponse?.processes.map((workflow) => ({
106
- title: workflow.workflowName,
107
- value: formatDate(workflow?.startedAt),
108
- url: `${PATH_WORKFLOWS}/${workflow.processId}`,
109
- })) ?? [],
116
+ listItems: optionalArrayMapper(
117
+ activeWorkflowsSummaryResponse?.processes,
118
+ mapProcessSummaryToSummaryCardListItem,
119
+ ),
110
120
  button: {
111
121
  name: t('activeWorkflows.buttonText'),
112
122
  url: PATH_WORKFLOWS,
113
123
  },
114
- isLoading: processesSummaryIsFetching,
124
+ isLoading: activeWorkflowsSummaryIsFetching,
125
+ };
126
+
127
+ const myWorkflowsSummaryCard: SummaryCard = {
128
+ headerTitle: t('myWorkflows.headerTitle'),
129
+ headerValue: myWorkflowsSummaryResponse?.pageInfo.totalItems ?? 0,
130
+ headerStatus: SummaryCardStatus.Success,
131
+ listTitle: t('myWorkflows.listTitle'),
132
+ listItems: optionalArrayMapper(
133
+ myWorkflowsSummaryResponse?.processes,
134
+ mapProcessSummaryToSummaryCardListItem,
135
+ ),
136
+ button: username
137
+ ? {
138
+ name: t('myWorkflows.buttonText'),
139
+ url: `${PATH_WORKFLOWS}?activeTab=COMPLETED&sortBy=field-lastModifiedAt_order-DESC&queryString=createdBy%3A${username}`,
140
+ }
141
+ : undefined,
142
+ isLoading: myWorkflowsSummaryIsFetching,
115
143
  };
116
144
 
117
145
  const failedTasksSummaryCard: SummaryCard = {
@@ -119,12 +147,10 @@ export const WfoStartPage = () => {
119
147
  headerValue: failedTasksSummaryResponse?.pageInfo.totalItems ?? 0,
120
148
  headerStatus: SummaryCardStatus.Error,
121
149
  listTitle: t('failedTasks.listTitle'),
122
- listItems:
123
- failedTasksSummaryResponse?.processes.map((task) => ({
124
- title: task.workflowName,
125
- value: formatDate(task?.startedAt),
126
- url: `${PATH_TASKS}/${task.processId}`,
127
- })) ?? [],
150
+ listItems: optionalArrayMapper(
151
+ failedTasksSummaryResponse?.processes,
152
+ mapProcessSummaryToSummaryCardListItem,
153
+ ),
128
154
  button: {
129
155
  name: t('failedTasks.buttonText'),
130
156
  url: PATH_TASKS,
@@ -163,113 +189,24 @@ export const WfoStartPage = () => {
163
189
  isLoading: productsSummaryIsFetching,
164
190
  };
165
191
 
166
- function getFailedTasksSummarycard() {
167
- return isAllowed(PolicyResource.NAVIGATION_TASKS)
168
- ? [failedTasksSummaryCard]
169
- : [];
170
- }
171
-
172
192
  const allowedSummaryCards = [
173
- latestWorkflowsSummaryCard,
174
- ...getFailedTasksSummarycard(),
193
+ ...toOptionalArrayEntry(myWorkflowsSummaryCard, !!username),
194
+ activeWorkflowsSummaryCard,
195
+ ...toOptionalArrayEntry(
196
+ failedTasksSummaryCard,
197
+ isAllowed(PolicyResource.NAVIGATION_TASKS),
198
+ ),
175
199
  latestOutOfSyncSubscriptionsSummaryCard,
176
200
  latestActiveSubscriptionsSummaryCard,
177
201
  productsSummaryCard,
178
202
  ];
179
203
 
204
+ const summaryCards =
205
+ overrideSummaryCards?.(allowedSummaryCards) || allowedSummaryCards;
206
+
180
207
  return (
181
208
  <EuiFlexItem>
182
- <WfoSummaryCards summaryCards={allowedSummaryCards} />
209
+ <WfoSummaryCards summaryCards={summaryCards} />
183
210
  </EuiFlexItem>
184
211
  );
185
212
  };
186
-
187
- const subscriptionsListSummaryQueryVariables: GraphqlQueryVariables<Subscription> =
188
- {
189
- first: 5,
190
- after: 0,
191
- sortBy: {
192
- field: 'startDate',
193
- order: SortOrder.DESC,
194
- },
195
- filterBy: [
196
- {
197
- field: 'status',
198
- value: 'Active',
199
- },
200
- ],
201
- };
202
-
203
- const outOfSyncSubscriptionsListSummaryQueryVariables: GraphqlQueryVariables<Subscription> =
204
- {
205
- first: 5,
206
- after: 0,
207
- sortBy: {
208
- field: 'startDate',
209
- order: SortOrder.ASC,
210
- },
211
- query: 'insync:false',
212
- filterBy: [
213
- {
214
- field: 'status',
215
- value: 'Active-Provisioning',
216
- },
217
- ],
218
- };
219
-
220
- const processListSummaryQueryVariables: GraphqlQueryVariables<Process> = {
221
- first: 5,
222
- after: 0,
223
- sortBy: {
224
- field: 'startedAt',
225
- order: SortOrder.DESC,
226
- },
227
- filterBy: [
228
- {
229
- // Todo: isTask is not a key of Process
230
- // However, backend still supports it. Field should not be a keyof ProcessListItem (or process)
231
- // https://github.com/workfloworchestrator/orchestrator-ui/issues/290
232
- // eslint-disable-next-line @typescript-eslint/ban-ts-comment
233
- // @ts-ignore waiting for fix in backend
234
- field: 'isTask',
235
- value: 'false',
236
- },
237
- {
238
- field: 'lastStatus',
239
- value: 'created-running-suspended-waiting-failed-resumed-inconsistent_data-api_unavailable-awaiting_callback',
240
- },
241
- ],
242
- };
243
-
244
- const taskListSummaryQueryVariables: GraphqlQueryVariables<Process> = {
245
- first: 5,
246
- after: 0,
247
- sortBy: {
248
- field: 'startedAt',
249
- order: SortOrder.DESC,
250
- },
251
- filterBy: [
252
- {
253
- // Todo: isTask is not a key of Process
254
- // However, backend still supports it. Field should not be a keyof ProcessListItem (or process)
255
- // https://github.com/workfloworchestrator/orchestrator-ui/issues/290
256
- // eslint-disable-next-line @typescript-eslint/ban-ts-comment
257
- // @ts-ignore waiting for fix in backend
258
- field: 'isTask',
259
- value: 'true',
260
- },
261
- {
262
- field: 'lastStatus',
263
- value: 'failed-inconsistent_data-api_unavailable',
264
- },
265
- ],
266
- };
267
-
268
- const productsSummaryQueryVariables: GraphqlQueryVariables<ProductsSummary> = {
269
- first: 1000,
270
- after: 0,
271
- sortBy: {
272
- field: 'name',
273
- order: SortOrder.ASC,
274
- },
275
- };
@@ -0,0 +1,21 @@
1
+ import { PATH_SUBSCRIPTIONS, PATH_WORKFLOWS } from '@/components';
2
+ import { SummaryCardListItem } from '@/components/WfoSummary';
3
+ import { ProcessSummary } from '@/rtk';
4
+ import { SubscriptionSummary } from '@/types';
5
+ import { formatDate } from '@/utils';
6
+
7
+ export const mapProcessSummaryToSummaryCardListItem = (
8
+ processSummary: ProcessSummary,
9
+ ): SummaryCardListItem => ({
10
+ title: processSummary.workflowName,
11
+ value: formatDate(processSummary?.startedAt),
12
+ url: `${PATH_WORKFLOWS}/${processSummary.processId}`,
13
+ });
14
+
15
+ export const mapSubscriptionSummaryToSummaryCardListItem = (
16
+ subscription: SubscriptionSummary,
17
+ ): SummaryCardListItem => ({
18
+ title: subscription.description,
19
+ value: formatDate(subscription.startDate),
20
+ url: `${PATH_SUBSCRIPTIONS}/${subscription.subscriptionId}`,
21
+ });
@@ -0,0 +1,111 @@
1
+ import {
2
+ GraphqlFilter,
3
+ GraphqlQueryVariables,
4
+ Process,
5
+ ProductsSummary,
6
+ SortOrder,
7
+ Subscription,
8
+ } from '@/types';
9
+
10
+ const baseQueryVariables: Partial<GraphqlQueryVariables<unknown>> = {
11
+ first: 5,
12
+ after: 0,
13
+ };
14
+ const baseQueryVariablesForSubscription: Partial<
15
+ GraphqlQueryVariables<Subscription>
16
+ > = {
17
+ ...baseQueryVariables,
18
+ sortBy: {
19
+ field: 'startDate',
20
+ order: SortOrder.DESC,
21
+ },
22
+ };
23
+
24
+ const baseQueryVariablesForProcess: Partial<GraphqlQueryVariables<Process>> = {
25
+ ...baseQueryVariables,
26
+ sortBy: {
27
+ field: 'startedAt',
28
+ order: SortOrder.DESC,
29
+ },
30
+ };
31
+
32
+ const getTaskFilter = (isTask: boolean): GraphqlFilter<Process> => {
33
+ return {
34
+ // Todo: isTask is not a key of Process
35
+ // However, backend still supports it. Field should not be a keyof ProcessListItem (or process)
36
+ // https://github.com/workfloworchestrator/orchestrator-ui/issues/290
37
+ // eslint-disable-next-line @typescript-eslint/ban-ts-comment
38
+ // @ts-ignore waiting for fix in backend
39
+ field: 'isTask',
40
+ value: isTask ? 'true' : 'false',
41
+ };
42
+ };
43
+
44
+ export const subscriptionsListSummaryQueryVariables: GraphqlQueryVariables<Subscription> =
45
+ {
46
+ ...baseQueryVariablesForSubscription,
47
+ filterBy: [
48
+ {
49
+ field: 'status',
50
+ value: 'Active',
51
+ },
52
+ ],
53
+ };
54
+
55
+ export const outOfSyncSubscriptionsListSummaryQueryVariables: GraphqlQueryVariables<Subscription> =
56
+ {
57
+ ...baseQueryVariablesForSubscription,
58
+ query: 'insync:false',
59
+ filterBy: [
60
+ {
61
+ field: 'status',
62
+ value: 'Active-Provisioning',
63
+ },
64
+ ],
65
+ };
66
+
67
+ export const getMyWorkflowListSummaryQueryVariables = (
68
+ username: string,
69
+ ): GraphqlQueryVariables<Process> => ({
70
+ ...baseQueryVariablesForProcess,
71
+ filterBy: [
72
+ getTaskFilter(false),
73
+ {
74
+ field: 'createdBy',
75
+ value: username,
76
+ },
77
+ ],
78
+ });
79
+
80
+ export const activeWorkflowsListSummaryQueryVariables: GraphqlQueryVariables<Process> =
81
+ {
82
+ ...baseQueryVariablesForProcess,
83
+ filterBy: [
84
+ getTaskFilter(false),
85
+ {
86
+ field: 'lastStatus',
87
+ value: 'created-running-suspended-waiting-failed-resumed-inconsistent_data-api_unavailable-awaiting_callback',
88
+ },
89
+ ],
90
+ };
91
+
92
+ export const taskListSummaryQueryVariables: GraphqlQueryVariables<Process> = {
93
+ ...baseQueryVariablesForProcess,
94
+ filterBy: [
95
+ getTaskFilter(true),
96
+ {
97
+ field: 'lastStatus',
98
+ value: 'failed-inconsistent_data-api_unavailable',
99
+ },
100
+ ],
101
+ };
102
+
103
+ export const productsSummaryQueryVariables: GraphqlQueryVariables<ProductsSummary> =
104
+ {
105
+ first: 1000,
106
+ after: 0,
107
+ sortBy: {
108
+ field: 'name',
109
+ order: SortOrder.ASC,
110
+ },
111
+ };
@@ -0,0 +1,13 @@
1
+ import { useAppSelector } from '@/rtk/hooks';
2
+
3
+ export const useStartPageSummaryCardConfigurationOverride = () => {
4
+ const overrideSummaryCards = useAppSelector(
5
+ (state) =>
6
+ state.orchestratorComponentOverride?.startPage
7
+ ?.summaryCardConfigurationOverride,
8
+ );
9
+
10
+ return {
11
+ overrideSummaryCards,
12
+ };
13
+ };
@@ -36,7 +36,10 @@ export const processListSummaryQuery = `
36
36
  }
37
37
  `;
38
38
 
39
- type ProcessSummary = Pick<Process, 'processId' | 'workflowName' | 'startedAt'>;
39
+ export type ProcessSummary = Pick<
40
+ Process,
41
+ 'processId' | 'workflowName' | 'startedAt'
42
+ >;
40
43
 
41
44
  export type ProcessListSummaryResponse = {
42
45
  processes: ProcessSummary[];
@@ -2,6 +2,7 @@ import { ReactNode } from 'react';
2
2
 
3
3
  import { Slice, createSlice } from '@reduxjs/toolkit';
4
4
 
5
+ import { SummaryCard } from '@/components/WfoSummary';
5
6
  import { FieldValue, SubscriptionDetail } from '@/types';
6
7
 
7
8
  export type ValueOverrideFunction = (fieldValue: FieldValue) => ReactNode;
@@ -13,6 +14,11 @@ export type WfoSubscriptionDetailGeneralConfiguration = {
13
14
  };
14
15
 
15
16
  export type OrchestratorComponentOverride = {
17
+ startPage?: {
18
+ summaryCardConfigurationOverride?: (
19
+ defaultItems: SummaryCard[],
20
+ ) => SummaryCard[];
21
+ };
16
22
  subscriptionDetail?: {
17
23
  valueOverrides?: ValueOverrideConfiguration;
18
24
  generalSectionConfigurationOverride?: (
@@ -9,4 +9,4 @@ export * from './onlyUnique';
9
9
  export * from './uuid';
10
10
  export * from './resultFlattener';
11
11
  export * from './strings';
12
- export * from './toOptionalArrayEntry';
12
+ export * from './optionalArray';
@@ -0,0 +1,32 @@
1
+ import { optionalArrayMapper, toOptionalArrayEntry } from './optionalArray';
2
+
3
+ describe('toOptionalArrayEntry', () => {
4
+ const testInput = { testField: 'testValue' };
5
+
6
+ it('returns an array with the data if the condition is true', () => {
7
+ const result = toOptionalArrayEntry(testInput, true);
8
+
9
+ expect(result).toEqual([testInput]);
10
+ });
11
+
12
+ it('returns an empty array if the condition is false', () => {
13
+ const result = toOptionalArrayEntry(testInput, false);
14
+
15
+ expect(result).toEqual([]);
16
+ });
17
+ });
18
+
19
+ describe('optionalArrayMapper', () => {
20
+ it('applies the mapper when data is defined', () => {
21
+ const testData = [{ testField: 'testValue' }];
22
+
23
+ const result = optionalArrayMapper(testData, () => 'mappedValue');
24
+
25
+ expect(result).toEqual(['mappedValue']);
26
+ });
27
+ it('returns an empty array when data is undefined', () => {
28
+ const result = optionalArrayMapper(undefined, () => 'test');
29
+
30
+ expect(result).toEqual([]);
31
+ });
32
+ });
@@ -0,0 +1,9 @@
1
+ export const toOptionalArrayEntry = <T>(
2
+ data: T,
3
+ condition: boolean,
4
+ ): [T] | [] => (condition ? [data] : []);
5
+
6
+ export const optionalArrayMapper = <T, U>(
7
+ data: T[] | undefined = [],
8
+ mapper: (input: T) => U,
9
+ ): U[] => data.map(mapper);
@@ -1,17 +0,0 @@
1
- import { toOptionalArrayEntry } from './toOptionalArrayEntry';
2
-
3
- describe('toOptionalArrayEntry', () => {
4
- const testInput = { testField: 'testValue' };
5
-
6
- it('returns an array with the data if ', () => {
7
- const result = toOptionalArrayEntry(testInput, true);
8
-
9
- expect(result).toEqual([testInput]);
10
- });
11
-
12
- it('returns an empty array if the condition is false', () => {
13
- const result = toOptionalArrayEntry(testInput, false);
14
-
15
- expect(result).toEqual([]);
16
- });
17
- });
@@ -1,4 +0,0 @@
1
- export const toOptionalArrayEntry = <T>(
2
- data: T,
3
- condition: boolean,
4
- ): [T] | [] => (condition ? [data] : []);