Skip to content

[O2B-1534] Migrate log overview to use filtering model pattern#2083

Open
NarrowsProjects wants to merge 58 commits intomainfrom
improv/O2B-1534/Migrate-Log-Overview-to-use-FilteringModel-pattern
Open

[O2B-1534] Migrate log overview to use filtering model pattern#2083
NarrowsProjects wants to merge 58 commits intomainfrom
improv/O2B-1534/Migrate-Log-Overview-to-use-FilteringModel-pattern

Conversation

@NarrowsProjects
Copy link
Copy Markdown
Collaborator

@NarrowsProjects NarrowsProjects commented Feb 20, 2026

I have a JIRA ticket

  • branch and/or PR name(s) include(s) JIRA ID
  • issue has "Fix version" assigned
  • issue "Status" is set to "In review"
  • PR labels are selected

Notable changes for users:

  • Individual from-to selectors on the logs page have been replaced with a single field that will open the standard time range selector
  • All open-input forms apply their filters when focus is lost on them.

Notable changes for developers:

  • All filters have been moved to a filteringModel in logsOverviewModel
  • The filters for runs, lhcfills and environments have been renamed under the hood to match getAllRunsUseCase:
    • runs => runNumbers
    • lhcFills => fillNumbers
    • environments => environmentIds

Changes made to the database:

  • none

@NarrowsProjects NarrowsProjects self-assigned this Feb 20, 2026
@NarrowsProjects NarrowsProjects added frontend javascript Pull requests that update Javascript code labels Feb 20, 2026
@NarrowsProjects NarrowsProjects marked this pull request as draft February 20, 2026 11:53
@codecov
Copy link
Copy Markdown

codecov bot commented Feb 20, 2026

Codecov Report

❌ Patch coverage is 34.78261% with 30 lines in your changes missing coverage. Please review.
✅ Project coverage is 45.76%. Comparing base (47203c7) to head (c768ba5).

Files with missing lines Patch % Lines
...ib/public/views/Logs/Overview/LogsOverviewModel.js 0.00% 11 Missing ⚠️
...blic/views/Logs/ActiveColumns/logsActiveColumns.js 0.00% 8 Missing ⚠️
...nts/Filters/LogsFilter/author/AuthorFilterModel.js 0.00% 6 Missing ⚠️
...mponents/Filters/LogsFilter/author/authorFilter.js 0.00% 3 Missing ⚠️
...ic/components/Filters/common/filters/textFilter.js 0.00% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2083      +/-   ##
==========================================
+ Coverage   43.78%   45.76%   +1.97%     
==========================================
  Files        1044     1042       -2     
  Lines       17353    17213     -140     
  Branches     3149     3119      -30     
==========================================
+ Hits         7598     7877     +279     
+ Misses       9755     9336     -419     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@NarrowsProjects NarrowsProjects force-pushed the improv/O2B-1534/Migrate-Log-Overview-to-use-FilteringModel-pattern branch from 07567e2 to 114285d Compare February 20, 2026 12:02
@NarrowsProjects NarrowsProjects force-pushed the improv/O2B-1534/Migrate-Log-Overview-to-use-FilteringModel-pattern branch from a936a03 to 5500b3e Compare February 20, 2026 16:24
@NarrowsProjects NarrowsProjects marked this pull request as ready for review February 21, 2026 18:22
@NarrowsProjects NarrowsProjects force-pushed the improv/O2B-1534/Migrate-Log-Overview-to-use-FilteringModel-pattern branch from 3cd62d0 to 370c475 Compare April 13, 2026 13:19
Comment thread lib/usecases/log/GetAllLogsUseCase.js Outdated
Comment thread test/public/logs/overview.test.js Outdated
Comment thread test/public/logs/overview.test.js Outdated
Comment thread test/public/logs/overview.test.js Outdated
Comment thread test/public/logs/overview.test.js Outdated
Comment thread lib/public/views/Logs/ActiveColumns/logsActiveColumns.js Outdated
Comment thread test/api/logs.test.js
Comment thread lib/public/components/Filters/LogsFilter/author/authorFilter.js Outdated
* @param {FilteringModel} logOverviewModel.filteringModel filtering model
* @return {Component} the filter component
*/
filter: ({ filteringModel }) => rawTextFilter(
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What about re-using the runNumbersFilter in this case?

Copy link
Copy Markdown
Collaborator Author

@NarrowsProjects NarrowsProjects Apr 16, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't see much use in making or using individual components for each filter that uses rawTextFilter that are virtually Identical.

What I do think is a good idea now that you mention it is to make a new component that would cover most of these usecases and change it for special cases such as authorFilter. Something like

export const textInputFilter =
    (filteringModel, identifier, placeholder) => rawTextFilter(filteringModel.get(identifier), { classes: ['w-100', identifier], placeholder });

Which would then shorten these filter creations to:

filter: ({ filteringModel }) => textInputFilter(filteringModel, 'runNumbers', 'e.g. 553203, 553221, ...'),

* @return {Component} the filter component
*/
filter: ({ filteringModel }) => rawTextFilter(
filteringModel.get('environmentIds'),
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Similar question, I see that runsActiveColumns also has the environmentIds as rawtextFilter
Could we perhaps extract as a reusable component similar to runNumbersFilter?

Copy link
Copy Markdown
Collaborator Author

@NarrowsProjects NarrowsProjects Apr 16, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As above

* @param {FilteringModel} logOverviewModel.filteringModel filtering model
* @return {Component} the filter component
*/
filter: ({ filteringModel }) => rawTextFilter(
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here

Copy link
Copy Markdown
Collaborator Author

@NarrowsProjects NarrowsProjects Apr 16, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As above

}

if (filter.run?.values?.length > 0) {
if (runNumbers) {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we not still check if array is not empty?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

From what I can remember, there is no way for runNumber to arrive here as an empty array.
The joy DTO requires it to be a string of numbers, and an empty string will be rejected

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've done some manual tests, and I can't find a way to reach that line as an empty array

}

if (filter.lhcFills?.values?.length > 0) {
if (fillNumbers) {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we not still check if array is not empty?
We could define on L54 as fillNumbers = [] and straight away check length perhaps?

Copy link
Copy Markdown
Collaborator Author

@NarrowsProjects NarrowsProjects Apr 16, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As above


if (filter.environments?.values?.length > 0) {
const validEnvironments = await EnvironmentRepository.findAll({ where: { id: { [Op.in]: filter.environments.values } } });
if (environmentIds) {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here

Copy link
Copy Markdown
Collaborator Author

@NarrowsProjects NarrowsProjects Apr 16, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As above

values: CustomJoi.stringArray().items(EntityIdDto).single().required(),
operation: Joi.string().valid('and', 'or').required(),
});
const RunFilterDto = CustomJoi.stringArray().items(EntityIdDto).single();
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see these RunFilter, Environment, LHC being used across DTOs with different matching criterias.
What about extracting this in its own DTO and reuse across DTOs?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will have a look to see if they can be standardised

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

frontend javascript Pull requests that update Javascript code

Development

Successfully merging this pull request may close these issues.

3 participants