Skip to content
Snippets Groups Projects
Commit c182b694 authored by Kawtar Laariche's avatar Kawtar Laariche
Browse files

#19: :bug: fix fetch share with team functionality

parent 8834ef3e
No related branches found
No related tags found
1 merge request!12Features/user auth manage my models
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
<span>This Model shared with below team members</span>|<span <span>This Model shared with below team members</span>|<span
class="green" class="green"
> >
({{ sharedWith.length }} members)</span ({{ sharedWith?.length }} members)</span
> >
</div> </div>
<div> <div>
......
...@@ -132,6 +132,7 @@ export class ShareWithTeamPageComponent implements OnInit { ...@@ -132,6 +132,7 @@ export class ShareWithTeamPageComponent implements OnInit {
this.activatedRoute.parent?.params.subscribe((params) => { this.activatedRoute.parent?.params.subscribe((params) => {
this.solutionId = params['solutionId']; this.solutionId = params['solutionId'];
this.revisionId = params['revisionId']; this.revisionId = params['revisionId'];
this.getUsersChips();
this.getShareWithTeam(this.solutionId); this.getShareWithTeam(this.solutionId);
this.loadSolutionDetails(this.solutionId, this.revisionId); this.loadSolutionDetails(this.solutionId, this.revisionId);
this.selectedRevisionSubscription = this.selectedRevisionSubscription =
...@@ -143,15 +144,6 @@ export class ShareWithTeamPageComponent implements OnInit { ...@@ -143,15 +144,6 @@ export class ShareWithTeamPageComponent implements OnInit {
}); });
} }
/* addUser(event: MatChipInputEvent): void {
const value = (event.value || '').trim();
this.allUsersList.filter(
(user) =>
user.firstName.toLowerCase().includes(value) ||
user.lastName?.toLowerCase().includes(value),
);
} */
remove(user: UserDetails) { remove(user: UserDetails) {
const index = this.users.indexOf(user); const index = this.users.indexOf(user);
...@@ -190,15 +182,21 @@ export class ShareWithTeamPageComponent implements OnInit { ...@@ -190,15 +182,21 @@ export class ShareWithTeamPageComponent implements OnInit {
const userActiveStatus = true; const userActiveStatus = true;
this.privateCatalogsService.getAllActiveUsers(userActiveStatus).subscribe({ this.privateCatalogsService.getAllActiveUsers(userActiveStatus).subscribe({
next: (users) => { next: (users) => {
const sharedWithIds = new Set( if (this.sharedWith) {
this.sharedWith.map((user) => user.userId), const sharedWithIds = new Set(
); this.sharedWith.map((user) => user.userId),
this.allUserDetails = users.filter((user) => {
return (
!sharedWithIds.has(user.userId) &&
user.userId != this.solution.ownerId
); );
}); this.allUserDetails = users.filter((user) => {
return (
!sharedWithIds.has(user.userId) &&
user.userId != this.solution.ownerId
);
});
} else {
this.allUserDetails = users.filter((user) => {
return user.userId != this.solution.ownerId;
});
}
this.allUsersList = this.allUserDetails; this.allUsersList = this.allUserDetails;
}, },
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment