Skip to content

Commit

Permalink
Merge pull request #1694 from BLSQ/IA-3301-Add-column-Projects-on-the…
Browse files Browse the repository at this point in the history
…-left

IA-3301: Add column Projects on the left
  • Loading branch information
hakifran authored Oct 10, 2024
2 parents d83fb79 + 32f3708 commit 548d26a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
6 changes: 6 additions & 0 deletions hat/assets/js/apps/Iaso/domains/teams/config.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,12 @@ export const teamColumns = (
accessor: 'id',
width: 80,
},
{
Header: formatMessage(MESSAGES.project),
accessor: 'project_details',
id: 'project__name',
Cell: settings => settings.row.original.project_details.name
},
{
Header: formatMessage(MESSAGES.name),
accessor: 'name',
Expand Down
4 changes: 3 additions & 1 deletion iaso/api/microplanning.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ class Meta:
fields = [
"id",
"project",
"project_details",
"name",
"description",
"created_at",
Expand All @@ -88,6 +89,7 @@ class Meta:

users_details = NestedUserSerializer(many=True, read_only=True, source="users")
sub_teams_details = NestedTeamSerializer(many=True, read_only=True, source="sub_teams")
project_details = NestedProjectSerializer(many=False, read_only=True, source="project")

def validate_parent(self, value: Team):
if value is not None and value.type not in (None, TeamType.TEAM_OF_TEAMS):
Expand Down Expand Up @@ -239,7 +241,7 @@ class TeamViewSet(AuditMixin, ModelViewSet):
permission_classes = [ReadOnlyOrHasPermission(permission.TEAMS)] # type: ignore
serializer_class = TeamSerializer
queryset = Team.objects.all()
ordering_fields = ["id", "name", "created_at", "updated_at", "type"]
ordering_fields = ["id", "project__name", "name", "created_at", "updated_at", "type"]
filterset_fields = {
"id": ["in"],
"name": ["icontains"],
Expand Down

0 comments on commit 548d26a

Please sign in to comment.