Copilot commented on code in PR #13642:
URL: https://github.com/apache/cloudstack/pull/13642#discussion_r3602502983


##########
ui/src/components/view/ListView.vue:
##########
@@ -695,12 +695,20 @@
             <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}` }">{{ text 
}}</router-link>
+            <router-link
+              v-else-if="$store.getters.userInfo.roletype !== 'User'"
+              :to="{ path: '/account', query: { name: text, domainid: 
record.domainid, dataView: true } }"
+            >{{ text }}</router-link>
             <span v-else>{{ text }}</span>
           </template>
           <template v-else>
             <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>
+            <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>

Review Comment:
   In the project-account branch (`text.startsWith('PrjAcct-')`), the new 
`/account` link renders a friendly label (projectname/account + "(project)") 
but the query still uses `name: text`, and the non-admin fallback still renders 
the raw `text` (typically `PrjAcct-...`). This can lead to inconsistent UI 
(regular users see internal account names) and couples navigation to a 
presentation slot value. Prefer using `record.account` for routing and render 
the same friendly label in the `<span>` fallback.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to