ui,api: fix api resourcename and user/project event resource (#6315)

For user and project dashborad event resource details were not showing as shown in admin dashboard.
API, UI shows name of the resource as event resourcename. Changed it to displaytext of the resource for consistency

Signed-off-by: Abhishek Kumar <abhishek.kumar@shapeblue.com>
This commit is contained in:
Abhishek Kumar 2022-04-27 08:02:18 +05:30 committed by GitHub
parent e53ed9e350
commit f8920b9312
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 2 deletions

View File

@ -54,7 +54,7 @@ public class EventJoinDaoImpl extends GenericDaoBase<EventJoinVO, Long> implemen
EntityManager entityMgr;
private String getResourceName(Object obj) {
String[] possibleMethods = {"getDisplayName", "getHostName","getName", "getAccountName", "getUsername"};
String[] possibleMethods = {"getDisplayName", "getDisplayText", "getHostName", "getName", "getAccountName", "getUsername"};
for (String possibleMethodName : possibleMethods) {
try {
Method m = obj.getClass().getMethod(possibleMethodName);

View File

@ -86,6 +86,7 @@
:color="getEventColour(event)">
<span :style="{ color: '#999' }"><small>{{ $toLocaleDate(event.created) }}</small></span><br/>
<span :style="{ color: '#666' }"><small><router-link :to="{ path: '/event/' + event.id }">{{ event.type }}</router-link></small></span><br/>
<resource-label :resourceType="event.resourcetype" :resourceId="event.resourceid" :resourceName="event.resourcename" />
<span :style="{ color: '#aaa' }">({{ event.username }}) {{ event.description }}</span>
</a-timeline-item>
</a-timeline>
@ -102,12 +103,14 @@ import store from '@/store'
import ChartCard from '@/components/widgets/ChartCard'
import UsageDashboardChart from '@/views/dashboard/UsageDashboardChart'
import ResourceLabel from '@/components/widgets/ResourceLabel'
export default {
name: 'UsageDashboard',
components: {
ChartCard,
UsageDashboardChart
UsageDashboardChart,
ResourceLabel
},
props: {
resource: {