Skip to content

Commit

Permalink
add legacy flag (#80)
Browse files Browse the repository at this point in the history
  • Loading branch information
kristw authored and zhaoyongjie committed Nov 26, 2021
1 parent 597d9b3 commit 26f12af
Showing 1 changed file with 7 additions and 3 deletions.
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 26f12af

Please sign in to comment.