From c003f1b18ed2eac8c26b0808197d3782a1854d9d Mon Sep 17 00:00:00 2001 From: Bikash Date: Tue, 6 Feb 2024 19:32:21 +0530 Subject: [PATCH 1/2] Fixed input field focus issue, added create new team button in teams popup, made awsaccountid required in new cloud provider page --- src/apps/console/components/menu-select.tsx | 22 ++++----- .../onboarding+/$a+/new-cloud-provider.tsx | 28 +++++------ .../routes/_main+/$account+/_layout.tsx | 46 ++++++++++++++----- .../console/routes/_main+/_layout/_layout.tsx | 5 +- .../devdoc/app/components/page/devops.tsx | 12 ++--- src/apps/devdoc/app/components/page/index.tsx | 14 +++--- src/design-system/components/atoms/input.tsx | 4 +- 7 files changed, 71 insertions(+), 60 deletions(-) diff --git a/src/apps/console/components/menu-select.tsx b/src/apps/console/components/menu-select.tsx index 0804b8a3b..6b552756e 100644 --- a/src/apps/console/components/menu-select.tsx +++ b/src/apps/console/components/menu-select.tsx @@ -11,13 +11,10 @@ interface ISelectItem { active?: boolean; } -const SelectItem = React.forwardRef( +export const SelectItem = React.forwardRef( ({ children, className, ...props }, forwardedRef) => { return ( { - console.log(e); - }} className={cn( 'group relative flex flex-row gap-xl items-center bodyMd gap cursor-pointer select-none py-lg px-xl text-text-default outline-none transition-colors focus:bg-surface-basic-hovered hover:bg-surface-basic-hovered data-[disabled]:pointer-events-none data-[disabled]:text-text-disabled data-[state=checked]:bg-surface-basic-active', className @@ -37,6 +34,7 @@ interface IMenuSelect { items: { label: ReactNode; value: string; + render?: () => ReactNode; }[]; onChange?: (value: string) => void; onClick?: (value: string) => void; @@ -83,15 +81,13 @@ const MenuSelect = ({ > {items.map((item) => (
onClick?.(item.value)}> - -
{ - console.log('clicked'); - }} - > - {item.label} -
-
+ {item.render ? ( + item.render() + ) : ( + +
{item.label}
+
+ )}
))} diff --git a/src/apps/console/routes/_a+/onboarding+/$a+/new-cloud-provider.tsx b/src/apps/console/routes/_a+/onboarding+/$a+/new-cloud-provider.tsx index b840c5cd4..2ed12a137 100644 --- a/src/apps/console/routes/_a+/onboarding+/$a+/new-cloud-provider.tsx +++ b/src/apps/console/routes/_a+/onboarding+/$a+/new-cloud-provider.tsx @@ -10,8 +10,8 @@ import { handleError } from '~/root/lib/utils/common'; import { useState } from 'react'; import { useConsoleApi } from '~/console/server/gql/api-provider'; import { validateCloudProvider } from '~/console/server/r-utils/common'; -import { IdSelector } from '~/console/components/id-selector'; import ProgressWrapper from '~/console/components/progress-wrapper'; +import { NameIdView } from '~/console/components/name-id-view'; const NewCloudProvider = () => { const { a: accountName } = useParams(); @@ -27,6 +27,7 @@ const NewCloudProvider = () => { name: '', provider: providers[0], awsAccountId: '', + isNameError: false, }, validationSchema: Yup.object({ displayName: Yup.string().required(), @@ -35,6 +36,7 @@ const NewCloudProvider = () => { label: Yup.string().required(), value: Yup.string().required(), }).required(), + awsAccountId: Yup.string().required('AccountId is required.'), }), onSubmit: async (val) => { const addProvider = async () => { @@ -95,24 +97,16 @@ const NewCloudProvider = () => { the internet.
- - { - handleChange('name')({ target: { value: id } }); - }} - className="pt-xl" + displayName={values.displayName} + name={values.name} + label="Name" + placeholder="Enter provider name" + errors={errors.name} + handleChange={handleChange} /> -