diff --git a/public/app/core/components/QueryOperationRow/QueryOperationRow.tsx b/public/app/core/components/QueryOperationRow/QueryOperationRow.tsx index 8db97692933..d2816609cdd 100644 --- a/public/app/core/components/QueryOperationRow/QueryOperationRow.tsx +++ b/public/app/core/components/QueryOperationRow/QueryOperationRow.tsx @@ -75,21 +75,26 @@ export const QueryOperationRow: React.FC = ({ const rowHeader = (
- - {title && ( -
-
{titleElement}
-
- )} - {headerElementRendered} - {actions &&
{actionsElement}
} - {draggable && ( - - )} +
+ + {title && ( +
+
{titleElement}
+
+ )} + {headerElementRendered} +
+ +
+ {actionsElement} + {draggable && ( + + )} +
); @@ -124,11 +129,13 @@ const getQueryOperationRowStyles = stylesFactory((theme: GrafanaTheme) => { margin-bottom: ${theme.spacing.md}; `, header: css` + label: Header; padding: ${theme.spacing.xs} ${theme.spacing.sm}; border-radius: ${theme.border.radius.sm}; background: ${theme.colors.bg2}; min-height: ${theme.spacing.formInputHeight}px; - display: flex; + display: grid; + grid-template-columns: minmax(100px, max-content) min-content; align-items: center; justify-content: space-between; white-space: nowrap; @@ -137,6 +144,11 @@ const getQueryOperationRowStyles = stylesFactory((theme: GrafanaTheme) => { outline: none; } `, + column: css` + label: Column; + display: flex; + align-items: center; + `, dragIcon: css` cursor: grab; color: ${theme.colors.textWeak}; @@ -164,6 +176,7 @@ const getQueryOperationRowStyles = stylesFactory((theme: GrafanaTheme) => { color: ${theme.colors.textBlue}; margin-left: ${theme.spacing.sm}; overflow: hidden; + text-overflow: ellipsis; `, content: css` margin-top: ${theme.spacing.inlineFormMargin}; diff --git a/public/app/features/query/components/QueryEditorRowHeader.tsx b/public/app/features/query/components/QueryEditorRowHeader.tsx index 83a3d89b8de..26b2bc701b8 100644 --- a/public/app/features/query/components/QueryEditorRowHeader.tsx +++ b/public/app/features/query/components/QueryEditorRowHeader.tsx @@ -80,46 +80,49 @@ export const QueryEditorRowHeader = (props: Props - {!isEditing && ( - - )} - {isEditing && ( - <> - - {validationError && {validationError}} - - )} - {renderDataSource(props, styles)} - {renderExtras &&
{renderExtras()}
} - {disabled && Disabled} + <> +
+ {!isEditing && ( + + )} + + {isEditing && ( + <> + + {validationError && {validationError}} + + )} + {renderDataSource(props, styles)} + {renderExtras &&
{renderExtras()}
} + {disabled && Disabled} +
{collapsedText && (
{collapsedText}
)} - + ); }; @@ -143,44 +146,37 @@ const renderDataSource = ( const getStyles = (theme: GrafanaTheme) => { return { wrapper: css` + label: Wrapper; display: flex; align-items: center; - flex-grow: 1; margin-left: ${theme.spacing.xs}; - overflow: hidden; + `, + queryNameWrapper: css` + display: flex; + cursor: pointer; + border: 1px solid transparent; + border-radius: ${theme.border.radius.md}; + align-items: center; + padding: 0 0 0 ${theme.spacing.xs}; + margin: 0; + background: transparent; &:hover { - .query-name-wrapper { - background: ${theme.colors.bg3}; - border: 1px dashed ${theme.colors.border3}; - } + background: ${theme.colors.bg3}; + border: 1px dashed ${theme.colors.border3}; + } + &:focus { + border: 2px solid ${theme.colors.formInputBorderActive}; + } + + &:hover, + &:focus { .query-name-edit-icon { visibility: visible; } } `, - queryNameWrapper: cx( - css` - display: flex; - cursor: pointer; - border: 1px solid transparent; - border-radius: ${theme.border.radius.md}; - align-items: center; - padding: 0 0 0 ${theme.spacing.xs}; - margin: 0; - background: transparent; - - &:focus { - border: 2px solid ${theme.colors.formInputBorderActive}; - - .query-name-edit-icon { - visibility: visible; - } - } - `, - 'query-name-wrapper' - ), queryName: css` font-weight: ${theme.typography.weight.semibold}; color: ${theme.colors.textBlue}; @@ -207,10 +203,8 @@ const getStyles = (theme: GrafanaTheme) => { align-items: center; overflow: hidden; font-style: italic; - overflow: hidden; white-space: nowrap; text-overflow: ellipsis; - min-width: 0; `, contextInfo: css` font-size: ${theme.typography.size.sm}; diff --git a/public/sass/pages/_explore.scss b/public/sass/pages/_explore.scss index 37f468d8070..ae1bc264206 100644 --- a/public/sass/pages/_explore.scss +++ b/public/sass/pages/_explore.scss @@ -141,7 +141,6 @@ display: flex; flex: 1 1 auto; flex-direction: column; - width: 100%; } .explore.explore-live {