Skip to content

Commit 4007a5e

Browse files
committed
feat: TT-430 column status change in prod or dev mode and delete is managed in backend
1 parent edaae8f commit 4007a5e

File tree

2 files changed

+16
-10
lines changed

2 files changed

+16
-10
lines changed

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

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,27 +2,34 @@
22
<table class="table table-sm table-bordered table-striped">
33
<thead class="thead-blue">
44
<tr class="d-flex">
5-
<th class="col-2 text-center">Activity ID</th>
5+
<th class="col-4 text-center">Activity ID</th>
66
<th class="col-4 text-center">Activity</th>
7-
<th class="{{showOptionInDevelopment ? 'col-2' : 'col-6'}} text-center">Status</th>
87
<th class="col-2 text-center" *ngIf="showOptionInDevelopment">Options</th>
9-
<th scope="col" class="col-2 text-center" *ngIf="showOptionInDevelopment">Status</th>
8+
<th class="{{ showOptionInDevelopment ? 'col-2' : 'col-4' }} text-center">Status</th>
109
</tr>
1110
</thead>
1211
<app-loading-bar *ngIf="isLoading$ | async"></app-loading-bar>
1312
<tbody *ngIf="(isLoading$ | async) === false">
1413
<tr class="d-flex" *ngFor="let activity of activities">
15-
<td class="col-2 text-break">{{ activity.id }}</td>
14+
<td class="col-4 text-break">{{ activity.id }}</td>
1615
<td class="col-4">{{ activity.name }}</td>
17-
<td class="{{showOptionInDevelopment ? 'col-2' : 'col-6'}} text-center">{{ activity.status }}</td>
1816
<td class="col-2 text-center" *ngIf="showOptionInDevelopment">
1917
<button type="button" class="btn btn-sm btn-primary" (click)="updateActivity(activity.id)">
2018
<i class="fa fa-pencil fa-xs"></i>
2119
</button>
2220
</td>
23-
<td class="col-2 text-center" *ngIf="showOptionInDevelopment">
24-
<app-dropdown [info]="activity" (updateInfo)="changeOperation($event)"> </app-dropdown>
25-
</td>
21+
<div *ngIf="showOptionInDevelopment; then devBlock; else prodBlock"></div>
22+
<ng-template #devBlock>
23+
<td class="col-2 text-center">
24+
<app-dropdown [info]="activity" (updateInfo)="changeOperation($event)"></app-dropdown>
25+
</td>
26+
</ng-template>
27+
<ng-template #prodBlock>
28+
<td class="col-4 text-center">
29+
<em class="fa mr-2 mt-1" [ngClass]="[activity.btnIcon, activity.iconColor]"></em>
30+
<span>{{ activity.btnName }}</span>
31+
</td>
32+
</ng-template>
2633
</tr>
2734
</tbody>
2835
</table>

src/app/modules/activities-management/store/activity-management.effects.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,8 +96,7 @@ export class ActivityEffects {
9696
ofType(actions.ActivityManagementActionTypes.UNARCHIVE_ACTIVITY),
9797
map((action: actions.UnarchiveActivity) => ({
9898
id: action.payload,
99-
status: 'active',
100-
deleted: false
99+
status: 'active'
101100
})
102101
),
103102
mergeMap((activity: ActivityStatus) =>

0 commit comments

Comments
 (0)