@orchestrator-ui/orchestrator-ui-components 0.2.1 → 0.2.3

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 (212) hide show
  1. package/.storybook/main.js +28 -0
  2. package/.storybook/preview.js +14 -0
  3. package/.turbo/turbo-build.log +11 -0
  4. package/.turbo/turbo-lint.log +10 -0
  5. package/.turbo/turbo-test.log +17 -0
  6. package/CHANGELOG.md +12 -0
  7. package/dist/index.d.ts +751 -0
  8. package/dist/index.js +7019 -0
  9. package/package.json +18 -4
  10. package/src/components/{Badges/Badge/Badge.stories.tsx → WFOBadges/WFOBadge/WFOBadge.stories.tsx} +4 -4
  11. package/src/components/{Badges/Badge/Badge.tsx → WFOBadges/WFOBadge/WFOBadge.tsx} +2 -2
  12. package/src/components/WFOBadges/WFOBadge/index.ts +1 -0
  13. package/src/components/{Badges/EngineStatusBadge/EngineStatusBadge.stories.tsx → WFOBadges/WFOEngineStatusBadge/WFOEngineStatusBadge.stories.tsx} +4 -4
  14. package/src/components/{Badges/EngineStatusBadge/EngineStatusBadge.tsx → WFOBadges/WFOEngineStatusBadge/WFOEngineStatusBadge.tsx} +6 -6
  15. package/src/components/WFOBadges/WFOEngineStatusBadge/index.ts +1 -0
  16. package/src/components/{Badges/EnvironmentBadge/EnvironmentBadge.stories.tsx → WFOBadges/WFOEnvironmentBadge/WFOEnvironmentBadge.stories.tsx} +4 -4
  17. package/src/components/{Badges/EnvironmentBadge/EnvironmentBadge.tsx → WFOBadges/WFOEnvironmentBadge/WFOEnvironmentBadge.tsx} +6 -6
  18. package/src/components/WFOBadges/WFOEnvironmentBadge/index.ts +1 -0
  19. package/src/components/WFOBadges/WFOFailedTasksBadge/WFOFailedTasksBadge.stories.tsx +12 -0
  20. package/src/components/{Badges/FailedTasksBadge/FailedTasksBadge.tsx → WFOBadges/WFOFailedTasksBadge/WFOFailedTasksBadge.tsx} +6 -6
  21. package/src/components/WFOBadges/WFOFailedTasksBadge/index.ts +1 -0
  22. package/src/components/{Badges/HeaderBadge/HeaderBadge.stories.tsx → WFOBadges/WFOHeaderBadge/WFOHeaderBadge.stories.tsx} +4 -4
  23. package/src/components/{Badges/HeaderBadge/HeaderBadge.tsx → WFOBadges/WFOHeaderBadge/WFOHeaderBadge.tsx} +4 -4
  24. package/src/components/WFOBadges/WFOHeaderBadge/index.ts +1 -0
  25. package/src/components/WFOBadges/WFOProcessStatusBadge/WFOProcessStatusBadge.tsx +71 -0
  26. package/src/components/WFOBadges/WFOProcessStatusBadge/index.ts +1 -0
  27. package/src/components/{Badges → WFOBadges}/WFOProductBlockBadge/WFOProductBlockBadge.stories.tsx +1 -1
  28. package/src/components/{Badges → WFOBadges}/WFOProductBlockBadge/WFOProductBlockBadge.tsx +3 -3
  29. package/src/components/{Badges → WFOBadges}/WFOStatusBadge/WFOStatusBadge.stories.tsx +1 -1
  30. package/src/components/{Badges → WFOBadges}/WFOStatusBadge/WFOStatusBadge.tsx +3 -3
  31. package/src/components/WFOBadges/index.ts +8 -0
  32. package/src/components/{Breadcrumbs/Breadcrumbs.tsx → WFOBreadcrumbs/WFOBreadcrumbs.tsx} +1 -1
  33. package/src/components/WFOBreadcrumbs/index.ts +1 -0
  34. package/src/components/WFOFilterTabs/WFOFilterTabs.tsx +43 -0
  35. package/src/components/WFOFilterTabs/index.ts +1 -0
  36. package/src/components/WFOLoading/WFOLoading.tsx +2 -0
  37. package/src/components/WFOLoading/index.ts +1 -0
  38. package/src/components/{OrchestratorPageTemplate/OrchestratorPageHeader/OrchestratorPageHeader.stories.tsx → WFOPageTemplate/WFOPageHeader/WFOPageHeader.stories.tsx} +5 -14
  39. package/src/components/{OrchestratorPageTemplate/OrchestratorPageHeader/OrchestratorPageHeader.tsx → WFOPageTemplate/WFOPageHeader/WFOPageHeader.tsx} +10 -10
  40. package/src/components/WFOPageTemplate/WFOPageHeader/index.ts +1 -0
  41. package/src/components/WFOPageTemplate/WFOPageTemplate/WFOPageTemplate.stories.tsx +24 -0
  42. package/src/components/{OrchestratorPageTemplate/OrchestratorPageTemplate/OrchestratorPageTemplate.tsx → WFOPageTemplate/WFOPageTemplate/WFOPageTemplate.tsx} +6 -6
  43. package/src/components/WFOPageTemplate/WFOPageTemplate/index.ts +1 -0
  44. package/src/components/{OrchestratorPageTemplate/OrchestratorSidebar/OrchestratorSidebar.stories.tsx → WFOPageTemplate/WFOSidebar/WFOSidebar.stories.tsx} +4 -4
  45. package/src/components/{OrchestratorPageTemplate/OrchestratorSidebar/OrchestratorSidebar.tsx → WFOPageTemplate/WFOSidebar/WFOSidebar.tsx} +2 -14
  46. package/src/components/WFOPageTemplate/WFOSidebar/index.ts +1 -0
  47. package/src/components/WFOPageTemplate/index.ts +3 -0
  48. package/src/components/{SearchBar/SearchField.tsx → WFOSearchBar/WFOSearchField.tsx} +3 -3
  49. package/src/components/WFOSearchBar/index.ts +1 -0
  50. package/src/components/WFOSettingsModal/index.tsx +1 -0
  51. package/src/components/{SettingsPage/EngineStatusButton.tsx → WFOSettingsPage/WFOEngineStatusButton.tsx} +2 -2
  52. package/src/components/{SettingsPage/FlushSettings.tsx → WFOSettingsPage/WFOFlushSettings.tsx} +1 -1
  53. package/src/components/{SettingsPage/ModifySettings.tsx → WFOSettingsPage/WFOModifySettings.tsx} +4 -4
  54. package/src/components/{SettingsPage/Settings.tsx → WFOSettingsPage/WFOSettings.tsx} +7 -7
  55. package/src/components/{SettingsPage/Status.tsx → WFOSettingsPage/WFOStatus.tsx} +4 -4
  56. package/src/components/WFOSettingsPage/index.ts +1 -0
  57. package/src/components/{StartPage/FrequentlyUsed.stories.tsx → WFOStartPage/WFOFrequentlyUsed.stories.tsx} +4 -4
  58. package/src/components/{StartPage/FrequentlyUsed.tsx → WFOStartPage/WFOFrequentlyUsed.tsx} +2 -2
  59. package/src/components/{StartPage/ListItemStartPage.stories.tsx → WFOStartPage/WFOListItemStartPage.stories.tsx} +4 -4
  60. package/src/components/{StartPage/ListItemStartPage.tsx → WFOStartPage/WFOListItemStartPage.tsx} +10 -7
  61. package/src/components/{StartPage/ListStartPage.stories.tsx → WFOStartPage/WFOListStartPage.stories.tsx} +4 -4
  62. package/src/components/{StartPage/ListStartPage.tsx → WFOStartPage/WFOListStartPage.tsx} +9 -4
  63. package/src/components/{StartPage/MultiListSection.stories.tsx → WFOStartPage/WFOMultiListSection.stories.tsx} +4 -4
  64. package/src/components/{StartPage/MultiListSection.tsx → WFOStartPage/WFOMultiListSection.tsx} +5 -5
  65. package/src/components/WFOStartPage/WFONewProcessPanel.stories.tsx +12 -0
  66. package/src/components/{StartPage/NewProcessPanel.tsx → WFOStartPage/WFONewProcessPanel.tsx} +3 -3
  67. package/src/components/WFOStartPage/WFOStatCards.stories.tsx +12 -0
  68. package/src/components/{StartPage/StatCards.tsx → WFOStartPage/WFOStatCards.tsx} +1 -1
  69. package/src/components/WFOStartPage/index.ts +6 -0
  70. package/src/components/{Subscription/FixedInputBlock.tsx → WFOSubscription/WFOFixedInputBlock.tsx} +2 -2
  71. package/src/components/{Subscription/ProcessesTimeline.tsx → WFOSubscription/WFOProcessesTimeline.tsx} +4 -4
  72. package/src/components/{Subscription/ProductBlock.tsx → WFOSubscription/WFOProductBlock.tsx} +4 -1
  73. package/src/components/{Subscription/SubscriptionActions.tsx → WFOSubscription/WFOSubscriptionActions.tsx} +1 -1
  74. package/src/components/{Subscription/SubscriptionBlock.tsx → WFOSubscription/WFOSubscriptionBlock.tsx} +5 -5
  75. package/src/components/{Subscription/SubscriptionDetailTree.tsx → WFOSubscription/WFOSubscriptionDetailTree.tsx} +5 -5
  76. package/src/components/{Subscription/SubscriptionGeneral.tsx → WFOSubscription/WFOSubscriptionGeneral.tsx} +9 -6
  77. package/src/components/WFOSubscription/index.ts +7 -0
  78. package/src/components/{Table/DataGridTable/DataGridTable.stories.tsx → WFOTable/WFODataGridTable/WFODataGridTable.stories.tsx} +6 -6
  79. package/src/components/{Table/DataGridTable/DataGridTable.tsx → WFOTable/WFODataGridTable/WFODataGridTable.tsx} +13 -13
  80. package/src/components/{Table/DataGridTable/dataGridColumns.spec.ts → WFOTable/WFODataGridTable/WFOdataGridColumns.spec.ts} +6 -6
  81. package/src/components/{Table/DataGridTable/dataGridColumns.ts → WFOTable/WFODataGridTable/WFOdataGridColumns.ts} +6 -6
  82. package/src/components/{Table/SortDirectionIcon.tsx → WFOTable/WFOSortDirectionIcon.tsx} +6 -6
  83. package/src/components/{Table/Table.tsx → WFOTable/WFOTable.tsx} +13 -13
  84. package/src/components/{Table/TableHeaderCell.tsx → WFOTable/WFOTableHeaderCell.tsx} +4 -4
  85. package/src/components/{Table/TableSettingsModal/TableSettingsModal.tsx → WFOTable/WFOTableSettingsModal/WFOTableSettingsModal.tsx} +1 -1
  86. package/src/components/WFOTable/WFOTableSettingsModal/index.ts +1 -0
  87. package/src/components/{Table/TableWithFilter/TableWithFilter.tsx → WFOTable/WFOTableWithFilter/WFOTableWithFilter.tsx} +31 -24
  88. package/src/components/WFOTable/WFOTableWithFilter/index.ts +1 -0
  89. package/src/components/WFOTable/index.ts +14 -0
  90. package/src/components/{Table → WFOTable}/utils/columns.ts +10 -10
  91. package/src/components/WFOTable/utils/constants.ts +15 -0
  92. package/src/components/{Tree/Tree.tsx → WFOTree/WFOTree.tsx} +4 -4
  93. package/src/components/{Tree/TreeBranch.tsx → WFOTree/WFOTreeBranch.tsx} +9 -5
  94. package/src/components/{Tree/TreeNode.tsx → WFOTree/WFOTreeNode.tsx} +6 -2
  95. package/src/components/index.ts +11 -11
  96. package/src/graphqlQueries/index.ts +2 -0
  97. package/src/graphqlQueries/processListQuery.ts +53 -0
  98. package/src/graphqlQueries/productBlocksQuery.ts +0 -5
  99. package/src/graphqlQueries/productsQuery.ts +47 -0
  100. package/src/graphqlQueries/resourceTypesQuery.ts +35 -0
  101. package/src/graphqlQueries/workflowsQuery.ts +37 -0
  102. package/src/hooks/useProcessStatusCountsQuery.ts +1 -0
  103. package/src/hooks/useSubscriptionProcesses.ts +2 -1
  104. package/src/icons/{ArrowNarrowDown.tsx → WFOArrowNarrowDown.tsx} +2 -2
  105. package/src/icons/{ArrowNarrowUp.tsx → WFOArrowNarrowUp.tsx} +2 -2
  106. package/src/icons/WFOCheckmarkCircleFill.stories.tsx +12 -0
  107. package/src/icons/{CheckmarkCircleFill.tsx → WFOCheckmarkCircleFill.tsx} +2 -2
  108. package/src/icons/{ChevronDown.tsx → WFOChevronDown.tsx} +2 -2
  109. package/src/icons/{IconProps.ts → WFOIconProps.ts} +1 -1
  110. package/src/icons/WFOLogoutIcon.stories.tsx +12 -0
  111. package/src/icons/{LogoutIcon.tsx → WFOLogoutIcon.tsx} +2 -2
  112. package/src/icons/WFOMinusCircleOutline.stories.tsx +12 -0
  113. package/src/icons/{MinusCircleOutline.tsx → WFOMinusCircleOutline.tsx} +2 -2
  114. package/src/icons/WFOPlusCircleFill.stories.tsx +12 -0
  115. package/src/icons/{PlusCircleFill.tsx → WFOPlusCircleFill.tsx} +2 -2
  116. package/src/icons/WFOStatusDotIcon.stories.tsx +12 -0
  117. package/src/icons/{StatusDotIcon.tsx → WFOStatusDotIcon.tsx} +2 -2
  118. package/src/icons/WFOXCircleFill.stories.tsx +12 -0
  119. package/src/icons/{XCircleFill.tsx → WFOXCircleFill.tsx} +2 -2
  120. package/src/icons/index.ts +10 -10
  121. package/src/messages/en-US.json +34 -2
  122. package/src/messages/nl-NL.json +67 -3
  123. package/src/pages/index.ts +2 -0
  124. package/src/pages/metadata/WFOMetadataPageLayout.tsx +0 -5
  125. package/src/pages/metadata/WFOProductBlocksPage.tsx +13 -16
  126. package/src/pages/metadata/WFOProductsPage.tsx +169 -0
  127. package/src/pages/metadata/WFOResourceTypesPage.tsx +120 -0
  128. package/src/pages/metadata/WFOWorkflowsPage.tsx +251 -0
  129. package/src/pages/metadata/index.ts +3 -0
  130. package/src/pages/processes/WFOProcessListPage.tsx +209 -0
  131. package/src/pages/processes/WFOProcessesListSubscriptionsCell.tsx +28 -0
  132. package/src/pages/processes/getProcessListTabTypeFromString.ts +19 -0
  133. package/src/pages/processes/index.ts +4 -0
  134. package/src/pages/processes/tabConfig.ts +33 -0
  135. package/src/pages/processes/tableConfig.ts +22 -0
  136. package/src/pages/subscriptions/index.ts +2 -0
  137. package/src/pages/subscriptions/subscriptionListTabs.ts +71 -0
  138. package/src/pages/subscriptions/types.ts +13 -0
  139. package/src/stories/Button.jsx +54 -0
  140. package/src/stories/Button.stories.js +45 -0
  141. package/src/stories/Configure.mdx +446 -0
  142. package/src/stories/Header.jsx +59 -0
  143. package/src/stories/Header.stories.js +23 -0
  144. package/src/stories/Page.jsx +68 -0
  145. package/src/stories/Page.stories.js +24 -0
  146. package/src/stories/assets/accessibility.png +0 -0
  147. package/src/stories/assets/accessibility.svg +5 -0
  148. package/src/stories/assets/addon-library.png +0 -0
  149. package/src/stories/assets/assets.png +0 -0
  150. package/src/stories/assets/context.png +0 -0
  151. package/src/stories/assets/discord.svg +15 -0
  152. package/src/stories/assets/docs.png +0 -0
  153. package/src/stories/assets/figma-plugin.png +0 -0
  154. package/src/stories/assets/github.svg +3 -0
  155. package/src/stories/assets/share.png +0 -0
  156. package/src/stories/assets/styling.png +0 -0
  157. package/src/stories/assets/testing.png +0 -0
  158. package/src/stories/assets/theming.png +0 -0
  159. package/src/stories/assets/tutorials.svg +12 -0
  160. package/src/stories/assets/youtube.svg +4 -0
  161. package/src/stories/button.css +30 -0
  162. package/src/stories/header.css +32 -0
  163. package/src/stories/page.css +69 -0
  164. package/src/types.ts +60 -11
  165. package/tsconfig.json +2 -4
  166. package/src/components/Badges/Badge/index.ts +0 -1
  167. package/src/components/Badges/EngineStatusBadge/index.ts +0 -1
  168. package/src/components/Badges/EnvironmentBadge/index.ts +0 -1
  169. package/src/components/Badges/FailedTasksBadge/FailedTasksBadge.stories.tsx +0 -12
  170. package/src/components/Badges/FailedTasksBadge/index.ts +0 -1
  171. package/src/components/Badges/HeaderBadge/index.ts +0 -1
  172. package/src/components/Badges/ProcessStatusBadge/ProcessStatusBadge.tsx +0 -46
  173. package/src/components/Badges/ProcessStatusBadge/index.ts +0 -1
  174. package/src/components/Badges/index.ts +0 -8
  175. package/src/components/Breadcrumbs/index.ts +0 -1
  176. package/src/components/Loading/Loading.tsx +0 -2
  177. package/src/components/Loading/index.ts +0 -1
  178. package/src/components/OrchestratorPageTemplate/OrchestratorPageHeader/index.ts +0 -1
  179. package/src/components/OrchestratorPageTemplate/OrchestratorPageTemplate/OrchestratorPageTemplate.stories.tsx +0 -33
  180. package/src/components/OrchestratorPageTemplate/OrchestratorPageTemplate/index.ts +0 -1
  181. package/src/components/OrchestratorPageTemplate/OrchestratorSidebar/index.ts +0 -1
  182. package/src/components/OrchestratorPageTemplate/index.ts +0 -3
  183. package/src/components/SearchBar/index.ts +0 -1
  184. package/src/components/SettingsModal/index.tsx +0 -1
  185. package/src/components/SettingsPage/index.ts +0 -1
  186. package/src/components/StartPage/NewProcessPanel.stories.tsx +0 -12
  187. package/src/components/StartPage/StatCards.stories.tsx +0 -12
  188. package/src/components/StartPage/index.ts +0 -6
  189. package/src/components/Subscription/index.ts +0 -7
  190. package/src/components/SubscriptionsTabs/SubscriptionsTabs.tsx +0 -90
  191. package/src/components/SubscriptionsTabs/getSubscriptionsTabTypeFromString.spec.ts +0 -34
  192. package/src/components/SubscriptionsTabs/getSubscriptionsTabTypeFromString.ts +0 -23
  193. package/src/components/SubscriptionsTabs/index.ts +0 -2
  194. package/src/components/Table/TableSettingsModal/index.ts +0 -1
  195. package/src/components/Table/TableWithFilter/index.ts +0 -1
  196. package/src/components/Table/index.ts +0 -14
  197. package/src/components/Table/utils/constants.ts +0 -5
  198. package/src/icons/CheckmarkCircleFill.stories.tsx +0 -12
  199. package/src/icons/LogoutIcon.stories.tsx +0 -12
  200. package/src/icons/MinusCircleOutline.stories.tsx +0 -12
  201. package/src/icons/PlusCircleFill.stories.tsx +0 -12
  202. package/src/icons/StatusDotIcon.stories.tsx +0 -12
  203. package/src/icons/XCircleFill.stories.tsx +0 -12
  204. /package/src/components/{Badges → WFOBadges}/WFOProductBlockBadge/index.ts +0 -0
  205. /package/src/components/{Badges → WFOBadges}/WFOStatusBadge/index.ts +0 -0
  206. /package/src/components/{SettingsModal/SettingsModal.tsx → WFOSettingsModal/WFOSettingsModal.tsx} +0 -0
  207. /package/src/components/{Subscription → WFOSubscription}/styles.ts +0 -0
  208. /package/src/components/{Table → WFOTable}/utils/columns.spec.ts +0 -0
  209. /package/src/components/{Table → WFOTable}/utils/tableConfigPersistence.spec.ts +0 -0
  210. /package/src/components/{Table → WFOTable}/utils/tableConfigPersistence.ts +0 -0
  211. /package/src/components/{Table → WFOTable}/utils/tableUtils.spec.ts +0 -0
  212. /package/src/components/{Table → WFOTable}/utils/tableUtils.ts +0 -0
