@orchestrator-ui/orchestrator-ui-components 0.0.1-alpha.1 → 0.0.1-alpha.10

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 (56) hide show
  1. package/index.js +2146 -804
  2. package/package.json +7 -4
  3. package/src/index.d.ts +6 -5
  4. package/src/lib/components/Badges/Badge/Badge.d.ts +8 -0
  5. package/src/lib/components/Badges/Badge/index.d.ts +1 -0
  6. package/src/lib/components/Badges/EngineStatusBadge/EngineStatusBadge.d.ts +1 -0
  7. package/src/lib/components/Badges/EngineStatusBadge/index.d.ts +1 -0
  8. package/src/lib/components/Badges/EnvironmentBadge/EnvironmentBadge.d.ts +1 -0
  9. package/src/lib/components/Badges/EnvironmentBadge/index.d.ts +1 -0
  10. package/src/lib/components/Badges/FailedTasksBadge/FailedTasksBadge.d.ts +1 -0
  11. package/src/lib/components/Badges/FailedTasksBadge/index.d.ts +1 -0
  12. package/src/lib/components/{OrchestratorPageTemplate → Badges/HeaderBadge}/HeaderBadge.d.ts +3 -2
  13. package/src/lib/components/Badges/HeaderBadge/index.d.ts +1 -0
  14. package/src/lib/components/Badges/SubscriptionStatusBadge/SubscriptionStatusBadge.d.ts +5 -0
  15. package/src/lib/components/Badges/SubscriptionStatusBadge/index.d.ts +1 -0
  16. package/src/lib/components/Badges/index.d.ts +6 -0
  17. package/src/lib/components/OrchestratorPageTemplate/OrchestratorPageHeader/index.d.ts +1 -0
  18. package/src/lib/components/OrchestratorPageTemplate/{OrchestratorPageTemplate.d.ts → OrchestratorPageTemplate/OrchestratorPageTemplate.d.ts} +1 -0
  19. package/src/lib/components/OrchestratorPageTemplate/OrchestratorPageTemplate/index.d.ts +1 -0
  20. package/src/lib/components/OrchestratorPageTemplate/{OrchestratorSidebar.d.ts → OrchestratorSidebar/OrchestratorSidebar.d.ts} +1 -1
  21. package/src/lib/components/OrchestratorPageTemplate/OrchestratorSidebar/index.d.ts +1 -0
  22. package/src/lib/components/OrchestratorPageTemplate/index.d.ts +3 -0
  23. package/src/lib/components/StartPage/FrequentlyUsed.d.ts +5 -0
  24. package/src/lib/components/StartPage/ListItemStartPage.d.ts +8 -0
  25. package/src/lib/components/StartPage/ListStartPage.d.ts +7 -0
  26. package/src/lib/components/StartPage/MultiListSection.d.ts +2 -0
  27. package/src/lib/components/StartPage/NewProcessPanel.d.ts +2 -0
  28. package/src/lib/components/StartPage/StatCards.d.ts +2 -0
  29. package/src/lib/components/StartPage/index.d.ts +6 -0
  30. package/src/lib/components/Table/DataGridTable.d.ts +18 -0
  31. package/src/lib/components/Table/Table.d.ts +14 -0
  32. package/src/lib/components/Table/TableHeaderCell.d.ts +12 -0
  33. package/src/lib/components/Table/columns.d.ts +22 -0
  34. package/src/lib/components/Table/dataGridColumns.d.ts +15 -0
  35. package/src/lib/components/Table/index.d.ts +5 -0
  36. package/src/lib/components/index.d.ts +4 -0
  37. package/src/lib/contexts/index.d.ts +1 -0
  38. package/src/lib/hooks/DataFetchHooks.d.ts +18 -0
  39. package/src/lib/hooks/index.d.ts +6 -0
  40. package/src/lib/hooks/useOrchestratorConfig.d.ts +7 -0
  41. package/src/lib/hooks/useOrchestratorTheme.d.ts +1 -0
  42. package/src/lib/hooks/useQueryWithGraphql.d.ts +4 -0
  43. package/src/lib/icons/ArrowNarrowDown.d.ts +3 -0
  44. package/src/lib/icons/ArrowNarrowUp.d.ts +3 -0
  45. package/src/lib/icons/CheckmarkCircleFill.d.ts +3 -0
  46. package/src/lib/icons/ChevronDown.d.ts +3 -0
  47. package/src/lib/icons/MinusCircleOutline.d.ts +3 -0
  48. package/src/lib/icons/PlusCircleFill.d.ts +3 -0
  49. package/src/lib/icons/index.d.ts +10 -0
  50. package/src/lib/theme/index.d.ts +1 -0
  51. package/src/lib/types.d.ts +55 -0
  52. package/src/lib/utils/date.d.ts +1 -0
  53. package/src/lib/utils/getTypedFieldFromObject.d.ts +1 -0
  54. package/src/lib/utils/index.d.ts +3 -0
  55. /package/src/lib/components/OrchestratorPageTemplate/{OrchestratorPageHeader.d.ts → OrchestratorPageHeader/OrchestratorPageHeader.d.ts} +0 -0
  56. /package/src/lib/{utils.d.ts → utils/getStatusBadgeColor.d.ts} +0 -0
