Skip to content

Commit

Permalink
Merge pull request #43 from epam/Charts
Browse files Browse the repository at this point in the history
Create chart component
  • Loading branch information
kelbitskaya authored Jul 31, 2024
2 parents 958d881 + e7d37cf commit e3625aa
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 3 deletions.
3 changes: 2 additions & 1 deletion src/api/page/content-types/page/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,8 @@
"sections.wave-banner",
"sections.carousel",
"shared.testimonials-card",
"shared.timeline-card"
"shared.timeline-card",
"sections.chart"
]
}
}
Expand Down
20 changes: 20 additions & 0 deletions src/components/sections/chart.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"collectionName": "components_sections_charts",
"info": {
"displayName": "Chart"
},
"options": {},
"attributes": {
"title": {
"type": "string"
},
"outline": {
"type": "boolean",
"default": false
},
"url": {
"type": "string",
"regex": "\\bhttps?:\\/\\/[-a-zA-Z0-9@:%._\\+~#=]{1,256}\\.[a-zA-Z0-9()]{1,6}\\b([-a-zA-Z0-9()@:%_\\+.~#?&//=]*)"
}
}
}
13 changes: 13 additions & 0 deletions types/generated/components.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,18 @@ export interface SectionsCarousel extends Schema.Component {
};
}

export interface SectionsChart extends Schema.Component {
collectionName: 'components_sections_charts';
info: {
displayName: 'Chart';
};
attributes: {
title: Attribute.String;
outline: Attribute.Boolean & Attribute.DefaultTo<false>;
url: Attribute.String;
};
}

export interface SectionsColumnsWithTabs extends Schema.Component {
collectionName: 'components_sections_columns_with_tabs';
info: {
Expand Down Expand Up @@ -1007,6 +1019,7 @@ declare module '@strapi/types' {
'meta.metadata': MetaMetadata;
'sections.blocks-grid': SectionsBlocksGrid;
'sections.carousel': SectionsCarousel;
'sections.chart': SectionsChart;
'sections.columns-with-tabs': SectionsColumnsWithTabs;
'sections.columns': SectionsColumns;
'sections.contact-banner': SectionsContactBanner;
Expand Down
4 changes: 2 additions & 2 deletions types/generated/contentTypes.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1190,7 +1190,6 @@ export interface ApiIconIcon extends Schema.CollectionType {
draftAndPublish: true;
};
attributes: {
icon: Attribute.Component<'shared.social-icon', true>;
createdAt: Attribute.DateTime;
updatedAt: Attribute.DateTime;
publishedAt: Attribute.DateTime;
Expand Down Expand Up @@ -1283,7 +1282,8 @@ export interface ApiPagePage extends Schema.CollectionType {
'sections.wave-banner',
'sections.carousel',
'shared.testimonials-card',
'shared.timeline-card'
'shared.timeline-card',
'sections.chart'
]
> &
Attribute.SetPluginOptions<{
Expand Down

0 comments on commit e3625aa

Please sign in to comment.