Skip to content

Commit

Permalink
Merge branch '1.3' into 1.x
Browse files Browse the repository at this point in the history
# Conflicts:
#	src/Resources/public/js/pimcore/perspective/perspective.js
  • Loading branch information
robertSt7 committed Jul 6, 2022
2 parents d750078 + 2188644 commit ded6d19
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 14 deletions.
28 changes: 15 additions & 13 deletions src/Controller/PerspectiveController.php
Original file line number Diff line number Diff line change
Expand Up @@ -309,19 +309,21 @@ protected function buildDashboardTree(TreeHelper $treeHelper, $config)
$disabledClass = $config['writeable'] ? '' : $this->disabledCssClass;

$tree = [];
foreach ($config['dashboards']['predefined'] as $dashboardName => $dashboardConfig) {
$tree[] = [
'id' => $treeHelper->createUuid(),
'text' => $dashboardName,
'type' => 'dashboardDefinition',
'leaf' => true,
'allowDrag' => false,
'allowDrop' => false,
'iconCls' => 'pimcore_icon_welcome',
'cls' => $disabledClass,
'writeable' => $config['writeable'],
'config' => array_merge($dashboardConfig, ['name' => $dashboardName])
];
if (isset($config['dashboards']['predefined'])) {
foreach ($config['dashboards']['predefined'] as $dashboardName => $dashboardConfig) {
$tree[] = [
'id' => $treeHelper->createUuid(),
'text' => $dashboardName,
'type' => 'dashboardDefinition',
'leaf' => true,
'allowDrag' => false,
'allowDrop' => false,
'iconCls' => 'pimcore_icon_welcome',
'cls' => $disabledClass,
'writeable' => $config['writeable'],
'config' => array_merge($dashboardConfig, ['name' => $dashboardName])
];
}
}

return $tree;
Expand Down
16 changes: 15 additions & 1 deletion src/Resources/public/js/pimcore/perspective/perspective.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,14 @@ pimcore.registerNS('pimcore.bundle.perspectiveeditor.PerspectiveEditor');
pimcore.bundle.perspectiveeditor.PerspectiveEditor = class {

routePrefix = '/admin/perspectives-views/perspective';
availablePortlets = [];
availablePortlets = [
{name: t('modificationStatistic'), value: 'pimcore.layout.portlets.modificationStatistic'},
{name: t('modifiedDocuments'), value: 'pimcore.layout.portlets.modifiedDocuments'},
{name: t('modifiedAssets'), value: 'pimcore.layout.portlets.modifiedAssets'},
{name: t('modifiedObjects'), value: 'pimcore.layout.portlets.modifiedObjects'},
{name: t('analytics'), value: 'pimcore.layout.portlets.analytics'},
{name: t('customreports'), value: 'pimcore.layout.portlets.customreports'}
];
activeRecordId = null;
deletedRecords = [];

Expand Down Expand Up @@ -305,6 +312,12 @@ pimcore.bundle.perspectiveeditor.PerspectiveEditor = class {

record.data.text = value;
record.data.name = value;

if(record.data.type === 'dashboardDefinition') {
let config = record.data.config;
config['name'] = value;
}

pimcore.bundle.perspectiveeditor.PerspectiveViewHelper.reloadTreeNode(record);
this.setDirty(true);
}
Expand Down Expand Up @@ -626,6 +639,7 @@ pimcore.bundle.perspectiveeditor.PerspectiveEditor = class {
}

createDashboardFormPanel (record){
record.data.config = Object.assign({}, record.data.config);
var config = record.data.config;
var data = this.availablePortlets;
var items = [];
Expand Down

0 comments on commit ded6d19

Please sign in to comment.