Skip to content

Commit

Permalink
Merge pull request #6 from Nosto/ADS-4480_storefront_and_administrati…
Browse files Browse the repository at this point in the history
…on_changes

(SW 6.6) ADS-4480 Migrate storefront and administration
  • Loading branch information
TobiasGraml11 authored Apr 15, 2024
2 parents c3ded3a + e9b174e commit 6a0098e
Show file tree
Hide file tree
Showing 16 changed files with 172 additions and 156 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ Component.extend('nosto-entity-listing', 'sw-entity-listing', {
},

selectAll(selected) {
this.$delete(this.selection);
this.selection = {};
this.records.forEach(item => {
if (this.isSelected(item[this.itemIdentifierProperty]) !== selected) {
this.selectItem(selected, item);
Expand All @@ -77,11 +77,12 @@ Component.extend('nosto-entity-listing', 'sw-entity-listing', {
}

const selection = this.selection;
const identifier = item[this.itemIdentifierProperty];

if (selected) {
this.$set(this.selection, item[this.itemIdentifierProperty], item);
} else if (!selected && selection[item[this.itemIdentifierProperty]]) {
this.$delete(this.selection, item[this.itemIdentifierProperty]);
this.selection[identifier] = item;
} else if (!selected && selection[identifier]) {
delete this.selection[identifier];
}

this.$emit('select-item', this.selection, item, selected);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -192,48 +192,47 @@
</slot>
</template>
</sw-modal>


{% endblock %}

{% block sw_data_grid_select_item_checkbox %}
<sw-checkbox-field
v-if="canDelete(item)"
:disabled="!isRecordSelectable(item)"
:value="isSelected(item[itemIdentifierProperty])"
@change="selectItem($event, item)"
/>
{% endblock %}
{% block sw_data_grid_select_item_checkbox %}
<sw-checkbox-field
v-if="canDelete(item)"
:disabled="!isRecordSelectable(item)"
:value="isSelected(item[itemIdentifierProperty])"
@update:value="selectItem($event, item)"
/>
{% endblock %}


{% block sw_data_grid_table %}
<table ref="table"
class="sw-data-grid__table"
<table
ref="table"
class="sw-data-grid__table"
>

{% block sw_data_grid_header %}
<thead
v-if="showHeader"
class="sw-data-grid__header"
v-if="showHeader"
class="sw-data-grid__header"
>

{% block sw_data_grid_header_row %}
<tr class="sw-data-grid__row">

{% block sw_data_grid_header_cell_selection %}
<th
v-if="showSelection"
class="sw-data-grid__cell sw-data-grid__cell--header sw-data-grid__cell--selection"
v-if="showSelection"
class="sw-data-grid__cell sw-data-grid__cell--header sw-data-grid__cell--selection"
>
{% block sw_data_grid_header_cell_selection_content %}
<div class="sw-data-grid__cell-content">
{% block sw_data_grid_select_all_checkbox %}
<sw-checkbox-field
v-if="records && records.length > 0"
:disabled="isSelectAllDisabled"
class="sw-data-grid__select-all"
:value="allSelectedChecked"
@change="selectAll"
v-if="records && records.length > 0"
:disabled="isSelectAllDisabled"
class="sw-data-grid__select-all"
:value="allSelectedChecked"
@update:value="selectAll"
/>
{% endblock %}
</div>
Expand Down Expand Up @@ -304,21 +303,21 @@
name="sort-indicator"
mode="out-in"
>
{% block sw_data_grid_sort_indicator_icon_asc %}
<sw-icon
{% block sw_data_grid_sort_indicator_icon_asc %}
<sw-icon
v-if="currentSortDirection === 'ASC'"
key="ASC"
name="small-arrow-small-up"
size="16px"
/>
{% endblock %}
name="solid-long-arrow-up"
size="20px"
/>
{% endblock %}

{% block sw_data_grid_sort_indicator_icon_desc %}
<sw-icon
v-else
key="DESC"
name="small-arrow-small-down"
size="16px"
v-else
key="DESC"
name="solid-long-arrow-down"
size="20px"
/>
{% endblock %}
</transition>
Expand Down Expand Up @@ -419,10 +418,11 @@
{% block sw_data_grid_body_cell_selection_content %}
<div class="sw-data-grid__cell-content">
{% block sw_data_grid_select_item_checkbox %}
<sw-checkbox-field v-if="canDelete(item)"
:disabled="!isRecordSelectable(item)"
:value="isSelected(item[itemIdentifierProperty])"
@change="selectItem($event, item)"
<sw-checkbox-field
v-if="canDelete(item)"
:disabled="!isRecordSelectable(item)"
:value="isSelected(item[itemIdentifierProperty])"
@update:value="selectItem($event, item)"
/>
{% endblock %}
</div>
Expand Down Expand Up @@ -460,7 +460,7 @@
<template v-if="column.inlineEdit === 'boolean'">
{% block sw_data_grid_columns_boolean %}
<sw-data-grid-column-boolean
v-model="item[column.property]"
v-model:value="item[column.property]"
:is-inline-edit="isInlineEdit(item) && column.hasOwnProperty('inlineEdit')"
/>
{% endblock %}
Expand All @@ -470,10 +470,10 @@
<template v-if="isInlineEdit(item) && column.hasOwnProperty('inlineEdit')">
{% block sw_data_grid_columns_render_inline_edit %}
<sw-data-grid-inline-edit
:column="column"
:compact="compact"
:value="item[column.property]"
@input="item[column.property] = $event"
:column="column"
:compact="compact"
:value="item[column.property]"
@update:value="item[column.property] = $event"
/>
{% endblock %}
</template>
Expand Down Expand Up @@ -613,4 +613,4 @@
/>
{% endblock %}
</table>
{% endblock %}
{% endblock %}
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand All @@ -14,7 +14,8 @@ Component.register('nosto-grouped-view', {
],

mixins: [
'notification',
Mixin.getByName('notification'),
Mixin.getByName('nosto-scheduler-utils'),
],

props: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,41 +31,42 @@
</template>
<template #column-startedAt="{ item }">
{% block nosto_job_list_grid_job_started_date %}
{{ item.startedAt|date() }}
{{ formatDate(item.startedAt) }}
{% endblock %}
</template>
<template #column-finishedAt="{ item }">
{% block nosto_job_list_grid_job_finished_date %}
{{ item.finishedAt|date() }}
{{ formatDate(item.finishedAt) }}
{% endblock %}
</template>
<template #column-createdAt="{ item }">
{% block nosto_job_list_grid_job_created_date %}
{{ item.createdAt|date() }}
{{ formatDate(item.createdAt) }}
{% endblock %}
</template>
<template class="sub-jobs-column" #column-subJobs="{ item }">
{% block nosto_job_list_grid_job_sub_jobs %}
<div :class="item.subJobs.length > 0 ? 'has-subjobs' : ''"
class="sub-jobs-counters-container jobs-info-counter">
class="sub-jobs-counters-container jobs-info-counter"
>
<div class="count-container" v-if="item.subJobs">
<span class="info-container">
<span class="count" v-html="getChildrenCount(item, 'succeed')"></span>
</span>
<span class="info-container">
<span class="count" v-html="getChildrenCount(item, 'succeed')"></span>
</span>
<nosto-job-status-badge status="succeed"></nosto-job-status-badge>
</div>

<div class="count-container" v-if="item.subJobs">
<span class="warning-container">
<span class="count" v-html="getChildrenCount(item, 'pending')"></span>
</span>
<span class="warning-container">
<span class="count" v-html="getChildrenCount(item, 'pending')"></span>
</span>
<nosto-job-status-badge status="pending"></nosto-job-status-badge>
</div>

<div class="count-container" v-if="item.subJobs">
<span class="error-counter">
<span class="count" v-html="getChildrenCount(item, 'error')"></span>
</span>
<span class="error-counter">
<span class="count" v-html="getChildrenCount(item, 'error')"></span>
</span>
<nosto-job-status-badge status="error"></nosto-job-status-badge>
</div>
</div>
Expand All @@ -81,23 +82,23 @@
<div :class="item.messages.length > 0 ? 'has-messages' : ''"
class="message-counters-container jobs-info-counter">
<div class="count-container" v-if="item.messages">
<span class="info-counter">
<span class="count" v-html="getMessagesCount(item, 'info')"></span>
</span>
<span class="info-counter">
<span class="count" v-html="getMessagesCount(item, 'info')"></span>
</span>
<sw-icon :small="true" name="regular-info-circle" color="#3498db"></sw-icon>
</div>

<div class="count-container" v-if="item.messages">
<span class="warning-counter">
<span class="count" v-html="getMessagesCount(item, 'warning')"></span>
</span>
<span class="warning-counter">
<span class="count" v-html="getMessagesCount(item, 'warning')"></span>
</span>
<sw-icon :small="true" name="regular-exclamation-triangle" color="#f39c12"></sw-icon>
</div>

<div class="count-container" v-if="item.messages">
<span class="error-counter">
<span class="count" v-html="getMessagesCount(item, 'error')"></span>
</span>
<span class="error-counter">
<span class="count" v-html="getMessagesCount(item, 'error')"></span>
</span>
<sw-icon :small="true" name="regular-times-hexagon" color="#c0392b"></sw-icon>
</div>
</div>
Expand Down Expand Up @@ -159,49 +160,34 @@
<sw-modal class="nosto-job-messages-modal" v-if="showMessagesModal" :title="$tc('job-listing.page.listing.grouped-view.job-messages')"
@modal-close="showMessagesModal = false">
{% block job_messages_listing %}
<sw-data-grid
v-if="currentJobMessages"
:items="currentJobMessages"
:data-source="currentJobMessages"
:showSelection="false"
:allowColumnEdit="false"
:allowDelete="false"
:allowEdit="false"
:showActions="false"
:showHeader="false"
class="nosto-job-messages-grid"
:columns="jobMessagesColumns">
<template #column-message="{ item }">
{% block job_list_grid_job_messages %}
<div class="job_list_grid_job_messages-information" style="width:100%;">
<sw-alert
v-if="item.type == 'info-message'"
variant="info"
appearance="default"
:showIcon="true"
:closable="false">
{{ item.message }}
</sw-alert>
<sw-alert
v-if="item.type == 'error-message'"
variant="error"
appearance="default"
:showIcon="true"
:closable="false">
{{ item.message }}
</sw-alert>
<sw-alert
v-if="item.type == 'warning-message'"
variant="warning"
appearance="default"
:showIcon="true"
:closable="false">
{{ item.message }}
</sw-alert>
</div>
{% endblock %}
</template>
</sw-data-grid>
<div v-if="currentJobMessages" class="job_list_grid_job_messages-information" style="width:100%;">
<div class="messages-content" v-for="item in currentJobMessages">
<sw-alert class="nosto-alert"
v-if="item.type == 'info-message'"
variant="info"
appearance="default"
:showIcon="true"
:closable="false">
{{ item.message }}
</sw-alert>
<sw-alert class="nosto-alert"
v-if="item.type == 'error-message'"
variant="error"
appearance="default"
:showIcon="true"
:closable="false">
{{ item.message }}
</sw-alert>
<sw-alert class="nosto-alert"
v-if="item.type == 'warning-message'"
variant="warning"
appearance="default"
:showIcon="true"
:closable="false">
{{ item.message }}
</sw-alert>
</div>
</div>
{% endblock %}
<template #modal-footer>
<sw-button variant="primary"
Expand Down
Loading

0 comments on commit 6a0098e

Please sign in to comment.