Skip to content

Commit a554e47

Browse files
committed
PB-366: Templates Lower Level Test Coverage
- Resolve title issue on Templates
1 parent e7797ad commit a554e47

File tree

2 files changed

+21
-5
lines changed
  • app/code/Magento/PageBuilder

2 files changed

+21
-5
lines changed

app/code/Magento/PageBuilder/Controller/Adminhtml/Template/Index.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,9 +56,9 @@ public function __construct(
5656
}
5757

5858
/**
59-
* Index action
59+
* Load the Manage Templates page
6060
*
61-
* @return \Magento\Backend\Model\View\Result\Page
61+
* @return \Magento\Framework\Controller\AbstractResult
6262
*/
6363
public function execute()
6464
{
@@ -70,7 +70,7 @@ public function execute()
7070
$resultPage = $this->resultPageFactory->create();
7171
$resultPage->setActiveMenu('Magento_PageBuilder::templates');
7272
$resultPage->addBreadcrumb(__('CMS'), __('CMS'));
73-
$resultPage->addBreadcrumb(__('Manage Templates'), __('Manage Templates'));
73+
$resultPage->addBreadcrumb(__('Templates'), __('Templates'));
7474
$resultPage->getConfig()->getTitle()->prepend(__('Templates'));
7575

7676
return $resultPage;

app/code/Magento/PageBuilder/view/adminhtml/web/js/modal/modal.js

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,9 @@
55

66
define([
77
'Magento_Ui/js/modal/modal-component',
8-
'Magento_PageBuilder/js/events'
9-
], function (ModalComponent, events) {
8+
'Magento_PageBuilder/js/events',
9+
'jquery'
10+
], function (ModalComponent, events, $) {
1011
'use strict';
1112

1213
return ModalComponent.extend({
@@ -30,6 +31,21 @@ define([
3031
return this;
3132
},
3233

34+
/**
35+
* Set the title only for the current modal
36+
*
37+
* @param {String} title
38+
*/
39+
setTitle: function (title) {
40+
if (this.title !== title) {
41+
this.title = title;
42+
}
43+
44+
if (this.modal) {
45+
this.modal.parents('[role="dialog"]').find($(this.modal).modal('option').modalTitle).text(title);
46+
}
47+
},
48+
3349
/**
3450
* Listen for from save.
3551
*

0 commit comments

Comments
 (0)