3
0

Adjust module record dedup UX

This commit is contained in:
Jože Fortun
2023-12-11 13:30:15 +01:00
committed by Peter Grlica
parent 321e0ff908
commit 8c7f9dab69
3 changed files with 34 additions and 15 deletions
@@ -1,16 +1,27 @@
<template>
<div>
<c-hint
:tooltip="$t('tooltip.performance')"
icon-class="text-warning"
class="float-right"
/>
<b-form-group label-class="d-flex align-items-center text-primary p-0">
<template #label>
{{ $t('enabled') }}
<c-hint
:tooltip="$t('tooltip.performance')"
icon-class="text-warning"
/>
</template>
<c-input-checkbox
v-model="isEnabled"
switch
:labels="checkboxLabel"
data-test-id="checkbox-enabled"
/>
</b-form-group>
<div
v-for="(rule, index) in rules"
:key="index"
>
<hr v-if="index">
<hr>
<h5 class="d-flex align-items-center">
{{ $t('uniqueValueConstraint', { index: index + 1 }) }}
@@ -127,9 +138,8 @@
<div class="d-flex justify-content-end">
<b-button
size="lg"
variant="outline-light"
class="d-flex align-items-center border-0 text-primary mt-3"
class="d-flex align-items-center border-0 text-primary"
@click="addNewConstraint"
>
<font-awesome-icon
@@ -172,11 +182,22 @@ export default {
get () {
return this.module.config.recordDeDup.rules
},
set (value) {
this.module.config.recordDeDup.rules = value
},
},
isEnabled: {
get () {
return this.module.config.recordDeDup.enabled
},
set (value) {
this.module.config.recordDeDup.enabled = value
},
},
modifierOptions () {
return [
{ value: 'ignore-case', text: this.$t('ignoreCase') },
+3 -6
View File
@@ -58,6 +58,7 @@ interface Config {
};
recordDeDup: {
enabled: boolean;
rules: RecordDeDupRule[];
};
}
@@ -174,12 +175,8 @@ export class Module {
},
recordDeDup: {
rules: [
{
strict: true,
constraints: []
}
],
enabled: false,
rules: [],
},
}
+2 -1
View File
@@ -190,6 +190,7 @@ edit:
uniqueValues:
title: Unique values
enabled: Enable duplication detection
preventRecordsSave: Prevent record saving if duplicate values are found
warningLabel: Warning or error message toast when constraint matches
valueModifiers: Value modifiers
@@ -209,7 +210,7 @@ edit:
addNewConstraint: Add new constraint
uniqueValueConstraint: "Unique value constraint #{{index}}"
tooltip:
performance: Using unique value constraints will impact performance
performance: Using duplication detection will impact performance
federated: Federated
forModule: