Skip to content

Commit 9aacf3d

Browse files
ChiZngJackLian
authored andcommitted
fix(exportschema): exportSchema(IPublicEnumTransformStage.Save) type conver (#2661)
* fix(exportschema): exportSchema(IPublicEnumTransformStage.Save) type conver * test(prop): nullProp equals null, not
1 parent 7469a43 commit 9aacf3d

File tree

3 files changed

+9
-13
lines changed

3 files changed

+9
-13
lines changed

packages/designer/src/document/node/props/prop.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -290,10 +290,6 @@ export class Prop implements IProp, IPropParent {
290290
}
291291

292292
if (type === 'literal' || type === 'expression') {
293-
// TODO 后端改造之后删除此逻辑
294-
if (this._value === null && stage === IPublicEnumTransformStage.Save) {
295-
return '';
296-
}
297293
return this._value;
298294
}
299295

packages/designer/tests/document/node/props/prop.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ describe('Prop 类测试', () => {
136136
expect(boolProp.export(IPublicEnumTransformStage.Save)).toBe(true);
137137
expect(strProp.export(IPublicEnumTransformStage.Save)).toBe('haha');
138138
expect(numProp.export(IPublicEnumTransformStage.Save)).toBe(1);
139-
expect(nullProp.export(IPublicEnumTransformStage.Save)).toBe('');
139+
expect(nullProp.export(IPublicEnumTransformStage.Save)).toBe(null);
140140
expect(nullProp.export(IPublicEnumTransformStage.Serilize)).toBe(null);
141141
expect(expProp.export(IPublicEnumTransformStage.Save)).toEqual({
142142
type: 'JSExpression',

packages/designer/tests/fixtures/schema/form.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -267,7 +267,7 @@ export default {
267267
labelTipsText: {
268268
type: 'i18n',
269269
use: 'zh-CN',
270-
'en-US': null,
270+
'en-US': '',
271271
'zh-CN': '',
272272
},
273273
},
@@ -337,7 +337,7 @@ export default {
337337
labelTipsText: {
338338
type: 'i18n',
339339
use: 'zh-CN',
340-
'en-US': null,
340+
'en-US': '',
341341
'zh-CN': '',
342342
},
343343
},
@@ -407,7 +407,7 @@ export default {
407407
labelTipsText: {
408408
type: 'i18n',
409409
use: 'zh-CN',
410-
'en-US': null,
410+
'en-US': '',
411411
'zh-CN': '',
412412
},
413413
},
@@ -489,7 +489,7 @@ export default {
489489
labelTipsText: {
490490
type: 'i18n',
491491
use: 'zh-CN',
492-
'en-US': null,
492+
'en-US': '',
493493
'zh-CN': '',
494494
},
495495
},
@@ -578,7 +578,7 @@ export default {
578578
labelTipsText: {
579579
type: 'i18n',
580580
use: 'zh-CN',
581-
'en-US': null,
581+
'en-US': '',
582582
'zh-CN': '',
583583
},
584584
searchDelay: 300,
@@ -697,7 +697,7 @@ export default {
697697
labelTipsText: {
698698
type: 'i18n',
699699
use: 'zh-CN',
700-
'en-US': null,
700+
'en-US': '',
701701
'zh-CN': '',
702702
},
703703
},
@@ -789,7 +789,7 @@ export default {
789789
labelTipsText: {
790790
type: 'i18n',
791791
use: 'zh-CN',
792-
'en-US': null,
792+
'en-US': '',
793793
'zh-CN': '',
794794
},
795795
},
@@ -871,7 +871,7 @@ export default {
871871
labelTipsText: {
872872
type: 'i18n',
873873
use: 'zh-CN',
874-
'en-US': null,
874+
'en-US': '',
875875
'zh-CN': '',
876876
},
877877
},

0 commit comments

Comments
 (0)