package/package.json CHANGED
@@ -1,16 +1,19 @@
1
1
  {
2
2
  "name": "@orchestrator-ui/orchestrator-ui-components",
3
- "version": "0.0.1-alpha.1",
3
+ "version": "0.0.1-alpha.10",
4
4
  "main": "./index.js",
5
5
  "module": "./index.js",
6
6
  "type": "module",
7
7
  "types": "./src\\index.d.ts",
8
8
  "dependencies": {},
9
9
  "peerDependencies": {
10
+ "react-query": "3.39.3",
11
+ "@elastic/eui": "77.2.2",
10
12
  "react": "18.2.0",
11
- "@emotion/react": "11.10.6",
12
- "@elastic/eui": "75.1.2",
13
+ "@emotion/react": "11.11.0",
13
14
  "next": "13.1.1",
14
- "react-query": "3.39.3"
15
+ "moment": "2.29.4",
16
+ "graphql-request": "5.2.0",
17
+ "@graphql-typed-document-node/core": "3.2.0"
15
18
  }
16
19
  }
package/src/index.d.ts CHANGED
@@ -1,6 +1,7 @@
1
- export * from './lib/components/custom-button/custom-button';
2
- export * from './lib/components/OrchestratorPageTemplate/OrchestratorPageTemplate';
3
- export * from './lib/theme/defaultOrchestratorTheme';
1
+ export * from './lib/components';
2
+ export * from './lib/icons';
3
+ export * from './lib/theme';
4
4
  export * from './lib/utils';
5
- export * from './lib/contexts/OrchestratorConfigContext';
6
- export * from './lib/hooks/useOrchestratorConfig';
5
+ export * from './lib/contexts';
6
+ export * from './lib/types';
7
+ export * from './lib/hooks';
@@ -0,0 +1,8 @@
1
+ import { EuiBadgeProps } from '@elastic/eui';
2
+ import { FC, ReactNode } from 'react';
3
+ import { TextColor } from '@elastic/eui/src/components/text/text_color';
4
+ export declare type BadgeProps = EuiBadgeProps & {
5
+ textColor: TextColor | string;
6
+ children: ReactNode;
7
+ };
8
+ export declare const Badge: FC<BadgeProps>;
@@ -0,0 +1 @@
1
+ export * from './Badge';
@@ -0,0 +1 @@
1
+ export declare const EngineStatusBadge: () => import("@emotion/react/jsx-runtime").JSX.Element;
@@ -0,0 +1 @@
1
+ export * from './EngineStatusBadge';
@@ -0,0 +1 @@
1
+ export declare const EnvironmentBadge: () => import("@emotion/react/jsx-runtime").JSX.Element;
@@ -0,0 +1 @@
1
+ export * from './EnvironmentBadge';
@@ -0,0 +1 @@
1
+ export declare const FailedTasksBadge: () => import("@emotion/react/jsx-runtime").JSX.Element;
@@ -0,0 +1 @@
1
+ export * from './FailedTasksBadge';
@@ -1,7 +1,8 @@
1
1
  import { FC, ReactNode } from 'react';
