diff --git a/packages/grafana-data/src/types/datasource.ts b/packages/grafana-data/src/types/datasource.ts index 3c15e2b200b..783c01eab77 100644 --- a/packages/grafana-data/src/types/datasource.ts +++ b/packages/grafana-data/src/types/datasource.ts @@ -184,6 +184,7 @@ export abstract class DataSourceApi< constructor(instanceSettings: DataSourceInstanceSettings) { this.name = instanceSettings.name; this.id = instanceSettings.id; + this.meta = {} as DataSourcePluginMeta; } /** @@ -248,7 +249,7 @@ export abstract class DataSourceApi< /** * static information about the datasource */ - meta?: DataSourcePluginMeta; + meta: DataSourcePluginMeta; /** * Used by alerting to check if query contains template variables diff --git a/packages/grafana-ui/src/components/Button/__snapshots__/Button.test.tsx.snap b/packages/grafana-ui/src/components/Button/__snapshots__/Button.test.tsx.snap index b42e545ccf2..2000309fe55 100644 --- a/packages/grafana-ui/src/components/Button/__snapshots__/Button.test.tsx.snap +++ b/packages/grafana-ui/src/components/Button/__snapshots__/Button.test.tsx.snap @@ -1,5 +1,5 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`Button renders correct html 1`] = `""`; +exports[`Button renders correct html 1`] = `""`; -exports[`LinkButton renders correct html 1`] = `"Click me"`; +exports[`LinkButton renders correct html 1`] = `"Click me"`; diff --git a/packages/grafana-ui/src/components/Button/styles.ts b/packages/grafana-ui/src/components/Button/styles.ts index 43a6ae85c44..7b4d2073aec 100644 --- a/packages/grafana-ui/src/components/Button/styles.ts +++ b/packages/grafana-ui/src/components/Button/styles.ts @@ -84,7 +84,7 @@ export const getButtonStyles = stylesFactory(({ theme, size, variant, textAndIco font-weight: ${fontWeight}; font-size: ${fontSize}; font-family: ${theme.typography.fontFamily.sansSerif}; - line-height: ${theme.typography.lineHeight.xs}; + line-height: ${theme.typography.lineHeight.md}; padding: ${padding}; vertical-align: middle; cursor: pointer; @@ -120,7 +120,7 @@ const calculateMeasures = (theme: GrafanaTheme, size: ButtonSize, textAndIcon: b switch (size) { case 'sm': { return { - padding: `${theme.spacing.xs} ${theme.spacing.sm}`, + padding: `0 ${theme.spacing.sm}`, fontSize: theme.typography.size.sm, height: theme.height.sm, fontWeight: theme.typography.weight.semibold, @@ -131,7 +131,7 @@ const calculateMeasures = (theme: GrafanaTheme, size: ButtonSize, textAndIcon: b const leftPadding = textAndIcon ? theme.spacing.sm : theme.spacing.md; return { - padding: `${theme.spacing.sm} ${theme.spacing.md} ${theme.spacing.sm} ${leftPadding}`, + padding: `0 ${theme.spacing.md} 0 ${leftPadding}`, fontSize: theme.typography.size.md, height: theme.height.md, fontWeight: theme.typography.weight.semibold, @@ -142,7 +142,7 @@ const calculateMeasures = (theme: GrafanaTheme, size: ButtonSize, textAndIcon: b const leftPadding = textAndIcon ? theme.spacing.md : theme.spacing.lg; return { - padding: `${theme.spacing.md} ${theme.spacing.lg} ${theme.spacing.md} ${leftPadding}`, + padding: `0 ${theme.spacing.lg} 0 ${leftPadding}`, fontSize: theme.typography.size.lg, height: theme.height.lg, fontWeight: theme.typography.weight.regular, @@ -153,7 +153,7 @@ const calculateMeasures = (theme: GrafanaTheme, size: ButtonSize, textAndIcon: b const leftPadding = textAndIcon ? theme.spacing.sm : theme.spacing.md; return { - padding: `${theme.spacing.sm} ${theme.spacing.md} ${theme.spacing.sm} ${leftPadding}`, + padding: `0 ${theme.spacing.md} 0 ${leftPadding}`, fontSize: theme.typography.size.base, height: theme.height.md, fontWeight: theme.typography.weight.regular, diff --git a/packages/grafana-ui/src/components/Forms/Button.tsx b/packages/grafana-ui/src/components/Forms/Button.tsx index 0b8c1a4d38f..592284ce5a7 100644 --- a/packages/grafana-ui/src/components/Forms/Button.tsx +++ b/packages/grafana-ui/src/components/Forms/Button.tsx @@ -87,7 +87,7 @@ export const getButtonStyles = stylesFactory(({ theme, size, variant }: StylePro align-items: center; font-weight: ${theme.typography.weight.semibold}; font-family: ${theme.typography.fontFamily.sansSerif}; - line-height: ${theme.typography.lineHeight.sm}; + line-height: ${theme.typography.lineHeight.md}; font-size: ${fontSize}; padding: ${padding}; height: ${height}; diff --git a/packages/grafana-ui/src/themes/_variables.scss.tmpl.ts b/packages/grafana-ui/src/themes/_variables.scss.tmpl.ts index c56ab6bd724..10b7d551fe3 100644 --- a/packages/grafana-ui/src/themes/_variables.scss.tmpl.ts +++ b/packages/grafana-ui/src/themes/_variables.scss.tmpl.ts @@ -175,8 +175,8 @@ $zindex-typeahead: ${theme.zIndex.typeahead}; // $btn-padding-x: 14px !default; -$btn-padding-y: 8px !default; -$btn-line-height: 1 !default; +$btn-padding-y: 0 !default; +$btn-line-height: $line-height-base; $btn-font-weight: ${theme.typography.weight.semibold} !default; $btn-padding-x-sm: 7px !default; diff --git a/public/app/features/dashboard/components/DashExportModal/DashboardExporter.ts b/public/app/features/dashboard/components/DashExportModal/DashboardExporter.ts index 6790a27387c..6f46ed10ee9 100644 --- a/public/app/features/dashboard/components/DashExportModal/DashboardExporter.ts +++ b/public/app/features/dashboard/components/DashExportModal/DashboardExporter.ts @@ -81,9 +81,9 @@ export class DashboardExporter { // add data source type to require list requires['datasource' + ds.meta?.id] = { type: 'datasource', - id: ds.meta?.id, - name: ds.meta?.name, - version: ds.meta?.info.version || '1.0.0', + id: ds.meta.id, + name: ds.meta.name, + version: ds.meta.info.version || '1.0.0', }; // if used via variable we can skip templatizing usage diff --git a/public/sass/_variables.generated.scss b/public/sass/_variables.generated.scss index 12dc7c01ab4..4875acf5957 100644 --- a/public/sass/_variables.generated.scss +++ b/public/sass/_variables.generated.scss @@ -178,8 +178,8 @@ $zindex-typeahead: 1060; // $btn-padding-x: 14px !default; -$btn-padding-y: 8px !default; -$btn-line-height: 1 !default; +$btn-padding-y: 0 !default; +$btn-line-height: $line-height-base; $btn-font-weight: 500 !default; $btn-padding-x-sm: 7px !default; diff --git a/public/sass/components/_navbar.scss b/public/sass/components/_navbar.scss index c4e469aafa9..67c9a06d442 100644 --- a/public/sass/components/_navbar.scss +++ b/public/sass/components/_navbar.scss @@ -117,8 +117,9 @@ i.navbar-page-btn__search { display: flex; align-items: center; font-weight: $btn-font-weight; - padding: 6px $space-sm; - line-height: 18px; + padding: 0 $space-sm; + line-height: 32px; + height: 32px; color: $text-muted; border: 1px solid $navbar-button-border; margin-left: $space-xs; @@ -162,12 +163,10 @@ i.navbar-page-btn__search { } &--tight { - padding: 7px 4px; + padding: 0px 4px; .fa { font-size: 14px; - position: relative; - top: 1px; } } diff --git a/scripts/ci-frontend-metrics.sh b/scripts/ci-frontend-metrics.sh index 6b066307a90..6913d1770ea 100755 --- a/scripts/ci-frontend-metrics.sh +++ b/scripts/ci-frontend-metrics.sh @@ -3,7 +3,8 @@ echo -e "Collecting code stats (typescript errors & more)" -ERROR_COUNT_LIMIT=812 + +ERROR_COUNT_LIMIT=798 DIRECTIVES_LIMIT=172 CONTROLLERS_LIMIT=139