diff --git a/projects/player/src/app/app.module.ts b/projects/player/src/app/app.module.ts index 3003bff80633e7d041c3a309ed455b6f6f5ec4e9..a156051d7cfe8abd0d2b4fe97b6d6b598c7c5a91 100644 --- a/projects/player/src/app/app.module.ts +++ b/projects/player/src/app/app.module.ts @@ -10,7 +10,7 @@ import { SectionComponent } from './components/section/section.component'; import { SharedModule } from '../../../common/app.module'; import { ElementOverlayComponent } from './components/element-overlay/element-overlay.component'; import { ValidationMessageComponent } from './components/validation-message/validation-message.component'; -import { UnitStateComponent } from './components/unit-state.component'; +import { UnitStateComponent } from './components/unit-state/unit-state.component'; import { PlayerStateComponent } from './components/player-state/player-state.component'; import { PlayerTranslateLoader } from './classes/player-translate-loader'; import { LayoutComponent } from './components/layout/layout.component'; diff --git a/projects/player/src/app/components/unit-state/unit-state.component.html b/projects/player/src/app/components/unit-state/unit-state.component.html new file mode 100644 index 0000000000000000000000000000000000000000..255692efd1e89845323439e3d3110bd86197a449 --- /dev/null +++ b/projects/player/src/app/components/unit-state/unit-state.component.html @@ -0,0 +1,6 @@ +<form [formGroup]="form"> + <app-player-state [parentForm]="form" + [playerConfig]="playerConfig" + [pages]="pages"> + </app-player-state> +</form> diff --git a/projects/player/src/app/components/unit-state.component.ts b/projects/player/src/app/components/unit-state/unit-state.component.ts similarity index 88% rename from projects/player/src/app/components/unit-state.component.ts rename to projects/player/src/app/components/unit-state/unit-state.component.ts index 2f478bb4f687208f648418b7db5b226c8627542f..ae3f6a953272878d7595bb7863fc531418e40170 100644 --- a/projects/player/src/app/components/unit-state.component.ts +++ b/projects/player/src/app/components/unit-state/unit-state.component.ts @@ -8,29 +8,22 @@ import { import { Subject } from 'rxjs'; import { takeUntil } from 'rxjs/operators'; import { TranslateService } from '@ngx-translate/core'; -import { FormService } from '../../../../common/form.service'; -import { VeronaSubscriptionService } from '../services/verona-subscription.service'; -import { VeronaPostService } from '../services/verona-post.service'; -import { MessageService } from '../../../../common/message.service'; -import { MetaDataService } from '../services/meta-data.service'; +import { FormService } from '../../../../../common/form.service'; +import { VeronaSubscriptionService } from '../../services/verona-subscription.service'; +import { VeronaPostService } from '../../services/verona-post.service'; +import { MessageService } from '../../../../../common/message.service'; +import { MetaDataService } from '../../services/meta-data.service'; import { FormControlElement, FormControlValidators, ChildFormGroup, ValueChangeElement -} from '../../../../common/form'; +} from '../../../../../common/form'; import { PlayerConfig, Progress, UnitState, VopNavigationDeniedNotification -} from '../models/verona'; -import { UnitPage } from '../../../../common/unit'; +} from '../../models/verona'; +import { UnitPage } from '../../../../../common/unit'; @Component({ selector: 'app-unit-state', - template: ` - <form [formGroup]="form"> - <app-player-state [parentForm]="form" - [playerConfig]="playerConfig" - [pages]="pages"> - </app-player-state> - </form> - ` + templateUrl: './unit-state.component.html' }) export class UnitStateComponent implements OnInit, OnDestroy { @Input() pages: UnitPage[] = []; @@ -67,10 +60,6 @@ export class UnitStateComponent implements OnInit, OnDestroy { this.formService.validatorsAdded .pipe(takeUntil(this.ngUnsubscribe)) .subscribe((validations: FormControlValidators): void => this.setValidators(validations)); - this.veronaSubscriptionService.vopNavigationDeniedNotification - .pipe(takeUntil(this.ngUnsubscribe)) - .subscribe((message: VopNavigationDeniedNotification): void => this.onNavigationDenied(message)); - this.formService.elementValueChanged .pipe(takeUntil(this.ngUnsubscribe)) .subscribe((value: ValueChangeElement): void => this.onElementValueChanges(value)); @@ -80,6 +69,9 @@ export class UnitStateComponent implements OnInit, OnDestroy { this.form.valueChanges .pipe(takeUntil(this.ngUnsubscribe)) .subscribe((): void => this.onFormChanges()); + this.veronaSubscriptionService.vopNavigationDeniedNotification + .pipe(takeUntil(this.ngUnsubscribe)) + .subscribe((message: VopNavigationDeniedNotification): void => this.onNavigationDenied(message)); } private get responseProgress(): Progress {