fix(web): order conditional SaaS questions
This commit is contained in:
@@ -44,6 +44,10 @@ export function buildGuidedRequiredPages<T extends GuidedVariable>(
|
|||||||
preferredNames = ["披露方名称", "接收方名称", "保密方向", "合作事项", "保密信息范围", "使用目的", "保密期限"];
|
preferredNames = ["披露方名称", "接收方名称", "保密方向", "合作事项", "保密信息范围", "使用目的", "保密期限"];
|
||||||
} else if (templateId === "TPL-LEASE-HOUSE-001" && variables.some((item) => item.name === "租金计价单位")) {
|
} else if (templateId === "TPL-LEASE-HOUSE-001" && variables.some((item) => item.name === "租金计价单位")) {
|
||||||
preferredNames = ["出租方名称", "承租方名称", "房屋地址", "租赁用途", "租赁起止日期", "租金标准", "租金计价单位"];
|
preferredNames = ["出租方名称", "承租方名称", "房屋地址", "租赁用途", "租赁起止日期", "租金标准", "租金计价单位"];
|
||||||
|
} else if (templateId === "TPL-SOFTWARE-SAAS-001" && variables.some((item) => item.name === "个人信息处理")) {
|
||||||
|
// Ask every branch controller before any dependent fact can be inserted
|
||||||
|
// into an already-completed page of the progressive wizard.
|
||||||
|
preferredNames = ["甲方名称", "乙方名称", "续费方式", "SLA约定", "个人信息处理", "服务名称", "服务期限"];
|
||||||
}
|
}
|
||||||
const byName = new Map(variables.map((variable) => [variable.name, variable]));
|
const byName = new Map(variables.map((variable) => [variable.name, variable]));
|
||||||
const preferred = preferredNames.flatMap((name) => {
|
const preferred = preferredNames.flatMap((name) => {
|
||||||
|
|||||||
@@ -49,6 +49,9 @@ test("labor probation, open term and special hours drive their actual dependent
|
|||||||
|
|
||||||
test("SaaS conditions and NDA reciprocal branch have no silently inserted default facts", () => {
|
test("SaaS conditions and NDA reciprocal branch have no silently inserted default facts", () => {
|
||||||
const saas = template("software-saas", "TPL-SOFTWARE-SAAS-001");
|
const saas = template("software-saas", "TPL-SOFTWARE-SAAS-001");
|
||||||
|
const initial = getTemplateInputState(saas, {});
|
||||||
|
const firstPage = buildGuidedRequiredPages(saas.id, initial.required)[0].map((field) => field.name);
|
||||||
|
assert.ok(["续费方式", "SLA约定", "个人信息处理"].every((name) => firstPage.includes(name)));
|
||||||
const names = getTemplateInputState(saas, { "续费方式": "自动续费", "SLA约定": "约定SLA", "个人信息处理": "不涉及个人信息" }).required.map((field) => field.name);
|
const names = getTemplateInputState(saas, { "续费方式": "自动续费", "SLA约定": "约定SLA", "个人信息处理": "不涉及个人信息" }).required.map((field) => field.name);
|
||||||
assert.ok(names.includes("续费取消方式") && names.includes("服务可用性") && names.includes("SLA服务补偿"));
|
assert.ok(names.includes("续费取消方式") && names.includes("服务可用性") && names.includes("SLA服务补偿"));
|
||||||
assert.equal(names.includes("个人信息类型"), false);
|
assert.equal(names.includes("个人信息类型"), false);
|
||||||
|
|||||||
Reference in New Issue
Block a user