Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
DanielLaranjeira063 committed May 24, 2024
2 parents 01d7624 + c46a748 commit 61f3510
Show file tree
Hide file tree
Showing 20 changed files with 338 additions and 59 deletions.
2 changes: 2 additions & 0 deletions .github/ci/files/.env
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
APP_ENV=test
APP_DEBUG=true
2 changes: 1 addition & 1 deletion .github/workflows/codeception.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
include:
- { php-version: 8.1, database: "mariadb:10.3", dependencies: lowest, pimcore_version: "", experimental: false }
- { php-version: 8.2, database: "mariadb:10.11", dependencies: highest, pimcore_version: "", experimental: false }
- { php-version: 8.2, database: "mariadb:10.11", dependencies: highest, pimcore_version: "11.x-dev as 11.0.0", experimental: true }
- { php-version: 8.3, database: "mariadb:10.11", dependencies: highest, pimcore_version: "11.x-dev as 11.0.0", experimental: true }
services:
mariadb:
image: "${{ matrix.database }}"
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/poeditor-export.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ permissions:
jobs:
poeditor:
runs-on: ubuntu-latest
if: ${{ github.repository == 'pimcore/admin-ui-classic-bundle' }}
steps:
- name: Trigger workflow in pimcore/poeditor-export-action
env:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/static-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
include:
- { php-version: "8.1", dependencies: "lowest", pimcore_version: "", phpstan_args: "", experimental: false }
- { php-version: "8.2", dependencies: "highest", pimcore_version: "", phpstan_args: "", experimental: false }
- { php-version: "8.2", dependencies: "highest", pimcore_version: "11.x-dev as 11.0.0", phpstan_args: "", experimental: true }
- { php-version: "8.3", dependencies: "highest", pimcore_version: "11.x-dev as 11.0.0", phpstan_args: "", experimental: true }
steps:
- name: "Checkout code"
uses: "actions/checkout@v2"
Expand Down
27 changes: 27 additions & 0 deletions .github/workflows/sync-changes-scheduled.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Sync changes scheduled from CE to EE
on:
workflow_dispatch:
schedule:
- cron: "30 21 * * *"

