{"version":3,"file":"projects_vr-public-website_src_app_features_study-detail_study-detail_module_ts.31af85b8de5cd68c.js","mappings":"qNAeM,MAAOA,uECPP,MAAOC,EAAP,MAEFC,YAAmBC,EAAyBC,GAAzBC,YAAyBA,iBAAkC,CAEvEC,oBAAoBC,GACvB,OAAOF,KAAKF,KAAKK,IAAIH,KAAKD,WAAWK,eAAiB,+BAAiCF,EAAU,QACrG,CAEOG,cAAcC,GACjB,MAAMC,GAAU,IAAIC,MAAcC,IAAI,eAAgB,oBACtD,OAAOT,KAAKF,KAAKY,KAAKV,KAAKD,WAAWK,eAAiB,gCAAiCE,EAAS,CAAEC,QAAWA,GAClH,CAEOI,UAAUC,GACb,OAAOZ,KAAKF,KAAKK,IAAIH,KAAKD,WAAWc,UAAY,6CAA+CD,EACpG,GAfE,IAAOhB,EAAPkB,wCAAOlB,GAAiBmB,oDAAjBnB,EAAiBoB,QAAjBpB,EAAiB,qBAFd,iLCNV,MAAOqB,EACXpB,YACSK,EACAgB,EACAC,EACAC,EACAC,EACAC,EACAC,EACAC,EACAC,EACAC,EACAC,EACAC,EACAC,EACAC,EACAC,GACAC,GACAC,GACAC,GACAC,IAlBAnC,eACAA,YACAA,2BACAA,mBACAA,cACAA,kBACAA,kBACAA,gBACAA,eACAA,wBACAA,4BACAA,wBACAA,uBACAA,kBACAA,yBACAA,8BACAA,qBACAA,uBACAA,iCAEL,0BCZA,MAAOoC,EAAP,MAGJvC,YAAmBC,EAAyBC,EACbsC,GADZrC,YAAyBA,kBACbA,kBAC7BA,KAAKsC,aAAYC,MAAkBF,EACnC,CAGOG,eAAetC,GAClB,OAAOF,KAAKF,KAAKK,IAAIH,KAAKD,WAAWK,eAAiB,6CAA+CF,EACzG,CAEKuC,iBAAiBC,EAAqBxC,GAC3C,MAAMI,EAAU,CACdqC,QAASzC,EACT0C,YAAaF,GAEf,OAAO1C,KAAKF,KAAKY,KAAKV,KAAKD,WAAWK,eAAiB,mCAAoCE,EAC7F,CAESuC,SAASC,GACd9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ACrB,CACEC,KAAM,GACNC,UAAW7G,IAgBF8G,EAAP,YAAOA,EAAPC,EACGA,aAAa,CAClBtC,KAAMzE,yCAFG8G,EAA0B,0BAA1BA,gCARTE,cAAsBL,IACtBM,KACAC,KACAC,KACAC,KACAC","names":["ApplyForStudyRequest","ApplyStudyService","constructor","http","appService","this","loadVolunteerGroups","studyId","get","recruitmentUrl","ApplyForStudy","reqbody","headers","HttpHeaders","set","post","GetSurvey","linkedSurveyId","surveyUrl","_ApplyStudyService","_angular_core__WEBPACK_IMPORTED_MODULE_2__","factory","Study","code","recruitmentPriority","description","gender","minimumAge","maximumAge","currency","payment","studyDescription","volunteerGroupHeader","isPediatricStudy","volunteerGroups","studyFiles","skipAvailability","displayedPaymentRange","isComingSoon","comingSoonText","surveyResponsesValidation","StudyService","platformId","isBrowser","isPlatformBrowser","getStudyDetail","canApplyForStudy","volunteerId","StudyId","VolunteerId","openFile","url","window","open","DownloadRecruitmentFile","labsiteCode","filename","publicFileUrl","recruitmentFileLocation","_StudyService","core","PLATFORM_ID","i0","StudyDetailComponent","route","spinner","studyService","globalRepositoryService","componentFactoryResolver","loader","messageService","translateService","helperService","applyStudyService","activeStudyService","sanitized","loggingService","screenSize","value","setScreenWiseConfig","ngOnInit","labSiteCode","getLabsiteCode","queryParams","subscribe","params","queryParameter","Object","assign","GetStudyDetails","logPageView","AppConstants","isPublicWebSiteSyncronizerEnabled","volunteerEmailId","getStudyDetails","show","getActiveStudyDetailFromBlob","studyDetail","GetStudyDescriptionFromBlobForPublicSyncronizer","activeStudiesData","GetStudyDescriptionFromBlob","getActiveStudiesFromBlob","studies","study","find","x","studyWithAllDetails","AssignStudy","isInvalidStudy","alert","instant","bypassSecurityTrustHtml","validateAndApplyStudy","getVolunteerId","response","isPendingRegistrationVisit","isVolunteerNotActive","isGenderCriterionNotMatching","isAlreadyLinked","isPediatricCriterionNotMatching","isMinorVolunteer","activeChildren","length","isAnyErrorOccured","isVolunteerNotFound","isValidAgeToApplyStudyViolation","isStudyBodyPartViolation","isSliderRequired","__webpack_require__","then","mod","ApplyStudyModule","lazyModule","componentFactory","resolveComponentFactory","components","lazy","addDynamicComponent","sliderWidth","studyInfo","childVolunteers","GetMediaType","getScreenSize","widthByScreen","getScreenSizeValue","sliderWidthByScreen","DownloadFile","fileUri","prepareVolunteerEntityForSave","requestDto","parentVolunteerId","undefined","surveyResponse","availabilityPreference","volunteerGroupGuids","request","JSON","stringify","data","onSucessfulSave","isNoGroupSelected","studyVolunteerValidationFailed","validationErrorMessage","startsWith","setIsDataEdited","success","logEvent","Lab","_StudyDetailComponent","selectors","routes","path","component","StudyDetailComponentModule","_StudyDetailComponentModule","RouterModule","CommonModule","MaterialModule","SharedModule","TranslateModule","SurveyModule"],"sourceRoot":"webpack:///","sources":["./projects/vr-public-website/src/app/features/apply-study/apply-study.model.ts","./projects/vr-public-website/src/app/features/apply-study/apply-study.service.ts","./projects/vr-public-website/src/app/features/study-detail/study-detail/study.model.ts","./projects/vr-public-website/src/app/features/study-detail/study-detail/study.service.ts","./projects/vr-public-website/src/app/features/study-detail/study-detail/study-detail.component.html","./projects/vr-public-website/src/app/features/study-detail/study-detail/study-detail.component.ts","./projects/vr-public-website/src/app/features/study-detail/study-detail.module.ts"],"sourcesContent":["export class VolunteerGroup {\r\n\r\n volunteerGroupId!: string;\r\n studyId!: string;\r\n name!: string;\r\n recruitmentStatusEnum!: string;\r\n description!: string;\r\n numberOfVolunteer!: number;\r\n visibleOnWebsite!: boolean;\r\n startDate!: Date;\r\n endDate!: Date;\r\n formattedStartDate!: string;\r\n formattedEndDate!: string;\r\n}\r\n\r\nexport class ApplyForStudyRequest {\r\n parentVolunteerId!: string;\r\n volunteerId!: string;\r\n studyId!: string;\r\n availabilityPreference!: string | undefined;\r\n volunteerGroupGuids!: string[] | undefined;\r\n surveyResponse!: string | undefined;\r\n linkedSurveyId: string | undefined;\r\n skipAvailability!: boolean;\r\n isValidSurveyResponse!: boolean;\r\n}\r\n\r\nexport class ApplyForStudyResponse {\r\n isVolunteerNotFound!: boolean;\r\n isNoGroupSelected!: boolean;\r\n validationErrorMessage!: string;\r\n studyVolunteerValidationFailed!: boolean;\r\n surveyValidationFailed!: boolean;\r\n isAnyErrorOccured!: boolean;\r\n}\r\n","import { Injectable } from '@angular/core';\r\nimport { HttpClient, HttpHeaders } from '@angular/common/http';\r\nimport { Observable } from 'rxjs';\r\nimport { AppSettingsService } from '../../core/core.module';\r\n\r\n@Injectable({\r\n providedIn: 'root'\r\n})\r\nexport class ApplyStudyService {\r\n\r\n constructor(public http: HttpClient, public appService: AppSettingsService) { }\r\n\r\n public loadVolunteerGroups(studyId: string): Observable {\r\n return this.http.get(this.appService.recruitmentUrl + 'studies/LoadVolunteerGroups/' + studyId + '/true');\r\n }\r\n\r\n public ApplyForStudy(reqbody: any) {\r\n const headers = new HttpHeaders().set('content-type', 'application/json');\r\n return this.http.post(this.appService.recruitmentUrl + 'studyVolunteers/ApplyForStudy', reqbody, { 'headers': headers });\r\n }\r\n\r\n public GetSurvey(linkedSurveyId: string) : Observable {\r\n return this.http.get(this.appService.surveyUrl + 'surveys/getSurveyTemplateByLinkedSurveyID/' + linkedSurveyId);\r\n }\r\n}\r\n","export class Study {\r\n constructor(\r\n public studyId: string,\r\n public code: string,\r\n public recruitmentPriority: boolean,\r\n public description: string,\r\n public gender: string,\r\n public minimumAge: string,\r\n public maximumAge: string,\r\n public currency: string,\r\n public payment: string,\r\n public studyDescription: string,\r\n public volunteerGroupHeader: string,\r\n public isPediatricStudy: boolean,\r\n public volunteerGroups: VolunteerGroups[],\r\n public studyFiles: StudyFileManagement[],\r\n public skipAvailability: boolean,\r\n public displayedPaymentRange: string,\r\n public isComingSoon: boolean,\r\n public comingSoonText: string,\r\n public surveyResponsesValidation: boolean\r\n \r\n ) { }\r\n}\r\n\r\nexport class VolunteerGroups {\r\n constructor(\r\n public studyId: string,\r\n public volunteerGroupId: string,\r\n public name: string,\r\n public description: string,\r\n public startDate: string,\r\n public endDate: string\r\n ) { }\r\n}\r\n\r\nexport class StudyFileManagement {\r\n studyFileManagementId!: string;\r\n studyId!: string;\r\n fileId!: string;\r\n fileName!: string;\r\n}\r\n\r\nexport class CanApplyForStudyResponse {\r\n isVolunteerNotSignedIn!: boolean;\r\n isPendingRegistrationVisit!: boolean;\r\n isVolunteerNotActive!: boolean;\r\n isGenderCriterionNotMatching!: boolean;\r\n isAlreadyLinked!: boolean;\r\n isPediatricCriterionNotMatching!: boolean;\r\n isAnyErrorOccured!: boolean;\r\n isVolunteerNotFound!: boolean;\r\n activeChildren!: ActiveChildrenResponse[];\r\n isMinorVolunteer!: boolean;\r\n linkedSurveyId!: string;\r\n isValidAgeToApplyStudyViolation!: boolean;\r\n isStudyBodyPartViolation!:boolean;\r\n}\r\n\r\nexport class ActiveChildrenResponse {\r\n id!: string;\r\n volunteerId!: string;\r\n firstName!: string;\r\n lastName!: string;\r\n code!: string;\r\n labSiteCode!: string;\r\n gender!: string;\r\n age!: number;\r\n genderEnum!: string;\r\n legalStatusEnum!: string;\r\n volunteerStatusEnum!: string;\r\n checked!: boolean;\r\n}","import { Injectable ,Inject, PLATFORM_ID} from '@angular/core';\r\nimport { HttpClient } from '@angular/common/http';\r\nimport { AppSettingsService } from '../../../core/core.module';\r\nimport { Observable } from 'rxjs';\r\nimport { isPlatformBrowser } from '@angular/common';\r\n\r\n\r\n@Injectable({\r\n providedIn: 'root'\r\n})\r\nexport class StudyService {\r\n isBrowser: boolean;\r\n\r\n constructor(public http: HttpClient, public appService: AppSettingsService,\r\n @Inject(PLATFORM_ID) private platformId: string) {\r\n this.isBrowser = isPlatformBrowser(platformId);\r\n }\r\n \r\n\r\n public getStudyDetail(studyId: string): Observable {\r\n return this.http.get(this.appService.recruitmentUrl + 'studyInformation/GetStudyWithGroupDetails/' + studyId);\r\n }\r\n\r\n public canApplyForStudy(volunteerId: string, studyId: string): Observable {\r\n const reqbody = {\r\n StudyId: studyId,\r\n VolunteerId: volunteerId, \r\n };\r\n return this.http.post(this.appService.recruitmentUrl + 'studyVolunteers/CanApplyForStudy', reqbody);\r\n }\r\n\r\n public openFile(url: string) {\r\n if (this.isBrowser) {\r\n window.open(url, '_blank');\r\n }\r\n }\r\n\r\n public DownloadRecruitmentFile(labsiteCode: string, filename: string) {\r\n return this.http.get(this.appService.publicFileUrl + 'Files/getURL/' + labsiteCode + '/' + this.appService.recruitmentFileLocation + '/' + filename);\r\n }\r\n}\r\n","
\r\n
\r\n \r\n {{study.code}}\r\n \r\n {{study.comingSoonText}}\r\n \r\n \r\n \r\n
\r\n\r\n \r\n
\r\n
\r\n \r\n \r\n {{\r\n 'StudyDetail.StudyInfo' | translate }}\r\n
\r\n
\r\n {{\r\n 'StudyDetail.Gender' | translate }}\r\n \r\n {{('GenderEnums.' + study.gender) | translate }}\r\n
\r\n
\r\n {{ 'StudyDetail.Age' |\r\n translate }}\r\n \r\n {{study.minimumAge}}-{{study.maximumAge}}\r\n
\r\n
\r\n {{\r\n 'StudyDetail.Payment' | translate }}\r\n \r\n {{study.displayedPaymentRange ? study.displayedPaymentRange : (study.payment | currency: study.currency)}}\r\n
\r\n
\r\n \r\n\r\n
\r\n
\r\n
\r\n
\r\n {{\r\n 'StudyDetail.StudyDescription' | translate }}\r\n \r\n
\r\n
\r\n
\r\n
\r\n\r\n {{\r\n 'StudyDetail.ProductDescription' | translate }}\r\n\r\n \r\n {{study.description}}\r\n \r\n\r\n
0\">\r\n {{'StudyDetail.StudyDocuments'\r\n | translate}}\r\n\r\n
\r\n
\r\n \r\n
\r\n
\r\n {{ file.fileName }}\r\n
\r\n
\r\n\r\n\r\n
\r\n\r\n\r\n {{ 'StudyDetail.Planning' | translate }}\r\n \r\n \r\n
\r\n
\r\n
\r\n
\r\n
\r\n
\r\n \r\n {{ 'StudyDetail.Group' | translate }} {{group.name | Split: \" \" : 1}} : {{ 'StudyDetail.From' | translate }} {{group.startDate | date: 'dd-MMM-yy' }}\r\n {{ 'StudyDetail.To' | translate}} {{group.endDate | date: 'dd-MMM-yy' }} \r\n
\r\n

{{group.description}}

\r\n
\r\n
\r\n
\r\n\r\n","import { Component, ComponentFactoryResolver, OnInit } from '@angular/core';\r\nimport { DomSanitizer } from '@angular/platform-browser';\r\nimport { ActivatedRoute } from '@angular/router';\r\nimport { TranslateService } from '@ngx-translate/core';\r\nimport { AppSettingsService } from '../../../core/core.module';\r\nimport { GlobalRepositoryService } from '../../../core/repository/global-repository.service';\r\nimport { SpinnerService } from '../../../core/spinner/spinner.service';\r\nimport { ScreenSizeValue } from '../../../main/models/screenSizeValue';\r\nimport { HelperService } from '../../../main/services/helper.service';\r\nimport { LoaderService } from '../../../main/services/loader.service';\r\nimport { LoggingService } from '../../../main/services/logging.service';\r\nimport { MessageService } from '../../../main/services/message.service';\r\nimport { AppConstants } from '../../../shared/constants/app-constants';\r\nimport { ActiveStudyService } from '../../active-studies/active-studies/active-studies.service';\r\nimport { ApplyForStudyRequest, ApplyForStudyResponse } from '../../apply-study/apply-study.model';\r\nimport { ApplyStudyService } from '../../apply-study/apply-study.service';\r\nimport { CanApplyForStudyResponse, Study } from './study.model';\r\nimport { StudyService } from './study.service';\r\n\r\n@Component({\r\n selector: 'anms-study-detail',\r\n templateUrl: './study-detail.component.html',\r\n styleUrls: ['./study-detail.component.scss'],\r\n})\r\nexport class StudyDetailComponent implements OnInit {\r\n labSiteCode?: string;\r\n studyId: string = '';\r\n study!: Study;\r\n sliderWidthByScreen: ScreenSizeValue[] = [{ screenSize: 'xl', value: '60%' }, { screenSize: 'md', value: '90%' },\r\n { screenSize: 'sm', value: '100%' }, { screenSize: 'xs', value: '100%' }];\r\n sliderWidth: string = '60%';\r\n volunteerGroupHeader: any;\r\n studyDescription: any;\r\n isInvalidStudy: boolean = false;\r\n\r\n constructor(\r\n private route: ActivatedRoute,\r\n public spinner: SpinnerService,\r\n public studyService: StudyService,\r\n public globalRepositoryService: GlobalRepositoryService,\r\n private componentFactoryResolver: ComponentFactoryResolver,\r\n public loader: LoaderService,\r\n public messageService: MessageService,\r\n public translateService: TranslateService,\r\n public helperService: HelperService,\r\n public applyStudyService: ApplyStudyService,\r\n public activeStudyService: ActiveStudyService,\r\n public sanitized: DomSanitizer,\r\n public loggingService: LoggingService,\r\n public appService: AppSettingsService\r\n ) {\r\n this.setScreenWiseConfig();\r\n }\r\n\r\n ngOnInit(): void {\r\n this.labSiteCode = this.globalRepositoryService.getLabsiteCode();\r\n this.route.queryParams.subscribe((params: any) => {\r\n const queryParameter = Object.assign({}, params);\r\n this.studyId = queryParameter.studyId;\r\n });\r\n this.GetStudyDetails();\r\n this.loggingService.logPageView(AppConstants.Pages.StudyDetails, this.labSiteCode);\r\n }\r\n\r\n private GetStudyDetails() {\r\n if (this.appService.isPublicWebSiteSyncronizerEnabled) {\r\n if (!this.globalRepositoryService.volunteerEmailId) {\r\n this.spinner.show(true);\r\n this.activeStudyService.getActiveStudyDetailFromBlob(this.globalRepositoryService.labsiteCode + '/' +\r\n AppConstants.Blob.ActiveStudies + '/' + AppConstants.Blob.ActiveStudy + '-' + this.studyId).subscribe((studyDetail) => {\r\n this.GetStudyDescriptionFromBlobForPublicSyncronizer(studyDetail);\r\n this.spinner.show(false);\r\n }, () => {\r\n this.spinner.show(false);\r\n });\r\n } else {\r\n this.getStudyDetails(this.studyId);\r\n }\r\n } else {\r\n if (!this.globalRepositoryService.volunteerEmailId) {\r\n if (!this.globalRepositoryService.activeStudiesData) {\r\n this.spinner.show(true);\r\n this.activeStudyService.getActiveStudiesFromBlob(this.globalRepositoryService.labsiteCode, AppConstants.Blob.ActiveStudies).subscribe((studies) => {\r\n this.globalRepositoryService.activeStudiesData = studies;\r\n this.GetStudyDescriptionFromBlob();\r\n this.spinner.show(false);\r\n });\r\n } else {\r\n this.GetStudyDescriptionFromBlob();\r\n }\r\n } else {\r\n this.getStudyDetails(this.studyId);\r\n }\r\n }\r\n }\r\n\r\n private GetStudyDescriptionFromBlob() {\r\n const study = this.globalRepositoryService.activeStudiesData.find(x => x.studyId === this.studyId);\r\n if (study) {\r\n const studyWithAllDetails = new Study(study?.studyId, study?.code, study?.recruitmentPriority,\r\n study?.description, study?.gender, study?.minimumAge, study?.maximumAge, study?.currency, study?.payment, study?.studyDescription ?? '', study?.volunteerGroupHeader ?? '',\r\n study?.isPediatricStudy, study?.volunteerGroups, study?.studyFiles, study?.skipAvailability, study?.displayedPaymentRange, study?.isComingSoon, study?.comingSoonText ?? '',\r\n study?.surveyResponsesValidation ?? false);\r\n this.AssignStudy(studyWithAllDetails);\r\n } else {\r\n this.isInvalidStudy = true;\r\n }\r\n }\r\n\r\n\r\n private GetStudyDescriptionFromBlobForPublicSyncronizer(studyDetail: Study) {\r\n if (studyDetail) {\r\n const studyWithAllDetails = new Study(studyDetail?.studyId, studyDetail?.code, studyDetail?.recruitmentPriority,\r\n studyDetail?.description, studyDetail?.gender, studyDetail?.minimumAge, studyDetail?.maximumAge, studyDetail?.currency, studyDetail?.payment, studyDetail?.studyDescription ?? '', studyDetail?.volunteerGroupHeader ?? '',\r\n studyDetail?.isPediatricStudy, studyDetail?.volunteerGroups, studyDetail?.studyFiles, studyDetail?.skipAvailability, studyDetail?.displayedPaymentRange, studyDetail?.isComingSoon, studyDetail?.comingSoonText ?? '',\r\n studyDetail?.surveyResponsesValidation ?? false);\r\n this.AssignStudy(studyWithAllDetails);\r\n } else {\r\n this.isInvalidStudy = true;\r\n }\r\n }\r\n\r\n getStudyDetails(studyId: string) {\r\n this.spinner.show(true);\r\n this.studyService.getStudyDetail(studyId).subscribe((studies: Study) => {\r\n if (!studies) {\r\n this.isInvalidStudy = true;\r\n } else {\r\n this.AssignStudy(studies);\r\n }\r\n\r\n }, () => {\r\n this.messageService.alert(this.translateService.instant('StudyDetail.ErrorFetchingData'), true);\r\n this.spinner.show(false);\r\n });\r\n }\r\n\r\n private AssignStudy(studies: Study) {\r\n this.study = studies;\r\n this.studyDescription = this.sanitized.bypassSecurityTrustHtml(this.study.studyDescription);\r\n this.volunteerGroupHeader = this.sanitized.bypassSecurityTrustHtml(this.study.volunteerGroupHeader);\r\n this.spinner.show(false);\r\n }\r\n\r\n validateAndApplyStudy() {\r\n const volunteerId = this.globalRepositoryService.getVolunteerId();\r\n if (volunteerId) {\r\n this.spinner.show(true);\r\n this.studyService.canApplyForStudy(volunteerId, this.study.studyId)\r\n .subscribe((response: CanApplyForStudyResponse) => {\r\n this.spinner.show(false);\r\n if (response.isPendingRegistrationVisit) {\r\n this.messageService.alert(this.translateService.instant('ActiveStudies.Validation.PendingRegistration'));\r\n } else if (response.isVolunteerNotActive) {\r\n this.messageService.alert(this.translateService.instant('ActiveStudies.Validation.NotActive'));\r\n } else if (response.isGenderCriterionNotMatching) {\r\n this.messageService.alert(this.translateService.instant('ActiveStudies.Validation.InvalidGender'));\r\n } else if (response.isAlreadyLinked) {\r\n this.messageService.alert(this.translateService.instant('ActiveStudies.Validation.AlreadyLinkedToStudy'));\r\n } else if ((this.study.isPediatricStudy) && (response.isPediatricCriterionNotMatching\r\n || (!response.isMinorVolunteer && !(response.activeChildren?.length > 0)))) {\r\n this.messageService.alert(this.translateService.instant('ActiveStudies.Validation.PediatricStudy'));\r\n } else if (response.isAnyErrorOccured) {\r\n this.messageService.alert(this.translateService.instant('ActiveStudies.Validation.ErrorInValidating'), true);\r\n } else if (response.isVolunteerNotFound) {\r\n this.messageService.alert(this.translateService.instant('ActiveStudies.Validation.VolunteerNotFound'));\r\n } else if (response.isValidAgeToApplyStudyViolation) {\r\n this.messageService.alert(this.translateService.instant('ActiveStudies.Validation.InvalidAgeToApplyStudy'));\r\n }else if (response.isStudyBodyPartViolation) {\r\n this.messageService.alert(this.translateService.instant('ActiveStudies.Validation.StudyBodyPartValidation'));\r\n }else {\r\n if (this.isSliderRequired(response)) {\r\n import('../../apply-study/apply-study.module')\r\n .then(mod => mod.ApplyStudyModule)\r\n .then(lazyModule => {\r\n const componentFactory = this.componentFactoryResolver.resolveComponentFactory(lazyModule.components['lazy']);\r\n this.loader.addDynamicComponent(componentFactory, this.sliderWidth, {\r\n studyInfo: this.study,\r\n linkedSurveyId: response.linkedSurveyId,\r\n childVolunteers: response.activeChildren, isMinorVolunteer: response.isMinorVolunteer\r\n });\r\n });\r\n } else {\r\n this.ApplyForStudy();\r\n }\r\n }\r\n }, () => {\r\n this.messageService.alert(this.translateService.instant('ActiveStudies.Validation.ErrorInValidating'), true);\r\n this.spinner.show(false);\r\n });\r\n } else {\r\n this.messageService.alert(this.translateService.instant('ActiveStudies.Validation.UserNotSignedIn'));\r\n }\r\n }\r\n\r\n setScreenWiseConfig() {\r\n this.helperService.GetMediaType();\r\n this.helperService.getScreenSize().subscribe(x => {\r\n const widthByScreen = this.helperService.getScreenSizeValue(this.sliderWidthByScreen, x);\r\n if (widthByScreen) {\r\n this.sliderWidth = widthByScreen;\r\n }\r\n });\r\n }\r\n\r\n DownloadFile(filename: string) {\r\n this.spinner.show(true);\r\n this.studyService.DownloadRecruitmentFile(this.globalRepositoryService.labsiteCode, filename).subscribe((response: any) => {\r\n this.studyService.openFile(response.fileUri);\r\n this.spinner.show(false);\r\n }, () => {\r\n this.messageService.alert(this.translateService.instant('StudyDetail.DownloadFileError'), true);\r\n this.spinner.show(false);\r\n });\r\n }\r\n\r\n public prepareVolunteerEntityForSave() {\r\n const requestDto = new ApplyForStudyRequest();\r\n\r\n requestDto.studyId = this.study.studyId;\r\n requestDto.parentVolunteerId = this.globalRepositoryService.getVolunteerId();\r\n requestDto.volunteerId = this.globalRepositoryService.getVolunteerId();\r\n requestDto.skipAvailability = this.study.skipAvailability;\r\n\r\n requestDto.linkedSurveyId = undefined;\r\n requestDto.surveyResponse = undefined;\r\n\r\n requestDto.availabilityPreference = undefined;\r\n requestDto.volunteerGroupGuids = undefined;\r\n\r\n return requestDto;\r\n }\r\n\r\n ApplyForStudy() {\r\n const request = this.prepareVolunteerEntityForSave();\r\n this.spinner.show(true);\r\n this.applyStudyService.ApplyForStudy(JSON.stringify(request))\r\n .subscribe((data: any) => {\r\n this.onSucessfulSave(data);\r\n this.spinner.show(false);\r\n },\r\n () => {\r\n this.messageService.alert(this.translateService.instant('ApplyStudy.UpdateError'), true);\r\n this.spinner.show(false);\r\n });\r\n }\r\n\r\n onSucessfulSave(response: ApplyForStudyResponse) {\r\n if (response.isVolunteerNotFound) {\r\n this.messageService.alert(this.translateService.instant('ApplyStudy.VolunteerNotFound'));\r\n } else if (response.isNoGroupSelected) {\r\n this.messageService.alert(this.translateService.instant('ApplyStudy.GroupNotSelected'));\r\n } else if (response.studyVolunteerValidationFailed) {\r\n if (response.validationErrorMessage.startsWith('InvalidStudyStatus')) {\r\n this.messageService.alert(this.translateService.instant('ApplyStudy.Validation.InvalidStudyStatus'));\r\n } else if (response.validationErrorMessage.startsWith('InvalidGender')) {\r\n this.messageService.alert(this.translateService.instant('ApplyStudy.Validation.InvalidGender'));\r\n } else if (response.validationErrorMessage.startsWith('InvalidStatus')) {\r\n this.messageService.alert(this.translateService.instant('ApplyStudy.Validation.InvalidVolunteerStatus'));\r\n } else if (response.validationErrorMessage.startsWith('InvalidDuplicateVolunteer')) {\r\n this.messageService.alert(this.translateService.instant('ApplyStudy.Validation.InvalidDuplicateVolunteer'));\r\n } else if (response.validationErrorMessage.startsWith('InvalidLegalStatusForPediatricStudy')) {\r\n this.messageService.alert(this.translateService.instant('ApplyStudy.Validation.InvalidLegalStatusForPediatricStudy'));\r\n } else if (response.validationErrorMessage.startsWith('InvalidLinkedVolunteerId')) {\r\n this.messageService.alert(this.translateService.instant('ApplyStudy.Validation.InvalidLinkedVolunteerId'));\r\n }\r\n } else if (response.isAnyErrorOccured) {\r\n this.messageService.alert(this.translateService.instant('ApplyStudy.UpdateError'), true);\r\n } else {\r\n this.loader.setIsDataEdited(false);\r\n this.messageService.success(this.translateService.instant('ApplyStudy.UpdateSuccess'), 10000);\r\n this.loggingService.logEvent(AppConstants.Events.ApplyStudy, { 'Lab': this.labSiteCode });\r\n }\r\n }\r\n\r\n public isSliderRequired(response: CanApplyForStudyResponse): boolean {\r\n if ((response.linkedSurveyId && response.linkedSurveyId !== AppConstants.emptyGUID) ||\r\n (this.study.isPediatricStudy && !response.isMinorVolunteer && response.activeChildren?.length > 0) ||\r\n (!this.study.skipAvailability)) {\r\n return true;\r\n } else {\r\n return false;\r\n }\r\n }\r\n}\r\n","import { NgModule } from '@angular/core';\r\nimport { CommonModule } from '@angular/common';\r\nimport { StudyDetailComponent } from './study-detail/study-detail.component';\r\nimport { MaterialModule } from '../../shared/material.module';\r\nimport { TranslateModule } from '@ngx-translate/core';\r\nimport { Routes, RouterModule } from '@angular/router';\r\nimport { SharedModule } from '../../shared/shared.module';\r\nimport { SurveyModule } from \"survey-angular-ui\";\r\nconst routes: Routes = [\r\n {\r\n path: '',\r\n component: StudyDetailComponent\r\n }\r\n];\r\n\r\n\r\n@NgModule({\r\n declarations: [StudyDetailComponent],\r\n imports: [\r\n RouterModule.forChild(routes),\r\n CommonModule,\r\n MaterialModule,\r\n SharedModule,\r\n TranslateModule,\r\n SurveyModule\r\n ]\r\n})\r\nexport class StudyDetailComponentModule {\r\n static components = {\r\n lazy: StudyDetailComponent\r\n };\r\n}\r\n"],"x_google_ignoreList":[]}