mirror of https://github.com/apache/superset.git
fix: font regression in SQL Lab (#14960)
* fix: font regression in SQL Lab * Fix tests
This commit is contained in:
parent
a59bbbc544
commit
3f527c7a45
|
@ -44,6 +44,7 @@ const mockedProps = {
|
||||||
message: 'Error message',
|
message: 'Error message',
|
||||||
},
|
},
|
||||||
source: 'dashboard' as ErrorSource,
|
source: 'dashboard' as ErrorSource,
|
||||||
|
subtitle: 'Error message',
|
||||||
};
|
};
|
||||||
|
|
||||||
test('should render', () => {
|
test('should render', () => {
|
||||||
|
|
|
@ -35,6 +35,7 @@ interface DatabaseErrorExtra {
|
||||||
function DatabaseErrorMessage({
|
function DatabaseErrorMessage({
|
||||||
error,
|
error,
|
||||||
source = 'dashboard',
|
source = 'dashboard',
|
||||||
|
subtitle,
|
||||||
}: ErrorMessageComponentProps<DatabaseErrorExtra>) {
|
}: ErrorMessageComponentProps<DatabaseErrorExtra>) {
|
||||||
const { extra, level, message } = error;
|
const { extra, level, message } = error;
|
||||||
|
|
||||||
|
@ -81,7 +82,7 @@ ${extra.issue_codes.map(issueCode => issueCode.message).join('\n')}`;
|
||||||
return (
|
return (
|
||||||
<ErrorAlert
|
<ErrorAlert
|
||||||
title={t('%s Error', extra.engine_name || t('DB engine'))}
|
title={t('%s Error', extra.engine_name || t('DB engine'))}
|
||||||
subtitle={message}
|
subtitle={subtitle}
|
||||||
level={level}
|
level={level}
|
||||||
source={source}
|
source={source}
|
||||||
copyText={copyText}
|
copyText={copyText}
|
||||||
|
|
|
@ -50,7 +50,13 @@ export default function ErrorMessageWithStackTrace({
|
||||||
error.error_type,
|
error.error_type,
|
||||||
);
|
);
|
||||||
if (ErrorMessageComponent) {
|
if (ErrorMessageComponent) {
|
||||||
return <ErrorMessageComponent error={error} source={source} />;
|
return (
|
||||||
|
<ErrorMessageComponent
|
||||||
|
error={error}
|
||||||
|
source={source}
|
||||||
|
subtitle={subtitle}
|
||||||
|
/>
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -44,6 +44,7 @@ const mockedProps = {
|
||||||
message: 'Error message',
|
message: 'Error message',
|
||||||
},
|
},
|
||||||
source: 'dashboard' as ErrorSource,
|
source: 'dashboard' as ErrorSource,
|
||||||
|
subtitle: 'Error message',
|
||||||
};
|
};
|
||||||
|
|
||||||
test('should render', () => {
|
test('should render', () => {
|
||||||
|
|
|
@ -54,6 +54,7 @@ const findMatches = (undefinedParameters: string[], templateKeys: string[]) => {
|
||||||
function ParameterErrorMessage({
|
function ParameterErrorMessage({
|
||||||
error,
|
error,
|
||||||
source = 'sqllab',
|
source = 'sqllab',
|
||||||
|
subtitle,
|
||||||
}: ErrorMessageComponentProps<ParameterErrorExtra>) {
|
}: ErrorMessageComponentProps<ParameterErrorExtra>) {
|
||||||
const { extra, level, message } = error;
|
const { extra, level, message } = error;
|
||||||
|
|
||||||
|
@ -112,7 +113,7 @@ ${extra.issue_codes.map(issueCode => issueCode.message).join('\n')}`;
|
||||||
return (
|
return (
|
||||||
<ErrorAlert
|
<ErrorAlert
|
||||||
title={t('Parameter error')}
|
title={t('Parameter error')}
|
||||||
subtitle={message}
|
subtitle={subtitle}
|
||||||
level={level}
|
level={level}
|
||||||
source={source}
|
source={source}
|
||||||
copyText={copyText}
|
copyText={copyText}
|
||||||
|
|
|
@ -88,6 +88,7 @@ export type ErrorMessageComponentProps<
|
||||||
> = {
|
> = {
|
||||||
error: SupersetError<ExtraType>;
|
error: SupersetError<ExtraType>;
|
||||||
source?: ErrorSource;
|
source?: ErrorSource;
|
||||||
|
subtitle?: React.ReactNode;
|
||||||
};
|
};
|
||||||
|
|
||||||
export type ErrorMessageComponent = React.ComponentType<ErrorMessageComponentProps>;
|
export type ErrorMessageComponent = React.ComponentType<ErrorMessageComponentProps>;
|
||||||
|
|
Loading…
Reference in New Issue