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
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
54 commits
Select commit Hold shift + click to select a range
a9a13de
fix: created dashboard, widgets and dashboard widget model
NarayanBavisetti Jan 8, 2024
76b1ead
Merge branch 'develop' of github.com:makeplane/plane into feat/dashbo…
NarayanBavisetti Jan 8, 2024
b0c5293
fix: new user home dashboard
NarayanBavisetti Jan 8, 2024
3aa6ef6
chore: recent projects list
NarayanBavisetti Jan 8, 2024
9ee1b65
chore: recent collaborators
NarayanBavisetti Jan 8, 2024
b1bcbb8
chore: priority order change
NarayanBavisetti Jan 8, 2024
2bb57ac
chore: payload changes
NarayanBavisetti Jan 8, 2024
b64d6bc
chore: collaborator's active issue count
NarayanBavisetti Jan 8, 2024
3849e60
chore: all dashboard widgets added with services and typs
aaryan610 Jan 8, 2024
c4c7081
chore: centered metric for pie chart
aaryan610 Jan 9, 2024
0ea0f0b
chore: assigned and created issues widgets
aaryan610 Jan 9, 2024
151e846
chore: widget filters
NarayanBavisetti Jan 9, 2024
d321f7e
Merge branch 'feat/dashboard-widgets' of github.com:makeplane/plane i…
NarayanBavisetti Jan 9, 2024
89fd0a2
chore: created issue filter
NarayanBavisetti Jan 9, 2024
a1ed588
fix: created and assigned issues payload change
NarayanBavisetti Jan 10, 2024
bb20e17
Merge branch 'develop' of github.com:makeplane/plane into feat/dashbo…
NarayanBavisetti Jan 10, 2024
faac5c2
chore: created issue payload change
NarayanBavisetti Jan 11, 2024
a31abef
Merge branch 'develop' of github.com:makeplane/plane into feat/dashbo…
NarayanBavisetti Jan 11, 2024
50a3f9b
fix: date filter change
NarayanBavisetti Jan 11, 2024
1be726d
chore: implement filters
aaryan610 Jan 11, 2024
d619ec5
fix: merge conflicts resolved
aaryan610 Jan 11, 2024
6172d3a
fix: added expansion fields
NarayanBavisetti Jan 11, 2024
8a8fcd1
Merge branch 'feat/dashboard-widgets' of github.com:makeplane/plane i…
NarayanBavisetti Jan 11, 2024
9c1a269
fix: changed issue structure with relation
NarayanBavisetti Jan 12, 2024
c8f476f
Merge branch 'develop' of github.com:makeplane/plane into feat/dashbo…
NarayanBavisetti Jan 12, 2024
e97f713
chore: new issues response
aaryan610 Jan 12, 2024
0660344
fix: project member fix
NarayanBavisetti Jan 12, 2024
349842e
Merge branch 'develop' of github.com:makeplane/plane into feat/dashbo…
NarayanBavisetti Jan 12, 2024
3eeb448
Merge branch 'feat/dashboard-widgets' of github.com:makeplane/plane i…
NarayanBavisetti Jan 12, 2024
b446f93
chore: updated issue_relation structure
gurusainath Jan 15, 2024
f9907fd
chore: code cleanup
NarayanBavisetti Jan 16, 2024
d12b259
Merge branch 'feat/dashboard-widgets' of github.com:makeplane/plane i…
NarayanBavisetti Jan 16, 2024
1635e34
Merge branch 'develop' of github.com:makeplane/plane into feat/dashbo…
NarayanBavisetti Jan 16, 2024
6f4d86a
chore: update issues response and added empty states
aaryan610 Jan 16, 2024
3c7d6fc
fix: merge conflicts resolved from develop
aaryan610 Jan 16, 2024
13a26cd
fix: button text wrap
aaryan610 Jan 16, 2024
94cdb1e
chore: update empty state messages
aaryan610 Jan 16, 2024
7c6dc75
fix: filters
aaryan610 Jan 17, 2024
3a5e758
chore: update dark mode empty states
aaryan610 Jan 17, 2024
fc102f2
build-error: Type check in the issue relation service
gurusainath Jan 17, 2024
51daa0c
fix: issues redirection
aaryan610 Jan 17, 2024
307b1ec
Merge branch 'feat/dashboard-widgets' of https://github.com/makeplane…
aaryan610 Jan 17, 2024
b26a8ea
fix: project empty state
aaryan610 Jan 17, 2024
abd25f3
chore: project member active check
NarayanBavisetti Jan 17, 2024
1ef2377
Merge branch 'feat/dashboard-widgets' of github.com:makeplane/plane i…
NarayanBavisetti Jan 17, 2024
df036d4
chore: project member check in state and priority
NarayanBavisetti Jan 17, 2024
f1abddf
chore: remove console logs and replace harcoded values with constants
aaryan610 Jan 17, 2024
336cbcc
Merge branch 'feat/dashboard-widgets' of https://github.com/makeplane…
aaryan610 Jan 17, 2024
1666ad3
fix: code refactoring
NarayanBavisetti Jan 18, 2024
235c771
Merge branch 'feat/dashboard-widgets' of github.com:makeplane/plane i…
NarayanBavisetti Jan 18, 2024
e63dd34
fix: key name changed
NarayanBavisetti Jan 18, 2024
20f6714
refactor: mapping through similar components using an array
aaryan610 Jan 18, 2024
8a3a513
Merge branch 'feat/dashboard-widgets' of https://github.com/makeplane…
aaryan610 Jan 18, 2024
59249a0
fix: build errors
aaryan610 Jan 18, 2024
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
3 changes: 2 additions & 1 deletion apiserver/plane/app/serializers/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,6 @@
IssueRelationSerializer,
RelatedIssueSerializer,
IssuePublicSerializer,
IssueRelationLiteSerializer,
)