2
- import { EuiBadgeProps, _EuiThemeColorsMode } from '@elastic/eui';
2
+ import { EuiBadgeProps } from '@elastic/eui';
3
+ import { TextColor } from '@elastic/eui/src/components/text/text_color';
3
4
  export declare type HeaderBadgeProps = EuiBadgeProps & {
4
- color: keyof _EuiThemeColorsMode;
5
+ textColor: TextColor | string;
5
6
  children: ReactNode;
6
7
  };
7
8
  export declare const HeaderBadge: FC<HeaderBadgeProps>;
@@ -0,0 +1 @@
1
+ export * from './HeaderBadge';
@@ -0,0 +1,5 @@
1
+ import { FC } from 'react';
2
+ export declare type SubscriptionStatusBadgeProps = {
3
+ subscriptionStatus: string;
4
+ };
5
+ export declare const SubscriptionStatusBadge: FC<SubscriptionStatusBadgeProps>;
@@ -0,0 +1 @@
1
+ export * from './SubscriptionStatusBadge';
@@ -0,0 +1,6 @@
1
+ export * from './Badge';
2
+ export * from './SubscriptionStatusBadge';
3
+ export * from './FailedTasksBadge';
4
+ export * from './EnvironmentBadge';
5
+ export * from './EngineStatusBadge';
6
+ export * from './HeaderBadge';
@@ -0,0 +1 @@
1
+ export * from './OrchestratorPageHeader';
@@ -1,6 +1,7 @@
1
1
  import { FC, ReactElement, ReactNode } from 'react';
2
2
  export interface OrchestratorPageTemplateProps {
3
3
  getAppLogo: (navigationHeight: number) => ReactElement;
4
+ routeTo: (route: string) => void;
4
5
  children: ReactNode;
5
6
  }
6
7
  export declare const OrchestratorPageTemplate: FC<OrchestratorPageTemplateProps>;
@@ -0,0 +1 @@
1
+ export * from './OrchestratorPageTemplate';
@@ -1,5 +1,5 @@
1
1
  import { FC } from 'react';
2
2
  export interface OrchestratorSidebarProps {
3
- text: string;
3
+ routeTo: (route: string) => void;
4
4
  }
5
5
  export declare const OrchestratorSidebar: FC<OrchestratorSidebarProps>;
