Skip to content

Commit

Permalink
Merge pull request #21 from newera-systems/add-empty-string-fields
Browse files Browse the repository at this point in the history
Add empty string fields
  • Loading branch information
sadortun authored Oct 15, 2023
2 parents f474eb4 + b17c465 commit 86b6b2d
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 1 deletion.
4 changes: 4 additions & 0 deletions src/datagrid-bvue.ts
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,8 @@ export enum EngineSubOperators {
ContainsAll = 'containsAll',
Before = 'before',
After = 'after',
Empty = 'empty',
NotEmpty = 'notEmpty',
}

export enum SimpleRuleType {
Expand Down Expand Up @@ -144,6 +146,8 @@ export const StringOperatorOptions: EngineSubOperators[] = [
EngineSubOperators.StartsWith,
EngineSubOperators.EndsWith,
EngineSubOperators.Matches,
EngineSubOperators.Empty,
EngineSubOperators.NotEmpty,
];
export const NumberOperatorOptions: EngineSubOperators[] = [
EngineSubOperators.EqualTo,
Expand Down
12 changes: 11 additions & 1 deletion src/rule/RuleInputs/StringRule.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,12 @@
<b-input-group-prepend>
<OperatorDropdown v-model="operator" :options="operatorList" />
</b-input-group-prepend>
<b-form-input v-model="content" autocomplete="off" trim />
<b-form-input
v-model="content"
:disabled="operator === 'empty' || operator === 'notEmpty'"
autocomplete="off"
trim
/>
</b-input-group>
<p v-show="operator === 'matches'" class="m-0 p-0">
Format:
Expand All @@ -30,6 +35,11 @@ import OperatorDropdown from '@/rule/RuleInputs/OperatorDropdown.vue';
export default defineComponent({
name: 'StringRule',
computed: {
EngineSubOperators() {
return EngineSubOperators;
},
},
mixins: [fieldInput],
components: {
BFormGroup,
Expand Down
4 changes: 4 additions & 0 deletions src/translation/filter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ export default {
endsWith: 'Finit par',
isNull: 'Est nul',
isNotNull: "N'est pas nul",
empty: 'Est vide',
notEmpty: "N'est pas vide",
and: 'Et',
or: 'Ou',
not: 'Non',
Expand Down Expand Up @@ -85,6 +87,8 @@ export default {
endsWith: 'Ends with',
isNull: 'Is null',
isNotNull: 'Is not null',
empty: 'Empty',
notEmpty: 'Not empty',
and: 'And',
or: 'Or',
not: 'Not',
Expand Down
4 changes: 4 additions & 0 deletions src/translation/modal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ export default {
endsWith: 'Finit par',
isNull: 'Est nul',
isNotNull: "N'est pas nul",
empty: 'Est vide',
notEmpty: "N'est pas vide",
and: 'Et',
or: 'Ou',
not: 'Non',
Expand Down Expand Up @@ -97,6 +99,8 @@ export default {
endsWith: 'Ends with',
isNull: 'Is null',
isNotNull: 'Is not null',
empty: 'Empty',
notEmpty: 'Not empty',
and: 'And',
or: 'Or',
not: 'Not',
Expand Down
4 changes: 4 additions & 0 deletions src/translation/table.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ export default {
endsWith: 'Finit par',
isNull: 'Est nul',
isNotNull: "N'est pas nul",
empty: 'Est vide',
notEmpty: "N'est pas vide",
and: 'Et',
or: 'Ou',
not: 'Non',
Expand Down Expand Up @@ -117,6 +119,8 @@ export default {
endsWith: 'Ends with',
isNull: 'Is null',
isNotNull: 'Is not null',
empty: 'Empty',
notEmpty: 'Not empty',
and: 'And',
or: 'Or',
not: 'Not',
Expand Down

0 comments on commit 86b6b2d

Please sign in to comment.