Skip to content

Commit

Permalink
add legacy flag (apache#80)
Browse files Browse the repository at this point in the history
  • Loading branch information
kristw authored Jan 24, 2019
1 parent e8f8430 commit c353610
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions packages/superset-ui-chart/src/models/ChartMetadata.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,32 +4,35 @@ interface LookupTable {

export interface ChartMetadataConfig {
name: string;
canBeAnnotationTypes?: Array<string>;
credits?: Array<string>;
description?: string;
show?: boolean;
canBeAnnotationTypes?: Array<string>;
supportedAnnotationTypes?: Array<string>;
thumbnail: string;
useLegacyApi?: boolean;
}

export default class ChartMetadata {
name: string;
canBeAnnotationTypesLookup: LookupTable;
credits: Array<string>;
description: string;
show: boolean;
canBeAnnotationTypesLookup: LookupTable;
supportedAnnotationTypes: Array<string>;
thumbnail: string;
useLegacyApi: boolean;

constructor(config: ChartMetadataConfig) {
const {
name,
canBeAnnotationTypes = [],
credits = [],
description = '',
show = true,
canBeAnnotationTypes = [],
supportedAnnotationTypes = [],
thumbnail,
useLegacyApi = false,
} = config;

this.name = name;
Expand All @@ -47,6 +50,7 @@ export default class ChartMetadata {
);
this.supportedAnnotationTypes = supportedAnnotationTypes;
this.thumbnail = thumbnail;
this.useLegacyApi = useLegacyApi;
}

canBeAnnotationType(type: string): boolean {
Expand Down

0 comments on commit c353610

Please sign in to comment.