Skip to content
This repository has been archived by the owner on Dec 10, 2021. It is now read-only.

Commit

Permalink
chore(core): adjustments to chart metadata (#1177)
Browse files Browse the repository at this point in the history
  • Loading branch information
suddjian authored Jun 17, 2021
1 parent b9e6268 commit 7aec0a4
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions packages/superset-ui-core/src/chart/models/ChartMetadata.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@ interface LookupTable {
[key: string]: boolean;
}

export interface ExampleImage {
url: string;
caption?: string;
}

export interface ChartMetadataConfig {
name: string;
canBeAnnotationTypes?: string[];
Expand All @@ -17,9 +22,9 @@ export interface ChartMetadataConfig {
useLegacyApi?: boolean;
behaviors?: Behavior[];
deprecated?: boolean;
exampleGallery?: string[];
exampleGallery?: ExampleImage[];
tags?: string[];
categories?: string[];
category?: string | null;
}

export default class ChartMetadata {
Expand Down Expand Up @@ -49,11 +54,11 @@ export default class ChartMetadata {

deprecated: boolean;

exampleGallery: string[];
exampleGallery: ExampleImage[];

tags: string[];

categories: string[];
category: string | null;

constructor(config: ChartMetadataConfig) {
const {
Expand All @@ -71,7 +76,7 @@ export default class ChartMetadata {
deprecated = false,
exampleGallery = [],
tags = [],
categories = [],
category = null,
} = config;

this.name = name;
Expand All @@ -97,7 +102,7 @@ export default class ChartMetadata {
this.deprecated = deprecated;
this.exampleGallery = exampleGallery;
this.tags = tags;
this.categories = categories;
this.category = category;
}

canBeAnnotationType(type: string): boolean {
Expand Down

1 comment on commit 7aec0a4

@vercel
Copy link

@vercel vercel bot commented on 7aec0a4 Jun 17, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.