-
!!filterType))
.subscribe(filterType => {
if (filterType.status === 'ACTIVE') {
+ if (!filterType.value) {
+ this.popoverFilter.close();
+ this.selectFilter(filterType, this.filters.length - 1);
+ this.editMode = true;
+ setTimeout(() => this.popoverFilter.open(),
+ 300);
+ }
+
this.filters.push(filterType);
} else {
this.filters = this.filters.filter(f => f.value !== filterType.value);
}
- this.filterChange.emit(this.filters);
+ if (!this.filterSelected) {
+ this.filterChange.emit(this.filters);
+ }
});
}
@@ -95,13 +105,13 @@ export class ElasticFilterComponent implements OnInit, OnDestroy {
return (value.field === filter.field && value.operator === filter.operator);
});
this.filters.splice(index, 1);
- this.filterSelected = undefined;
+ this.filterSelected = null;
this.filterChange.emit(this.filters);
}
deleteAll() {
this.filters = [];
- this.filterSelected = undefined;
+ this.filterSelected = null;
this.filterChange.emit(this.filters);
}
diff --git a/frontend/src/app/shared/components/utm/filters/utm-elastic-filter/shared/behavior/utm-filter.behavior.ts b/frontend/src/app/shared/components/utm/filters/utm-elastic-filter/shared/behavior/utm-filter.behavior.ts
index a63ed3b6f..f2587d8c5 100644
--- a/frontend/src/app/shared/components/utm/filters/utm-elastic-filter/shared/behavior/utm-filter.behavior.ts
+++ b/frontend/src/app/shared/components/utm/filters/utm-elastic-filter/shared/behavior/utm-filter.behavior.ts
@@ -12,4 +12,15 @@ export class UtmFilterBehavior {
* Use to add exist filter on add field to table
*/
$filterExistChange = new BehaviorSubject(null);
+
+ processKey(key: string): string {
+ const regex = /\.(\d+)\./g;
+ if (regex.test(key)) {
+ return key.replace(regex, '.');
+ } else if (!isNaN(Number(key.substring(key.lastIndexOf('.'), key.length)))) {
+ return key.substring(0, key.lastIndexOf('.'));
+ } else {
+ return key;
+ }
+ }
}
diff --git a/frontend/src/app/shared/components/utm/table/utm-table/utm-table-detail/utm-table-detail-view/utm-table-detail-view.component.ts b/frontend/src/app/shared/components/utm/table/utm-table/utm-table-detail/utm-table-detail-view/utm-table-detail-view.component.ts
index a8da9b6d9..5772d3a83 100644
--- a/frontend/src/app/shared/components/utm/table/utm-table/utm-table-detail/utm-table-detail-view/utm-table-detail-view.component.ts
+++ b/frontend/src/app/shared/components/utm/table/utm-table/utm-table-detail/utm-table-detail-view/utm-table-detail-view.component.ts
@@ -37,24 +37,13 @@ export class UtmTableDetailViewComponent implements OnInit {
filterByValue(row: { key: string; value: any }) {
this.utmFilterBehavior.$filterChange.next(
{
- field: this.processKey(row.key),
+ field: this.utmFilterBehavior.processKey(row.key),
value: row.value,
operator: ElasticOperatorsEnum.IS,
status: 'ACTIVE'
});
}
- processKey(key: string): string {
- const regex = /\.(\d+)\./g;
- if (regex.test(key)) {
- return key.replace(regex, '.');
- } else if (!isNaN(Number(key.substring(key.lastIndexOf('.'), key.length)))) {
- return key.substring(0, key.lastIndexOf('.'));
- } else {
- return key;
- }
- }
-
isDate(key: string, value: string): boolean {
return (key.toLowerCase().includes('time') || key.toLowerCase().includes('date')) && !isNaN(new Date(value).getDate());
}
diff --git a/frontend/src/app/shared/constants/filter-operators.const.ts b/frontend/src/app/shared/constants/filter-operators.const.ts
index c2aec2741..874a6f024 100644
--- a/frontend/src/app/shared/constants/filter-operators.const.ts
+++ b/frontend/src/app/shared/constants/filter-operators.const.ts
@@ -12,8 +12,8 @@ export const FILTER_OPERATORS: OperatorsType[] = [
{name: 'is not between', operator: ElasticOperatorsEnum.IS_NOT_BETWEEN, inverse: ElasticOperatorsEnum.IS_BETWEEN},
{name: 'contain', operator: ElasticOperatorsEnum.CONTAIN, inverse: ElasticOperatorsEnum.DOES_NOT_CONTAIN},
{name: 'does not contain', operator: ElasticOperatorsEnum.DOES_NOT_CONTAIN, inverse: ElasticOperatorsEnum.CONTAIN},
- {name: 'contain one of', operator: ElasticOperatorsEnum.CONTAIN_ONE_OF, inverse: ElasticOperatorsEnum.DOES_NOT_CONTAIN_ONE_OF},
- {name: 'does not contain one of', operator: ElasticOperatorsEnum.DOES_NOT_CONTAIN_ONE_OF, inverse: ElasticOperatorsEnum.CONTAIN_ONE_OF},
+ {name: 'contains one of', operator: ElasticOperatorsEnum.CONTAIN_ONE_OF, inverse: ElasticOperatorsEnum.DOES_NOT_CONTAIN_ONE_OF},
+ {name: 'does not contains one of', operator: ElasticOperatorsEnum.DOES_NOT_CONTAIN_ONE_OF, inverse: ElasticOperatorsEnum.CONTAIN_ONE_OF},
{name: 'start with', operator: ElasticOperatorsEnum.START_WITH, inverse: ElasticOperatorsEnum.NOT_START_WITH},
{name: 'does not start with', operator: ElasticOperatorsEnum.NOT_START_WITH, inverse: ElasticOperatorsEnum.START_WITH},
{name: 'end with', operator: ElasticOperatorsEnum.ENDS_WITH, inverse: ElasticOperatorsEnum.NOT_ENDS_WITH},
diff --git a/frontend/src/styles.scss b/frontend/src/styles.scss
index 905748378..b9115f411 100644
--- a/frontend/src/styles.scss
+++ b/frontend/src/styles.scss
@@ -1328,5 +1328,9 @@ app-utm-cp-cron-editor {
max-width: 350px !important;
}
+.border-radius-1 {
+ border-radius: 4px;
+}
+