-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
135 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 4 additions & 0 deletions
4
frontend/src/app/users/users-profile/users-profile.component.css
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
/* | ||
* SPDX-FileCopyrightText: Copyright DB Netz AG and the capella-collab-manager contributors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ |
25 changes: 25 additions & 0 deletions
25
frontend/src/app/users/users-profile/users-profile.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
<!-- | ||
~ SPDX-FileCopyrightText: Copyright DB Netz AG and the capella-collab-manager contributors | ||
~ SPDX-License-Identifier: Apache-2.0 | ||
--> | ||
|
||
<h2>Profile of {{ user?.name }}</h2> | ||
|
||
<div *ngIf="user?.id !== userService.user?.id">Common Projects</div> | ||
|
||
<ng-container | ||
*ngIf="(projectService.projects$ | async)?.length; else elseBlock" | ||
> | ||
<mat-card | ||
*ngFor="let project of projectService.projects$ | async" | ||
class="!ml-0 cursor-pointer" | ||
[routerLink]="['/project', project.slug]" | ||
> | ||
<mat-card-content> | ||
<b>{{ project.name }}</b | ||
><br /> | ||
{{ project.description }} | ||
</mat-card-content> | ||
</mat-card> | ||
</ng-container> | ||
<ng-template #elseBlock>You do not have any common projects.</ng-template> |
36 changes: 36 additions & 0 deletions
36
frontend/src/app/users/users-profile/users-profile.component.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
/* | ||
* SPDX-FileCopyrightText: Copyright DB Netz AG and the capella-collab-manager contributors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
import { Component, OnInit } from '@angular/core'; | ||
import { ActivatedRoute } from '@angular/router'; | ||
import { ProjectService } from 'src/app/projects/service/project.service'; | ||
import { User, UserService } from 'src/app/services/user/user.service'; | ||
|
||
@Component({ | ||
selector: 'app-users-profile', | ||
templateUrl: './users-profile.component.html', | ||
styleUrls: ['./users-profile.component.css'], | ||
}) | ||
export class UsersProfileComponent implements OnInit { | ||
user: User | undefined; | ||
user_id: number | undefined; | ||
constructor( | ||
public userService: UserService, | ||
public projectService: ProjectService, | ||
private route: ActivatedRoute, | ||
) {} | ||
|
||
ngOnInit() { | ||
this.route.queryParams.subscribe( | ||
(params) => (this.user_id = params.user_id), | ||
); | ||
if (this.user_id) { | ||
this.userService | ||
.getUserById(this.user_id) | ||
.subscribe((user) => (this.user = user)); | ||
} | ||
this.projectService.loadCommonProjects(this.user_id!); | ||
} | ||
} |