From 39fdb4b503fddbdcb26e2f871545570c5c5ba84f Mon Sep 17 00:00:00 2001 From: Isaac Hill <71404865+isaachilly@users.noreply.github.com> Date: Wed, 3 Dec 2025 15:04:38 +0100 Subject: [PATCH 1/2] [O2B-1507] Show 'Created At' column again The 'Created At' column in environmentsActiveColumns is now visible again. Affected tests have been updated. --- .../ActiveColumns/environmentsActiveColumns.js | 2 +- test/public/envs/overview.test.js | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/lib/public/views/Environments/ActiveColumns/environmentsActiveColumns.js b/lib/public/views/Environments/ActiveColumns/environmentsActiveColumns.js index c570931869..9c6b6653b8 100644 --- a/lib/public/views/Environments/ActiveColumns/environmentsActiveColumns.js +++ b/lib/public/views/Environments/ActiveColumns/environmentsActiveColumns.js @@ -71,7 +71,7 @@ export const environmentsActiveColumns = { }, createdAt: { name: 'Created At', - visible: false, + visible: true, sortable: false, size: 'w-10', format: (timestamp) => formatTimestamp(timestamp, false), diff --git a/test/public/envs/overview.test.js b/test/public/envs/overview.test.js index ae673ef4e0..770a9722cc 100644 --- a/test/public/envs/overview.test.js +++ b/test/public/envs/overview.test.js @@ -84,7 +84,7 @@ module.exports = () => { it('Should have balloon on runs column', async () => { await checkColumnBalloon(page, 1, 2); - await checkColumnBalloon(page, 1, 5); + await checkColumnBalloon(page, 1, 6); }); it('Should have correct status color in the overview page', async () => { @@ -132,11 +132,11 @@ module.exports = () => { }; - await checkEnvironmentStatusColor(1, 3); - await checkEnvironmentStatusColor(2, 3); - await checkEnvironmentStatusColor(3, 3); - await checkEnvironmentStatusColor(6, 3); - await checkEnvironmentStatusColor(9, 3); + await checkEnvironmentStatusColor(1, 4); + await checkEnvironmentStatusColor(2, 4); + await checkEnvironmentStatusColor(3, 4); + await checkEnvironmentStatusColor(6, 4); + await checkEnvironmentStatusColor(9, 4); }); it('can set how many environments are available per page', async () => { From 1e24b903c62f454509500644f831c995a9e4b6e4 Mon Sep 17 00:00:00 2001 From: Isaac Hill <71404865+isaachilly@users.noreply.github.com> Date: Wed, 3 Dec 2025 15:11:06 +0100 Subject: [PATCH 2/2] [O2B-1507] Add createdAt date range filter to environments Introduces a time range filter for the 'createdAt' column in the environments overview page. Adds test to verify filtering by createdAt date range behaves correctly. --- .../environmentsActiveColumns.js | 9 ++++ .../Overview/EnvironmentOverviewModel.js | 2 + test/public/envs/overview.test.js | 52 +++++++++++++++++++ 3 files changed, 63 insertions(+) diff --git a/lib/public/views/Environments/ActiveColumns/environmentsActiveColumns.js b/lib/public/views/Environments/ActiveColumns/environmentsActiveColumns.js index 9c6b6653b8..112f3fe364 100644 --- a/lib/public/views/Environments/ActiveColumns/environmentsActiveColumns.js +++ b/lib/public/views/Environments/ActiveColumns/environmentsActiveColumns.js @@ -24,6 +24,7 @@ import { environmentStatusHistoryLegendComponent } from '../../../components/env import { infoTooltip } from '../../../components/common/popover/infoTooltip.js'; import { aliEcsEnvironmentLinkComponent } from '../../../components/common/externalLinks/aliEcsEnvironmentLinkComponent.js'; import { StatusAcronym } from '../../../domain/enums/statusAcronym.mjs'; +import { timeRangeFilter } from '../../../components/Filters/common/filters/timeRangeFilter.js'; /** * List of active columns for a generic Environments component @@ -75,6 +76,14 @@ export const environmentsActiveColumns = { sortable: false, size: 'w-10', format: (timestamp) => formatTimestamp(timestamp, false), + + /** + * CreatedAt filter component + * + * @param {EnvironmentOverviewModel} environmentOverviewModel the environment overview model + * @return {Component} the filter component + */ + filter: (environmentOverviewModel) => timeRangeFilter(environmentOverviewModel.filteringModel.get('created')), }, status: { name: 'Current Status', diff --git a/lib/public/views/Environments/Overview/EnvironmentOverviewModel.js b/lib/public/views/Environments/Overview/EnvironmentOverviewModel.js index 1d701b4a27..065e7318d0 100644 --- a/lib/public/views/Environments/Overview/EnvironmentOverviewModel.js +++ b/lib/public/views/Environments/Overview/EnvironmentOverviewModel.js @@ -14,6 +14,7 @@ import { buildUrl } from '/js/src/index.js'; import { FilteringModel } from '../../../components/Filters/common/FilteringModel.js'; import { OverviewPageModel } from '../../../models/OverviewModel.js'; +import { TimeRangeInputModel } from '../../../components/Filters/common/filters/TimeRangeInputModel.js'; import { debounce } from '../../../utilities/debounce.js'; /** @@ -28,6 +29,7 @@ export class EnvironmentOverviewModel extends OverviewPageModel { super(); this._filteringModel = new FilteringModel({ + created: new TimeRangeInputModel(), }); this._filteringModel.observe(() => this._applyFilters(true)); diff --git a/test/public/envs/overview.test.js b/test/public/envs/overview.test.js index 770a9722cc..6d8fb1bed2 100644 --- a/test/public/envs/overview.test.js +++ b/test/public/envs/overview.test.js @@ -26,6 +26,9 @@ const { getPopoverSelector, goToPage, openFilteringPanel, + fillInput, + getPeriodInputsSelectors, + resetFilters, } = require('../defaults.js'); const dateAndTime = require('date-and-time'); const { resetDatabaseContent } = require('../../utilities/resetDatabaseContent.js'); @@ -290,4 +293,53 @@ module.exports = () => { await openFilteringPanel(page); await page.waitForSelector(filterPanelSelector, { visible: true }); }); + + it('should successfully filter environments by their createdAt date', async () => { + /** + * This is the sequence to test filtering the environments based on their createdAt date + * + * @param {string} selector the filter input selector + * @param {string} fromDate the from date string + * @param {string} fromTime the from time string + * @param {string} toDate the to date string + * @param {string} toTime the to time string + * @param {string[]} expectedIds the list of expected environment IDs after filtering + * @return {void} + */ + const filterOnCreatedAt = async (selector, fromDate, fromTime, toDate, toTime, expectedIds) => { + await fillInput(page, selector.fromTimeSelector, fromTime, ['change']); + await fillInput(page, selector.toTimeSelector, toTime, ['change']); + + await fillInput(page, selector.fromDateSelector, fromDate, ['change']); + await fillInput(page, selector.toDateSelector, toDate, ['change']); + + await waitForTableLength(page, expectedIds.length); + expect(await page.$$eval('tbody tr', (rows) => rows.map((row) => row.id))).to.eql(expectedIds.map(id => `row${id}`)); + }; + + await openFilteringPanel(page); + + const createdAtPopoverSelector = await getPopoverSelector(await page.$('.createdAt-filter .popover-trigger')); + const periodInputsSelectors = getPeriodInputsSelectors(createdAtPopoverSelector); + + await filterOnCreatedAt( + periodInputsSelectors, + '2019-05-08', + '00:00', + '2019-05-10', + '00:00', + ['eZF99lH6'], + ); + await resetFilters(page); + + await filterOnCreatedAt( + periodInputsSelectors, + '2019-08-09', + '00:00', + '2019-08-09', + '14:00', + ['GIDO1jdkD', '8E4aZTjY', 'Dxi029djX'], + ); + await resetFilters(page); + }); };