From 0c5a34e1fd680cafd6c9a6e418b2666438984131 Mon Sep 17 00:00:00 2001 From: Aryan Date: Mon, 19 Feb 2024 17:28:25 +0530 Subject: [PATCH 1/4] Added loader in UserManagement modal. Signed-off-by: Aryan --- .../AccountDetailsChange.tsx | 4 +- .../AccountPasswordChange.tsx | 4 +- .../views/CreateNewToken/CreateNewToken.tsx | 4 +- .../src/views/CreateNewUser/CreateNewUser.tsx | 4 +- .../views/DeleteApiToken/DeleteApiToken.tsx | 7 +++- .../EnableDisableUser/EnableDisableUser.tsx | 39 ++++++++++++------- .../src/views/ResetPassword/ResetPassword.tsx | 17 +++++--- 7 files changed, 53 insertions(+), 26 deletions(-) diff --git a/chaoscenter/web/src/views/AccountDetailsChange/AccountDetailsChange.tsx b/chaoscenter/web/src/views/AccountDetailsChange/AccountDetailsChange.tsx index e06be22860d..2696e979134 100644 --- a/chaoscenter/web/src/views/AccountDetailsChange/AccountDetailsChange.tsx +++ b/chaoscenter/web/src/views/AccountDetailsChange/AccountDetailsChange.tsx @@ -1,5 +1,5 @@ import { FontVariation } from '@harnessio/design-system'; -import { Button, ButtonVariation, Container, FormInput, Layout, Text } from '@harnessio/uicore'; +import { Button, ButtonVariation, Container, FormInput, Layout, OverlaySpinner, Text } from '@harnessio/uicore'; import React from 'react'; import { Icon } from '@harnessio/icons'; import { Form, Formik } from 'formik'; @@ -54,6 +54,7 @@ export default function AccountDetailsChangeView(props: AccountDetailsChangeView } return ( + {getString('editName')} @@ -111,5 +112,6 @@ export default function AccountDetailsChangeView(props: AccountDetailsChangeView + ); } diff --git a/chaoscenter/web/src/views/AccountPasswordChange/AccountPasswordChange.tsx b/chaoscenter/web/src/views/AccountPasswordChange/AccountPasswordChange.tsx index 577dea0f1f2..5b05ad7c5dc 100644 --- a/chaoscenter/web/src/views/AccountPasswordChange/AccountPasswordChange.tsx +++ b/chaoscenter/web/src/views/AccountPasswordChange/AccountPasswordChange.tsx @@ -1,5 +1,5 @@ import { FontVariation } from '@harnessio/design-system'; -import { Button, ButtonVariation, Container, FormInput, Layout, Text, useToaster } from '@harnessio/uicore'; +import { Button, ButtonVariation, Container, FormInput, Layout, OverlaySpinner, Text, useToaster } from '@harnessio/uicore'; import React from 'react'; import { Icon } from '@harnessio/icons'; import { Form, Formik } from 'formik'; @@ -64,6 +64,7 @@ export default function AccountPasswordChangeView(props: AccountPasswordChangeVi } return ( + {getString('updatePassword')} @@ -130,5 +131,6 @@ export default function AccountPasswordChangeView(props: AccountPasswordChangeVi + ); } diff --git a/chaoscenter/web/src/views/CreateNewToken/CreateNewToken.tsx b/chaoscenter/web/src/views/CreateNewToken/CreateNewToken.tsx index bd1ed33bbbf..aa34120f6bb 100644 --- a/chaoscenter/web/src/views/CreateNewToken/CreateNewToken.tsx +++ b/chaoscenter/web/src/views/CreateNewToken/CreateNewToken.tsx @@ -1,7 +1,7 @@ import type { UseMutateFunction } from '@tanstack/react-query'; import React from 'react'; import { FontVariation } from '@harnessio/design-system'; -import { Layout, Container, FormInput, ButtonVariation, Text, Button } from '@harnessio/uicore'; +import { Layout, Container, FormInput, ButtonVariation, Text, Button, OverlaySpinner } from '@harnessio/uicore'; import { Formik, Form } from 'formik'; import { Icon } from '@harnessio/icons'; import * as Yup from 'yup'; @@ -48,6 +48,7 @@ export default function CreateNewTokenView(props: CreateNewTokenViewProps): Reac } return ( + {getString('createNewToken')} @@ -109,5 +110,6 @@ export default function CreateNewTokenView(props: CreateNewTokenViewProps): Reac + ); } diff --git a/chaoscenter/web/src/views/CreateNewUser/CreateNewUser.tsx b/chaoscenter/web/src/views/CreateNewUser/CreateNewUser.tsx index 290298569bf..b304c2fd9ac 100644 --- a/chaoscenter/web/src/views/CreateNewUser/CreateNewUser.tsx +++ b/chaoscenter/web/src/views/CreateNewUser/CreateNewUser.tsx @@ -1,7 +1,7 @@ import type { UseMutateFunction } from '@tanstack/react-query'; import React from 'react'; import { FontVariation } from '@harnessio/design-system'; -import { Layout, Container, FormInput, ButtonVariation, Text, Button } from '@harnessio/uicore'; +import { Layout, Container, FormInput, ButtonVariation, Text, Button, OverlaySpinner} from '@harnessio/uicore'; import { Formik, Form } from 'formik'; import { Icon } from '@harnessio/icons'; import * as Yup from 'yup'; @@ -46,6 +46,7 @@ export default function CreateNewUserView(props: CreateNewUserViewProps): React. } return ( + {getString('createNewUser')} @@ -128,5 +129,6 @@ export default function CreateNewUserView(props: CreateNewUserViewProps): React. + ); } diff --git a/chaoscenter/web/src/views/DeleteApiToken/DeleteApiToken.tsx b/chaoscenter/web/src/views/DeleteApiToken/DeleteApiToken.tsx index c5a2df76895..2571a889615 100644 --- a/chaoscenter/web/src/views/DeleteApiToken/DeleteApiToken.tsx +++ b/chaoscenter/web/src/views/DeleteApiToken/DeleteApiToken.tsx @@ -1,6 +1,6 @@ import type { UseMutateFunction } from '@tanstack/react-query'; import React from 'react'; -import { Button, ButtonVariation, Layout, Text } from '@harnessio/uicore'; +import { Button, ButtonVariation, Layout, OverlaySpinner, Text } from '@harnessio/uicore'; import { FontVariation } from '@harnessio/design-system'; import { Icon } from '@harnessio/icons'; import type { RemoveApiTokenMutationProps, RemoveApiTokenOkResponse } from '@api/auth'; @@ -15,13 +15,15 @@ interface DeleteApiTokenViewProps { unknown >; token: string | undefined; + mutationLoading: boolean; } export default function DeleteApiTokenView(props: DeleteApiTokenViewProps): React.ReactElement { - const { handleClose, deleteApiTokenMutation, token } = props; + const { handleClose, deleteApiTokenMutation, token, mutationLoading} = props; const { getString } = useStrings(); return ( + {getString('delete')} @@ -45,5 +47,6 @@ export default function DeleteApiTokenView(props: DeleteApiTokenViewProps): Reac