/** * 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 { LEGEND_QUERY_ROUTE_PATTERN } from '../__lib__/LegendQueryNavigation.js'; import { QuerySetupLandingPage } from './QuerySetup.js'; import { ExistingQueryEditor, MappingQueryCreator, ServiceQueryCreator, } from './QueryEditor.js'; import { BrowserEnvironmentProvider, generateExtensionUrlPattern, Route, Routes, } from '@finos/legend-application/browser'; import { LegendTokenSync } from '@finos/legend-application'; import { LegendQueryFrameworkProvider, useLegendQueryApplicationStore, useLegendQueryBaseStore, } from './LegendQueryFrameworkProvider.js'; import { EditExistingQuerySetup } from './EditExistingQuerySetup.js'; import { CreateMappingQuerySetup } from './CreateMappingQuerySetup.js'; import { useEffect } from 'react'; import { flowResult } from 'mobx'; import { LEGACY_DATA_SPACE_QUERY_ROUTE_PATTERN } from '../__lib__/DSL_DataSpace_LegendQueryNavigation.js'; import { DataSpaceTemplateQueryCreator } from './data-space/DataSpaceTemplateQueryCreator.js'; import { QueryCreator } from './data-space/DataProductQueryCreator.js'; import { DataProductSampleQueryCreator } from './data-product/DataProductSampleQueryCreator.js'; import { IngestQueryCreator } from './ingest/IngestQueryCreator.js'; import { ExistingQueryDataCubeViewer } from './data-cube/ExistingQueryDataCubeViewer.js'; import { DataSpaceArtifactInspector } from './DataSpaceArtifactInspector.js'; import { AuthProvider, withAuthenticationRequired, type AuthProviderProps, } from 'react-oidc-context'; import type { User } from 'oidc-client-ts'; import { CubesLoadingIndicator, CubesLoadingIndicatorIcon, } from '@finos/legend-art'; const LegendQueryWebApplicationRouter = observer(() => { const applicationStore = useLegendQueryApplicationStore(); const baseStore = useLegendQueryBaseStore(); const extraApplicationPageEntries = applicationStore.pluginManager .getApplicationPlugins() .flatMap((plugin) => plugin.getExtraApplicationPageEntries?.() ?? []); useEffect(() => { flowResult(baseStore.initialize()).catch( applicationStore.alertUnhandledError, ); }, [applicationStore, baseStore]); return (