-
Notifications
You must be signed in to change notification settings - Fork 34
fix: fixing run number in dataset list #1976
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
Merged
Merged
Conversation
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey there - I've reviewed your changes - here's some feedback:
- There are leftover console.log debug statements in DynamicMatTableComponent—please remove them before merging.
- The old runNumber customRender block is just commented out; consider deleting it or refactoring it into a clear fallback path to keep the codebase clean.
- Subscribing directly to forkJoin for header translations without teardown can lead to memory leaks—consider using the async pipe or unsubscribing in ngOnDestroy.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- There are leftover console.log debug statements in DynamicMatTableComponent—please remove them before merging.
- The old runNumber customRender block is just commented out; consider deleting it or refactoring it into a clear fallback path to keep the codebase clean.
- Subscribing directly to forkJoin for header translations without teardown can lead to memory leaks—consider using the async pipe or unsubscribing in ngOnDestroy.
## Individual Comments
### Comment 1
<location> `src/app/datasets/dataset-table/dataset-table.component.ts:407` </location>
<code_context>
- convertedColumn.toExport = (row) =>
- lodashGet(row, "scientificMetadata.runNumber.value");
- }
+ // if (column.name === "runNumber" && column.type !== "custom") {
+ // // NOTE: This is for the saved columns in the database or the old config.
+ // convertedColumn.customRender = (c, row) =>
+ // lodashGet(row, "scientificMetadata.runNumber.value");
+ // convertedColumn.toExport = (row) =>
+ // lodashGet(row, "scientificMetadata.runNumber.value");
+ // }
</code_context>
<issue_to_address>
Commented-out code for runNumber handling may cause confusion.
Remove deprecated code if no longer needed, or add a comment specifying when and why it should be re-enabled if it's only temporarily disabled.
</issue_to_address>
### Comment 2
<location> `src/app/shared/modules/dynamic-material-table/table/dynamic-mat-table.component.ts:515` </location>
<code_context>
}
columnName(row: any, column: TableField<any>) {
+ console.log("------");
+ console.log(row);
+ console.log(column);
if (column.customRender) {
+ console.log("Custom");
+ console.log(column.customRender(column, row));
return column.customRender(column, row);
}
-
+ console.log("standard");
+ console.log(row[column.name]);
return row[column.name];
}
</code_context>
<issue_to_address>
Debugging console.log statements should be removed before merging.
Please remove these console.log statements or use a proper logging mechanism if necessary.
</issue_to_address>
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
src/app/shared/modules/dynamic-material-table/table/dynamic-mat-table.component.ts
Outdated
Show resolved
Hide resolved
4 tasks
Junjiequan
previously approved these changes
Sep 10, 2025
Junjiequan
requested changes
Sep 30, 2025
emigun
reviewed
Sep 30, 2025
emigun
reviewed
Sep 30, 2025
Junjiequan
approved these changes
Sep 30, 2025
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Description
This PR removes the custom function to extract the run number from the scientific metadata with hard coded key name. It instead uses the dedicated high level field run_number recently added in the dataset schema.
Motivation
We need to show run number high level field by default. A soon to be created PR, will allow to include scientific metadata in the datasets list, so a different run number from scientific metadata will be addressed by the new PR.
Changes:
Please provide a list of the changes implemented by this PR
Tests included
Documentation
official documentation info
If you have updated the official documentation, please provide PR # and URL of the pages where the updates are included
Backend version
Summary by Sourcery
Fix run number display in the dataset list by removing the custom scientific metadata fallback and using the high-level runNumber field, add localization of table headers, and standardize translation namespaces across dataset components.
Bug Fixes:
Enhancements:
Chores: