diff --git a/CHANGELOG_de-DE.md b/CHANGELOG_de-DE.md index 59dbb48..858deff 100644 --- a/CHANGELOG_de-DE.md +++ b/CHANGELOG_de-DE.md @@ -1,3 +1,6 @@ +# 3.0.1 +- Verbessert den Upload der Seriennummer per csv-Datei + # 3.0.0 - Shopware 6 Kompatibilität diff --git a/CHANGELOG_en-GB.md b/CHANGELOG_en-GB.md index 51ac0ce..70e9294 100644 --- a/CHANGELOG_en-GB.md +++ b/CHANGELOG_en-GB.md @@ -1,3 +1,6 @@ +# 3.0.1 +- Improved the upload serial number by csv file + # 3.0.0 - Shopware 6 compatibility diff --git a/composer.json b/composer.json index bca3867..7d287f1 100644 --- a/composer.json +++ b/composer.json @@ -3,7 +3,7 @@ "description":"ESD / Download plugin", "type":"shopware-platform-plugin", "keywords": ["esd", "download"], - "version":"3.0.0", + "version":"3.0.1", "license":"proprietary", "authors":[ { diff --git a/makefile b/makefile index be4807b..d6891a0 100644 --- a/makefile +++ b/makefile @@ -64,3 +64,6 @@ review: ## Review make ecs -B make phpunit -B make eslint -B + +zip: + shopware-cli extension zip . --release --disable-git --output-directory ../ diff --git a/src/Resources/app/administration/src/module/sas-esd/component/sas-esd-modal-csv/index.js b/src/Resources/app/administration/src/module/sas-esd/component/sas-esd-modal-csv/index.js index f5f1338..9bae2d1 100644 --- a/src/Resources/app/administration/src/module/sas-esd/component/sas-esd-modal-csv/index.js +++ b/src/Resources/app/administration/src/module/sas-esd/component/sas-esd-modal-csv/index.js @@ -179,8 +179,8 @@ export default { _this.callback(this.form.csv); }, buildMappedCsv() { - const _this = this; const csv = this.hasHeaders ? drop(this.csv) : this.csv; + const _this = this; return map(csv, (row) => { const newRow = {}; forEach(_this.map, (column, field) => { @@ -224,6 +224,7 @@ export default { }, toggleHasHeaders() { this.hasHeaders = !this.hasHeaders; + this.map = this.hasHeaders ? { serial: null } : { serial: 0 }; }, makeId(id) { return `${id}${this._uid}`; @@ -242,12 +243,13 @@ export default { watch: { map: { deep: true, - handler: (newVal) => { + immediate: true, + handler(newVal) { if (!this.url) { const hasAllKeys = Array.isArray(this.mapFields) ? every(this.mapFields, (item) => { - return newVal.hasOwnProperty(item); + return newVal.hasOwnProperty(item) && newVal[item] !== null; }) : every(this.mapFields, (item, key) => { - return newVal.hasOwnProperty(key); + return newVal.hasOwnProperty(key) && newVal[key] !== null; }); if (hasAllKeys) { this.createNotificationSuccess({ @@ -257,6 +259,8 @@ export default { ), }); this.isDisabled = false; + } else { + this.isDisabled = true; } } }, @@ -278,6 +282,12 @@ export default { } } }, + isValidFileMimeType() { + if (this.isValidFileMimeType) { + this.load(); + this.map = this.hasHeaders ? this.map : { serial: 0 }; + } + }, }, computed: { ...mapState('swProductDetail', [ diff --git a/src/Resources/app/administration/src/module/sas-esd/component/sas-esd-modal-csv/sas-esd-modal-csv.html.twig b/src/Resources/app/administration/src/module/sas-esd/component/sas-esd-modal-csv/sas-esd-modal-csv.html.twig index 73d8743..df9f0dc 100644 --- a/src/Resources/app/administration/src/module/sas-esd/component/sas-esd-modal-csv/sas-esd-modal-csv.html.twig +++ b/src/Resources/app/administration/src/module/sas-esd/component/sas-esd-modal-csv/sas-esd-modal-csv.html.twig @@ -24,7 +24,7 @@ name="hasHeaders" :value="hasHeaders" :class="checkboxClass" :label="$tc('sas-esd.sas-esd-modal-csv.checkboxLabel')" -@@update:value="toggleHasHeaders" +@update:value="toggleHasHeaders" /> @@ -84,7 +84,10 @@ size="small" v-if="sample" class="vue-csv-mapping" > -