diff --git a/resources/js/processes/export/components/ExportSuccessModal.vue b/resources/js/processes/export/components/ExportSuccessModal.vue index d7c4758d3d..c530b1295a 100644 --- a/resources/js/processes/export/components/ExportSuccessModal.vue +++ b/resources/js/processes/export/components/ExportSuccessModal.vue @@ -61,8 +61,6 @@ export default { }).map(([uuid, setting]) => { return this.$root.manifest[uuid]; }).reduce((groups, asset) => { - console.log(asset); - if(!(asset.type in groups)) { groups[asset.type] = { firstAsset: asset, diff --git a/resources/js/processes/export/components/MainAssetView.vue b/resources/js/processes/export/components/MainAssetView.vue index befa7727cc..57316bb421 100644 --- a/resources/js/processes/export/components/MainAssetView.vue +++ b/resources/js/processes/export/components/MainAssetView.vue @@ -152,6 +152,8 @@ export default { importingName: asset.name, existingId: asset.existing_id, matchedBy: asset.matched_by, + existingUpdatedAt: asset.existing_attributes?.updated_at, + importingUpdatedAt: asset.attributes?.updated_at, }; }); } diff --git a/resources/js/processes/import/components/ImportManagerView.vue b/resources/js/processes/import/components/ImportManagerView.vue index f2594e8055..50fdb8e5fa 100644 --- a/resources/js/processes/import/components/ImportManagerView.vue +++ b/resources/js/processes/import/components/ImportManagerView.vue @@ -155,8 +155,8 @@ export default { importingName: asset.name, existingId: asset.existing_id, matchedBy: asset.matched_by, - existingUpdatedAt: asset.existing_attributes.updated_at, - importingUpdatedAt: asset.attributes.updated_at, + existingUpdatedAt: asset.existing_attributes?.updated_at, + importingUpdatedAt: asset.attributes?.updated_at, }; }); } diff --git a/resources/js/processes/import/components/ImportProcessModal.vue b/resources/js/processes/import/components/ImportProcessModal.vue index c13b9435e8..f562b6d8dc 100644 --- a/resources/js/processes/import/components/ImportProcessModal.vue +++ b/resources/js/processes/import/components/ImportProcessModal.vue @@ -104,21 +104,21 @@ return this.$t('Caution: {{type}} Already Exists', {type: asset.typeHuman}); }, helperText(asset) { - let assetTiming = this.$t("This environment already contains "); + let text = "This environment already contains the {{ item }} named '{{ name }}.'"; + if (asset.existingUpdatedAt && asset.importingUpdatedAt) { + const existingUpdatedAt = new Date(asset.existingUpdatedAt); + const importingUpdatedAt = new Date(`${asset.importingUpdatedAt.replace(" ", "T")}.000000Z`); - const existingUpdatedAt = new Date(asset.existingUpdatedAt); - const importingUpdatedAt = new Date(`${asset.importingUpdatedAt.replace(" ", "T")}.000000Z`); - - if (existingUpdatedAt > importingUpdatedAt) { - assetTiming += this.$t("a newer"); - } else if (existingUpdatedAt < importingUpdatedAt) { - assetTiming += this.$t("an older"); - } else { - assetTiming += this.$t("the same"); + if (existingUpdatedAt > importingUpdatedAt) { + text = "This environment already contains a newer version of the {{ item }} named '{{ name }}.'"; + } else if (existingUpdatedAt < importingUpdatedAt) { + text = "This environment already contains an older version of the {{ item }} named '{{ name }}.'"; + } else { + text = "This environment already contains the same version of the {{ item }} named '{{ name }}.'"; + } } - const text = this.$t('{{ assetTiming }} version of the {{ item }} named "{{ name }}."', { - assetTiming, + text = this.$t(text, { item: asset.typeHuman.toLowerCase(), name: asset.importingName, }); diff --git a/resources/lang/en.json b/resources/lang/en.json index 70d5077d14..66452fa34f 100644 --- a/resources/lang/en.json +++ b/resources/lang/en.json @@ -1748,10 +1748,10 @@ "Import all assets from the uploaded package.":"Import all assets from the uploaded package.", "Custom":"Custom", "Select which assets from the uploaded package should be imported to this environment.":"Select which assets from the uploaded package should be imported to this environment.", - "This environment already contains ": "This environment already contains ", - "a newer": "a newer", - "an older": "an older", - "the same": "the same", + "This environment already contains the {{ item }} named '{{ name }}.'": "This environment already contains the {{ item }} named '{{ name }}.'", + "This environment already contains a newer version of the {{ item }} named '{{ name }}.'":"This environment already contains a newer version of the {{ item }} named '{{ name }}.'", + "This environment already contains an older version of the {{ item }} named '{{ name }}.'":"This environment already contains an older version of the {{ item }} named '{{ name }}.'", + "This environment already contains the same version of the {{ item }} named '{{ name }}.'":"This environment already contains the same version of the {{ item }} named '{{ name }}.'", "You are about to import":"You are about to import", "Process was successfully imported":"Process was successfully imported", "Select Import Type":"Select Import Type",