Skip to content

Commit

Permalink
fix(admin): display groups on recently viewed dashboard
Browse files Browse the repository at this point in the history
* There was just a technical problem of matching type RichGroup/Group after some recent changes of loading groups.
* This matching was fixed on the dashboard and also in the related service.
  • Loading branch information
HejdaJakub committed Oct 5, 2023
1 parent aacc183 commit 5bc0986
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ export class DashboardRecentlyViewedButtonFieldComponent implements OnInit {
this.vosIds.push(item.id);
break;
}
case 'RichGroup':
case 'Group': {
this.groupsIds.push(item.id);
break;
Expand Down Expand Up @@ -127,6 +128,7 @@ export class DashboardRecentlyViewedButtonFieldComponent implements OnInit {
}
break;
}
case 'RichGroup':
case 'Group': {
const filteredGroup = this.groups.filter((group) => group.id === item.id)[0];
if (filteredGroup) {
Expand Down
4 changes: 2 additions & 2 deletions libs/perun/utils/src/lib/perun-utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,7 @@ export function addRecentlyVisitedObject(item: Vo & Facility & Group, voName?: s
if (localStorage.getItem('recent') === null) {
// if user not have any in local storage
let recent;
if (item.beanName === 'Group') {
if (item.beanName.includes('Group')) {
recent = [
{
id: item.id,
Expand All @@ -329,7 +329,7 @@ export function addRecentlyVisitedObject(item: Vo & Facility & Group, voName?: s
} else {
const recent: RecentEntity[] = JSON.parse(localStorage.getItem('recent')) as RecentEntity[];
let object: RecentEntity;
if (item.beanName === 'Group') {
if (item.beanName.includes('Group')) {
object = {
id: item.id,
name: item.shortName,
Expand Down

0 comments on commit 5bc0986

Please sign in to comment.