Exclude default columns from mapping [SCI-10808]

This commit is contained in:
Anton 2024-06-26 15:24:29 +02:00
parent 759234aad1
commit 32c8af1280
2 changed files with 25 additions and 3 deletions

View file

@ -23,7 +23,7 @@
:clearable="true"
:size="'sm'"
:class="{
'outline-sn-alert-brittlebush outline-1 outline rounded': matchNotFound
'outline-sn-alert-brittlebush outline-1 outline rounded': computeMatchNotFound
}"
:placeholder="computeMatchNotFound ?
i18n.t('repositories.import_records.steps.step2.table.tableRow.placeholders.matchNotFound') :
@ -51,7 +51,7 @@
<i v-if="differentMapingName" :title="i18n.t('repositories.import_records.steps.step2.table.tableRow.importedColumnTitle')"
class="sn-icon sn-icon-info text-sn-science-blue"></i>
<i v-else-if="columnMapped" :title="i18n.t('repositories.import_records.steps.step2.table.tableRow.importedColumnTitle')" class="sn-icon sn-icon-check"></i>
<i v-else-if="matchNotFound" :title="i18n.t('repositories.import_records.steps.step2.table.tableRow.matchNotFoundColumnTitle')"
<i v-else-if="matchNotFound && !isSystemColumn(item)" :title="i18n.t('repositories.import_records.steps.step2.table.tableRow.matchNotFoundColumnTitle')"
class="sn-icon sn-icon-close text-sn-alert-brittlebush"></i>
<i v-else :title="i18n.t('repositories.import_records.steps.step2.table.tableRow.doNotImportColumnTitle')" class="sn-icon sn-icon-close text-sn-sleepy-grey"></i>
</div>
@ -100,6 +100,16 @@ export default {
type: 'Text',
name: ''
},
systemColumns: [
this.i18n.t('repositories.import_records.steps.step2.systemColumns.added_by'),
this.i18n.t('repositories.import_records.steps.step2.systemColumns.created_on'),
this.i18n.t('repositories.import_records.steps.step2.systemColumns.updated_by'),
this.i18n.t('repositories.import_records.steps.step2.systemColumns.updated_on'),
this.i18n.t('repositories.import_records.steps.step2.systemColumns.archived_by'),
this.i18n.t('repositories.import_records.steps.step2.systemColumns.archived_on'),
this.i18n.t('repositories.import_records.steps.step2.systemColumns.parents'),
this.i18n.t('repositories.import_records.steps.step2.systemColumns.children')
],
newColumnTypes: [
['Text', this.i18n.t('repositories.import_records.steps.step2.table.tableRow.newColumnType.text')],
['List', this.i18n.t('repositories.import_records.steps.step2.table.tableRow.newColumnType.list')]
@ -122,7 +132,7 @@ export default {
},
computed: {
computeMatchNotFound() {
return this.autoMapping && ((this.selectedColumnType && !this.selectedColumnType.key) || !this.selectedColumnType);
return this.autoMapping && !this.isSystemColumn(this.item) && ((this.selectedColumnType && !this.selectedColumnType.key) || !this.selectedColumnType);
},
selected() {
return !!this.value?.key;
@ -138,6 +148,9 @@ export default {
}
},
methods: {
isSystemColumn(column) {
return this.systemColumns.includes(column);
},
autoMap() {
Object.entries(this.params.import_data.available_fields).forEach(([key, value]) => {
if (this.item === value) {

View file

@ -2228,6 +2228,15 @@ en:
cancelBtnText: 'Cancel'
confirmBtnText: 'Confirm'
importedIgnoredSection: '<b>%{imported}</b> columns to <b>import.</b> <b>%{ignored}</b> columns <b>ignored.</b>'
systemColumns:
added_by: 'Added by'
created_on: 'Created on'
updated_by: 'Updated by'
updated_on: 'Updated on'
archived_by: 'Archived by'
archived_on: 'Archived on'
parents: 'Parents'
children: 'Children'
computedDropdownOptions:
name: 'Name'
id: 'ID'