From 5e4a900abe48c56b5b51e8c7c7ea526f020d9f5f Mon Sep 17 00:00:00 2001 From: Khushi Jain <57278642+khushijain21@users.noreply.github.com> Date: Wed, 20 Sep 2023 15:34:56 +0530 Subject: [PATCH] Forms: Remove gf-form appearances in admin, profile and team settings (#74360) * Accessibility: Added label prop to RadioButtonGroup * Update packages/grafana-ui/src/components/Forms/RadioButtonGroup/RadioButtonGroup.tsx Co-authored-by: Tobias Skarhed <1438972+tskarhed@users.noreply.github.com> * Update RadioButtonGroup.tsx * Update RadioButtonGroup.tsx * corrected ariaLabel * fix accessibility * Forms: Remove gf-form appearances in Grafana * remove wrong commit * Remove gf-form from User Profile Edit Form * AlertRuleList * to not change anything under AlertRuleList * removed gf-form-button-row --------- Co-authored-by: Tobias Skarhed <1438972+tskarhed@users.noreply.github.com> --- .../SharedPreferences/SharedPreferences.tsx | 161 +++++++++--------- .../app/features/admin/UserListAdminPage.tsx | 19 ++- .../features/profile/UserProfileEditForm.tsx | 101 ++++++----- public/app/features/teams/CreateTeam.tsx | 57 ++++--- 4 files changed, 170 insertions(+), 168 deletions(-) diff --git a/public/app/core/components/SharedPreferences/SharedPreferences.tsx b/public/app/core/components/SharedPreferences/SharedPreferences.tsx index 937e5f0ddfc..819608c4fb1 100644 --- a/public/app/core/components/SharedPreferences/SharedPreferences.tsx +++ b/public/app/core/components/SharedPreferences/SharedPreferences.tsx @@ -140,89 +140,88 @@ export class SharedPreferences extends PureComponent {
{() => { return ( -
Preferences} disabled={disabled}> - - + - - - Home Dashboard - - - } - data-testid="User preferences home dashboard drop down" - > - this.onHomeDashboardChanged(v?.uid ?? '')} - defaultOptions={true} - isClearable={true} - placeholder={t('shared-preferences.fields.home-dashboard-placeholder', 'Default dashboard')} - inputId="home-dashboard-select" - /> - - - - - - - - - - - - - Language - - - - } - data-testid="User preferences language drop down" - > - lang.value === language)} + onChange={(lang: SelectableValue) => this.onLanguageChanged(lang.value ?? '')} + options={languages} + placeholder={t('shared-preferences.fields.locale-placeholder', 'Choose language')} + inputId="locale-select" + /> + +
+ + ); }}
diff --git a/public/app/features/admin/UserListAdminPage.tsx b/public/app/features/admin/UserListAdminPage.tsx index 66fa7929bc0..74ae31c0c59 100644 --- a/public/app/features/admin/UserListAdminPage.tsx +++ b/public/app/features/admin/UserListAdminPage.tsx @@ -13,6 +13,7 @@ import { Tooltip, useStyles2, FilterInput, + InlineField, } from '@grafana/ui'; import { Page } from 'app/core/components/Page/Page'; import { TagBadge } from 'app/core/components/TagFilter/TagBadge'; @@ -82,13 +83,15 @@ const UserListAdminPageUnConnected = ({ return (
-
- + <> + + + ( ))} -
+ {contextSrv.hasPermission(AccessControlAction.UsersCreate) && ( New user diff --git a/public/app/features/profile/UserProfileEditForm.tsx b/public/app/features/profile/UserProfileEditForm.tsx index bfc25f02359..371a0a0f578 100644 --- a/public/app/features/profile/UserProfileEditForm.tsx +++ b/public/app/features/profile/UserProfileEditForm.tsx @@ -31,58 +31,57 @@ export const UserProfileEditForm = ({ user, isSavingUser, updateProfile }: Props
{({ register, errors }) => { return ( -
- Name is required} - disabled={disabledEdit} - > - } - /> - - - Email is required} - disabled={disabledEdit} - > - } - /> - - - - } - /> - - -
- -
-
+ } + /> + + + Email is required} + disabled={disabledEdit} + > + } + /> + + + + } + /> + + + + ); }}
diff --git a/public/app/features/teams/CreateTeam.tsx b/public/app/features/teams/CreateTeam.tsx index deb3330c70a..5136e92abf0 100644 --- a/public/app/features/teams/CreateTeam.tsx +++ b/public/app/features/teams/CreateTeam.tsx @@ -46,35 +46,36 @@ export const CreateTeam = (): JSX.Element => {
{({ register, errors }) => ( -
- - - - {contextSrv.licensedAccessControlEnabled() && ( - - + <> +
+ + - )} - - - -
- -
-
+ {contextSrv.licensedAccessControlEnabled() && ( + + + + )} + + + +
+ + + )}