From 4a821f52d308f7453cf5851e483def3e251c5082 Mon Sep 17 00:00:00 2001 From: Rares Mardare Date: Tue, 28 Nov 2023 16:56:26 +0200 Subject: [PATCH] Users profile tweaks (#3443) ## Which issue(s) this PR fixes https://github.com/grafana/oncall/issues/3340 https://github.com/grafana/oncall/issues/3341 --- CHANGELOG.md | 6 ++++ .../src/containers/Labels/Labels.module.css | 2 -- .../src/containers/Labels/Labels.tsx | 7 +--- .../src/containers/Labels/LabelsFilter.tsx | 7 +--- .../parts/connectors/PhoneConnector.tsx | 34 +++++++++++++++---- .../UserSettings/parts/index.module.css | 23 +++++++++++++ .../PhoneVerification/PhoneVerification.tsx | 2 +- 7 files changed, 59 insertions(+), 22 deletions(-) delete mode 100644 grafana-plugin/src/containers/Labels/Labels.module.css diff --git a/CHANGELOG.md b/CHANGELOG.md index ba9bee1c..ede47cad 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## Unreleased + +### Fixed + +- User profile UI tweaks ([#3443](https://github.com/grafana/oncall/pull/3443)) + ## v1.3.64 (2023-11-28) ### Fixed diff --git a/grafana-plugin/src/containers/Labels/Labels.module.css b/grafana-plugin/src/containers/Labels/Labels.module.css deleted file mode 100644 index c3a2af63..00000000 --- a/grafana-plugin/src/containers/Labels/Labels.module.css +++ /dev/null @@ -1,2 +0,0 @@ -.root { -} diff --git a/grafana-plugin/src/containers/Labels/Labels.tsx b/grafana-plugin/src/containers/Labels/Labels.tsx index 60fc1324..c30d9016 100644 --- a/grafana-plugin/src/containers/Labels/Labels.tsx +++ b/grafana-plugin/src/containers/Labels/Labels.tsx @@ -2,7 +2,6 @@ import React, { forwardRef, useCallback, useImperativeHandle, useState } from 'r import { ServiceLabels, ServiceLabelsProps } from '@grafana/labels'; import { Field } from '@grafana/ui'; -import cn from 'classnames/bind'; import { isEmpty } from 'lodash-es'; import { observer } from 'mobx-react'; @@ -10,10 +9,6 @@ import { LabelKeyValue } from 'models/label/label.types'; import { useStore } from 'state/useStore'; import { openErrorNotification } from 'utils'; -import styles from './Labels.module.css'; - -const cx = cn.bind(styles); - export interface LabelsProps { value: LabelKeyValue[]; errors: any; @@ -107,7 +102,7 @@ const Labels = observer( }, []); return ( -
+
{ }; return ( -
+
{
) : storeUser.unverified_phone_number ? ( -
- - + +
+ + + Phone + + + +
+ {isCurrentUser ? ( ) : ( @@ -133,10 +152,11 @@ const PhoneConnector = (props: PhoneConnectorProps) => { )} - - +
+
+ -
+ ) : (
diff --git a/grafana-plugin/src/containers/UserSettings/parts/index.module.css b/grafana-plugin/src/containers/UserSettings/parts/index.module.css index f6bf4215..23402b9c 100644 --- a/grafana-plugin/src/containers/UserSettings/parts/index.module.css +++ b/grafana-plugin/src/containers/UserSettings/parts/index.module.css @@ -28,3 +28,26 @@ text-align: center; justify-content: center; } + +.tag-container { + display: flex; + gap: 4px; + width: 100%; +} + +.tag { + font-weight: 500; + font-size: 12px; + height: 32px; + line-height: 32px; + padding: 0 8px; + width: 120px; +} + +.tag-left { + flex-basis: 120px; +} + +.tag-right { + flex-basis: calc(100% - 120px); +} diff --git a/grafana-plugin/src/containers/UserSettings/parts/tabs/PhoneVerification/PhoneVerification.tsx b/grafana-plugin/src/containers/UserSettings/parts/tabs/PhoneVerification/PhoneVerification.tsx index a354c0f0..de056d1e 100644 --- a/grafana-plugin/src/containers/UserSettings/parts/tabs/PhoneVerification/PhoneVerification.tsx +++ b/grafana-plugin/src/containers/UserSettings/parts/tabs/PhoneVerification/PhoneVerification.tsx @@ -53,7 +53,7 @@ const PhoneVerification = observer((props: PhoneVerificationProps) => { }), { code: '', - phone: user.verified_phone_number || '+', + phone: user.verified_phone_number || user.unverified_phone_number || '+', isLoading: false, isCodeSent: false, isPhoneCallInitiated: false,