Skip to content
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

Merged
merged 1 commit into from
Feb 24, 2025

Conversation

fit2bot
Copy link
Contributor

@fit2bot fit2bot commented Feb 24, 2025

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.

…auses the asset name in the asset details to display as Object.
@fit2bot fit2bot requested a review from a team February 24, 2025 10:32
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}`
Copy link
Member

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'
Copy link
Member

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:

  1. Remove @ before import statements to separate imports from other lines.
  2. 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}

@ZhaoJiSen ZhaoJiSen merged commit ace6058 into dev Feb 24, 2025
5 of 6 checks passed
@ZhaoJiSen ZhaoJiSen deleted the pr@dev@fixed_account_detail branch February 24, 2025 10:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants