Skip to content

Commit

Permalink
Fixed merge conflits and ts errors
Browse files Browse the repository at this point in the history
  • Loading branch information
tulsiojha committed Jan 14, 2024
1 parent 7a9b35a commit 23ba7bb
Show file tree
Hide file tree
Showing 11 changed files with 130 additions and 97 deletions.
104 changes: 60 additions & 44 deletions gql-queries-generator/doc/queries.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -1243,6 +1243,13 @@ query consoleListRouters($projectName: String!, $envName: String!, $search: Sear
recordVersion
spec {
domains
routes {
app
lambda
path
port
rewrite
}
}
status {
checks
Expand Down Expand Up @@ -3771,35 +3778,37 @@ mutation consoleDeleteConsoleVpnDevice($deviceName: String!) {
core_deleteVPNDevice(deviceName: $deviceName)
}

query authCli_CoreCheckNameAvailability($projectName: String!, $resType: ConsoleResType!, $name: String!) {
core_checkNameAvailability(
projectName: $projectName
resType: $resType
name: $name
) {
query authCli_CoreCheckNameAvailability($resType: ConsoleResType!, $name: String!) {
core_checkNameAvailability(resType: $resType, name: $name) {
result
suggestedNames
}
}

query authCli_listCoreDevices($pq: CursorPaginationIn) {
core_listVPNDevices(pq: $pq) {
edges {
cursor
node {
displayName
environmentName
metadata {
name
}
projectName
spec {
disabled
ports {
port
targetPort
}
}
query authCli_listCoreDevices {
core_listVPNDevicesForUser {
displayName
environmentName
metadata {
name
}
projectName
status {
isReady
message {
RawMessage
}
}
spec {
cnameRecords {
host
target
}
deviceNamespace
disabled
ports {
port
targetPort
}
}
}
Expand Down Expand Up @@ -4175,26 +4184,33 @@ mutation authCli_updateDevice($clusterName: String!, $vpnDevice: VPNDeviceIn!) {
}
}

query authCli_listDevices {
core_listVPNDevicesForUser {
displayName
environmentName
markedForDeletion
metadata {
name
namespace
}
projectName
spec {
cnameRecords {
host
target
}
deviceNamespace
disabled
ports {
port
targetPort
query authCli_listDevices($pq: CursorPaginationIn) {
infra_listVPNDevices(pq: $pq) {
edges {
node {
displayName
metadata {
name
}
spec {
deviceNamespace
disabled
nodeSelector
ports {
port
targetPort
}
}
status {
isReady
message {
RawMessage
}
}
wireguardConfig {
encoding
value
}
}
}
}
Expand Down
2 changes: 0 additions & 2 deletions src/apps/console/components/name-id-view.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,6 @@ export const NameIdView = forwardRef<HTMLInputElement, INameIdView>(
}, [displayName, name]);

const checkNameAvailable = () => {
console.log('inside ', errors);

if (errors) {
// onCheckError?.(true);
return errors;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,11 @@ import Breadcrum from '~/console/components/breadcrum';
import { CommonTabs } from '~/console/components/common-navbar-tabs';
import HandleScope from '~/console/page-components/new-scope';
import { GQLServerHandler } from '~/console/server/gql/saved-queries';
import { parseName, parseNodes } from '~/console/server/r-utils/common';
import {
ExtractNodeType,
parseName,
parseNodes,
} from '~/console/server/r-utils/common';
import {
ensureAccountClientSide,
ensureAccountSet,
Expand All @@ -40,7 +44,10 @@ import {
BreadcrumSlash,
tabIconSize,
} from '~/console/utils/commons';
import { IEnvironment } from '~/console/server/gql/queries/environment-queries';
import {
IEnvironment,
IEnvironments,
} from '~/console/server/gql/queries/environment-queries';
import { useActivePath } from '~/root/lib/client/hooks/use-active-path';
import { cn } from '~/components/utils';
import { IProjectContext } from '../_layout';
Expand Down Expand Up @@ -129,7 +136,9 @@ const CurrentBreadcrum = ({ environment }: { environment: IEnvironment }) => {
const params = useParams();

const [showPopup, setShowPopup] = useState<any>(null);
const [environments, setEnvironments] = useState<IEnvironment[]>([]);
const [environments, setEnvironments] = useState<
ExtractNodeType<IEnvironments>[]
>([]);

const api = useConsoleApi();
const [search, setSearch] = useState('');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ const RenderField = ({
errors,
fieldKey,
}: {
field: NN<ISelectedService>['service']['fields'][number];
field: NN<NN<ISelectedService>['service']>['fields'][number];
onChange: (e: string) => (e: { target: { value: any } }) => void;
value: any;
errors: Record<string, any>;
Expand Down Expand Up @@ -337,7 +337,7 @@ const HandleManagedResources = (props: IDialog) => {
return (
<Popup.Root show={visible} onOpenChange={(v) => setVisible(v)}>
<Popup.Header>
{isUpdate ? 'Edit managed service' : 'Add managed service'}
{isUpdate ? 'Edit managed resource' : 'Add managed resource'}
</Popup.Header>
{(!isUpdate || (isUpdate && props.data)) && <Root {...props} />}
</Popup.Root>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ const KlOperatorServices = () => {
return (
<Wrapper
header={{
title: 'Managed services',
title: 'Managed resources',
action: managedResources.length > 0 && (
<Button
variant="primary"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import { useMapper } from '~/components/utils';
import { NN } from '~/root/lib/types/common';
import { TextInput } from '~/components/atoms/input';
import { useEffect, useState } from 'react';
import { IApp } from '~/console/server/gql/queries/app-queries';
import { IApps } from '~/console/server/gql/queries/app-queries';
import { ModifiedRouter } from './_index';

type IDialog = IDialogBase<
Expand All @@ -33,7 +33,7 @@ const Root = (props: IDialog) => {
const reloadPage = useReload();

const { project: projectName, environment: envName } = useParams();
const [selectedApp, setSelectedApp] = useState<IApp>();
const [selectedApp, setSelectedApp] = useState<ExtractNodeType<IApps>>();

const {
data,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ const tabs = [
];

const Project = () => {
const rootContext = useOutletContext<IClusterContext>();
const rootContext = useOutletContext<IAccountContext>();
const { project, msvtemplates } = useLoaderData();
return (
<SubNavDataProvider>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ const RenderField = ({
errors,
fieldKey,
}: {
field: NN<ISelectedService>['service']['fields'][number];
field: NN<NN<ISelectedService>['service']>['fields'][number];
onChange: (e: string) => (e: { target: { value: any } }) => void;
value: any;
errors: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ export const updateProject = async ({
};

const ProjectSettingGeneral = () => {
const { project, account, cluster } = useOutletContext<IProjectContext>();
const { project, account } = useOutletContext<IProjectContext>();

const { setHasChanges, resetAndReload } = useUnsavedChanges();

Expand Down
7 changes: 7 additions & 0 deletions src/apps/console/server/gql/queries/router-queries.ts
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,13 @@ export const routerQueries = (executor: IExecutor) => ({
recordVersion
spec {
domains
routes {
app
lambda
path
port
rewrite
}
}
status {
checks
Expand Down
83 changes: 43 additions & 40 deletions src/generated/gql/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2613,7 +2613,16 @@ export type ConsoleListRoutersQuery = {
createdBy: { userEmail: string; userId: string; userName: string };
lastUpdatedBy: { userEmail: string; userId: string; userName: string };
metadata?: { generation: number; name: string; namespace?: string };
spec: { domains: Array<string> };
spec: {
domains: Array<string>;
routes?: Array<{
app?: string;
lambda?: string;
path: string;
port: number;
rewrite?: boolean;
}>;
};
status?: {
checks?: any;
isReady: boolean;
Expand Down Expand Up @@ -4976,20 +4985,12 @@ export type ConsoleListConsoleVpnDevicesForUserQueryVariables = Exact<{
export type ConsoleListConsoleVpnDevicesForUserQuery = {
core_listVPNDevicesForUser?: Array<{
accountName: string;
<<<<<<< HEAD
apiVersion?: string;
=======
apiVersion: string;
>>>>>>> 8de1ad26b8e04b8e252c65c4b81ddcc837464b6d
creationTime: any;
displayName: string;
environmentName?: string;
id: string;
<<<<<<< HEAD
kind?: string;
=======
kind: string;
>>>>>>> 8de1ad26b8e04b8e252c65c4b81ddcc837464b6d
markedForDeletion?: boolean;
projectName?: string;
recordVersion: number;
Expand Down Expand Up @@ -5025,7 +5026,6 @@ export type ConsoleDeleteConsoleVpnDeviceMutation = {
};

export type AuthCli_CoreCheckNameAvailabilityQueryVariables = Exact<{
projectName: Scalars['String']['input'];
resType: ConsoleResType;
name: Scalars['String']['input'];
}>;
Expand All @@ -5038,25 +5038,23 @@ export type AuthCli_CoreCheckNameAvailabilityQuery = {
};

export type AuthCli_ListCoreDevicesQueryVariables = Exact<{
pq?: InputMaybe<CursorPaginationIn>;
[key: string]: never;
}>;

export type AuthCli_ListCoreDevicesQuery = {
core_listVPNDevices?: {
edges: Array<{
cursor: string;
node: {
displayName: string;
environmentName?: string;
projectName?: string;
metadata?: { name: string };
spec?: {
disabled?: boolean;
ports?: Array<{ port?: number; targetPort?: number }>;
};
};
}>;
};
core_listVPNDevicesForUser?: Array<{
displayName: string;
environmentName?: string;
projectName?: string;
metadata?: { name: string };
status?: { isReady: boolean; message?: { RawMessage?: any } };
spec?: {
deviceNamespace?: string;
disabled?: boolean;
cnameRecords?: Array<{ host?: string; target?: string }>;
ports?: Array<{ port?: number; targetPort?: number }>;
};
}>;
};

export type AuthCli_GetCoreDeviceQueryVariables = Exact<{
Expand Down Expand Up @@ -5421,22 +5419,27 @@ export type AuthCli_UpdateDeviceMutation = {
};
};

export type AuthCli_ListDevicesQueryVariables = Exact<{ [key: string]: never }>;
export type AuthCli_ListDevicesQueryVariables = Exact<{
pq?: InputMaybe<CursorPaginationIn>;
}>;

export type AuthCli_ListDevicesQuery = {
core_listVPNDevicesForUser?: Array<{
displayName: string;
environmentName?: string;
markedForDeletion?: boolean;
projectName?: string;
metadata?: { name: string; namespace?: string };
spec?: {
deviceNamespace?: string;
disabled?: boolean;
cnameRecords?: Array<{ host?: string; target?: string }>;
ports?: Array<{ port?: number; targetPort?: number }>;
};
}>;
infra_listVPNDevices?: {
edges: Array<{
node: {
displayName: string;
metadata?: { name: string };
spec?: {
deviceNamespace?: string;
disabled?: boolean;
nodeSelector?: any;
ports?: Array<{ port?: number; targetPort?: number }>;
};
status?: { isReady: boolean; message?: { RawMessage?: any } };
wireguardConfig?: { encoding: string; value: string };
};
}>;
};
};

export type AuthCli_GetDeviceQueryVariables = Exact<{
Expand Down

0 comments on commit 23ba7bb

Please sign in to comment.