UNPKG

@finos/legend-extension-dsl-data-quality

Version:
50 lines 3.37 kB
import { jsx as _jsx, 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 { Dialog, ModalBody, ModalFooter, Modal, ModalFooterButton, ModalHeader, TreeView, } from '@finos/legend-art'; import { DataQualityConstraintsTreeNodeContainer, getQueryBuilderExplorerTreeNodeSortRank, } from './DataQualityConstraintsSelection.js'; import { DataQualityGraphFetchTreeNodeData } from './utils/DataQualityGraphFetchTreeUtil.js'; export const DataQualityStructuralValidationsPanel = observer((props) => { const { dataQualityState } = props; const { structuralValidationsGraphFetchTreeState } = dataQualityState; const structureValidationsTree = structuralValidationsGraphFetchTreeState.treeData; if (!structureValidationsTree) { return null; } const closePlanViewer = () => { dataQualityState.setShowStructuralValidations(false); }; const isDarkMode = !dataQualityState.applicationStore.layoutService .TEMPORARY__isLightColorThemeEnabled; const getChildNodes = (node) => node.childrenIds .map((id) => structureValidationsTree.nodes.get(id)) .filter((_node) => _node instanceof DataQualityGraphFetchTreeNodeData) .sort((a, b) => a.label.localeCompare(b.label)) .sort((a, b) => getQueryBuilderExplorerTreeNodeSortRank(b) - getQueryBuilderExplorerTreeNodeSortRank(a)); return (_jsx(Dialog, { open: dataQualityState.showStructuralValidations, onClose: closePlanViewer, classes: { root: 'data-quality-editor-modal__root-container', container: 'data-quality-editor-modal__container', paper: 'data-quality-editor-modal__content', }, children: _jsxs(Modal, { className: "data-quality-editor-modal", darkMode: isDarkMode, children: [_jsx(ModalHeader, { title: "Structural Attributes" }), _jsx(ModalBody, { children: _jsx("div", { className: "data-quality-validation-graph-fetch-constraints-selection", children: _jsx("div", { className: "data-quality-validation-graph-fetch-constraints-selection__config-group__item", children: _jsx(TreeView, { components: { TreeNodeContainer: DataQualityConstraintsTreeNodeContainer, }, className: "data-quality-validation-graph-fetch-tree__container__tree", treeData: structureValidationsTree, getChildNodes: getChildNodes, innerProps: { dataQualityState, isReadOnly: true, } }) }) }) }), _jsx(ModalFooter, { children: _jsx(ModalFooterButton, { onClick: closePlanViewer, text: "Close", type: "secondary" }) })] }) })); }); //# sourceMappingURL=DataQualityStructuralValidationsPanel.js.map