mirror of
https://github.com/graphql-hive/console
synced 2026-05-24 01:28:32 +00:00
[hive/app] remove use client comments, remove globalThis.window checks (#5004)
This commit is contained in:
parent
4c940ba070
commit
0c04caf5b3
15 changed files with 13 additions and 50 deletions
|
|
@ -1,5 +1,3 @@
|
|||
'use client';
|
||||
|
||||
import React from 'react';
|
||||
import { ChevronDown } from 'lucide-react';
|
||||
import { cn } from '@/lib/utils';
|
||||
|
|
|
|||
|
|
@ -1,5 +1,3 @@
|
|||
'use client';
|
||||
|
||||
import React from 'react';
|
||||
import { buttonVariants } from '@/components/ui/button';
|
||||
import { cn } from '@/lib/utils';
|
||||
|
|
|
|||
|
|
@ -1,5 +1,3 @@
|
|||
'use client';
|
||||
|
||||
import React from 'react';
|
||||
import { DayPicker } from 'react-day-picker';
|
||||
import { cn } from '@/lib/utils';
|
||||
|
|
|
|||
|
|
@ -1,5 +1,3 @@
|
|||
'use client';
|
||||
|
||||
import React from 'react';
|
||||
import { Command as CommandPrimitive } from 'cmdk';
|
||||
import { Search } from 'lucide-react';
|
||||
|
|
|
|||
|
|
@ -1,5 +1,3 @@
|
|||
'use client';
|
||||
|
||||
import React from 'react';
|
||||
import { X } from 'lucide-react';
|
||||
import { cn } from '@/lib/utils';
|
||||
|
|
|
|||
|
|
@ -1,5 +1,3 @@
|
|||
'use client';
|
||||
|
||||
import React from 'react';
|
||||
import { cn } from '@/lib/utils';
|
||||
import * as HoverCardPrimitive from '@radix-ui/react-hover-card';
|
||||
|
|
|
|||
|
|
@ -1,5 +1,3 @@
|
|||
'use client';
|
||||
|
||||
import React from 'react';
|
||||
import { cva, type VariantProps } from 'class-variance-authority';
|
||||
import { cn } from '@/lib/utils';
|
||||
|
|
|
|||
|
|
@ -1,5 +1,3 @@
|
|||
'use client';
|
||||
|
||||
import React from 'react';
|
||||
import { cn } from '@/lib/utils';
|
||||
import * as PopoverPrimitive from '@radix-ui/react-popover';
|
||||
|
|
|
|||
|
|
@ -1,5 +1,3 @@
|
|||
'use client';
|
||||
|
||||
import React from 'react';
|
||||
import { Circle } from 'lucide-react';
|
||||
import { cn } from '@/lib/utils';
|
||||
|
|
|
|||
|
|
@ -1,5 +1,3 @@
|
|||
'use client';
|
||||
|
||||
import React from 'react';
|
||||
import { cn } from '@/lib/utils';
|
||||
import * as ScrollAreaPrimitive from '@radix-ui/react-scroll-area';
|
||||
|
|
|
|||
|
|
@ -1,5 +1,3 @@
|
|||
'use client';
|
||||
|
||||
import React from 'react';
|
||||
import { cn } from '@/lib/utils';
|
||||
import * as SwitchPrimitives from '@radix-ui/react-switch';
|
||||
|
|
|
|||
|
|
@ -1,5 +1,3 @@
|
|||
'use client';
|
||||
|
||||
import {
|
||||
Toast,
|
||||
ToastClose,
|
||||
|
|
|
|||
|
|
@ -23,18 +23,18 @@ export const frontendConfig = () => {
|
|||
if (
|
||||
env.auth.okta !== null &&
|
||||
(env.auth.okta.hidden === false ||
|
||||
globalThis.window?.location.pathname === '/auth/callback/okta' ||
|
||||
window.location.pathname === '/auth/callback/okta' ||
|
||||
// Until we support the Okta Integration Network (OIN)
|
||||
// We want to hide the log in with Okta button on the hosted platform by default to not confuse people
|
||||
// We only want to show it conditionally in order to verify the integration is working for the OIN application process.
|
||||
(env.auth.okta.hidden === true &&
|
||||
// Only show Okta via query parameter
|
||||
new URLSearchParams(globalThis.window?.location.search ?? '').get('show_okta') === '1'))
|
||||
new URLSearchParams(window.location.search ?? '').get('show_okta') === '1'))
|
||||
) {
|
||||
providers.push(ThirdPartyEmailPasswordReact.Okta.init());
|
||||
}
|
||||
|
||||
const url = new URL(globalThis.window.location.toString());
|
||||
const url = new URL(window.location.toString());
|
||||
|
||||
if (
|
||||
env.auth.oidc === true && // Open ID Connect linked to organization
|
||||
|
|
|
|||
13
packages/web/app/src/env/read.ts
vendored
13
packages/web/app/src/env/read.ts
vendored
|
|
@ -1,14 +1,3 @@
|
|||
function isBrowser() {
|
||||
// eslint-disable-next-line no-restricted-syntax
|
||||
return Boolean(
|
||||
typeof window !== 'undefined' && '__ENV' in window && window['__ENV'] !== undefined,
|
||||
);
|
||||
}
|
||||
|
||||
export function getAllEnv(): Record<string, string | undefined> {
|
||||
if (isBrowser()) {
|
||||
return (window as any)['__ENV'] ?? {};
|
||||
}
|
||||
|
||||
throw new Error('getAllEnv should only be called in the browser');
|
||||
return (window as any).__ENV ?? {};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -70,17 +70,15 @@ import { TargetInsightsOperationPage } from './pages/target-insights-operation';
|
|||
import { TargetLaboratoryPage } from './pages/target-laboratory';
|
||||
import { TargetSettingsPage } from './pages/target-settings';
|
||||
|
||||
if (globalThis.window) {
|
||||
SuperTokens.init(frontendConfig());
|
||||
if (env.sentry) {
|
||||
init({
|
||||
dsn: env.sentry.dsn,
|
||||
enabled: true,
|
||||
dist: 'webapp',
|
||||
release: env.release,
|
||||
environment: env.environment,
|
||||
});
|
||||
}
|
||||
SuperTokens.init(frontendConfig());
|
||||
if (env.sentry) {
|
||||
init({
|
||||
dsn: env.sentry.dsn,
|
||||
enabled: true,
|
||||
dist: 'webapp',
|
||||
release: env.release,
|
||||
environment: env.environment,
|
||||
});
|
||||
}
|
||||
|
||||
const queryClient = new QueryClient();
|
||||
|
|
|
|||
Loading…
Reference in a new issue