From ee82801843b3cd781eda8917917b78fcbaa67786 Mon Sep 17 00:00:00 2001 From: Khushi Jain <57278642+khushijain21@users.noreply.github.com> Date: Thu, 14 Dec 2023 12:57:30 +0530 Subject: [PATCH] Chore: Remove gf-form in UserPermission & Annotation Query (#78785) * Chore: Remove gf-form in UserPermission * more changes * Update public/app/features/admin/UserPermissions.tsx Co-authored-by: Tobias Skarhed <1438972+tskarhed@users.noreply.github.com> * more change * Added annotationQueryEditor * empty div * Update public/app/plugins/datasource/elasticsearch/components/QueryEditor/AnnotationQueryEditor.tsx Co-authored-by: Alex Khomenko * final --------- Co-authored-by: Tobias Skarhed <1438972+tskarhed@users.noreply.github.com> Co-authored-by: Alex Khomenko --- public/app/features/admin/UserPermissions.tsx | 91 ++++++++++--------- .../QueryEditor/AnnotationQueryEditor.tsx | 13 ++- 2 files changed, 54 insertions(+), 50 deletions(-) diff --git a/public/app/features/admin/UserPermissions.tsx b/public/app/features/admin/UserPermissions.tsx index 30cc4c798d5..f9be4537bfb 100644 --- a/public/app/features/admin/UserPermissions.tsx +++ b/public/app/features/admin/UserPermissions.tsx @@ -40,53 +40,51 @@ export function UserPermissions({ isGrafanaAdmin, isExternalUser, lockMessage, o return ( <>

Permissions

-
-
- - - - - {isEditing ? ( - - ) : ( - - )} - + + +
Grafana Admin - - - {isGrafanaAdmin ? ( - <> - Yes - - ) : ( - <>No - )} - - {canChangePermissions && ( - - Change - - )} - {isExternalUser && ( -
- -
+
+ + + + + {isEditing ? ( + + ) : ( + - - -
Grafana Admin + + + {isGrafanaAdmin ? ( + <> + Yes + + ) : ( + <>No )}
-
+ )} +
+ {canChangePermissions && ( + + Change + + )} + {isExternalUser && ( +
+ +
+ )} +
); @@ -99,4 +97,7 @@ const getTooltipStyles = (theme: GrafanaTheme2) => ({ font-style: italic; margin-right: ${theme.spacing(0.6)}; `, + container: css({ + marginBottom: theme.spacing(5), + }), }); diff --git a/public/app/plugins/datasource/elasticsearch/components/QueryEditor/AnnotationQueryEditor.tsx b/public/app/plugins/datasource/elasticsearch/components/QueryEditor/AnnotationQueryEditor.tsx index 413decf565e..3411b611647 100644 --- a/public/app/plugins/datasource/elasticsearch/components/QueryEditor/AnnotationQueryEditor.tsx +++ b/public/app/plugins/datasource/elasticsearch/components/QueryEditor/AnnotationQueryEditor.tsx @@ -2,7 +2,7 @@ import React from 'react'; import { AnnotationQuery } from '@grafana/data'; import { EditorField, EditorRow } from '@grafana/experimental'; -import { Input } from '@grafana/ui'; +import { Input, Stack } from '@grafana/ui'; import { ElasticsearchQuery } from '../../types'; @@ -18,8 +18,8 @@ export function ElasticsearchAnnotationsQueryEditor(props: Props) { const onAnnotationChange = props.onAnnotationChange!; return ( - <> -
+ +
{ @@ -37,7 +37,7 @@ export function ElasticsearchAnnotationsQueryEditor(props: Props) { />
-
+
Field mappings
@@ -92,6 +92,9 @@ export function ElasticsearchAnnotationsQueryEditor(props: Props) {
- + + {/*Empty div to preserve the bottom margin */} +
+ ); }