Skip to content

Commit

Permalink
Merge branch 'OCD-4484' into development
Browse files Browse the repository at this point in the history
  • Loading branch information
andlar committed Mar 12, 2024
2 parents 92a875e + c07e5e8 commit 8f46368
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 28 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ const SurveillanceReportRelevantListingsComponent = {
relevantListing: '<',
surveillanceOutcomes: '<',
surveillanceProcessTypes: '<',
onSave: '&',
},
controller: class SurveillanceReportRelevantListingComponent {
constructor($log, DateUtil) {
Expand Down Expand Up @@ -48,11 +47,6 @@ const SurveillanceReportRelevantListingsComponent = {
cancelEdit() {
this.activeListing = undefined;
}

save(listing) {
this.onSave({ listing });
this.activeListing = undefined;
}
},
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,10 @@ const SurveillanceReportRelevantSurveillanceComponent = {
cancel() {
this.onCancel();
}

shouldShowOtherSurveillanceProcessTypesExplanation() {
return this.surveillance.surveillanceProcessTypes?.some((spt) => spt.name === 'Other - [Please describe]');
}
},
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,13 @@ <h4>Surveillance Data</h4>
</div>
<div class="form-group">
<label class="control-label" for="surveillance-process-type">Surveillance Process Type</label>
<select class="form-control" id="surveillance-process-type" name="surveillanceProcessType" ng-model="$ctrl.surveillance.surveillanceProcessType"
<p class="form-control-static">Select all activities that were conducted as part of the process to surveil this listing/developer for potential non-conformities.</p>
<select class="form-control" id="surveillance-process-types" name="surveillanceProcessTypes" ng-model="$ctrl.surveillance.surveillanceProcessTypes"
multiple
ng-disabled="!$ctrl.hasAnyRole(['chpl-admin', 'chpl-onc-acb'])"
ng-options="type as type.name for type in $ctrl.surveillanceProcessTypes track by type.id"></select>
</div>
<div class="form-group" ng-if="$ctrl.surveillance.surveillanceProcessType.name === 'Other - [Please describe]'">
<div class="form-group" ng-if="$ctrl.shouldShowOtherSurveillanceProcessTypesExplanation()">
<label class="control-label" for="surveillance-process-type-other">Surveillance Process Type - Other Explanation <span class="text-danger">*</span></label>
<input type="text" class="form-control" id="surveillance-process-type-other" name="surveillanceProcessTypeOther" ng-model="$ctrl.surveillance.surveillanceProcessTypeOther"
ng-disabled="!$ctrl.hasAnyRole(['chpl-admin', 'chpl-onc-acb'])" required></input>
Expand Down
15 changes: 0 additions & 15 deletions src/app/pages/surveillance/reporting/quarter.component.js
Original file line number Diff line number Diff line change
Expand Up @@ -102,21 +102,6 @@ export const SurveillanceReportQuarterComponent = {
});
}

saveRelevantListing (listing) {
let that = this;
this.networkService.updateRelevantListing(this.report.id, listing).then(() => {
that.networkService.getRelevantListings(that.report.id).then(results => {
that.relevantListings = results;
that.parseRelevantListings(that.relevantListings);
});
}, () => {
that.networkService.getRelevantListings(that.report.id).then(results => {
that.relevantListings = results;
that.parseRelevantListings(that.relevantListings);
});
});
}

isRelevantSurveillance (surveillance) {
let reportStart = this.report.startDay;
let reportEnd = this.report.endDay;
Expand Down
1 change: 0 additions & 1 deletion src/app/pages/surveillance/reporting/quarter.html
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@ <h2>Quarterly Report</h2>
<chpl-surveillance-report-relevant-listings
listings="$ctrl.relevantListings"
quarterly-report="$ctrl.report"
on-save="$ctrl.saveRelevantListing(listing)"
relevant-listing="$ctrl.relevantListing"
surveillance-outcomes="$ctrl.surveillanceOutcomes"
surveillance-process-types="$ctrl.surveillanceProcessTypes">
Expand Down
4 changes: 0 additions & 4 deletions src/app/services/network.service.js
Original file line number Diff line number Diff line change
Expand Up @@ -561,10 +561,6 @@ export default class NetworkService {
return this.apiPUT('/surveillance-report/quarterly', report);
}

updateRelevantListing(reportId, listing) {
return this.apiPUT(`/surveillance-report/quarterly/${reportId}/listings/${listing.id}`, listing);
}

updateRelevantSurveillance(reportId, surveillance) {
return this.apiPUT(`/surveillance-report/quarterly/${reportId}/surveillance/${surveillance.id}`, surveillance);
}
Expand Down

0 comments on commit 8f46368

Please sign in to comment.