Skip to content

Add dropdown to Projects nav item

Kushal Pandya requested to merge 35010-projects-nav-dropdown into master

What does this MR do?

Adds a dropdown menu to Projects on navigation

Why was this MR needed?

This MR enables easier access to items related to projects which otherwise involved multiple clicks.

How do we determine list of frequently accessed projects?

A project is logged in list of frequent projects within localStorage based on following scenarios;

  1. When a project is visited for first time, we log it with frequency set to 1 & lastAccessedOn set to current timestamp.
  2. If same project is visited more than once in an hour, both frequency & lastAccessedOn remain unchanged.
  3. If same project is visited more than once over duration of more than an hour, frequency is increased by 1 and lastAccessedOn is updated with current timestamp.
  4. At the most, we keep 20 such visited projects in storage.

Top 5 frequent projects are retrieved based on following filters from storage;

  1. Sort entire collection of stored projects list in descending order of frequency (highest to lowest) and then by lastAccessedOn (recent most to oldest)
  2. Filter the sorted collection based on frequency higher than 3.
  3. Return first 5 projects from this filtered collection and show on dropdown.

Notes:

  • This feature entirely depends on availability localStorage.
  • This feature is only available to logged-in users (projects dropdown is not shown for guests).
  • A list of frequent projects is limited to browser, user can't access his/her frequent projects by logging in to a new browser (as the list is stored locally within browser).
  • This list of projects is unique to user, if user A logs out and user B logs in within same browsers, frequent projects of user A are not shown to user B, vice versa is also true.
  • Once a project is part of frequents list, if anything about project changes; like name, namespace, path or avatar, it will not be reflected in the list until project page is visited. This is a known limitation.
  • It is worth noting here that in case project path has changed (due to change in name or namespace), entry in dropdown will still point to old URL, which can lead to 404, so it is suggested to visit project once using new URL to update the list entry.

Screenshots

Desktop View

Default (without Frequent projects available)

image

With Frequent Projects

image

If localStorage is unavailable

image

Loading Search Results

image

Search Results

image

No Results for Search

image

Failure while performing search

image

Mobile View

Default

image

With Frequent Projects

image

Does this MR meet the acceptance criteria?

What are the relevant issue numbers?

Closes #35010 (closed)

Edited by Filipa Lacerda

Merge request reports