Browse Source

Merge pull request #15764 from mtsymbarov-del/fix/cf-dirty-flag-form

Fixed "Confirm exit" dialog appearing when the form was not changed
pull/15809/head
Maksym Tsymbarov 2 months ago
committed by GitHub
parent
commit
c282c25404
No known key found for this signature in database GPG Key ID: B5690EEEBB952194
  1. 5
      ui-ngx/src/app/core/services/calculated-field-form.service.ts
  2. 1
      ui-ngx/src/app/modules/home/components/calculated-fields/components/entity-aggregation-configuration/entity-aggregation-component.component.html
  3. 4
      ui-ngx/src/app/modules/home/components/calculated-fields/components/entity-aggregation-configuration/entity-aggregation-component.component.ts

5
ui-ngx/src/app/core/services/calculated-field-form.service.ts

@ -25,11 +25,11 @@ import {
CalculatedFieldType,
OutputStrategyType
} from '@shared/models/calculated-field.models';
import { oneSpaceInsideRegex } from '@shared/models/regex.constants';
import { isDefined } from '@core/utils';
import { CalculatedFieldsService } from '@core/http/calculated-fields.service';
import { CalculatedFieldsTableEntity } from '@home/components/calculated-fields/calculated-fields-table-config';
import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
import { getTimezoneInfo } from '@shared/models/time/time.models';
@Injectable({ providedIn: 'root' })
export class CalculatedFieldFormService {
@ -86,6 +86,9 @@ export class CalculatedFieldFormService {
if (isDefined(config?.output) && !config?.output?.strategy) {
config.output.strategy = { type: OutputStrategyType.RULE_CHAIN };
}
if (config.type === CalculatedFieldType.ENTITY_AGGREGATION && config.interval) {
config.interval.tz = getTimezoneInfo(config.interval.tz, undefined, true)?.id;
}
}
return config;
}

1
ui-ngx/src/app/modules/home/components/calculated-fields/components/entity-aggregation-configuration/entity-aggregation-component.component.html

@ -58,7 +58,6 @@
appearance="outline"
subscriptSizing="dynamic"
required
userTimezoneByDefault
formControlName="tz">
</tb-timezone-select>
</div>

4
ui-ngx/src/app/modules/home/components/calculated-fields/components/entity-aggregation-configuration/entity-aggregation-component.component.ts

@ -37,7 +37,7 @@ import {
} from '@shared/models/calculated-field.models';
import { filter, map } from 'rxjs/operators';
import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
import { AVG_MONTH, AVG_QUARTER, DAY, HOUR, MINUTE, SECOND, WEEK, YEAR } from '@shared/models/time/time.models';
import { AVG_MONTH, AVG_QUARTER, DAY, getDefaultTimezone, HOUR, MINUTE, SECOND, WEEK, YEAR } from '@shared/models/time/time.models';
import { deepClone, isDefinedAndNotNull } from '@core/utils';
import { getCurrentAuthState } from '@core/auth/auth.selectors';
import { Store } from '@ngrx/store';
@ -99,7 +99,7 @@ export class EntityAggregationComponentComponent implements ControlValueAccessor
metrics: this.fb.control({}, notEmptyObjectValidator()),
interval: this.fb.group({
type: [AggIntervalType.HOUR],
tz: ['', Validators.required],
tz: [getDefaultTimezone(), Validators.required],
durationSec: [this.minAllowedAggregationIntervalInSecForCF, Validators.required],
allowOffsetSec: [false],
offsetSec: [this.minAllowedAggregationIntervalInSecForCF > 60 ? MINUTE / SECOND : 1, Validators.required],

Loading…
Cancel
Save