-
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
base: master
Are you sure you want to change the base?
Conversation
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.
// 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) => |
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.
nitpick: 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.
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]); |
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.
issue: Debugging console.log statements should be removed before merging.
Please remove these console.log statements or use a proper logging mechanism if necessary.
Description
This PR removes the custom function to extract the run number from the scientific metadata, but uses the high level field.
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: