Subida del módulo y tema de PrestaShop

This commit is contained in:
Kaloyan
2026-04-09 18:31:51 +02:00
parent 12c253296f
commit 16b3ff9424
39262 changed files with 7418797 additions and 0 deletions

View File

@@ -0,0 +1,36 @@
/**
* For the full copyright and license information, please view the
* docs/licenses/LICENSE.txt file that was distributed with this source code.
*/
import PermissionsRowSelector from './permissions-row-selector';
const {$} = window;
$(() => {
const webserviceGrid = new window.prestashop.component.Grid('webservice_key');
webserviceGrid.addExtension(new window.prestashop.component.GridExtensions.ReloadListExtension());
webserviceGrid.addExtension(new window.prestashop.component.GridExtensions.ExportToSqlManagerExtension());
webserviceGrid.addExtension(new window.prestashop.component.GridExtensions.FiltersResetExtension());
webserviceGrid.addExtension(new window.prestashop.component.GridExtensions.ColumnTogglingExtension());
webserviceGrid.addExtension(new window.prestashop.component.GridExtensions.SortingExtension());
webserviceGrid.addExtension(new window.prestashop.component.GridExtensions.SubmitBulkActionExtension());
webserviceGrid.addExtension(new window.prestashop.component.GridExtensions.SubmitRowActionExtension());
webserviceGrid.addExtension(new window.prestashop.component.GridExtensions.BulkActionCheckboxExtension());
webserviceGrid.addExtension(new window.prestashop.component.GridExtensions.LinkRowActionExtension());
// needed for shop association input in form
new window.prestashop.component.ChoiceTree('#webservice_key_shop_association').enableAutoCheckChildren();
window.prestashop.component.initComponents(['MultipleChoiceTable', 'GeneratableInput']);
// needed for key input in form
window.prestashop.instance.generatableInput.attachOn('.js-generator-btn');
new PermissionsRowSelector();
window.prestashop.component.initComponents(
[
'MultistoreConfigField',
],
);
});

View File

@@ -0,0 +1,33 @@
/**
* For the full copyright and license information, please view the
* docs/licenses/LICENSE.txt file that was distributed with this source code.
*/
const {$} = window;
/**
* In Add/Edit page of Webservice key there is permissions table input (permissons as columns / resources as rows).
* There is "All" column and once resource is checked under this column
* every other permission column should be auto-selected for that resource.
*/
export default class PermissionsRowSelector {
constructor() {
// when checkbox in "All" column is checked
$('input[id^="webservice_key_permissions_all"]').on(
'change',
(event: JQueryEventObject) => {
const $checkedBox = $(event.currentTarget);
const isChecked = $checkedBox.is(':checked');
// for each input in same row we need to toggle its value
$checkedBox
.closest('tr')
.find(`input:not(input[id="${$checkedBox.attr('id')}"])`)
.each((i, input) => {
$(input).prop('checked', isChecked);
});
},
);
}
}