|
10 | 10 | All Users |
11 | 11 | </div> |
12 | 12 | <div class="d-flex align-items-center"> |
13 | | - <mat-icon |
14 | | - style="transform: scale(0.85); margin-right: 5px; margin-left: 10px" |
15 | | - svgIcon="ic_magnify_search" |
16 | | - ></mat-icon> |
17 | | - <mat-form-field style="width: 220px"> |
| 13 | + <mat-form-field class="w-100 my-1" subscriptSizing="dynamic"> |
| 14 | + <mat-icon |
| 15 | + matPrefix |
| 16 | + style="transform: scale(0.85); margin-right: 5px; margin-left: 10px" |
| 17 | + svgIcon="ic_magnify_search" |
| 18 | + ></mat-icon> |
18 | 19 | <input |
19 | 20 | matInput |
20 | 21 | [(ngModel)]="filterString" |
21 | 22 | (keyup)="applyFilter($event.target.value)" |
22 | 23 | placeholder="Search" |
23 | 24 | #searchBox |
24 | | - /> |
| 25 | + /> |
25 | 26 | @if (filterString !== '') { |
26 | 27 | <button |
27 | 28 | mat-icon-button |
28 | 29 | matSuffix |
29 | 30 | (click)="clearFilter()" |
30 | 31 | title="Clear Search" |
31 | | - > |
| 32 | + > |
32 | 33 | <mat-icon |
33 | 34 | style="transform: scale(0.85)" |
34 | 35 | svgIcon="ic_cancel_circle" |
|
39 | 40 | </div> |
40 | 41 |
|
41 | 42 | @if (isLoading) { |
42 | | - <mat-card |
43 | | - class="d-flex justify-content-center align-items-center" |
44 | | - > |
| 43 | + <mat-card class="d-flex justify-content-center align-items-center"> |
45 | 44 | <mat-progress-spinner color="primary" mode="indeterminate"> |
46 | 45 | </mat-progress-spinner> |
47 | 46 | </mat-card> |
|
52 | 51 | #table |
53 | 52 | [dataSource]="userDataSource" |
54 | 53 | matSort |
55 | | - > |
| 54 | + > |
56 | 55 | <ng-container matColumnDef="name"> |
57 | 56 | <mat-header-cell *matHeaderCellDef mat-sort-header |
58 | 57 | >User Name</mat-header-cell |
| 58 | + > |
| 59 | + <mat-cell *matCellDef="let element"> |
| 60 | + @if (element.name !== null) { |
| 61 | + <div>{{ element.name }}</div> |
| 62 | + } |
| 63 | + @if (element.name === null) { |
| 64 | + <div>{{ element.id }}</div> |
| 65 | + } |
| 66 | + </mat-cell> |
| 67 | + </ng-container> |
| 68 | + |
| 69 | + <ng-container matColumnDef="id"> |
| 70 | + <mat-header-cell *matHeaderCellDef> </mat-header-cell> |
| 71 | + <mat-cell *matCellDef="let element"> |
| 72 | + <div> |
| 73 | + <button mat-stroked-button (click)="addUserToTeam(element)"> |
| 74 | + Add User |
| 75 | + </button> |
| 76 | + </div> |
| 77 | + </mat-cell> |
| 78 | + </ng-container> |
| 79 | + |
| 80 | + <mat-header-row *matHeaderRowDef="displayedUserColumns"></mat-header-row> |
| 81 | + <mat-row *matRowDef="let row; columns: displayedUserColumns"></mat-row> |
| 82 | + </mat-table> |
| 83 | + |
| 84 | + @if (userDataSource.filteredData.length === 0) { |
| 85 | + <div>No results found</div> |
| 86 | + } |
| 87 | + <mat-paginator |
| 88 | + #paginator |
| 89 | + [pageSize]="defaultPageSize" |
| 90 | + [showFirstLastButtons]="true" |
| 91 | + (page)="pageEvent = $event" |
| 92 | + > |
| 93 | + </mat-paginator> |
| 94 | + </div> |
| 95 | + |
| 96 | + <div style="margin-left: 20px"> |
| 97 | + <div class="team-list-container mat-elevation-z8"> |
| 98 | + <div id="userImport"> |
| 99 | + <div class="sp-icon"> |
| 100 | + <img height="35" src="assets/img/SP_Icon_Team.png" alt="Users" /> |
| 101 | + Team Users |
| 102 | + </div> |
| 103 | + <div> |
| 104 | + <button |
| 105 | + mat-stroked-button |
| 106 | + (click)="fileInput.click()" |
| 107 | + title="Import users from a CSV containing a single column of user IDs" |
59 | 108 | > |
| 109 | + Import Users |
| 110 | + </button> |
| 111 | + </div> |
| 112 | + <input |
| 113 | + hidden |
| 114 | + (change)="uploadUsers($event.target.files)" |
| 115 | + #fileInput |
| 116 | + type="file" |
| 117 | + /> |
| 118 | + </div> |
| 119 | + |
| 120 | + @if (isLoading) { |
| 121 | + <mat-card class="d-flex justify-content-center align-items-center"> |
| 122 | + <mat-progress-spinner color="primary" mode="indeterminate"> |
| 123 | + </mat-progress-spinner> |
| 124 | + </mat-card> |
| 125 | + } |
| 126 | + |
| 127 | + <mat-table |
| 128 | + class="mat-table-team-users" |
| 129 | + #table |
| 130 | + [dataSource]="teamUserDataSource" |
| 131 | + > |
| 132 | + <ng-container matColumnDef="name"> |
| 133 | + <mat-header-cell *matHeaderCellDef>User Name</mat-header-cell> |
60 | 134 | <mat-cell *matCellDef="let element"> |
61 | | - @if (element.name !== null) { |
62 | | - <div>{{ element.name }}</div> |
| 135 | + @if (element.user.name !== null) { |
| 136 | + <div> |
| 137 | + {{ element.user.name }} |
| 138 | + </div> |
63 | 139 | } |
64 | | - @if (element.name === null) { |
65 | | - <div>{{ element.id }}</div> |
| 140 | + @if (element.user.name === null) { |
| 141 | + <div>{{ element.user.id }}</div> |
66 | 142 | } |
67 | 143 | </mat-cell> |
68 | 144 | </ng-container> |
69 | 145 |
|
70 | | - <ng-container matColumnDef="id"> |
71 | | - <mat-header-cell *matHeaderCellDef> </mat-header-cell> |
| 146 | + <ng-container matColumnDef="teamMembership"> |
| 147 | + <mat-header-cell *matHeaderCellDef>Role</mat-header-cell> |
72 | 148 | <mat-cell *matCellDef="let element"> |
| 149 | + <mat-form-field> |
| 150 | + <mat-select |
| 151 | + placeholder="Role" |
| 152 | + name="teamMembershipRole" |
| 153 | + [(ngModel)]="element.teamMembership.roleId" |
| 154 | + (selectionChange)="updateMembership(element)" |
| 155 | + [(value)]="element.teamMembership.roleId" |
| 156 | + > |
| 157 | + @for (role of roles; track role) { |
| 158 | + <mat-option [value]="role.id"> |
| 159 | + {{ role.name }} |
| 160 | + </mat-option> |
| 161 | + } |
| 162 | + </mat-select> |
| 163 | + </mat-form-field> |
| 164 | + </mat-cell> |
| 165 | + </ng-container> |
| 166 | + |
| 167 | + <ng-container matColumnDef="user"> |
| 168 | + <mat-header-cell *matHeaderCellDef> </mat-header-cell> |
| 169 | + <mat-cell style="margin-left: 20px" *matCellDef="let element"> |
73 | 170 | <div> |
74 | | - <button mat-stroked-button (click)="addUserToTeam(element)"> |
75 | | - Add User |
| 171 | + <button mat-stroked-button (click)="removeUserFromTeam(element)"> |
| 172 | + Remove |
76 | 173 | </button> |
77 | 174 | </div> |
78 | 175 | </mat-cell> |
79 | 176 | </ng-container> |
80 | 177 |
|
81 | | - <mat-header-row *matHeaderRowDef="displayedUserColumns"></mat-header-row> |
82 | | - <mat-row *matRowDef="let row; columns: displayedUserColumns"></mat-row> |
| 178 | + <mat-header-row |
| 179 | + *matHeaderRowDef="displayedTeamColumns" |
| 180 | + ></mat-header-row> |
| 181 | + <mat-row *matRowDef="let row; columns: displayedTeamColumns"></mat-row> |
83 | 182 | </mat-table> |
84 | | - |
85 | | - @if (userDataSource.filteredData.length === 0) { |
86 | | - <div>No results found</div> |
87 | | - } |
88 | | - <mat-paginator |
89 | | - #paginator |
90 | | - [pageSize]="defaultPageSize" |
91 | | - [showFirstLastButtons]="true" |
92 | | - (page)="pageEvent = $event" |
93 | | - > |
94 | | - </mat-paginator> |
95 | | - </div> |
96 | | - |
97 | | - <div style="margin-left: 20px"> |
98 | | - <div class="team-list-container mat-elevation-z8"> |
99 | | - <div id="userImport"> |
100 | | - <div class="sp-icon"> |
101 | | - <img height="35" src="assets/img/SP_Icon_Team.png" alt="Users" /> |
102 | | - Team Users |
103 | | - </div> |
104 | | - <div> |
105 | | - <button |
106 | | - mat-stroked-button |
107 | | - (click)="fileInput.click()" |
108 | | - title="Import users from a CSV containing a single column of user IDs" |
109 | | - > |
110 | | - Import Users |
111 | | - </button> |
112 | | - </div> |
113 | | - <input |
114 | | - hidden |
115 | | - (change)="uploadUsers($event.target.files)" |
116 | | - #fileInput |
117 | | - type="file" |
118 | | - /> |
119 | | - </div> |
120 | | - |
121 | | - @if (isLoading) { |
122 | | - <mat-card |
123 | | - class="d-flex justify-content-center align-items-center" |
124 | | - > |
125 | | - <mat-progress-spinner color="primary" mode="indeterminate"> |
126 | | - </mat-progress-spinner> |
127 | | - </mat-card> |
128 | | - } |
129 | | - |
130 | | - <mat-table |
131 | | - class="mat-table-team-users" |
132 | | - #table |
133 | | - [dataSource]="teamUserDataSource" |
134 | | - > |
135 | | - <ng-container matColumnDef="name"> |
136 | | - <mat-header-cell *matHeaderCellDef>User Name</mat-header-cell> |
137 | | - <mat-cell *matCellDef="let element"> |
138 | | - @if (element.user.name !== null) { |
139 | | - <div> |
140 | | - {{ element.user.name }} |
141 | | - </div> |
142 | | - } |
143 | | - @if (element.user.name === null) { |
144 | | - <div>{{ element.user.id }}</div> |
145 | | - } |
146 | | - </mat-cell> |
147 | | - </ng-container> |
148 | | - |
149 | | - <ng-container matColumnDef="teamMembership"> |
150 | | - <mat-header-cell *matHeaderCellDef>Role</mat-header-cell> |
151 | | - <mat-cell *matCellDef="let element"> |
152 | | - <mat-form-field> |
153 | | - <mat-select |
154 | | - placeholder="Role" |
155 | | - name="teamMembershipRole" |
156 | | - [(ngModel)]="element.teamMembership.roleId" |
157 | | - (selectionChange)="updateMembership(element)" |
158 | | - [(value)]="element.teamMembership.roleId" |
159 | | - > |
160 | | - @for (role of roles; track role) { |
161 | | - <mat-option [value]="role.id"> |
162 | | - {{ role.name }} |
163 | | - </mat-option> |
164 | | - } |
165 | | - </mat-select> |
166 | | - </mat-form-field> |
167 | | - </mat-cell> |
168 | | - </ng-container> |
169 | | - |
170 | | - <ng-container matColumnDef="user"> |
171 | | - <mat-header-cell *matHeaderCellDef> </mat-header-cell> |
172 | | - <mat-cell style="margin-left: 20px" *matCellDef="let element"> |
173 | | - <div> |
174 | | - <button mat-stroked-button (click)="removeUserFromTeam(element)"> |
175 | | - Remove |
176 | | - </button> |
177 | | - </div> |
178 | | - </mat-cell> |
179 | | - </ng-container> |
180 | | - |
181 | | - <mat-header-row |
182 | | - *matHeaderRowDef="displayedTeamColumns" |
183 | | - ></mat-header-row> |
184 | | - <mat-row *matRowDef="let row; columns: displayedTeamColumns"></mat-row> |
185 | | - </mat-table> |
186 | | - </div> |
187 | 183 | </div> |
188 | 184 | </div> |
| 185 | +</div> |
189 | 186 |
|
190 | | - <div class="d-flex justify-content-center"> |
191 | | - <mat-dialog-actions> |
192 | | - <button mat-stroked-button (click)="done()">Done</button> |
193 | | - </mat-dialog-actions> |
194 | | - </div> |
| 187 | +<div class="d-flex justify-content-center"> |
| 188 | + <mat-dialog-actions> |
| 189 | + <button mat-stroked-button (click)="done()">Done</button> |
| 190 | + </mat-dialog-actions> |
| 191 | +</div> |
0 commit comments