Skip to content

Commit

Permalink
[Improvement]: Make Dependencies tab hide-able via config (#549)
Browse files Browse the repository at this point in the history
  • Loading branch information
kingjia90 committed Jun 18, 2024
1 parent b47c6fb commit e87b3c7
Show file tree
Hide file tree
Showing 17 changed files with 113 additions and 32 deletions.
9 changes: 7 additions & 2 deletions public/js/pimcore/asset/archive.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,11 @@ pimcore.asset.archive = Class.create(pimcore.asset.asset, {
this.properties = new pimcore.element.properties(this, "asset");
this.versions = new pimcore.asset.versions(this);
this.scheduler = new pimcore.element.scheduler(this, "asset");
this.dependencies = new pimcore.element.dependencies(this, "asset");

if (pimcore.settings.dependency) {
this.dependencies = new pimcore.element.dependencies(this, "asset");
}

if (user.isAllowed("notes_events")) {
this.notes = new pimcore.element.notes(this, "asset");
}
Expand Down Expand Up @@ -73,7 +76,9 @@ pimcore.asset.archive = Class.create(pimcore.asset.asset, {
items.push(this.scheduler.getLayout());
}

items.push(this.dependencies.getLayout());
if (typeof this.dependencies !== "undefined") {
items.push(this.dependencies.getLayout());
}

if (user.isAllowed("notes_events")) {
items.push(this.notes.getLayout());
Expand Down
9 changes: 7 additions & 2 deletions public/js/pimcore/asset/audio.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,10 @@ pimcore.asset.audio = Class.create(pimcore.asset.asset, {
this.properties = new pimcore.element.properties(this, "asset");
this.versions = new pimcore.asset.versions(this);
this.scheduler = new pimcore.element.scheduler(this, "asset");
this.dependencies = new pimcore.element.dependencies(this, "asset");

if (pimcore.settings.dependency) {
this.dependencies = new pimcore.element.dependencies(this, "asset");
}

if (user.isAllowed("notes_events")) {
this.notes = new pimcore.element.notes(this, "asset");
Expand Down Expand Up @@ -77,7 +80,9 @@ pimcore.asset.audio = Class.create(pimcore.asset.asset, {
items.push(this.scheduler.getLayout());
}

items.push(this.dependencies.getLayout());
if (typeof this.dependencies !== "undefined") {
items.push(this.dependencies.getLayout());
}

if (user.isAllowed("notes_events")) {
items.push(this.notes.getLayout());
Expand Down
9 changes: 7 additions & 2 deletions public/js/pimcore/asset/document.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,10 @@ pimcore.asset.document = Class.create(pimcore.asset.asset, {
this.properties = new pimcore.element.properties(this, "asset");
this.versions = new pimcore.asset.versions(this);
this.scheduler = new pimcore.element.scheduler(this, "asset");
this.dependencies = new pimcore.element.dependencies(this, "asset");

if (pimcore.settings.dependency) {
this.dependencies = new pimcore.element.dependencies(this, "asset");
}

if (user.isAllowed("notes_events")) {
this.notes = new pimcore.element.notes(this, "asset");
Expand Down Expand Up @@ -79,7 +82,9 @@ pimcore.asset.document = Class.create(pimcore.asset.asset, {
items.push(this.scheduler.getLayout());
}

items.push(this.dependencies.getLayout());
if (typeof this.dependencies !== "undefined") {
items.push(this.dependencies.getLayout());
}

if (user.isAllowed("notes_events")) {
items.push(this.notes.getLayout());
Expand Down
9 changes: 7 additions & 2 deletions public/js/pimcore/asset/folder.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,10 @@ pimcore.asset.folder = Class.create(pimcore.asset.asset, {
var user = pimcore.globalmanager.get("user");

this.properties = new pimcore.element.properties(this, "asset");
this.dependencies = new pimcore.element.dependencies(this, "asset");

if (pimcore.settings.dependency) {
this.dependencies = new pimcore.element.dependencies(this, "asset");
}

if (user.isAllowed("notes_events")) {
this.notes = new pimcore.element.notes(this, "asset");
Expand Down Expand Up @@ -147,7 +150,9 @@ pimcore.asset.folder = Class.create(pimcore.asset.asset, {
items.push(this.properties.getLayout());
}

items.push(this.dependencies.getLayout());
if (typeof this.dependencies !== "undefined") {
items.push(this.dependencies.getLayout());
}


if (user.isAllowed("notes_events")) {
Expand Down
9 changes: 7 additions & 2 deletions public/js/pimcore/asset/image.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,10 @@ pimcore.asset.image = Class.create(pimcore.asset.asset, {
this.properties = new pimcore.element.properties(this, "asset");
this.versions = new pimcore.asset.versions(this);
this.scheduler = new pimcore.element.scheduler(this, "asset");
this.dependencies = new pimcore.element.dependencies(this, "asset");

if (pimcore.settings.dependency) {
this.dependencies = new pimcore.element.dependencies(this, "asset");
}

if (user.isAllowed("notes_events")) {
this.notes = new pimcore.element.notes(this, "asset");
Expand Down Expand Up @@ -87,7 +90,9 @@ pimcore.asset.image = Class.create(pimcore.asset.asset, {
items.push(this.scheduler.getLayout());
}

items.push(this.dependencies.getLayout());
if (typeof this.dependencies !== "undefined") {
items.push(this.dependencies.getLayout());
}

if (user.isAllowed("notes_events")) {
items.push(this.notes.getLayout());
Expand Down
9 changes: 7 additions & 2 deletions public/js/pimcore/asset/text.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,10 @@ pimcore.asset.text = Class.create(pimcore.asset.asset, {
this.properties = new pimcore.element.properties(this, "asset");
this.versions = new pimcore.asset.versions(this);
this.scheduler = new pimcore.element.scheduler(this, "asset");
this.dependencies = new pimcore.element.dependencies(this, "asset");

if (pimcore.settings.dependency) {
this.dependencies = new pimcore.element.dependencies(this, "asset");
}

if (user.isAllowed("notes_events")) {
this.notes = new pimcore.element.notes(this, "asset");
Expand Down Expand Up @@ -75,7 +78,9 @@ pimcore.asset.text = Class.create(pimcore.asset.asset, {
items.push(this.scheduler.getLayout());
}

items.push(this.dependencies.getLayout());
if (typeof this.dependencies !== "undefined") {
items.push(this.dependencies.getLayout());
}

if (user.isAllowed("notes_events")) {
items.push(this.notes.getLayout());
Expand Down
9 changes: 7 additions & 2 deletions public/js/pimcore/asset/unknown.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,10 @@ pimcore.asset.unknown = Class.create(pimcore.asset.asset, {
this.properties = new pimcore.element.properties(this, "asset");
this.versions = new pimcore.asset.versions(this);
this.scheduler = new pimcore.element.scheduler(this, "asset");
this.dependencies = new pimcore.element.dependencies(this, "asset");

if (pimcore.settings.dependency) {
this.dependencies = new pimcore.element.dependencies(this, "asset");
}

if (user.isAllowed("notes_events")) {
this.notes = new pimcore.element.notes(this, "asset");
Expand Down Expand Up @@ -74,7 +77,9 @@ pimcore.asset.unknown = Class.create(pimcore.asset.asset, {
items.push(this.scheduler.getLayout());
}

items.push(this.dependencies.getLayout());
if (typeof this.dependencies !== "undefined") {
items.push(this.dependencies.getLayout());
}

if (user.isAllowed("notes_events")) {
items.push(this.notes.getLayout());
Expand Down
9 changes: 7 additions & 2 deletions public/js/pimcore/asset/video.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,10 @@ pimcore.asset.video = Class.create(pimcore.asset.asset, {
this.properties = new pimcore.element.properties(this, "asset");
this.versions = new pimcore.asset.versions(this);
this.scheduler = new pimcore.element.scheduler(this, "asset");
this.dependencies = new pimcore.element.dependencies(this, "asset");

if (pimcore.settings.dependency) {
this.dependencies = new pimcore.element.dependencies(this, "asset");
}

if (user.isAllowed("notes_events")) {
this.notes = new pimcore.element.notes(this, "asset");
Expand Down Expand Up @@ -82,7 +85,9 @@ pimcore.asset.video = Class.create(pimcore.asset.asset, {
items.push(this.scheduler.getLayout());
}

items.push(this.dependencies.getLayout());
if (typeof this.dependencies !== "undefined") {
items.push(this.dependencies.getLayout());
}

if (user.isAllowed("notes_events")) {
items.push(this.notes.getLayout());
Expand Down
8 changes: 6 additions & 2 deletions public/js/pimcore/document/email.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,10 @@ pimcore.document.email = Class.create(pimcore.document.page_snippet, {
if (this.isAllowed("versions")) {
this.versions = new pimcore.document.versions(this);
}
if (pimcore.settings.dependency) {
this.dependencies = new pimcore.element.dependencies(this, "document");
}

this.dependencies = new pimcore.element.dependencies(this, "document");
this.preview = new pimcore.document.pages.preview(this);
if(pimcore.globalmanager.get('customReportsPanelImplementationFactory').hasImplementation()) {
this.reports = pimcore.globalmanager.get('customReportsPanelImplementationFactory').getNewReportInstance("document_snippet");
Expand Down Expand Up @@ -96,7 +98,9 @@ pimcore.document.email = Class.create(pimcore.document.page_snippet, {
items.push(this.versions.getLayout());
}

items.push(this.dependencies.getLayout());
if (typeof this.dependencies !== "undefined") {
items.push(this.dependencies.getLayout());
}

if(this.reports) {
var reportLayout = this.reports.getLayout();
Expand Down
9 changes: 7 additions & 2 deletions public/js/pimcore/document/folder.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,10 @@ pimcore.document.folder = Class.create(pimcore.document.document, {
this.notes = new pimcore.element.notes(this, "document");
}

this.dependencies = new pimcore.element.dependencies(this, "document");
if (pimcore.settings.dependency) {
this.dependencies = new pimcore.element.dependencies(this, "document");
}

this.tagAssignment = new pimcore.element.tag.assignment(this, "document");
this.workflows = new pimcore.element.workflows(this, "document");
},
Expand Down Expand Up @@ -313,7 +316,9 @@ pimcore.document.folder = Class.create(pimcore.document.document, {
items.push(this.properties.getLayout());
}

items.push(this.dependencies.getLayout());
if (typeof this.dependencies !== "undefined") {
items.push(this.dependencies.getLayout());
}

if (user.isAllowed("notes_events")) {
items.push(this.notes.getLayout());
Expand Down
9 changes: 7 additions & 2 deletions public/js/pimcore/document/hardlink.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,10 @@ pimcore.document.hardlink = Class.create(pimcore.document.document, {
this.notes = new pimcore.element.notes(this, "document");
}

this.dependencies = new pimcore.element.dependencies(this, "document");
if (pimcore.settings.dependency) {
this.dependencies = new pimcore.element.dependencies(this, "document");
}

this.tagAssignment = new pimcore.element.tag.assignment(this, "document");
this.workflows = new pimcore.element.workflows(this, "document");
},
Expand Down Expand Up @@ -386,7 +389,9 @@ pimcore.document.hardlink = Class.create(pimcore.document.document, {
items.push(this.properties.getLayout());
}

items.push(this.dependencies.getLayout());
if (typeof this.dependencies !== "undefined") {
items.push(this.dependencies.getLayout());
}

if (this.isAllowed("settings")) {
items.push(this.scheduler.getLayout());
Expand Down
9 changes: 7 additions & 2 deletions public/js/pimcore/document/link.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,10 @@ pimcore.document.link = Class.create(pimcore.document.document, {
this.notes = new pimcore.element.notes(this, "document");
}

this.dependencies = new pimcore.element.dependencies(this, "document");
if (pimcore.settings.dependency) {
this.dependencies = new pimcore.element.dependencies(this, "document");
}

this.tagAssignment = new pimcore.element.tag.assignment(this, "document");
this.workflows = new pimcore.element.workflows(this, "document");
},
Expand Down Expand Up @@ -383,7 +386,9 @@ pimcore.document.link = Class.create(pimcore.document.document, {
items.push(this.properties.getLayout());
}

items.push(this.dependencies.getLayout());
if (typeof this.dependencies !== "undefined") {
items.push(this.dependencies.getLayout());
}

if (this.isAllowed("settings")) {
items.push(this.scheduler.getLayout());
Expand Down
9 changes: 7 additions & 2 deletions public/js/pimcore/document/page.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,10 @@ pimcore.document.page = Class.create(pimcore.document.page_snippet, {
this.versions = new pimcore.document.versions(this);
}

this.dependencies = new pimcore.element.dependencies(this, "document");
if (pimcore.settings.dependency) {
this.dependencies = new pimcore.element.dependencies(this, "document");
}

this.preview = new pimcore.document.pages.preview(this);
if(pimcore.globalmanager.get('customReportsPanelImplementationFactory').hasImplementation()) {
this.reports = pimcore.globalmanager.get('customReportsPanelImplementationFactory').getNewReportInstance("document_page");
Expand Down Expand Up @@ -96,7 +99,9 @@ pimcore.document.page = Class.create(pimcore.document.page_snippet, {
items.push(this.scheduler.getLayout());
}

items.push(this.dependencies.getLayout());
if (typeof this.dependencies !== "undefined") {
items.push(this.dependencies.getLayout());
}

if(this.reports) {
var reportLayout = this.reports.getLayout();
Expand Down
9 changes: 7 additions & 2 deletions public/js/pimcore/document/snippet.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,10 @@ pimcore.document.snippet = Class.create(pimcore.document.page_snippet, {
this.versions = new pimcore.document.versions(this);
}

this.dependencies = new pimcore.element.dependencies(this, "document");
if (pimcore.settings.dependency) {
this.dependencies = new pimcore.element.dependencies(this, "document");
}

if(pimcore.globalmanager.get('customReportsPanelImplementationFactory').hasImplementation()) {
this.reports = pimcore.globalmanager.get('customReportsPanelImplementationFactory').getNewReportInstance("document_snippet");
}
Expand Down Expand Up @@ -93,7 +96,9 @@ pimcore.document.snippet = Class.create(pimcore.document.page_snippet, {
items.push(this.scheduler.getLayout());
}

items.push(this.dependencies.getLayout());
if (typeof this.dependencies !== "undefined") {
items.push(this.dependencies.getLayout());
}

if(this.reports) {
var reportLayout = this.reports.getLayout();
Expand Down
9 changes: 7 additions & 2 deletions public/js/pimcore/object/folder.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,10 @@ pimcore.object.folder = Class.create(pimcore.object.abstract, {
this.notes = new pimcore.element.notes(this, "object");
}

this.dependencies = new pimcore.element.dependencies(this, "object");
if (pimcore.settings.dependency) {
this.dependencies = new pimcore.element.dependencies(this, "object");
}

this.tagAssignment = new pimcore.element.tag.assignment(this, "object");
this.workflows = new pimcore.element.workflows(this, "object");
},
Expand Down Expand Up @@ -435,7 +438,9 @@ pimcore.object.folder = Class.create(pimcore.object.abstract, {
if (this.isAllowed("properties")) {
items.push(this.properties.getLayout());
}
items.push(this.dependencies.getLayout());
if (typeof this.dependencies !== "undefined") {
items.push(this.dependencies.getLayout());
}

if (user.isAllowed("notes_events")) {
items.push(this.notes.getLayout());
Expand Down
10 changes: 8 additions & 2 deletions public/js/pimcore/object/object.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,11 @@ pimcore.object.object = Class.create(pimcore.object.abstract, {
this.properties = new pimcore.element.properties(this, "object");
this.versions = new pimcore.object.versions(this);
this.scheduler = new pimcore.element.scheduler(this, "object");
this.dependencies = new pimcore.element.dependencies(this, "object");

if (pimcore.settings.dependency) {
this.dependencies = new pimcore.element.dependencies(this, "object");
}

this.workflows = new pimcore.element.workflows(this, "object");

if (user.isAllowed("notes_events")) {
Expand Down Expand Up @@ -360,7 +364,9 @@ pimcore.object.object = Class.create(pimcore.object.abstract, {
}

try {
items.push(this.dependencies.getLayout());
if (typeof this.dependencies !== "undefined") {
items.push(this.dependencies.getLayout());
}
} catch (e) {

}
Expand Down
1 change: 1 addition & 0 deletions src/Controller/Admin/IndexController.php
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,7 @@ protected function buildPimcoreSettings(
'document_tree_paging_limit' => $config['documents']['tree_paging_limit'],
'object_tree_paging_limit' => $config['objects']['tree_paging_limit'],
'hostname' => htmlentities(\Pimcore\Tool::getHostname(), ENT_QUOTES, 'UTF-8'),
'dependency' => $config['dependency']['enabled'],

'document_auto_save_interval' => $config['documents']['auto_save_interval'],
'object_auto_save_interval' => $config['objects']['auto_save_interval'],
Expand Down

0 comments on commit e87b3c7

Please sign in to comment.