jobs:
sync-branches:
uses: pimcore/workflows-collection-public/.github/workflows/reusable-sync-changes.yaml@v1.0.0
if: github.repository == 'pimcore/admin-ui-classic-bundle'
strategy:
fail-fast: false
matrix:
ref:
[
{ "base": "1.x", "destination": "1.x" },
{ "base": "1.4", "destination": "1.4" },
]
with:
base_ref: ${{ matrix.ref.base }}
ref_name: ${{ matrix.ref.destination }}
target_repo: "ee-admin-ui-classic-bundle"
auto_merge: true
secrets:
SYNC_TOKEN: ${{ secrets.SYNC_TOKEN }}
GIT_NAME: ${{ secrets.GIT_NAME }}
GIT_EMAIL: ${{ secrets.GIT_EMAIL }}
1 change: 1 addition & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
}
},
"require": {
"php": "~8.1.0 || ~8.2.0 || ~8.3.0",
"cbschuld/browser.php": "^1.9.6",
"pimcore/pimcore": "^11.2.0",
"symfony/webpack-encore-bundle": "^1.13.2"
Expand Down
12 changes: 12 additions & 0 deletions public/js/pimcore/object/helpers/edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -302,6 +302,14 @@ pimcore.object.helpers.edit = {
// add asterisk to mandatory field
l.titleOriginal = l.title;
let icons = '';
let wasMandatory = false;

if (context.containerType == 'localizedfield') {
if (l.mandatory && !in_array(context.language, pimcore.settings.requiredLanguages)) {
l.mandatory = false;
wasMandatory = true;
}
}

if(l.mandatory) {
icons += '<span style="color:red;">*</span>';
Expand Down Expand Up @@ -458,6 +466,10 @@ pimcore.object.helpers.edit = {
}
}

if (wasMandatory) {
l.mandatory = true;
}

return dLayout;
}
}
Expand Down
40 changes: 40 additions & 0 deletions public/js/pimcore/object/helpers/gridTabAbstract.js
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,45 @@ pimcore.object.helpers.gridTabAbstract = Class.create({

this.store.getProxy().setExtraParam("query", this.searchFilter);

var selectObjectOptions = Ext.create('Ext.data.Store', {
fields: ['name', 'value'],
data: [
[t("all_types"), "all_objects"],
[t("only_object"), "only_objects"],
[t("only_variant"), "only_variant_objects"],
]
});

this.selectObjectType = new Ext.form.ComboBox({
fieldLabel: t('select_objects_type'),
name: 'objects_type',
labelWidth: 120,
xtype: "combo",
displayField:'name',
valueField: "value",
hidden: !this.element.data.general.allowInheritance,
store: selectObjectOptions,
editable: false,
width : 300,
triggerAction: 'all',
value: 'all_objects',
listeners: {
change: function(comboBox,selected){
this.grid.getStore().setRemoteFilter(false);
this.grid.filters.clearFilters();
this.grid.getStore().clearFilter();

this.store.getProxy().setExtraParam("filter_by_object_type", selected);

this.pagingtoolbar.moveFirst();

this.grid.getStore().setRemoteFilter(true);

this.saveColumnConfigButton.show();
}.bind(this)
}
});

this.checkboxOnlyDirectChildren = new Ext.form.Checkbox({
name: "onlyDirectChildren",
style: "margin-bottom: 5px; margin-left: 5px",
Expand Down Expand Up @@ -296,6 +335,7 @@ pimcore.object.helpers.gridTabAbstract = Class.create({
this.languageInfo, "-",
this.toolbarFilterInfo,
this.clearFilterButton, "->",
this.selectObjectType, "-",
this.checkboxOnlyDirectChildren, "-",
this.exportButton, "-",
this.columnConfigButton,
Expand Down
7 changes: 7 additions & 0 deletions public/js/pimcore/object/tags/inputQuantityValue.js
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,7 @@ pimcore.object.tags.inputQuantityValue = Class.create(pimcore.object.tags.abstra
}.bind(this, field.key);

return {
getEditor: this.getWindowCellEditor.bind(this, field),
text: t(field.label),
sortable:true,
dataIndex:field.key,
Expand All @@ -159,6 +160,12 @@ pimcore.object.tags.inputQuantityValue = Class.create(pimcore.object.tags.abstra
};
},

getCellEditValue: function () {
let value = this.getValue();
value["unitAbbr"] = this.unitField.getRawValue();
return value;
},

getName: function () {
return this.fieldConfig.name;
}
Expand Down
69 changes: 37 additions & 32 deletions public/js/pimcore/object/tags/table.js
Original file line number Diff line number Diff line change
Expand Up @@ -161,50 +161,55 @@ pimcore.object.tags.table = Class.create(pimcore.object.tags.abstract, {

this.cellEditing = Ext.create('Ext.grid.plugin.CellEditing', {});

var tbar = [];
let tbar = null;

if (!this.fieldConfig.noteditable)
{
tbar = [];

if (!this.fieldConfig.colsFixed || columns.length < this.fieldConfig.cols) {
tbar.push({
iconCls: "pimcore_icon_table_col pimcore_icon_overlay_add",
handler: this.addColumn.bind(this)
});
}

if (!this.fieldConfig.colsFixed || columns.length < this.fieldConfig.cols) {
tbar.push({
iconCls: "pimcore_icon_table_col pimcore_icon_overlay_add",
handler: this.addColumn.bind(this)
});
}
if (!this.fieldConfig.colsFixed || columns.length > this.fieldConfig.cols) {
tbar.push({
iconCls: "pimcore_icon_table_col pimcore_icon_overlay_delete",
handler: this.deleteColumn.bind(this)
});
}

if (!this.fieldConfig.rowsFixed || data.length != this.fieldConfig.rows) {
tbar.push({
iconCls: "pimcore_icon_table_row pimcore_icon_overlay_delete",
handler: this.deleteRow.bind(this)
});

tbar.push({
iconCls: "pimcore_icon_table_row pimcore_icon_overlay_add",
handler: this.addRow.bind(this)
});
}

if (!this.fieldConfig.colsFixed || columns.length > this.fieldConfig.cols) {
tbar.push({
iconCls: "pimcore_icon_table_col pimcore_icon_overlay_delete",
handler: this.deleteColumn.bind(this)
iconCls: 'pimcore_icon_copy',
handler: this.copyFromTable.bind(this)
});
}

if (!this.fieldConfig.rowsFixed || data.length != this.fieldConfig.rows) {
tbar.push({
iconCls: "pimcore_icon_table_row pimcore_icon_overlay_delete",
handler: this.deleteRow.bind(this)
iconCls: "pimcore_icon_paste",
handler: this.pasteFromClipboard.bind(this)
});


tbar.push({
iconCls: "pimcore_icon_table_row pimcore_icon_overlay_add",
handler: this.addRow.bind(this)
iconCls: "pimcore_icon_empty",
handler: this.emptyStore.bind(this)
});
}

tbar.push({
iconCls: 'pimcore_icon_copy',
handler: this.copyFromTable.bind(this)
});

tbar.push({
iconCls: "pimcore_icon_paste",
handler: this.pasteFromClipboard.bind(this)
});


tbar.push({
iconCls: "pimcore_icon_empty",
handler: this.emptyStore.bind(this)
});

this.grid = Ext.create('Ext.grid.Panel', {
store: this.store,
columns: columns,
Expand Down
42 changes: 41 additions & 1 deletion public/js/pimcore/settings/system.js
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,11 @@ pimcore.settings.system = Class.create({
id: "system_settings_general_validLanguages",
name: 'general.validLanguages',
value: this.getValue("general.valid_languages", true)
}, {
xtype: "hidden",
id: "system_settings_general_requiredLanguages",
name: 'general.requiredLanguages',
value: this.getValue("general.required_languages", true)
}, {
xtype: "hidden",
id: "system_settings_general_defaultLanguage",
Expand Down Expand Up @@ -596,11 +601,38 @@ pimcore.settings.system = Class.create({
}
}.bind(this)
}
}, {
xtype: "checkbox",
name: "general.requiredLanguage",
boxLabel: t("required_language"),
checked: this.getValue("general.required_languages", true).includes(language),
listeners: {
change: function (el, checked) {
var requiredLanguagesField = Ext.getCmp("system_settings_general_requiredLanguages");
var requiredLanguages = [];

if (requiredLanguagesField.getValue() != '') {
requiredLanguages = requiredLanguagesField.getValue().split(",");
}

if (checked) {
if (!in_array(language, requiredLanguages)) {
requiredLanguages.push(language);
}
} else {
if (in_array(language, requiredLanguages)) {
requiredLanguages.splice(array_search(language, requiredLanguages), 1);
}
}

requiredLanguagesField.setValue(requiredLanguages.join(","));
}.bind(this)
}
}, {
xtype: "button",
title: t("delete"),
iconCls: "pimcore_icon_delete",
style: "position:absolute; right: 5px; top:12px;",
style: "position:absolute; right: 5px; top:40px;",
handler: this.removeLanguage.bind(this, language)
}]
});
Expand All @@ -618,6 +650,14 @@ pimcore.settings.system = Class.create({
languageField.setValue(addedLanguages.join(","));
}

// remove the required language out of the hidden field
var requiredLanguagesField = Ext.getCmp("system_settings_general_requiredLanguages");
var addedRequiredLanguages = requiredLanguagesField.getValue().split(",");
if (in_array(language, addedRequiredLanguages)) {
addedRequiredLanguages.splice(array_search(language, addedRequiredLanguages), 1);
requiredLanguagesField.setValue(addedRequiredLanguages.join(","));
}

// remove the default language from hidden field
var defaultLanguageField = Ext.getCmp("system_settings_general_defaultLanguage");
if (defaultLanguageField.getValue() == language) {
Expand Down
34 changes: 33 additions & 1 deletion public/js/pimcore/settings/thumbnail/item.js
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ pimcore.settings.thumbnail.item = Class.create({
value: this.data.format,
triggerAction: 'all',
editable: false,
store: [["SOURCE", "Auto (Web-optimized - recommended)"], ["ORIGINAL", "ORIGINAL"], ["PNG", "PNG"], ["GIF", "GIF"], ["JPEG", "JPEG"], ["PJPEG", "JPEG (progressive)"], ["TIFF", "TIFF"],
store: [["SOURCE", "Auto (Web-optimized - recommended)"], ["ORIGINAL", "ORIGINAL"], ["PNG", "PNG"], ["GIF", "GIF"], ["JPEG", "JPEG"], ["PJPEG", "JPEG (progressive)"], ["WEBP", "WebP"], ["AVIF", "AVIF"], ["TIFF", "TIFF"],
["PRINT", "Print (PNG,JPG,SVG,TIFF)"]],
width: 450
}, {
Expand Down Expand Up @@ -855,6 +855,38 @@ pimcore.settings.thumbnail.items = {
return item;
},

itemMirror: function (panel, data, getName) {
const niceName = t("mirror");
if (typeof getName != "undefined" && getName) {
return niceName;
}

if (typeof data == "undefined") {
data = {};
}
const myId = Ext.id();

return new Ext.form.FormPanel({
id: myId,
style: "margin-top: 10px",
border: true,
bodyStyle: "padding: 10px;",
tbar: this.getTopBar(niceName, myId, panel),
items: [{
xtype: 'combo',
name: "mode",
fieldLabel: t("mode"),
width: 210,
store: [["horizontal", t("horizontal")], ["vertical", t("vertical")]],
value: data.mode
}, {
xtype: "hidden",
name: "type",
value: "mirror"
}]
});
},

itemSetBackgroundColor: function (panel, data, getName) {

var niceName = t("setbackgroundcolor");
Expand Down
Loading

0 comments on commit 61f3510

Please sign in to comment.