Skip to content

Commit

Permalink
fix(#5770): Revert changes for kpi-alarms-filters component
Browse files Browse the repository at this point in the history
  • Loading branch information
noveo-verokhov committed Jan 27, 2025
1 parent 7b266ea commit 48b3f0a
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,19 +30,14 @@

<script>
import {
DATETIME_INTERVAL_TYPES,
KPI_METRICS_MAX_ALARM_YEAR_INTERVAL_DIFF_IN_YEARS,
METRICS_QUICK_RANGES,
SAMPLINGS,
TIME_UNITS,
} from '@/constants';
import { getDiffBetweenDates, subtractUnitFromDate } from '@/helpers/date/date';
import {
convertDateIntervalToMoment,
convertStartDateIntervalToTimestamp,
convertStopDateIntervalToTimestamp,
} from '@/helpers/date/date-intervals';
import { convertStartDateIntervalToTimestamp, convertStopDateIntervalToTimestamp } from '@/helpers/date/date-intervals';
import { fromSeconds } from '@/helpers/date/duration';
import { formMixin } from '@/mixins/form';
Expand Down Expand Up @@ -87,7 +82,7 @@ export default {
getDateWithMaxIntervalDiff(to) {
return subtractUnitFromDate(
convertDateIntervalToMoment(to, DATETIME_INTERVAL_TYPES.start, undefined, TIME_UNITS.day),
to,
KPI_METRICS_MAX_ALARM_YEAR_INTERVAL_DIFF_IN_YEARS,
TIME_UNITS.year,
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ exports[`kpi-alarms-filters Renders \`kpi-alarms-filters\` with hour sampling 1`
>
<c-quick-date-interval-field-stub
class="mr-4"
min="1354834800"
min="1354921199"
quick-ranges="[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]"
value="[object Object]"
/>
Expand Down Expand Up @@ -38,7 +38,7 @@ exports[`kpi-alarms-filters Renders \`kpi-alarms-filters\` with hour sampling an
>
<c-quick-date-interval-field-stub
class="mr-4"
min="1354834801"
min="1354921199"
quick-ranges="[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]"
value="[object Object]"
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ describe('kpi-alarms-filters', () => {
expect(wrapper).toEmitInput({
...initialQuery,
interval: {
from: nowSubtractYearTimestamp,
from: 1354921199, // We are not using nowSubtractYearTimestamp because `today` interval value is not `now`
to: initialQuery.interval.to,
},
sampling: SAMPLINGS.hour,
Expand Down Expand Up @@ -130,7 +130,7 @@ describe('kpi-alarms-filters', () => {
expect(wrapper).toEmitInput({
...initialQuery,
interval: {
from: nowSubtractYearTimestamp,
from: 1354921199, // We are not using nowSubtractYearTimestamp because `today` interval value is not `now`
to: initialQuery.interval.to,
},
sampling: SAMPLINGS.hour,
Expand Down

0 comments on commit 48b3f0a

Please sign in to comment.