UNPKG

@finos/legend-application-marketplace

Version:
85 lines 4.5 kB
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime"; /** * Copyright (c) 2020-present, Goldman Sachs * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ import { observer } from 'mobx-react-lite'; import { CubesLoadingIndicator, CubesLoadingIndicatorIcon, } from '@finos/legend-art'; import { DataGrid, } from '@finos/legend-lego/data-grid'; import { Box } from '@mui/material'; import {} from '@finos/legend-graph'; import { useState } from 'react'; import { EntitlementsDataContractViewer } from '../entitlements/EntitlementsDataContractViewer.js'; import { EntitlementsDataContractViewerState } from '../../../stores/lakehouse/entitlements/EntitlementsDataContractViewerState.js'; export const LakehouseAdminContractsDashboard = observer((props) => { const { adminStore } = props; const contracts = adminStore.contracts; const [selectedContract, setSelectedContract] = useState(); const handleRowClicked = (event) => { setSelectedContract(event.data); }; return (_jsxs(_Fragment, { children: [_jsx(CubesLoadingIndicator, { isLoading: Boolean(adminStore.contractsInitializationState.isInProgress), children: _jsx(CubesLoadingIndicatorIcon, {}) }), _jsx(Box, { className: "marketplace-lakehouse-admin__contracts__grid ag-theme-balham", children: _jsx(DataGrid, { rowData: contracts, onRowDataUpdated: (params) => { params.api.refreshCells({ force: true }); }, suppressFieldDotNotation: true, suppressContextMenu: false, onRowClicked: handleRowClicked, columnDefs: [ { minWidth: 50, sortable: true, resizable: true, headerName: 'Contract Id', valueGetter: (p) => p.data?.guid, flex: 2, }, { minWidth: 50, sortable: true, resizable: true, headerName: 'Contract Description', valueGetter: (p) => p.data?.description, flex: 2, }, { minWidth: 10, sortable: true, resizable: true, headerName: 'Version', valueGetter: (p) => p.data?.version, flex: 1, }, { minWidth: 50, sortable: true, resizable: true, headerName: 'State', valueGetter: (p) => p.data?.state, flex: 2, }, { minWidth: 50, sortable: true, resizable: true, headerName: 'Members', valueGetter: (p) => p.data?.members.map((m) => m.user), flex: 1, }, { minWidth: 50, sortable: true, resizable: true, headerName: 'Created By', valueGetter: (p) => p.data?.createdBy, flex: 1, }, ] }) }), selectedContract !== undefined && (_jsx(EntitlementsDataContractViewer, { open: true, currentViewer: new EntitlementsDataContractViewerState(selectedContract, adminStore.lakehouseContractServerClient), onClose: () => setSelectedContract(undefined) }))] })); }); //# sourceMappingURL=LakehouseAdminContractsDashboard.js.map