from .module import (
Expand Down Expand Up @@ -120,3 +119,5 @@
from .exporter import ExporterHistorySerializer

from .webhook import WebhookSerializer, WebhookLogSerializer

from .dashboard import DashboardSerializer, WidgetSerializer
13 changes: 6 additions & 7 deletions apiserver/plane/app/serializers/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ def _filter_fields(self, fields):
LabelSerializer,
CycleIssueSerializer,
IssueFlatSerializer,
IssueRelationSerializer,
)

# Expansion mapper
Expand All @@ -78,14 +79,10 @@ def _filter_fields(self, fields):
"labels": LabelSerializer,
"issue_cycle": CycleIssueSerializer,
"parent": IssueSerializer,
"issue_relation": IssueRelationSerializer,
}

self.fields[field] = expansion[field](
many=True
if field
in ["members", "assignees", "labels", "issue_cycle"]
else False
)

self.fields[field] = expansion[field](many=True if field in ["members", "assignees", "labels", "issue_cycle", "issue_relation"] else False)

return self.fields

Expand All @@ -105,6 +102,7 @@ def to_representation(self, instance):
IssueSerializer,
LabelSerializer,
CycleIssueSerializer,
IssueRelationSerializer,
)

# Expansion mapper
Expand All @@ -124,6 +122,7 @@ def to_representation(self, instance):
"labels": LabelSerializer,
"issue_cycle": CycleIssueSerializer,
"parent": IssueSerializer,
"issue_relation": IssueRelationSerializer
}
# Check if field in expansion then expand the field
if expand in expansion:
Expand Down
26 changes: 26 additions & 0 deletions apiserver/plane/app/serializers/dashboard.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Module imports
from .base import BaseSerializer
from plane.db.models import Dashboard, Widget

# Third party frameworks
from rest_framework import serializers


class DashboardSerializer(BaseSerializer):
class Meta:
model = Dashboard
fields = "__all__"


class WidgetSerializer(BaseSerializer):
is_visible = serializers.BooleanField(read_only=True)
widget_filters = serializers.JSONField(read_only=True)

class Meta:
model = Widget
fields = [
"id",
"key",
"is_visible",
"widget_filters"
]
36 changes: 15 additions & 21 deletions apiserver/plane/app/serializers/issue.py
Original file line number Diff line number Diff line change
Expand Up @@ -293,31 +293,19 @@ class Meta:
]


class IssueRelationLiteSerializer(DynamicBaseSerializer):
project_id = serializers.PrimaryKeyRelatedField(read_only=True)
class IssueRelationSerializer(BaseSerializer):
id = serializers.UUIDField(source="related_issue.id", read_only=True)
project_id = serializers.PrimaryKeyRelatedField(source="related_issue.project_id", read_only=True)
sequence_id = serializers.IntegerField(source="related_issue.sequence_id", read_only=True)
relation_type = serializers.CharField(read_only=True)

class Meta:
model = Issue
model = IssueRelation
fields = [
"id",
"project_id",
"sequence_id",
]
read_only_fields = [
"workspace",
"project",
]


class IssueRelationSerializer(BaseSerializer):
issue_detail = IssueRelationLiteSerializer(
read_only=True, source="related_issue"
)

class Meta:
model = IssueRelation
fields = [
"issue_detail",
"relation_type",
]
read_only_fields = [
"workspace",
Expand All @@ -326,12 +314,18 @@ class Meta:


class RelatedIssueSerializer(BaseSerializer):
issue_detail = IssueRelationLiteSerializer(read_only=True, source="issue")
id = serializers.UUIDField(source="issue.id", read_only=True)
project_id = serializers.PrimaryKeyRelatedField(source="issue.project_id", read_only=True)
sequence_id = serializers.IntegerField(source="issue.sequence_id", read_only=True)
relation_type = serializers.CharField(read_only=True)

class Meta:
model = IssueRelation
fields = [
"issue_detail",
"id",
"project_id",
"sequence_id",
"relation_type",
]
read_only_fields = [
"workspace",
Expand Down
2 changes: 2 additions & 0 deletions apiserver/plane/app/urls/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
from .authentication import urlpatterns as authentication_urls
from .config import urlpatterns as configuration_urls
from .cycle import urlpatterns as cycle_urls
from .dashboard import urlpatterns as dashboard_urls
from .estimate import urlpatterns as estimate_urls
from .external import urlpatterns as external_urls
from .importer import urlpatterns as importer_urls
Expand All @@ -28,6 +29,7 @@
*authentication_urls,
*configuration_urls,
*cycle_urls,
*dashboard_urls,
*estimate_urls,
*external_urls,
*importer_urls,
Expand Down
23 changes: 23 additions & 0 deletions apiserver/plane/app/urls/dashboard.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
from django.urls import path


from plane.app.views import DashboardEndpoint, WidgetsEndpoint


urlpatterns = [
path(
"workspaces/<str:slug>/dashboard/",
DashboardEndpoint.as_view(),
name="dashboard",
),
path(
"workspaces/<str:slug>/dashboard/<uuid:dashboard_id>/",
DashboardEndpoint.as_view(),
name="dashboard",
),
path(
"dashboard/<uuid:dashboard_id>/widgets/<uuid:widget_id>/",
WidgetsEndpoint.as_view(),
name="widgets",
),
]
5 changes: 5 additions & 0 deletions apiserver/plane/app/views/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -177,3 +177,8 @@
WebhookLogsEndpoint,
WebhookSecretRegenerateEndpoint,
)

from .dashboard import (
DashboardEndpoint,
WidgetsEndpoint
)
Loading
Loading