Skip to content

Commit

Permalink
fix(exportschema): exportSchema(IPublicEnumTransformStage.Save) type …
Browse files Browse the repository at this point in the history
…conver (#2661)

* fix(exportschema): exportSchema(IPublicEnumTransformStage.Save) type conver

* test(prop): nullProp equals null, not
  • Loading branch information
ChiZng authored Nov 20, 2023
1 parent 0f8bc82 commit 8208dd3
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 13 deletions.
4 changes: 0 additions & 4 deletions packages/designer/src/document/node/props/prop.ts
Original file line number Diff line number Diff line change
Expand Up @@ -290,10 +290,6 @@ export class Prop implements IProp, IPropParent {
}

if (type === 'literal' || type === 'expression') {
// TODO 后端改造之后删除此逻辑
if (this._value === null && stage === IPublicEnumTransformStage.Save) {
return '';
}
return this._value;
}

Expand Down
2 changes: 1 addition & 1 deletion packages/designer/tests/document/node/props/prop.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ describe('Prop 类测试', () => {
expect(boolProp.export(IPublicEnumTransformStage.Save)).toBe(true);
expect(strProp.export(IPublicEnumTransformStage.Save)).toBe('haha');
expect(numProp.export(IPublicEnumTransformStage.Save)).toBe(1);
expect(nullProp.export(IPublicEnumTransformStage.Save)).toBe('');
expect(nullProp.export(IPublicEnumTransformStage.Save)).toBe(null);
expect(nullProp.export(IPublicEnumTransformStage.Serilize)).toBe(null);
expect(expProp.export(IPublicEnumTransformStage.Save)).toEqual({
type: 'JSExpression',
Expand Down
16 changes: 8 additions & 8 deletions packages/designer/tests/fixtures/schema/form.ts
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@ export default {
labelTipsText: {
type: 'i18n',
use: 'zh-CN',
'en-US': null,
'en-US': '',
'zh-CN': '',
},
},
Expand Down Expand Up @@ -337,7 +337,7 @@ export default {
labelTipsText: {
type: 'i18n',
use: 'zh-CN',
'en-US': null,
'en-US': '',
'zh-CN': '',
},
},
Expand Down Expand Up @@ -407,7 +407,7 @@ export default {
labelTipsText: {
type: 'i18n',
use: 'zh-CN',
'en-US': null,
'en-US': '',
'zh-CN': '',
},
},
Expand Down Expand Up @@ -489,7 +489,7 @@ export default {
labelTipsText: {
type: 'i18n',
use: 'zh-CN',
'en-US': null,
'en-US': '',
'zh-CN': '',
},
},
Expand Down Expand Up @@ -578,7 +578,7 @@ export default {
labelTipsText: {
type: 'i18n',
use: 'zh-CN',
'en-US': null,
'en-US': '',
'zh-CN': '',
},
searchDelay: 300,
Expand Down Expand Up @@ -697,7 +697,7 @@ export default {
labelTipsText: {
type: 'i18n',
use: 'zh-CN',
'en-US': null,
'en-US': '',
'zh-CN': '',
},
},
Expand Down Expand Up @@ -789,7 +789,7 @@ export default {
labelTipsText: {
type: 'i18n',
use: 'zh-CN',
'en-US': null,
'en-US': '',
'zh-CN': '',
},
},
Expand Down Expand Up @@ -871,7 +871,7 @@ export default {
labelTipsText: {
type: 'i18n',
use: 'zh-CN',
'en-US': null,
'en-US': '',
'zh-CN': '',
},
},
Expand Down

0 comments on commit 8208dd3

Please sign in to comment.