From 88570f8d415b7f6d563374e548a78844c4b1f53f Mon Sep 17 00:00:00 2001 From: Bikash Date: Sun, 14 Jan 2024 21:14:00 +0530 Subject: [PATCH] Fixed merge conflits and ts errors --- gql-queries-generator/doc/queries.graphql | 104 ++++++++++-------- src/apps/console/components/name-id-view.tsx | 2 - .../$project+/$environment+/_layout.tsx | 15 ++- .../handle-managed-resource.tsx | 4 +- .../$environment+/managed-resources/route.tsx | 2 +- .../router+/$router+/routes/handle-route.tsx | 4 +- .../_main+/$account+/$project+/_layout.tsx | 2 +- .../handle-backend-service.tsx | 2 +- .../$project+/settings+/general/route.tsx | 2 +- .../server/gql/queries/router-queries.ts | 7 ++ src/generated/gql/server.ts | 83 +++++++------- 11 files changed, 130 insertions(+), 97 deletions(-) diff --git a/gql-queries-generator/doc/queries.graphql b/gql-queries-generator/doc/queries.graphql index c4c79b70c..94690d833 100644 --- a/gql-queries-generator/doc/queries.graphql +++ b/gql-queries-generator/doc/queries.graphql @@ -1243,6 +1243,13 @@ query consoleListRouters($projectName: String!, $envName: String!, $search: Sear recordVersion spec { domains + routes { + app + lambda + path + port + rewrite + } } status { checks @@ -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 } } } @@ -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 + } } } } diff --git a/src/apps/console/components/name-id-view.tsx b/src/apps/console/components/name-id-view.tsx index 625db2559..dfa5b877c 100644 --- a/src/apps/console/components/name-id-view.tsx +++ b/src/apps/console/components/name-id-view.tsx @@ -108,8 +108,6 @@ export const NameIdView = forwardRef( }, [displayName, name]); const checkNameAvailable = () => { - console.log('inside ', errors); - if (errors) { // onCheckError?.(true); return errors; diff --git a/src/apps/console/routes/_main+/$account+/$project+/$environment+/_layout.tsx b/src/apps/console/routes/_main+/$account+/$project+/$environment+/_layout.tsx index 6fca5ab34..f2d81e619 100644 --- a/src/apps/console/routes/_main+/$account+/$project+/$environment+/_layout.tsx +++ b/src/apps/console/routes/_main+/$account+/$project+/$environment+/_layout.tsx @@ -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, @@ -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'; @@ -129,7 +136,9 @@ const CurrentBreadcrum = ({ environment }: { environment: IEnvironment }) => { const params = useParams(); const [showPopup, setShowPopup] = useState(null); - const [environments, setEnvironments] = useState([]); + const [environments, setEnvironments] = useState< + ExtractNodeType[] + >([]); const api = useConsoleApi(); const [search, setSearch] = useState(''); diff --git a/src/apps/console/routes/_main+/$account+/$project+/$environment+/managed-resources/handle-managed-resource.tsx b/src/apps/console/routes/_main+/$account+/$project+/$environment+/managed-resources/handle-managed-resource.tsx index 3ebf34dce..e76a0d19e 100644 --- a/src/apps/console/routes/_main+/$account+/$project+/$environment+/managed-resources/handle-managed-resource.tsx +++ b/src/apps/console/routes/_main+/$account+/$project+/$environment+/managed-resources/handle-managed-resource.tsx @@ -41,7 +41,7 @@ const RenderField = ({ errors, fieldKey, }: { - field: NN['service']['fields'][number]; + field: NN['service']>['fields'][number]; onChange: (e: string) => (e: { target: { value: any } }) => void; value: any; errors: Record; @@ -337,7 +337,7 @@ const HandleManagedResources = (props: IDialog) => { return ( setVisible(v)}> - {isUpdate ? 'Edit managed service' : 'Add managed service'} + {isUpdate ? 'Edit managed resource' : 'Add managed resource'} {(!isUpdate || (isUpdate && props.data)) && } diff --git a/src/apps/console/routes/_main+/$account+/$project+/$environment+/managed-resources/route.tsx b/src/apps/console/routes/_main+/$account+/$project+/$environment+/managed-resources/route.tsx index eae99053a..09d5b14b0 100644 --- a/src/apps/console/routes/_main+/$account+/$project+/$environment+/managed-resources/route.tsx +++ b/src/apps/console/routes/_main+/$account+/$project+/$environment+/managed-resources/route.tsx @@ -39,7 +39,7 @@ const KlOperatorServices = () => { return ( 0 && (