Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[MBO-662][MBO-663][MBO-668][MBO-670]feat: ✨ design button and customization title and description recommended modules modal #422

Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
c5fd3c8
feat: :sparkles: customize title of button recommended modules
DinoHOPIC Feb 2, 2023
a0c49ff
fix: :fire: CS fixer
DinoHOPIC Feb 2, 2023
e37a4c3
fix: :fire: cs fixer2
DinoHOPIC Feb 2, 2023
6dfcfbf
feat: :sparkles: add customization to other page concerned
DinoHOPIC Feb 2, 2023
a7592b7
fix: :bug: cs fix3
DinoHOPIC Feb 2, 2023
9bee4fd
fix: :fire: fix space in JS
DinoHOPIC Feb 2, 2023
bb6f0c1
feat: :sparkles: add description text to modal recommended modules
DinoHOPIC Feb 3, 2023
62a3213
fix: :bug: ajust targeting class CSS and change title with description
DinoHOPIC Feb 3, 2023
0be3c03
fix: :bug: fix QA note
DinoHOPIC Feb 7, 2023
7b37978
style: :art: strong caracteres for description + line break
DinoHOPIC Feb 7, 2023
00fa3cd
fix: :fire: use regular quote
DinoHOPIC Feb 7, 2023
f14ec0f
fix: :bug: update description for AdminFeatures
DinoHOPIC Feb 8, 2023
40db1e5
style: :sparkles: new design of link to addons in recommended modules…
DinoHOPIC Feb 9, 2023
7ee4869
fix: :bug: fix style css of button recommended and link addons
DinoHOPIC Feb 13, 2023
7de5ddb
fix: :bug: detect module version
DinoHOPIC Feb 13, 2023
3ab3f75
fix typo
julienr114 Feb 13, 2023
0cdd2e6
fix: :bug: fix bug border of button toolbar in attributs and features
DinoHOPIC Feb 14, 2023
5ba58f4
fix: :bug: fix bug nav-link active
DinoHOPIC Feb 14, 2023
2590f32
fix: :art: cs fixer
DinoHOPIC Feb 14, 2023
77b0890
fix: :art: cs fixer correction
DinoHOPIC Feb 14, 2023
fbd27c1
Merge branch '2.0.x' into feat/MBO-662/-Update-design-of-button-Modul…
julienr114 Feb 15, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 37 additions & 1 deletion ps_mbo.php
Original file line number Diff line number Diff line change
Expand Up @@ -469,7 +469,7 @@ public function hookDisplayDashboardTop()
'shouldAttachRecommendedModulesAfterContent' => $this->shouldAttachRecommendedModulesAfterContent(),
'shouldAttachRecommendedModulesButton' => $this->shouldAttachRecommendedModulesButton(),
'shouldUseLegacyTheme' => $this->isAdminLegacyContext(),
'recommendedModulesTitleTranslated' => $this->trans('Recommended Modules and Services'),
'recommendedModulesTitleTranslated' => $this->getRecommandedModulesButtonTitle(),
'recommendedModulesCloseTranslated' => $this->trans('Close', [], 'Admin.Actions'),
'recommendedModulesUrl' => $recommendedModulesUrl,
]);
Expand Down Expand Up @@ -505,6 +505,42 @@ private function shouldAttachRecommendedModulesAfterContent()
return in_array(Tools::getValue('controller'), static::TABS_WITH_RECOMMENDED_MODULES_AFTER_CONTENT, true);
}

/**
* Customize title button recommended modules
*
* @return string
*/
private function getRecommandedModulesButtonTitle()
{
switch (Tools::getValue('controller')) {
case 'AdminInvoices':
case 'AdminDeliverySlip':
case 'AdminSlip':
case 'AdminOrders':
$title = $this->trans('Boost sales', [], 'Modules.Mbo.Recommendedmodulesandservices');
break;
case 'AdminSpecificPriceRule':
case 'AdminManufacturers':
case 'AdminAttributesGroups':
case 'AdminCartRules':
case 'AdminProducts':
$title = $this->trans('Optimize product catalog', [], 'Modules.Mbo.Recommendedmodulesandservices');
break;
case 'AdminStats':
$title = $this->trans('Improve data strategy', [], 'Modules.Mbo.Recommendedmodulesandservices');
break;
case 'AdminCustomerThreads':
case 'AdminCustomers':
$title = $this->trans('Improve customer experience', [], 'Modules.Mbo.Recommendedmodulesandservices');
break;
default:
$title = $this->trans('Recommended modules', [], 'Modules.Mbo.Recommendedmodulesandservices');
break;
}

return $title;
}

/**
* Indicates if the recommended modules button should be attached in this page
*
Expand Down
21 changes: 21 additions & 0 deletions views/css/recommended-modules.css
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,27 @@
margin-top: 15px;
}

.bootstrap .page-head .toolbarBox .btn-toolbar .toolbar_btn.mbo-modules-recommended-button {
color: #fff;
background-color: #6c868e;
border-color: #6c868e;
-webkit-box-shadow: none;
box-shadow: none;
display: flex;
align-items: center;
}
.bootstrap .page-head .toolbarBox .btn-toolbar .toolbar_btn.mbo-modules-recommended-button i {
display: inline-block;
color: #fff;
margin-right: 5px;
}

.bootstrap .page-head .toolbarBox .btn-toolbar .toolbar_btn.mbo-modules-recommended-button:hover {
color: #fff;
background-color: #b7ced3;
border-color: #b7ced3;
}

@media (min-width: 768px) {
#content.bootstrap #modules_list_container .modal-dialog {
width: 680px;
Expand Down
7 changes: 4 additions & 3 deletions views/js/recommended-modules.js
Original file line number Diff line number Diff line change
Expand Up @@ -180,15 +180,16 @@ var mbo = {};
if (config.shouldUseLegacyTheme) {
$markup = $(
'<li id="recommended-modules-button-container">\n' +
' <a id="' + buttonId + '" class="toolbar_btn pointer" href="' + config.recommendedModulesUrl + '" title="' + label + '">\n' +
' <i class="process-icon-modules-list"></i>\n' +
' <a id="' + buttonId + '" class="toolbar_btn pointer mbo-modules-recommended-button " href="' + config.recommendedModulesUrl + '" title="' + label + '">\n' +
' <i class="material-icons mi-extension">extension</i>\n' +
' <div>' + label + '</div>\n' +
' </a>\n' +
'</li>'
);
} else {
$markup = $(
'<a class="btn btn-outline-secondary" id="' + buttonId + '" href="' + config.recommendedModulesUrl + '" title="' + label + '">\n' +
'<a class="btn btn-secondary" id="' + buttonId + '" href="' + config.recommendedModulesUrl + '" title="' + label + '">' +
'<i class="material-icons">extension</i>\n' +
label +
'</a>'
);
Expand Down