Skip to content

add session check on route #32

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
May 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 15 additions & 17 deletions configuration/configuration.ts
Original file line number Diff line number Diff line change
@@ -1,20 +1,22 @@
import process from 'process';
import process from "process";

import {
Environment,
OrchestratorConfig,
} from '@orchestrator-ui/orchestrator-ui-components';
} from "@orchestrator-ui/orchestrator-ui-components";

export const DEFAULT_GRAPHQL_CORE_ENDPOINT =
'http://localhost:8080/api/graphql';
export const DEFAULT_ORCHESTRATOR_API_BASE_URL = 'http://localhost:8080/api';
export const DEFAULT_ORCHESTRATOR_WEBSOCKET_URL = 'ws://localhost:8080';
"http://localhost:8080/api/graphql";
export const DEFAULT_ORCHESTRATOR_API_BASE_URL = "http://localhost:8080/api";
export const DEFAULT_ORCHESTRATOR_WEBSOCKET_URL = "ws://localhost:8080";

export const ENGINE_STATUS_ENDPOINT = '/settings/status';
export const PROCESSES_ENDPOINT = '/processes';
export const ENGINE_STATUS_ENDPOINT = "/settings/status";
export const PROCESS_STATUS_COUNTS_ENDPOINT = "/processes/status-counts";
export const PROCESSES_ENDPOINT = "/processes";
export const SUBSCRIPTION_ACTIONS_ENDPOINT = "/subscriptions/workflows";
export const SUBSCRIPTION_PROCESSES_ENDPOINT =
'/processes/process-subscriptions-by-subscription-id';
export const DEFAULT_WORKFLOW_INFORMATION_LINK_URL = 'http://localhost:8080';
"/processes/process-subscriptions-by-subscription-id";
export const DEFAULT_WORKFLOW_INFORMATION_LINK_URL = "http://localhost:8080";

export const getInitialOrchestratorConfig = (): OrchestratorConfig => {
const orchestratorGraphqlBaseUrl =
Expand All @@ -30,24 +32,20 @@ export const getInitialOrchestratorConfig = (): OrchestratorConfig => {

return {
orchestratorApiBaseUrl,
engineStatusEndpoint: orchestratorApiBaseUrl + ENGINE_STATUS_ENDPOINT,
graphqlEndpointCore: orchestratorGraphqlBaseUrl,
processesEndpoint: orchestratorApiBaseUrl + PROCESSES_ENDPOINT,
environmentName:
process.env.ENVIRONMENT_NAME ?? Environment.DEVELOPMENT,
subscriptionProcessesEndpoint:
orchestratorApiBaseUrl + SUBSCRIPTION_PROCESSES_ENDPOINT,
orchestratorWebsocketUrl:
process.env.ORCHESTRATOR_WEBSOCKET_URL ||
DEFAULT_ORCHESTRATOR_WEBSOCKET_URL,
authActive: process.env.AUTH_ACTIVE?.toLowerCase() != 'false',
useWebSockets: process.env.USE_WEB_SOCKETS?.toLowerCase() === 'true',
useThemeToggle: process.env.USE_THEME_TOGGLE?.toLowerCase() === 'true',
authActive: process.env.AUTH_ACTIVE?.toLowerCase() != "false",
useWebSockets: process.env.USE_WEB_SOCKETS?.toLowerCase() === "true",
useThemeToggle: process.env.USE_THEME_TOGGLE?.toLowerCase() === "true",
workflowInformationLinkUrl:
process.env.WORKFLOW_INFORMATION_LINK_URL ??
DEFAULT_WORKFLOW_INFORMATION_LINK_URL,
showWorkflowInformationLink:
process.env.SHOW_WORKFLOW_INFORMATION_LINK?.toLowerCase() ===
'true',
"true",
};
};
50 changes: 10 additions & 40 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

97 changes: 47 additions & 50 deletions pages/_app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ import { QueryParamProvider } from 'use-query-params';
import { EuiProvider, EuiThemeColorMode } from '@elastic/eui';
import '@elastic/eui/dist/eui_theme_light.min.css';
import {
ApiClientContextProvider,
ColorModes,
ConfirmationDialogContextWrapper,
OrchestratorConfig,
Expand All @@ -22,6 +21,7 @@ import {
WfoAuth,
WfoErrorBoundary,
WfoPageTemplate,
WfoRouteChangeListener,
WfoToastsList,
defaultOrchestratorTheme,
} from '@orchestrator-ui/orchestrator-ui-components';
Expand Down Expand Up @@ -77,64 +77,61 @@ function CustomApp({
initialOrchestratorConfig={orchestratorConfig}
>
<StoreProvider initialOrchestratorConfig={orchestratorConfig}>
<WfoRouteChangeListener />
<SessionProvider session={pageProps.session}>
<NoSSR>
<WfoAuth>
<EuiProvider
colorMode={themeMode}
modify={defaultOrchestratorTheme}
>
<ApiClientContextProvider>
<QueryClientProvider
client={queryClient}
contextSharing={true}
>
<TranslationsProvider>
<Head>
<link
rel="icon"
href="/favicon.png"
/>
<title>
Welcome to
example-orchestrator-ui!
</title>
</Head>
<main className="app">
<ConfirmationDialogContextWrapper>
<WfoPageTemplate
getAppLogo={
getAppLogo
}
onThemeSwitch={
handleThemeSwitch
<QueryClientProvider
client={queryClient}
contextSharing={true}
>
<TranslationsProvider>
<Head>
<link
rel="icon"
href="/favicon.png"
/>
<title>
Welcome to
example-orchestrator-ui!
</title>
</Head>
<main className="app">
<ConfirmationDialogContextWrapper>
<WfoPageTemplate
getAppLogo={getAppLogo}
onThemeSwitch={
handleThemeSwitch
}
>
<QueryParamProvider
adapter={
NextAdapter
}
options={{
removeDefaultsFromUrl:
false,
enableBatching:
true,
}}
>
<QueryParamProvider
adapter={
NextAdapter
}
options={{
removeDefaultsFromUrl:
false,
enableBatching:
true,
}}
>
<Component
{...pageProps}
/>
</QueryParamProvider>
</WfoPageTemplate>
<WfoToastsList />
</ConfirmationDialogContextWrapper>
<ReactQueryDevtools
initialIsOpen={false}
/>
</main>
</TranslationsProvider>
</QueryClientProvider>
</ApiClientContextProvider>
<Component
{...pageProps}
/>
</QueryParamProvider>
</WfoPageTemplate>
<WfoToastsList />
</ConfirmationDialogContextWrapper>
<ReactQueryDevtools
initialIsOpen={false}
/>
</main>
</TranslationsProvider>
</QueryClientProvider>
</EuiProvider>
</WfoAuth>
</NoSSR>
Expand Down