Skip to content

Commit 6c1c06f

Browse files
feat: TT-208 add switch status button in column
1 parent 217fbb8 commit 6c1c06f

File tree

3 files changed

+34
-15
lines changed

3 files changed

+34
-15
lines changed

src/app/modules/activities-management/components/activity-list/activity-list.component.html

Lines changed: 25 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -5,39 +5,49 @@
55
<th class="col-4 text-center">Activity ID</th>
66
<th class="col-4 text-center">Activity</th>
77
<th class="col-2 text-center">Options</th>
8-
<th class="col-2 text-center">Status</th>
8+
<th class="col-2 text-center">Visibility</th>
99
</tr>
1010
</thead>
11-
<app-loading-bar *ngIf="(isLoading$ | async)"></app-loading-bar>
11+
<app-loading-bar *ngIf="isLoading$ | async"></app-loading-bar>
1212
<tbody *ngIf="(isLoading$ | async) === false">
1313
<tr class="d-flex" *ngFor="let activity of activities">
1414
<td class="col-4 text-break">{{ activity.id }}</td>
15-
<td class="col-4 ">{{ activity.name }}</td>
15+
<td class="col-4">{{ activity.name }}</td>
1616
<td class="col-2 text-center">
1717
<button type="button" class="btn btn-sm btn-primary" (click)="updateActivity(activity.id)">
1818
<i class="fa fa-pencil fa-xs"></i>
1919
</button>
20-
<button type="button" class="btn btn-sm btn-danger ml-2" data-toggle="modal" data-target="#deleteModal"
21-
(click)="openModal(activity)">
20+
<button
21+
type="button"
22+
class="btn btn-sm btn-danger ml-2"
23+
data-toggle="modal"
24+
data-target="#deleteModal"
25+
(click)="openModal(activity)"
26+
>
2227
<i class="fas fa-trash-alt fa-xs"></i>
2328
</button>
2429
</td>
2530
<td class="col-2 text-center">
26-
status
31+
<ui-switch
32+
size="small"
33+
(change)="switchStatus('active')"
34+
[checked]="activity.status === 'active'"
35+
></ui-switch>
2736
</td>
2837
</tr>
2938
</tbody>
3039
</table>
3140
</div>
3241

33-
<app-dialog
34-
*ngIf="showModal"
35-
class="modal fade"
36-
id="deleteModal"
37-
tabindex="-1"
38-
role="dialog"
42+
<app-dialog
43+
*ngIf="showModal"
44+
class="modal fade"
45+
id="deleteModal"
46+
tabindex="-1"
47+
role="dialog"
3948
aria-hidden="true"
40-
[title]="'Delete Activity'"
41-
[body]="message"
42-
(closeModalEvent)="deleteActivity()">
49+
[title]="'Delete Activity'"
50+
[body]="message"
51+
(closeModalEvent)="deleteActivity()"
52+
>
4353
</app-dialog>

src/app/modules/activities-management/components/activity-list/activity-list.component.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,4 +48,12 @@ export class ActivityListComponent implements OnInit {
4848
this.message = `Are you sure you want to delete ${item.name}?`;
4949
this.showModal = true;
5050
}
51+
52+
switchStatus(state: string): void {
53+
// this.store.dispatch(
54+
// user.groups.includes(groupName)
55+
// ? new RemoveUserFromGroup(user.id, groupName)
56+
// : new AddUserToGroup(user.id, groupName)
57+
// );
58+
}
5159
}

src/app/modules/shared/models/activity.model.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,5 @@ export interface Activity {
33
name: string;
44
description: string;
55
tenant_id?: string;
6+
status?: string;
67
}

0 commit comments

Comments
 (0)