Skip to content

Commit

Permalink
Fix duplicate import of TimezoneService
Browse files Browse the repository at this point in the history
  • Loading branch information
oliverguenther committed Apr 3, 2024
1 parent e3250c4 commit ec66285
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,11 @@

import { Directive, Injector, OnDestroy, OnInit } from '@angular/core';
import { InjectField } from 'core-app/shared/helpers/angular/inject-field.decorator';
import { TimezoneService } from 'core-app/core/datetime/timezone.service';
import { EditFieldComponent } from 'core-app/shared/components/fields/edit/edit-field.component';
import { DeviceService } from 'core-app/core/browser/device.service';

@Directive()
export abstract class ProgressEditFieldComponent extends EditFieldComponent implements OnInit, OnDestroy {
@InjectField() readonly timezoneService:TimezoneService;

@InjectField() deviceService:DeviceService;

@InjectField() injector:Injector;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
class="spot-input"
(click)="onInputClick($event)"
(focus)="showProgressModal()"
[value]="formatter(value)"
[value]="asHours"
/>

<ng-container slot="body">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ export class ProgressPopoverEditFieldComponent extends ProgressEditFieldComponen
private halEvents:HalEventsService,
private toastService:ToastService,
private apiV3Service:ApiV3Service,
private timeZoneService:TimezoneService,
private timezoneService:TimezoneService,
) {
super(I18n, elementRef, change, schema, handler, cdRef, injector);
}
Expand Down Expand Up @@ -123,11 +123,10 @@ export class ProgressPopoverEditFieldComponent extends ProgressEditFieldComponen
.removeEventListener('turbo:submit-end', this.contextBasedListener.bind(this));
}

// HELP!
public get asHours():string {
if (this.value) {
// eslint-disable-next-line @typescript-eslint/no-unsafe-argument
this.timezoneService.formattedDuration(this.value);
return this.timezoneService.formattedDuration(this.value);
}

return this.text.placeholder;
Expand Down

0 comments on commit ec66285

Please sign in to comment.