/** * 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 { getElementIcon, useEditorStore, } from '@finos/legend-application-studio'; import { clsx, CheckCircleIcon, EyeIcon, LockIcon, Panel, PanelContent, } from '@finos/legend-art'; import { DataSpaceEditorState } from '../stores/DataSpaceEditorState.js'; import { DataSpaceGeneralEditor } from './DataSpaceGeneralEditor/DataSpaceGeneralEditor.js'; import { DataSpacePreviewState } from '../stores/DataSpacePreviewState.js'; import { flowResult } from 'mobx'; import { useEffect } from 'react'; import { isStubbed_PackageableElement } from '@finos/legend-graph'; import { resolveExecutionContextMapping } from '@finos/legend-extension-dsl-data-space/graph'; import { DSL_DATA_SPACE_LEGEND_STUDIO_APPLICATION_NAVIGATION_CONTEXT_KEY } from '../__lib__/DSL_DataSpace_LegendStudioDocumentation.js'; import { useApplicationNavigationContext } from '@finos/legend-application'; const DataSpaceEditorHeader = observer( (props: { dataSpaceState: DataSpaceEditorState; canPreview: boolean; onPreview: () => void; }) => { const { dataSpaceState, canPreview, onPreview } = props; const editorStore = useEditorStore(); const dataSpace = dataSpaceState.dataSpace; const statuses = [ dataSpaceState.isVerified && { label: 'Verified', kind: 'verified', title: 'Marked as verified', }, dataSpaceState.isInDevelopment && { label: 'In development', kind: 'development', title: 'Marked as still in development', }, dataSpaceState.isExternal && { label: 'External', kind: 'external', title: 'Marked as externally sourced', }, dataSpaceState.deprecationNotice && { label: 'Deprecated', kind: 'deprecated', title: dataSpaceState.deprecationNotice, }, ].filter( (status): status is { label: string; kind: string; title: string } => Boolean(status), ); return (