fix(e2e): change the value of adminSchemaUid
This commit is contained in:
parent
1cbdfa4f60
commit
1eee7f5f4e
@ -435,65 +435,54 @@ const createPage = async (options?: CreatePageOptions) => {
|
|||||||
};
|
};
|
||||||
const state = await api.storageState();
|
const state = await api.storageState();
|
||||||
const headers = getHeaders(state);
|
const headers = getHeaders(state);
|
||||||
|
|
||||||
const systemSettings = await api.get(`/api/systemSettings:get/1`, {
|
|
||||||
headers,
|
|
||||||
});
|
|
||||||
|
|
||||||
const pageUid = uid();
|
const pageUid = uid();
|
||||||
const gridName = uid();
|
const gridName = uid();
|
||||||
|
|
||||||
if (systemSettings.ok()) {
|
const result = await api.post(`/api/uiSchemas:insertAdjacent/nocobase-admin-menu?position=beforeEnd`, {
|
||||||
const { data } = await systemSettings.json();
|
headers,
|
||||||
|
data: {
|
||||||
const result = await api.post(`/api/uiSchemas:insertAdjacent/${data.options.adminSchemaUid}?position=beforeEnd`, {
|
schema: {
|
||||||
headers,
|
_isJSONSchemaObject: true,
|
||||||
data: {
|
version: '2.0',
|
||||||
schema: {
|
type: 'void',
|
||||||
_isJSONSchemaObject: true,
|
title: name || pageUid,
|
||||||
version: '2.0',
|
...typeToSchema[type],
|
||||||
type: 'void',
|
'x-decorator': 'ACLMenuItemProvider',
|
||||||
title: name || pageUid,
|
'x-server-hooks': [
|
||||||
...typeToSchema[type],
|
{ type: 'onSelfCreate', method: 'bindMenuToRole' },
|
||||||
'x-decorator': 'ACLMenuItemProvider',
|
{ type: 'onSelfSave', method: 'extractTextToLocale' },
|
||||||
'x-server-hooks': [
|
],
|
||||||
{ type: 'onSelfCreate', method: 'bindMenuToRole' },
|
properties: {
|
||||||
{ type: 'onSelfSave', method: 'extractTextToLocale' },
|
page: updateUidOfPageSchema(pageSchema) || {
|
||||||
],
|
_isJSONSchemaObject: true,
|
||||||
properties: {
|
version: '2.0',
|
||||||
page: updateUidOfPageSchema(pageSchema) || {
|
type: 'void',
|
||||||
_isJSONSchemaObject: true,
|
'x-component': 'Page',
|
||||||
version: '2.0',
|
'x-async': true,
|
||||||
type: 'void',
|
properties: {
|
||||||
'x-component': 'Page',
|
[gridName]: {
|
||||||
'x-async': true,
|
_isJSONSchemaObject: true,
|
||||||
properties: {
|
version: '2.0',
|
||||||
[gridName]: {
|
type: 'void',
|
||||||
_isJSONSchemaObject: true,
|
'x-component': 'Grid',
|
||||||
version: '2.0',
|
'x-initializer': 'BlockInitializers',
|
||||||
type: 'void',
|
'x-uid': uid(),
|
||||||
'x-component': 'Grid',
|
name: gridName,
|
||||||
'x-initializer': 'BlockInitializers',
|
|
||||||
'x-uid': uid(),
|
|
||||||
name: gridName,
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
'x-uid': uid(),
|
|
||||||
name: 'page',
|
|
||||||
},
|
},
|
||||||
|
'x-uid': uid(),
|
||||||
|
name: 'page',
|
||||||
},
|
},
|
||||||
name: uid(),
|
|
||||||
'x-uid': pageUid,
|
|
||||||
},
|
},
|
||||||
wrap: null,
|
name: uid(),
|
||||||
|
'x-uid': pageUid,
|
||||||
},
|
},
|
||||||
});
|
wrap: null,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
if (!result.ok()) {
|
if (!result.ok()) {
|
||||||
throw new Error(await result.text());
|
throw new Error(await result.text());
|
||||||
}
|
|
||||||
} else {
|
|
||||||
throw new Error('systemSettings is not ok');
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return pageUid;
|
return pageUid;
|
||||||
|
Loading…
Reference in New Issue
Block a user