Skip to content

Commit 39df769

Browse files
author
NarrowsProjects
committed
feat: create textInputFilter
1 parent c768ba5 commit 39df769

4 files changed

Lines changed: 28 additions & 2 deletions

File tree

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
/**
2+
* @license
3+
* Copyright CERN and copyright holders of ALICE O2. This software is
4+
* distributed under the terms of the GNU General Public License v3 (GPL
5+
* Version 3), copied verbatim in the file "COPYING".
6+
*
7+
* See http://alice-o2.web.cern.ch/license for full licensing information.
8+
*
9+
* In applying this license CERN does not waive the privileges and immunities
10+
* granted to it by virtue of its status as an Intergovernmental Organization
11+
* or submit itself to any jurisdiction.
12+
*/
13+
14+
import { rawTextFilter } from './rawTextFilter.js';
15+
16+
/**
17+
* Standardised component for a rawTextFilter that span the width of their container
18+
*
19+
* @param {FilteringModel} filteringModel the page's filteringModel
20+
* @param {string} key the identifier to serve as css selector and to fetch the correct filter from the filteringModel
21+
* @param {string} placeholder placeholder text for the input element
22+
* @return {Component} the filter
23+
*/
24+
export const textInputFilter = (filteringModel, key, placeholder) =>
25+
rawTextFilter(filteringModel.get(key), { classes: ['w-100', `${key}-filter`], placeholder });

lib/public/views/Runs/Overview/RunsOverviewPage.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ import { table } from '../../../components/common/table/table.js';
2020
import { runNumbersFilter } from '../../../components/Filters/RunsFilter/runNumbersFilter.js';
2121
import { switchInput } from '../../../components/common/form/switchInput.js';
2222
import { exportTriggerAndModal } from '../../../components/common/dataExport/exportTriggerAndModal.js';
23+
import { textInputFilter } from '../../../components/Filters/common/filters/textInputFilter.js';
2324

2425
const TABLEROW_HEIGHT = 59;
2526
// Estimate of the navbar and pagination elements height total; Needs to be updated in case of changes;

lib/public/views/Runs/RunPerDataPass/RunsPerDataPassOverviewPage.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,7 @@ export const RunsPerDataPassOverviewPage = ({
230230
return [
231231
h('.flex-row.justify-between.items-center.g2', [
232232
filtersPanelPopover(perDataPassOverviewModel, activeColumns, { profile: 'runsPerDataPass' }),
233-
h('.pl2#runOverviewFilter', runNumbersFilter(perDataPassOverviewModel.filteringModel.get('runNumbers'))),
233+
h('.pl2#runOverviewFilter', textInputFilter(perDataPassOverviewModel.filteringModel, 'runNumbers', 'e.g. 534454, 534455...')),
234234
h(
235235
'.flex-row.g1.items-center',
236236
h('.flex-row.items-center.g1', [

lib/public/views/Runs/RunsPerSimulationPass/RunsPerSimulationPassOverviewPage.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ export const RunsPerSimulationPassOverviewPage = ({
9494
return [
9595
h('.flex-row.justify-between.items-center.g2', [
9696
filtersPanelPopover(perSimulationPassOverviewModel, activeColumns, { profile: 'runsPerSimulationPass' }),
97-
h('.pl2#runOverviewFilter', runNumbersFilter(perSimulationPassOverviewModel.filteringModel.get('runNumbers'))),
97+
h('.pl2#runOverviewFilter', textInputFilter(perSimulationPassOverviewModel.filteringModel, 'runNumbers', 'e.g. 534454, 534455...')),
9898
h(
9999
'.flex-row.g1.items-center',
100100
breadcrumbs([

0 commit comments

Comments
 (0)