mirror of
https://github.com/strapi/strapi.git
synced 2025-08-06 15:53:11 +00:00
Merge branch 'master' into patch-1
This commit is contained in:
commit
f729bb39cb
@ -183,6 +183,18 @@ module.exports = {
|
|||||||
return ctx.badRequest(null, [{ messages: removeModelErrors }]);
|
return ctx.badRequest(null, [{ messages: removeModelErrors }]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const pluginStore = strapi.store({
|
||||||
|
environment: '',
|
||||||
|
type: 'plugin',
|
||||||
|
name: 'content-manager'
|
||||||
|
});
|
||||||
|
|
||||||
|
const schema = await pluginStore.get({ key: 'schema' });
|
||||||
|
|
||||||
|
delete schema.layout[model];
|
||||||
|
|
||||||
|
await pluginStore.set({ key: 'schema', value: schema });
|
||||||
|
|
||||||
ctx.send({ ok: true });
|
ctx.send({ ok: true });
|
||||||
|
|
||||||
strapi.reload();
|
strapi.reload();
|
||||||
|
@ -42,7 +42,7 @@ module.exports = {
|
|||||||
const attrToRemoveInfos = manager.attrToRemoveInfos; // Retrieve the removed item infos
|
const attrToRemoveInfos = manager.attrToRemoveInfos; // Retrieve the removed item infos
|
||||||
const arrayOfLastLineElements = manager.arrayOfEndLineElements;
|
const arrayOfLastLineElements = manager.arrayOfEndLineElements;
|
||||||
const isRemovingAFullWidthNode = attrToRemoveInfos.bootstrapCol === 12;
|
const isRemovingAFullWidthNode = attrToRemoveInfos.bootstrapCol === 12;
|
||||||
|
|
||||||
if (isRemovingAFullWidthNode) {
|
if (isRemovingAFullWidthNode) {
|
||||||
const currentNodeLine = _.findIndex(arrayOfLastLineElements, ['index', attrToRemoveInfos.index]); // Used only to know if removing a full size element on the first line
|
const currentNodeLine = _.findIndex(arrayOfLastLineElements, ['index', attrToRemoveInfos.index]); // Used only to know if removing a full size element on the first line
|
||||||
if (currentNodeLine === 0) {
|
if (currentNodeLine === 0) {
|
||||||
@ -55,7 +55,7 @@ module.exports = {
|
|||||||
const previousLineRangeIndexes = firstElementOnLine === lastElementOnLine ? [firstElementOnLine] : _.range(firstElementOnLine, lastElementOnLine);
|
const previousLineRangeIndexes = firstElementOnLine === lastElementOnLine ? [firstElementOnLine] : _.range(firstElementOnLine, lastElementOnLine);
|
||||||
const elementsOnLine = manager.getElementsOnALine(previousLineRangeIndexes);
|
const elementsOnLine = manager.getElementsOnALine(previousLineRangeIndexes);
|
||||||
const previousLineColNumber = manager.getLineSize(elementsOnLine);
|
const previousLineColNumber = manager.getLineSize(elementsOnLine);
|
||||||
|
|
||||||
if (previousLineColNumber >= 10) {
|
if (previousLineColNumber >= 10) {
|
||||||
newList = newList
|
newList = newList
|
||||||
.delete(index);
|
.delete(index);
|
||||||
@ -65,7 +65,7 @@ module.exports = {
|
|||||||
newList = newList
|
newList = newList
|
||||||
.delete(index)
|
.delete(index)
|
||||||
.insert(index, colsToAdd[0]);
|
.insert(index, colsToAdd[0]);
|
||||||
|
|
||||||
if (colsToAdd.length > 1) {
|
if (colsToAdd.length > 1) {
|
||||||
newList = newList
|
newList = newList
|
||||||
.insert(index, colsToAdd[1]);
|
.insert(index, colsToAdd[1]);
|
||||||
@ -84,7 +84,7 @@ module.exports = {
|
|||||||
newList = newList
|
newList = newList
|
||||||
.delete(attrToRemoveInfos.index);
|
.delete(attrToRemoveInfos.index);
|
||||||
} else {
|
} else {
|
||||||
const random = Math.floor(Math.random() * 1000);
|
const random = Math.random().toString(36).substring(7);
|
||||||
newList = newList
|
newList = newList
|
||||||
.delete(attrToRemoveInfos.index)
|
.delete(attrToRemoveInfos.index)
|
||||||
.insert(rightBoundIndex, `__col-md-${attrToRemoveInfos.bootstrapCol}__${random}`);
|
.insert(rightBoundIndex, `__col-md-${attrToRemoveInfos.bootstrapCol}__${random}`);
|
||||||
@ -96,7 +96,6 @@ module.exports = {
|
|||||||
const lastManager = createManager(state, newList, keys, 0, fromJS(layout.attributes));
|
const lastManager = createManager(state, newList, keys, 0, fromJS(layout.attributes));
|
||||||
newList = reorderList(lastManager, lastManager.getLayout());
|
newList = reorderList(lastManager, lastManager.getLayout());
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
// Delete them from the available fields
|
// Delete them from the available fields
|
||||||
fieldsToRemove.forEach(field => {
|
fieldsToRemove.forEach(field => {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user