Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Include more info on fields #178

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,12 @@
var vm = this;

vm.availableItems = $scope.model.availableItems;
vm.groupedItems = $scope.model.availableItems.reduce((grp, item) => {
let { group } = item;
grp[group] = grp[group] ?? [];
grp[group].push(item);
return grp;
}, {});
vm.model = {
selection: []
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,19 @@
hide-description="true">
</umb-editor-header>
<umb-editor-container>
<umb-box>
<umb-box ng-repeat="group in vm.groupedItems">
<umb-box-content>
<div class="umb-tree">
<h4>
{{group[0].group}}
</h4>
<ul>
<li class="umb-tree-item" ng-repeat="item in vm.availableItems">
<li class="umb-tree-item" ng-repeat="item in group">
<div class="umb-tree-item__inner">
<umb-icon icon="icon-check" class="umb-tree-icon" ng-show="vm.model.selection.includes(item)"></umb-icon>
<umb-icon icon="icon-autofill" class="umb-tree-icon" ng-show="!vm.model.selection.includes(item)"></umb-icon>
<a class="umb-tree-item__label" ng-click="vm.selectItem(item)">
{{item.name}}
{{item.name}} {{item.source == 1 ? '(' + item.value + ')' : ''}}
</a>
</div>
</li>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,8 @@
name: field.name,
value: field.value,
onlyShowIfInherited: field.onlyShowIfInherited,
source: 2
source: 2,
group: 'SEO Toolkit'
});
});
fields.forEach(function (d) {
Expand Down Expand Up @@ -107,11 +108,11 @@

function getAllContentFields(fields) {
return editorState.getCurrent().groups.flatMap(function (g) {
return g.properties;
return g.properties.map(prop => {return { group: g, prop};});
}).filter(function (g) {
return fields.includes(g.editor);
return fields.includes(g.prop.editor);
}).map(function (g) {
return { name: g.label, value: g.alias, source: 1 };
return { name: g.prop.label, value: g.prop.alias, source: 1, group: g.group.name };
});
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<div class="umb-nested-content__heading">
<umb-icon icon="icon-autofill" class="icon"></umb-icon>
<div class="umb-nested-content__item-name --has-icon">
{{field.name}}
{{field.name}} {{field.source == 1 ? '(' + field.value + ')' : ''}}
</div>
</div>
<div class="umb-nested-content__icons">
Expand Down