Convert level into group type and ensure names are unique again

This commit is contained in:
Ronald Barendse
2021-06-22 11:45:23 +02:00
parent 0e63edb375
commit 17d2c4cab9
24 changed files with 172 additions and 80 deletions

View File

@@ -23,12 +23,12 @@
if (newValue && newValue.length === 0) return;
scope.tabs = $filter("filter")(scope.model.groups, (group) => {
return group.level === 0;
return group.type === 1;
});
});
function getFirstTab () {
return scope.model.groups.find(group => group.level === 0);
return scope.model.groups.find(group => group.type === 1);
}
function activate() {
@@ -402,7 +402,7 @@
key: String.CreateGuid(),
name: "",
parentKey: null,
level: 0,
type: 1,
sortOrder,
icon: "icon-document color-black"
};
@@ -504,7 +504,7 @@
parentTabContentTypeNames: [],
name: "",
parentKey: tabKey || null,
level: 1,
type: 0,
sortOrder: lastGroupSortOrder
};

View File

@@ -64,7 +64,7 @@
var saveModel = _.pick(displayModel,
'compositeContentTypes', 'isContainer', 'allowAsRoot', 'allowedTemplates', 'allowedContentTypes',
'alias', 'description', 'thumbnail', 'name', 'id', 'icon', 'trashed',
'key', 'parentId', 'alias', 'path', 'allowCultureVariant', 'allowSegmentVariant', 'isElement', 'tabs');
'key', 'parentId', 'alias', 'path', 'allowCultureVariant', 'allowSegmentVariant', 'isElement');
// TODO: Map these
saveModel.allowedTemplates = _.map(displayModel.allowedTemplates, function (t) { return t.alias; });
@@ -75,7 +75,7 @@
});
saveModel.groups = _.map(realGroups, function (g) {
var saveGroup = _.pick(g, 'inherited', 'id', 'sortOrder', 'name', 'key', 'parentKey', 'level', 'icon');
var saveGroup = _.pick(g, 'inherited', 'id', 'sortOrder', 'name', 'key', 'parentKey', 'type', 'icon');
var realProperties = _.reject(g.properties, function (p) {
//do not include these properties