@finos/legend-application-marketplace 0.2.13 → 0.2.15

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 (120) hide show
  1. package/lib/__lib__/LegendMarketplaceNavigation.d.ts +2 -0
  2. package/lib/__lib__/LegendMarketplaceNavigation.d.ts.map +1 -1
  3. package/lib/__lib__/LegendMarketplaceNavigation.js +4 -0
  4. package/lib/__lib__/LegendMarketplaceNavigation.js.map +1 -1
  5. package/lib/application/LegendMarketplaceApplicationConfig.d.ts +9 -0
  6. package/lib/application/LegendMarketplaceApplicationConfig.d.ts.map +1 -1
  7. package/lib/application/LegendMarketplaceApplicationConfig.js +40 -22
  8. package/lib/application/LegendMarketplaceApplicationConfig.js.map +1 -1
  9. package/lib/application/LegendMarketplaceWebApplication.d.ts.map +1 -1
  10. package/lib/application/LegendMarketplaceWebApplication.js +4 -1
  11. package/lib/application/LegendMarketplaceWebApplication.js.map +1 -1
  12. package/lib/application/__test-utils__/LegendMarketplaceApplicationTestUtils.d.ts.map +1 -1
  13. package/lib/application/__test-utils__/LegendMarketplaceApplicationTestUtils.js +7 -0
  14. package/lib/application/__test-utils__/LegendMarketplaceApplicationTestUtils.js.map +1 -1
  15. package/lib/application/providers/LegendMarketplaceAIChatStoreProvider.d.ts +21 -0
  16. package/lib/application/providers/LegendMarketplaceAIChatStoreProvider.d.ts.map +1 -0
  17. package/lib/application/providers/LegendMarketplaceAIChatStoreProvider.js +29 -0
  18. package/lib/application/providers/LegendMarketplaceAIChatStoreProvider.js.map +1 -0
  19. package/lib/index.css +2 -2
  20. package/lib/index.css.map +1 -1
  21. package/lib/package.json +1 -1
  22. package/lib/pages/Agents/LegendMarketplaceAgents.d.ts.map +1 -1
  23. package/lib/pages/Agents/LegendMarketplaceAgents.js +49 -17
  24. package/lib/pages/Agents/LegendMarketplaceAgents.js.map +1 -1
  25. package/lib/pages/Agents/MarketplaceAIChatView.d.ts +21 -0
  26. package/lib/pages/Agents/MarketplaceAIChatView.d.ts.map +1 -0
  27. package/lib/pages/Agents/MarketplaceAIChatView.js +141 -0
  28. package/lib/pages/Agents/MarketplaceAIChatView.js.map +1 -0
  29. package/lib/pages/Agents/MarketplaceAIInputBar.d.ts +22 -0
  30. package/lib/pages/Agents/MarketplaceAIInputBar.d.ts.map +1 -0
  31. package/lib/pages/Agents/MarketplaceAIInputBar.js +40 -0
  32. package/lib/pages/Agents/MarketplaceAIInputBar.js.map +1 -0
  33. package/lib/pages/Agents/MarketplaceAIProductAutosuggest.d.ts +25 -0
  34. package/lib/pages/Agents/MarketplaceAIProductAutosuggest.d.ts.map +1 -0
  35. package/lib/pages/Agents/MarketplaceAIProductAutosuggest.js +86 -0
  36. package/lib/pages/Agents/MarketplaceAIProductAutosuggest.js.map +1 -0
  37. package/lib/pages/Agents/MarketplaceAIProductCards.d.ts +23 -0
  38. package/lib/pages/Agents/MarketplaceAIProductCards.d.ts.map +1 -0
  39. package/lib/pages/Agents/MarketplaceAIProductCards.js +20 -0
  40. package/lib/pages/Agents/MarketplaceAIProductCards.js.map +1 -0
  41. package/lib/pages/Agents/MarketplaceAIScopeSelector.d.ts +19 -0
  42. package/lib/pages/Agents/MarketplaceAIScopeSelector.d.ts.map +1 -0
  43. package/lib/pages/Agents/MarketplaceAIScopeSelector.js +46 -0
  44. package/lib/pages/Agents/MarketplaceAIScopeSelector.js.map +1 -0
  45. package/lib/pages/Lakehouse/entitlements/EntitlementsClosedContractsDashboard.d.ts.map +1 -1
  46. package/lib/pages/Lakehouse/entitlements/EntitlementsClosedContractsDashboard.js +74 -63
  47. package/lib/pages/Lakehouse/entitlements/EntitlementsClosedContractsDashboard.js.map +1 -1
  48. package/lib/pages/Lakehouse/entitlements/EntitlementsPendingContractsDashboard.d.ts.map +1 -1
  49. package/lib/pages/Lakehouse/entitlements/EntitlementsPendingContractsDashboard.js +85 -69
  50. package/lib/pages/Lakehouse/entitlements/EntitlementsPendingContractsDashboard.js.map +1 -1
  51. package/lib/pages/Lakehouse/entitlements/EntitlementsPendingTasksDashboard.d.ts.map +1 -1
  52. package/lib/pages/Lakehouse/entitlements/EntitlementsPendingTasksDashboard.js +7 -11
  53. package/lib/pages/Lakehouse/entitlements/EntitlementsPendingTasksDashboard.js.map +1 -1
  54. package/lib/pages/Lakehouse/entitlements/PermitDataAccessRequest.d.ts +17 -0
  55. package/lib/pages/Lakehouse/entitlements/PermitDataAccessRequest.d.ts.map +1 -0
  56. package/lib/pages/Lakehouse/entitlements/PermitDataAccessRequest.js +126 -0
  57. package/lib/pages/Lakehouse/entitlements/PermitDataAccessRequest.js.map +1 -0
  58. package/lib/pages/Lakehouse/entitlements/WorkflowDataAccessRequest.d.ts.map +1 -1
  59. package/lib/pages/Lakehouse/entitlements/WorkflowDataAccessRequest.js +23 -65
  60. package/lib/pages/Lakehouse/entitlements/WorkflowDataAccessRequest.js.map +1 -1
  61. package/lib/pages/Lakehouse/entitlements/showTaskActionAlert.d.ts +29 -0
  62. package/lib/pages/Lakehouse/entitlements/showTaskActionAlert.d.ts.map +1 -0
  63. package/lib/pages/Lakehouse/entitlements/showTaskActionAlert.js +60 -0
  64. package/lib/pages/Lakehouse/entitlements/showTaskActionAlert.js.map +1 -0
  65. package/lib/pages/Lakehouse/searchResults/LegendMarketplaceSearchResults.d.ts.map +1 -1
  66. package/lib/pages/Lakehouse/searchResults/LegendMarketplaceSearchResults.js +3 -8
  67. package/lib/pages/Lakehouse/searchResults/LegendMarketplaceSearchResults.js.map +1 -1
  68. package/lib/stores/LegendMarketplaceBaseStore.d.ts +2 -1
  69. package/lib/stores/LegendMarketplaceBaseStore.d.ts.map +1 -1
  70. package/lib/stores/LegendMarketplaceBaseStore.js +8 -1
  71. package/lib/stores/LegendMarketplaceBaseStore.js.map +1 -1
  72. package/lib/stores/ai/LegendMarketplaceAIChatStore.d.ts +109 -0
  73. package/lib/stores/ai/LegendMarketplaceAIChatStore.d.ts.map +1 -0
  74. package/lib/stores/ai/LegendMarketplaceAIChatStore.js +1106 -0
  75. package/lib/stores/ai/LegendMarketplaceAIChatStore.js.map +1 -0
  76. package/lib/stores/lakehouse/LegendMarketplaceProductViewerStore.d.ts.map +1 -1
  77. package/lib/stores/lakehouse/LegendMarketplaceProductViewerStore.js +3 -2
  78. package/lib/stores/lakehouse/LegendMarketplaceProductViewerStore.js.map +1 -1
  79. package/lib/stores/lakehouse/dataProducts/ProductCardState.d.ts +1 -1
  80. package/lib/stores/lakehouse/dataProducts/ProductCardState.d.ts.map +1 -1
  81. package/lib/stores/lakehouse/dataProducts/ProductCardState.js +1 -2
  82. package/lib/stores/lakehouse/dataProducts/ProductCardState.js.map +1 -1
  83. package/lib/stores/lakehouse/entitlements/EntitlementsDashboardState.d.ts +30 -3
  84. package/lib/stores/lakehouse/entitlements/EntitlementsDashboardState.d.ts.map +1 -1
  85. package/lib/stores/lakehouse/entitlements/EntitlementsDashboardState.js +94 -16
  86. package/lib/stores/lakehouse/entitlements/EntitlementsDashboardState.js.map +1 -1
  87. package/lib/utils/EntitlementsUtils.d.ts +36 -2
  88. package/lib/utils/EntitlementsUtils.d.ts.map +1 -1
  89. package/lib/utils/EntitlementsUtils.js +225 -46
  90. package/lib/utils/EntitlementsUtils.js.map +1 -1
  91. package/lib/utils/SearchUtils.d.ts.map +1 -1
  92. package/lib/utils/SearchUtils.js +7 -4
  93. package/lib/utils/SearchUtils.js.map +1 -1
  94. package/package.json +10 -10
  95. package/src/__lib__/LegendMarketplaceNavigation.ts +11 -0
  96. package/src/application/LegendMarketplaceApplicationConfig.ts +62 -24
  97. package/src/application/LegendMarketplaceWebApplication.tsx +15 -0
  98. package/src/application/__test-utils__/LegendMarketplaceApplicationTestUtils.ts +7 -0
  99. package/src/application/providers/LegendMarketplaceAIChatStoreProvider.tsx +47 -0
  100. package/src/pages/Agents/LegendMarketplaceAgents.tsx +145 -23
  101. package/src/pages/Agents/MarketplaceAIChatView.tsx +555 -0
  102. package/src/pages/Agents/MarketplaceAIInputBar.tsx +91 -0
  103. package/src/pages/Agents/MarketplaceAIProductAutosuggest.tsx +181 -0
  104. package/src/pages/Agents/MarketplaceAIProductCards.tsx +111 -0
  105. package/src/pages/Agents/MarketplaceAIScopeSelector.tsx +84 -0
  106. package/src/pages/Lakehouse/entitlements/EntitlementsClosedContractsDashboard.tsx +131 -136
  107. package/src/pages/Lakehouse/entitlements/EntitlementsPendingContractsDashboard.tsx +158 -165
  108. package/src/pages/Lakehouse/entitlements/EntitlementsPendingTasksDashboard.tsx +12 -17
  109. package/src/pages/Lakehouse/entitlements/PermitDataAccessRequest.tsx +245 -0
  110. package/src/pages/Lakehouse/entitlements/WorkflowDataAccessRequest.tsx +25 -94
  111. package/src/pages/Lakehouse/entitlements/showTaskActionAlert.tsx +101 -0
  112. package/src/pages/Lakehouse/searchResults/LegendMarketplaceSearchResults.tsx +27 -31
  113. package/src/stores/LegendMarketplaceBaseStore.ts +12 -0
  114. package/src/stores/ai/LegendMarketplaceAIChatStore.ts +1720 -0
  115. package/src/stores/lakehouse/LegendMarketplaceProductViewerStore.ts +6 -0
  116. package/src/stores/lakehouse/dataProducts/ProductCardState.ts +3 -4
  117. package/src/stores/lakehouse/entitlements/EntitlementsDashboardState.ts +181 -48
  118. package/src/utils/EntitlementsUtils.tsx +341 -86
  119. package/src/utils/SearchUtils.tsx +7 -4
  120. package/tsconfig.json +9 -0
@@ -15,14 +15,12 @@
15
15
  */
16
16
 
17
17
  import {
18
- type V1_LiteDataContract,
19
- GraphManagerState,
20
18
  V1_AdhocTeam,
19
+ V1_ContractState,
21
20
  V1_LiteDataContractWithUserStatus,
22
21
  } from '@finos/legend-graph';
23
22
  import {
24
23
  DataGrid,
25
- type DataGridCellClickedEvent,
26
24
  type DataGridColumnDefinition,
27
25
  } from '@finos/legend-lego/data-grid';
28
26
  import {
@@ -32,33 +30,45 @@ import {
32
30
  FormGroup,
33
31
  Switch,
34
32
  } from '@mui/material';
35
- import { useMemo, useState } from 'react';
36
- import type {
37
- ContractCreatedByUserDetails,
38
- EntitlementsDashboardState,
39
- } from '../../../stores/lakehouse/entitlements/EntitlementsDashboardState.js';
33
+ import { useEffect, useMemo, useState } from 'react';
34
+ import { startCase } from '@finos/legend-shared';
35
+ import type { EntitlementsDashboardState } from '../../../stores/lakehouse/entitlements/EntitlementsDashboardState.js';
40
36
  import { useLegendMarketplaceBaseStore } from '../../../application/providers/LegendMarketplaceFrameworkProvider.js';
41
37
  import { observer } from 'mobx-react-lite';
42
38
  import { useAuth } from 'react-oidc-context';
43
39
  import {
40
+ type ContractErrorLayer,
44
41
  DataAccessRequestViewer,
45
- DataContractViewerState,
46
42
  isApprovalStatusTerminal,
47
43
  isContractInTerminalState,
48
44
  } from '@finos/legend-extension-dsl-data-product';
49
- import {
50
- generateContractPagePath,
51
- generateLakehouseDataProductPath,
52
- } from '../../../__lib__/LegendMarketplaceNavigation.js';
53
45
  import { flowResult } from 'mobx';
54
- import { getCommonEntitlementsColDefs } from '../../../utils/EntitlementsUtils.js';
46
+ import {
47
+ getCommonEntitlementsColDefs,
48
+ type EntitlementsRow,
49
+ getSelectedRowId,
50
+ getSelectedContractGuid,
51
+ EntitlementsColumnHeader,
52
+ ENTITLEMENTS_DEFAULT_COL_DEF,
53
+ ROW_KIND_CONTRACT,
54
+ ROW_KIND_REQUEST,
55
+ TERMINAL_DATA_REQUEST_STATES,
56
+ UNKNOWN,
57
+ useSelectedViewerState,
58
+ useGetDataProductUrl,
59
+ } from '../../../utils/EntitlementsUtils.js';
55
60
 
56
61
  export const EntitlementsClosedContractsDashboard = observer(
57
62
  (props: { dashboardState: EntitlementsDashboardState }): React.ReactNode => {
58
63
  const { dashboardState } = props;
59
- const { allContractsForUser, allContractsCreatedByUser } = dashboardState;
64
+ const {
65
+ allContractsForUser,
66
+ allContractsCreatedByUser,
67
+ dataRequestsCreatedByUser,
68
+ } = dashboardState;
60
69
  const marketplaceBaseStore = useLegendMarketplaceBaseStore();
61
70
  const auth = useAuth();
71
+ const getDataProductUrl = useGetDataProductUrl();
62
72
 
63
73
  const myClosedContracts = useMemo(
64
74
  () =>
@@ -81,102 +91,109 @@ export const EntitlementsClosedContractsDashboard = observer(
81
91
  [allContractsCreatedByUser, myClosedContractIds],
82
92
  );
83
93
 
84
- const [selectedContract, setSelectedContract] = useState<
85
- V1_LiteDataContract | undefined
94
+ const closedDataRequests = useMemo(
95
+ () =>
96
+ (dataRequestsCreatedByUser ?? []).filter((dr) =>
97
+ TERMINAL_DATA_REQUEST_STATES.has(dr.dataRequest.state),
98
+ ),
99
+ [dataRequestsCreatedByUser],
100
+ );
101
+
102
+ const [selectedRow, setSelectedRow] = useState<
103
+ EntitlementsRow | undefined
86
104
  >();
87
- const [unverifiedIngestDefinitions, setUnverifiedIngestDefinitions] =
88
- useState<string[] | undefined>(undefined);
89
- const [ingestVerificationInProgress, setIngestVerificationInProgress] =
90
- useState(false);
105
+ const [contractErrors, setContractErrors] = useState<
106
+ ContractErrorLayer | undefined
107
+ >(undefined);
91
108
  const [showForOthers, setShowForOthers] = useState<boolean>(
92
109
  myClosedContracts.length === 0 && closedContractsForOthers.length > 0,
93
110
  );
94
111
 
95
- const handleCellClicked = async (
96
- event: DataGridCellClickedEvent<
97
- V1_LiteDataContractWithUserStatus | ContractCreatedByUserDetails
98
- >,
99
- ) => {
100
- const contract = event.data?.contractResultLite;
101
- setSelectedContract(contract);
102
- setUnverifiedIngestDefinitions(undefined);
103
- if (contract !== undefined) {
104
- setIngestVerificationInProgress(true);
105
- const result = await flowResult(
106
- dashboardState.getUnverifiedIngestDefinitions(
112
+ useEffect(() => {
113
+ setContractErrors(undefined);
114
+ if (selectedRow?.kind === ROW_KIND_CONTRACT) {
115
+ const contract = selectedRow.data.contractResultLite;
116
+ const isCompleted = contract.state === V1_ContractState.COMPLETED;
117
+ dashboardState
118
+ .getContractErrors(
107
119
  contract.guid,
108
120
  auth.user?.access_token,
109
- ),
110
- );
111
- setUnverifiedIngestDefinitions(result);
112
- setIngestVerificationInProgress(false);
121
+ isCompleted,
122
+ )
123
+ .then((result) => setContractErrors(result))
124
+ .catch(() => setContractErrors(undefined));
113
125
  }
114
- };
115
-
116
- const defaultColDef: DataGridColumnDefinition<
117
- V1_LiteDataContractWithUserStatus | ContractCreatedByUserDetails
118
- > = useMemo(
119
- () => ({
120
- minWidth: 50,
121
- sortable: true,
122
- resizable: true,
123
- flex: 1,
124
- }),
125
- [],
126
- );
126
+ }, [selectedRow, auth.user?.access_token, dashboardState]);
127
127
 
128
- const colDefs: DataGridColumnDefinition<
129
- V1_LiteDataContractWithUserStatus | ContractCreatedByUserDetails
130
- >[] = useMemo(
131
- () => [
132
- ...getCommonEntitlementsColDefs(dashboardState),
133
- {
134
- headerName: 'State',
135
- valueGetter: (params) =>
136
- params.data instanceof V1_LiteDataContractWithUserStatus
137
- ? params.data.status
138
- : (params.data?.contractResultLite.state ?? 'Unknown'),
139
- },
140
- {
141
- headerName: 'Business Justification',
142
- valueGetter: (p) => p.data?.contractResultLite.description,
143
- },
144
- {
145
- hide: true,
146
- headerName: 'Contract ID',
147
- valueGetter: (p) => p.data?.contractResultLite.guid,
148
- },
149
- ],
150
- [dashboardState],
151
- );
128
+ const selectedRowId = getSelectedRowId(selectedRow);
152
129
 
153
- const gridRowData = useMemo(
154
- () =>
155
- showForOthers
156
- ? [...myClosedContracts, ...closedContractsForOthers]
157
- : myClosedContracts,
158
- [myClosedContracts, closedContractsForOthers, showForOthers],
130
+ const selectedViewerState = useSelectedViewerState(
131
+ selectedRow,
132
+ selectedRowId,
159
133
  );
160
134
 
161
135
  const getInitialUserForViewer = (): string | undefined => {
136
+ if (selectedRow?.kind !== ROW_KIND_CONTRACT) {
137
+ return undefined;
138
+ }
139
+ const contract = selectedRow.data.contractResultLite;
162
140
  const currentUser =
163
- dashboardState.lakehouseEntitlementsStore.applicationStore
164
- .identityService.currentUser;
165
- if (selectedContract && myClosedContractIds.has(selectedContract.guid)) {
141
+ marketplaceBaseStore.applicationStore.identityService.currentUser;
142
+ if (myClosedContractIds.has(contract.guid)) {
166
143
  return currentUser;
167
144
  }
168
145
  if (
169
- selectedContract &&
170
- selectedContract.consumer instanceof V1_AdhocTeam &&
171
- selectedContract.consumer.users.some(
172
- (user) => user.name === currentUser,
173
- )
146
+ contract.consumer instanceof V1_AdhocTeam &&
147
+ contract.consumer.users.some((user) => user.name === currentUser)
174
148
  ) {
175
149
  return currentUser;
176
150
  }
177
151
  return undefined;
178
152
  };
179
153
 
154
+ const selectedContractGuid = getSelectedContractGuid(selectedRow);
155
+
156
+ const colDefs: DataGridColumnDefinition<EntitlementsRow>[] = useMemo(
157
+ () => [
158
+ ...getCommonEntitlementsColDefs(dashboardState),
159
+ {
160
+ headerName: EntitlementsColumnHeader.STATE,
161
+ valueGetter: (params) => {
162
+ if (!params.data) {
163
+ return UNKNOWN;
164
+ }
165
+ if (params.data.kind === ROW_KIND_CONTRACT) {
166
+ return params.data.data instanceof
167
+ V1_LiteDataContractWithUserStatus
168
+ ? params.data.data.status
169
+ : params.data.data.contractResultLite.state;
170
+ }
171
+ return startCase(params.data.data.dataRequest.state);
172
+ },
173
+ },
174
+ ],
175
+ [dashboardState],
176
+ );
177
+
178
+ const gridRowData: EntitlementsRow[] = useMemo(() => {
179
+ const contracts = showForOthers
180
+ ? [...myClosedContracts, ...closedContractsForOthers]
181
+ : myClosedContracts;
182
+ return [
183
+ ...contracts.map(
184
+ (c): EntitlementsRow => ({ kind: ROW_KIND_CONTRACT, data: c }),
185
+ ),
186
+ ...closedDataRequests.map(
187
+ (r): EntitlementsRow => ({ kind: ROW_KIND_REQUEST, data: r }),
188
+ ),
189
+ ];
190
+ }, [
191
+ showForOthers,
192
+ myClosedContracts,
193
+ closedContractsForOthers,
194
+ closedDataRequests,
195
+ ]);
196
+
180
197
  return (
181
198
  <Box className="marketplace-lakehouse-entitlements__completed-contracts">
182
199
  <FormGroup className="marketplace-lakehouse-entitlements__completed-contracts__action-btns">
@@ -212,62 +229,40 @@ export const EntitlementsClosedContractsDashboard = observer(
212
229
  suppressFieldDotNotation={true}
213
230
  suppressContextMenu={false}
214
231
  columnDefs={colDefs}
215
- onCellClicked={(
216
- event: DataGridCellClickedEvent<
217
- V1_LiteDataContractWithUserStatus | ContractCreatedByUserDetails
218
- >,
219
- ) =>
220
- // eslint-disable-next-line no-void
221
- void handleCellClicked(event)
222
- }
223
- defaultColDef={defaultColDef}
232
+ onCellClicked={(event) => event.data && setSelectedRow(event.data)}
233
+ defaultColDef={ENTITLEMENTS_DEFAULT_COL_DEF}
224
234
  rowHeight={45}
225
- overlayNoRowsTemplate="You have no closed contracts"
226
- loading={dashboardState.fetchingContractsForUserState.isInProgress}
227
- overlayLoadingTemplate="Loading contracts"
235
+ overlayNoRowsTemplate="You have no closed contracts or data requests"
236
+ loading={
237
+ dashboardState.fetchingContractsForUserState.isInProgress ||
238
+ dashboardState.fetchingDataRequestsCreatedByUserState.isInProgress
239
+ }
240
+ overlayLoadingTemplate="Loading"
228
241
  />
229
242
  </Box>
230
- {selectedContract !== undefined && !ingestVerificationInProgress && (
243
+ {selectedRow !== undefined && selectedViewerState !== undefined && (
231
244
  <DataAccessRequestViewer
232
245
  open={true}
233
246
  onClose={() => {
234
- setSelectedContract(undefined);
235
- setUnverifiedIngestDefinitions(undefined);
236
- setIngestVerificationInProgress(false);
247
+ setSelectedRow(undefined);
248
+ setContractErrors(undefined);
237
249
  }}
238
- unverifiedIngestDefinitions={unverifiedIngestDefinitions}
239
- viewerState={
240
- new DataContractViewerState(
241
- selectedContract,
242
- (contractId: string, taskId: string) =>
243
- marketplaceBaseStore.applicationStore.navigationService.navigator.generateAddress(
244
- generateContractPagePath(contractId, taskId),
245
- ),
246
- undefined,
247
- marketplaceBaseStore.applicationStore,
248
- marketplaceBaseStore.lakehouseContractServerClient,
249
- new GraphManagerState(
250
- marketplaceBaseStore.applicationStore.pluginManager,
251
- marketplaceBaseStore.applicationStore.logService,
252
- ),
253
- marketplaceBaseStore.userSearchService,
254
- )
255
- }
250
+ contractErrors={contractErrors}
251
+ viewerState={selectedViewerState}
256
252
  initialSelectedUser={getInitialUserForViewer()}
257
- onRefresh={async () => {
258
- await flowResult(
259
- dashboardState.updateContract(
260
- selectedContract.guid,
261
- auth.user?.access_token,
262
- ),
263
- );
264
- }}
265
- getDataProductUrl={(dataProductId: string, deploymentId: number) =>
266
- marketplaceBaseStore.applicationStore.navigationService.navigator.generateAddress(
267
- generateLakehouseDataProductPath(dataProductId, deploymentId),
268
- )
269
- }
270
- //Derives environment from the fact that other environments are filtered out
253
+ {...(selectedContractGuid
254
+ ? {
255
+ onRefresh: async () => {
256
+ await flowResult(
257
+ dashboardState.updateContract(
258
+ selectedContractGuid,
259
+ auth.user?.access_token,
260
+ ),
261
+ );
262
+ },
263
+ }
264
+ : {})}
265
+ getDataProductUrl={getDataProductUrl}
271
266
  dataProductEnvironment={
272
267
  marketplaceBaseStore.envState.lakehouseEnvironment
273
268
  }