Skip to content

Commit

Permalink
Merge pull request #394 from sancsoft/393-points-ui-should-not-show-e…
Browse files Browse the repository at this point in the history
…dit-icon-for-users-who-cant-edit-points

added a condition on points edit to make it show for any role other t…
  • Loading branch information
rmaffitsancsoft authored Jan 13, 2025
2 parents 33ca0a2 + 52b7a95 commit 69ce33d
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -82,9 +82,18 @@ <h1 class="font-rajdhani font-semibold text-3xl px-5 mb-5">Planning Points</h1>
>
</td>
<td>
<button (click)="editStaffPlanningPoint(staff)" title="Edit points">
<i class="bi bi-pencil-fill text-gray-450"></i>
</button>
@if (
[HQRole.Manager, HQRole.Partner, HQRole.Administrator]
| inRole
| async
) {
<button
(click)="editStaffPlanningPoint(staff)"
title="Edit points"
>
<i class="bi bi-pencil-fill text-gray-450"></i>
</button>
}
</td>
@for (point of staff.points; track point.id) {
<td width="165" class="border-l border-black">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ import { formControlChanges } from '../../core/functions/form-control-changes';
import { PlanningPointsModalComponent } from '../planning-points-modal/planning-points-modal.component';
import { Dialog } from '@angular/cdk/dialog';
import { SelectInputComponent } from '../../core/components/select-input/select-input.component';
import { HQRole } from '../../enums/hqrole';
import { InRolePipe } from '../../pipes/in-role.pipe';

@Component({
selector: 'hq-planning-points',
Expand All @@ -34,6 +36,7 @@ import { SelectInputComponent } from '../../core/components/select-input/select-
CommonModule,
CoreModule,
RouterLink,
InRolePipe,
FormsModule,
ReactiveFormsModule,
SelectInputComponent,
Expand All @@ -56,6 +59,8 @@ export class PlanningPointsComponent implements OnDestroy {
chargeCodeToColor = chargeCodeToColor;
private destroyed$: ReplaySubject<boolean> = new ReplaySubject(1);

HQRole = HQRole;

summary$: Observable<GetPointsSummaryResponseV1>;

constructor(
Expand Down

0 comments on commit 69ce33d

Please sign in to comment.