@@ -2,15 +2,20 @@
2
2
  "main": {
3
3
  "title": "Welcome to example-orchestrator-ui!"
4
4
  },
5
+ "common": {
6
+ "addToFavorites": "Favoriet",
7
+ "product": "Produkt",
8
+ "deselect": "Deselecteer",
9
+ "close": "Sluiten"
10
+ },
5
11
  "metadata": {
6
12
  "tabs": {
7
13
  "products": "Producten",
8
14
  "productBlocks": "Productblokken",
9
15
  "resourceTypes": "Resource types",
10
- "fixedInputs": "Vaste inputs",
11
16
  "workflows": "Workflows"
12
17
  },
13
- "product": {
18
+ "products": {
14
19
  "name": "Naam",
15
20
  "description": "Beschrijving",
16
21
  "tag": "Tag",
@@ -18,6 +23,48 @@
18
23
  "status": "Status",
19
24
  "productBlocks": "Product blocks",
20
25
  "createdAt": "Aangemaakt"
26
+ },
27
+ "productBlocks": {
28
+ "id": "ID",
29
+ "name": "Naam",
30
+ "description": "Beschrijving",
31
+ "tag": "Tag",
32
+ "status": "Status",
33
+ "resourceTypes": "Resource types",
34
+ "createdAt": "Aangemaakt",
35
+ "endDate": "Eind datum",
36
+ "parentIds": "Parents"
37
+ },
38
+ "resourceTypes": {
39
+ "type": "Type",
40
+ "description": "Description",
41
+ "resourceId": "Resource ID"
42
+ },
43
+ "workflows": {
44
+ "name": "Naam",
45
+ "description": "Beschrijving",
46
+ "target": "Target",
47
+ "productTags": "Product Tags",
48
+ "createdAt": "Aangemaakt"
49
+ }
50
+ },
51
+ "processes": {
52
+ "tabs": {
53
+ "active": "Actief",
54
+ "completed": "Voltooid"
55
+ },
56
+ "index": {
57
+ "workflowName": "Workflow naam",
58
+ "lastStep": "Laatste stap",
59
+ "status": "Status",
60
+ "product": "Product",
61
+ "customer": "Klant",
62
+ "subscriptions": "Subscriptions",
63
+ "createdBy": "Gecreëerd door",
64
+ "assignee": "Assignee",
65
+ "id": "ID",
66
+ "started": "Gestart",
67
+ "lastModified": "Aangepast op"
21
68
  }
22
69
  },
23
70
  "subscriptions": {
@@ -44,7 +91,24 @@
44
91
  "serviceConfiguration": "Service configuratie",
45
92
  "processes": "Processen",
46
93
  "relatedSubscriptions": "Geralateerde subscriptions"
47
- }
94
+ },
95
+ "loadingStatus": "Loading status",
96
+ "workflow": {
97
+ "create": "Create workflow",
98
+ "modify": "Modify workflow",
99
+ "system": "System workflow",
100
+ "terminate": "Terminate workflow"
101
+ },
102
+ "subscriptionDetails": "Subscription details",
103
+ "fixedInputs": "Fixed inputs",
104
+ "productInfo": "Product info",
105
+ "noProductBlockSelected": "No product block selected",
106
+ "productBlocks": "Product blocks",
107
+ "ctaSelectProductBlock": "Select one or more product blocks to view their details",
108
+ "startedBy": "Started by",
109
+ "startedAt": "Started at",
110
+ "status": "Status",
111
+ "id": "ID"
48
112
  }
