-
Notifications
You must be signed in to change notification settings - Fork 113
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
Fixed: Fix the issue where clicking on an asset in the account list causes the asset name in the asset details to display as Object. #4670
Conversation
…auses the asset name in the asset details to display as Object.
col: this.col, | ||
row: this.row, | ||
cellValue: this.cellValue | ||
}) | ||
} | ||
let title = this.cellValue || this.row.name | ||
let title = this.cellValue?.name || drawerTitle | ||
const resource = this.getResource() | ||
if (resource) { | ||
title = `${resource}: ${title}` |
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.
The code contains one typo which is details
instead of 'details'
. The function to set the title should be defined inside the method that handles getting the title based on formatter arguments, not as a separate function:
if (this.formatterArgs?.getTitle && typeof this.formatterArgs.getTitle === 'function') {
this.setDrawerTitle();
}
// SetDrawerTitle logic here
return { title };
Please review these updates before proceeding with any changes.
@@ -11,9 +11,6 @@ export default { | |||
}, | |||
data() { | |||
return { | |||
drawerTitle: '', | |||
showTableUpdateDrawer: false, | |||
currentTemplate: null, | |||
config: { | |||
url: '/api/v1/assets/assets/', | |||
category: 'all' |
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.
There are no significant deviations from this code snippet. It appears to be well-formed and follows basic object-oriented programming principles in Vue.js.
However, there may be some stylistic refinements that could potentially make it more maintainable over time if needed:
- Remove
@
before import statements to separate imports from other lines. - Add semicolons at the ends of functions, blocks, or methods where they're not already present (S suggests keeping them for better readability.)
Here's a slightly revised version with those suggestions:
export default {
...
};
/**
* Function name should always end with a closing parenthesis
*/
function myFunction(){
//...code goes here...
}
if (!/\w+$/.test(myFunction())){ //check for function syntax errors}
|
Fixed: Fix the issue where clicking on an asset in the account list causes the asset name in the asset details to display as Object.