mirror of
https://github.com/alibaba/lowcode-engine.git
synced 2025-12-13 04:03:07 +00:00
fix(exportschema): exportSchema(IPublicEnumTransformStage.Save) type conver (#2661)
* fix(exportschema): exportSchema(IPublicEnumTransformStage.Save) type conver * test(prop): nullProp equals null, not
This commit is contained in:
parent
7469a43b46
commit
9aacf3daee
@ -290,10 +290,6 @@ export class Prop implements IProp, IPropParent {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (type === 'literal' || type === 'expression') {
|
if (type === 'literal' || type === 'expression') {
|
||||||
// TODO 后端改造之后删除此逻辑
|
|
||||||
if (this._value === null && stage === IPublicEnumTransformStage.Save) {
|
|
||||||
return '';
|
|
||||||
}
|
|
||||||
return this._value;
|
return this._value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -136,7 +136,7 @@ describe('Prop 类测试', () => {
|
|||||||
expect(boolProp.export(IPublicEnumTransformStage.Save)).toBe(true);
|
expect(boolProp.export(IPublicEnumTransformStage.Save)).toBe(true);
|
||||||
expect(strProp.export(IPublicEnumTransformStage.Save)).toBe('haha');
|
expect(strProp.export(IPublicEnumTransformStage.Save)).toBe('haha');
|
||||||
expect(numProp.export(IPublicEnumTransformStage.Save)).toBe(1);
|
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(nullProp.export(IPublicEnumTransformStage.Serilize)).toBe(null);
|
||||||
expect(expProp.export(IPublicEnumTransformStage.Save)).toEqual({
|
expect(expProp.export(IPublicEnumTransformStage.Save)).toEqual({
|
||||||
type: 'JSExpression',
|
type: 'JSExpression',
|
||||||
|
|||||||
16
packages/designer/tests/fixtures/schema/form.ts
vendored
16
packages/designer/tests/fixtures/schema/form.ts
vendored
@ -267,7 +267,7 @@ export default {
|
|||||||
labelTipsText: {
|
labelTipsText: {
|
||||||
type: 'i18n',
|
type: 'i18n',
|
||||||
use: 'zh-CN',
|
use: 'zh-CN',
|
||||||
'en-US': null,
|
'en-US': '',
|
||||||
'zh-CN': '',
|
'zh-CN': '',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@ -337,7 +337,7 @@ export default {
|
|||||||
labelTipsText: {
|
labelTipsText: {
|
||||||
type: 'i18n',
|
type: 'i18n',
|
||||||
use: 'zh-CN',
|
use: 'zh-CN',
|
||||||
'en-US': null,
|
'en-US': '',
|
||||||
'zh-CN': '',
|
'zh-CN': '',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@ -407,7 +407,7 @@ export default {
|
|||||||
labelTipsText: {
|
labelTipsText: {
|
||||||
type: 'i18n',
|
type: 'i18n',
|
||||||
use: 'zh-CN',
|
use: 'zh-CN',
|
||||||
'en-US': null,
|
'en-US': '',
|
||||||
'zh-CN': '',
|
'zh-CN': '',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@ -489,7 +489,7 @@ export default {
|
|||||||
labelTipsText: {
|
labelTipsText: {
|
||||||
type: 'i18n',
|
type: 'i18n',
|
||||||
use: 'zh-CN',
|
use: 'zh-CN',
|
||||||
'en-US': null,
|
'en-US': '',
|
||||||
'zh-CN': '',
|
'zh-CN': '',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@ -578,7 +578,7 @@ export default {
|
|||||||
labelTipsText: {
|
labelTipsText: {
|
||||||
type: 'i18n',
|
type: 'i18n',
|
||||||
use: 'zh-CN',
|
use: 'zh-CN',
|
||||||
'en-US': null,
|
'en-US': '',
|
||||||
'zh-CN': '',
|
'zh-CN': '',
|
||||||
},
|
},
|
||||||
searchDelay: 300,
|
searchDelay: 300,
|
||||||
@ -697,7 +697,7 @@ export default {
|
|||||||
labelTipsText: {
|
labelTipsText: {
|
||||||
type: 'i18n',
|
type: 'i18n',
|
||||||
use: 'zh-CN',
|
use: 'zh-CN',
|
||||||
'en-US': null,
|
'en-US': '',
|
||||||
'zh-CN': '',
|
'zh-CN': '',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@ -789,7 +789,7 @@ export default {
|
|||||||
labelTipsText: {
|
labelTipsText: {
|
||||||
type: 'i18n',
|
type: 'i18n',
|
||||||
use: 'zh-CN',
|
use: 'zh-CN',
|
||||||
'en-US': null,
|
'en-US': '',
|
||||||
'zh-CN': '',
|
'zh-CN': '',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@ -871,7 +871,7 @@ export default {
|
|||||||
labelTipsText: {
|
labelTipsText: {
|
||||||
type: 'i18n',
|
type: 'i18n',
|
||||||
use: 'zh-CN',
|
use: 'zh-CN',
|
||||||
'en-US': null,
|
'en-US': '',
|
||||||
'zh-CN': '',
|
'zh-CN': '',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user