49
113
  }
50
114
  }
@@ -1 +1,3 @@
1
1
  export * from './metadata';
2
+ export * from './processes';
3
+ export * from './subscriptions';
@@ -31,11 +31,6 @@ const metaDataTabs: MetaDataTab[] = [
31
31
  translationKey: 'resourceTypes',
32
32
  path: '/metadata/resource-types',
33
33
  },
34
- {
35
- id: 4,
36
- translationKey: 'fixedInputs',
37
- path: '/metadata/fixed-inputs',
38
- },
39
34
  {
40
35
  id: 5,
41
36
  translationKey: 'workflows',
@@ -10,7 +10,7 @@ import {
10
10
  import {
11
11
  WFOStatusBadge,
12
12
  WFOProductBlockBadge,
13
- TableWithFilter,
13
+ WFOTableWithFilter,
14
14
  } from '../../components';
15
15
  import {
16
16
  getTableConfigFromLocalStorage,
@@ -18,7 +18,7 @@ import {
18
18
  getPageChangeHandler,
19
19
  getEsQueryStringHandler,
20
20
  } from '../../components';
21
- import type { TableColumns, DataSorting } from '../../components';
21
+ import type { WFOTableColumns, WFODataSorting } from '../../components';
22
22
 
23
23
  import { parseDateToLocaleString } from '../../utils';
24
24
  import type { ProductBlockDefinition } from '../../types';
@@ -30,20 +30,17 @@ import { GET_PRODUCTS_BLOCKS_GRAPHQL_QUERY } from '../../graphqlQueries';
30
30
 
31
31
  import { WFOMetadataPageLayout } from './WFOMetadataPageLayout';
32
32
 
33
- export const PRODUCT_BLOCK_FIELD_ID: keyof ProductBlockDefinition =
34
- 'productBlockId';
35
- export const PRODUCT_BLOCK_FIELD_NAME: keyof ProductBlockDefinition = 'name';
33
+ const PRODUCT_BLOCK_FIELD_ID: keyof ProductBlockDefinition = 'productBlockId';
34
+ const PRODUCT_BLOCK_FIELD_NAME: keyof ProductBlockDefinition = 'name';
36
35
 
37
- export const PRODUCT_BLOCK_FIELD_TAG: keyof ProductBlockDefinition = 'tag';
38
- export const PRODUCT_BLOCK_FIELD_DESCRIPTION: keyof ProductBlockDefinition =
36
+ const PRODUCT_BLOCK_FIELD_TAG: keyof ProductBlockDefinition = 'tag';
37
+ const PRODUCT_BLOCK_FIELD_DESCRIPTION: keyof ProductBlockDefinition =
39
38
  'description';
40
- export const PRODUCT_BLOCK_FIELD_STATUS: keyof ProductBlockDefinition =
41
- 'status';
42
- export const PRODUCT_BLOCK_FIELD_CREATED_AT: keyof ProductBlockDefinition =
39
+ const PRODUCT_BLOCK_FIELD_STATUS: keyof ProductBlockDefinition = 'status';
40
+ const PRODUCT_BLOCK_FIELD_CREATED_AT: keyof ProductBlockDefinition =
43
41
  'createdAt';
44
- export const PRODUCT_BLOCK_FIELD_END_DATE: keyof ProductBlockDefinition =
45
- 'endDate';
46
- export const PRODUCT_BLOCK_FIELD_RESOURCE_TYPES: keyof ProductBlockDefinition =
42
+ const PRODUCT_BLOCK_FIELD_END_DATE: keyof ProductBlockDefinition = 'endDate';
43
+ const PRODUCT_BLOCK_FIELD_RESOURCE_TYPES: keyof ProductBlockDefinition =
47
44
  'resourceTypes';
48
45
 
49
46
  export const WFOProductBlocksPage = () => {
@@ -63,7 +60,7 @@ export const WFOProductBlocksPage = () => {
63
60
  },
64
61
  });
65
62
 
66
- const tableColumns: TableColumns<ProductBlockDefinition> = {
63
+ const tableColumns: WFOTableColumns<ProductBlockDefinition> = {
67
64
  productBlockId: {
68
65
  field: PRODUCT_BLOCK_FIELD_ID,
69
66
  name: t('id'),
@@ -127,7 +124,7 @@ export const WFOProductBlocksPage = () => {
127
124
  true,
128
125
  );
129
126
 
130
- const dataSorting: DataSorting<ProductBlockDefinition> = {
127
+ const dataSorting: WFODataSorting<ProductBlockDefinition> = {
131
128
  field: dataDisplayParams.sortBy?.field ?? PRODUCT_BLOCK_FIELD_NAME,
132
129
  sortOrder: dataDisplayParams.sortBy?.order ?? SortOrder.ASC,
133
130
  };
@@ -143,7 +140,7 @@ export const WFOProductBlocksPage = () => {
143
140
 
144
141
  return (
145
142
  <WFOMetadataPageLayout>
146
- <TableWithFilter<ProductBlockDefinition>
143
+ <WFOTableWithFilter<ProductBlockDefinition>
147
144
  data={data ? data.productBlocks.page : []}
148
145
  tableColumns={tableColumns}
149
146
  dataSorting={dataSorting}
@@ -0,0 +1,169 @@
1
+ import React from 'react';
2
+ import { useTranslations } from 'next-intl';
3
+ import type { Pagination } from '@elastic/eui/src/components';
4
+
5
+ import {
6
+ DEFAULT_PAGE_SIZE,
7
+ DEFAULT_PAGE_SIZES,
8
+ METADATA_PRODUCT_TABLE_LOCAL_STORAGE_KEY,
9
+ } from '../../components';
10
+ import {
11
+ WFOStatusBadge,
12
+ WFOProductBlockBadge,
13
+ WFOTableWithFilter,
14
+ } from '../../components';
15
+ import {
16
+ getTableConfigFromLocalStorage,
17
+ getDataSortHandler,
18
+ getPageChangeHandler,
19
+ getEsQueryStringHandler,
20
+ } from '../../components';
21
+ import type { WFOTableColumns, WFODataSorting } from '../../components';
22
+
23
+ import type { ProductDefinition } from '../../types';
24
+ import { SortOrder } from '../../types';
25
+
26
+ import { useDataDisplayParams, useQueryWithGraphql } from '../../hooks';
27
+
28
+ import { GET_PRODUCTS_GRAPHQL_QUERY } from '../../graphqlQueries';
29
+
30
+ import { WFOMetadataPageLayout } from './WFOMetadataPageLayout';
31
+
32
+ const PRODUCT_FIELD_PRODUCT_ID: keyof ProductDefinition = 'productId';
33
+ const PRODUCT_FIELD_NAME: keyof ProductDefinition = 'name';
34
+ const PRODUCT_FIELD_DESCRIPTION: keyof ProductDefinition = 'description';
35
+ const PRODUCT_FIELD_TAG: keyof ProductDefinition = 'tag';
36
+ const PRODUCT_FIELD_PRODUCT_TYPE: keyof ProductDefinition = 'productType';
37
+ const PRODUCT_FIELD_STATUS: keyof ProductDefinition = 'status';
38
+ const PRODUCT_FIELD_PRODUCT_BLOCKS: keyof ProductDefinition = 'productBlocks';
39
+ const PRODUCT_FIELD_FIXED_INPUTS: keyof ProductDefinition = 'fixedInputs';
40
+ const PRODUCT_FIELD_CREATED_AT: keyof ProductDefinition = 'createdAt';
41
+
42
+ export const WFOProductsPage = () => {
43
+ const t = useTranslations('metadata.products');
44
+
45
+ const initialPageSize =
46
+ getTableConfigFromLocalStorage(METADATA_PRODUCT_TABLE_LOCAL_STORAGE_KEY)
47
+ ?.selectedPageSize ?? DEFAULT_PAGE_SIZE;
48
+
49
+ const { dataDisplayParams, setDataDisplayParam } =
50
+ useDataDisplayParams<ProductDefinition>({
51
+ pageSize: initialPageSize,
52
+ sortBy: {
53
+ field: PRODUCT_FIELD_NAME,
54
+ order: SortOrder.ASC,
55
+ },
56
+ });
57
+
58
+ const tableColumns: WFOTableColumns<ProductDefinition> = {
59
+ productId: {
60
+ field: PRODUCT_FIELD_PRODUCT_ID,
61
+ name: t('id'),
62
+ width: '110',
63
+ },
64
+ name: {
65
+ field: PRODUCT_FIELD_NAME,
66
+ name: t('name'),
67
+ width: '110',
68
+ },
69
+ description: {
70
+ field: PRODUCT_FIELD_DESCRIPTION,
71
+ name: t('description'),
72
+ width: '400',
73
+ },
74
+ tag: {
75
+ field: PRODUCT_FIELD_TAG,
76
+ name: t('tag'),
77
+ },
78
+ productType: {
79
+ field: PRODUCT_FIELD_PRODUCT_TYPE,
80
+ name: t('productType'),
81
+ },
82
+ status: {
83
+ field: PRODUCT_FIELD_STATUS,
84
+ name: t('status'),
85
+ width: '90',
86
+ render: (value) => (
87
+ <WFOStatusBadge status={value.toLocaleLowerCase()} />
88
+ ),
89
+ },
90
+ productBlocks: {
91
+ field: PRODUCT_FIELD_PRODUCT_BLOCKS,
92
+ name: t('productBlocks'),
93
+ render: (productBlocks) => (
94
+ <>
95
+ {productBlocks.map((block, index) => (
96
+ <WFOProductBlockBadge key={index}>
97
+ {block.name}
98
+ </WFOProductBlockBadge>
99
+ ))}
100
+ </>
101
+ ),
102
+ },
103
+ fixedInputs: {
104
+ field: PRODUCT_FIELD_FIXED_INPUTS,
105
+ name: t('fixedInputs'),
106
+ render: (fixedInputs) => (
107
+ <>
108
+ {fixedInputs.map((fixedInput, index) => (
109
+ <WFOProductBlockBadge key={index}>
110
+ {`${fixedInput.name}: ${fixedInput.value}`}
111
+ </WFOProductBlockBadge>
112
+ ))}
113
+ </>
114
+ ),
115
+ },
116
+ createdAt: {
117
+ field: PRODUCT_FIELD_CREATED_AT,
118
+ name: t('createdAt'),
119
+ },
120
+ };
121
+
122
+ const { data, isFetching } = useQueryWithGraphql(
123
+ GET_PRODUCTS_GRAPHQL_QUERY,
124
+ {
125
+ first: dataDisplayParams.pageSize,
126
+ after: dataDisplayParams.pageIndex * dataDisplayParams.pageSize,
127
+ sortBy: dataDisplayParams.sortBy,
128
+ },
129
+ 'products',
130
+ true,
131
+ );
132
+ const totalItems = data?.products.pageInfo.totalItems;
133
+
134
+ const pagination: Pagination = {
135
+ pageSize: dataDisplayParams.pageSize,
136
+ pageIndex: dataDisplayParams.pageIndex,
137
+ pageSizeOptions: DEFAULT_PAGE_SIZES,
138
+ totalItemCount: totalItems ? totalItems : 0,
139
+ };
140
+
141
+ const dataSorting: WFODataSorting<ProductDefinition> = {
142
+ field: dataDisplayParams.sortBy?.field ?? PRODUCT_FIELD_NAME,
143
+ sortOrder: dataDisplayParams.sortBy?.order ?? SortOrder.ASC,
144
+ };
145
+
146
+ return (
147
+ <WFOMetadataPageLayout>
148
+ <WFOTableWithFilter<ProductDefinition>
149
+ data={data ? data.products.page : []}
150
+ tableColumns={tableColumns}
151
+ dataSorting={dataSorting}
152
+ onUpdateDataSort={getDataSortHandler<ProductDefinition>(
153
+ dataDisplayParams,
154
+ setDataDisplayParam,
155
+ )}
156
+ onUpdatePage={getPageChangeHandler<ProductDefinition>(
157
+ setDataDisplayParam,
158
+ )}
159
+ onUpdateEsQueryString={getEsQueryStringHandler<ProductDefinition>(
160
+ setDataDisplayParam,
161
+ )}
162
+ pagination={pagination}
163
+ isLoading={isFetching}
164
+ esQueryString={dataDisplayParams.esQueryString}
165
+ localStorageKey={METADATA_PRODUCT_TABLE_LOCAL_STORAGE_KEY}
166
+ />
167
+ </WFOMetadataPageLayout>
168
+ );
169
+ };
@@ -0,0 +1,120 @@
1
+ import React from 'react';
2
+ import { useTranslations } from 'next-intl';
3
+ import type { Pagination } from '@elastic/eui/src/components';
4
+
5
+ import {
6
+ DEFAULT_PAGE_SIZE,
7
+ DEFAULT_PAGE_SIZES,
8
+ METADATA_RESOURCE_TYPES_TABLE_LOCAL_STORAGE_KEY,
9
+ } from '../../components';
10
+ import { WFOTableWithFilter } from '../../components';
11
+ import {
12
+ getTableConfigFromLocalStorage,
13
+ getDataSortHandler,
14
+ getPageChangeHandler,
15
+ getEsQueryStringHandler,
16
+ } from '../../components';
17
+ import type { WFOTableColumns, WFODataSorting } from '../../components';
18
+
19
+ import type { ResourceTypeDefinition } from '../../types';
20
+ import { SortOrder } from '../../types';
21
+
22
+ import { useDataDisplayParams, useQueryWithGraphql } from '../../hooks';
23
+
24
+ import { GET_RESOURCE_TYPES_GRAPHQL_QUERY } from '../../graphqlQueries';
25
+
26
+ import { WFOMetadataPageLayout } from './WFOMetadataPageLayout';
27
+
28
+ export const RESOURCE_TYPE_FIELD_ID: keyof ResourceTypeDefinition =
29
+ 'resourceTypeId';
30
+ export const RESOURCE_TYPE_FIELD_TYPE: keyof ResourceTypeDefinition =
31
+ 'resourceType';
32
+ export const RESOURCE_TYPE_FIELD_DESCRIPTION: keyof ResourceTypeDefinition =
33
+ 'description';
34
+
35
+ export const WFOResourceTypesPage = () => {
36
+ const t = useTranslations('metadata.resourceTypes');
37
+
38
+ const initialPageSize =
39
+ getTableConfigFromLocalStorage(
40
+ METADATA_RESOURCE_TYPES_TABLE_LOCAL_STORAGE_KEY,
41
+ )?.selectedPageSize ?? DEFAULT_PAGE_SIZE;
42
+
43
+ const { dataDisplayParams, setDataDisplayParam } =
44
+ useDataDisplayParams<ResourceTypeDefinition>({
45
+ pageSize: initialPageSize,
46
+ sortBy: {
47
+ field: RESOURCE_TYPE_FIELD_TYPE,
48
+ order: SortOrder.ASC,
49
+ },
50
+ });
51
+
52
+ const tableColumns: WFOTableColumns<ResourceTypeDefinition> = {
53
+ resourceType: {
54
+ field: RESOURCE_TYPE_FIELD_TYPE,
55
+ name: t('type'),
56
+ width: '110',
57
+ },
58
+ description: {
59
+ field: RESOURCE_TYPE_FIELD_DESCRIPTION,
60
+ name: t('description'),
61
+ width: '400',
62
+ },
63
+ resourceTypeId: {
64
+ field: RESOURCE_TYPE_FIELD_ID,
65
+ name: t('resourceId'),
66
+ width: '110',
67
+ },
68
+ };
69
+
70
+ const { data, isFetching } = useQueryWithGraphql(
71
+ GET_RESOURCE_TYPES_GRAPHQL_QUERY,
72
+ {
73
+ first: dataDisplayParams.pageSize,
74
+ after: dataDisplayParams.pageIndex * dataDisplayParams.pageSize,
75
+ sortBy: dataDisplayParams.sortBy,
76
+ },
77
+ 'resourceTypes',
78
+ true,
79
+ );
80
+
81
+ const dataSorting: WFODataSorting<ResourceTypeDefinition> = {
82
+ field: dataDisplayParams.sortBy?.field ?? RESOURCE_TYPE_FIELD_TYPE,
83
+ sortOrder: dataDisplayParams.sortBy?.order ?? SortOrder.ASC,
84
+ };
85
+
86
+ const totalItems = data?.resourceTypes.pageInfo.totalItems;
87
+
88
+ const pagination: Pagination = {
89
+ pageSize: dataDisplayParams.pageSize,
90
+ pageIndex: dataDisplayParams.pageIndex,
91
+ pageSizeOptions: DEFAULT_PAGE_SIZES,
92
+ totalItemCount: totalItems ? totalItems : 0,
93
+ };
94
+
95
+ return (
96
+ <WFOMetadataPageLayout>
97
+ <WFOTableWithFilter<ResourceTypeDefinition>
98
+ data={data ? data.resourceTypes.page : []}
99
+ tableColumns={tableColumns}
100
+ dataSorting={dataSorting}
101
+ onUpdateDataSort={getDataSortHandler<ResourceTypeDefinition>(
102
+ dataDisplayParams,
103
+ setDataDisplayParam,
104
+ )}
105
+ onUpdatePage={getPageChangeHandler<ResourceTypeDefinition>(
106
+ setDataDisplayParam,
107
+ )}
108
+ onUpdateEsQueryString={getEsQueryStringHandler<ResourceTypeDefinition>(
109
+ setDataDisplayParam,
110
+ )}
111
+ pagination={pagination}
112
+ isLoading={isFetching}
113
+ esQueryString={dataDisplayParams.esQueryString}
114
+ localStorageKey={
115
+ METADATA_RESOURCE_TYPES_TABLE_LOCAL_STORAGE_KEY
116
+ }
117
+ />
118
+ </WFOMetadataPageLayout>
119
+ );
120
+ };