i18n实体 configuration去掉static
This commit is contained in:
parent
29d758c69d
commit
16a382c0b2
|
|
@ -37,7 +37,6 @@ exports.desc = {
|
|||
type: "object"
|
||||
}
|
||||
},
|
||||
static: true,
|
||||
actionType: "crud",
|
||||
actions: action_1.genericActions,
|
||||
indexes: [
|
||||
|
|
|
|||
|
|
@ -177,6 +177,14 @@ export type CreateOperationData = FormCreateData<Omit<OpSchema, "entity" | "enti
|
|||
entity: "actionAuth";
|
||||
entityId: ForeignKey<"ActionAuth">;
|
||||
actionAuth?: never;
|
||||
} | {
|
||||
entity?: never;
|
||||
entityId?: never;
|
||||
i18n: I18n.CreateSingleOperation;
|
||||
} | {
|
||||
entity: "i18n";
|
||||
entityId: ForeignKey<"I18n">;
|
||||
i18n?: I18n.UpdateOperation;
|
||||
} | {
|
||||
entity: "i18n";
|
||||
entityId: ForeignKey<"I18n">;
|
||||
|
|
@ -289,6 +297,10 @@ export type UpdateOperationData = FormUpdateData<Omit<OpSchema, "entity" | "enti
|
|||
actionAuth?: ActionAuth.CreateSingleOperation | ActionAuth.UpdateOperation | ActionAuth.RemoveOperation;
|
||||
entityId?: never;
|
||||
entity?: never;
|
||||
} | {
|
||||
i18n?: I18n.CreateSingleOperation | I18n.UpdateOperation | I18n.RemoveOperation;
|
||||
entityId?: never;
|
||||
entity?: never;
|
||||
} | {
|
||||
path?: Path.CreateSingleOperation | Path.UpdateOperation | Path.RemoveOperation;
|
||||
entityId?: never;
|
||||
|
|
@ -337,6 +349,8 @@ export type RemoveOperationData = {} & (({
|
|||
modi?: Modi.UpdateOperation | Modi.RemoveOperation;
|
||||
})) & ({
|
||||
actionAuth?: ActionAuth.UpdateOperation | ActionAuth.RemoveOperation;
|
||||
} | {
|
||||
i18n?: I18n.UpdateOperation | I18n.RemoveOperation;
|
||||
} | {
|
||||
path?: Path.UpdateOperation | Path.RemoveOperation;
|
||||
} | {
|
||||
|
|
|
|||
|
|
@ -174,6 +174,14 @@ export type CreateOperationData = FormCreateData<Omit<OpSchema, "entity" | "enti
|
|||
entity: "actionAuth";
|
||||
entityId: ForeignKey<"ActionAuth">;
|
||||
actionAuth?: never;
|
||||
} | {
|
||||
entity?: never;
|
||||
entityId?: never;
|
||||
i18n: I18n.CreateSingleOperation;
|
||||
} | {
|
||||
entity: "i18n";
|
||||
entityId: ForeignKey<"I18n">;
|
||||
i18n?: I18n.UpdateOperation;
|
||||
} | {
|
||||
entity: "i18n";
|
||||
entityId: ForeignKey<"I18n">;
|
||||
|
|
@ -280,6 +288,10 @@ export type UpdateOperationData = FormUpdateData<Omit<OpSchema, "entity" | "enti
|
|||
actionAuth?: ActionAuth.CreateSingleOperation | ActionAuth.UpdateOperation | ActionAuth.RemoveOperation;
|
||||
entityId?: never;
|
||||
entity?: never;
|
||||
} | {
|
||||
i18n?: I18n.CreateSingleOperation | I18n.UpdateOperation | I18n.RemoveOperation;
|
||||
entityId?: never;
|
||||
entity?: never;
|
||||
} | {
|
||||
path?: Path.CreateSingleOperation | Path.UpdateOperation | Path.RemoveOperation;
|
||||
entityId?: never;
|
||||
|
|
@ -326,6 +338,8 @@ export type UpdateOperationData = FormUpdateData<Omit<OpSchema, "entity" | "enti
|
|||
export type UpdateOperation = OakOperation<"update" | string, UpdateOperationData, Filter, Sorter>;
|
||||
export type RemoveOperationData = {} & ({
|
||||
actionAuth?: ActionAuth.UpdateOperation | ActionAuth.RemoveOperation;
|
||||
} | {
|
||||
i18n?: I18n.UpdateOperation | I18n.RemoveOperation;
|
||||
} | {
|
||||
path?: Path.UpdateOperation | Path.RemoveOperation;
|
||||
} | {
|
||||
|
|
|
|||
|
|
@ -30,7 +30,4 @@ const entityDesc = {
|
|||
},
|
||||
}
|
||||
],
|
||||
configuration: {
|
||||
static: true,
|
||||
},
|
||||
};
|
||||
|
|
|
|||
|
|
@ -77,7 +77,7 @@ function createUniqueCheckers(schema) {
|
|||
entity,
|
||||
action: 'create',
|
||||
type: 'logicalData',
|
||||
priority: types_1.CHECKER_MAX_PRIORITY,
|
||||
priority: types_1.CHECKER_MAX_PRIORITY, // 优先级要放在最低,所有前置的checker/trigger将数据完整之后再在这里检测
|
||||
checker: (operation, context) => {
|
||||
const { data } = operation;
|
||||
if (data instanceof Array) {
|
||||
|
|
@ -93,9 +93,9 @@ function createUniqueCheckers(schema) {
|
|||
}
|
||||
}, {
|
||||
entity,
|
||||
action: 'update',
|
||||
action: 'update', // 只检查update,其它状态转换的action应该不会涉及unique约束的属性
|
||||
type: 'logicalData',
|
||||
priority: types_1.CHECKER_MAX_PRIORITY,
|
||||
priority: types_1.CHECKER_MAX_PRIORITY, // 优先级要放在最低,所有前置的checker/trigger将数据完整之后再在这里检测
|
||||
checker: (operation, context) => {
|
||||
const { data, filter: operationFilter } = operation;
|
||||
if (data) {
|
||||
|
|
@ -213,7 +213,7 @@ function createActionTransformerCheckers(actionDefDict) {
|
|||
action: 'create',
|
||||
type: 'logicalData',
|
||||
entity,
|
||||
priority: 10,
|
||||
priority: 10, // 优先级要高,先于真正的data检查进行
|
||||
checker: (operation) => {
|
||||
const { data } = operation;
|
||||
if (data instanceof Array) {
|
||||
|
|
|
|||
|
|
@ -60,7 +60,7 @@ function destructRelationPath(schema, entity, path, relationFilter, recursive) {
|
|||
},
|
||||
filter: relationFilter,
|
||||
} // as ED['userRelation']['Selection']
|
||||
},
|
||||
}, // as ED[keyof ED]['Selection']['data'],
|
||||
getData: (d) => {
|
||||
return d.userRelation$entity;
|
||||
},
|
||||
|
|
|
|||
|
|
@ -39,7 +39,4 @@ const entityDesc: EntityDesc<Schema> = {
|
|||
},
|
||||
}
|
||||
],
|
||||
configuration: {
|
||||
static: true,
|
||||
},
|
||||
};
|
||||
|
|
|
|||
Loading…
Reference in New Issue