diff --git a/project/ws/app/src/lib/routes/karma-programs/karma-programs-microsite/karma-programs-microsite.component.html b/project/ws/app/src/lib/routes/karma-programs/karma-programs-microsite-v1/karma-programs-microsite-v1.component.html similarity index 100% rename from project/ws/app/src/lib/routes/karma-programs/karma-programs-microsite/karma-programs-microsite.component.html rename to project/ws/app/src/lib/routes/karma-programs/karma-programs-microsite-v1/karma-programs-microsite-v1.component.html diff --git a/project/ws/app/src/lib/routes/karma-programs/karma-programs-microsite/karma-programs-microsite.component.scss b/project/ws/app/src/lib/routes/karma-programs/karma-programs-microsite-v1/karma-programs-microsite-v1.component.scss similarity index 100% rename from project/ws/app/src/lib/routes/karma-programs/karma-programs-microsite/karma-programs-microsite.component.scss rename to project/ws/app/src/lib/routes/karma-programs/karma-programs-microsite-v1/karma-programs-microsite-v1.component.scss diff --git a/project/ws/app/src/lib/routes/karma-programs/karma-programs-microsite-v1/karma-programs-microsite-v1.component.spec.ts b/project/ws/app/src/lib/routes/karma-programs/karma-programs-microsite-v1/karma-programs-microsite-v1.component.spec.ts new file mode 100644 index 000000000..4178f2f67 --- /dev/null +++ b/project/ws/app/src/lib/routes/karma-programs/karma-programs-microsite-v1/karma-programs-microsite-v1.component.spec.ts @@ -0,0 +1,25 @@ +import { async, ComponentFixture, TestBed } from '@angular/core/testing' + +import { KarmaProgramsMicrositeV1Component } from './karma-programs-microsite-v1.component' + +describe('KarmaProgramsMicrositeV1Component', () => { + let component: KarmaProgramsMicrositeV1Component + let fixture: ComponentFixture + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [KarmaProgramsMicrositeV1Component], + }) + .compileComponents() + })) + + beforeEach(() => { + fixture = TestBed.createComponent(KarmaProgramsMicrositeV1Component) + component = fixture.componentInstance + fixture.detectChanges() + }) + + it('should create', () => { + expect(component).toBeTruthy() + }) +}) diff --git a/project/ws/app/src/lib/routes/karma-programs/karma-programs-microsite/karma-programs-microsite.component.ts b/project/ws/app/src/lib/routes/karma-programs/karma-programs-microsite-v1/karma-programs-microsite-v1.component.ts similarity index 96% rename from project/ws/app/src/lib/routes/karma-programs/karma-programs-microsite/karma-programs-microsite.component.ts rename to project/ws/app/src/lib/routes/karma-programs/karma-programs-microsite-v1/karma-programs-microsite-v1.component.ts index eb2db80dd..8792a6c08 100644 --- a/project/ws/app/src/lib/routes/karma-programs/karma-programs-microsite/karma-programs-microsite.component.ts +++ b/project/ws/app/src/lib/routes/karma-programs/karma-programs-microsite-v1/karma-programs-microsite-v1.component.ts @@ -6,11 +6,11 @@ import { EventService, WsEvents, MultilingualTranslationsService, Configurations import { TranslateService } from '@ngx-translate/core' @Component({ - selector: 'ws-app-karma-programs-microsite', - templateUrl: './karma-programs-microsite.component.html', - styleUrls: ['./karma-programs-microsite.component.scss'], + selector: 'ws-app-karma-programs-microsite-v1', + templateUrl: './karma-programs-microsite-v1.component.html', + styleUrls: ['./karma-programs-microsite-v1.component.scss'], }) -export class KarmaProgramsMicrositeComponent implements OnInit { +export class KarmaProgramsMicrositeV1Component implements OnInit { programName = '' playListKey = '' orgId = '' diff --git a/project/ws/app/src/lib/routes/karma-programs/karma-programs-microsite-v2/karma-programs-microsite-v2.component.html b/project/ws/app/src/lib/routes/karma-programs/karma-programs-microsite-v2/karma-programs-microsite-v2.component.html new file mode 100644 index 000000000..82d6b9ec2 --- /dev/null +++ b/project/ws/app/src/lib/routes/karma-programs/karma-programs-microsite-v2/karma-programs-microsite-v2.component.html @@ -0,0 +1,130 @@ + + + +
+
+ + + +
+ +
+ + + + +
+
+
+
+
+
+
+
+ + + + + +
+
+
+ +
+
+
+
+

{{data?.title}}

+

+ {{data?.description | slice:0:descriptionMaxLength}} + ... +

+ + +

+ {{ref?.label}} : {{'contentstripmultiple.clickHere' | translate}} +

+
+
+ +
+
+
+
+ + +
+ +
+
+
+
+
+
+ + + + +
+
+
+ + + +
+
+ +
+
+ +
+
+
+ + +
+
+ No results +

{{'learnsearch.noResults' | translate}}

+
+
+
+
+
\ No newline at end of file diff --git a/project/ws/app/src/lib/routes/karma-programs/karma-programs-microsite-v2/karma-programs-microsite-v2.component.scss b/project/ws/app/src/lib/routes/karma-programs/karma-programs-microsite-v2/karma-programs-microsite-v2.component.scss new file mode 100644 index 000000000..0571da2d6 --- /dev/null +++ b/project/ws/app/src/lib/routes/karma-programs/karma-programs-microsite-v2/karma-programs-microsite-v2.component.scss @@ -0,0 +1,120 @@ +@import 'ws-mixins'; +@import 'ws-common'; + +.container-balanced { + @extend %page-center; + } + + .container { + max-width: 1200px; + } + .infra-background { + background: #1B4CA1; + align-items: center; + justify-content: center; + display: flex; +} + + .banner-container{ + align-items: center; + background: #eee; + padding: 16px; + gap: 2.5rem; + justify-content: center; + } + + .logo-box { + vertical-align: middle; + max-width: 250px; + background: #f5fdf1; + padding: 8px; + border: 1px solid rgba(0,0,0,0.5); + } + .slider-box { + // max-width: 30%; +} + +.slider-background { + height: 160px; +} + +.slider-background1 { + height: 195px; +} + +.slider-background-2 { + position: relative; +} + +.info-slider{ + position: absolute; + top: -180px; + padding: 25px; +} + +::ng-deep .mat-form-search { + + .mat-form-field-infix { + border-top: 0.2em solid transparent !important; + } + + .mat-form-field-wrapper { + padding-bottom: 0 + } + + .mat-select-panel .mat-optgroup-label, + .mat-select-panel .mat-option { + font-size: inherit; + line-height: 3em; + height: 4em; + padding-top: 8px; + } + + // .mat-select-arrow { + // margin-top: 12px; + // } + } + + .comp-back-img { + position: absolute; + filter: brightness(100); + left: 0; + right: 0; + top: 178px; + margin-left: auto; + margin-right: auto; + width: 100%; + } + + .mob-comp-back-img { + background-image: url("/assets/icons/microsite/competency.svg"); + filter: brightness(100); + } + + .zindex { + z-index: 99 + } + + .ref-links { + font-weight: 700 !important; + text-decoration: underline !important; + color: #F3962F !important; + position: relative; + z-index: 999999; + } + + .banner-new { + background-size: contain; + background-position: center; + background-repeat: no-repeat; + width: 100%; + height: 457px; + } + + .banner-image-v2 { + width: 100%; + height: 100%; + } + .mobile-container { + padding: 15px 15px 0 15px; + } \ No newline at end of file diff --git a/project/ws/app/src/lib/routes/karma-programs/karma-programs-microsite-v2/karma-programs-microsite-v2.component.spec.ts b/project/ws/app/src/lib/routes/karma-programs/karma-programs-microsite-v2/karma-programs-microsite-v2.component.spec.ts new file mode 100644 index 000000000..030a225e7 --- /dev/null +++ b/project/ws/app/src/lib/routes/karma-programs/karma-programs-microsite-v2/karma-programs-microsite-v2.component.spec.ts @@ -0,0 +1,25 @@ +import { async, ComponentFixture, TestBed } from '@angular/core/testing' + +import { KarmaProgramsMicrositeV2Component } from './karma-programs-microsite-v2.component' + +describe('KarmaProgramsMicrositeV2Component', () => { + let component: KarmaProgramsMicrositeV2Component + let fixture: ComponentFixture + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [KarmaProgramsMicrositeV2Component], + }) + .compileComponents() + })) + + beforeEach(() => { + fixture = TestBed.createComponent(KarmaProgramsMicrositeV2Component) + component = fixture.componentInstance + fixture.detectChanges() + }) + + it('should create', () => { + expect(component).toBeTruthy() + }) +}) diff --git a/project/ws/app/src/lib/routes/karma-programs/karma-programs-microsite-v2/karma-programs-microsite-v2.component.ts b/project/ws/app/src/lib/routes/karma-programs/karma-programs-microsite-v2/karma-programs-microsite-v2.component.ts new file mode 100644 index 000000000..2dc176028 --- /dev/null +++ b/project/ws/app/src/lib/routes/karma-programs/karma-programs-microsite-v2/karma-programs-microsite-v2.component.ts @@ -0,0 +1,195 @@ +import { Component, OnInit } from '@angular/core' +import { ActivatedRoute } from '@angular/router' +import { CommonMethodsService } from '@sunbird-cb/consumption' +import { KarmaProgramsService } from '../service/karma-programs.service' +import { EventService, WsEvents, MultilingualTranslationsService, ConfigurationsService } from '@sunbird-cb/utils-v2' +import { TranslateService } from '@ngx-translate/core' +import { DomSanitizer } from '@angular/platform-browser' + +@Component({ + selector: 'ws-app-karma-programs-microsite-v2', + templateUrl: './karma-programs-microsite-v2.component.html', + styleUrls: ['./karma-programs-microsite-v2.component.scss'], +}) +export class KarmaProgramsMicrositeV2Component implements OnInit { + programName = '' + playListKey = '' + orgId = '' + sectionList: any = [] + contentDataList: any = [] + originalContentlist: any = [] + seeAllPageConfig: any + titles = [ + { title: 'Learn', url: '/page/learn', icon: 'school', disableTranslate: false }, + { + title: `Karma Programs`, + url: `/app/learn/karma-programs/all-programs`, + icon: '', disableTranslate: true, + }, + ] + loadContentSearch = false + descriptionMaxLength = 750 + bannerImages: any + currentImageUrl: any + constructor(private route: ActivatedRoute, + public contentSvc: KarmaProgramsService, + private translate: TranslateService, + private langtranslations: MultilingualTranslationsService, + public eventSvc: EventService, + private configSvc: ConfigurationsService, + public commonSvc: CommonMethodsService, + private sanitizer: DomSanitizer) { + this.langtranslations.languageSelectedObservable.subscribe(() => { + if (localStorage.getItem('websiteLanguage')) { + this.translate.setDefaultLang('en') + const lang = localStorage.getItem('websiteLanguage')! + this.translate.use(lang) + } + }) + } + + ngOnInit() { + this.route.params.subscribe(params => { + this.programName = params['programName'] + this.playListKey = params['playListKey'] + this.orgId = params['orgId'] + this.titles.push({ + title: this.programName, icon: '', url: 'none', disableTranslate: true, + }) + }) + if (this.route.snapshot.data && this.route.snapshot.data.formData + && this.route.snapshot.data.formData.data + && this.route.snapshot.data.formData.data.result + && this.route.snapshot.data.formData.data.result.form + && this.route.snapshot.data.formData.data.result.form.data + && this.route.snapshot.data.formData.data.result.form.data.sectionList + ) { + this.sectionList = this.route.snapshot.data.formData.data.result.form.data.sectionList + this.getDataFromSearch() + } + + } + + richTextContent(content: any) { + return this.sanitizer.bypassSecurityTrustHtml(content) + } + + async getDataFromSearch(requestData?: any) { + const request = requestData || this.formRequest() + const sectionData = this.sectionList.filter((ele: any) => ele.key === 'contentSearch') + if (sectionData && sectionData.length) { + const strip: any = sectionData[0].column[0].data && sectionData[0].column[0].data.strips[0] || {} + this.seeAllPageConfig = strip + try { + this.loadContentSearch = true + const response = await this.fetchFromSearchV6(request) + if (response && response.results) { + if (response.results.result.content) { + let contentList = [] + if (this.configSvc && this.configSvc.unMappedUser && + this.configSvc.unMappedUser.profileDetails && + this.configSvc.unMappedUser.profileDetails.profileStatus && + this.configSvc.unMappedUser.profileDetails.profileStatus === 'VERIFIED') { + contentList = response.results.result.content + } else { + contentList = response.results.result.content.filter((ele: any) => { + if (ele.secureSettings) { + return ele.secureSettings && ele.secureSettings.isVerifiedKarmayogi === 'No' + } + return ele + }) + } + this.contentDataList = this.commonSvc.transformContentsToWidgets(contentList, strip) + this.originalContentlist = contentList + } + this.loadContentSearch = false + } + } catch (error) { + // Handle errors + // console.error('Error:', error); + } + } + } + + async fetchFromSearchV6(request: any) { + return new Promise((resolve, reject) => { + if (request && request) { + this.contentSvc.fetchPlaylistSearchData(this.playListKey, this.orgId).subscribe(results => { + resolve({ results }) + }, (error: any) => { + reject(error) + }, + ) + } + }) + } + // handleSearchQuery(e: any) { + // if (e.target.value) { + // const request = this.formRequest(e.target.value) + // this.getDataFromSearch(request) + // } + // } + + handleSearchQuery(e: any) { + if (e.target.value || e.target.value === '') { + this.contentDataList = this.commonSvc.transformSkeletonToWidgets(this.seeAllPageConfig) + // this.callApi(e.target.value) + this.filterContentList(e.target.value) + } + } + filterContentList(searchText: string) { + const data = [...this.originalContentlist] + const filterValue = searchText.toLowerCase() + const filteredData = data.filter((p: any) => p && p.name && p.name.toLowerCase().includes(filterValue)) + this.contentDataList = this.commonSvc.transformContentsToWidgets(filteredData, this.seeAllPageConfig) + } + + formRequest(queryText?: any, addFilter?: any) { + this.loadCardSkeletonLoader() + const request: any = { + 'request': { + 'query': queryText || '', + 'filters': { + 'contentType': 'Course', + ...addFilter, + 'status': [ + 'Live', + ], + }, + 'sort_by': { + 'lastUpdatedOn': 'desc', + }, + 'offset': 0, + 'fields': [ + ], + }, + } + return request + } + + loadCardSkeletonLoader() { + const sectionData = this.sectionList.filter((ele: any) => ele.key === 'contentSearch') + if (sectionData && sectionData.length) { + const strip: any = sectionData[0].column[0].data && sectionData[0].column[0].data.strips[0] + this.contentDataList = this.commonSvc.transformSkeletonToWidgets(strip) + } + } + + raiseTelemetryInteratEvent(event: any) { + this.eventSvc.raiseInteractTelemetry( + { + type: 'click', + subType: 'karma-programs', + id: `card-content`, + }, + { + id: event.identifier, + type: event.primaryCategory, + }, + { + module: WsEvents.EnumTelemetrymodules.LEARN, + } + ) + } + +} diff --git a/project/ws/app/src/lib/routes/karma-programs/karma-programs-microsite/karma-programs-microsite.component.spec.ts b/project/ws/app/src/lib/routes/karma-programs/karma-programs-microsite/karma-programs-microsite.component.spec.ts deleted file mode 100644 index 1b7a943c7..000000000 --- a/project/ws/app/src/lib/routes/karma-programs/karma-programs-microsite/karma-programs-microsite.component.spec.ts +++ /dev/null @@ -1,25 +0,0 @@ -import { async, ComponentFixture, TestBed } from '@angular/core/testing' - -import { KarmaProgramsMicrositeComponent } from './karma-programs-microsite.component' - -describe('KarmaProgramsMicrositeComponent', () => { - let component: KarmaProgramsMicrositeComponent - let fixture: ComponentFixture - - beforeEach(async(() => { - TestBed.configureTestingModule({ - declarations: [KarmaProgramsMicrositeComponent], - }) - .compileComponents() - })) - - beforeEach(() => { - fixture = TestBed.createComponent(KarmaProgramsMicrositeComponent) - component = fixture.componentInstance - fixture.detectChanges() - }) - - it('should create', () => { - expect(component).toBeTruthy() - }) -}) diff --git a/project/ws/app/src/lib/routes/karma-programs/karma-programs-routing.module.ts b/project/ws/app/src/lib/routes/karma-programs/karma-programs-routing.module.ts index a4f49bc69..99a47148a 100644 --- a/project/ws/app/src/lib/routes/karma-programs/karma-programs-routing.module.ts +++ b/project/ws/app/src/lib/routes/karma-programs/karma-programs-routing.module.ts @@ -1,9 +1,11 @@ import { NgModule } from '@angular/core' import { Routes, RouterModule } from '@angular/router' -import { KarmaProgramsFormService } from './service/karma-programs-form.service' +// import { KarmaProgramsFormV1Service } from './service/karma-programs-form-v1.service' import { KarmaProgramsComponent } from './karma-programs/karma-programs.component' -import { KarmaProgramsMicrositeComponent } from './karma-programs-microsite/karma-programs-microsite.component' +// import { KarmaProgramsMicrositeV1Component } from './karma-programs-microsite-v1/karma-programs-microsite-v1.component' import { KarmaProgramDataService } from './service/karma-program-data.service' +import { KarmaProgramsMicrositeV2Component } from './karma-programs-microsite-v2/karma-programs-microsite-v2.component' +import { KarmaProgramsFormV2Service } from './service/karma-programs-form-v2.service.' const routes: Routes = [ { @@ -22,15 +24,26 @@ const routes: Routes = [ programData: KarmaProgramDataService, }, }, + // { + // path: ':programName/:playListKey/:orgId/micro-sites', + // component: KarmaProgramsMicrositeV1Component, + // data: { + // pageId: ':programName/:playListKey/:orgId/micro-sites', + // module: 'Learn', + // }, + // resolve: { + // formData: KarmaProgramsFormV1Service, + // }, + // }, { path: ':programName/:playListKey/:orgId/micro-sites', - component: KarmaProgramsMicrositeComponent, + component: KarmaProgramsMicrositeV2Component, data: { pageId: ':programName/:playListKey/:orgId/micro-sites', module: 'Learn', }, resolve: { - formData: KarmaProgramsFormService, + formData: KarmaProgramsFormV2Service, }, }, ] diff --git a/project/ws/app/src/lib/routes/karma-programs/karma-programs.module.ts b/project/ws/app/src/lib/routes/karma-programs/karma-programs.module.ts index 13e866104..9a35a419f 100644 --- a/project/ws/app/src/lib/routes/karma-programs/karma-programs.module.ts +++ b/project/ws/app/src/lib/routes/karma-programs/karma-programs.module.ts @@ -1,21 +1,25 @@ import { NgModule } from '@angular/core' import { CommonModule } from '@angular/common' -import { KarmaProgramsComponent } from './karma-programs/karma-programs.component' -import { KarmaProgramsMicrositeComponent } from './karma-programs-microsite/karma-programs-microsite.component' +import { KarmaProgramsMicrositeV1Component } from './karma-programs-microsite-v1/karma-programs-microsite-v1.component' import { KarmaProgramsRoutingModule } from './karma-programs-routing.module' import { CardsModule, CommonMethodsService, SlidersLibModule } from '@sunbird-cb/consumption' import { FormsModule, ReactiveFormsModule } from '@angular/forms' import { MatButtonModule, MatFormFieldModule, MatIconModule, MatInputModule, MatMenuModule, MatProgressSpinnerModule, MatSelectModule, MatSidenavModule } from '@angular/material' import { KarmaProgramsService } from './service/karma-programs.service' -import { PipeFilterV2Module, PipeOrderByModule } from '@sunbird-cb/utils-v2' +import { ImageResponsiveModule, PipeFilterV2Module, PipeOrderByModule } from '@sunbird-cb/utils-v2' import { BtnPageBackModule } from '@sunbird-cb/collection/src/public-api' import { TranslateLoader, TranslateModule } from '@ngx-translate/core' import { HttpClient } from '@angular/common/http' import { HttpLoaderFactory } from 'src/app/app.module' import { KarmaProgramDataService } from './service/karma-program-data.service' +import { KarmaProgramsComponent } from './karma-programs/karma-programs.component' +import { KarmaProgramsMicrositeV2Component } from './karma-programs-microsite-v2/karma-programs-microsite-v2.component' @NgModule({ - declarations: [KarmaProgramsComponent, KarmaProgramsMicrositeComponent], + declarations: [ + KarmaProgramsComponent, + KarmaProgramsMicrositeV1Component, + KarmaProgramsMicrositeV2Component], imports: [ CommonModule, FormsModule, @@ -34,6 +38,7 @@ import { KarmaProgramDataService } from './service/karma-program-data.service' MatIconModule, MatMenuModule, MatButtonModule, + ImageResponsiveModule, TranslateModule.forRoot({ loader: { provide: TranslateLoader, diff --git a/project/ws/app/src/lib/routes/karma-programs/karma-programs/karma-programs.component.spec.ts b/project/ws/app/src/lib/routes/karma-programs/karma-programs/karma-programs.component.spec.ts index 82aed4075..73d0c0721 100644 --- a/project/ws/app/src/lib/routes/karma-programs/karma-programs/karma-programs.component.spec.ts +++ b/project/ws/app/src/lib/routes/karma-programs/karma-programs/karma-programs.component.spec.ts @@ -1,5 +1,4 @@ import { async, ComponentFixture, TestBed } from '@angular/core/testing' - import { KarmaProgramsComponent } from './karma-programs.component' describe('KarmaProgramsComponent', () => { diff --git a/project/ws/app/src/lib/routes/karma-programs/service/karma-programs-form-v1.service.spec.ts b/project/ws/app/src/lib/routes/karma-programs/service/karma-programs-form-v1.service.spec.ts new file mode 100644 index 000000000..e14767591 --- /dev/null +++ b/project/ws/app/src/lib/routes/karma-programs/service/karma-programs-form-v1.service.spec.ts @@ -0,0 +1,12 @@ +import { TestBed } from '@angular/core/testing' + +import { KarmaProgramsFormV1Service } from './karma-programs-form-v1.service' + +describe('KarmaProgramsFormV1Service', () => { + beforeEach(() => TestBed.configureTestingModule({})) + + it('should be created', () => { + const service: KarmaProgramsFormV1Service = TestBed.get(KarmaProgramsFormV1Service) + expect(service).toBeTruthy() + }) +}) diff --git a/project/ws/app/src/lib/routes/karma-programs/service/karma-programs-form.service.ts b/project/ws/app/src/lib/routes/karma-programs/service/karma-programs-form-v1.service.ts similarity index 96% rename from project/ws/app/src/lib/routes/karma-programs/service/karma-programs-form.service.ts rename to project/ws/app/src/lib/routes/karma-programs/service/karma-programs-form-v1.service.ts index d5ea61727..842ffe755 100644 --- a/project/ws/app/src/lib/routes/karma-programs/service/karma-programs-form.service.ts +++ b/project/ws/app/src/lib/routes/karma-programs/service/karma-programs-form-v1.service.ts @@ -8,7 +8,7 @@ import { FormExtService } from 'src/app/services/form-ext.service' @Injectable({ providedIn: 'root', }) -export class KarmaProgramsFormService implements +export class KarmaProgramsFormV1Service implements Resolve> | IResolveResponse> { constructor( private formSvc: FormExtService) {} diff --git a/project/ws/app/src/lib/routes/karma-programs/service/karma-programs-form-v2.service..ts b/project/ws/app/src/lib/routes/karma-programs/service/karma-programs-form-v2.service..ts new file mode 100644 index 000000000..b13f55b50 --- /dev/null +++ b/project/ws/app/src/lib/routes/karma-programs/service/karma-programs-form-v2.service..ts @@ -0,0 +1,46 @@ +import { Injectable } from '@angular/core' +import { ActivatedRouteSnapshot, Resolve, RouterStateSnapshot } from '@angular/router' +import { IResolveResponse } from '@sunbird-cb/utils-v2' +import { Observable, of } from 'rxjs' +import { catchError, map, tap } from 'rxjs/operators' +import { FormExtService } from 'src/app/services/form-ext.service' + +@Injectable({ + providedIn: 'root', +}) +export class KarmaProgramsFormV2Service implements +Resolve> | IResolveResponse> { +constructor( +private formSvc: FormExtService) {} + +resolve( + _route: ActivatedRouteSnapshot, + _state: RouterStateSnapshot, +): Observable> { + const orgId = _route.params && _route.params.orgId || '' + const requestData: any = { + 'request': { + 'type': 'karma-program', + 'subType': 'microsite-v2', + 'action': 'page-configuration', + 'component': 'portal', + 'rootOrgId': orgId, + }, + } + // 'request': { + // 'type': 'ATI-CTI', + // 'subType': 'microsite', + // 'action': 'page-configuration', + // 'component': 'portal', + // 'rootOrgId': orgId, + // }, + return this.formSvc.formReadData(requestData).pipe( + map((rData: any) => ({ data: rData, error: null })), + tap((resolveData: any) => { + const finalData = resolveData && resolveData.data.result.form + return of({ error: null, data: finalData }) + }), + catchError((error: any) => of({ error, data: null })), + ) + } +} diff --git a/project/ws/app/src/lib/routes/karma-programs/service/karma-programs-form-v2.service.spec.ts b/project/ws/app/src/lib/routes/karma-programs/service/karma-programs-form-v2.service.spec.ts new file mode 100644 index 000000000..a6ec9f74e --- /dev/null +++ b/project/ws/app/src/lib/routes/karma-programs/service/karma-programs-form-v2.service.spec.ts @@ -0,0 +1,11 @@ +import { TestBed } from '@angular/core/testing' +import { KarmaProgramsFormV2Service } from './karma-programs-form-v2.service.' + +describe('KarmaProgramsFormV2Service', () => { + beforeEach(() => TestBed.configureTestingModule({})) + + it('should be created', () => { + const service: KarmaProgramsFormV2Service = TestBed.get(KarmaProgramsFormV2Service) + expect(service).toBeTruthy() + }) +}) diff --git a/project/ws/app/src/lib/routes/karma-programs/service/karma-programs-form.service.spec.ts b/project/ws/app/src/lib/routes/karma-programs/service/karma-programs-form.service.spec.ts deleted file mode 100644 index 9a47438b5..000000000 --- a/project/ws/app/src/lib/routes/karma-programs/service/karma-programs-form.service.spec.ts +++ /dev/null @@ -1,12 +0,0 @@ -import { TestBed } from '@angular/core/testing' - -import { KarmaProgramsFormService } from './karma-programs-form.service' - -describe('KarmaProgramsFormService', () => { - beforeEach(() => TestBed.configureTestingModule({})) - - it('should be created', () => { - const service: KarmaProgramsFormService = TestBed.get(KarmaProgramsFormService) - expect(service).toBeTruthy() - }) -})