Skip to content

Commit

Permalink
Open all portal non-decision documents in new browser tab iframe with…
Browse files Browse the repository at this point in the history
… file name
  • Loading branch information
sandratoh committed Mar 11, 2024
1 parent 2e1f124 commit 4ed225d
Show file tree
Hide file tree
Showing 46 changed files with 129 additions and 59 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@ import {
ApplicationOwnerDetailedDto,
ApplicationOwnerDto,
} from '../../../services/application-owner/application-owner.dto';
import { PARCEL_OWNERSHIP_TYPE } from '../../../services/application-parcel/application-parcel.dto';
import { ApplicationParcelService } from '../../../services/application-parcel/application-parcel.service';
import { ApplicationSubmissionDetailedDto } from '../../../services/application-submission/application-submission.dto';
import { LocalGovernmentDto } from '../../../services/code/code.dto';
import { CodeService } from '../../../services/code/code.service';
import { DOCUMENT_SOURCE, DOCUMENT_TYPE } from '../../../shared/dto/document.dto';
import { OWNER_TYPE } from '../../../shared/dto/owner.dto';
import { openFileIframe } from '../../../shared/utils/file';

@Component({
selector: 'app-application-details',
Expand Down Expand Up @@ -85,7 +85,9 @@ export class ApplicationDetailsComponent implements OnInit, OnDestroy {

async openFile(uuid: string) {
const res = await this.applicationDocumentService.openFile(uuid);
window.open(res?.url, '_blank');
if (res) {
openFileIframe(res);
}
}

async onNavigateToStep(step: number) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import { ApplicationSubmissionDetailedDto } from '../../../../services/applicati
import { CovenantTransfereeDto } from '../../../../services/covenant-transferee/covenant-transferee.dto';
import { CovenantTransfereeService } from '../../../../services/covenant-transferee/covenant-transferee.service';
import { DOCUMENT_TYPE } from '../../../../shared/dto/document.dto';
import { openFileIframe } from '../../../../shared/utils/file';

@Component({
selector: 'app-cove-details',
Expand Down Expand Up @@ -53,7 +54,9 @@ export class CoveDetailsComponent {

async openFile(uuid: string) {
const res = await this.applicationDocumentService.openFile(uuid);
window.open(res?.url, '_blank');
if (res) {
openFileIframe(res);
}
}

private async loadTransferees(uuid: string) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { ApplicationDocumentService } from '../../../../services/application-doc
import { ApplicationSubmissionDetailedDto } from '../../../../services/application-submission/application-submission.dto';
import { ApplicationDocumentDto } from '../../../../services/application-document/application-document.dto';
import { DOCUMENT_TYPE } from '../../../../shared/dto/document.dto';
import { openFileIframe } from '../../../../shared/utils/file';

@Component({
selector: 'app-excl-details',
Expand Down Expand Up @@ -53,6 +54,8 @@ export class ExclDetailsComponent {

async openFile(uuid: string) {
const res = await this.applicationDocumentService.openFile(uuid);
window.open(res?.url, '_blank');
if (res) {
openFileIframe(res);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import { ApplicationSubmissionDetailedDto } from '../../../../services/applicati
import { ApplicationDocumentDto } from '../../../../services/application-document/application-document.dto';
import { AuthenticationService } from '../../../../services/authentication/authentication.service';
import { DOCUMENT_TYPE } from '../../../../shared/dto/document.dto';
import { openFileIframe } from '../../../../shared/utils/file';

@Component({
selector: 'app-incl-details',
Expand Down Expand Up @@ -73,7 +74,9 @@ export class InclDetailsComponent implements OnInit, OnDestroy {

async openFile(uuid: string) {
const res = await this.applicationDocumentService.openFile(uuid);
window.open(res?.url, '_blank');
if (res) {
openFileIframe(res);
}
}

ngOnDestroy(): void {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { ApplicationDocumentDto } from '../../../../services/application-documen
import { ApplicationDocumentService } from '../../../../services/application-document/application-document.service';
import { ApplicationSubmissionDetailedDto } from '../../../../services/application-submission/application-submission.dto';
import { DOCUMENT_TYPE } from '../../../../shared/dto/document.dto';
import { openFileIframe } from '../../../../shared/utils/file';

@Component({
selector: 'app-naru-details[applicationSubmission]',
Expand Down Expand Up @@ -43,6 +44,8 @@ export class NaruDetailsComponent {

async openFile(uuid: string) {
const res = await this.applicationDocumentService.openFile(uuid);
window.open(res?.url, '_blank');
if (res) {
openFileIframe(res);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { ApplicationDocumentDto } from '../../../../services/application-documen
import { ApplicationDocumentService } from '../../../../services/application-document/application-document.service';
import { ApplicationSubmissionDetailedDto } from '../../../../services/application-submission/application-submission.dto';
import { DOCUMENT_TYPE } from '../../../../shared/dto/document.dto';
import { openFileIframe } from '../../../../shared/utils/file';

@Component({
selector: 'app-nfu-details[applicationSubmission]',
Expand Down Expand Up @@ -35,6 +36,8 @@ export class NfuDetailsComponent {

async openFile(uuid: string) {
const res = await this.applicationDocumentService.openFile(uuid);
window.open(res?.url, '_blank');
if (res) {
openFileIframe(res);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import { BehaviorSubject, Subject, takeUntil } from 'rxjs';
import { ApplicationDocumentDto } from '../../../../services/application-document/application-document.dto';
import { ApplicationDocumentService } from '../../../../services/application-document/application-document.service';
import { ApplicationOwnerDto } from '../../../../services/application-owner/application-owner.dto';
import { ApplicationOwnerService } from '../../../../services/application-owner/application-owner.service';
import {
ApplicationParcelDto,
ApplicationParcelUpdateDto,
Expand All @@ -14,6 +13,7 @@ import { ApplicationParcelService } from '../../../../services/application-parce
import { ApplicationSubmissionDetailedDto } from '../../../../services/application-submission/application-submission.dto';
import { BaseCodeDto } from '../../../../shared/dto/base.dto';
import { formatBooleanToYesNoString } from '../../../../shared/utils/boolean-helper';
import { openFileIframe } from '../../../../shared/utils/file';

export class ApplicationParcelBasicValidation {
// indicates general validity check state, including owner related information
Expand Down Expand Up @@ -101,7 +101,7 @@ export class ParcelComponent {
async onOpenFile(uuid: string) {
const res = await this.applicationDocumentService.openFile(uuid);
if (res) {
window.open(res.url, '_blank');
openFileIframe(res);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { ApplicationDocumentDto } from '../../../../services/application-documen
import { ApplicationDocumentService } from '../../../../services/application-document/application-document.service';
import { ApplicationSubmissionDetailedDto } from '../../../../services/application-submission/application-submission.dto';
import { DOCUMENT_TYPE } from '../../../../shared/dto/document.dto';
import { openFileIframe } from '../../../../shared/utils/file';

@Component({
selector: 'app-pfrs-details[applicationSubmission]',
Expand Down Expand Up @@ -49,6 +50,8 @@ export class PfrsDetailsComponent {

async openFile(uuid: string) {
const res = await this.applicationDocumentService.openFile(uuid);
window.open(res?.url, '_blank');
if (res) {
openFileIframe(res);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { ApplicationDocumentDto } from '../../../../services/application-documen
import { ApplicationDocumentService } from '../../../../services/application-document/application-document.service';
import { ApplicationSubmissionDetailedDto } from '../../../../services/application-submission/application-submission.dto';
import { DOCUMENT_TYPE } from '../../../../shared/dto/document.dto';
import { openFileIframe } from '../../../../shared/utils/file';

@Component({
selector: 'app-pofo-details[applicationSubmission]',
Expand Down Expand Up @@ -47,6 +48,8 @@ export class PofoDetailsComponent {

async openFile(uuid: string) {
const res = await this.applicationDocumentService.openFile(uuid);
window.open(res?.url, '_blank');
if (res) {
openFileIframe(res);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { ApplicationDocumentDto } from '../../../../services/application-documen
import { ApplicationDocumentService } from '../../../../services/application-document/application-document.service';
import { ApplicationSubmissionDetailedDto } from '../../../../services/application-submission/application-submission.dto';
import { DOCUMENT_TYPE } from '../../../../shared/dto/document.dto';
import { openFileIframe } from '../../../../shared/utils/file';

@Component({
selector: 'app-roso-details[applicationSubmission]',
Expand Down Expand Up @@ -47,6 +48,8 @@ export class RosoDetailsComponent {

async openFile(uuid: string) {
const res = await this.applicationDocumentService.openFile(uuid);
window.open(res?.url, '_blank');
if (res) {
openFileIframe(res);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { ApplicationDocumentService } from '../../../../services/application-doc
import { ApplicationParcelService } from '../../../../services/application-parcel/application-parcel.service';
import { ApplicationSubmissionDetailedDto } from '../../../../services/application-submission/application-submission.dto';
import { DOCUMENT_TYPE } from '../../../../shared/dto/document.dto';
import { openFileIframe } from '../../../../shared/utils/file';

@Component({
selector: 'app-subd-details[applicationSubmission]',
Expand Down Expand Up @@ -57,7 +58,9 @@ export class SubdDetailsComponent {

async openFile(uuid: string) {
const res = await this.applicationDocumentService.openFile(uuid);
window.open(res?.url, '_blank');
if (res) {
openFileIframe(res);
}
}

private async loadParcels(fileNumber: string) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { ApplicationDocumentDto } from '../../../../services/application-documen
import { ApplicationDocumentService } from '../../../../services/application-document/application-document.service';
import { ApplicationSubmissionDetailedDto } from '../../../../services/application-submission/application-submission.dto';
import { DOCUMENT_TYPE } from '../../../../shared/dto/document.dto';
import { openFileIframe } from '../../../../shared/utils/file';

@Component({
selector: 'app-tur-details[applicationSubmission]',
Expand Down Expand Up @@ -44,6 +45,8 @@ export class TurDetailsComponent {

async openFile(uuid: string) {
const res = await this.applicationDocumentService.openFile(uuid);
window.open(res?.url, '_blank');
if (res) {
openFileIframe(res);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import { DOCUMENT_TYPE } from '../../../shared/dto/document.dto';
import { FileHandle } from '../../../shared/file-drag-drop/drag-drop.directive';
import { RemoveFileConfirmationDialogComponent } from '../alcs-edit-submission/remove-file-confirmation-dialog/remove-file-confirmation-dialog.component';
import { StepComponent } from './step.partial';
import { openFileIframe } from '../../../shared/utils/file';

@Component({
selector: 'app-file-step',
Expand Down Expand Up @@ -85,7 +86,7 @@ export abstract class FilesStepComponent extends StepComponent {
async openFile(uuid: string) {
const res = await this.applicationDocumentService.openFile(uuid);
if (res) {
window.open(res.url, '_blank');
openFileIframe(res);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import { OwnerDialogComponent } from '../../../../../shared/owner-dialogs/owner-
import { formatBooleanToString } from '../../../../../shared/utils/boolean-helper';
import { RemoveFileConfirmationDialogComponent } from '../../../alcs-edit-submission/remove-file-confirmation-dialog/remove-file-confirmation-dialog.component';
import { ParcelEntryConfirmationDialogComponent } from './parcel-entry-confirmation-dialog/parcel-entry-confirmation-dialog.component';
import { openFileIframe } from '../../../../../shared/utils/file';

export interface ParcelEntryFormData {
uuid: string;
Expand Down Expand Up @@ -345,7 +346,7 @@ export class ParcelEntryComponent implements OnInit {
async openFile(uuid: string) {
const res = await this.applicationDocumentService.openFile(uuid);
if (res) {
window.open(res.url, '_blank');
openFileIframe(res);
}
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { Component, EventEmitter, Input, OnDestroy, OnInit, Output } from '@angular/core';
import { Router } from '@angular/router';
import { BehaviorSubject, Subject, takeUntil } from 'rxjs';
import { ApplicationDocumentDto } from '../../../../services/application-document/application-document.dto';
import { ApplicationDocumentService } from '../../../../services/application-document/application-document.service';
Expand All @@ -8,6 +7,7 @@ import { ToastService } from '../../../../services/toast/toast.service';
import { DOCUMENT_SOURCE, DOCUMENT_TYPE } from '../../../../shared/dto/document.dto';
import { FileHandle } from '../../../../shared/file-drag-drop/drag-drop.directive';
import { ReviewApplicationFngSteps, ReviewApplicationSteps } from '../review-submission.component';
import { openFileIframe } from '../../../../shared/utils/file';

@Component({
selector: 'app-review-attachments',
Expand Down Expand Up @@ -128,7 +128,7 @@ export class ReviewAttachmentsComponent implements OnInit, OnDestroy {
async openFile(uuid: string) {
const res = await this.applicationDocumentService.openFile(uuid);
if (res) {
window.open(res.url, '_blank');
openFileIframe(res);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import { MOBILE_BREAKPOINT } from '../../../../shared/utils/breakpoints';
import { ReviewApplicationFngSteps } from '../review-submission.component';
import { ToastService } from '../../../../services/toast/toast.service';
import { SubmitConfirmationDialogComponent } from '../submit-confirmation-dialog/submit-confirmation-dialog.component';
import { openFileIframe } from '../../../../shared/utils/file';

@Component({
selector: 'app-review-submit-fng[stepper]',
Expand Down Expand Up @@ -123,7 +124,7 @@ export class ReviewSubmitFngComponent implements OnInit, OnDestroy {
async openFile(uuid: string) {
const res = await this.applicationDocumentService.openFile(uuid);
if (res) {
window.open(res.url, '_blank');
openFileIframe(res);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import { DOCUMENT_SOURCE, DOCUMENT_TYPE } from '../../../../shared/dto/document.
import { MOBILE_BREAKPOINT } from '../../../../shared/utils/breakpoints';
import { ReviewApplicationSteps } from '../review-submission.component';
import { SubmitConfirmationDialogComponent } from '../submit-confirmation-dialog/submit-confirmation-dialog.component';
import { openFileIframe } from '../../../../shared/utils/file';

@Component({
selector: 'app-review-submit[stepper]',
Expand Down Expand Up @@ -131,7 +132,7 @@ export class ReviewSubmitComponent implements OnInit, OnDestroy {
async openFile(uuid: string) {
const res = await this.applicationDocumentService.openFile(uuid);
if (res) {
window.open(res.url, '_blank');
openFileIframe(res);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { MatTableDataSource } from '@angular/material/table';
import { BehaviorSubject, Subject, takeUntil } from 'rxjs';
import { ApplicationDocumentDto } from '../../../../../services/application-document/application-document.dto';
import { ApplicationDocumentService } from '../../../../../services/application-document/application-document.service';
import { openFileIframe } from '../../../../../shared/utils/file';

@Component({
selector: 'app-submission-documents',
Expand Down Expand Up @@ -32,7 +33,7 @@ export class SubmissionDocumentsComponent implements OnInit, OnDestroy {
async openFile(uuid: string) {
const res = await this.applicationDocumentService.openFile(uuid);
if (res) {
window.open(res.url, '_blank');
openFileIframe(res);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import {
} from '../../../../services/application-submission/application-submission.dto';
import { PdfGenerationService } from '../../../../services/pdf-generation/pdf-generation.service';
import { DOCUMENT_SOURCE, DOCUMENT_TYPE } from '../../../../shared/dto/document.dto';
import { openFileIframe } from '../../../../shared/utils/file';

@Component({
selector: 'app-lfng-review',
Expand Down Expand Up @@ -40,7 +41,7 @@ export class LfngReviewComponent implements OnInit, OnDestroy {
private applicationReviewService: ApplicationSubmissionReviewService,
private pdfGenerationService: PdfGenerationService,
private applicationDocumentService: ApplicationDocumentService,
private router: Router,
private router: Router
) {}

ngOnInit(): void {
Expand Down Expand Up @@ -69,7 +70,7 @@ export class LfngReviewComponent implements OnInit, OnDestroy {
this.$application.pipe(takeUntil(this.$destroy)).subscribe((application) => {
this.application = application;
this.submittedToAlcStatus = !!this.application?.submissionStatuses.find(
(s) => s.statusTypeCode === SUBMISSION_STATUS.SUBMITTED_TO_ALC && !!s.effectiveDate,
(s) => s.statusTypeCode === SUBMISSION_STATUS.SUBMITTED_TO_ALC && !!s.effectiveDate
);
this.isTurOrCov = this.application?.typeCode === 'COVE' || this.application?.typeCode === 'TURP';
this.loadReview();
Expand All @@ -78,10 +79,10 @@ export class LfngReviewComponent implements OnInit, OnDestroy {
this.$applicationDocuments.subscribe((documents) => {
this.staffReport = documents.filter((document) => document.type?.code === DOCUMENT_TYPE.STAFF_REPORT);
this.resolutionDocument = documents.filter(
(document) => document.type?.code === DOCUMENT_TYPE.RESOLUTION_DOCUMENT,
(document) => document.type?.code === DOCUMENT_TYPE.RESOLUTION_DOCUMENT
);
this.governmentOtherAttachments = documents.filter(
(document) => document.type?.code === DOCUMENT_TYPE.OTHER && document.source === DOCUMENT_SOURCE.LFNG,
(document) => document.type?.code === DOCUMENT_TYPE.OTHER && document.source === DOCUMENT_SOURCE.LFNG
);
});
}
Expand Down Expand Up @@ -109,7 +110,7 @@ export class LfngReviewComponent implements OnInit, OnDestroy {
async openFile(uuid: string) {
const res = await this.applicationDocumentService.openFile(uuid);
if (res) {
window.open(res.url, '_blank');
openFileIframe(res);
}
}

Expand Down
Loading

0 comments on commit 4ed225d

Please sign in to comment.