mirror of
https://github.com/strapi/strapi.git
synced 2025-09-26 08:52:26 +00:00
Fix relations
This commit is contained in:
parent
618d8afa4d
commit
d2f50f7bae
@ -329,7 +329,9 @@ export const formatModelAttributes = attributes =>
|
||||
if (
|
||||
((curr.includes('max') || curr.includes('min')) && !value) ||
|
||||
curr === 'isVirtual' ||
|
||||
(curr === 'dominant' && !value)
|
||||
(curr === 'dominant' && !value) ||
|
||||
(curr === 'columnName' && value === '') ||
|
||||
(curr === 'targetColumnName' && value === '')
|
||||
) {
|
||||
return acc2;
|
||||
}
|
||||
|
@ -54,16 +54,16 @@ export function* submitCT({
|
||||
body.plugin = source;
|
||||
}
|
||||
|
||||
yield put(emitEvent('willSaveContentType'));
|
||||
emitEvent('willSaveContentType');
|
||||
|
||||
const opts = { method: 'PUT', body };
|
||||
|
||||
yield call(request, requestURL, opts, true);
|
||||
yield put(emitEvent('didSaveContentType'));
|
||||
emitEvent('didSaveContentType');
|
||||
yield put(submitContentTypeSucceeded(oldContentTypeName));
|
||||
|
||||
if (name !== oldContentTypeName) {
|
||||
yield put(emitEvent('didEditNameOfContentType'));
|
||||
emitEvent('didEditNameOfContentType');
|
||||
|
||||
const appPlugins = plugins.toJS ? plugins.toJS() : plugins;
|
||||
const appMenu = get(appPlugins, ['content-manager', 'leftMenuSections'], []);
|
||||
@ -86,14 +86,14 @@ export function* submitCT({
|
||||
/* istanbul ignore-next */
|
||||
export function* submitTempCT({ body, context: { emitEvent, plugins, updatePlugin } }) {
|
||||
try {
|
||||
yield put(emitEvent('willSaveContentType'));
|
||||
emitEvent('willSaveContentType');
|
||||
|
||||
const requestURL = `/${pluginId}/models`;
|
||||
const opts = { method: 'POST', body };
|
||||
|
||||
yield call(request, requestURL, opts, true);
|
||||
|
||||
yield put(emitEvent('didSaveContentType'));
|
||||
emitEvent('didSaveContentType');
|
||||
yield put(submitTempContentTypeSucceeded());
|
||||
|
||||
const { name } = body;
|
||||
|
@ -140,7 +140,6 @@ describe('Content Type Builder Action utils', () => {
|
||||
pluginValue: 'users-permissions',
|
||||
plugin: true,
|
||||
configurable: false,
|
||||
targetColumnName: '',
|
||||
target: 'role',
|
||||
},
|
||||
},
|
||||
@ -152,7 +151,6 @@ describe('Content Type Builder Action utils', () => {
|
||||
nature: 'manyToMany',
|
||||
pluginValue: 'users-permissions',
|
||||
plugin: true,
|
||||
targetColumnName: '',
|
||||
target: 'role2',
|
||||
},
|
||||
},
|
||||
@ -740,7 +738,6 @@ describe('App actions', () => {
|
||||
pluginValue: 'users-permissions',
|
||||
plugin: true,
|
||||
configurable: false,
|
||||
targetColumnName: '',
|
||||
target: 'role',
|
||||
},
|
||||
},
|
||||
@ -833,7 +830,6 @@ describe('App actions', () => {
|
||||
pluginValue: 'users-permissions',
|
||||
plugin: true,
|
||||
configurable: false,
|
||||
targetColumnName: '',
|
||||
target: 'role',
|
||||
},
|
||||
},
|
||||
|
@ -359,7 +359,6 @@
|
||||
"type": "checkbox",
|
||||
"value": false,
|
||||
"validations": {
|
||||
"required": true
|
||||
}
|
||||
}
|
||||
]
|
||||
|
@ -266,7 +266,7 @@ export class ModelPage extends React.Component {
|
||||
} = this.props;
|
||||
const attributeType = ['integer', 'biginteger', 'float', 'decimal'].includes(type) ? 'number' : type;
|
||||
|
||||
if (canOpenModal) {
|
||||
if (canOpenModal || this.isUpdatingTemporaryContentType()) {
|
||||
setTemporaryAttribute(attributeName, this.isUpdatingTemporaryContentType(), this.getModelName());
|
||||
|
||||
await this.wait();
|
||||
|
@ -30,8 +30,9 @@
|
||||
"users": {
|
||||
"collection": "user",
|
||||
"via": "role",
|
||||
"configurable": false,
|
||||
"plugin": "users-permissions"
|
||||
}
|
||||
},
|
||||
"collectionName": "users-permissions_role"
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user