[O2B-1534] Migrate log overview to use filtering model pattern#2083
[O2B-1534] Migrate log overview to use filtering model pattern#2083NarrowsProjects wants to merge 64 commits intomainfrom
Conversation
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #2083 +/- ##
==========================================
+ Coverage 45.50% 45.75% +0.25%
==========================================
Files 1044 1042 -2
Lines 17353 17214 -139
Branches 3149 3120 -29
==========================================
- Hits 7897 7877 -20
+ Misses 9456 9337 -119 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
07567e2 to
114285d
Compare
a936a03 to
5500b3e
Compare
…FilteringModel-pattern
| * @param {FilteringModel} logOverviewModel.filteringModel filtering model | ||
| * @return {Component} the filter component | ||
| */ | ||
| filter: ({ filteringModel }) => rawTextFilter( |
There was a problem hiding this comment.
What about re-using the runNumbersFilter in this case?
There was a problem hiding this comment.
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, key, placeholder) => rawTextFilter(filteringModel.get(key), { classes: ['w-100', `key-${filter}`], 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'), |
There was a problem hiding this comment.
Similar question, I see that runsActiveColumns also has the environmentIds as rawtextFilter
Could we perhaps extract as a reusable component similar to runNumbersFilter?
There was a problem hiding this comment.
As above
| * @param {FilteringModel} logOverviewModel.filteringModel filtering model | ||
| * @return {Component} the filter component | ||
| */ | ||
| filter: ({ filteringModel }) => rawTextFilter( |
There was a problem hiding this comment.
As above
a86e6a6 to
a40f51f
Compare
| import { fillNumberFilter } from '../../../components/Filters/LhcFillsFilter/fillNumberFilter.js'; | ||
| import { durationFilter } from '../../../components/Filters/LhcFillsFilter/durationFilter.js'; | ||
| import { beamTypeFilter } from '../../../components/Filters/LhcFillsFilter/beamTypeFilter.js'; | ||
| import { schemeNameFilter } from '../../../components/Filters/LhcFillsFilter/schemeNameFilter.js'; |
There was a problem hiding this comment.
Should this file not be removed the same as runNumbersFilter? I do not see it being used anywhere else
| import { formatBeamType } from '../../../utilities/formatting/formatBeamType.js'; | ||
| import { frontLink } from '../../../components/common/navigation/frontLink.js'; | ||
| import { toggleStableBeamOnlyFilter } from '../../../components/Filters/LhcFillsFilter/stableBeamFilter.js'; | ||
| import { fillNumberFilter } from '../../../components/Filters/LhcFillsFilter/fillNumberFilter.js'; |
There was a problem hiding this comment.
Should this file not be removed?
| import { iconCommentSquare, iconPaperclip } from '/js/src/icons.js'; | ||
|
|
||
| import { authorFilter } from '../../../components/Filters/LogsFilter/author/authorFilter.js'; | ||
| import createdFilter from '../../../components/Filters/LogsFilter/created.js'; |
|
|
||
| import { authorFilter } from '../../../components/Filters/LogsFilter/author/authorFilter.js'; | ||
| import createdFilter from '../../../components/Filters/LogsFilter/created.js'; | ||
| import runsFilter from '../../../components/Filters/LogsFilter/runs.js'; |
| import { formatRunsList } from '../../Runs/format/formatRunsList.js'; | ||
| import { profiles } from '../../../components/common/table/profiles.js'; | ||
| import { textFilter } from '../../../components/Filters/common/filters/textFilter.js'; | ||
| import { environmentFilter } from '../../../components/Filters/LogsFilter/environments.js'; |
| import { textFilter } from '../../../components/Filters/common/filters/textFilter.js'; | ||
| import { environmentFilter } from '../../../components/Filters/LogsFilter/environments.js'; | ||
| import { formatLhcFillsList } from '../../LhcFills/format/formatLhcFillsList.js'; | ||
| import { lhcFillsFilter } from '../../../components/Filters/LogsFilter/lhcFill.js'; |
I have a JIRA ticket
Notable changes for users:
Notable changes for developers:
filteringModelinlogsOverviewModelChanges made to the database: