@finos/legend-application-marketplace 0.0.19 → 0.0.21

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 (248) hide show
  1. package/lib/__lib__/LegendMarketplaceNavigation.d.ts +3 -0
  2. package/lib/__lib__/LegendMarketplaceNavigation.d.ts.map +1 -1
  3. package/lib/__lib__/LegendMarketplaceNavigation.js +11 -1
  4. package/lib/__lib__/LegendMarketplaceNavigation.js.map +1 -1
  5. package/lib/app.css +2 -2
  6. package/lib/app.css.map +1 -1
  7. package/lib/application/LegendMarketplaceApplicationConfig.d.ts +10 -0
  8. package/lib/application/LegendMarketplaceApplicationConfig.d.ts.map +1 -1
  9. package/lib/application/LegendMarketplaceApplicationConfig.js +10 -0
  10. package/lib/application/LegendMarketplaceApplicationConfig.js.map +1 -1
  11. package/lib/application/LegendMarketplaceFrameworkProvider.d.ts.map +1 -1
  12. package/lib/application/LegendMarketplaceFrameworkProvider.js +2 -2
  13. package/lib/application/LegendMarketplaceFrameworkProvider.js.map +1 -1
  14. package/lib/application/LegendMarketplaceWebApplication.d.ts.map +1 -1
  15. package/lib/application/LegendMarketplaceWebApplication.js +18 -8
  16. package/lib/application/LegendMarketplaceWebApplication.js.map +1 -1
  17. package/lib/components/DataProductCard/LegendMarketplaceDataProductSearchCard.d.ts.map +1 -1
  18. package/lib/components/DataProductCard/LegendMarketplaceDataProductSearchCard.js +6 -3
  19. package/lib/components/DataProductCard/LegendMarketplaceDataProductSearchCard.js.map +1 -1
  20. package/lib/components/DataProductCard/LegendMarketplaceLightDataProductCard.d.ts.map +1 -1
  21. package/lib/components/DataProductCard/LegendMarketplaceLightDataProductCard.js +9 -6
  22. package/lib/components/DataProductCard/LegendMarketplaceLightDataProductCard.js.map +1 -1
  23. package/lib/components/{Lakehouse/LakehouseHeader.d.ts → Header/MarketplaceLakehouseHeader.d.ts} +2 -2
  24. package/lib/components/Header/MarketplaceLakehouseHeader.d.ts.map +1 -0
  25. package/lib/components/{Lakehouse/LakehouseHeader.js → Header/MarketplaceLakehouseHeader.js} +8 -4
  26. package/lib/components/Header/MarketplaceLakehouseHeader.js.map +1 -0
  27. package/lib/components/MarketplaceCard/LegendMarketplaceCard.d.ts +25 -0
  28. package/lib/components/MarketplaceCard/LegendMarketplaceCard.d.ts.map +1 -0
  29. package/lib/components/MarketplaceCard/LegendMarketplaceCard.js +32 -0
  30. package/lib/components/MarketplaceCard/LegendMarketplaceCard.js.map +1 -0
  31. package/lib/components/ProviderCard/LegendMarketplaceProviderCard.d.ts.map +1 -1
  32. package/lib/components/ProviderCard/LegendMarketplaceProviderCard.js +6 -3
  33. package/lib/components/ProviderCard/LegendMarketplaceProviderCard.js.map +1 -1
  34. package/lib/components/__test-utils__/LegendMarketplaceStoreTestUtils.d.ts.map +1 -1
  35. package/lib/components/__test-utils__/LegendMarketplaceStoreTestUtils.js +3 -6
  36. package/lib/components/__test-utils__/LegendMarketplaceStoreTestUtils.js.map +1 -1
  37. package/lib/index.css +2 -2
  38. package/lib/index.css.map +1 -1
  39. package/lib/package.json +2 -1
  40. package/lib/pages/Home/LegendMarketplaceHome.d.ts.map +1 -1
  41. package/lib/pages/Home/LegendMarketplaceHome.js +4 -4
  42. package/lib/pages/Home/LegendMarketplaceHome.js.map +1 -1
  43. package/lib/pages/Lakehouse/DataProductDataAccess.d.ts.map +1 -0
  44. package/lib/{components → pages}/Lakehouse/DataProductDataAccess.js +41 -9
  45. package/lib/pages/Lakehouse/DataProductDataAccess.js.map +1 -0
  46. package/lib/pages/Lakehouse/DataProductHolder.d.ts.map +1 -0
  47. package/lib/pages/Lakehouse/DataProductHolder.js.map +1 -0
  48. package/lib/pages/Lakehouse/DataProductViewer.d.ts.map +1 -0
  49. package/lib/pages/Lakehouse/DataProductViewer.js.map +1 -0
  50. package/lib/pages/Lakehouse/DataProductViewerActivityBar.d.ts.map +1 -0
  51. package/lib/pages/Lakehouse/DataProductViewerActivityBar.js.map +1 -0
  52. package/lib/pages/Lakehouse/DataProductWiki.d.ts.map +1 -0
  53. package/lib/pages/Lakehouse/DataProductWiki.js.map +1 -0
  54. package/lib/pages/Lakehouse/LakehouseDataProduct.d.ts.map +1 -0
  55. package/lib/{components → pages}/Lakehouse/LakehouseDataProduct.js +3 -3
  56. package/lib/pages/Lakehouse/LakehouseDataProduct.js.map +1 -0
  57. package/lib/{components/Lakehouse/LakehouseMarketplace.d.ts → pages/Lakehouse/MarketplaceLakehouseHome.d.ts} +2 -2
  58. package/lib/pages/Lakehouse/MarketplaceLakehouseHome.d.ts.map +1 -0
  59. package/lib/pages/Lakehouse/MarketplaceLakehouseHome.js +54 -0
  60. package/lib/pages/Lakehouse/MarketplaceLakehouseHome.js.map +1 -0
  61. package/lib/{components/Lakehouse/MarketLakehouseStoreProvider.d.ts → pages/Lakehouse/MarketplaceLakehouseStoreProvider.d.ts} +1 -1
  62. package/lib/pages/Lakehouse/MarketplaceLakehouseStoreProvider.d.ts.map +1 -0
  63. package/lib/{components/Lakehouse/MarketLakehouseStoreProvider.js → pages/Lakehouse/MarketplaceLakehouseStoreProvider.js} +1 -1
  64. package/lib/pages/Lakehouse/MarketplaceLakehouseStoreProvider.js.map +1 -0
  65. package/lib/{components/Lakehouse/entitlements/LakehouseEntitlements.d.ts → pages/Lakehouse/entitlements/EntitlementsDashboard.d.ts} +6 -5
  66. package/lib/pages/Lakehouse/entitlements/EntitlementsDashboard.d.ts.map +1 -0
  67. package/lib/pages/Lakehouse/entitlements/EntitlementsDashboard.js +194 -0
  68. package/lib/pages/Lakehouse/entitlements/EntitlementsDashboard.js.map +1 -0
  69. package/lib/pages/Lakehouse/entitlements/EntitlementsDataContractCreator.d.ts +24 -0
  70. package/lib/pages/Lakehouse/entitlements/EntitlementsDataContractCreator.d.ts.map +1 -0
  71. package/lib/pages/Lakehouse/entitlements/EntitlementsDataContractCreator.js +38 -0
  72. package/lib/pages/Lakehouse/entitlements/EntitlementsDataContractCreator.js.map +1 -0
  73. package/lib/pages/Lakehouse/entitlements/EntitlementsDataContractViewer.d.ts +22 -0
  74. package/lib/pages/Lakehouse/entitlements/EntitlementsDataContractViewer.d.ts.map +1 -0
  75. package/lib/pages/Lakehouse/entitlements/EntitlementsDataContractViewer.js +23 -0
  76. package/lib/pages/Lakehouse/entitlements/EntitlementsDataContractViewer.js.map +1 -0
  77. package/lib/pages/Lakehouse/entitlements/EntitlementsTaskViewer.d.ts +21 -0
  78. package/lib/pages/Lakehouse/entitlements/EntitlementsTaskViewer.d.ts.map +1 -0
  79. package/lib/pages/Lakehouse/entitlements/EntitlementsTaskViewer.js +32 -0
  80. package/lib/pages/Lakehouse/entitlements/EntitlementsTaskViewer.js.map +1 -0
  81. package/lib/pages/Lakehouse/entitlements/LakehouseEntitlements.d.ts +17 -0
  82. package/lib/pages/Lakehouse/entitlements/LakehouseEntitlements.d.ts.map +1 -0
  83. package/lib/pages/Lakehouse/entitlements/LakehouseEntitlements.js +55 -0
  84. package/lib/pages/Lakehouse/entitlements/LakehouseEntitlements.js.map +1 -0
  85. package/lib/pages/Lakehouse/entitlements/LakehouseEntitlementsStoreProvider.d.ts.map +1 -0
  86. package/lib/pages/Lakehouse/entitlements/LakehouseEntitlementsStoreProvider.js.map +1 -0
  87. package/lib/pages/Lakehouse/shared/GridItemViewer.d.ts +21 -0
  88. package/lib/pages/Lakehouse/shared/GridItemViewer.d.ts.map +1 -0
  89. package/lib/pages/Lakehouse/shared/GridItemViewer.js +46 -0
  90. package/lib/pages/Lakehouse/shared/GridItemViewer.js.map +1 -0
  91. package/lib/pages/Lakehouse/subscriptions/LakehouseSubscriptions.d.ts +29 -0
  92. package/lib/pages/Lakehouse/subscriptions/LakehouseSubscriptions.d.ts.map +1 -0
  93. package/lib/pages/Lakehouse/subscriptions/LakehouseSubscriptions.js +152 -0
  94. package/lib/pages/Lakehouse/subscriptions/LakehouseSubscriptions.js.map +1 -0
  95. package/lib/pages/Lakehouse/subscriptions/LakehouseSubscriptionsStoreProvider.d.ts +22 -0
  96. package/lib/pages/Lakehouse/subscriptions/LakehouseSubscriptionsStoreProvider.d.ts.map +1 -0
  97. package/lib/pages/Lakehouse/subscriptions/LakehouseSubscriptionsStoreProvider.js +34 -0
  98. package/lib/pages/Lakehouse/subscriptions/LakehouseSubscriptionsStoreProvider.js.map +1 -0
  99. package/lib/pages/LegendMarketplacePage.d.ts +23 -0
  100. package/lib/pages/LegendMarketplacePage.d.ts.map +1 -0
  101. package/lib/pages/LegendMarketplacePage.js +23 -0
  102. package/lib/pages/LegendMarketplacePage.js.map +1 -0
  103. package/lib/pages/SearchResults/LegendMarketplaceSearchResults.d.ts.map +1 -1
  104. package/lib/pages/SearchResults/LegendMarketplaceSearchResults.js +13 -13
  105. package/lib/pages/SearchResults/LegendMarketplaceSearchResults.js.map +1 -1
  106. package/lib/pages/VendorData/LegendMarketplaceVendorData.d.ts.map +1 -1
  107. package/lib/pages/VendorData/LegendMarketplaceVendorData.js +6 -6
  108. package/lib/pages/VendorData/LegendMarketplaceVendorData.js.map +1 -1
  109. package/lib/stores/LakehouseContractServerClient.d.ts +11 -4
  110. package/lib/stores/LakehouseContractServerClient.d.ts.map +1 -1
  111. package/lib/stores/LakehouseContractServerClient.js +21 -3
  112. package/lib/stores/LakehouseContractServerClient.js.map +1 -1
  113. package/lib/stores/LegendMarketplaceBaseStore.d.ts +3 -0
  114. package/lib/stores/LegendMarketplaceBaseStore.d.ts.map +1 -1
  115. package/lib/stores/LegendMarketplaceBaseStore.js +8 -1
  116. package/lib/stores/LegendMarketplaceBaseStore.js.map +1 -1
  117. package/lib/stores/lakehouse/DataProductDataAccessState.d.ts +6 -7
  118. package/lib/stores/lakehouse/DataProductDataAccessState.d.ts.map +1 -1
  119. package/lib/stores/lakehouse/DataProductDataAccessState.js +47 -48
  120. package/lib/stores/lakehouse/DataProductDataAccessState.js.map +1 -1
  121. package/lib/stores/lakehouse/DataProductViewerState.d.ts +7 -3
  122. package/lib/stores/lakehouse/DataProductViewerState.d.ts.map +1 -1
  123. package/lib/stores/lakehouse/DataProductViewerState.js +51 -22
  124. package/lib/stores/lakehouse/DataProductViewerState.js.map +1 -1
  125. package/lib/stores/lakehouse/LakehouseUtils.d.ts +50 -0
  126. package/lib/stores/lakehouse/LakehouseUtils.d.ts.map +1 -0
  127. package/lib/stores/lakehouse/LakehouseUtils.js +267 -0
  128. package/lib/stores/lakehouse/LakehouseUtils.js.map +1 -0
  129. package/lib/stores/lakehouse/MarketplaceLakehouseStore.d.ts.map +1 -1
  130. package/lib/stores/lakehouse/MarketplaceLakehouseStore.js +9 -4
  131. package/lib/stores/lakehouse/MarketplaceLakehouseStore.js.map +1 -1
  132. package/lib/stores/lakehouse/entitlements/EntitlementsDashboardState.d.ts +31 -0
  133. package/lib/stores/lakehouse/entitlements/EntitlementsDashboardState.d.ts.map +1 -0
  134. package/lib/stores/lakehouse/entitlements/EntitlementsDashboardState.js +110 -0
  135. package/lib/stores/lakehouse/entitlements/EntitlementsDashboardState.js.map +1 -0
  136. package/lib/stores/lakehouse/entitlements/EntitlementsDataContractViewerState.d.ts +30 -0
  137. package/lib/stores/lakehouse/entitlements/EntitlementsDataContractViewerState.d.ts.map +1 -0
  138. package/lib/stores/lakehouse/entitlements/EntitlementsDataContractViewerState.js +65 -0
  139. package/lib/stores/lakehouse/entitlements/EntitlementsDataContractViewerState.js.map +1 -0
  140. package/lib/stores/lakehouse/entitlements/EntitlementsTaskViewerState.d.ts +41 -0
  141. package/lib/stores/lakehouse/entitlements/EntitlementsTaskViewerState.d.ts.map +1 -0
  142. package/lib/stores/lakehouse/entitlements/EntitlementsTaskViewerState.js +146 -0
  143. package/lib/stores/lakehouse/entitlements/EntitlementsTaskViewerState.js.map +1 -0
  144. package/lib/stores/lakehouse/entitlements/LakehouseEntitlementsStore.d.ts +10 -32
  145. package/lib/stores/lakehouse/entitlements/LakehouseEntitlementsStore.d.ts.map +1 -1
  146. package/lib/stores/lakehouse/entitlements/LakehouseEntitlementsStore.js +49 -163
  147. package/lib/stores/lakehouse/entitlements/LakehouseEntitlementsStore.js.map +1 -1
  148. package/lib/stores/lakehouse/entitlements/LakehouseViewerState.d.ts +23 -0
  149. package/lib/stores/lakehouse/entitlements/LakehouseViewerState.d.ts.map +1 -0
  150. package/lib/stores/lakehouse/entitlements/LakehouseViewerState.js +24 -0
  151. package/lib/stores/lakehouse/entitlements/LakehouseViewerState.js.map +1 -0
  152. package/lib/stores/lakehouse/subscriptions/LakehouseSubscriptionsStore.d.ts +30 -0
  153. package/lib/stores/lakehouse/subscriptions/LakehouseSubscriptionsStore.d.ts.map +1 -0
  154. package/lib/stores/lakehouse/subscriptions/LakehouseSubscriptionsStore.js +63 -0
  155. package/lib/stores/lakehouse/subscriptions/LakehouseSubscriptionsStore.js.map +1 -0
  156. package/package.json +5 -4
  157. package/src/__lib__/LegendMarketplaceNavigation.ts +16 -1
  158. package/src/application/LegendMarketplaceApplicationConfig.ts +25 -0
  159. package/src/application/LegendMarketplaceFrameworkProvider.tsx +2 -0
  160. package/src/application/LegendMarketplaceWebApplication.tsx +50 -12
  161. package/src/components/DataProductCard/LegendMarketplaceDataProductSearchCard.tsx +41 -33
  162. package/src/components/DataProductCard/LegendMarketplaceLightDataProductCard.tsx +33 -36
  163. package/src/components/{Lakehouse/LakehouseHeader.tsx → Header/MarketplaceLakehouseHeader.tsx} +7 -3
  164. package/src/components/MarketplaceCard/LegendMarketplaceCard.tsx +98 -0
  165. package/src/components/ProviderCard/LegendMarketplaceProviderCard.tsx +47 -39
  166. package/src/components/__test-utils__/LegendMarketplaceStoreTestUtils.tsx +2 -14
  167. package/src/pages/Home/LegendMarketplaceHome.tsx +42 -51
  168. package/src/{components → pages}/Lakehouse/DataProductDataAccess.tsx +91 -12
  169. package/src/{components → pages}/Lakehouse/LakehouseDataProduct.tsx +14 -23
  170. package/src/pages/Lakehouse/MarketplaceLakehouseHome.tsx +167 -0
  171. package/src/pages/Lakehouse/entitlements/EntitlementsDashboard.tsx +390 -0
  172. package/src/pages/Lakehouse/entitlements/EntitlementsDataContractCreator.tsx +99 -0
  173. package/src/pages/Lakehouse/entitlements/EntitlementsDataContractViewer.tsx +33 -0
  174. package/src/pages/Lakehouse/entitlements/EntitlementsTaskViewer.tsx +73 -0
  175. package/src/pages/Lakehouse/entitlements/LakehouseEntitlements.tsx +82 -0
  176. package/src/pages/Lakehouse/shared/GridItemViewer.tsx +105 -0
  177. package/src/pages/Lakehouse/subscriptions/LakehouseSubscriptions.tsx +358 -0
  178. package/src/pages/Lakehouse/subscriptions/LakehouseSubscriptionsStoreProvider.tsx +65 -0
  179. package/src/pages/LegendMarketplacePage.tsx +26 -0
  180. package/src/pages/SearchResults/LegendMarketplaceSearchResults.tsx +58 -65
  181. package/src/pages/VendorData/LegendMarketplaceVendorData.tsx +44 -42
  182. package/src/stores/LakehouseContractServerClient.ts +78 -10
  183. package/src/stores/LegendMarketplaceBaseStore.ts +16 -1
  184. package/src/stores/lakehouse/DataProductDataAccessState.ts +67 -63
  185. package/src/stores/lakehouse/DataProductViewerState.ts +86 -29
  186. package/src/stores/lakehouse/LakehouseUtils.ts +345 -0
  187. package/src/stores/lakehouse/MarketplaceLakehouseStore.ts +10 -6
  188. package/src/stores/lakehouse/entitlements/EntitlementsDashboardState.ts +167 -0
  189. package/src/stores/lakehouse/entitlements/EntitlementsDataContractViewerState.ts +101 -0
  190. package/src/stores/lakehouse/entitlements/EntitlementsTaskViewerState.ts +227 -0
  191. package/src/stores/lakehouse/entitlements/LakehouseEntitlementsStore.ts +69 -231
  192. package/src/stores/lakehouse/entitlements/LakehouseViewerState.ts +27 -0
  193. package/src/stores/lakehouse/subscriptions/LakehouseSubscriptionsStore.ts +100 -0
  194. package/tsconfig.json +26 -13
  195. package/lib/components/Lakehouse/DataProductDataAccess.d.ts.map +0 -1
  196. package/lib/components/Lakehouse/DataProductDataAccess.js.map +0 -1
  197. package/lib/components/Lakehouse/DataProductHolder.d.ts.map +0 -1
  198. package/lib/components/Lakehouse/DataProductHolder.js.map +0 -1
  199. package/lib/components/Lakehouse/DataProductViewer.d.ts.map +0 -1
  200. package/lib/components/Lakehouse/DataProductViewer.js.map +0 -1
  201. package/lib/components/Lakehouse/DataProductViewerActivityBar.d.ts.map +0 -1
  202. package/lib/components/Lakehouse/DataProductViewerActivityBar.js.map +0 -1
  203. package/lib/components/Lakehouse/DataProductWiki.d.ts.map +0 -1
  204. package/lib/components/Lakehouse/DataProductWiki.js.map +0 -1
  205. package/lib/components/Lakehouse/LakehouseDataProduct.d.ts.map +0 -1
  206. package/lib/components/Lakehouse/LakehouseDataProduct.js.map +0 -1
  207. package/lib/components/Lakehouse/LakehouseHeader.d.ts.map +0 -1
  208. package/lib/components/Lakehouse/LakehouseHeader.js.map +0 -1
  209. package/lib/components/Lakehouse/LakehouseMarketplace.d.ts.map +0 -1
  210. package/lib/components/Lakehouse/LakehouseMarketplace.js +0 -57
  211. package/lib/components/Lakehouse/LakehouseMarketplace.js.map +0 -1
  212. package/lib/components/Lakehouse/MarketLakehouseStoreProvider.d.ts.map +0 -1
  213. package/lib/components/Lakehouse/MarketLakehouseStoreProvider.js.map +0 -1
  214. package/lib/components/Lakehouse/entitlements/LakehouseEntitlements.d.ts.map +0 -1
  215. package/lib/components/Lakehouse/entitlements/LakehouseEntitlements.js +0 -147
  216. package/lib/components/Lakehouse/entitlements/LakehouseEntitlements.js.map +0 -1
  217. package/lib/components/Lakehouse/entitlements/LakehouseEntitlementsStoreProvider.d.ts.map +0 -1
  218. package/lib/components/Lakehouse/entitlements/LakehouseEntitlementsStoreProvider.js.map +0 -1
  219. package/lib/stores/MarketplaceLakehouseServerClient.d.ts +0 -25
  220. package/lib/stores/MarketplaceLakehouseServerClient.d.ts.map +0 -1
  221. package/lib/stores/MarketplaceLakehouseServerClient.js +0 -27
  222. package/lib/stores/MarketplaceLakehouseServerClient.js.map +0 -1
  223. package/lib/stores/lakehouse/entitlements/DataContractState.d.ts +0 -27
  224. package/lib/stores/lakehouse/entitlements/DataContractState.d.ts.map +0 -1
  225. package/lib/stores/lakehouse/entitlements/DataContractState.js +0 -115
  226. package/lib/stores/lakehouse/entitlements/DataContractState.js.map +0 -1
  227. package/src/components/Lakehouse/LakehouseMarketplace.tsx +0 -193
  228. package/src/components/Lakehouse/entitlements/LakehouseEntitlements.tsx +0 -332
  229. package/src/stores/MarketplaceLakehouseServerClient.ts +0 -40
  230. package/src/stores/lakehouse/entitlements/DataContractState.ts +0 -131
  231. /package/lib/{components → pages}/Lakehouse/DataProductDataAccess.d.ts +0 -0
  232. /package/lib/{components → pages}/Lakehouse/DataProductHolder.d.ts +0 -0
  233. /package/lib/{components → pages}/Lakehouse/DataProductHolder.js +0 -0
  234. /package/lib/{components → pages}/Lakehouse/DataProductViewer.d.ts +0 -0
  235. /package/lib/{components → pages}/Lakehouse/DataProductViewer.js +0 -0
  236. /package/lib/{components → pages}/Lakehouse/DataProductViewerActivityBar.d.ts +0 -0
  237. /package/lib/{components → pages}/Lakehouse/DataProductViewerActivityBar.js +0 -0
  238. /package/lib/{components → pages}/Lakehouse/DataProductWiki.d.ts +0 -0
  239. /package/lib/{components → pages}/Lakehouse/DataProductWiki.js +0 -0
  240. /package/lib/{components → pages}/Lakehouse/LakehouseDataProduct.d.ts +0 -0
  241. /package/lib/{components → pages}/Lakehouse/entitlements/LakehouseEntitlementsStoreProvider.d.ts +0 -0
  242. /package/lib/{components → pages}/Lakehouse/entitlements/LakehouseEntitlementsStoreProvider.js +0 -0
  243. /package/src/{components → pages}/Lakehouse/DataProductHolder.tsx +0 -0
  244. /package/src/{components → pages}/Lakehouse/DataProductViewer.tsx +0 -0
  245. /package/src/{components → pages}/Lakehouse/DataProductViewerActivityBar.tsx +0 -0
  246. /package/src/{components → pages}/Lakehouse/DataProductWiki.tsx +0 -0
  247. /package/src/{components/Lakehouse/MarketLakehouseStoreProvider.tsx → pages/Lakehouse/MarketplaceLakehouseStoreProvider.tsx} +0 -0
  248. /package/src/{components → pages}/Lakehouse/entitlements/LakehouseEntitlementsStoreProvider.tsx +0 -0
@@ -0,0 +1,167 @@
1
+ /**
2
+ * Copyright (c) 2020-present, Goldman Sachs
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+
17
+ import {
18
+ ActionState,
19
+ assertErrorThrown,
20
+ type GeneratorFn,
21
+ type PlainObject,
22
+ } from '@finos/legend-shared';
23
+ import { deserialize } from 'serializr';
24
+ import {
25
+ type V1_ContractUserEventRecord,
26
+ type V1_TaskStatusChangeResponse,
27
+ V1_TaskStatusChangeResponseModelSchema,
28
+ type V1_PendingTasksRespond,
29
+ type V1_UserPendingContractsRecord,
30
+ type V1_UserPendingContractsResponse,
31
+ type V1_TaskStatus,
32
+ V1_pendingTasksRespondModelSchema,
33
+ } from '@finos/legend-graph';
34
+ import { makeObservable, flow, observable, action } from 'mobx';
35
+ import {
36
+ TEST_USER,
37
+ TEST_USER2,
38
+ type LakehouseEntitlementsStore,
39
+ } from './LakehouseEntitlementsStore.js';
40
+ import { LakehouseViewerState } from './LakehouseViewerState.js';
41
+
42
+ export class EntitlementsDashboardState extends LakehouseViewerState {
43
+ pendingTasks: V1_ContractUserEventRecord[] | undefined;
44
+ pendingContracts: V1_UserPendingContractsRecord[] | undefined;
45
+ changingState = ActionState.create();
46
+
47
+ constructor(state: LakehouseEntitlementsStore) {
48
+ super(state);
49
+ makeObservable(this, {
50
+ pendingTasks: observable,
51
+ setPendingTasks: action,
52
+ changingState: observable,
53
+ pendingContracts: observable,
54
+ initializationState: observable,
55
+ approve: flow,
56
+ setPendingContracts: action,
57
+ init: flow,
58
+ deny: flow,
59
+ });
60
+ }
61
+
62
+ *init(token: string | undefined): GeneratorFn<void> {
63
+ try {
64
+ this.setPendingContracts(undefined);
65
+ this.setPendingTasks(undefined);
66
+ const rawTasks = (yield this.state.lakehouseServerClient.getPendingTasks(
67
+ TEST_USER,
68
+ token,
69
+ )) as PlainObject<V1_PendingTasksRespond>;
70
+ const pendingContracts =
71
+ (yield this.state.lakehouseServerClient.getPendingContracts(
72
+ TEST_USER2,
73
+ token,
74
+ )) as V1_UserPendingContractsResponse;
75
+ this.setPendingContracts(pendingContracts.records ?? []);
76
+ const tasks = deserialize(V1_pendingTasksRespondModelSchema, rawTasks);
77
+ this.setPendingTasks([...tasks.dataOwner, ...tasks.privilegeManager]);
78
+ } catch (error) {
79
+ assertErrorThrown(error);
80
+ }
81
+ }
82
+
83
+ setPendingTasks(val: V1_ContractUserEventRecord[] | undefined): void {
84
+ this.pendingTasks = val;
85
+ }
86
+
87
+ setPendingContracts(val: V1_UserPendingContractsRecord[] | undefined): void {
88
+ this.pendingContracts = val;
89
+ }
90
+
91
+ *approve(
92
+ task: V1_ContractUserEventRecord,
93
+ token: string | undefined,
94
+ ): GeneratorFn<void> {
95
+ try {
96
+ this.changingState.inProgress();
97
+ this.changingState.setMessage('Approving Task');
98
+ const response = (yield this.state.lakehouseServerClient.approveTask(
99
+ task.taskId,
100
+ token,
101
+ )) as PlainObject<V1_TaskStatusChangeResponse>;
102
+ const change = deserialize(
103
+ V1_TaskStatusChangeResponseModelSchema,
104
+ response,
105
+ );
106
+ if (change.errorMessage) {
107
+ throw new Error(
108
+ `Unable to approve task: ${task.taskId}: ${change.errorMessage}`,
109
+ );
110
+ }
111
+ task.status = change.status;
112
+ this.setPendingTasks([...(this.pendingTasks ?? [])]);
113
+ this.state.applicationStore.notificationService.notifySuccess(
114
+ `Task has been Approved`,
115
+ );
116
+ } catch (error) {
117
+ assertErrorThrown(error);
118
+ this.state.applicationStore.notificationService.notifyError(
119
+ `${error.message}`,
120
+ );
121
+ } finally {
122
+ this.changingState.complete();
123
+ this.changingState.setMessage(undefined);
124
+ }
125
+ }
126
+
127
+ *deny(
128
+ task: V1_ContractUserEventRecord,
129
+ token: string | undefined,
130
+ ): GeneratorFn<void> {
131
+ try {
132
+ this.changingState.inProgress();
133
+ this.state.applicationStore.alertService.setBlockingAlert({
134
+ message: 'Denying Task',
135
+ prompt: 'Denying task...',
136
+ showLoading: true,
137
+ });
138
+ const response = (yield this.state.lakehouseServerClient.denyTask(
139
+ task.taskId,
140
+ token,
141
+ )) as PlainObject<V1_TaskStatus>;
142
+ const change = deserialize(
143
+ V1_TaskStatusChangeResponseModelSchema,
144
+ response,
145
+ );
146
+ if (change.errorMessage) {
147
+ throw new Error(
148
+ `Unable to deny task: ${task.taskId}: ${change.errorMessage}`,
149
+ );
150
+ }
151
+ task.status = change.status;
152
+ this.setPendingTasks([...(this.pendingTasks ?? [])]);
153
+ this.state.applicationStore.notificationService.notifySuccess(
154
+ `Task has been denied`,
155
+ );
156
+ } catch (error) {
157
+ assertErrorThrown(error);
158
+ this.state.applicationStore.notificationService.notifyError(
159
+ `${error.message}`,
160
+ );
161
+ } finally {
162
+ this.changingState.complete();
163
+ this.changingState.setMessage(undefined);
164
+ this.state.applicationStore.alertService.setBlockingAlert(undefined);
165
+ }
166
+ }
167
+ }
@@ -0,0 +1,101 @@
1
+ /**
2
+ * Copyright (c) 2020-present, Goldman Sachs
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+
17
+ import {
18
+ type V1_ContractUserEventRecord,
19
+ type V1_PendingTasksRespond,
20
+ type V1_DataContract,
21
+ V1_deserializeTaskResponse,
22
+ } from '@finos/legend-graph';
23
+ import { type LakehouseEntitlementsStore } from './LakehouseEntitlementsStore.js';
24
+ import { LakehouseViewerState } from './LakehouseViewerState.js';
25
+ import {
26
+ assertErrorThrown,
27
+ type GeneratorFn,
28
+ type PlainObject,
29
+ } from '@finos/legend-shared';
30
+ import { action, computed, flow, makeObservable, observable } from 'mobx';
31
+ import {
32
+ buildDataContractDetail,
33
+ buildTaskGridItemDetail,
34
+ convertMutilGridItemDetail,
35
+ type GridItemDetail,
36
+ } from '../LakehouseUtils.js';
37
+
38
+ export class EntitlementsDataContractViewerState extends LakehouseViewerState {
39
+ readonly value: V1_DataContract;
40
+ associatedTasks: V1_ContractUserEventRecord[] | undefined;
41
+
42
+ constructor(value: V1_DataContract, state: LakehouseEntitlementsStore) {
43
+ super(state);
44
+ this.value = value;
45
+ makeObservable(this, {
46
+ associatedTasks: observable,
47
+ setAssociatedTasks: action,
48
+ init: flow,
49
+ tasksDetails: computed,
50
+ });
51
+ }
52
+
53
+ get contractDetails(): GridItemDetail[] {
54
+ return [
55
+ ...buildDataContractDetail(this.value, {
56
+ openDirectoryHandler: this.state.directoryCallBack,
57
+ openApplicationIdHandler: this.state.applicationCallBack,
58
+ }),
59
+ ...this.tasksDetails,
60
+ ];
61
+ }
62
+
63
+ get tasksDetails(): GridItemDetail[] {
64
+ return convertMutilGridItemDetail(
65
+ this.associatedTasks?.map((task) =>
66
+ buildTaskGridItemDetail(
67
+ task,
68
+ [],
69
+ undefined,
70
+ undefined,
71
+ this.state.directoryCallBack,
72
+ this.state.applicationCallBack,
73
+ ),
74
+ ) ?? [],
75
+ ).map((e) => {
76
+ e.name = `Contract ${e.name}`;
77
+ return e;
78
+ });
79
+ }
80
+
81
+ setAssociatedTasks(
82
+ associatedTasks: V1_ContractUserEventRecord[] | undefined,
83
+ ): void {
84
+ this.associatedTasks = associatedTasks;
85
+ }
86
+
87
+ *init(token: string | undefined): GeneratorFn<void> {
88
+ try {
89
+ this.setAssociatedTasks(undefined);
90
+ const pendingContracts =
91
+ (yield this.state.lakehouseServerClient.getContractTasks(
92
+ this.value.guid,
93
+ token,
94
+ )) as PlainObject<V1_PendingTasksRespond>;
95
+ const tasks = V1_deserializeTaskResponse(pendingContracts);
96
+ this.setAssociatedTasks(tasks.map((e) => e.rec));
97
+ } catch (error) {
98
+ assertErrorThrown(error);
99
+ }
100
+ }
101
+ }
@@ -0,0 +1,227 @@
1
+ /**
2
+ * Copyright (c) 2020-present, Goldman Sachs
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+
17
+ import {
18
+ ActionState,
19
+ assertErrorThrown,
20
+ type GeneratorFn,
21
+ type PlainObject,
22
+ } from '@finos/legend-shared';
23
+ import { deserialize } from 'serializr';
24
+ import {
25
+ type V1_ContractUserEventRecord,
26
+ type V1_TaskStatusChangeResponse,
27
+ V1_TaskStatusChangeResponseModelSchema,
28
+ type V1_TaskStatus,
29
+ type V1_DataContract,
30
+ V1_DataContractsRecordModelSchema,
31
+ type V1_DataContractsRecord,
32
+ type V1_PendingTasksRespond,
33
+ V1_pendingTasksRespondModelSchema,
34
+ type V1_UserPendingContractsRecord,
35
+ type V1_TaskMetadata,
36
+ } from '@finos/legend-graph';
37
+ import { makeObservable, flow, observable, flowResult, action } from 'mobx';
38
+ import {
39
+ type LakehouseEntitlementsStore,
40
+ TEST_USER,
41
+ } from './LakehouseEntitlementsStore.js';
42
+ import { LakehouseViewerState } from './LakehouseViewerState.js';
43
+ import {
44
+ buildTaskGridItemDetail,
45
+ type GridItemDetail,
46
+ } from '../LakehouseUtils.js';
47
+ import { generateLakehouseContractPath } from '../../../__lib__/LegendMarketplaceNavigation.js';
48
+
49
+ export class EntitlementsTaskViewerState extends LakehouseViewerState {
50
+ readonly value: V1_ContractUserEventRecord;
51
+ readonly approvalStatus = ActionState.create();
52
+ canApprove: boolean | undefined;
53
+ dataContract: V1_DataContract | undefined;
54
+ pendingAssociatedContractEvent: V1_UserPendingContractsRecord[] | undefined;
55
+ changingTaskState = ActionState.create();
56
+ taskAssignees: string[] | undefined;
57
+ constructor(value: V1_TaskMetadata, state: LakehouseEntitlementsStore) {
58
+ super(state);
59
+ this.value = value.rec;
60
+ this.taskAssignees = value.assignees;
61
+ makeObservable(this, {
62
+ canApprove: observable,
63
+ pendingAssociatedContractEvent: observable,
64
+ setPendingAssociatedContractEvent: action,
65
+ setCanApprove: action,
66
+ approve: flow,
67
+ deny: flow,
68
+ init: flow,
69
+ calculateApprovalRights: flow,
70
+ fetchContract: flow,
71
+ dataContract: observable,
72
+ taskAssignees: observable,
73
+ });
74
+ this.observeContract();
75
+ }
76
+
77
+ get id(): string {
78
+ return this.value.taskId;
79
+ }
80
+
81
+ setPendingAssociatedContractEvent(
82
+ pendingAssociatedContractEvent: V1_UserPendingContractsRecord[] | undefined,
83
+ ): void {
84
+ this.pendingAssociatedContractEvent = pendingAssociatedContractEvent;
85
+ }
86
+
87
+ *init(token: string | undefined): GeneratorFn<void> {
88
+ flowResult(this.calculateApprovalRights(token)).catch(
89
+ this.state.applicationStore.alertUnhandledError,
90
+ );
91
+ flowResult(this.fetchContract(token)).catch(
92
+ this.state.applicationStore.alertUnhandledError,
93
+ );
94
+ }
95
+
96
+ setCanApprove(val: boolean | undefined): void {
97
+ this.canApprove = val;
98
+ }
99
+
100
+ observeContract(): void {
101
+ makeObservable(this.value, {
102
+ status: observable,
103
+ });
104
+ }
105
+
106
+ *approve(token: string | undefined): GeneratorFn<void> {
107
+ try {
108
+ this.approvalStatus.inProgress();
109
+ const response = (yield this.state.lakehouseServerClient.approveTask(
110
+ this.value.taskId,
111
+ token,
112
+ )) as PlainObject<V1_TaskStatusChangeResponse>;
113
+ const change = deserialize(
114
+ V1_TaskStatusChangeResponseModelSchema,
115
+ response,
116
+ );
117
+ if (change.errorMessage) {
118
+ this.approvalStatus.fail();
119
+ throw new Error(
120
+ `Unable to approve task: ${this.value.taskId}: ${change.errorMessage}`,
121
+ );
122
+ }
123
+ this.value.status = change.status;
124
+ this.setCanApprove(false);
125
+ this.approvalStatus.pass();
126
+ this.state.applicationStore.notificationService.notifySuccess(
127
+ 'Approval succeeded',
128
+ );
129
+ } catch (error) {
130
+ this.approvalStatus.fail();
131
+ assertErrorThrown(error);
132
+ this.state.applicationStore.notificationService.notifyError(
133
+ `${error.message}`,
134
+ );
135
+ }
136
+ }
137
+
138
+ *deny(token: string | undefined): GeneratorFn<void> {
139
+ try {
140
+ this.changingTaskState.inProgress();
141
+ this.state.applicationStore.alertService.setBlockingAlert({
142
+ message: 'Denying Task',
143
+ prompt: 'Denying task...',
144
+ showLoading: true,
145
+ });
146
+ const response = (yield this.state.lakehouseServerClient.denyTask(
147
+ this.value.taskId,
148
+ token,
149
+ )) as PlainObject<V1_TaskStatus>;
150
+ const change = deserialize(
151
+ V1_TaskStatusChangeResponseModelSchema,
152
+ response,
153
+ );
154
+ if (change.errorMessage) {
155
+ throw new Error(
156
+ `Unable to deny task: ${this.value.taskId}: ${change.errorMessage}`,
157
+ );
158
+ }
159
+ this.value.status = change.status;
160
+ this.setCanApprove(false);
161
+ this.state.applicationStore.notificationService.notifySuccess(
162
+ `Task has been denied`,
163
+ );
164
+ } catch (error) {
165
+ assertErrorThrown(error);
166
+ this.state.applicationStore.notificationService.notifyError(
167
+ `${error.message}`,
168
+ );
169
+ } finally {
170
+ this.changingTaskState.complete();
171
+ this.changingTaskState.setMessage(undefined);
172
+ this.state.applicationStore.alertService.setBlockingAlert(undefined);
173
+ }
174
+ }
175
+
176
+ *calculateApprovalRights(token: string | undefined): GeneratorFn<void> {
177
+ this.canApprove = undefined;
178
+ try {
179
+ const rawTasks = (yield this.state.lakehouseServerClient.getPendingTasks(
180
+ TEST_USER,
181
+ token,
182
+ )) as PlainObject<V1_PendingTasksRespond>;
183
+ const tasks = deserialize(V1_pendingTasksRespondModelSchema, rawTasks);
184
+ const allTasks = [...tasks.dataOwner, ...tasks.privilegeManager];
185
+ const canApprove = Boolean(
186
+ allTasks.find((e) => e.taskId === this.value.taskId),
187
+ );
188
+ this.setCanApprove(canApprove);
189
+ } catch (error) {
190
+ assertErrorThrown(error);
191
+ }
192
+ }
193
+
194
+ *fetchContract(token: string | undefined): GeneratorFn<void> {
195
+ try {
196
+ const contractId = this.value.dataContractId;
197
+ const dataContracts =
198
+ (yield this.state.lakehouseServerClient.getDataContract(
199
+ contractId,
200
+ token,
201
+ )) as PlainObject<V1_DataContractsRecord>;
202
+
203
+ const dataContract = deserialize(
204
+ V1_DataContractsRecordModelSchema,
205
+ dataContracts,
206
+ ).dataContracts[0]?.dataContract;
207
+ this.dataContract = dataContract;
208
+ } catch (error) {
209
+ assertErrorThrown(error);
210
+ }
211
+ }
212
+
213
+ get taskDetails(): GridItemDetail[] {
214
+ return buildTaskGridItemDetail(
215
+ this.value,
216
+ this.taskAssignees,
217
+ this.dataContract,
218
+ (id: string): void => {
219
+ this.state.applicationStore.navigationService.navigator.updateCurrentLocation(
220
+ generateLakehouseContractPath(id),
221
+ );
222
+ },
223
+ this.state.directoryCallBack,
224
+ this.state.applicationCallBack,
225
+ );
226
+ }
227
+ }