Skip to content

Commit

Permalink
Merge branch '1.7.7.x' into merge-177
Browse files Browse the repository at this point in the history
  • Loading branch information
jolelievre committed Jun 15, 2020
2 parents 21aa532 + 2699079 commit c574316
Show file tree
Hide file tree
Showing 543 changed files with 6,611 additions and 7,053 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ npm-debug.log.*

# Upload
/upload/*
!/upload/index.php
!/upload/.htaccess

/vendor/*
Expand Down
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ after_deploy:
gcloud compute instances stop --zone $GC_ZONE "${GC_INSTANCE_NAME}-${INSTANCE_TYPE}";
gcloud compute instances add-metadata "${GC_INSTANCE_NAME}-${INSTANCE_TYPE}" --zone $GC_ZONE --metadata=NIGHTLY_TOKEN=$NIGHTLY_TOKEN && \
gcloud compute instances add-metadata "${GC_INSTANCE_NAME}-${INSTANCE_TYPE}" --zone $GC_ZONE --metadata=TRAVIS_BRANCH=$TRAVIS_BRANCH && \
gcloud compute instances add-metadata "${GC_INSTANCE_NAME}-${INSTANCE_TYPE}" --zone $GC_ZONE --metadata-from-file startup-tests-script=tests/puppeteer/scripts/run-nightly-tests.sh && \
gcloud compute instances add-metadata "${GC_INSTANCE_NAME}-${INSTANCE_TYPE}" --zone $GC_ZONE --metadata-from-file startup-reports-script=tests/puppeteer/scripts/run-nightly-reports.sh && \
gcloud compute instances add-metadata "${GC_INSTANCE_NAME}-${INSTANCE_TYPE}" --zone $GC_ZONE --metadata-from-file startup-tests-script=tests/UI/scripts/run-nightly-tests.sh && \
gcloud compute instances add-metadata "${GC_INSTANCE_NAME}-${INSTANCE_TYPE}" --zone $GC_ZONE --metadata-from-file startup-reports-script=tests/UI/scripts/run-nightly-reports.sh && \
gcloud compute instances start --zone $GC_ZONE "${GC_INSTANCE_NAME}-${INSTANCE_TYPE}"
fi
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@

<div class="alert alert-info">{l s='You\'re currently generating combinations for the following product:'} <b>{$product_name|escape:'html':'UTF-8'}</b></div>

<div class="alert alert-info"><strong>{l s='Step 1: On the left side, select the attributes you want to use (Hold down the "Ctrl" key on your keyboard and validate by clicking on "Add")'}</strong></div>
<div class="alert alert-info"><strong>{l s='Step 1: On the left side, select the attributes you want to use (Hold down the "Ctrl" key on your keyboard and validate by clicking on "%add_label%")' d='Admin.Catalog.Notification' sprintf=['%add_label%' => {l s='Add' d='Admin.Actions'}]}</strong></div>

{foreach $attribute_groups as $k => $attribute_group}
{if isset($attribute_js[$attribute_group['id_attribute_group']])}
Expand Down Expand Up @@ -135,7 +135,7 @@
</tr>
</tbody>
</table>
<div class="alert alert-info">{l s='Please click on "Generate these combinations".'}</div>
<div class="alert alert-info">{l s='Please click on "%generate_label%".' d='Admin.Catalog.Notification' sprintf=['%generate_label%' => {l s='Generate these combinations'}]}</div>
<button type="submit" class="btn btn-default" name="generate"><i class="icon-random"></i> {l s='Generate these combinations'}</button>
</div>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
<div class="alert alert-info">
<p>{l s='Your online store needs to have a proper carrier registered in PrestaShop as soon as you start shipping your products. This means sending yours parcels using your local postal service, or having a contract with a private carrier which in turn will ship your parcels to your customers. In order to have PrestaShop suggest the most adequate carrier to your customers during their order checkout process, you need to register all the carriers with which you have chosen to work.' d='Admin.Shipping.Help'}</p>
<p>{l s='PrestaShop comes with a number of carrier modules that you can activate. You can also buy carrier modules on the PrestaShop Addons marketplace. Recommended modules are listed below: install the module that matches your carrier, and configure it!' d='Admin.Shipping.Help'}</p>
<p>{l s='If there is no existing module for your carrier, then you can register that carrier by hand using the information that it can provide you: shipping rates, regional zones, size and weight limits, etc. Click on the "Add new carrier" button below to open the Carrier Wizard, which will help you register a new carrier in a few steps.' d='Admin.Shipping.Help'}</p>
<p>{l s='If there is no existing module for your carrier, then you can register that carrier by hand using the information that it can provide you: shipping rates, regional zones, size and weight limits, etc. Click on the "%add_new_label%" button below to open the Carrier Wizard, which will help you register a new carrier in a few steps.' d='Admin.Shipping.Help' sprintf=['%add_new_label%' => {l s='Add new carrier' d='Admin.Shipping.Feature'}]}</p>
<p>{l s='Note: DO NOT register a new carrier if there already exists a module for it! Using a module will be much faster and more accurate!' d='Admin.Shipping.Help'}</p>
</div>
{/if}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@
<div class="form-group">
<label class="control-label col-lg-3">
<span class="label-tooltip" data-toggle="tooltip"
title="{l s='This is the code users should enter to apply the voucher to a cart. Either create your own code or generate one by clicking on "Generate".' d='Admin.Catalog.Help'}">
title="{{l s='This is the code users should enter to apply the voucher to a cart. Either create your own code or generate one by clicking on "%generate_label%".' d='Admin.Catalog.Help' sprintf=['%generate_label%' => {l s='Generate' d='Admin.Actions'}]}|escape:"html"}">
{l s='Code' d='Admin.Global'}
</span>
</label>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
</h3>
<div class="alert alert-warning">
<p>{l s='You can choose to keep your images stored in the previous system. There\'s nothing wrong with that.' d='Admin.Design.Notification'}</p>
<p>{l s='You can also decide to move your images to the new storage system. In this case, click on the "Move images" button below. Please be patient. This can take several minutes.' d='Admin.Design.Notification'}</p>
<p>{l s='You can also decide to move your images to the new storage system. In this case, click on the "%move_images_label%" button below. Please be patient. This can take several minutes.' d='Admin.Design.Notification' sprintf=['%move_images_label%' => {l s='Move images' d='Admin.Design.Feature'}]}</p>
</div>
<div class="alert alert-info">&nbsp;
{l s='After moving all of your product images, set the "Use the legacy image filesystem" option above to "No" for best performance.' d='Admin.Design.Notification'}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
<h3>
<i class="icon-fullscreen"></i> {l s='Indexing' d='Admin.Shopparameters.Feature'}
</h3>
<div class="alert alert-info">{l s='There is a huge quantity of data, so each connection corresponding to a referrer is indexed. You can also refresh this index by clicking the "Refresh index" button. This process may take a while, and it\'s only needed if you modified or added a referrer, or if you want changes to be retroactive.' d='Admin.Shopparameters.Help'}</div>
<div class="alert alert-info">{l s='There is a huge quantity of data, so each connection corresponding to a referrer is indexed. You can also refresh this index by clicking the "%refresh_index_label%" button. This process may take a while, and it\'s only needed if you modified or added a referrer, or if you want changes to be retroactive.' d='Admin.Shopparameters.Help' sprintf=['%refresh_index_label%' => {l s='Refresh index' d='Admin.Shopparameters.Feature'}]}</div>
<button type="submit" class="btn btn-default" name="submitRefreshIndex" id="submitRefreshIndex">
<i class="icon-refresh"></i> {l s='Refresh index' d='Admin.Shopparameters.Feature'}
</button>
Expand All @@ -42,7 +42,7 @@
<h3>
<i class="icon-briefcase"></i> {l s='Cache' d='Admin.Shopparameters.Feature'}
</h3>
<div class="alert alert-info">{l s='Your data is cached in order to sort it and filter it. You can refresh the cache by clicking on the "Refresh cache" button.' d='Admin.Shopparameters.Help'}</div>
<div class="alert alert-info">{l s='Your data is cached in order to sort it and filter it. You can refresh the cache by clicking on the "%refresh_cache_label%" button.' d='Admin.Shopparameters.Help' sprintf=['%refresh_cache_label%' => {l s='Refresh cache' d='Admin.Shopparameters.Feature'}]}</div>
<button type="submit" class="btn btn-default" name="submitRefreshCache" id="submitRefreshCache">
<i class="icon-refresh"></i> {l s='Refresh cache' d='Admin.Shopparameters.Feature'}
</button>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@
<div class="col-lg-12">
<p class="help-block">
<strong>{l s='Check / Uncheck all'}</strong><br />
{l s='You are editing this page for a specific shop or group. Click "Yes" to check all fields, "No" to uncheck all.'}<br />
{l s='You are editing this page for a specific shop or group. Click "%yes_label%" to check all fields, "%no_label%" to uncheck all.' d='Admin.Design.Help' sprintf=['%yes_label%' => {l s='Yes' d='Admin.Global'}, '%no_label%' => {l s='No' d='Admin.Global'}]}<br />
{l s='If you check a field, change its value, and save, the multistore behavior will not apply to this shop (or group), for this particular parameter.'}
</p>
</div>
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion admin-dev/themes/new-theme/js/fos_js_routes.json

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions admin-dev/themes/new-theme/js/pages/order/OrderViewPageMap.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@ export default {
updateCustomerAddressModal: '#updateCustomerAddressModal',
openOrderAddressUpdateModalBtn: '.js-update-customer-address-modal-btn',
updateOrderAddressTypeInput: '#change_order_address_address_type',
deliveryAddressEditBtn: '#js-delivery-address-edit-btn',
invoiceAddressEditBtn: '#js-invoice-address-edit-btn',
orderMessageNameSelect: '#order_message_order_message',
orderMessagesContainer: '.js-order-messages-container',
orderMessage: '#order_message_message',
Expand All @@ -67,13 +69,15 @@ export default {
productsCount: '#orderProductsPanelCount',
productDeleteBtn: '.js-order-product-delete-btn',
productsTable: '#orderProductsTable',
productsPagination: '.order-product-pagination',
productsNavPagination: '#orderProductsNavPagination',
productsTablePagination: '#orderProductsTablePagination',
productsTablePaginationNext: '#orderProductsTablePaginationNext',
productsTablePaginationPrev: '#orderProductsTablePaginationPrev',
productsTablePaginationLink: '.page-item:not(.d-none):not(#orderProductsTablePaginationNext):not(#orderProductsTablePaginationPrev) .page-link',
productsTablePaginationActive: '#orderProductsTablePagination .page-item.active span',
productsTablePaginationTemplate: '#orderProductsTablePagination .page-item.d-none',
productsTablePaginationNumberSelector: '#orderProductsTablePaginationNumberSelector',
productsTableRow: (productId) => `#orderProduct_${productId}`,
productsTableRowEdited: (productId) => `#editOrderProduct_${productId}`,
productsCellLocation: 'tr .cellProductLocation',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ export default class OrderProductRenderer {
'tr[id^="orderProduct_"]',
);
$rows.removeClass('d-none');
$(OrderViewPageMap.productsNavPagination).addClass('d-none');
$(OrderViewPageMap.productsPagination).addClass('d-none');

const scrollValue = $(scrollTarget).offset().top - $('.header-toolbar').height() - 100;
$('html,body').animate({scrollTop: scrollValue}, 'slow');
Expand All @@ -130,6 +130,7 @@ export default class OrderProductRenderer {
.detach()
.appendTo(OrderViewPageMap.productOriginalPosition);

$(OrderViewPageMap.productsPagination).removeClass('d-none');
$(OrderViewPageMap.productActionBtn).removeClass('d-none');
$(
`${OrderViewPageMap.productAddActionBtn}, ${OrderViewPageMap.productAddRow}`,
Expand Down Expand Up @@ -235,6 +236,32 @@ export default class OrderProductRenderer {
this.togglePaginationControls();
}

updateNumPerPage(numPerPage) {
if (numPerPage < 1) {
numPerPage = 1;
}
const $rows = $(OrderViewPageMap.productsTable).find('tr[id^="orderProduct_"]');
const $tablePagination = $(OrderViewPageMap.productsTablePagination);
const numPages = Math.ceil($rows.length / numPerPage);

// Update table data fields
$tablePagination.data('numPages', numPages);
$tablePagination.data('numPerPage', numPerPage);

// Clean all page links, reinsert the removed template
const $linkPaginationTemplate = $(OrderViewPageMap.productsTablePaginationTemplate);
$(OrderViewPageMap.productsTablePagination).find(`li:has(> [data-page])`).remove();
$(OrderViewPageMap.productsTablePaginationNext).before($linkPaginationTemplate);

// Add appropriate pages
for (let i = 1; i <= numPages; ++i) {
const $linkPagination = $linkPaginationTemplate.clone();
$linkPagination.find('span').attr('data-page', i);
$linkPagination.find('span').html(i);
$linkPaginationTemplate.before($linkPagination.removeClass('d-none'));
}
}

paginationAddPage(numPage) {
const $tablePagination = $(OrderViewPageMap.productsTablePagination);
$tablePagination.data('numPages', numPage);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,5 @@ export default {
productUpdated: 'productUpdated',
productEditionCanceled: 'productEditionCanceled',
productListPaginated: 'productListPaginated',
productListNumberPerPage: 'productListNumberPerPage',
};
47 changes: 40 additions & 7 deletions admin-dev/themes/new-theme/js/pages/order/view/order-view-page.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,23 @@ export default class OrderViewPage {
this.orderDocumentsRefresher = new OrderDocumentsRefresher();
this.orderInvoicesRefresher = new OrderInvoicesRefresher();
this.orderProductCancel = new OrderProductCancel();
this.router = new Router();
this.listenToEvents();
}

listenToEvents() {

$(OrderViewPageMap.invoiceAddressEditBtn).fancybox({
'type': 'iframe',
'width': '90%',
'height': '90%',
});
$(OrderViewPageMap.deliveryAddressEditBtn).fancybox({
'type': 'iframe',
'width': '90%',
'height': '90%',
});

EventEmitter.on(OrderViewEventMap.productDeletedFromOrder, (event) => {
// Remove the row
const $row = $(OrderViewPageMap.productsTableRow(event.oldOrderDetailId));
Expand All @@ -72,7 +85,6 @@ export default class OrderViewPage {
currentPage -= 1;
}
EventEmitter.emit(OrderViewEventMap.productListPaginated, {
orderId: event.orderId,
numPage: currentPage,
});

Expand Down Expand Up @@ -134,7 +146,6 @@ export default class OrderViewPage {
}
// Move to last page
EventEmitter.emit(OrderViewEventMap.productListPaginated, {
orderId: event.orderId,
numPage: numPages,
});
}
Expand Down Expand Up @@ -181,7 +192,7 @@ export default class OrderViewPage {
$(OrderViewPageMap.productPackModal.modal).on('show.bs.modal', (event) => {
const button = $(event.relatedTarget);
const packItems = button.data('packItems');
const router = new Router();
const modal = $(this);
$(OrderViewPageMap.productPackModal.rows).remove();
packItems.forEach((item) => {
const $item = $(OrderViewPageMap.productPackModal.template).clone();
Expand All @@ -190,7 +201,7 @@ export default class OrderViewPage {
$item.find(OrderViewPageMap.productPackModal.product.name).html(item.name);
$item.find(OrderViewPageMap.productPackModal.product.link).attr(
'href',
router.generate('admin_product_form', {id: item.id}),
this.router.generate('admin_product_form', {id: item.id}),
);
if (item.reference !== '') {
$item.find(OrderViewPageMap.productPackModal.product.ref).append(item.reference);
Expand Down Expand Up @@ -231,7 +242,6 @@ export default class OrderViewPage {
event.preventDefault();
const $btn = $(event.currentTarget);
EventEmitter.emit(OrderViewEventMap.productListPaginated, {
orderId: $btn.data('orderId'),
numPage: $btn.data('page'),
});
});
Expand All @@ -243,7 +253,6 @@ export default class OrderViewPage {
}
const activePage = this.getActivePage();
EventEmitter.emit(OrderViewEventMap.productListPaginated, {
orderId: $(activePage).data('orderId'),
numPage: parseInt($(activePage).html(), 10) + 1,
});
});
Expand All @@ -255,17 +264,41 @@ export default class OrderViewPage {
}
const activePage = this.getActivePage();
EventEmitter.emit(OrderViewEventMap.productListPaginated, {
orderId: $(activePage).data('orderId'),
numPage: parseInt($(activePage).html(), 10) - 1,
});
});
$(OrderViewPageMap.productsTablePaginationNumberSelector).on('change', (event) => {
event.preventDefault();
const $select = $(event.currentTarget);
const numPerPage = parseInt($select.val(), 10);
EventEmitter.emit(OrderViewEventMap.productListNumberPerPage, {
numPerPage: numPerPage
});
});

EventEmitter.on(OrderViewEventMap.productListPaginated, (event) => {
this.orderProductRenderer.paginate(event.numPage);
this.listenForProductDelete();
this.listenForProductEdit();
this.resetToolTips();
});

EventEmitter.on(OrderViewEventMap.productListNumberPerPage, (event) => {
// Update pagination num per page (page links are regenerated)
this.orderProductRenderer.updateNumPerPage(event.numPerPage);

// Paginate to page 1
EventEmitter.emit(OrderViewEventMap.productListPaginated, {
numPage: 1,
});

// Save new config
$.ajax({
url: this.router.generate('admin_orders_configure_product_pagination'),
method: 'POST',
data: {numPerPage: event.numPerPage},
});
});
}

listenForRefund() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@
}

&__message {
max-width: 460px;
max-width: 540px;
font-size: 14px;
line-height: 1.43;
color: #6c868e;
Expand Down
5 changes: 5 additions & 0 deletions admin-dev/themes/new-theme/scss/pages/_orders.scss
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,11 @@
input[type="number"] {
width: 80px;
}
.order-product-pagination {
display: flex;
flex-direction: row;
justify-content: flex-start;
}
}

#addProductTableRow,
Expand Down
1 change: 0 additions & 1 deletion admin-dev/themes/new-theme/scss/pages/_orders_view.scss
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,6 @@
#order-view-page {
.table {
display: block;
overflow-y: scroll;
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -648,16 +648,6 @@ Comment: @todo Throw exception</note>
<target>%currency% is the default currency for shop %shop_name%, and therefore cannot be disabled</target>
<note>Line: 523</note>
</trans-unit>
<trans-unit id="32308f335c5aca97078cb283ce88f9d3">
<source>Oops... it looks like this ISO code already exists. If you are: [1][2]trying to create an alternative currency, you must type a different ISO code[/2][2]trying to modify the currency with ISO code %isoCode%, make sure you did not check the creation box[/2][/1]</source>
<target>Oops... it looks like this ISO code already exists. If you are: [1][2]trying to create an alternative currency, you must type a different ISO code[/2][2]trying to modify the currency with ISO code %isoCode%, make sure you did not check the creation box[/2][/1]</target>
<note>Line: 552</note>
</trans-unit>
<trans-unit id="2751c5e3327bc580a6e62973524440ad">
<source><![CDATA[Oops... it looks like this ISO code already exists. If you are: <ul><li>trying to create an alternative currency, you must type a different ISO code</li><li>trying to modify the currency with ISO code %isoCode%, make sure you did not check the creation box</li></ul>]]></source>
<target><![CDATA[Oops... it looks like this ISO code already exists. If you are: <ul><li>trying to create an alternative currency, you must type a different ISO code</li><li>trying to modify the currency with ISO code %isoCode%, make sure you did not check the creation box</li></ul>]]></target>
<note>Line: 548</note>
</trans-unit>
</body>
</file>
<file original="src/PrestaShopBundle/Controller/Admin/Improve/International/LanguageController.php" source-language="en-US" target-language="en" datatype="plaintext">
Expand Down
Loading

0 comments on commit c574316

Please sign in to comment.