Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SAK-50572 Portal don't remove recent sites from pinned #12951

Merged
merged 1 commit into from
Oct 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -1061,9 +1061,8 @@ public void syncUserSitesWithPortalNav(final String userId) {
sitesToPin.remove(id);
});

// remove unpinned and recent sites as they should not be pinned
// remove unpinned as they should not be pinned
sitesToPin.removeAll(unPinnedSites);
sitesToPin.removeAll(recentSites);
// any remaining sites should be auto pinned
savePinnedSites(userId, new ArrayList<>(sitesToPin));

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -403,10 +403,24 @@ public void testRecentlyUnpinned() {
// simulate another login
((Observer) portalService).update(null, event);

// should be no change to sites pinned, unpinned, or recent
// no change after login, results in 0 pinned, 4 unpinned, 3 recent
Assert.assertEquals(0, portalService.getPinnedSites(user1).size());
Assert.assertEquals(4, portalService.getUnpinnedSites(user1).size());
Assert.assertEquals(3, portalService.getRecentSites(user1).size());

// re pin site3, results in 1 pinned, 3 unpinned, 3 recent
portalService.addPinnedSite(user1, "site3", true);
Assert.assertEquals(1, portalService.getPinnedSites(user1).size());
Assert.assertEquals(3, portalService.getUnpinnedSites(user1).size());
Assert.assertEquals(3, portalService.getRecentSites(user1).size());

// simulate another login
((Observer) portalService).update(null, event);

// no change after login, results in 1 pinned, 3 unpinned, 3 recent
Assert.assertEquals(1, portalService.getPinnedSites(user1).size());
Assert.assertEquals(3, portalService.getUnpinnedSites(user1).size());
Assert.assertEquals(3, portalService.getRecentSites(user1).size());
}

@Test
Expand Down
Loading