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

feat: dashboard widgets #3362

Merged
merged 54 commits into from
Jan 18, 2024
Merged

feat: dashboard widgets #3362

merged 54 commits into from
Jan 18, 2024

Conversation

NarayanBavisetti
Copy link
Collaborator

@NarayanBavisetti NarayanBavisetti commented Jan 12, 2024

Dashboard widgets

This PR introduces an enhanced version of the dashboard, providing users with a personalised home dashboard experience using multiple widgets.

Screen.Recording.2024-01-17.at.5.45.58.AM.mov

There are 8 widgets in total, including-

1. Statistics overview:

  • Gives an overview to the user, such as- Total number of issues assigned to them, overdue, created by them, and completed by them.
  • Clicking on each stat redirects the user to the desired page with the list of all the issues.
Widget Loading state
image image

2. Assigned issues:

  • Displays the top 5 issues assigned to the user, sorted by priority.
  • Categories include Upcoming, Overdue, and Completed issues.
  • Date based filters can be applied, such as- today, this week, this month and this year.
Widget Empty state Loading state
image image image

3. Created issues:

  • Lists the top 5 issues created by the user, ordered by priority.
  • Categories include Upcoming, Overdue, and Completed issues.
  • Date based filters can be applied.
Widget Empty state Loading state
image image image

Each issue of the above two widgets can be opened in the peek overview.

4. Issues by state groups:

  • Graphical representation of user-assigned issues grouped by state groups.
  • Date based filters can be applied.
  • Clicking on the ring of the graph redirects the user to the assigned issues page with the selected state group applied as the filter.
Widget Empty state Loading state
image image image

5. Issues by priority:

  • Graphical representation of user-assigned issues grouped by priority.
  • Date based filters can be applied.
  • Clicking on a bar of the graph redirects the user to the assigned issues page with the selected priority applied as the filter.
Widget Empty state Loading state
image image image

6. My activity:

  • Lists the latest activity of the user across the workspace.
Widget Empty state Loading state
image image image

7. My projects:

  • Lists the projects the user is part of, ordered by last activity.
  • Allows users to create a project directly from the widget (if they have the access).
Widget Loading state
image image

8. Collaborators

  • Lists members of all projects the user is part of across the workspace.
  • Clicking on each member redirects the user to their profile page.
Widget Empty state Loading state
image image image

Implementation:

  1. Created a new MobX store (dashboard.store) to store the widget details and statistics, and other necessary actions and computed functions, including-
// observables
homeDashboardId: observable.ref,
widgetDetails: observable,
widgetStats: observable,

// computed
homeDashboardWidgets: computed,

// computed actions
getWidgetDetails: action,

// fetch actions
fetchHomeDashboardWidgets: action,
fetchWidgetStats: action,

// update actions
updateDashboardWidget: action,
updateDashboardWidgetFilters: action,

Other updates:

  1. Updated the @plane/ui Button component to use classNames using clsx and tailwind-merge.
  2. Updated the @plane/ui PriorityIcon component logic and refactored the component.
  3. Project empty state in the dashboard
image

NarayanBavisetti and others added 29 commits January 8, 2024 12:52
@NarayanBavisetti NarayanBavisetti marked this pull request as ready for review January 17, 2024 09:22
Copy link
Collaborator

@rahulramesha rahulramesha left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please make the necessary changes and address the comments

web/components/dashboard/widgets/created-issues.tsx Outdated Show resolved Hide resolved
import DarkImage from "public/empty-state/dashboard/dark/recent-collaborators.svg";
import LightImage from "public/empty-state/dashboard/light/recent-collaborators.svg";
// helpers
import { cn } from "helpers/common.helper";
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All the empty states look very similar to each other. could you please create a common component and re use that in all the empty states

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The empty states vary in terms of content and structure, I don't think it'll make much sense as we are going to have more widgets in the future with different empty states structure.

web/components/dashboard/widgets/issues-by-priority.tsx Outdated Show resolved Hide resolved
web/components/dashboard/widgets/issues-by-state-group.tsx Outdated Show resolved Hide resolved
{widgetStats.map((activity) => (
<div key={activity.id} className="flex gap-5">
<div className="flex-shrink-0">
{activity.field ? (
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please avoid conditionals inside tsx, It will make it look more readable

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As there are too many conditions inside tsx, we better break this down into smaller components.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This same logic is being used wherever we are rendering activity, I think it'll be better to have a separate PR just to refactor the activity logic.

web/components/issues/issue-modal/form.tsx Outdated Show resolved Hide resolved
web/store/issue/issue-details/relation.store.ts Outdated Show resolved Hide resolved
@sriramveeraghanta sriramveeraghanta merged commit 9065b5d into develop Jan 18, 2024
5 of 8 checks passed
@sriramveeraghanta sriramveeraghanta deleted the feat/dashboard-widgets branch January 18, 2024 10:19
sriramveeraghanta pushed a commit that referenced this pull request Jan 22, 2024
* fix: created dashboard, widgets and dashboard widget model

* fix: new user home dashboard

* chore: recent projects list

* chore: recent collaborators

* chore: priority order change

* chore: payload changes

* chore: collaborator's active issue count

* chore: all dashboard widgets added with services and typs

* chore: centered metric for pie chart

* chore: widget filters

* chore: created issue filter

* fix: created and assigned issues payload change

* chore: created issue payload change

* fix: date filter change

* chore: implement filters

* fix: added expansion fields

* fix: changed issue structure with relation

* chore: new issues response

* fix: project member fix

* chore: updated issue_relation structure

* chore: code cleanup

* chore: update issues response and added empty states

* fix: button text wrap

* chore: update empty state messages

* fix: filters

* chore: update dark mode empty states

* build-error: Type check in the issue relation service

* fix: issues redirection

* fix: project empty state

* chore: project member active check

* chore: project member check in state and priority

* chore: remove console logs and replace harcoded values with constants

* fix: code refactoring

* fix: key name changed

* refactor: mapping through similar components using an array

* fix: build errors

---------

Co-authored-by: Aaryan Khandelwal <aaryankhandu123@gmail.com>
Co-authored-by: gurusainath <gurusainath007@gmail.com>
sriramveeraghanta pushed a commit that referenced this pull request Jan 22, 2024
* fix: created dashboard, widgets and dashboard widget model

* fix: new user home dashboard

* chore: recent projects list

* chore: recent collaborators

* chore: priority order change

* chore: payload changes

* chore: collaborator's active issue count

* chore: all dashboard widgets added with services and typs

* chore: centered metric for pie chart

* chore: widget filters

* chore: created issue filter

* fix: created and assigned issues payload change

* chore: created issue payload change

* fix: date filter change

* chore: implement filters

* fix: added expansion fields

* fix: changed issue structure with relation

* chore: new issues response

* fix: project member fix

* chore: updated issue_relation structure

* chore: code cleanup

* chore: update issues response and added empty states

* fix: button text wrap

* chore: update empty state messages

* fix: filters

* chore: update dark mode empty states

* build-error: Type check in the issue relation service

* fix: issues redirection

* fix: project empty state

* chore: project member active check

* chore: project member check in state and priority

* chore: remove console logs and replace harcoded values with constants

* fix: code refactoring

* fix: key name changed

* refactor: mapping through similar components using an array

* fix: build errors

---------

Co-authored-by: Aaryan Khandelwal <aaryankhandu123@gmail.com>
Co-authored-by: gurusainath <gurusainath007@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants