diff --git a/app/code/Magento/Backend/view/adminhtml/layout/default.xml b/app/code/Magento/Backend/view/adminhtml/layout/default.xml index f52bbb4f8021f..5bcb35156a1c0 100644 --- a/app/code/Magento/Backend/view/adminhtml/layout/default.xml +++ b/app/code/Magento/Backend/view/adminhtml/layout/default.xml @@ -8,6 +8,7 @@ Magento Admin + diff --git a/app/code/Magento/Catalog/Block/Adminhtml/Product/Helper/Form/Category.php b/app/code/Magento/Catalog/Block/Adminhtml/Product/Helper/Form/Category.php index b5c69b661f085..54a51a1a55148 100644 --- a/app/code/Magento/Catalog/Block/Adminhtml/Product/Helper/Form/Category.php +++ b/app/code/Magento/Catalog/Block/Adminhtml/Product/Helper/Form/Category.php @@ -132,7 +132,7 @@ public function getAfterElementHtml() 'id' => 'add_category_button', 'label' => $newCategoryCaption, 'title' => $newCategoryCaption, - 'onclick' => 'jQuery("#new-category").dialog("open")', + 'onclick' => 'jQuery("#new-category").trigger("openModal")', 'disabled' => $this->getDisabled(), ] ); diff --git a/app/code/Magento/Catalog/view/adminhtml/web/js/new-category-dialog.js b/app/code/Magento/Catalog/view/adminhtml/web/js/new-category-dialog.js index 46ad787624620..552e6a3a70ee7 100644 --- a/app/code/Magento/Catalog/view/adminhtml/web/js/new-category-dialog.js +++ b/app/code/Magento/Catalog/view/adminhtml/web/js/new-category-dialog.js @@ -7,6 +7,7 @@ define([ 'jquery', 'jquery/ui', + 'Magento_Ui/js/modal/modal', 'mage/translate', 'mage/backend/tree-suggest', 'mage/backend/validation' @@ -51,53 +52,37 @@ define([ options.errorClass, options.validClass || ''); } }); - - this.element.dialog({ + this.element.modal({ + type: 'slide', + modalClass: 'mage-new-category-dialog form-inline', title: $.mage.__('Create Category'), - autoOpen: false, - width: '75%', - dialogClass: 'mage-new-category-dialog form-inline', - modal: true, - multiselect: true, - resizable: false, - position: { - my: 'left top', - at: 'center top', - of: 'body' - }, - open: function () { - // fix for suggest field - overlapping dialog z-index - $('#new_category_parent-suggest').css('z-index', $.ui.dialog.maxZ + 1); + opened: function () { var enteredName = $('#category_ids-suggest').val(); + $('#new_category_name').val(enteredName); if (enteredName === '') { $('#new_category_name').focus(); } $('#new_category_messages').html(''); - $(this).closest('.ui-dialog').addClass('ui-dialog-active'); - - var topMargin = $(this).closest('.ui-dialog').children('.ui-dialog-titlebar').outerHeight() + 15; - $(this).closest('.ui-dialog').css('margin-top', topMargin); }, - close: function () { - $('#new_category_name, #new_category_parent-suggest').val(''); + closed: function () { var validationOptions = newCategoryForm.validation('option'); + + $('#new_category_name, #new_category_parent-suggest').val(''); validationOptions.unhighlight($('#new_category_parent-suggest').get(0), validationOptions.errorClass, validationOptions.validClass || ''); newCategoryForm.validation('clearError'); $('#category_ids-suggest').focus(); - $(this).closest('.ui-dialog').removeClass('ui-dialog-active'); }, buttons: [{ text: $.mage.__('Create Category'), - 'class': 'action-primary', - 'data-action': 'save', - click: function (event) { + class: 'action-primary', + click: function (e) { if (!newCategoryForm.valid()) { return; } + var thisButton = $(e.currentTarget); - var thisButton = $(event.target).closest('[data-action=save]'); thisButton.prop('disabled', true); $.ajax({ type: 'POST', @@ -115,27 +100,25 @@ define([ }, dataType: 'json', context: $('body') - }) - .success( - function (data) { - if (!data.error) { - $('#category_ids-suggest').trigger('selectItem', { - id: data.category.entity_id, - label: data.category.name - }); - $('#new_category_name, #new_category_parent-suggest').val(''); - $('#category_ids-suggest').val(''); - clearParentCategory(); - widget.element.dialog('close'); - } else { - $('#new_category_messages').html(data.messages); - } - } - ) - .complete( - function () { - thisButton.prop('disabled', false); - } + }).success(function (data) { + if (!data.error) { + var $suggest = $('#category_ids-suggest'); + + $suggest.trigger('selectItem', { + id: data.category.entity_id, + label: data.category.name + }); + $('#new_category_name, #new_category_parent-suggest').val(''); + $suggest.val(''); + clearParentCategory(); + widget.element.trigger('closeModal'); + } else { + $('#new_category_messages').html(data.messages); + } + }).complete( + function () { + thisButton.prop('disabled', false); + } ); } }] diff --git a/app/code/Magento/Checkout/view/frontend/web/js/view/shipping-address.js b/app/code/Magento/Checkout/view/frontend/web/js/view/shipping-address.js index 17b75243a4ee6..aaa5529851d79 100644 --- a/app/code/Magento/Checkout/view/frontend/web/js/view/shipping-address.js +++ b/app/code/Magento/Checkout/view/frontend/web/js/view/shipping-address.js @@ -58,18 +58,22 @@ define( return !quote.isVirtual(); }, selectShippingAddress: function() { - var additionalData = {}; - var billingAddress = quote.getBillingAddress()(); + var additionalFields, + addressData, + additionalData = {}, + billingAddress = quote.getBillingAddress()(); + if (!billingAddress.customerAddressId || !this.visible()) { /** * All the the input fields that are not a part of the address but need to be submitted * in the same request must have data-scope attribute set */ - var additionalFields = $('input[data-scope="additionalAddressData"]').serializeArray(); + additionalFields = $('input[data-scope="additionalAddressData"]').serializeArray(); additionalFields.forEach(function (field) { additionalData[field.name] = field.value; }); } + if (!newAddressSelected()) { selectShippingAddress( addressList.getAddressById(this.selectedAddressId()), @@ -80,23 +84,32 @@ define( if (this.visible()) { this.validate(); } + if (!this.source.get('params.invalid')) { - var addressData = this.source.get('shippingAddress'); + addressData = this.source.get('shippingAddress'); selectShippingAddress(addressData, this.sameAsBilling(), additionalData); } } }, sameAsBillingClick: function() { + var billingAddress, + shippingAddress, + property; + addressList.isBillingSameAsShipping = !addressList.isBillingSameAsShipping; + if (this.sameAsBilling()) { - var billingAddress = quote.getBillingAddress()(); + billingAddress = quote.getBillingAddress()(); + if (billingAddress.customerAddressId) { this.selectedAddressId(billingAddress.customerAddressId); newAddressSelected(false); + } else { // copy billing address data to shipping address form if customer uses new address for billing - var shippingAddress = this.source.get('shippingAddress'); - for (var property in billingAddress) { + shippingAddress = this.source.get('shippingAddress'); + + for (property in billingAddress) { if (billingAddress.hasOwnProperty(property) && shippingAddress.hasOwnProperty(property)) { if (typeof billingAddress[property] === 'string') { this.source.set('shippingAddress.' + property, billingAddress[property]); @@ -105,6 +118,7 @@ define( } } } + this.selectedAddressId(null); newAddressSelected(true); } @@ -113,9 +127,11 @@ define( }, onAddressChange: function() { var billingAddress = quote.getBillingAddress(); + if (this.selectedAddressId() !== billingAddress().customerAddressId) { this.sameAsBilling(false); } + if (this.selectedAddressId() === null) { newAddressSelected(true); } else { diff --git a/app/code/Magento/Cms/view/adminhtml/layout/cms_block_listing.xml b/app/code/Magento/Cms/view/adminhtml/layout/cms_block_listing.xml deleted file mode 100644 index 22788b865327b..0000000000000 --- a/app/code/Magento/Cms/view/adminhtml/layout/cms_block_listing.xml +++ /dev/null @@ -1,129 +0,0 @@ - - - - - - - cms_block_listing - Magento\Cms\Model\Resource\Block\Collection - 1 - - - - Add New Block - - - - - - true - true - true - - block_id - edit - - - ID - left - text - filter_range - - - Title - left - text - filter_input - - - Identifier - left - text - filter_input - - - Store View - left - store - false - filter_store - Magento\Store\Ui\DataProvider\Options - - - Status - left - text - filter_select - - - 0 - Disabled - - - 1 - Enabled - - - - - Created - left - date - filter_date - - - Modified - left - date - filter_date - - - Action - left - actions - false - false - false - - - - - - - - - block_id - - - - - - - - - store - Magento_Store/js/listing/filter/store - - - - - - - - - - - Delete - cms/block/massDelete - - - - - - - diff --git a/app/code/Magento/Cms/view/adminhtml/layout/cms_page_listing.xml b/app/code/Magento/Cms/view/adminhtml/layout/cms_page_listing.xml deleted file mode 100644 index 55a8f04288348..0000000000000 --- a/app/code/Magento/Cms/view/adminhtml/layout/cms_page_listing.xml +++ /dev/null @@ -1,126 +0,0 @@ - - - - - - - cms_page_listing - Magento\Cms\Model\Resource\Page\Collection - 1 - - - - Add New Page - - - - - - true - true - true - - page_id - edit - - - ID - left - text - filter_range - - - Title - left - text - filter_input - - - URL Key - left - text - filter_input - - - Layout - left - text - filter_select - Magento\Cms\Ui\DataProvider\Page\Options\PageLayout - - - Store View - left - false - store - filter_store - Magento\Store\Ui\DataProvider\Options - - - Status - left - text - filter_select - Magento\Cms\Ui\DataProvider\Page\Options\IsActive - - - Created - left - date - filter_date - - - Modified - left - date - filter_date - - - Action - left - actions - false - false - - - - - - - - - - - Delete - cms/page/massDelete - - - - - - - - - - - store - Magento_Store/js/listing/filter/store - - - - - - - - - page_id - - - - - diff --git a/app/code/Magento/Cms/view/adminhtml/ui_component/cms_page_listing.xml b/app/code/Magento/Cms/view/adminhtml/ui_component/cms_page_listing.xml index b8f4b086bbf15..7d154b524cdac 100644 --- a/app/code/Magento/Cms/view/adminhtml/ui_component/cms_page_listing.xml +++ b/app/code/Magento/Cms/view/adminhtml/ui_component/cms_page_listing.xml @@ -376,6 +376,7 @@ Magento_Ui/js/grid/columns/sortable + ui/grid/cells/html false text left diff --git a/app/code/Magento/Sales/view/adminhtml/templates/order/invoice/create/items.phtml b/app/code/Magento/Sales/view/adminhtml/templates/order/invoice/create/items.phtml index fff76e569226d..0253050d8f3b0 100644 --- a/app/code/Magento/Sales/view/adminhtml/templates/order/invoice/create/items.phtml +++ b/app/code/Magento/Sales/view/adminhtml/templates/order/invoice/create/items.phtml @@ -132,7 +132,7 @@