Skip to content

Commit

Permalink
Merge branch '1.5' into patch-1
Browse files Browse the repository at this point in the history
  • Loading branch information
blankse committed Sep 16, 2024
2 parents d4663ec + d78819c commit e8ebd1d
Show file tree
Hide file tree
Showing 24 changed files with 214 additions and 137 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
- [Date/time fields] Date/time fields now support the usage without timezone support.
- [Icons] Overhauled Icon library and icon dropdown selector in class definition editor.
- [System Settings] Removed "Default-Language in Admin-Interface" setting.
- [Security] Add CSP configuration option `frame-ancestors` (default: `self`).

#### v1.4.0
- [DataObject] Password data type algorithms other than `password_hash` are deprecated since `pimcore/pimcore:^11.2` and will be removed in `pimcore/pimcore:^12`.
Expand Down
7 changes: 2 additions & 5 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
"require": {
"php": "~8.1.0 || ~8.2.0 || ~8.3.0",
"cbschuld/browser.php": "^1.9.6",
"phpoffice/phpspreadsheet": "^1.24 || ^2.1",
"pimcore/pimcore": "~11.3.0",
"phpoffice/phpspreadsheet": "^1.24 || ^2.2",
"pimcore/pimcore": "~11.3.1",
"symfony/webpack-encore-bundle": "^1.13.2"
},
"require-dev": {
Expand All @@ -40,9 +40,6 @@
"kernel/Kernel.php"
]
},
"conflict": {
"symfony/string": "<6.0"
},
"extra": {
"branch-alias": {
"1.x-dev": "1.5.x-dev"
Expand Down
24 changes: 24 additions & 0 deletions public/css/admin.css
Original file line number Diff line number Diff line change
Expand Up @@ -2376,3 +2376,27 @@ ul.leaflet-draw-actions.leaflet-draw-actions-top.leaflet-draw-actions-bottom li:
.pimcore_cb_middle_two_lines .x-form-cb-default {
top: -9px
}

.pimcore_reverse-object-relation-warning {
width: inherit;
padding: 0 5px 0 20px;

white-space: initial;
background:url("/bundles/pimcoreadmin/img/icon/error.png") no-repeat scroll 0 0 transparent;
}

.pimcore_reverse-object-relation-panel {
overflow: visible !important;
}

.pimcore_reverse-object-relation-panel > .x-panel-bodyWrap {
overflow: visible !important;
}

.pimcore_reverse-object-relation-bottom-bar {
overflow: visible !important;
}

.pimcore_reverse-object-relation-bottom-bar > div {
height: 4.5rem !important;
}
4 changes: 2 additions & 2 deletions public/js/pimcore/document/document.js
Original file line number Diff line number Diff line change
Expand Up @@ -250,13 +250,13 @@ pimcore.document.document = Class.create(pimcore.element.abstract, {
const menuItem = this.toolbarButtons.publish.menu.items.items.find(
element => element.text === t('save_draft')
)
menuItem.setHidden(false)
menuItem?.setHidden(false)
}
if (this.isAllowed("settings")) {
const menuItem = this.toolbarButtons.publish.menu.items.items.find(
element => element.text === t('save_only_scheduled_tasks')
)
menuItem.setHidden(false)
menuItem?.setHidden(false)
}

this.toolbarButtons.publish.show();
Expand Down
30 changes: 16 additions & 14 deletions public/js/pimcore/element/helpers/gridCellEditor.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,41 +36,43 @@ Ext.define('pimcore.element.helpers.gridCellEditor', {

value = Ext.clone(value);

var fieldInfo = Ext.clone(this.config.fieldInfo);
var fieldType = this.config.elementType;
const fieldInfo = Ext.clone(this.config.fieldInfo);
const fieldType = this.config.elementType;

//make sure that no relation data is loaded async
fieldInfo.layout.optimizedAdminLoading = false;

if(!fieldInfo || !fieldInfo.layout) {
if (!fieldInfo?.layout) {
return;
}

if(fieldInfo.layout.noteditable) {
if (fieldInfo.layout.noteditable) {
pimcore.helpers.showNotification(t('warning'), t('this_element_cannot_be_edited'), 'warning');
return;
}

this.context = this.editingPlugin.context;
// this.callParent(arguments);

var tagType = fieldInfo.layout.fieldtype;
const tagType = fieldInfo.layout.fieldtype;

// translate title
if(typeof fieldInfo.layout.title != "undefined") {
fieldInfo.layout.title = t(fieldInfo.layout.title);
}


let tag;
if (fieldType == "assetmetadata") {
var tag = new pimcore.asset.metadata.tags[tagType](value, fieldInfo.layout);
tag = new pimcore.asset.metadata.tags[tagType](value, fieldInfo.layout);
} else {
var tag = new pimcore[fieldType].tags[tagType](value, fieldInfo.layout);
tag = new pimcore[fieldType].tags[tagType](value, fieldInfo.layout);
}

if(fieldType == 'object') {
var object = Ext.clone(this.context.record);
const object = Ext.clone(this.context.record);
tag.setObject(object);
tag.updateContext({
objectId: object.id
});
}

tag.updateContext({
Expand All @@ -82,7 +84,7 @@ Ext.define('pimcore.element.helpers.gridCellEditor', {
tag.finishSetup();
}

var formPanel = Ext.create('Ext.form.Panel', {
const formPanel = Ext.create('Ext.form.Panel', {
xtype: "form",
border: false,
items: [tag.getLayoutEdit()],
Expand Down Expand Up @@ -145,10 +147,10 @@ Ext.define('pimcore.element.helpers.gridCellEditor', {
},

completeEdit: function(remainVisible) {
var me = this,
const me = this,
fieldInfo = me.config.fieldInfo,
startValue = me.startValue,
value;
startValue = me.startValue;
let value;

if (fieldInfo.layout.noteditable) {
return;
Expand Down
8 changes: 7 additions & 1 deletion public/js/pimcore/element/helpers/gridColumnConfig.js
Original file line number Diff line number Diff line change
Expand Up @@ -456,7 +456,7 @@ pimcore.element.helpers.gridColumnConfig = {
title: title,
items: [formPanel],
bodyStyle: "background: #fff;",
width: 700,
width: formPanel.items.items[0].width + 25,
maxHeight: 650
});
this.filterByRelationWindow.show();
Expand Down Expand Up @@ -694,6 +694,12 @@ pimcore.element.helpers.gridColumnConfig = {
Ext.Msg.alert(t("error"), t("error_jobs") + ":<br>" + jobErrors.join("<br>"));
}

// Due to some ExtJS bug, when using a lock, the selection is visually cleared after batch operation
// To avoid confusion and disalignment on what we see from what is actually selected, everything is unselected
if (this.grid.hasOwnProperty('enableLocking') && this.grid.enableLocking){
this.grid.getSelectionModel().deselectAll();
}

return;
}

Expand Down
2 changes: 1 addition & 1 deletion public/js/pimcore/helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -3379,7 +3379,7 @@ pimcore.helpers.treeDragDropValidate = function (node, oldParent, newParent) {
pimcore.helpers.isComponentAsChildAllowed = function (parentNode, childNode) {
const parentType = parentNode.data.editor.type;
const childType = childNode.data.editor.type;
const allowedChildren = pimcore.object.helpers.layout.getRawAllowedTypes();
const allowedChildren = pimcore.object.helpers.layout.getAllowedTypes();

if (allowedChildren[parentType] &&
allowedChildren[parentType].includes(childType) ||
Expand Down
2 changes: 1 addition & 1 deletion public/js/pimcore/object/folder/search.js
Original file line number Diff line number Diff line change
Expand Up @@ -458,7 +458,7 @@ pimcore.object.search = Class.create(pimcore.object.helpers.gridTabAbstract, {
}

menu.add(new Ext.menu.Item({
hidden: data.data.locked,
hidden: data.data.locked || !data.data.permissions.delete,
text: t('delete'),
iconCls: "pimcore_icon_delete",
handler: function (data) {
Expand Down
9 changes: 5 additions & 4 deletions public/js/pimcore/object/tags/dateRange.js
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,8 @@ pimcore.object.tags.dateRange = Class.create(pimcore.object.tags.abstract, {

getLayoutShow: function () {
this.component = this.getLayoutEdit();
this.component.items[0].setReadonly(true);
this.component.items[2].setReadonly(true);
this.component.items.items[0].setReadOnly(true);
this.component.items.items[2].setReadOnly(true);

return this.component;
},
Expand All @@ -98,15 +98,16 @@ pimcore.object.tags.dateRange = Class.create(pimcore.object.tags.abstract, {
renderer: function (key, value, metaData, record) {
this.applyPermissionStyle(key, value, metaData, record);

if (record.data.inheritedFields && record.data.inheritedFields[key] && record.data.inheritedFields[key].inherited === true) {
if (record.data.inheritedFields?.[key]?.inherited) {
metaData.tdCls += ' grid_value_inherited';
}

if (value) {
const minDate = new Date(intval(value['start_date'] || 0) * 1000);
const maxDate = new Date(intval(value['end_date'] || 0) * 1000);
const shortDateFormat = pimcore.globalmanager.get('localeDateTime').getShortDateFormat();

return `${Ext.Date.format(minDate, pimcore.globalmanager.get('localeDateTime').getShortDateFormat()), Ext.Date.format(maxDate, pimcore.globalmanager.get('localeDateTime').getShortDateFormat())}`;
return `${Ext.Date.format(minDate, shortDateFormat)}, ${Ext.Date.format(maxDate, shortDateFormat)}`;
}

return '';
Expand Down
5 changes: 5 additions & 0 deletions public/js/pimcore/object/tags/quantityValue.js
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,11 @@ pimcore.object.tags.quantityValue = Class.create(pimcore.object.tags.abstract, {
});

var updateCompatibleUnitsToolTipContent = function() {
if(pimcore.globalmanager.get("user").isAllowed('quantityValueUnits') !== true) {
compatibleUnitsButton.hide();
return false;
}

if (this.inputField.value === '' || this.inputField.value === null || !this.unitField.value) {
compatibleUnitsButton.hide();
return false;
Expand Down
40 changes: 27 additions & 13 deletions public/js/pimcore/object/tags/reverseObjectRelation.js
Original file line number Diff line number Diff line change
Expand Up @@ -112,10 +112,11 @@ pimcore.object.tags.reverseObjectRelation = Class.create(pimcore.object.tags.man

let columns = this.getVisibleColumns();

this.component = new Ext.grid.GridPanel({
this.component = new Ext.grid.GridPanel({
store: this.store,
border: true,
style: "margin-bottom: 10px",
cls: "pimcore_reverse-object-relation-panel",
selModel: Ext.create('Ext.selection.RowModel', {}),
columns: {
defaults: {
Expand Down Expand Up @@ -160,17 +161,30 @@ pimcore.object.tags.reverseObjectRelation = Class.create(pimcore.object.tags.man
tbar: {
items: this.getEditToolbarItems(),
ctCls: "pimcore_force_auto_width",
cls: "pimcore_force_auto_width"
cls: "pimcore_force_auto_width",
},
bbar: {
items: [{
xtype: "tbtext",
text: ' <span class="warning">' + t('nonownerobject_warning') + " | " + t('owner_class')
+ ':<b>' + t(className) + "</b> " + t('owner_field') + ': <b>'
+ t(this.fieldConfig.ownerFieldName) + '</b></span>'
}],
items: [
{
xtype: "tbtext",
text:
' <div class="warning pimcore_reverse-object-relation-warning">' +
t("nonownerobject_warning") +
"<br>" +
t("owner_class") +
": <b>" +
t(className) +
"</b> " +
t("owner_field") +
": <b>" +
t(this.fieldConfig.ownerFieldName) +
"</b></div>",
height: "fit-content",
},
],
ctCls: "pimcore_force_auto_width",
cls: "pimcore_force_auto_width"
cls: "pimcore_force_auto_width pimcore_reverse-object-relation-bottom-bar",
height: "4.5rem",
},
autoHeight: autoHeight,
bodyCssClass: "pimcore_object_tag_objects",
Expand All @@ -179,12 +193,12 @@ pimcore.object.tags.reverseObjectRelation = Class.create(pimcore.object.tags.man
listeners: {
afterrender: function (gridview) {
this.requestNicePathData(this.store.data);
}.bind(this)
}
}.bind(this),
},
},
listeners: {
rowdblclick: this.gridRowDblClickHandler
}
rowdblclick: this.gridRowDblClickHandler,
},
});

this.component.on("rowcontextmenu", this.onRowContextmenu);
Expand Down
Loading

0 comments on commit e8ebd1d

Please sign in to comment.