import {Component, OnInit, ViewEncapsulation} from '@angular/core'; import {FieldType} from '@ngx-formly/material'; import {AllService} from '../../../all.service'; import {ActivatedRoute} from '@angular/router'; import {FormGroup} from '@angular/forms'; import {FormlyFieldConfig} from '@ngx-formly/core'; @Component({ selector: 'jhi-step-summary-bpa', templateUrl: './step-summary-bpa.component.html', styleUrls: ['./step-summary-bpa.component.scss'], encapsulation: ViewEncapsulation.None }) export class StepSummaryBpaComponent extends FieldType implements OnInit { indexSelected = 0; dataTemps = { 'simulationId': null, 'productName': 'fluo', 'productCode': 'fluo', 'productLogo': 'https://ressources.magnolia.fr/images/products/fluo.svg', 'monthlyCost': '65.31', 'totalCost': '15674.36', 'rate': '0.39', products: [{ 'loadedWarranties': [{ 'warrantieCode': 'DC', 'medicalResultDTO': { 'loading': 0.0, 'perThousand': 2.0, 'loadingReason': null, 'exclusionReason': null, 'duration': 999, 'pendingDetails': null, 'loanLoadingDuration': {}, 'failureType': null }, 'decision': 2 }, { 'warrantieCode': 'IPT', 'medicalResultDTO': { 'loading': 100.0, 'perThousand': 0.0, 'loadingReason': null, 'exclusionReason': null, 'duration': 999, 'pendingDetails': null, 'loanLoadingDuration': {}, 'failureType': null }, 'decision': 2 }, { 'warrantieCode': 'ITT', 'medicalResultDTO': { 'loading': 100.0, 'perThousand': 0.0, 'loadingReason': null, 'exclusionReason': null, 'duration': 999, 'pendingDetails': null, 'loanLoadingDuration': {}, 'failureType': null }, 'decision': 2 }, { 'warrantieCode': 'ITT', 'medicalResultDTO': { 'loading': 100.0, 'perThousand': 0.0, 'loadingReason': null, 'exclusionReason': null, 'duration': 999, 'pendingDetails': null, 'loanLoadingDuration': {}, 'failureType': null }, 'decision': 2 }, { 'warrantieCode': 'ITT', 'medicalResultDTO': { 'loading': 100.0, 'perThousand': 0.0, 'loadingReason': null, 'exclusionReason': null, 'duration': 999, 'pendingDetails': null, 'loanLoadingDuration': {}, 'failureType': null }, 'decision': 2 }, { 'warrantieCode': 'ITT', 'medicalResultDTO': { 'loading': 100.0, 'perThousand': 0.0, 'loadingReason': null, 'exclusionReason': null, 'duration': 999, 'pendingDetails': null, 'loanLoadingDuration': {}, 'failureType': null }, 'decision': 2 }, { 'warrantieCode': 'PTIA', 'medicalResultDTO': { 'loading': 100.0, 'perThousand': 0.0, 'loadingReason': null, 'exclusionReason': null, 'duration': 999, 'pendingDetails': null, 'loanLoadingDuration': {}, 'failureType': null }, 'decision': 2 }] }, { 'loadedWarranties': [{ 'warrantieCode': 'DC', 'medicalResultDTO': { 'loading': 0.0, 'perThousand': 2.0, 'loadingReason': null, 'exclusionReason': null, 'duration': 999, 'pendingDetails': null, 'loanLoadingDuration': {}, 'failureType': null }, 'decision': 2 }, { 'warrantieCode': 'IPT', 'medicalResultDTO': { 'loading': 100.0, 'perThousand': 0.0, 'loadingReason': null, 'exclusionReason': null, 'duration': 999, 'pendingDetails': null, 'loanLoadingDuration': {}, 'failureType': null }, 'decision': 2 }, { 'warrantieCode': 'ITT', 'medicalResultDTO': { 'loading': 100.0, 'perThousand': 0.0, 'loadingReason': null, 'exclusionReason': null, 'duration': 999, 'pendingDetails': null, 'loanLoadingDuration': {}, 'failureType': null }, 'decision': 2 }, { 'warrantieCode': 'PTIA', 'medicalResultDTO': { 'loading': 100.0, 'perThousand': 0.0, 'loadingReason': null, 'exclusionReason': null, 'duration': 999, 'pendingDetails': null, 'loanLoadingDuration': {}, 'failureType': null }, 'decision': 2 }] }], 'excludedWarranties': [], 'selectable': true, 'loaded': true, 'excluded': false, 'normal': false }; products: Array = this.dataTemps.products; formReadMore = new FormGroup({}); fieldsReadMore: FormlyFieldConfig[] = [ { fieldGroup: [ { 'key': 'remoretext', 'className': 'mt-3', 'type': 'textElement', 'templateOptions': { 'label': 'Comprendre mes garanties', 'autocomplete': false } }, { 'key': 'read-more-legende', 'type': 'readMore', 'templateOptions': { 'label': 'Comprendre mes garanties', 'autocomplete': false, 'title': 'Comprendre mes garanties', 'content': '' } } ] } ]; constructor(public allService: AllService, private route: ActivatedRoute ) { super(); } ngOnInit(): void { super.ngOnInit(); } public isInteger(value: any) { return Number.isInteger(value); } }