Skip to content

Commit d27a0e2

Browse files
committed
fix(admin): key 'resources' duplicated in localStorage
* Expandable tiles functionality added 'resources' as a new key to localStorage, but this key had been already used by recently visited functionality. * This caused that if expandable functionality change the value in localStorage to 'true', the resource list will be broken due to recently visited functionality. * Key for expandable tiles in localStorage is changed to 'resourcesExpandable'.
1 parent 2fbd165 commit d27a0e2

File tree

5 files changed

+9
-5
lines changed

5 files changed

+9
-5
lines changed

apps/admin-gui/src/app/shared/side-menu/side-menu-item.service.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -524,7 +524,7 @@ export class SideMenuItemService {
524524
url: [`/organizations/${vo.id}/resources`],
525525
activatedRegex: '/organizations/\\d+/resources$',
526526
children: children,
527-
showChildren: 'resources',
527+
showChildren: 'resourcesExpandable',
528528
});
529529
}
530530

apps/admin-gui/src/app/vos/pages/vo-detail-page/vo-overview/vo-overview.component.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<perun-web-apps-expandable-tiles
55
[items]="resourcesItems"
66
[title]="'MENU_ITEMS.VO.RESOURCES'"
7-
[sectionId]="'resources'">
7+
[sectionId]="'resourcesExpandable'">
88
</perun-web-apps-expandable-tiles>
99
<perun-web-apps-expandable-tiles
1010
[items]="settingsItems"
Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,5 @@
1-
export type ExpandableSectionId = 'settings' | 'resources' | 'visualizer' | 'authentication';
1+
export type ExpandableSectionId =
2+
| 'settings'
3+
| 'resourcesExpandable'
4+
| 'visualizer'
5+
| 'authentication';

libs/perun/services/src/lib/expanded-tiles-store.service.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ export class ExpandedTilesStoreService {
1616
// Right now there is no check if all sections are initialized and needs to be kept manually updated
1717
private sections: ExpandableSectionId[] = [
1818
'settings',
19-
'resources',
19+
'resourcesExpandable',
2020
'visualizer',
2121
'authentication',
2222
];

libs/perun/utils/src/lib/perun-utils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -267,7 +267,7 @@ export function getRecentlyVisitedItems(key: string): RecentItem[] {
267267
* @param key of localStorage
268268
* @param item entity that was visited
269269
*/
270-
export function addRecentlyVisited(key: string, item: Vo | Facility | Group): void {
270+
export function addRecentlyVisited(key: string, item: Vo | Facility | Group | Resource): void {
271271
if (localStorage.getItem(key) === null) {
272272
// if user not have any in local storage
273273
const recent: number[] = [];

0 commit comments

Comments
 (0)