Skip to content

Commit

Permalink
Merge branch 'develop' into feature/prime-2605-2743-revise-claim-orga…
Browse files Browse the repository at this point in the history
…nization
  • Loading branch information
bergomi02 authored Nov 12, 2024
2 parents 4872bff + 90268ec commit 9d4c9fd
Show file tree
Hide file tree
Showing 59 changed files with 41,431 additions and 141 deletions.
77 changes: 0 additions & 77 deletions .github/workflows/build-deploy-backup-dev.yml

This file was deleted.

2 changes: 0 additions & 2 deletions .github/workflows/build-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ on:
push:
paths-ignore: # do NOT trigger on changes to backup service.
- prime-database-backup/**
- .github/workflows/build-deploy-backup-dev.yml
branches-ignore:
- 'develop'
- 'test'
Expand All @@ -13,7 +12,6 @@ on:
pull_request:
paths-ignore:
- prime-database-backup/**
- .github/workflows/build-deploy-backup-dev.yml
branches-ignore:
- 'develop'
- 'test'
Expand Down
17 changes: 17 additions & 0 deletions infrastructure/redis/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
FROM rhel8/redis-6

# Redis image based on Software Collections packages
#
# Volumes:
# * /var/lib/redis/data - Datastore for Redis
# Environment:
# * $REDIS_PASSWORD - Database password

EXPOSE 6379
USER root
# Add Tini
ENV TINI_VERSION v0.19.0
ADD https://github.com/krallin/tini/releases/download/${TINI_VERSION}/tini /tini
RUN chmod +x /tini
ENTRYPOINT ["/tini", "--", "container-entrypoint"]
CMD ["run-redis"]
Original file line number Diff line number Diff line change
Expand Up @@ -606,4 +606,37 @@ export class SiteResource {
})
);
}

public archiveSite(siteId: number, note: string): NoContent {
return this.apiResource.post<NoContent>(`sites/${siteId}/archive`, { note })
.pipe(
NoContentResponse,
catchError((error: any) => {
this.logger.error('[SiteRegistration] SiteResource::archiveSite error has occurred: ', error);
throw error;
})
);
}

public restoreArchivedSite(siteId: number, note: string): NoContent {
return this.apiResource.post<NoContent>(`sites/${siteId}/restore`, { note })
.pipe(
NoContentResponse,
catchError((error: any) => {
this.logger.error('[SiteRegistration] SiteResource::restoreArchivedSite error has occurred: ', error);
throw error;
})
);
}

public canRestoreSite(siteId: number): Observable<boolean> {
return this.apiResource.get<boolean>(`sites/${siteId}/can-restore`)
.pipe(
map((response: ApiHttpResponse<boolean>) => response.result),
catchError((error: any) => {
this.logger.error('[SiteRegistration] SiteResource::canRestoreSite error has occurred: ', error);
throw error;
})
);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,7 @@ export enum SiteAdjudicationAction {
REQUEST_CHANGES = 1,
APPROVE = 2,
REJECT = 3,
UNREJECT = 4
UNREJECT = 4,
ARCHIVE = 7,
RESTORE = 8,
}
3 changes: 2 additions & 1 deletion prime-angular-frontend/src/app/lib/enums/site-status.enum.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,6 @@ export enum SiteStatusType {
IN_REVIEW = 2,
LOCKED = 3,
EDITABLE_NOT_APPROVED = 4,
FLAGGED = 5
FLAGGED = 5,
ARCHIVED = 8,
}
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import { SiteRegistrationNote } from '@shared/models/site-registration-note.mode

import { AdjudicationRoutes } from '@adjudication/adjudication.routes';
import { AdjudicationResource } from '../services/adjudication-resource.service';
import { SiteActionEnum, SiteArchiveRestoreComponent } from '@shared/components/dialogs/content/site-archive-restore/site-archive-restore.component';

export abstract class AbstractSiteAdminPage {
public abstract busy: Subscription;
Expand Down Expand Up @@ -198,7 +199,7 @@ export abstract class AbstractSiteAdminPage {
message: 'Are you sure you want to reject this Site Registration?',
actionText: 'Reject Site Registration',
actionType: 'warn',
component: NoteComponent
component: NoteComponent,
};

this.busy = this.dialog.open(ConfirmDialogComponent, { data })
Expand All @@ -225,6 +226,54 @@ export abstract class AbstractSiteAdminPage {
.subscribe(() => this.onRefresh());
}

public onArchive(siteId: number): void {
const data: DialogOptions = {
data: {
siteId: siteId,
action: SiteActionEnum.Archive,
}
};

this.busy = this.dialog.open(SiteArchiveRestoreComponent, { data })
.afterClosed()
.subscribe((result: { reload: boolean }) => (result?.reload) ?
this.getDataset(this.route.snapshot.queryParams) : noop);
}

public onRestore(siteId: number): void {

this.siteResource.canRestoreSite(siteId)
.subscribe((value: boolean) => {

if (value) {
const data: DialogOptions = {
data: {
siteId: siteId,
action: SiteActionEnum.Restore,
}
};

this.busy = this.dialog.open(SiteArchiveRestoreComponent, { data })
.afterClosed()
.subscribe((result: { reload: boolean }) => (result?.reload) ?
this.getDataset(this.route.snapshot.queryParams) : noop);

} else {
const data: DialogOptions = {
title: 'Restore Archived Site',
message: 'Site ID has been used in a different site. This Site can\'t be restored.',
cancelText: "Close",
actionType: 'warn',
actionHide: true
};

this.dialog.open(ConfirmDialogComponent, { data })
.afterClosed()
.subscribe();
}
});
}

public onEnableEditing(siteId: number): void {
this.busy = this.siteResource.enableEditingSite(siteId)
.subscribe(() => this.onRefresh());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,9 @@
(escalate)="onEscalate($event)"
(enableEditing)="onEnableEditing($event)"
(flag)="onToggleFlagSite($event)"
(delete)="deleteSite($event)">
(delete)="deleteSite($event)"
(archive)="onArchive($event)"
(restore)="onRestore($event)">
</app-site-registration-actions>

</ng-template>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@
[class.editable]="row.status === SiteStatusType.EDITABLE && !row.approvedDate"
[class.under-review]="row.status === SiteStatusType.IN_REVIEW"
[class.approved]="row.status === SiteStatusType.EDITABLE && !!row.approvedDate"
[class.declined]="row.status === SiteStatusType.LOCKED">
[class.declined]="row.status === SiteStatusType.LOCKED || row.status === SiteStatusType.ARCHIVED">
<div class="d-flex align-items-center">
<span class="mr-1">{{ SiteStatusType[row.status] | case : 'snake' : 'space' | capitalize : true | default: 'Editable' }}</span>
<mat-icon *ngIf="row?.flagged"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,23 @@
<mat-icon>flag</mat-icon>
<span>{{siteRegistration?.isNew ? 'Unflag' : 'Flag'}} "Is New"</span>
</button>

<button mat-menu-item
[disabled]="!(Role.SUPER_ADMIN | inRole)"
*ngIf="isActionAllowed(SiteAdjudicationAction.ARCHIVE)"
(click)="onArchive()">
<mat-icon>archive</mat-icon>
<span>Archive Site</span>
</button>

<button mat-menu-item
[disabled]="!(Role.SUPER_ADMIN | inRole)"
*ngIf="isActionAllowed(SiteAdjudicationAction.RESTORE)"
(click)="onRestore()">
<mat-icon>unarchive</mat-icon>
<span>Restore Site</span>
</button>

<mat-divider></mat-divider>

<button mat-menu-item
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ export class SiteRegistrationActionsComponent implements OnInit {
@Output() public reject: EventEmitter<number>;
@Output() public unreject: EventEmitter<number>;
@Output() public escalate: EventEmitter<number>;
@Output() public archive: EventEmitter<number>;
@Output() public restore: EventEmitter<number>;
@Output() public delete: EventEmitter<{ [key: string]: number }>;
@Output() public enableEditing: EventEmitter<number>;
@Output() public flag: EventEmitter<{ siteId: number, flagged: boolean }>;
Expand All @@ -41,6 +43,8 @@ export class SiteRegistrationActionsComponent implements OnInit {
this.reject = new EventEmitter<number>();
this.unreject = new EventEmitter<number>();
this.escalate = new EventEmitter<number>();
this.archive = new EventEmitter<number>();
this.restore = new EventEmitter<number>();
this.enableEditing = new EventEmitter<number>();
this.flag = new EventEmitter<{ siteId: number, flagged: boolean }>();
this.isNew = new EventEmitter<{ siteId: number, isNew: boolean }>();
Expand Down Expand Up @@ -82,6 +86,14 @@ export class SiteRegistrationActionsComponent implements OnInit {
}
}

public onArchive() {
this.archive.emit(this.siteRegistration.id);
}

public onRestore() {
this.restore.emit(this.siteRegistration.id);
}

public onContactSigningAuthority() {
const site = this.siteRegistration as SiteRegistrationListViewModel;
const signingAuthority = site.signingAuthority;
Expand Down Expand Up @@ -161,13 +173,17 @@ export class SiteRegistrationActionsComponent implements OnInit {
public isActionAllowed(action: SiteAdjudicationAction): boolean {
switch (this.siteRegistration.status) {
case SiteStatusType.EDITABLE:
return (action === SiteAdjudicationAction.REJECT);
return (action === SiteAdjudicationAction.REJECT
|| action === SiteAdjudicationAction.ARCHIVE);
case SiteStatusType.IN_REVIEW:
return (action === SiteAdjudicationAction.REQUEST_CHANGES
|| action === SiteAdjudicationAction.APPROVE
|| action === SiteAdjudicationAction.REJECT);
|| action === SiteAdjudicationAction.REJECT
|| action === SiteAdjudicationAction.ARCHIVE);
case SiteStatusType.LOCKED:
return (action === SiteAdjudicationAction.UNREJECT);
case SiteStatusType.ARCHIVED:
return (action === SiteAdjudicationAction.RESTORE);
default:
return false;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@
(delete)="onDelete($event)"
(unreject)="onUnreject($event)"
(escalate)="onEscalate($event)"
(archive)="onArchive($event)"
(restore)="onRestore($event)"
(enableEditing)="onEnableEditing($event)"
(flag)="onToggleFlagSite($event)"
(isNew)="onToggleIsNewSite($event)">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,7 @@ export class SiteRegistrationContainerComponent extends AbstractSiteAdminPage im
signingAuthority,
signingAuthorityName: `${signingAuthority.firstName ? signingAuthority.firstName : ''} ${signingAuthority.lastName}`,
organizationName: name,
duplicatePecSiteCount: 0,
name,
organizationDoingBusinessAs: doingBusinessAs,
hasClaim,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@
[class.editable]="row.status === SiteStatusType.EDITABLE && !row.approvedDate"
[class.under-review]="row.status === SiteStatusType.IN_REVIEW"
[class.approved]="row.status === SiteStatusType.EDITABLE && !!row.approvedDate"
[class.declined]="row.status === SiteStatusType.LOCKED">
[class.declined]="row.status === SiteStatusType.LOCKED || row.status === SiteStatusType.ARCHIVED">
<div class="d-flex align-items-center">
<span class="mr-1">{{ SiteStatusType[row.status] | case : 'snake' : 'space' | capitalize : true | default: 'Editable' }}</span>
<mat-icon *ngIf="row?.flagged"
Expand All @@ -109,7 +109,17 @@
*matHeaderCellDef
scope="col"> Site ID </th>
<td mat-cell
*matCellDef="let row;"> {{ row.pec | default }} </td>
*matCellDef="let row;">
<div class="d-flex align-items-center">
{{ row.pec | default }}
<mat-icon *ngIf="row?.duplicatePecSiteCount && row?.duplicatePecSiteCount > 0"
[matTooltip]="getDuplicatePecText(row)"
class="pec-alert"
(click)="onPecFilter(row.pec)"
matTooltipPosition="after">info
</mat-icon>
</div>
</td>
</ng-container>

<ng-container matColumnDef="remoteUsers">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,15 @@
.red {
color: orangered;
}

.pec-alert {
color: theme-palette(yellow);
font-size: large;
}

.prefix-container {
height: 48px;
width: 24px;
padding-top: 3px;
padding-bottom: 3px;
}
Loading

0 comments on commit 9d4c9fd

Please sign in to comment.