diff --git a/src/app/shared/components/share-with-team-page/share-with-team-page.component.html b/src/app/shared/components/share-with-team-page/share-with-team-page.component.html index bc7eb39dd029f63b344816dccf126d3dc3c29381..b822efc8d8b96a98f43c0b3ed976e820694e5026 100644 --- a/src/app/shared/components/share-with-team-page/share-with-team-page.component.html +++ b/src/app/shared/components/share-with-team-page/share-with-team-page.component.html @@ -12,7 +12,7 @@ <span>This Model shared with below team members</span>|<span class="green" > - ({{ sharedWith.length }} members)</span + ({{ sharedWith?.length }} members)</span > </div> <div> diff --git a/src/app/shared/components/share-with-team-page/share-with-team-page.component.ts b/src/app/shared/components/share-with-team-page/share-with-team-page.component.ts index 8a1f0cdef25b0efd86614e8ade4508c4b589060b..081cd63ebd8f1ee60e22904a30bb0323a8fe5682 100644 --- a/src/app/shared/components/share-with-team-page/share-with-team-page.component.ts +++ b/src/app/shared/components/share-with-team-page/share-with-team-page.component.ts @@ -132,6 +132,7 @@ export class ShareWithTeamPageComponent implements OnInit { this.activatedRoute.parent?.params.subscribe((params) => { this.solutionId = params['solutionId']; this.revisionId = params['revisionId']; + this.getUsersChips(); this.getShareWithTeam(this.solutionId); this.loadSolutionDetails(this.solutionId, this.revisionId); this.selectedRevisionSubscription = @@ -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) { const index = this.users.indexOf(user); @@ -190,15 +182,21 @@ export class ShareWithTeamPageComponent implements OnInit { const userActiveStatus = true; this.privateCatalogsService.getAllActiveUsers(userActiveStatus).subscribe({ next: (users) => { - 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 + if (this.sharedWith) { + 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 + ); + }); + } else { + this.allUserDetails = users.filter((user) => { + return user.userId != this.solution.ownerId; + }); + } this.allUsersList = this.allUserDetails; },