Skip to content

Commit

Permalink
Merge pull request #335 from dcsaorg/DDT-1370-bug-fixes
Browse files Browse the repository at this point in the history
DDT-1370: bug fixes
  • Loading branch information
douradofrazer authored Dec 22, 2022
2 parents e789797 + 3616579 commit 95953fd
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ export class TimestampMappingService {
private readonly locationNamePBP: string = "PBP Location Name";
private readonly locationNameBerth: string = "Berth Location Name";
private readonly locationNameAnchorage: string = "Anchorage Location Name";
private readonly locationNameGeneric: string = "Location Name";

addPortCallTimestamp(timestamp: Timestamp): Observable<Timestamp> {
return this.timestampService.addTimestamp(timestamp)
Expand Down Expand Up @@ -63,9 +64,9 @@ export class TimestampMappingService {
createTimestampStub(transportCall: TransportCall, timestampDefinition: TimestampDefinitionTO, fullVesselDetails?: Vessel, operationsEvent?: OperationsEvent): Timestamp {
const facilityCode = timestampDefinition.isTerminalNeeded ? operationsEvent?.eventLocation.facilityCode : null
const vessel: TimestampVessel = {
vesselIMONumber: transportCall.vessel.vesselIMONumber,
name: transportCall.vessel.vesselName,
callSign: transportCall.vessel.vesselCallSignNumber,
vesselIMONumber: fullVesselDetails.vesselIMONumber,
name: fullVesselDetails.vesselName,
callSign: fullVesselDetails.vesselCallSignNumber,
lengthOverall: fullVesselDetails.length,
width: fullVesselDetails.width,
draft: null,
Expand Down Expand Up @@ -152,6 +153,7 @@ export class TimestampMappingService {
if (timestampType?.facilityTypeCode == FacilityTypeCode.ANCH) {
return this.locationNameAnchorage;
}
return this.locationNameGeneric
}
return undefined;
}
Expand Down
9 changes: 6 additions & 3 deletions src/app/controller/services/util/debounce-click.directive.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import { debounceTime } from 'rxjs/operators';
})
export class DebounceClickDirective implements OnInit, OnDestroy {
@Input() debounceTime = 500;
@Input() disabled: boolean;
@Output() debounceClick = new EventEmitter();
private clicks = new Subject();
private subscription: Subscription;
Expand All @@ -25,8 +26,10 @@ export class DebounceClickDirective implements OnInit, OnDestroy {

@HostListener('click', ['$event'])
clickEvent(event) {
event.preventDefault();
event.stopPropagation();
this.clicks.next(event);
if (!this.disabled) {
event.preventDefault();
event.stopPropagation();
this.clicks.next(event);
}
}
}
2 changes: 1 addition & 1 deletion src/app/view/vessel-editor/vessel-editor.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ export class VesselEditorComponent implements OnInit {
return this.vesselService.getCarriers()
.pipe(
tap(carriers => {
const selectedCarrier = carriers.find(c => c.smdgCode === this.vessel.vesselOperatorCarrierCode);
const selectedCarrier = carriers.find(c => c.smdgCode === this.vessel?.vesselOperatorCarrierCode);
const operatorForm = this.vesselFormGroup.controls.vesselOperatorCarrierCode;
if (operatorForm.pristine) {
operatorForm.setValue(selectedCarrier);
Expand Down

0 comments on commit 95953fd

Please sign in to comment.