Skip to content

fix(ui): restore Account column hyperlink routing in list views (#13639)#13642

Open
Chinmay048 wants to merge 3 commits into
apache:mainfrom
Chinmay048:fix-13639-account-hyperlink
Open

fix(ui): restore Account column hyperlink routing in list views (#13639)#13642
Chinmay048 wants to merge 3 commits into
apache:mainfrom
Chinmay048:fix-13639-account-hyperlink

Conversation

@Chinmay048

Copy link
Copy Markdown

Fixes #13639

Root Cause:
The block in ListView.vue contained an overly specific conditional check for /quotasummary that fell back to rendering a plain, unclickable for all other views, breaking general account hyperlink routing across tables.

Solution:
Added an explicit v-else-if routing check for /account to restore navigation for administrators and domain admins in non-Quota views, aligning with the existing record.owner routing architecture.

How Has This Been Tested?
Verified locally in cloud workspace:

npm run lint — 0 AST/formatting errors.

npm run test:unit — 4 test suites passed, 175 total tests passed cleanly.

Copilot AI review requested due to automatic review settings July 17, 2026 10:43

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Restores the Account column’s router-link behavior in ListView table cells by preventing non-Quota list views from falling back to an unclickable <span> for administrators/domain admins.

Changes:

  • Adds an explicit /account route link for non-User roles when rendering the account column outside of QuotaSummary.
  • Keeps the existing QuotaSummary-specific routing to ${$route.path}/${record.accountid} when the target route exists.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread ui/src/components/view/ListView.vue Outdated
Comment on lines 708 to 712
<router-link
v-else-if="$store.getters.userInfo.roletype !== 'User'"
:to="{ path: '/account', query: { name: text, domainid: record.domainid, dataView: true } }"
>{{ (record.projectname || record.account).concat(' (').concat($t('label.project')).concat(')') }}</router-link>
<span v-else>{{ text }}</span>
@weizhouapache

Copy link
Copy Markdown
Member

thanks @Chinmay048

@winterhazel could you review ?
this seems to be related by #13449

@weizhouapache weizhouapache added this to the 4.23.0 milestone Jul 17, 2026
@codecov

codecov Bot commented Jul 17, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 19.64%. Comparing base (75748a5) to head (5f29065).

Additional details and impacted files
@@             Coverage Diff              @@
##               main   #13642      +/-   ##
============================================
- Coverage     19.65%   19.64%   -0.01%     
+ Complexity    19792    19788       -4     
============================================
  Files          6368     6368              
  Lines        575107   575107              
  Branches      70370    70370              
============================================
- Hits         113016   112995      -21     
- Misses       449808   449826      +18     
- Partials      12283    12286       +3     
Flag Coverage Δ
uitests 3.41% <ø> (ø)
unittests 20.92% <ø> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@weizhouapache

Copy link
Copy Markdown
Member

@blueorangutan packge

@winterhazel

Copy link
Copy Markdown
Member

@blueorangutan ui

@blueorangutan

Copy link
Copy Markdown

@winterhazel a Jenkins job has been kicked to build UI QA env. I'll keep you posted as I make progress.

@blueorangutan

Copy link
Copy Markdown

UI build: ✔️
Live QA URL: https://qa.cloudstack.cloud/simulator/pr/13642 (QA-JID-962)

@winterhazel winterhazel left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Chinmay048 to restore the previous behavior, I would change the block that begins with <template v-if="text"> (line 693 in your commit) to:

        <template v-if="text">
          <template v-if="!text.startsWith('PrjAcct-')">
            <router-link
              v-if="$route.path.startsWith('/quotasummary')"
              :to="{ path: `${$route.path}/${record.accountid}` }">{{ text }}</router-link>
            <router-link v-else-if="record.accountid" :to="{ path: '/account/' + record.accountid }">{{ text }}</router-link>
            <router-link
              v-else-if="$store.getters.userInfo.roletype !== 'User'"
              :to="{ path: '/account', query: { name: record.account, domainid: record.domainid, dataView: true } }">
              {{ text }}
            </router-link>
            <span v-else>{{ text }}</span>
          </template>
          <template v-else-if="$route.path.startsWith('/quotasummary')">
            <router-link :to="{ path: `${$route.path}/${record.accountid}` }">
              {{ (record.projectname || record.account).concat(' (').concat($t('label.project')).concat(')') }}
            </router-link>
          </template>
        </template>

The difference is that, previously, records belonging to a project that for some reason include the account field, with the project's account, in their response did not render anything in the Account column. The way ListView.vue is now allows it to render.

Copilot AI review requested due to automatic review settings July 17, 2026 15:11
@Chinmay048

Copy link
Copy Markdown
Author

Hi @winterhazel, thank you for the review! I have updated ListView.vue to use the suggested v-else-if template hierarchy for the Account column to ensure clean routing without breaking project payload rendering.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated 3 comments.

</template>

<template v-if="column.key === 'clustername'">
<template v-if="column.key === 'clustername'">

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Chinmay048 could you remove this indentation change from the PR?

Comment on lines +695 to 703
v-if="$route.path.startsWith('/quotasummary')"
:to="{ path: `${$route.path}/${record.accountid}` }">{{ text }}</router-link>
<span v-else>{{ text }}</span>
</template>
<template v-else>
<router-link v-else-if="record.accountid" :to="{ path: '/account/' + record.accountid }">{{ text }}</router-link>
<router-link
v-if="$route.path.startsWith('/quotasummary') && $router.resolve(`${$route.path}/${record.accountid}`).matched[0].redirect !== '/exception/404'"
:to="{ path: `${$route.path}/${record.accountid}` }">{{ (record.projectname || record.account).concat(' (').concat($t('label.project')).concat(')') }}</router-link>
v-else-if="$store.getters.userInfo.roletype !== 'User'"
:to="{ path: '/account', query: { name: record.account, domainid: record.domainid, dataView: true } }">
{{ text }}
</router-link>
<span v-else>{{ text }}</span>
Comment on lines +705 to +709
<template v-else-if="$route.path.startsWith('/quotasummary')">
<router-link :to="{ path: `${$route.path}/${record.accountid}` }">
{{ (record.projectname || record.account).concat(' (').concat($t('label.project')).concat(')') }}
</router-link>
</template>
</template>

<template v-if="column.key === 'clustername'">
<template v-if="column.key === 'clustername'">

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Chinmay048 could you remove this indentation change from the PR?

Comment thread ui/src/components/view/ListView.vue Outdated
</template>
</template>
<template v-if="text">
<template v-else-if="text">

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is changing the original behavior. Use just v-if instead.

Copilot AI review requested due to automatic review settings July 18, 2026 05:21
@Chinmay048

Copy link
Copy Markdown
Author

@winterhazel,

I have pushed an updated commit that completely reverts the accidental whitespace/indentation change on the clustername block and restores v-if="text" on the Account column to preserve the original rendering behavior. Thank you for catching that!

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated no new comments.

Comments suppressed due to low confidence (2)

ui/src/components/view/ListView.vue:658

  • The <template v-if="column.key === 'clustername'"> line lost its indentation relative to the surrounding bodyCell templates, making this block inconsistent and harder to read. Please restore the previous indentation level.
<template v-if="column.key === 'clustername'">

ui/src/components/view/ListView.vue:697

  • This account link is currently rendered for any role when record.accountid is present. Elsewhere in this same account cell (e.g. the record.owner block), account navigation is restricted to non-User roles; regular users shouldn’t get a clickable account link here either.
            <router-link v-else-if="record.accountid" :to="{ path: '/account/' + record.accountid }">{{ text }}</router-link>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[4.23] UI: the hyperlink for Account does not work

5 participants