@finos/legend-extension-dsl-data-product 0.0.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.
Files changed (143) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +3 -0
  3. package/lib/__lib__/DSL_DataProduct_Event.d.ts +19 -0
  4. package/lib/__lib__/DSL_DataProduct_Event.d.ts.map +1 -0
  5. package/lib/__lib__/DSL_DataProduct_Event.js +20 -0
  6. package/lib/__lib__/DSL_DataProduct_Event.js.map +1 -0
  7. package/lib/components/Core_DataProductDataAccess_LegendApplicationPlugin.d.ts +25 -0
  8. package/lib/components/Core_DataProductDataAccess_LegendApplicationPlugin.d.ts.map +1 -0
  9. package/lib/components/Core_DataProductDataAccess_LegendApplicationPlugin.js +105 -0
  10. package/lib/components/Core_DataProductDataAccess_LegendApplicationPlugin.js.map +1 -0
  11. package/lib/components/DataProduct/DataContract/EntitlementsDataContractCreator.d.ts +27 -0
  12. package/lib/components/DataProduct/DataContract/EntitlementsDataContractCreator.d.ts.map +1 -0
  13. package/lib/components/DataProduct/DataContract/EntitlementsDataContractCreator.js +57 -0
  14. package/lib/components/DataProduct/DataContract/EntitlementsDataContractCreator.js.map +1 -0
  15. package/lib/components/DataProduct/DataContract/EntitlementsDataContractViewer.d.ts +29 -0
  16. package/lib/components/DataProduct/DataContract/EntitlementsDataContractViewer.d.ts.map +1 -0
  17. package/lib/components/DataProduct/DataContract/EntitlementsDataContractViewer.js +165 -0
  18. package/lib/components/DataProduct/DataContract/EntitlementsDataContractViewer.js.map +1 -0
  19. package/lib/components/DataProduct/DataProductDataAccess.d.ts +34 -0
  20. package/lib/components/DataProduct/DataProductDataAccess.d.ts.map +1 -0
  21. package/lib/components/DataProduct/DataProductDataAccess.js +336 -0
  22. package/lib/components/DataProduct/DataProductDataAccess.js.map +1 -0
  23. package/lib/components/DataProduct/DataProductSupportInfo.d.ts +22 -0
  24. package/lib/components/DataProduct/DataProductSupportInfo.d.ts.map +1 -0
  25. package/lib/components/DataProduct/DataProductSupportInfo.js +43 -0
  26. package/lib/components/DataProduct/DataProductSupportInfo.js.map +1 -0
  27. package/lib/components/DataProduct/Subscriptions/DataProductSubscriptionsViewer.d.ts +26 -0
  28. package/lib/components/DataProduct/Subscriptions/DataProductSubscriptionsViewer.d.ts.map +1 -0
  29. package/lib/components/DataProduct/Subscriptions/DataProductSubscriptionsViewer.js +219 -0
  30. package/lib/components/DataProduct/Subscriptions/DataProductSubscriptionsViewer.js.map +1 -0
  31. package/lib/components/ProductViewer.d.ts +33 -0
  32. package/lib/components/ProductViewer.d.ts.map +1 -0
  33. package/lib/components/ProductViewer.js +113 -0
  34. package/lib/components/ProductViewer.js.map +1 -0
  35. package/lib/components/ProductWiki.d.ts +39 -0
  36. package/lib/components/ProductWiki.d.ts.map +1 -0
  37. package/lib/components/ProductWiki.js +95 -0
  38. package/lib/components/ProductWiki.js.map +1 -0
  39. package/lib/components/TerminalProduct/TerminalProductPrice.d.ts +22 -0
  40. package/lib/components/TerminalProduct/TerminalProductPrice.d.ts.map +1 -0
  41. package/lib/components/TerminalProduct/TerminalProductPrice.js +39 -0
  42. package/lib/components/TerminalProduct/TerminalProductPrice.js.map +1 -0
  43. package/lib/components/UserRenderer/MultiUserRenderer.d.ts +24 -0
  44. package/lib/components/UserRenderer/MultiUserRenderer.d.ts.map +1 -0
  45. package/lib/components/UserRenderer/MultiUserRenderer.js +46 -0
  46. package/lib/components/UserRenderer/MultiUserRenderer.js.map +1 -0
  47. package/lib/components/UserRenderer/UserRenderer.d.ts +27 -0
  48. package/lib/components/UserRenderer/UserRenderer.d.ts.map +1 -0
  49. package/lib/components/UserRenderer/UserRenderer.js +57 -0
  50. package/lib/components/UserRenderer/UserRenderer.js.map +1 -0
  51. package/lib/components/__test-utils__/StateTestUtils.d.ts +36 -0
  52. package/lib/components/__test-utils__/StateTestUtils.d.ts.map +1 -0
  53. package/lib/components/__test-utils__/StateTestUtils.js +97 -0
  54. package/lib/components/__test-utils__/StateTestUtils.js.map +1 -0
  55. package/lib/components/__test-utils__/TEST_DATA__LakehouseContractData.d.ts +25 -0
  56. package/lib/components/__test-utils__/TEST_DATA__LakehouseContractData.d.ts.map +1 -0
  57. package/lib/components/__test-utils__/TEST_DATA__LakehouseContractData.js +231 -0
  58. package/lib/components/__test-utils__/TEST_DATA__LakehouseContractData.js.map +1 -0
  59. package/lib/components/__test-utils__/TEST_DATA__LakehouseDataProducts.d.ts +71 -0
  60. package/lib/components/__test-utils__/TEST_DATA__LakehouseDataProducts.d.ts.map +1 -0
  61. package/lib/components/__test-utils__/TEST_DATA__LakehouseDataProducts.js +316 -0
  62. package/lib/components/__test-utils__/TEST_DATA__LakehouseDataProducts.js.map +1 -0
  63. package/lib/index.css +17 -0
  64. package/lib/index.css.map +1 -0
  65. package/lib/index.d.ts +32 -0
  66. package/lib/index.d.ts.map +1 -0
  67. package/lib/index.js +32 -0
  68. package/lib/index.js.map +1 -0
  69. package/lib/package.json +95 -0
  70. package/lib/stores/BaseLayoutState.d.ts +35 -0
  71. package/lib/stores/BaseLayoutState.d.ts.map +1 -0
  72. package/lib/stores/BaseLayoutState.js +166 -0
  73. package/lib/stores/BaseLayoutState.js.map +1 -0
  74. package/lib/stores/BaseViewerState.d.ts +33 -0
  75. package/lib/stores/BaseViewerState.d.ts.map +1 -0
  76. package/lib/stores/BaseViewerState.js +27 -0
  77. package/lib/stores/BaseViewerState.js.map +1 -0
  78. package/lib/stores/DataProduct/DataProductAPGState.d.ts +62 -0
  79. package/lib/stores/DataProduct/DataProductAPGState.d.ts.map +1 -0
  80. package/lib/stores/DataProduct/DataProductAPGState.js +222 -0
  81. package/lib/stores/DataProduct/DataProductAPGState.js.map +1 -0
  82. package/lib/stores/DataProduct/DataProductDataAccessState.d.ts +66 -0
  83. package/lib/stores/DataProduct/DataProductDataAccessState.d.ts.map +1 -0
  84. package/lib/stores/DataProduct/DataProductDataAccessState.js +191 -0
  85. package/lib/stores/DataProduct/DataProductDataAccessState.js.map +1 -0
  86. package/lib/stores/DataProduct/DataProductViewerState.d.ts +40 -0
  87. package/lib/stores/DataProduct/DataProductViewerState.d.ts.map +1 -0
  88. package/lib/stores/DataProduct/DataProductViewerState.js +60 -0
  89. package/lib/stores/DataProduct/DataProductViewerState.js.map +1 -0
  90. package/lib/stores/DataProduct/EntitlementsDataContractViewerState.d.ts +31 -0
  91. package/lib/stores/DataProduct/EntitlementsDataContractViewerState.d.ts.map +1 -0
  92. package/lib/stores/DataProduct/EntitlementsDataContractViewerState.js +57 -0
  93. package/lib/stores/DataProduct/EntitlementsDataContractViewerState.js.map +1 -0
  94. package/lib/stores/DataProductDataAccess_LegendApplicationPlugin_Extension.d.ts +33 -0
  95. package/lib/stores/DataProductDataAccess_LegendApplicationPlugin_Extension.d.ts.map +1 -0
  96. package/lib/stores/DataProductDataAccess_LegendApplicationPlugin_Extension.js +17 -0
  97. package/lib/stores/DataProductDataAccess_LegendApplicationPlugin_Extension.js.map +1 -0
  98. package/lib/stores/ProductViewerNavigation.d.ts +29 -0
  99. package/lib/stores/ProductViewerNavigation.d.ts.map +1 -0
  100. package/lib/stores/ProductViewerNavigation.js +35 -0
  101. package/lib/stores/ProductViewerNavigation.js.map +1 -0
  102. package/lib/stores/TerminalProduct/TerminalProductViewerState.d.ts +25 -0
  103. package/lib/stores/TerminalProduct/TerminalProductViewerState.d.ts.map +1 -0
  104. package/lib/stores/TerminalProduct/TerminalProductViewerState.js +32 -0
  105. package/lib/stores/TerminalProduct/TerminalProductViewerState.js.map +1 -0
  106. package/lib/utils/DataContractUtils.d.ts +23 -0
  107. package/lib/utils/DataContractUtils.d.ts.map +1 -0
  108. package/lib/utils/DataContractUtils.js +76 -0
  109. package/lib/utils/DataContractUtils.js.map +1 -0
  110. package/lib/utils/LakehouseUtils.d.ts +21 -0
  111. package/lib/utils/LakehouseUtils.d.ts.map +1 -0
  112. package/lib/utils/LakehouseUtils.js +72 -0
  113. package/lib/utils/LakehouseUtils.js.map +1 -0
  114. package/package.json +95 -0
  115. package/src/__lib__/DSL_DataProduct_Event.ts +19 -0
  116. package/src/components/Core_DataProductDataAccess_LegendApplicationPlugin.tsx +233 -0
  117. package/src/components/DataProduct/DataContract/EntitlementsDataContractCreator.tsx +182 -0
  118. package/src/components/DataProduct/DataContract/EntitlementsDataContractViewer.tsx +586 -0
  119. package/src/components/DataProduct/DataProductDataAccess.tsx +767 -0
  120. package/src/components/DataProduct/DataProductSupportInfo.tsx +195 -0
  121. package/src/components/DataProduct/Subscriptions/DataProductSubscriptionsViewer.tsx +602 -0
  122. package/src/components/ProductViewer.tsx +287 -0
  123. package/src/components/ProductWiki.tsx +196 -0
  124. package/src/components/TerminalProduct/TerminalProductPrice.tsx +56 -0
  125. package/src/components/UserRenderer/MultiUserRenderer.tsx +89 -0
  126. package/src/components/UserRenderer/UserRenderer.tsx +100 -0
  127. package/src/components/__test-utils__/StateTestUtils.ts +170 -0
  128. package/src/components/__test-utils__/TEST_DATA__LakehouseContractData.ts +253 -0
  129. package/src/components/__test-utils__/TEST_DATA__LakehouseDataProducts.ts +343 -0
  130. package/src/index.ts +34 -0
  131. package/src/stores/BaseLayoutState.ts +220 -0
  132. package/src/stores/BaseViewerState.ts +75 -0
  133. package/src/stores/DataProduct/DataProductAPGState.ts +385 -0
  134. package/src/stores/DataProduct/DataProductDataAccessState.ts +354 -0
  135. package/src/stores/DataProduct/DataProductViewerState.ts +100 -0
  136. package/src/stores/DataProduct/EntitlementsDataContractViewerState.ts +83 -0
  137. package/src/stores/DataProductDataAccess_LegendApplicationPlugin_Extension.ts +38 -0
  138. package/src/stores/ProductViewerNavigation.ts +48 -0
  139. package/src/stores/TerminalProduct/TerminalProductViewerState.ts +43 -0
  140. package/src/utils/DataContractUtils.ts +121 -0
  141. package/src/utils/LakehouseUtils.ts +91 -0
  142. package/tsconfig.json +91 -0
  143. package/tsconfig.package.json +56 -0
@@ -0,0 +1,195 @@
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
+ AnchorLinkIcon,
19
+ DocumentIcon,
20
+ EnvelopeOutlineIcon,
21
+ ExternalLinkIcon,
22
+ HeadsetIcon,
23
+ QuestionCircleOutlineIcon,
24
+ WorldOutlineIcon,
25
+ } from '@finos/legend-art';
26
+ import { observer } from 'mobx-react-lite';
27
+ import { useEffect, useRef } from 'react';
28
+ import { Box, Grid2 as Grid, Link } from '@mui/material';
29
+ import type { DataProductViewerState } from '../../stores/DataProduct/DataProductViewerState.js';
30
+ import {
31
+ generateAnchorForSection,
32
+ DATA_PRODUCT_VIEWER_SECTION,
33
+ } from '../../stores/ProductViewerNavigation.js';
34
+ import { ProductWikiPlaceholder } from '../ProductWiki.js';
35
+
36
+ export const DataProductSupportInfo = observer(
37
+ (props: { dataProductViewerState: DataProductViewerState }) => {
38
+ const { dataProductViewerState } = props;
39
+ const sectionRef = useRef<HTMLDivElement>(null);
40
+
41
+ const anchor = generateAnchorForSection(
42
+ DATA_PRODUCT_VIEWER_SECTION.SUPPORT_INFO,
43
+ );
44
+
45
+ const supportInfo = dataProductViewerState.product.supportInfo;
46
+ const doesSupportInfoExist =
47
+ supportInfo !== undefined &&
48
+ (supportInfo.emails.length > 0 ||
49
+ supportInfo.documentation ||
50
+ supportInfo.website ||
51
+ supportInfo.faqUrl ||
52
+ supportInfo.supportUrl);
53
+
54
+ useEffect(() => {
55
+ if (sectionRef.current) {
56
+ dataProductViewerState.layoutState.setWikiPageAnchor(
57
+ anchor,
58
+ sectionRef.current,
59
+ );
60
+ }
61
+ return () =>
62
+ dataProductViewerState.layoutState.unsetWikiPageAnchor(anchor);
63
+ }, [dataProductViewerState, anchor]);
64
+
65
+ return (
66
+ <div ref={sectionRef} className="data-product__viewer__wiki__section">
67
+ <div className="data-product__viewer__wiki__section__header">
68
+ <div className="data-product__viewer__wiki__section__header__label">
69
+ Support
70
+ <button
71
+ className="data-product__viewer__wiki__section__header__anchor"
72
+ tabIndex={-1}
73
+ onClick={() => dataProductViewerState.changeZone(anchor, true)}
74
+ >
75
+ <AnchorLinkIcon />
76
+ </button>
77
+ </div>
78
+ </div>
79
+ <div className="data-product__viewer__wiki__section__content">
80
+ {doesSupportInfoExist ? (
81
+ <Grid
82
+ container={true}
83
+ spacing={3}
84
+ columns={2}
85
+ className="data-product__viewer__support-info_container"
86
+ >
87
+ {supportInfo.emails.length > 0 && (
88
+ <Grid
89
+ size={1}
90
+ className="data-product__viewer__support-info__section"
91
+ >
92
+ <Box className="data-product__viewer__support-info__section__icon">
93
+ <EnvelopeOutlineIcon />
94
+ </Box>
95
+ {supportInfo.emails.map((email, index) => (
96
+ <>
97
+ <Link
98
+ key={email.address}
99
+ className="data-product__viewer__support-info__link"
100
+ href={`mailto:${email.address}`}
101
+ >
102
+ {email.title}
103
+ <ExternalLinkIcon />
104
+ </Link>
105
+ {index < supportInfo.emails.length - 1 ? ', ' : null}
106
+ </>
107
+ ))}
108
+ </Grid>
109
+ )}
110
+ {supportInfo.documentation !== undefined && (
111
+ <Grid
112
+ size={1}
113
+ className="data-product__viewer__support-info__section"
114
+ >
115
+ <Box className="data-product__viewer__support-info__section__icon">
116
+ <DocumentIcon />
117
+ </Box>
118
+ <Link
119
+ className="data-product__viewer__support-info__link"
120
+ href={supportInfo.documentation.url}
121
+ target="_blank"
122
+ rel="noopener noreferrer"
123
+ >
124
+ {supportInfo.documentation.label ??
125
+ supportInfo.documentation.url}
126
+ <ExternalLinkIcon />
127
+ </Link>
128
+ </Grid>
129
+ )}
130
+ {supportInfo.supportUrl !== undefined && (
131
+ <Grid
132
+ size={1}
133
+ className="data-product__viewer__support-info__section"
134
+ >
135
+ <Box className="data-product__viewer__support-info__section__icon">
136
+ <HeadsetIcon />
137
+ </Box>
138
+ <Link
139
+ className="data-product__viewer__support-info__link"
140
+ href={supportInfo.supportUrl.url}
141
+ target="_blank"
142
+ rel="noopener noreferrer"
143
+ >
144
+ {supportInfo.supportUrl.label ?? supportInfo.supportUrl.url}
145
+ <ExternalLinkIcon />
146
+ </Link>
147
+ </Grid>
148
+ )}
149
+ {supportInfo.website !== undefined && (
150
+ <Grid
151
+ size={1}
152
+ className="data-product__viewer__support-info__section"
153
+ >
154
+ <Box className="data-product__viewer__support-info__section__icon">
155
+ <WorldOutlineIcon />
156
+ </Box>
157
+ <Link
158
+ className="data-product__viewer__support-info__link"
159
+ href={supportInfo.website.url}
160
+ target="_blank"
161
+ rel="noopener noreferrer"
162
+ >
163
+ {supportInfo.website.label ?? supportInfo.website.url}
164
+ <ExternalLinkIcon />
165
+ </Link>
166
+ </Grid>
167
+ )}
168
+ {supportInfo.faqUrl !== undefined && (
169
+ <Grid
170
+ size={1}
171
+ className="data-product__viewer__support-info__section"
172
+ >
173
+ <Box className="data-product__viewer__support-info__section__icon">
174
+ <QuestionCircleOutlineIcon />
175
+ </Box>
176
+ <Link
177
+ className="data-product__viewer__support-info__link"
178
+ href={supportInfo.faqUrl.url}
179
+ target="_blank"
180
+ rel="noopener noreferrer"
181
+ >
182
+ {supportInfo.faqUrl.label ?? supportInfo.faqUrl.url}
183
+ <ExternalLinkIcon />
184
+ </Link>
185
+ </Grid>
186
+ )}
187
+ </Grid>
188
+ ) : (
189
+ <ProductWikiPlaceholder message="(support information not specified)" />
190
+ )}
191
+ </div>
192
+ </div>
193
+ );
194
+ },
195
+ );