-
Notifications
You must be signed in to change notification settings - Fork 14
[OGUI-1852] Open Bookkeeping from RunNumber ObjectInfoPanel #3272
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
Open
AlexJanson
wants to merge
13
commits into
dev
Choose a base branch
from
feature/QCG/OGUI-1852/open-bookkeeping-from-run-number
base: dev
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.
Open
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
e2aef9a
feat: add new services endpoint for querying services information
AlexJanson d389085
feat: add external link icon to the run number when bookkeeping is co…
AlexJanson ba7882d
fix: update partial run details to proper link structure
AlexJanson ab22f44
fix: bookkeeping service still being present in service config
AlexJanson b018bb6
feat: add external link button for opening runs in bookkeeping if boo…
AlexJanson 814d500
style: fix linting errors
AlexJanson 205d7ce
test: fix failing test due to markup changes
AlexJanson 43755bc
fix: when run number is null show no link to bookkeeping
AlexJanson df406f1
test: fix timing issue introduced with changes
AlexJanson f96fda1
feat: add id to bookkeeping link for easier testing
AlexJanson 1b4ee22
test: add tests for the backend and frontend
AlexJanson 59e9050
Merge branch 'dev' into feature/QCG/OGUI-1852/open-bookkeeping-from-r…
AlexJanson beb4ede
style: add missing semicolon
AlexJanson 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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -147,7 +147,7 @@ | |
| font-weight: 500; | ||
| } | ||
|
|
||
| &>div:hover { | ||
| & > div > div:hover { | ||
| font-weight: 700; | ||
| } | ||
| } | ||
|
|
||
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,81 @@ | ||
| /** | ||
| * @license | ||
| * Copyright 2019-2020 CERN and copyright holders of ALICE O2. | ||
| * See http://alice-o2.web.cern.ch/copyright for details of the copyright holders. | ||
| * All rights not expressly granted are reserved. | ||
| * | ||
| * This software is distributed under the terms of the GNU General Public | ||
| * License v3 (GPL Version 3), copied verbatim in the file "COPYING". | ||
| * | ||
| * 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 { RemoteData } from '/js/src/index.js'; | ||
|
|
||
| /** | ||
| * @typedef {object} ServicePayload | ||
| * @property {object} [bookkeeping] - Configuration for the Bookkeeping service. | ||
| * @property {string} bookkeeping.BASE_URL - The root URL of the Bookkeeping application. | ||
| * @property {string} bookkeeping.PARTIAL_RUN_DETAILS - The URL path/query parameters for run details. | ||
| */ | ||
|
|
||
| export default class StatusService { | ||
| /** | ||
| * Initialize service | ||
| * @param {Model} model - root model of the application | ||
| */ | ||
| constructor(model) { | ||
| this.model = model; | ||
| this.loader = model.loader; | ||
|
|
||
| /** | ||
| * @type {RemoteData<ServicePayload>} | ||
| */ | ||
| this.serviceConfig = RemoteData.notAsked(); | ||
|
|
||
| this.initStatusService(); | ||
| } | ||
|
|
||
| /** | ||
| * Fetches service configurations from the backend and updates the internal state. | ||
| * Notifies the model once the request completes (success or failure). | ||
| * @returns {Promise<void>} | ||
| */ | ||
| async initStatusService() { | ||
| const { result, ok } = await this.loader.get('api/services'); | ||
| if (ok) { | ||
| this.serviceConfig = RemoteData.success(result || {}); | ||
| } else { | ||
| this.serviceConfig = RemoteData.failure('Error retrieving services'); | ||
| } | ||
|
|
||
| this.model.notify(); | ||
| } | ||
|
|
||
| /** | ||
| * Checks if a specific service configuration is successfully loaded and available. | ||
| * @param {string} service - The name of the service to check (e.g. 'bookkeeping'). | ||
| * @returns {boolean} - True if the service key exists in a successful payload. | ||
| */ | ||
| isConfigured(service) { | ||
| return this.serviceConfig.match({ | ||
| Success: (config) => Object.hasOwn(config, service), | ||
| Other: () => false, | ||
| }); | ||
| } | ||
|
|
||
| /** | ||
| * Constructs a full URL for the bookkeeping run details page. | ||
| * @param {string|number} runNumber - The specific run identifier to append to the URL. | ||
| * @returns {string|undefined} The formatted URL, or `undefined` if the service is not configured. | ||
| */ | ||
| buildBookkeepingUrl(runNumber) { | ||
| if (!this.isConfigured('bookkeeping')) { | ||
| return; | ||
| } | ||
| const { BASE_URL, PARTIAL_RUN_DETAILS } = this.serviceConfig.payload.bookkeeping; | ||
| return `${BASE_URL}/${PARTIAL_RUN_DETAILS}${runNumber}`; | ||
| } | ||
| } |
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
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.
Check notice
Code scanning / CodeQL
Semicolon insertion Note test
Copilot Autofix
AI 1 day ago
To fix this, we should explicitly terminate the
await testParent.test(...)statement that ends around line 241 with a semicolon. This means adding a;immediately after the closing)line so that the call is clearly a complete statement before the nextawait testParent.test(...)call begins. No imports, methods, or additional definitions are needed—this is a simple syntactic/style correction.Concretely, in
QualityControl/test/public/pages/object-tree.test.js, locate theawait testParent.test(block starting at line 225 ('should have an external link to bookkeeping inline with the run number row') and ending at line 241. Change the final line of that call from)to);. This preserves all existing functionality while eliminating reliance on automatic semicolon insertion.