diff --git a/src/Resources/app/administration/src/component/nosto-grouped-view/index.js b/src/Resources/app/administration/src/component/nosto-grouped-view/index.js index 229f33e..4975b50 100644 --- a/src/Resources/app/administration/src/component/nosto-grouped-view/index.js +++ b/src/Resources/app/administration/src/component/nosto-grouped-view/index.js @@ -2,7 +2,7 @@ import template from './nosto-grouped-view.html.twig'; import JobHelper from '../../util/job.helper'; import './nosto-grouped-view.scss'; -const { Component } = Shopware; +const { Component, Mixin } = Shopware; const { Criteria } = Shopware.Data; /** @private */ @@ -14,7 +14,8 @@ Component.register('nosto-grouped-view', { ], mixins: [ - 'notification', + Mixin.getByName('notification'), + Mixin.getByName('nosto-scheduler-utils'), ], props: { @@ -284,9 +285,5 @@ Component.register('nosto-grouped-view', { this.currentJobMessages = job.messages; this.showMessagesModal = true; }, - - formatDate(date) { - return date ? (new Date(date)).toLocaleString() : ''; - }, }, }); diff --git a/src/Resources/app/administration/src/component/nosto-job-info/index.js b/src/Resources/app/administration/src/component/nosto-job-info/index.js index ada7b52..218c952 100644 --- a/src/Resources/app/administration/src/component/nosto-job-info/index.js +++ b/src/Resources/app/administration/src/component/nosto-job-info/index.js @@ -1,6 +1,6 @@ import template from './nosto-job-info.html.twig'; -const { Component } = Shopware; +const { Component, Mixin } = Shopware; const { Criteria } = Shopware.Data; /** @private */ @@ -13,7 +13,8 @@ Component.register('nosto-job-info', { ], mixins: [ - 'notification', + Mixin.getByName('notification'), + Mixin.getByName('nosto-scheduler-utils'), ], props: { @@ -46,9 +47,5 @@ Component.register('nosto-job-info', { this.jobItem = jobItem; }); }, - - formatDate(date) { - return date ? (new Date(date)).toLocaleString() : ''; - }, }, }); diff --git a/src/Resources/app/administration/src/component/nosto-job-sub-jobs/index.js b/src/Resources/app/administration/src/component/nosto-job-sub-jobs/index.js index 3142079..17f7c16 100644 --- a/src/Resources/app/administration/src/component/nosto-job-sub-jobs/index.js +++ b/src/Resources/app/administration/src/component/nosto-job-sub-jobs/index.js @@ -2,7 +2,7 @@ import template from './nosto-job-sub-jobs.html.twig'; import JobHelper from '../../util/job.helper'; import './nosto-job-sub-jobs.scss'; -const { Component } = Shopware; +const { Component, Mixin } = Shopware; const { Criteria } = Shopware.Data; /** @private */ @@ -15,7 +15,8 @@ Component.register('nosto-job-sub-jobs', { ], mixins: [ - 'notification', + Mixin.getByName('notification'), + Mixin.getByName('nosto-scheduler-utils'), ], props: { @@ -133,9 +134,5 @@ Component.register('nosto-job-sub-jobs', { return item.type === `${type}-message`; }).length; }, - - formatDate(date) { - return date ? (new Date(date)).toLocaleString() : ''; - }, }, }); diff --git a/src/Resources/app/administration/src/main.js b/src/Resources/app/administration/src/main.js index d648f31..a2ef49d 100644 --- a/src/Resources/app/administration/src/main.js +++ b/src/Resources/app/administration/src/main.js @@ -1,3 +1,4 @@ +import './mixins/nosto-scheduler-utils'; import './component/nosto-entity-listing'; import './component/nosto-job-status-badge'; import './module/nosto-job'; diff --git a/src/Resources/app/administration/src/mixins/nosto-scheduler-utils.js b/src/Resources/app/administration/src/mixins/nosto-scheduler-utils.js new file mode 100644 index 0000000..05ba4c8 --- /dev/null +++ b/src/Resources/app/administration/src/mixins/nosto-scheduler-utils.js @@ -0,0 +1,9 @@ +const { Mixin, Utils } = Shopware; + +Mixin.register('nosto-scheduler-utils', { + methods: { + formatDate(date) { + return Utils.format.date(date) + } + } +}); diff --git a/src/Resources/app/administration/src/module/nosto-job/page/nosto-job-listing-index/index.js b/src/Resources/app/administration/src/module/nosto-job/page/nosto-job-listing-index/index.js index a879f77..22e8288 100644 --- a/src/Resources/app/administration/src/module/nosto-job/page/nosto-job-listing-index/index.js +++ b/src/Resources/app/administration/src/module/nosto-job/page/nosto-job-listing-index/index.js @@ -2,7 +2,7 @@ import template from './nosto-job-listing-index.html.twig'; import JobHelper from '../../../../util/job.helper'; import './nosto-job-listing-index.scss'; -const { Component } = Shopware; +const { Component, Mixin } = Shopware; const { Criteria } = Shopware.Data; /** @private */ @@ -17,7 +17,8 @@ Component.register('nosto-job-listing-index', { ], mixins: [ - 'notification', + Mixin.getByName('notification'), + Mixin.getByName('nosto-scheduler-utils'), ], props: { @@ -289,9 +290,5 @@ Component.register('nosto-job-listing-index', { this.autoLoadIsActive = false; clearInterval(this.reloadInterval); }, - - formatDate(date) { - return date ? (new Date(date)).toLocaleString() : ''; - }, }, }); diff --git a/src/Resources/public/administration/js/nosto-scheduler.js b/src/Resources/public/administration/js/nosto-scheduler.js index ffe963e..4e7a2ff 100644 --- a/src/Resources/public/administration/js/nosto-scheduler.js +++ b/src/Resources/public/administration/js/nosto-scheduler.js @@ -1 +1 @@ -(function(){var e={30:function(){},328:function(){},250:function(){},758:function(){},729:function(){},671:function(e,t,n){var s=n(30);s.__esModule&&(s=s.default),"string"==typeof s&&(s=[[e.id,s,""]]),s.locals&&(e.exports=s.locals),n(346).Z("585a76b3",s,!0,{})},158:function(e,t,n){var s=n(328);s.__esModule&&(s=s.default),"string"==typeof s&&(s=[[e.id,s,""]]),s.locals&&(e.exports=s.locals),n(346).Z("3a2beb4e",s,!0,{})},951:function(e,t,n){var s=n(250);s.__esModule&&(s=s.default),"string"==typeof s&&(s=[[e.id,s,""]]),s.locals&&(e.exports=s.locals),n(346).Z("19dce50c",s,!0,{})},461:function(e,t,n){var s=n(758);s.__esModule&&(s=s.default),"string"==typeof s&&(s=[[e.id,s,""]]),s.locals&&(e.exports=s.locals),n(346).Z("5f6e56a6",s,!0,{})},266:function(e,t,n){var s=n(729);s.__esModule&&(s=s.default),"string"==typeof s&&(s=[[e.id,s,""]]),s.locals&&(e.exports=s.locals),n(346).Z("87d3cc56",s,!0,{})},346:function(e,t,n){"use strict";function s(e,t){for(var n=[],s={},o=0;on.parts.length&&(s.parts.length=n.parts.length)}else{for(var i=[],o=0;o\n{% endblock %}\n\n{% block sw_data_grid_bulk_selected_actions_content %}\n {% block sw_data_grid_bulk_edit_content %}\n \n \n {{ $tc(\'global.sw-bulk-edit-modal.bulkEdit\') }}\n \n {% endblock %}\n\n {% block sw_data_grid_bulk_delete_content %}\n \n \n {{ $tc(\'global.default.delete\') }}\n \n {% endblock %}\n{% endblock %}\n\n{% block sw_data_grid_slot_bulk_modals %}\n {% block sw_data_grid_bulk_edit_modal %}\n \n {% block sw_data_grid_slot_bulk_edit_modal %}\n \n {% endblock %}\n \n {% endblock %}\n\n {% block sw_data_grid_bulk_delete_modal %}\n \n

\n \n {{ $tc(\'global.entity-components.deleteMessage\', selectionCount, { count: selectionCount }) }}\n \n

\n\n \n \n {% endblock %}\n{% endblock %}\n\n{% block sw_data_grid_slot_actions %}\n \n \n {{ detailPageLinkText }}\n \n \n\n \n\n \n \n {{ $tc(\'global.default.delete\') }}\n \n\n \n Test\n \n \n{% endblock %}\n\n{% block sw_data_grid_slot_action_modals %}\n \n

\n \n {{ $tc(\'global.entity-components.deleteMessage\') }}\n \n

\n\n \n \n{% endblock %}\n\n{% block sw_data_grid_select_item_checkbox %}\n \n{% endblock %}\n\n\n{% block sw_data_grid_table %}\n \n\n {% block sw_data_grid_header %}\n \n\n {% block sw_data_grid_header_row %}\n \n\n {% block sw_data_grid_header_cell_selection %}\n \n {% block sw_data_grid_header_cell_selection_content %}\n
\n {% block sw_data_grid_select_all_checkbox %}\n \n {% endblock %}\n
\n {% endblock %}\n \n {% endblock %}\n\n {% block sw_data_grid_header_columns %}\n \n\n {% block sw_data_grid_header_columns_content %}\n
\n\n \n\n {% block sw_data_grid_header_columns_icon %}\n \n {{ $te(column.label) ? $tc(column.label) : column.label }}\n \n {% endblock %}\n\n {% block sw_data_grid_header_columns_label %}\n \n {% endblock %}\n \n\n {% block sw_data_grid_column_actions %}\n \n {% block sw_data_grid_column_actions_hide %}\n \n {{ $tc(\'global.sw-data-grid.labelColumnHide\') }}\n \n {% endblock %}\n \n {% endblock %}\n\n {% block sw_data_grid_sort_indicator %}\n \n {% block sw_data_grid_sort_indicator_transition %}\n \n {% block sw_data_grid_sort_indicator_icon_asc %}\n \n {% endblock %}\n\n {% block sw_data_grid_sort_indicator_icon_desc %}\n \n {% endblock %}\n \n {% endblock %}\n \n {% endblock %}\n
\n {% endblock %}\n\n {% block sw_data_grid_header_columns_resize %}\n \n {% endblock %}\n \n {% endblock %}\n\n {% block sw_data_grid_header_cell_spacer %}\n