-
Notifications
You must be signed in to change notification settings - Fork 21
[O2B-643] Run duration accept format HH:MM:SS #1464
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Draft
xsalonx
wants to merge
56
commits into
main
Choose a base branch
from
xsalonx/misc/O2B-643/run-duration-should-accept-format
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from 34 commits
Commits
Show all changes
56 commits
Select commit
Hold shift + click to select a range
355ddac
works
xsalonx 9702196
works
xsalonx 4b87ce8
refactor
xsalonx d436308
add model
xsalonx eda937b
nEPS filter works
xsalonx 8c18794
filters work
xsalonx 15b5dac
filter works
xsalonx c3b2f86
pol
xsalonx e9e7420
pol
xsalonx 5e98f04
linter
xsalonx 3cbb87f
add default
xsalonx 1a61b69
docs
xsalonx 2d1731a
conf min max
xsalonx 2475d19
docs
xsalonx b37573a
value
xsalonx 78950b5
change default
xsalonx 7f03dff
test WIP
xsalonx 58d31e5
Test
xsalonx 191d434
Merge branch 'main' into xsalonx/misc/O2B-643/run-duration-should-acc…
xsalonx fbdefc0
Merge branch 'main' into xsalonx/misc/O2B-643/run-duration-should-acc…
xsalonx 3661588
remove override
xsalonx a06640d
refactor
xsalonx 21c1cf4
use SelectionMode
xsalonx 0ab6860
rename
xsalonx 144317c
rename
xsalonx 40b70e2
bug
xsalonx 68a01d7
simp
xsalonx ff0da59
cherry-picked
xsalonx 7d57685
cherry -pick
xsalonx 71cb30d
rm
xsalonx 14fc5a8
cleanup
xsalonx 6dda2bc
cl
xsalonx e639db8
revoke
xsalonx 1d5e0c7
remove
xsalonx cd9d679
ref
xsalonx c4c9fc7
ch
xsalonx b59e0d2
add model
xsalonx a4933f2
ref WIP
xsalonx 5d6c941
ref
xsalonx fe67005
fix
xsalonx f165e23
fix
xsalonx 52e7bf6
merge main
xsalonx 318d0a5
cleanup
xsalonx 7d05396
test WIP
xsalonx a4843f3
merge main
xsalonx 6b013dd
fix
xsalonx c353f54
fix
xsalonx 73425be
fix
xsalonx c4c70dd
Merge branch 'main' into xsalonx/misc/O2B-643/run-duration-should-acc…
xsalonx 2507a4a
simp
xsalonx e6763c6
merge main
xsalonx a908084
Merge branch 'main' into xsalonx/misc/O2B-643/run-duration-should-acc…
xsalonx bf412c4
add method
xsalonx 2ea7b4a
merge main
xsalonx 76905be
Merge branch 'main' into xsalonx/misc/O2B-643/run-duration-should-acc…
xsalonx eb7ae9f
merg main
xsalonx File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
32 changes: 32 additions & 0 deletions
32
lib/public/components/Filters/common/filters/ComparisonOperatorSelectionModel.js
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,32 @@ | ||
| /** | ||
| * @license | ||
| * Copyright CERN and copyright holders of ALICE O2. This software is | ||
| * distributed under the terms of the GNU General Public License v3 (GPL | ||
| * Version 3), copied verbatim in the file "COPYING". | ||
| * | ||
| * See http://alice-o2.web.cern.ch/license for full licensing information. | ||
| * | ||
| * In applying this license CERN does not waive the privileges and immunities | ||
| * granted to it by virtue of its status as an Intergovernmental Organization | ||
| * or submit itself to any jurisdiction. | ||
| */ | ||
|
|
||
| import { SelectionModel } from '../../../common/selection/SelectionModel.js'; | ||
|
|
||
| /** | ||
| * Model storing state of a selection of predefined comparison operators | ||
| */ | ||
| export class ComparisonOperatorSelectionModel extends SelectionModel { | ||
| /** | ||
| * Constructor | ||
| * @param {string} [defaultOperator = '='] one of ['<', '<=', '=', '>=', '>'] operators | ||
| */ | ||
| constructor(defaultOperator = '=') { | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If you don't override this parameter anywhere, simply don't add it |
||
| super({ | ||
| availableOptions: ['<', '<=', '=', '>=', '>'].map((operator) => ({ value: operator })), | ||
| multiple: false, | ||
| allowEmpty: false, | ||
| defaultSelection: [{ value: defaultOperator }], | ||
| }); | ||
| } | ||
| } | ||
98 changes: 98 additions & 0 deletions
98
lib/public/components/common/form/inputs/DurationInputModel.js
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,98 @@ | ||
| /** | ||
| * @license | ||
| * Copyright CERN and copyright holders of ALICE O2. This software is | ||
| * distributed under the terms of the GNU General Public License v3 (GPL | ||
| * Version 3), copied verbatim in the file "COPYING". | ||
| * | ||
| * See http://alice-o2.web.cern.ch/license for full licensing information. | ||
| * | ||
| * In applying this license CERN does not waive the privileges and immunities | ||
| * granted to it by virtue of its status as an Intergovernmental Organization | ||
| * or submit itself to any jurisdiction. | ||
| */ | ||
|
|
||
| import { Observable } from '/js/src/index.js'; | ||
|
|
||
| /** | ||
| * @typedef DurationInputRawData | ||
| * @property {number} hours the number of hours | ||
| * @property {number} minutes the number of minutes | ||
| * @property {number} seconds the number of seconds | ||
| */ | ||
|
|
||
| /** | ||
| * Store the duration input | ||
| */ | ||
| export class DurationInputModel extends Observable { | ||
| /** | ||
| * Constructor | ||
| */ | ||
| constructor() { | ||
| super(); | ||
|
|
||
| this._raw = { | ||
| hours: null, | ||
| minutes: null, | ||
| seconds: null, | ||
| }; | ||
|
|
||
| /** | ||
| * Timestamp (ms) | ||
| * @type {number|null} | ||
| * @private | ||
| */ | ||
| this._value = null; | ||
| } | ||
|
|
||
| /** | ||
| * Update the inputs raw values | ||
| * @param {DurationInputRawData} raw the input raw values | ||
| * @return {void} | ||
| */ | ||
| update(raw) { | ||
| try { | ||
| this._raw = { ...this._raw, ...raw }; | ||
| this._value = | ||
| (this._raw.hours || 0) * 60 * 60 * 1000 + | ||
| (this._raw.minutes || 0) * 60 * 1000 + | ||
| (this._raw.seconds || 0) * 1000; | ||
|
|
||
| if (this._value === 0) { | ||
martinboulais marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| this.reset(); | ||
| } | ||
| } catch (_) { | ||
| this._value = null; | ||
| } | ||
|
|
||
| this.notify(); | ||
| } | ||
|
|
||
| /** | ||
| * Reset the inputs to its initial state | ||
| * @return {void} | ||
| */ | ||
| reset() { | ||
| this._raw = { | ||
| hours: null, | ||
| minutes: null, | ||
| seconds: null, | ||
| }; | ||
| this._value = null; | ||
| } | ||
|
|
||
| /** | ||
| * Returns the raw input values | ||
| * @return {DurationInputRawData} the raw values | ||
| */ | ||
| get raw() { | ||
| return this._raw; | ||
| } | ||
|
|
||
| /** | ||
| * Returns the current date represented by the inputs (null if no valid value is represented) | ||
| * @return {number|null} the current value | ||
| */ | ||
| get value() { | ||
| return this._value; | ||
| } | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.