@@ -0,0 +1 @@
1
+ export * from './OrchestratorSidebar';
@@ -0,0 +1,3 @@
1
+ export * from './OrchestratorPageHeader';
2
+ export * from './OrchestratorPageTemplate';
3
+ export * from './OrchestratorSidebar';
@@ -0,0 +1,5 @@
1
+ import { FC } from 'react';
2
+ export interface FrequentlyUsedProps {
3
+ values: string[];
4
+ }
5
+ export declare const FrequentlyUsed: FC<FrequentlyUsedProps>;
@@ -0,0 +1,8 @@
1
+ import { FC } from 'react';
2
+ import { Process, Subscription } from '../../types';
3
+ export interface ListItemStartPageProps {
4
+ item: Subscription | Process;
5
+ type: string;
6
+ }
7
+ export declare const ListItemStartPage: FC<ListItemStartPageProps>;
8
+ export default ListItemStartPage;
@@ -0,0 +1,7 @@
1
+ import { ReactElement } from 'react';
2
+ import { ItemsList } from '../../types';
3
+ interface ListStartPage {
4
+ list: ItemsList;
5
+ }
6
+ export default function ListStartPage({ list }: ListStartPage): ReactElement;
7
+ export {};
@@ -0,0 +1,2 @@
1
+ import { FC } from 'react';
2
+ export declare const MultiListSection: FC;
@@ -0,0 +1,2 @@
1
+ import { FC } from 'react';
2
+ export declare const NewProcessPanel: FC;
@@ -0,0 +1,2 @@
1
+ import { FC } from 'react';
2
+ export declare const StatCards: FC;
@@ -0,0 +1,6 @@
1
+ export * from './FrequentlyUsed';
2
+ export * from './ListItemStartPage';
3
+ export * from './ListStartPage';
4
+ export * from './MultiListSection';
5
+ export * from './NewProcessPanel';
6
+ export * from './StatCards';
@@ -0,0 +1,18 @@
1
+ import { ControlColumn, DataGridTableColumns } from './dataGridColumns';
2
+ import { EuiDataGridPaginationProps } from '@elastic/eui/src/components/datagrid/data_grid_types';
3
+ import { DataSorting } from './columns';
4
+ export declare type Pagination = EuiDataGridPaginationProps & {
5
+ totalRecords: number;
6
+ };
7
+ export declare type DataGridTableProps<T> = {
8
+ data: T[];
9
+ pagination: Pagination;
10
+ columns: DataGridTableColumns<T>;
11
+ leadingControlColumns?: ControlColumn<T>[];
12
+ trailingControlColumns?: ControlColumn<T>[];
13
+ initialColumnOrder: Array<keyof T>;
14
+ dataSorting?: DataSorting<T>;
15
+ handleRowClick?: (row: T) => void;
16
+ updateDataSorting?: (updatedDataSorting: DataSorting<T>) => void;
17
+ };
18
+ export declare const DataGridTable: <T>({ data, pagination, columns, leadingControlColumns, trailingControlColumns, initialColumnOrder, dataSorting, handleRowClick, updateDataSorting, }: DataGridTableProps<T>) => import("@emotion/react/jsx-runtime").JSX.Element;
@@ -0,0 +1,14 @@
1
+ import { Pagination } from '@elastic/eui';
2
+ import { Criteria } from '@elastic/eui/src/components/basic_table/basic_table';
3
+ import { DataSorting, TableColumnsWithExtraNonDataFields } from './columns';
4
+ export declare type TableProps<T> = {
5
+ data: T[];
6
+ columns: TableColumnsWithExtraNonDataFields<T>;
7
+ hiddenColumns?: Array<keyof T>;
8
+ dataSorting?: DataSorting<T>;
9
+ pagination: Pagination;
10
+ isLoading?: boolean;
11
+ onCriteriaChange: (criteria: Criteria<T>) => void;
12
+ onDataSort?: (columnId: keyof T) => void;
13
+ };
14
+ export declare const Table: <T>({ data, columns, hiddenColumns, dataSorting, pagination, isLoading, onCriteriaChange, onDataSort, }: TableProps<T>) => import("@emotion/react/jsx-runtime").JSX.Element;
@@ -0,0 +1,12 @@
1
+ import { FC, ReactNode } from 'react';
2
+ import { SortDirection } from './columns';
3
+ export declare type TableHeaderCellProps = {
4
+ sortDirection?: SortDirection;
5
+ onClick?: () => void;
6
+ children: ReactNode;
7
+ };
8
+ export declare const TableHeaderCell: FC<TableHeaderCellProps>;
9
+ export declare type SortDirectionIconProps = {
10
+ sortDirection: SortDirection;
11
+ };
12
+ export declare const SortDirectionIcon: FC<SortDirectionIconProps>;
@@ -0,0 +1,22 @@
1
+ import { EuiBasicTableColumn } from '@elastic/eui';
2
+ export declare type TableColumns<T> = {
3
+ [Property in keyof T]: EuiBasicTableColumn<T> & {
4
+ field: Property;
5
+ name: string;
6
+ };
7
+ };
8
+ export declare type TableColumnsWithExtraNonDataFields<T> = TableColumns<T> & {
9
+ [key: string]: EuiBasicTableColumn<T> & {
10
+ field: string;
11
+ name?: string;
12
+ };
13
+ };
14
+ export declare enum SortDirection {
15
+ Asc = "ASC",
16
+ Desc = "DESC"
17
+ }
18
+ export declare type DataSorting<T> = {
19
+ columnId: keyof T;
20
+ sortDirection: SortDirection;
21
+ };
22
+ export declare const getSortDirectionFromString: (sortOrder?: string) => SortDirection | undefined;
@@ -0,0 +1,15 @@
1
+ import { EuiDataGridColumn } from '@elastic/eui';
2
+ import { ReactNode } from 'react';
3
+ import { EuiDataGridControlColumn, EuiDataGridSorting } from '@elastic/eui/src/components/datagrid/data_grid_types';
4
+ import { DataSorting } from './columns';
5
+ export declare type DataGridTableColumns<T> = {
6
+ [Property in keyof T]: Omit<EuiDataGridColumn, 'id'> & {
7
+ renderCell?: (cellValue: T[Property], row: T) => ReactNode;
8
+ isHiddenByDefault?: boolean;
9
+ };
10
+ };
11
+ export declare type ControlColumn<T> = Omit<EuiDataGridControlColumn, 'rowCellRender' | 'headerCellRender' | 'footerCellRender' | 'footerCellProps' | 'headerCellProps'> & {
12
+ rowCellRender: (row: T) => ReactNode;
13
+ };
14
+ export declare function getInitialColumnOrder<T>(columns: DataGridTableColumns<T>, initialColumnOrder: Array<keyof T>): EuiDataGridColumn[];
15
+ export declare function columnSortToEuiDataGridSorting<T>(columnSort?: DataSorting<T>, updateColumnSort?: (columnSort: DataSorting<T>) => void): EuiDataGridSorting;
@@ -0,0 +1,5 @@
1
+ export * from './Table';
2
+ export * from './TableHeaderCell';
3
+ export * from './columns';
4
+ export * from './DataGridTable';
5
+ export * from './dataGridColumns';
@@ -0,0 +1,4 @@
1
+ export * from './Badges';
2
+ export * from './OrchestratorPageTemplate';
3
+ export * from './StartPage';
4
+ export * from './Table';
@@ -0,0 +1 @@
1
+ export * from './OrchestratorConfigContext';
@@ -0,0 +1,18 @@
1
+ export declare const useFavouriteSubscriptions: () => {
2
+ items: any;
3
+ type: string;
4
+ title: string;
5
+ buttonName: string;
6
+ };
7
+ export declare const useProcessesAttention: () => {
8
+ items: any;
9
+ type: string;
10
+ title: string;
11
+ buttonName: string;
12
+ };
13
+ export declare const useRecentProcesses: () => {
14
+ items: any;
15
+ type: string;
16
+ title: string;
17
+ buttonName: string;
18
+ };
@@ -0,0 +1,6 @@
1
+ export * from './useQueryWithGraphql';
2
+ export * from './useEngineStatusQuery';
3
+ export * from './useOrchestratorConfig';
4
+ export * from './useOrchestratorTheme';
5
+ export * from './useProcessStatusCountsQuery';
6
+ export * from './DataFetchHooks';
@@ -1,6 +1,13 @@
1
+ export declare enum Environment {
2
+ DEVELOPMENT = "Development",
3
+ PRODUCTION = "Production"
4
+ }
1
5
  export declare type OrchestratorConfig = {
6
+ environmentName: Environment | string;
7
+ orchestratorApiBaseUrl: string;
2
8
  engineStatusEndpoint: string;
3
9
  processStatusCountsEndpoint: string;
10
+ graphqlEndpoint: string;
4
11
  };
5
12
  export declare const useOrchestratorConfig: (initialOrchestratorConfig: OrchestratorConfig) => {
6
13
  orchestratorConfig: OrchestratorConfig;
@@ -2,4 +2,5 @@
2
2
  export declare const useOrchestratorTheme: () => {
3
3
  theme: import("@elastic/eui").EuiThemeComputed<{}>;
4
4
  multiplyByBaseUnit: (multiplier: number) => number;
5
+ toSecondaryColor: (color: string) => string;
5
6
  };
@@ -0,0 +1,4 @@
1
+ import { TypedDocumentNode } from '@graphql-typed-document-node/core';
2
+ import { Variables } from 'graphql-request/build/cjs/types';
3
+ export declare const useQueryWithGraphql: <U, V extends Variables>(query: TypedDocumentNode<U, V>, queryVars: V) => import("react-query").UseQueryResult<U, unknown>;
4
+ export declare const useStringQueryWithGraphql: <T, U extends Variables>(query: string, queryVars: U) => import("react-query").UseQueryResult<T, unknown>;
@@ -0,0 +1,3 @@
1
+ import { FC } from 'react';
2
+ import { IconProps } from './IconProps';
3
+ export declare const ArrowNarrowDown: FC<IconProps>;
@@ -0,0 +1,3 @@
1
+ import { FC } from 'react';
2
+ import { IconProps } from './IconProps';
3
+ export declare const ArrowNarrowUp: FC<IconProps>;
@@ -0,0 +1,3 @@
1
+ import { FC } from 'react';
2
+ import { IconProps } from './IconProps';
3
+ export declare const CheckmarkCircleFill: FC<IconProps>;
@@ -0,0 +1,3 @@
1
+ import { FC } from 'react';
2
+ import { IconProps } from './IconProps';
3
+ export declare const ChevronDown: FC<IconProps>;
@@ -0,0 +1,3 @@
1
+ import { FC } from 'react';
2
+ import { IconProps } from './IconProps';
3
+ export declare const MinusCircleOutline: FC<IconProps>;
@@ -0,0 +1,3 @@
1
+ import { FC } from 'react';
2
+ import { IconProps } from './IconProps';
3
+ export declare const PlusCircleFill: FC<IconProps>;
@@ -0,0 +1,10 @@
1
+ export * from './XCircleFill';
2
+ export * from './StatusDotIcon';
3
+ export * from './LogoutIcon';
4
+ export * from './CheckmarkCircleFill';
5
+ export * from './IconProps';
6
+ export * from './MinusCircleOutline';
7
+ export * from './PlusCircleFill';
8
+ export * from './ChevronDown';
9
+ export * from './ArrowNarrowDown';
10
+ export * from './ArrowNarrowUp';
@@ -0,0 +1 @@
1
+ export * from './defaultOrchestratorTheme';
@@ -0,0 +1,55 @@
1
+ import { _EuiThemeColorsMode } from '@elastic/eui/src/global_styling/variables/colors';
2
+ export interface ItemsList {
3
+ type: string;
4
+ title: string;
5
+ items: Subscription[] | Process[];
6
+ buttonName: string;
7
+ }
8
+ export interface TotalStat {
9
+ icon: string;
10
+ name: string;
11
+ value: number;
12
+ color: keyof _EuiThemeColorsMode;
13
+ }
14
+ export interface Subscription {
15
+ name: string;
16
+ subscription_id: string;
17
+ description: string;
18
+ product: Product;
19
+ product_id: string;
20
+ status: string;
21
+ insync: boolean;
22
+ customer_id: string;
23
+ start_date: number;
24
+ end_date: number;
25
+ note: string;
26
+ }
27
+ export interface Process {
28
+ pid: string;
29
+ workflow: string;
30
+ assignee: string;
31
+ last_status: string;
32
+ failed_reason: string;
33
+ traceback: string;
34
+ step: string;
35
+ created_by: string;
36
+ started_at: number;
37
+ last_modified_at: number;
38
+ is_task: boolean;
39
+ }
40
+ export interface Product {
41
+ name: string;
42
+ tag: string;
43
+ description: string;
44
+ product_id: string;
45
+ created_at: number;
46
+ product_type: string;
47
+ end_date: number;
48
+ status: string;
49
+ fixed_inputs: [];
50
+ workflows: [];
51
+ product_blocks: [];
52
+ create_subscription_workflow_key: string;
53
+ modify_subscription_workflow_key: string;
54
+ terminate_subscription_workflow_key: string;
55
+ }
@@ -0,0 +1 @@
1
+ export declare const parseDate: (date: string | null) => Date | null;
@@ -0,0 +1 @@
1
+ export declare function getTypedFieldFromObject<T extends object>(field: string, object: T): null | keyof T;
@@ -0,0 +1,3 @@
1
+ export * from './date';
2
+ export * from './getStatusBadgeColor';
3
+ export * from './getTypedFieldFromObject';