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

Add Helper Card to Employees page #11049

Merged
merged 9 commits into from Nov 8, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
38 changes: 38 additions & 0 deletions admin-dev/themes/new-theme/js/components/helper-card.js
@@ -0,0 +1,38 @@
/**
* 2007-2018 PrestaShop
*
* NOTICE OF LICENSE
*
* This source file is subject to the Open Software License (OSL 3.0)
* that is bundled with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* https://opensource.org/licenses/OSL-3.0
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@prestashop.com so we can send you a copy immediately.
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
* versions in the future. If you wish to customize PrestaShop for your
* needs please refer to http://www.prestashop.com for more information.
*
* @author PrestaShop SA <contact@prestashop.com>
* @copyright 2007-2018 PrestaShop SA
* @license https://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0)
* International Registered Trademark & Property of PrestaShop SA
*/

const $ = window.$;

/**
* Manages Helper cards on page.
*/
export default class HelperCard {
constructor() {
$(document).on('click', '.js-close-helper-card', (event) => {
console.log($(event.target));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@sarjon I just saw this. Is it intended or is it a debug statement that we forgot to remove ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

definitely not intended, we should remove it.

$(event.currentTarget).closest('.helper-card').remove();
});
}
}
3 changes: 3 additions & 0 deletions admin-dev/themes/new-theme/js/pages/employee/index.js
Expand Up @@ -31,6 +31,7 @@ import SortingExtension from "../../components/grid/extension/sorting-extension"
import BulkActionCheckboxExtension from "../../components/grid/extension/bulk-action-checkbox-extension";
import SubmitBulkActionExtension from "../../components/grid/extension/submit-bulk-action-extension";
import SubmitRowActionExtension from "../../components/grid/extension/action/row/submit-row-action-extension";
import HelperCard from "../../components/helper-card";

const $ = window.$;

Expand All @@ -44,4 +45,6 @@ $(() => {
employeeGrid.addExtension(new BulkActionCheckboxExtension());
employeeGrid.addExtension(new SubmitBulkActionExtension());
employeeGrid.addExtension(new SubmitRowActionExtension());

new HelperCard();
});
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/public/backup.bundle.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion admin-dev/themes/new-theme/public/catalog.bundle.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.