Skip to content

Commit a02aeb6

Browse files
niktverdNikolay Tverdokhlebov
andauthored
fix(card): remove validator (#45)
Co-authored-by: Nikolay Tverdokhlebov <[email protected]>
1 parent fc07782 commit a02aeb6

File tree

11 files changed

+15
-106
lines changed

11 files changed

+15
-106
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# Changelog
22

3+
## [1.5.0](https://github.com/gravity-ui/page-constructor/issues/44) (2022-11-03)
4+
5+
### Features
6+
7+
* remove card validator and types
8+
39
## [1.4.2](https://github.com/gravity-ui/page-constructor/pull/46) (2022-11-07)
410

511
### Bug Fixes

src/components/CardBase/schema.ts

Lines changed: 0 additions & 64 deletions
This file was deleted.

src/constructor-items.ts

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,6 @@ import {
3737
ContentLayoutBlock,
3838
} from './blocks';
3939

40-
import {CardBase} from './components';
41-
4240
export const blockMap = {
4341
[BlockType.SliderBlock]: SliderBlock,
4442
[BlockType.SimpleBlock]: SimpleBlock,
@@ -80,8 +78,4 @@ export const subBlockMap = {
8078
[SubBlockType.BasicCard]: BasicCard,
8179
[SubBlockType.Content]: Content,
8280
[SubBlockType.Quote]: Quote,
83-
/**
84-
* @deprecated Will be removed, use basic card instead
85-
*/
86-
[SubBlockType.Card]: CardBase,
8781
};

src/models/constructor-items/common.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -331,8 +331,6 @@ export interface CardBaseProps {
331331
border?: CardBorder;
332332
}
333333

334-
export interface CardProps extends CardBaseProps, CardData {}
335-
336334
export interface CardHeader {
337335
title?: string;
338336
image?: ImageProps;

src/models/constructor-items/sub-blocks.ts

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ import {
77
ButtonPixel,
88
ButtonProps,
99
CardBaseProps,
10-
CardProps,
1110
ContentTheme,
1211
DividerSize,
1312
ImageObjectProps,
@@ -171,10 +170,6 @@ export type DividerModel = {
171170
type: SubBlockType.Divider;
172171
} & DividerProps;
173172

174-
export type CardModel = {
175-
type: SubBlockType.Card;
176-
} & CardProps;
177-
178173
export type QuoteModel = {
179174
type: SubBlockType.Quote;
180175
} & QuoteProps;
@@ -217,7 +212,6 @@ export type BannerCardModel = {
217212

218213
export type SubBlockModels =
219214
| DividerModel
220-
| CardModel
221215
| QuoteModel
222216
| NewsCardModel
223217
| PartnerModel

src/schema/index.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ import {
2525
} from './validators/blocks';
2626

2727
import {
28-
CardBlock,
2928
PartnerBlock,
3029
MediaCardBlock,
3130
TutorialCard,
@@ -68,7 +67,6 @@ export function generateDefaultSchema(config?: SchemaCustomConfig) {
6867
type: 'string',
6968
enum: [
7069
'divider',
71-
'card',
7270
'quote',
7371
'event',
7472
'post',
@@ -129,7 +127,6 @@ export function generateDefaultSchema(config?: SchemaCustomConfig) {
129127
type: {
130128
type: 'string',
131129
enum: [
132-
'card',
133130
'partner',
134131
'post',
135132
'media-card',
@@ -148,7 +145,6 @@ export function generateDefaultSchema(config?: SchemaCustomConfig) {
148145
select: {$data: '0/type'},
149146
selectCases: {
150147
// Cards
151-
...CardBlock,
152148
...PartnerBlock,
153149
...MediaCardBlock,
154150
...BannerCard,

src/schema/validators/common.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -482,3 +482,10 @@ export const MediaProps = {
482482
},
483483
dataLens: DataLensProps,
484484
};
485+
486+
export const CardBase = {
487+
border: {
488+
type: 'string',
489+
enum: ['border', 'shadow', 'none'],
490+
},
491+
};

src/schema/validators/sub-blocks.ts

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,3 @@ export * from '../../sub-blocks/CardWithImage/schema';
99
export * from '../../sub-blocks/Quote/schema';
1010
export * from '../../sub-blocks/Divider/schema';
1111
export * from '../../sub-blocks/BasicCard/schema';
12-
13-
/**
14-
* @deprecated Will be removed
15-
*/
16-
export * from '../../components/CardBase/schema';

src/sub-blocks/BackgroundCard/schema.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
import {BaseProps, withTheme} from '../../schema/validators/common';
2-
import {CardBase} from '../../components/CardBase/schema';
1+
import {BaseProps, CardBase, withTheme} from '../../schema/validators/common';
32
import {ContentBase} from '../Content/schema';
43
import {ImageObjectProps} from '../../components/Image/schema';
54
import _ from 'lodash';

src/sub-blocks/BasicCard/schema.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import _ from 'lodash';
22

3-
import {BaseProps} from '../../schema/validators/common';
4-
import {CardBase} from '../../components/CardBase/schema';
3+
import {BaseProps, CardBase} from '../../schema/validators/common';
54
import {ContentBase} from '../Content/schema';
65
import {ImageProps} from '../../components/Image/schema';
76

0 commit comments

Comments
 (0)