From dba690d65331d479131f2a62e58f56fe9038070c Mon Sep 17 00:00:00 2001 From: Khushi Jain <57278642+khushijain21@users.noreply.github.com> Date: Sat, 16 Dec 2023 13:16:54 +0530 Subject: [PATCH] Chore: Removes gf-form from profile/user (#79552) * Chore: Removes gf-form from profile/user * message * better --- .betterer.results | 9 -- .../features/profile/UserOrganizations.tsx | 82 +++++++++-------- .../features/profile/UserProfileEditPage.tsx | 10 ++- public/app/features/profile/UserSessions.tsx | 89 +++++++++---------- public/app/features/profile/UserTeams.tsx | 50 +++++------ 5 files changed, 112 insertions(+), 128 deletions(-) diff --git a/.betterer.results b/.betterer.results index 0d4444a9f74..c99a1a1c714 100644 --- a/.betterer.results +++ b/.betterer.results @@ -7224,15 +7224,6 @@ exports[`no gf-form usage`] = { "public/app/features/plugins/admin/components/PluginDashboards.tsx:5381": [ [0, 0, 0, "gf-form usage has been deprecated. Use a component from @grafana/ui or custom CSS instead.", "5381"] ], - "public/app/features/profile/UserOrganizations.tsx:5381": [ - [0, 0, 0, "gf-form usage has been deprecated. Use a component from @grafana/ui or custom CSS instead.", "5381"] - ], - "public/app/features/profile/UserSessions.tsx:5381": [ - [0, 0, 0, "gf-form usage has been deprecated. Use a component from @grafana/ui or custom CSS instead.", "5381"] - ], - "public/app/features/profile/UserTeams.tsx:5381": [ - [0, 0, 0, "gf-form usage has been deprecated. Use a component from @grafana/ui or custom CSS instead.", "5381"] - ], "public/app/features/query/components/QueryEditorRow.tsx:5381": [ [0, 0, 0, "gf-form usage has been deprecated. Use a component from @grafana/ui or custom CSS instead.", "5381"] ], diff --git a/public/app/features/profile/UserOrganizations.tsx b/public/app/features/profile/UserOrganizations.tsx index 88fae4864a2..6d39fc567e8 100644 --- a/public/app/features/profile/UserOrganizations.tsx +++ b/public/app/features/profile/UserOrganizations.tsx @@ -30,48 +30,46 @@ export class UserOrganizations extends PureComponent { Organizations -
- - - - - - - - - {orgs.map((org: UserOrg, index) => { - return ( - - - - - - ); - })} - -
- Name - - Role - -
{org.name}{org.role} - {org.orgId === user?.orgId ? ( - - ) : ( - - )} -
-
+ + + + + + + + + {orgs.map((org: UserOrg, index) => { + return ( + + + + + + ); + })} + +
+ Name + + Role + +
{org.name}{org.role} + {org.orgId === user?.orgId ? ( + + ) : ( + + )} +
); } diff --git a/public/app/features/profile/UserProfileEditPage.tsx b/public/app/features/profile/UserProfileEditPage.tsx index 9b074206c89..0b9fbe7d75f 100644 --- a/public/app/features/profile/UserProfileEditPage.tsx +++ b/public/app/features/profile/UserProfileEditPage.tsx @@ -5,7 +5,7 @@ import { useMount } from 'react-use'; import { PluginExtensionComponent, PluginExtensionPoints } from '@grafana/data'; import { selectors } from '@grafana/e2e-selectors'; import { getPluginComponentExtensions } from '@grafana/runtime'; -import { Tab, TabsBar, TabContent, VerticalGroup } from '@grafana/ui'; +import { Tab, TabsBar, TabContent, VerticalGroup, Stack } from '@grafana/ui'; import { Page } from 'app/core/components/Page/Page'; import SharedPreferences from 'app/core/components/SharedPreferences/SharedPreferences'; import { useQueryParams } from 'app/core/hooks/useQueryParams'; @@ -116,9 +116,11 @@ export function UserProfileEditPage({ - - - + + + + + ); diff --git a/public/app/features/profile/UserSessions.tsx b/public/app/features/profile/UserSessions.tsx index 107d3c636ed..ec9dbb034e7 100644 --- a/public/app/features/profile/UserSessions.tsx +++ b/public/app/features/profile/UserSessions.tsx @@ -1,4 +1,4 @@ -import { css, cx } from '@emotion/css'; +import { css } from '@emotion/css'; import { t } from 'i18next'; import React, { PureComponent } from 'react'; @@ -27,50 +27,48 @@ class UserSessions extends PureComponent { {sessions.length > 0 && ( <>

Sessions

-
- - - - - - - - - - +
- Last seen - - Logged on - - IP address - - Browser & OS -
+ + + + + + + + + - - {sessions.map((session: UserSession, index) => ( - - {session.isActive ? : } - - - - - - ))} - -
+ Last seen + + Logged on + + IP address + + Browser & OS +
Now{session.seenAt}{i18nDate(session.createdAt, { dateStyle: 'long' })}{session.clientIp} - {session.browser} on {session.os} {session.osVersion} - - -
-
+ + {sessions.map((session: UserSession, index) => ( + + {session.isActive ? Now : {session.seenAt}} + {i18nDate(session.createdAt, { dateStyle: 'long' })} + {session.clientIp} + + {session.browser} on {session.os} {session.osVersion} + + + + + + ))} + + )} @@ -82,9 +80,6 @@ const getStyles = () => ({ wrapper: css({ maxWidth: '100%', }), - table: css({ - overflow: 'auto', - }), }); export default UserSessions; diff --git a/public/app/features/profile/UserTeams.tsx b/public/app/features/profile/UserTeams.tsx index a8af0342f8d..75239994c1c 100644 --- a/public/app/features/profile/UserTeams.tsx +++ b/public/app/features/profile/UserTeams.tsx @@ -23,32 +23,30 @@ export class UserTeams extends PureComponent { return (

Teams

-
- - - - - - - - - - {teams.map((team: Team, index) => { - return ( - - - - - - - ); - })} - -
- NameEmailMembers
- - {team.name}{team.email}{team.memberCount}
-
+ + + + + + + + + + {teams.map((team: Team, index) => { + return ( + + + + + + + ); + })} + +
+ NameEmailMembers
+ + {team.name}{team.email}{team.memberCount}
); }