Skip to content

Commit 6d4721b

Browse files
Merge pull request #258 from christyfernandes/kcm-mapping
Kcm mapping
2 parents 6b65999 + be18991 commit 6d4721b

File tree

15 files changed

+339
-219
lines changed

15 files changed

+339
-219
lines changed

angular.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
"main": "src/main.ts",
1818
"polyfills": "src/polyfills.ts",
1919
"tsConfig": "tsconfig.app.json",
20+
"preserveSymlinks": true,
2021
"assets": [
2122
"src/favicon.png",
2223
"src/dashboard-assets/"
@@ -87,7 +88,8 @@
8788
"scripts": [
8889
"node_modules/jquery/dist/jquery.min.js",
8990
"node_modules/shepherd.js/dist/js/shepherd.min.js",
90-
"node_modules/@project-sunbird/telemetry-sdk/index.js"
91+
"node_modules/@project-sunbird/telemetry-sdk/index.js",
92+
"node_modules/leader-line/leader-line.min.js"
9193
]
9294
},
9395
"configurations": {

package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@
4141
"@angular/service-worker": "~8.2.1",
4242
"@project-sunbird/telemetry-sdk": "0.0.26",
4343
"@sunbird-cb/collection": "^1.0.34",
44+
"@sunbird-cb/taxonomy-editor": "^0.0.7",
4445
"@sunbird-cb/rain-dashboards": "^0.3.9",
4546
"@sunbird-cb/resolver": "^1.0.0",
4647
"@sunbird-cb/utils": "^1.0.17",
@@ -57,6 +58,7 @@
5758
"jquery": "^3.4.1",
5859
"jsplumb": "2.11.2",
5960
"keycloak-angular": "^6.1.0",
61+
"leader-line": "^1.0.7",
6062
"lodash": "^4.17.21",
6163
"material-icons": "^0.3.1",
6264
"moment": "^2.29.1",

project/ws/app/src/lib/routes/home/home.module.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { CommsComponent } from './routes/comms/comms.component'
2-
import { NgModule } from '@angular/core'
2+
import { CUSTOM_ELEMENTS_SCHEMA, NgModule } from '@angular/core'
33
import { CommonModule } from '@angular/common'
44
import { PipeFilterModule, PipeHtmlTagRemovalModule, PipeOrderByModule, PipeRelativeTimeModule } from '@sunbird-cb/utils'
55
import { MatGridListModule } from '@angular/material/grid-list'
@@ -89,6 +89,8 @@ import { RequestCopyDetailsComponent } from './routes/request/request-copy-detai
8989
import { CompetencyViewComponent } from './routes/request/competency-view/competency-view.component'
9090
import { ConfirmationPopupComponent } from './routes/request/confirmation-popup/confirmation-popup.component'
9191
import { AssignListPopupComponent } from './routes/request/assign-list-popup/assign-list-popup.component'
92+
import { KCMMappingComponent } from './routes/kcm-mapping/kcm-mapping.component'
93+
import { TaxonomyEditorModule } from '@sunbird-cb/taxonomy-editor'
9294
import { SingleAssignPopupComponent } from './routes/request/single-assign-popup/single-assign-popup.component'
9395
@NgModule({
9496
declarations: [
@@ -132,6 +134,7 @@ import { SingleAssignPopupComponent } from './routes/request/single-assign-popup
132134
CompetencyViewComponent,
133135
ConfirmationPopupComponent,
134136
AssignListPopupComponent,
137+
KCMMappingComponent,
135138
SingleAssignPopupComponent,
136139
],
137140
imports: [
@@ -189,6 +192,7 @@ import { SingleAssignPopupComponent } from './routes/request/single-assign-popup
189192
// TO-DO need to enable for image crop
190193
// ImageCropModule,
191194
NgMultiSelectDropDownModule.forRoot(),
195+
TaxonomyEditorModule,
192196
],
193197
entryComponents: [
194198
UserPopupComponent,
@@ -212,7 +216,7 @@ import { SingleAssignPopupComponent } from './routes/request/single-assign-popup
212216
ConfirmationPopupComponent,
213217
],
214218
exports: [AddThumbnailComponent],
219+
schemas: [CUSTOM_ELEMENTS_SCHEMA],
215220
})
216221
export class HomeModule {
217-
218222
}

project/ws/app/src/lib/routes/home/home.rounting.module.ts

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import { CreateMdoComponent } from './routes/create-mdo/create-mdo.component'
1111
import { CreateUserComponent } from './routes/create-user/create-user.component'
1212
import { DepartmentResolve } from './resolvers/department-resolve'
1313
import { RolesResolver } from './resolvers/roles-resolver.service'
14-
// import { PageResolve } from '@sunbird-cb/utils'
14+
import { PageResolve } from '@sunbird-cb/utils'
1515
import { ModerationViewComponent } from './routes/moderation/moderation.component'
1616
import { RolesUsersComponent } from './routes/roles-users/roles-users.component'
1717
import { ReportsComponent } from './routes/reports/reports.component'
@@ -32,6 +32,7 @@ import { AddSectorComponent } from './routes/sectors/add-sector/add-sector.compo
3232
import { EditSectorComponent } from './routes/sectors/edit-sector/edit-sector.component'
3333
import { AllRequestComponent } from './routes/request/all-request/all-request.component'
3434
import { RequestCopyDetailsComponent } from './routes/request/request-copy-details/request-copy-details.component'
35+
import { KCMMappingComponent } from './routes/kcm-mapping/kcm-mapping.component'
3536

3637
const routes: Routes = [
3738
{
@@ -371,7 +372,7 @@ const routes: Routes = [
371372
},
372373
{
373374
path: 'request-details',
374-
component: RequestCopyDetailsComponent,
375+
component: RequestCopyDetailsComponent,
375376
data: {
376377
pageId: 'home/request-details',
377378
module: 'Request-Details',
@@ -382,6 +383,20 @@ const routes: Routes = [
382383
configService: ConfigResolveService,
383384
},
384385
},
386+
{
387+
path: 'kcm-mapping',
388+
component: KCMMappingComponent,
389+
data: {
390+
pageId: 'home/KCM-mapping',
391+
module: 'KCM-mapping',
392+
pageType: 'feature',
393+
pageKey: 'kcm',
394+
},
395+
resolve: {
396+
configService: ConfigResolveService,
397+
pageData: PageResolve,
398+
},
399+
},
385400

386401
],
387402
},
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
<div class="flex flex-col gap-4">
2+
<h1 class="mat-heading-1">{{kcmConfig?.mainHeading}}</h1>
3+
<mat-card class="mb-4" [ngStyle]="{'background-color': showTopSection ? '#fff' : 'rgba(235, 235, 235, 1)'}">
4+
<div class="flex">
5+
<span class="mat-body-1 font-bold-imp flex-1">{{kcmConfig?.topsection?.heading}}</span>
6+
<mat-icon class="cursor-pointer mat-icon mr-4" *ngIf="showTopSection"
7+
(click)="showTopSection = !showTopSection">keyboard_arrow_up</mat-icon>
8+
<mat-icon class="cursor-pointer mat-icon mr-4" *ngIf="!showTopSection"
9+
(click)="showTopSection = !showTopSection">keyboard_arrow_down</mat-icon>
10+
</div>
11+
<div class="mt-5" *ngIf="showTopSection">
12+
<div class="flex">
13+
<div class="flex-1 flex-col gap-4">
14+
<p class="flex items-center" *ngFor="let step of kcmConfig?.topsection?.steps">
15+
<mat-icon class="mat-icon mr-4">error_outline</mat-icon>
16+
{{step.title}}
17+
</p>
18+
</div>
19+
<div *ngIf="kcmConfig?.topsection?.guideVideo?.enabled">
20+
<video width="173" height="102" controls>
21+
<source src="{{kcmConfig?.topsection?.guideVideo?.url}}" type="{{kcmConfig?.topsection?.guideVideo?.type}}">
22+
</video>
23+
</div>
24+
</div>
25+
</div>
26+
</mat-card>
27+
<div>
28+
<lib-taxonomy-view [environment]="environmentVal" [taxonomyConfig]="taxonomyConfig"></lib-taxonomy-view>
29+
</div>
30+
</div>
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
.font-bold-imp{
2+
font-weight: 700 !important;
3+
}
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
import { async, ComponentFixture, TestBed } from '@angular/core/testing'
2+
3+
import { KCMMappingComponent } from './kcm-mapping.component'
4+
5+
describe('KCMMappingComponent', () => {
6+
let component: KCMMappingComponent
7+
let fixture: ComponentFixture<KCMMappingComponent>
8+
9+
beforeEach(async(() => {
10+
TestBed.configureTestingModule({
11+
declarations: [KCMMappingComponent],
12+
})
13+
.compileComponents()
14+
}))
15+
16+
beforeEach(() => {
17+
fixture = TestBed.createComponent(KCMMappingComponent)
18+
component = fixture.componentInstance
19+
fixture.detectChanges()
20+
})
21+
22+
it('should create', () => {
23+
expect(component).toBeTruthy()
24+
})
25+
})
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
import { Component, OnInit } from '@angular/core'
2+
import { environment } from '../../../../../../../../../src/environments/environment'
3+
import { ActivatedRoute } from '@angular/router'
4+
5+
@Component({
6+
selector: 'ws-app-kcm-mapping',
7+
templateUrl: './kcm-mapping.component.html',
8+
styleUrls: ['./kcm-mapping.component.scss'],
9+
})
10+
export class KCMMappingComponent implements OnInit {
11+
environmentVal: any
12+
taxonomyConfig: any
13+
showTopSection = true
14+
kcmConfig: any
15+
constructor(
16+
private activateRoute: ActivatedRoute
17+
) { }
18+
19+
ngOnInit() {
20+
this.environmentVal = environment
21+
this.environmentVal.frameworkName = environment.KCMframeworkName
22+
// this.environmentVal.url = `https://localhost:3000`
23+
this.activateRoute.data.subscribe(data => {
24+
this.kcmConfig = data.pageData.data
25+
this.taxonomyConfig = this.kcmConfig.frameworkConfig
26+
// console.log('kcmConfig', this.kcmConfig)
27+
})
28+
}
29+
30+
}

0 commit comments

Comments
 (0)