└── competency-ui-lib ├── projects └── competency-ui │ ├── index.ts │ ├── core │ ├── index.ts │ ├── components │ │ └── app-loader │ │ │ ├── app-loader.component.html │ │ │ ├── app-loader.component.spec.ts │ │ │ ├── app-loader.component.ts │ │ │ └── app-loader.component.scss │ ├── public-api.ts │ ├── package.json │ ├── services │ │ ├── data.service.spec.ts │ │ └── data.service.ts │ ├── core.module.ts │ └── config │ │ └── url.config.ts │ ├── competency │ ├── index.ts │ ├── package.json │ ├── services │ │ ├── request-util.spec.ts │ │ ├── gained.service.spec.ts │ │ ├── active-summary.service.spec.ts │ │ ├── required-competency.service.spec.ts │ │ ├── required-competency.service.ts │ │ ├── active-summary.service.ts │ │ ├── gained.service.ts │ │ └── request-util.ts │ ├── public-api.ts │ ├── components │ │ ├── active-summary │ │ │ ├── active-summary.component.spec.ts │ │ │ ├── active-summary.component.html │ │ │ ├── active-summary.component.scss │ │ │ └── active-summary.component.ts │ │ ├── competency-dashboard │ │ │ ├── competency-dashboard.component.ts │ │ │ ├── competency-dashboard.component.spec.ts │ │ │ ├── competency-dashboard.component.html │ │ │ └── competency-dashboard.component.scss │ │ ├── gained-comptency-card │ │ │ ├── gained-comptency-card.component.spec.ts │ │ │ ├── gained-comptency-card.component.ts │ │ │ ├── gained-comptency-card.component.scss │ │ │ └── gained-comptency-card.component.html │ │ └── required-comptency-card │ │ │ ├── required-comptency-card.component.spec.ts │ │ │ ├── required-comptency-card.component.html │ │ │ ├── required-comptency-card.component.scss │ │ │ └── required-comptency-card.component.ts │ └── competency.module.ts │ ├── entry-module │ ├── index.ts │ ├── services │ │ ├── configuration-context.ts │ │ ├── configuration-context.spec.ts │ │ ├── config.service.spec.ts │ │ └── config.service.ts │ ├── package.json │ ├── components │ │ ├── competency-entry │ │ │ ├── competency-entry.component.html │ │ │ ├── competency-entry.component.scss │ │ │ ├── competency-entry.component.ts │ │ │ └── competency-entry.component.spec.ts │ │ └── slef-assessment-entry │ │ │ ├── slef-assessment-entry.component.html │ │ │ ├── slef-assessment-entry.component.scss │ │ │ ├── slef-assessment-entry.component.ts │ │ │ └── slef-assessment-entry.component.spec.ts │ ├── public-api.ts │ └── entry-module.ts │ ├── self-assessment │ ├── index.ts │ ├── package.json │ ├── public-api.ts │ ├── components │ │ ├── self-assessment-card │ │ │ ├── self-assessment-card.component.html │ │ │ ├── self-assessment-card.component.ts │ │ │ ├── self-assessment-card.component.spec.ts │ │ │ └── self-assessment-card.component.scss │ │ └── self-assessment │ │ │ ├── self-assessment.component.html │ │ │ ├── self-assessment.component.scss │ │ │ ├── self-assessment.component.spec.ts │ │ │ └── self-assessment.component.ts │ └── self-assessment.module.ts │ ├── assets │ ├── images │ │ └── filter.png │ └── styles │ │ └── global.scss │ ├── package.json │ ├── public-api.ts │ ├── ng-package.json │ ├── tslint.json │ ├── tsconfig.spec.json │ ├── competency-routing │ └── competency-routing.module.ts │ ├── tsconfig.lib.json │ ├── test.ts │ ├── README.md │ └── karma.conf.js ├── .editorconfig ├── .gitignore ├── tsconfig.json ├── README.md ├── angular.json ├── package.json └── tslint.json /competency-ui-lib/projects/competency-ui/index.ts: -------------------------------------------------------------------------------- 1 | export * from './public-api' -------------------------------------------------------------------------------- /competency-ui-lib/projects/competency-ui/core/index.ts: -------------------------------------------------------------------------------- 1 | export * from './public-api' -------------------------------------------------------------------------------- /competency-ui-lib/projects/competency-ui/competency/index.ts: -------------------------------------------------------------------------------- 1 | export * from './public-api' -------------------------------------------------------------------------------- /competency-ui-lib/projects/competency-ui/entry-module/index.ts: -------------------------------------------------------------------------------- 1 | export * from './public-api' -------------------------------------------------------------------------------- /competency-ui-lib/projects/competency-ui/self-assessment/index.ts: -------------------------------------------------------------------------------- 1 | export * from './public-api' -------------------------------------------------------------------------------- /competency-ui-lib/projects/competency-ui/entry-module/services/configuration-context.ts: -------------------------------------------------------------------------------- 1 | export class ConfigurationContext { 2 | config:any 3 | } 4 | -------------------------------------------------------------------------------- /competency-ui-lib/projects/competency-ui/entry-module/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "ngPackage": { 3 | "lib": { 4 | "entryFile": "public-api.ts" 5 | } 6 | } 7 | } -------------------------------------------------------------------------------- /competency-ui-lib/projects/competency-ui/self-assessment/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "ngPackage": { 3 | "lib": { 4 | "entryFile": "public-api.ts" 5 | } 6 | } 7 | } -------------------------------------------------------------------------------- /competency-ui-lib/projects/competency-ui/assets/images/filter.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sphere/aastrika-UI/master/competency-ui-lib/projects/competency-ui/assets/images/filter.png -------------------------------------------------------------------------------- /competency-ui-lib/projects/competency-ui/entry-module/components/competency-entry/competency-entry.component.html: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /competency-ui-lib/projects/competency-ui/core/components/app-loader/app-loader.component.html: -------------------------------------------------------------------------------- 1 | 2 |
3 |

4 |
5 |
6 | -------------------------------------------------------------------------------- /competency-ui-lib/projects/competency-ui/entry-module/components/slef-assessment-entry/slef-assessment-entry.component.html: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /competency-ui-lib/projects/competency-ui/core/public-api.ts: -------------------------------------------------------------------------------- 1 | export * from './config/url.config' 2 | export * from './services/data.service' 3 | export * from './components/app-loader/app-loader.component' 4 | export * from './core.module' -------------------------------------------------------------------------------- /competency-ui-lib/projects/competency-ui/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@aastrika_npmjs/comptency", 3 | "version": "0.0.1", 4 | "peerDependencies": { 5 | "@angular/common": "^8.2.14", 6 | "@angular/core": "^8.2.14" 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /competency-ui-lib/projects/competency-ui/core/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "ngPackage": { 3 | "lib": { 4 | "entryFile": "public-api.ts", 5 | "umdModuleIds":{ 6 | "lodash-es":"lodashEs" 7 | } 8 | } 9 | } 10 | } -------------------------------------------------------------------------------- /competency-ui-lib/projects/competency-ui/competency/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "ngPackage": { 3 | "lib": { 4 | "entryFile": "public-api.ts", 5 | "umdModuleIds":{ 6 | "lodash-es":"lodashEs" 7 | } 8 | } 9 | } 10 | } -------------------------------------------------------------------------------- /competency-ui-lib/projects/competency-ui/public-api.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Public API Surface of competency-ui 3 | */ 4 | 5 | export * from './entry-module/entry-module' 6 | export * from './self-assessment/self-assessment.module' 7 | export * from './competency/competency.module' -------------------------------------------------------------------------------- /competency-ui-lib/projects/competency-ui/self-assessment/public-api.ts: -------------------------------------------------------------------------------- 1 | export * from './components/self-assessment-card/self-assessment-card.component' 2 | export * from './components/self-assessment/self-assessment.component' 3 | export * from './self-assessment.module' -------------------------------------------------------------------------------- /competency-ui-lib/projects/competency-ui/competency/services/request-util.spec.ts: -------------------------------------------------------------------------------- 1 | import { RequestUtil } from './request-util'; 2 | 3 | describe('RequestUtil', () => { 4 | it('should create an instance', () => { 5 | expect(new RequestUtil()).toBeTruthy(); 6 | }); 7 | }); 8 | -------------------------------------------------------------------------------- /competency-ui-lib/projects/competency-ui/entry-module/public-api.ts: -------------------------------------------------------------------------------- 1 | 2 | export * from './components/slef-assessment-entry/slef-assessment-entry.component' 3 | export * from './components/competency-entry/competency-entry.component' 4 | export * from './services/config.service' 5 | export * from './entry-module' -------------------------------------------------------------------------------- /competency-ui-lib/projects/competency-ui/ng-package.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "../../node_modules/ng-packagr/ng-package.schema.json", 3 | "dest": "../../dist/competency-ui", 4 | "lib": { 5 | "entryFile": "public-api.ts", 6 | "umdModuleIds":{ 7 | "lodash-es":"lodashEs" 8 | } 9 | } 10 | } -------------------------------------------------------------------------------- /competency-ui-lib/projects/competency-ui/entry-module/services/configuration-context.spec.ts: -------------------------------------------------------------------------------- 1 | import { ConfigurationContext } from './configuration-context'; 2 | 3 | describe('ConfigurationContext', () => { 4 | it('should create an instance', () => { 5 | expect(new ConfigurationContext()).toBeTruthy(); 6 | }); 7 | }); 8 | -------------------------------------------------------------------------------- /competency-ui-lib/.editorconfig: -------------------------------------------------------------------------------- 1 | # Editor configuration, see https://editorconfig.org 2 | root = true 3 | 4 | [*] 5 | charset = utf-8 6 | indent_style = space 7 | indent_size = 2 8 | insert_final_newline = true 9 | trim_trailing_whitespace = true 10 | 11 | [*.md] 12 | max_line_length = off 13 | trim_trailing_whitespace = false 14 | -------------------------------------------------------------------------------- /competency-ui-lib/projects/competency-ui/tslint.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tslint.json", 3 | "rules": { 4 | "directive-selector": [ 5 | true, 6 | "attribute", 7 | "lib", 8 | "camelCase" 9 | ], 10 | "component-selector": [ 11 | true, 12 | "element", 13 | "lib", 14 | "kebab-case" 15 | ] 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /competency-ui-lib/projects/competency-ui/tsconfig.spec.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "../../out-tsc/spec", 5 | "types": [ 6 | "jasmine", 7 | "node" 8 | ] 9 | }, 10 | "files": [ 11 | "src/test.ts" 12 | ], 13 | "include": [ 14 | "**/*.spec.ts", 15 | "**/*.d.ts" 16 | ] 17 | } 18 | -------------------------------------------------------------------------------- /competency-ui-lib/projects/competency-ui/competency/public-api.ts: -------------------------------------------------------------------------------- 1 | export * from './components/required-comptency-card/required-comptency-card.component' 2 | export * from './components/gained-comptency-card/gained-comptency-card.component' 3 | export * from './components/competency-dashboard/competency-dashboard.component' 4 | export * from './competency.module' 5 | export * from './services/request-util' -------------------------------------------------------------------------------- /competency-ui-lib/projects/competency-ui/entry-module/components/competency-entry/competency-entry.component.scss: -------------------------------------------------------------------------------- 1 | @import '../../../assets/styles/global.scss'; 2 | 3 | .mat-primary-background { 4 | background: #1C5D95 !important; 5 | border-radius: $radius-l; 6 | color: white; 7 | border: none; 8 | padding: 9px 40px; 9 | gap: 8px; 10 | width: 310px; 11 | cursor: pointer; 12 | } -------------------------------------------------------------------------------- /competency-ui-lib/projects/competency-ui/entry-module/components/slef-assessment-entry/slef-assessment-entry.component.scss: -------------------------------------------------------------------------------- 1 | @import '../../../assets/styles/global.scss'; 2 | 3 | .mat-primary-background { 4 | background: #1C5D95 !important; 5 | border-radius: $radius-l; 6 | color: white; 7 | border: none; 8 | padding: 9px 40px; 9 | gap: 8px; 10 | width: 310px; 11 | cursor: pointer; 12 | } 13 | -------------------------------------------------------------------------------- /competency-ui-lib/projects/competency-ui/core/services/data.service.spec.ts: -------------------------------------------------------------------------------- 1 | import { TestBed } from '@angular/core/testing'; 2 | 3 | import { DataService } from './data.service'; 4 | 5 | describe('DataService', () => { 6 | beforeEach(() => TestBed.configureTestingModule({})); 7 | 8 | it('should be created', () => { 9 | const service: DataService = TestBed.get(DataService); 10 | expect(service).toBeTruthy(); 11 | }); 12 | }); 13 | -------------------------------------------------------------------------------- /competency-ui-lib/projects/competency-ui/competency/services/gained.service.spec.ts: -------------------------------------------------------------------------------- 1 | import { TestBed } from '@angular/core/testing'; 2 | 3 | import { GainedService } from './gained.service'; 4 | 5 | describe('GainedService', () => { 6 | beforeEach(() => TestBed.configureTestingModule({})); 7 | 8 | it('should be created', () => { 9 | const service: GainedService = TestBed.get(GainedService); 10 | expect(service).toBeTruthy(); 11 | }); 12 | }); 13 | -------------------------------------------------------------------------------- /competency-ui-lib/projects/competency-ui/entry-module/services/config.service.spec.ts: -------------------------------------------------------------------------------- 1 | import { TestBed } from '@angular/core/testing'; 2 | 3 | import { ConfigService } from './config.service'; 4 | 5 | describe('ConfigService', () => { 6 | beforeEach(() => TestBed.configureTestingModule({})); 7 | 8 | it('should be created', () => { 9 | const service: ConfigService = TestBed.get(ConfigService); 10 | expect(service).toBeTruthy(); 11 | }); 12 | }); 13 | -------------------------------------------------------------------------------- /competency-ui-lib/projects/competency-ui/self-assessment/components/self-assessment-card/self-assessment-card.component.html: -------------------------------------------------------------------------------- 1 |
2 | 3 |
{{ cardData?.title }}
4 |
5 | 6 |
{{ cardData?.description }}
7 |
8 | 9 | 10 |
11 | -------------------------------------------------------------------------------- /competency-ui-lib/projects/competency-ui/competency/services/active-summary.service.spec.ts: -------------------------------------------------------------------------------- 1 | import { TestBed } from '@angular/core/testing'; 2 | 3 | import { ActiveSummaryService } from './active-summary.service'; 4 | 5 | describe('ActiveSummaryService', () => { 6 | beforeEach(() => TestBed.configureTestingModule({})); 7 | 8 | it('should be created', () => { 9 | const service: ActiveSummaryService = TestBed.get(ActiveSummaryService); 10 | expect(service).toBeTruthy(); 11 | }); 12 | }); 13 | -------------------------------------------------------------------------------- /competency-ui-lib/projects/competency-ui/competency-routing/competency-routing.module.ts: -------------------------------------------------------------------------------- 1 | 2 | import { NgModule } from '@angular/core' 3 | import { CommonModule } from '@angular/common' 4 | import { RouterModule, Routes } from '@angular/router' 5 | 6 | const routes: Routes = [ 7 | 8 | ] 9 | 10 | @NgModule({ 11 | declarations: [], 12 | imports: [ 13 | RouterModule.forChild(routes), 14 | CommonModule 15 | ], 16 | exports: [RouterModule] 17 | }) 18 | export class CompetencyRoutingModule { } 19 | -------------------------------------------------------------------------------- /competency-ui-lib/projects/competency-ui/self-assessment/components/self-assessment/self-assessment.component.html: -------------------------------------------------------------------------------- 1 |
2 | chevron_left 3 | 4 |

Self Assessment

5 | 6 | 7 | 8 | 9 | 10 |
11 | -------------------------------------------------------------------------------- /competency-ui-lib/projects/competency-ui/competency/services/required-competency.service.spec.ts: -------------------------------------------------------------------------------- 1 | import { TestBed } from '@angular/core/testing'; 2 | 3 | import { RequiredCompetencyService } from './required-competency.service'; 4 | 5 | describe('RequiredCompetencyService', () => { 6 | beforeEach(() => TestBed.configureTestingModule({})); 7 | 8 | it('should be created', () => { 9 | const service: RequiredCompetencyService = TestBed.get(RequiredCompetencyService); 10 | expect(service).toBeTruthy(); 11 | }); 12 | }); 13 | -------------------------------------------------------------------------------- /competency-ui-lib/projects/competency-ui/self-assessment/components/self-assessment-card/self-assessment-card.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, Input, OnInit } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'lib-self-assessment-card', 5 | templateUrl: './self-assessment-card.component.html', 6 | styleUrls: ['./self-assessment-card.component.scss'] 7 | }) 8 | export class SelfAssessmentCardComponent implements OnInit { 9 | 10 | @Input() cardData: any 11 | 12 | 13 | constructor() { } 14 | 15 | ngOnInit() { 16 | } 17 | 18 | } 19 | -------------------------------------------------------------------------------- /competency-ui-lib/projects/competency-ui/entry-module/components/competency-entry/competency-entry.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, EventEmitter, OnInit, Output } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'lib-competency-entry', 5 | templateUrl: './competency-entry.component.html', 6 | styleUrls: ['./competency-entry.component.scss'] 7 | }) 8 | export class CompetencyEntryComponent implements OnInit { 9 | @Output() stateChange: EventEmitter = new EventEmitter(); 10 | constructor() { } 11 | 12 | ngOnInit() { 13 | } 14 | 15 | navigateTo(){ 16 | this.stateChange.emit({'navigation':true}) 17 | } 18 | 19 | } 20 | -------------------------------------------------------------------------------- /competency-ui-lib/projects/competency-ui/self-assessment/components/self-assessment/self-assessment.component.scss: -------------------------------------------------------------------------------- 1 | 2 | .content { 3 | padding: 60px 20px 50px; 4 | margin: auto; 5 | 6 | @media only screen and (min-width: 960px) { 7 | max-width: 30%; 8 | } 9 | 10 | @media only screen and (min-width: 1280px) { 11 | max-width: 35%; 12 | } 13 | 14 | @media only screen and (min-width: 1920px) { 15 | max-width: 30%; 16 | } 17 | 18 | @media only screen and (min-width: 600px) and (max-width: 959px) { 19 | max-width: 50%; 20 | } 21 | 22 | @media only screen and (max-width: 599px){ 23 | max-width: 90%; 24 | } 25 | } 26 | 27 | 28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /competency-ui-lib/projects/competency-ui/core/core.module.ts: -------------------------------------------------------------------------------- 1 | import { NgModule } from '@angular/core'; 2 | import { CommonModule } from '@angular/common'; 3 | import { DataService } from './services/data.service'; 4 | import { HttpClientModule } from '@angular/common/http' 5 | import { AppLoaderComponent } from './components/app-loader/app-loader.component'; 6 | /** 7 | * Core Module 8 | * 9 | * @author Aman Kumar Sharma 10 | */ 11 | @NgModule({ 12 | imports: [ 13 | CommonModule, 14 | HttpClientModule, 15 | ], 16 | declarations: [AppLoaderComponent], 17 | exports:[AppLoaderComponent], 18 | providers:[DataService] 19 | }) 20 | export class CoreModule { } 21 | -------------------------------------------------------------------------------- /competency-ui-lib/projects/competency-ui/tsconfig.lib.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "../../out-tsc/lib", 5 | "target": "es2015", 6 | "declaration": true, 7 | "inlineSources": true, 8 | "types": [], 9 | "lib": [ 10 | "dom", 11 | "es2018" 12 | ] 13 | }, 14 | "angularCompilerOptions": { 15 | "annotateForClosureCompiler": false, 16 | "skipTemplateCodegen": true, 17 | "strictMetadataEmit": true, 18 | "fullTemplateTypeCheck": true, 19 | "strictInjectionParameters": true, 20 | "enableResourceInlining": true 21 | }, 22 | "exclude": [ 23 | "src/test.ts", 24 | "**/*.spec.ts" 25 | ] 26 | } 27 | -------------------------------------------------------------------------------- /competency-ui-lib/projects/competency-ui/entry-module/components/slef-assessment-entry/slef-assessment-entry.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, EventEmitter, OnInit, Output } from '@angular/core'; 2 | import { Router } from '@angular/router'; 3 | @Component({ 4 | selector: 'lib-slef-assessment-entry', 5 | templateUrl: './slef-assessment-entry.component.html', 6 | styleUrls: ['./slef-assessment-entry.component.scss'] 7 | }) 8 | export class SlefAssessmentEntryComponent implements OnInit { 9 | @Output() stateChange: EventEmitter = new EventEmitter(); 10 | constructor(public router:Router) { } 11 | 12 | ngOnInit() { 13 | } 14 | 15 | navigateTo(){ 16 | this.stateChange.emit({'navigation':true}) 17 | } 18 | 19 | } 20 | -------------------------------------------------------------------------------- /competency-ui-lib/projects/competency-ui/self-assessment/self-assessment.module.ts: -------------------------------------------------------------------------------- 1 | import { NgModule } from '@angular/core'; 2 | import { CommonModule } from '@angular/common'; 3 | import { SelfAssessmentCardComponent } from './components/self-assessment-card/self-assessment-card.component'; 4 | import { SelfAssessmentComponent } from './components/self-assessment/self-assessment.component'; 5 | import { MatIconModule } from '@angular/material'; 6 | 7 | 8 | @NgModule({ 9 | declarations: [SelfAssessmentCardComponent, SelfAssessmentComponent], 10 | imports: [ 11 | CommonModule, 12 | MatIconModule, 13 | ], 14 | exports:[SelfAssessmentCardComponent, SelfAssessmentComponent] 15 | }) 16 | export class SelfAssessmentModule { } 17 | -------------------------------------------------------------------------------- /competency-ui-lib/projects/competency-ui/core/config/url.config.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * urlConfig to return the api url 3 | * 4 | * @author Aman Kumar Sharma 5 | */ 6 | export const urlConfig = { 7 | // endpoint configs...! 8 | // host: 'http://localhost:3002', 9 | host: 'http://localhost:3000', 10 | apiSlug: '/apis/protected/v8', 11 | apiProxy: '/apis/proxies/v8', 12 | apiBasePath: () => `${urlConfig.host}${urlConfig.apiSlug}`, 13 | apiBaseProxy:() => `${urlConfig.host}${urlConfig.apiProxy}`, 14 | getEntityById: (id:number) => `${urlConfig.apiBasePath()}/entityCompetency/getEntityById/${id}`, 15 | getAllEntity: () => `${urlConfig.apiBasePath()}/entityCompetency/getAllEntity`, 16 | getUserPassbook: () => `${urlConfig.apiBaseProxy()}/user/v1/passbook`, 17 | } -------------------------------------------------------------------------------- /competency-ui-lib/projects/competency-ui/test.ts: -------------------------------------------------------------------------------- 1 | // This file is required by karma.conf.js and loads recursively all the .spec and framework files 2 | 3 | import 'zone.js/dist/zone'; 4 | import 'zone.js/dist/zone-testing'; 5 | import { getTestBed } from '@angular/core/testing'; 6 | import { 7 | BrowserDynamicTestingModule, 8 | platformBrowserDynamicTesting 9 | } from '@angular/platform-browser-dynamic/testing'; 10 | 11 | declare const require: any; 12 | 13 | // First, initialize the Angular testing environment. 14 | getTestBed().initTestEnvironment( 15 | BrowserDynamicTestingModule, 16 | platformBrowserDynamicTesting() 17 | ); 18 | // Then we find all the tests. 19 | const context = require.context('./', true, /\.spec\.ts$/); 20 | // And load the modules. 21 | context.keys().map(context); 22 | -------------------------------------------------------------------------------- /competency-ui-lib/projects/competency-ui/core/components/app-loader/app-loader.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { async, ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { AppLoaderComponent } from './app-loader.component'; 4 | 5 | describe('AppLoaderComponent', () => { 6 | let component: AppLoaderComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async(() => { 10 | TestBed.configureTestingModule({ 11 | declarations: [ AppLoaderComponent ] 12 | }) 13 | .compileComponents(); 14 | })); 15 | 16 | beforeEach(() => { 17 | fixture = TestBed.createComponent(AppLoaderComponent); 18 | component = fixture.componentInstance; 19 | fixture.detectChanges(); 20 | }); 21 | 22 | it('should create', () => { 23 | expect(component).toBeTruthy(); 24 | }); 25 | }); 26 | -------------------------------------------------------------------------------- /competency-ui-lib/.gitignore: -------------------------------------------------------------------------------- 1 | # See http://help.github.com/ignore-files/ for more about ignoring files. 2 | 3 | # compiled output 4 | /dist 5 | /tmp 6 | /out-tsc 7 | # Only exists if Bazel was run 8 | /bazel-out 9 | 10 | # dependencies 11 | /node_modules 12 | 13 | # profiling files 14 | chrome-profiler-events*.json 15 | speed-measure-plugin*.json 16 | 17 | # IDEs and editors 18 | /.idea 19 | .project 20 | .classpath 21 | .c9/ 22 | *.launch 23 | .settings/ 24 | *.sublime-workspace 25 | 26 | # IDE - VSCode 27 | .vscode/* 28 | !.vscode/settings.json 29 | !.vscode/tasks.json 30 | !.vscode/launch.json 31 | !.vscode/extensions.json 32 | .history/* 33 | 34 | # misc 35 | /.sass-cache 36 | /connect.lock 37 | /coverage 38 | /libpeerconnection.log 39 | npm-debug.log 40 | yarn-error.log 41 | testem.log 42 | /typings 43 | 44 | # System Files 45 | .DS_Store 46 | Thumbs.db 47 | -------------------------------------------------------------------------------- /competency-ui-lib/projects/competency-ui/core/components/app-loader/app-loader.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, Input, OnInit } from '@angular/core'; 2 | import * as _ from 'lodash-es' 3 | @Component({ 4 | selector: 'lib-app-loader', 5 | templateUrl: './app-loader.component.html', 6 | styleUrls: ['./app-loader.component.scss'] 7 | }) 8 | export class AppLoaderComponent implements OnInit { 9 | 10 | @Input() data; 11 | headerMessage: string; 12 | loaderMessage: string; 13 | 14 | constructor() { } 15 | 16 | ngOnInit() { 17 | this.headerMessage = 'Please wait'; 18 | this.loaderMessage = 'We are fetching details'; 19 | if (this.data) { 20 | this.headerMessage = _.get(this.data, 'headerMessage') || this.headerMessage; 21 | this.loaderMessage = _.get(this.data, 'loaderMessage') || this.loaderMessage; 22 | } 23 | 24 | } 25 | 26 | } 27 | -------------------------------------------------------------------------------- /competency-ui-lib/projects/competency-ui/competency/components/active-summary/active-summary.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { async, ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { ActiveSummaryComponent } from './active-summary.component'; 4 | 5 | describe('ActiveSummaryComponent', () => { 6 | let component: ActiveSummaryComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async(() => { 10 | TestBed.configureTestingModule({ 11 | declarations: [ ActiveSummaryComponent ] 12 | }) 13 | .compileComponents(); 14 | })); 15 | 16 | beforeEach(() => { 17 | fixture = TestBed.createComponent(ActiveSummaryComponent); 18 | component = fixture.componentInstance; 19 | fixture.detectChanges(); 20 | }); 21 | 22 | it('should create', () => { 23 | expect(component).toBeTruthy(); 24 | }); 25 | }); 26 | -------------------------------------------------------------------------------- /competency-ui-lib/projects/competency-ui/self-assessment/components/self-assessment/self-assessment.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { async, ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { SelfAssessmentComponent } from './self-assessment.component'; 4 | 5 | describe('SelfAssessmentComponent', () => { 6 | let component: SelfAssessmentComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async(() => { 10 | TestBed.configureTestingModule({ 11 | declarations: [ SelfAssessmentComponent ] 12 | }) 13 | .compileComponents(); 14 | })); 15 | 16 | beforeEach(() => { 17 | fixture = TestBed.createComponent(SelfAssessmentComponent); 18 | component = fixture.componentInstance; 19 | fixture.detectChanges(); 20 | }); 21 | 22 | it('should create', () => { 23 | expect(component).toBeTruthy(); 24 | }); 25 | }); 26 | -------------------------------------------------------------------------------- /competency-ui-lib/projects/competency-ui/entry-module/components/competency-entry/competency-entry.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { async, ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { CompetencyEntryComponent } from './competency-entry.component'; 4 | 5 | describe('CompetencyEntryComponent', () => { 6 | let component: CompetencyEntryComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async(() => { 10 | TestBed.configureTestingModule({ 11 | declarations: [ CompetencyEntryComponent ] 12 | }) 13 | .compileComponents(); 14 | })); 15 | 16 | beforeEach(() => { 17 | fixture = TestBed.createComponent(CompetencyEntryComponent); 18 | component = fixture.componentInstance; 19 | fixture.detectChanges(); 20 | }); 21 | 22 | it('should create', () => { 23 | expect(component).toBeTruthy(); 24 | }); 25 | }); 26 | -------------------------------------------------------------------------------- /competency-ui-lib/projects/competency-ui/competency/components/competency-dashboard/competency-dashboard.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, EventEmitter, OnInit, Output } from '@angular/core'; 2 | import { Location } from '@angular/common' 3 | 4 | @Component({ 5 | selector: 'lib-competency-dashboard', 6 | templateUrl: './competency-dashboard.component.html', 7 | styleUrls: ['./competency-dashboard.component.scss'] 8 | }) 9 | export class CompetencyDashboardComponent implements OnInit { 10 | @Output() stateChange: EventEmitter = new EventEmitter(); 11 | tabIndex = 0; 12 | constructor(private location: Location) { 13 | } 14 | 15 | ngOnInit() { 16 | } 17 | 18 | navigateBack() { 19 | this.location.back() 20 | } 21 | changeTab(event:any){ 22 | this.tabIndex = event.index; 23 | } 24 | startSelfAssessment() { 25 | this.stateChange.emit({'navigation':true}) 26 | } 27 | 28 | } 29 | -------------------------------------------------------------------------------- /competency-ui-lib/projects/competency-ui/entry-module/services/config.service.ts: -------------------------------------------------------------------------------- 1 | import { Injectable, Optional } from '@angular/core'; 2 | import { Subject,BehaviorSubject } from 'rxjs'; 3 | import { ConfigurationContext } from './configuration-context'; 4 | @Injectable({ 5 | providedIn: 'root' 6 | }) 7 | export class ConfigService { 8 | public config$: Subject = new BehaviorSubject({}); 9 | private _config = this.config$.asObservable() 10 | constructor(@Optional() context: ConfigurationContext, ) { 11 | if(context){ 12 | console.log('context log in config service ------ ', context) 13 | this.setConfig(context) 14 | } 15 | } 16 | public setConfig(context) { 17 | this.config$.next(context) 18 | } 19 | public getConfig(){ 20 | let config :any 21 | this._config.subscribe((res:any)=>{ 22 | config = res 23 | }) 24 | return config 25 | } 26 | 27 | } 28 | -------------------------------------------------------------------------------- /competency-ui-lib/projects/competency-ui/competency/components/competency-dashboard/competency-dashboard.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { async, ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { CompetencyDashboardComponent } from './competency-dashboard.component'; 4 | 5 | describe('CompetencyDashboardComponent', () => { 6 | let component: CompetencyDashboardComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async(() => { 10 | TestBed.configureTestingModule({ 11 | declarations: [ CompetencyDashboardComponent ] 12 | }) 13 | .compileComponents(); 14 | })); 15 | 16 | beforeEach(() => { 17 | fixture = TestBed.createComponent(CompetencyDashboardComponent); 18 | component = fixture.componentInstance; 19 | fixture.detectChanges(); 20 | }); 21 | 22 | it('should create', () => { 23 | expect(component).toBeTruthy(); 24 | }); 25 | }); 26 | -------------------------------------------------------------------------------- /competency-ui-lib/projects/competency-ui/self-assessment/components/self-assessment-card/self-assessment-card.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { async, ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { SelfAssessmentCardComponent } from './self-assessment-card.component'; 4 | 5 | describe('SelfAssessmentCardComponent', () => { 6 | let component: SelfAssessmentCardComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async(() => { 10 | TestBed.configureTestingModule({ 11 | declarations: [ SelfAssessmentCardComponent ] 12 | }) 13 | .compileComponents(); 14 | })); 15 | 16 | beforeEach(() => { 17 | fixture = TestBed.createComponent(SelfAssessmentCardComponent); 18 | component = fixture.componentInstance; 19 | fixture.detectChanges(); 20 | }); 21 | 22 | it('should create', () => { 23 | expect(component).toBeTruthy(); 24 | }); 25 | }); 26 | -------------------------------------------------------------------------------- /competency-ui-lib/projects/competency-ui/competency/components/gained-comptency-card/gained-comptency-card.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { async, ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { GainedComptencyCardComponent } from './gained-comptency-card.component'; 4 | 5 | describe('GainedComptencyCardComponent', () => { 6 | let component: GainedComptencyCardComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async(() => { 10 | TestBed.configureTestingModule({ 11 | declarations: [ GainedComptencyCardComponent ] 12 | }) 13 | .compileComponents(); 14 | })); 15 | 16 | beforeEach(() => { 17 | fixture = TestBed.createComponent(GainedComptencyCardComponent); 18 | component = fixture.componentInstance; 19 | fixture.detectChanges(); 20 | }); 21 | 22 | it('should create', () => { 23 | expect(component).toBeTruthy(); 24 | }); 25 | }); 26 | -------------------------------------------------------------------------------- /competency-ui-lib/projects/competency-ui/entry-module/components/slef-assessment-entry/slef-assessment-entry.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { async, ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { SlefAssessmentEntryComponent } from './slef-assessment-entry.component'; 4 | 5 | describe('SlefAssessmentEntryComponent', () => { 6 | let component: SlefAssessmentEntryComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async(() => { 10 | TestBed.configureTestingModule({ 11 | declarations: [ SlefAssessmentEntryComponent ] 12 | }) 13 | .compileComponents(); 14 | })); 15 | 16 | beforeEach(() => { 17 | fixture = TestBed.createComponent(SlefAssessmentEntryComponent); 18 | component = fixture.componentInstance; 19 | fixture.detectChanges(); 20 | }); 21 | 22 | it('should create', () => { 23 | expect(component).toBeTruthy(); 24 | }); 25 | }); 26 | -------------------------------------------------------------------------------- /competency-ui-lib/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compileOnSave": false, 3 | "compilerOptions": { 4 | "baseUrl": "./", 5 | "outDir": "./dist/out-tsc", 6 | "sourceMap": true, 7 | "declaration": false, 8 | "downlevelIteration": true, 9 | "experimentalDecorators": true, 10 | "resolveJsonModule":true, 11 | "module": "esnext", 12 | "moduleResolution": "node", 13 | "importHelpers": true, 14 | "target": "es2015", 15 | "typeRoots": [ 16 | "node_modules/@types" 17 | ], 18 | "lib": [ 19 | "es2018", 20 | "dom" 21 | ], 22 | "paths": { 23 | "@aastrika_npmjs/comptency/*": [ 24 | "projects/competency-ui/*" 25 | ], 26 | "@aastrika_npmjs/comptency": [ 27 | "projects/competency-ui" 28 | ] 29 | } 30 | }, 31 | "angularCompilerOptions": { 32 | "fullTemplateTypeCheck": true, 33 | "strictInjectionParameters": true, 34 | 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /competency-ui-lib/projects/competency-ui/competency/components/required-comptency-card/required-comptency-card.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { async, ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { RequiredComptencyCardComponent } from './required-comptency-card.component'; 4 | 5 | describe('RequiredComptencyCardComponent', () => { 6 | let component: RequiredComptencyCardComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async(() => { 10 | TestBed.configureTestingModule({ 11 | declarations: [ RequiredComptencyCardComponent ] 12 | }) 13 | .compileComponents(); 14 | })); 15 | 16 | beforeEach(() => { 17 | fixture = TestBed.createComponent(RequiredComptencyCardComponent); 18 | component = fixture.componentInstance; 19 | fixture.detectChanges(); 20 | }); 21 | 22 | it('should create', () => { 23 | expect(component).toBeTruthy(); 24 | }); 25 | }); 26 | -------------------------------------------------------------------------------- /competency-ui-lib/projects/competency-ui/self-assessment/components/self-assessment/self-assessment.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit } from '@angular/core'; 2 | import { Location } from '@angular/common' 3 | 4 | @Component({ 5 | selector: 'lib-self-assessment', 6 | templateUrl: './self-assessment.component.html', 7 | styleUrls: ['./self-assessment.component.scss'] 8 | }) 9 | export class SelfAssessmentComponent implements OnInit { 10 | 11 | gainedproficencyData = [ 12 | { 13 | title: 'Sector Meetings', 14 | description: 'Documents and discuss HCM, THR, growth monitoring and referral related issues in sector meetings', 15 | 16 | }, 17 | { 18 | title: 'Counselling ', 19 | description: 'Lorem ipsum dolor sit amet, consectetur', 20 | 21 | } 22 | ] 23 | 24 | constructor( 25 | private location: Location 26 | ) { } 27 | 28 | ngOnInit() { 29 | } 30 | 31 | navigateBack() { 32 | this.location.back() 33 | } 34 | 35 | } 36 | -------------------------------------------------------------------------------- /competency-ui-lib/projects/competency-ui/competency/services/required-competency.service.ts: -------------------------------------------------------------------------------- 1 | import { Injectable } from '@angular/core'; 2 | import { DataService } from '@aastrika_npmjs/comptency/core'; 3 | import { HttpClient } from '@angular/common/http'; 4 | import { urlConfig } from '@aastrika_npmjs/comptency/core'; 5 | /** 6 | * RequiredCompetencyService to extend Data Service 7 | * 8 | * @author Mansur Shaik 9 | */ 10 | @Injectable({ 11 | providedIn: 'root' 12 | }) 13 | export class RequiredCompetencyService extends DataService { 14 | 15 | constructor(http:HttpClient) { 16 | super(http) 17 | } 18 | 19 | /** 20 | * for making getall required competency api calls 21 | * 22 | */ 23 | 24 | public getRequiredCompetencyById(reqBody:any){ 25 | const httpOptions: any = { 26 | url: urlConfig.getEntityById(3), 27 | data: reqBody 28 | }; 29 | console.log('reqBody',httpOptions) 30 | return this.post(httpOptions) 31 | } 32 | 33 | } 34 | -------------------------------------------------------------------------------- /competency-ui-lib/projects/competency-ui/competency/services/active-summary.service.ts: -------------------------------------------------------------------------------- 1 | import { Injectable } from '@angular/core'; 2 | import { DataService } from '@aastrika_npmjs/comptency/core'; 3 | import { HttpClient } from '@angular/common/http'; 4 | import { urlConfig } from '@aastrika_npmjs/comptency/core'; 5 | /** 6 | * ActiveSummaryService to extend Data Service 7 | * 8 | * @author Aman Kumar Sharma 9 | */ 10 | @Injectable({ 11 | providedIn: 'root' 12 | }) 13 | export class ActiveSummaryService extends DataService { 14 | 15 | constructor(http:HttpClient) { 16 | super(http) 17 | } 18 | 19 | /** 20 | * for making getall activity api calls 21 | * 22 | */ 23 | public getActivityById(reqBody:any){ 24 | // console.log('calling getActivityById>>') 25 | const httpOptions: any = { 26 | url: urlConfig.getEntityById(reqBody.id), 27 | data: reqBody 28 | }; 29 | // console.log('reqBody',httpOptions) 30 | return this.post(httpOptions) 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /competency-ui-lib/projects/competency-ui/core/components/app-loader/app-loader.component.scss: -------------------------------------------------------------------------------- 1 | .sbt-app-loader-container { 2 | background:var(--sbt-compt-bg); 3 | width:94% !important; 4 | margin:0 auto; 5 | border-radius: 1.5rem; 6 | border:0px; 7 | } 8 | 9 | 10 | .loader-content{ 11 | display: flex; 12 | justify-content: center; 13 | align-items: center; 14 | margin-top: 38px; 15 | } 16 | 17 | .message{ 18 | margin: 0; 19 | font-size: 16px; 20 | color: #919191; 21 | } 22 | 23 | 24 | .loader { 25 | width: 30px; 26 | height: 30px; 27 | margin: -76px 0 0 -76px; 28 | border: 4px solid #f3f3f3; 29 | border-radius: 50%; 30 | border-top: 4px solid #555; 31 | -webkit-animation: spin 2s linear infinite; 32 | animation: spin 2s linear infinite; 33 | } 34 | 35 | @-webkit-keyframes spin { 36 | 0% { -webkit-transform: rotate(0deg); } 37 | 100% { -webkit-transform: rotate(360deg); } 38 | } 39 | 40 | @keyframes spin { 41 | 0% { transform: rotate(0deg); } 42 | 100% { transform: rotate(360deg); } 43 | } -------------------------------------------------------------------------------- /competency-ui-lib/projects/competency-ui/competency/services/gained.service.ts: -------------------------------------------------------------------------------- 1 | import { Injectable } from '@angular/core'; 2 | import { DataService, urlConfig } from '@aastrika_npmjs/comptency/core'; 3 | import { HttpClient } from '@angular/common/http'; 4 | import { forkJoin, Observable } from 'rxjs'; 5 | 6 | /** 7 | * GainedService to extend Data Service 8 | * 9 | * @author Vishali Sakar 10 | */ 11 | 12 | @Injectable({ 13 | providedIn: 'root' 14 | }) 15 | export class GainedService extends DataService { 16 | 17 | constructor(http:HttpClient) { 18 | super(http) 19 | } 20 | 21 | /** 22 | * for making getall Gained api calls 23 | * 24 | */ 25 | 26 | public fetchUserPassbook(reqBody:any){ 27 | 28 | const httpOptions: any = { 29 | url: urlConfig.getUserPassbook(), 30 | data: reqBody 31 | }; 32 | return this.post(httpOptions) 33 | } 34 | 35 | 36 | public fetchAllEntity(reqBody:any){ 37 | 38 | const httpOptions: any = { 39 | url: urlConfig.getAllEntity(), 40 | data: reqBody 41 | }; 42 | return this.post(httpOptions) 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /competency-ui-lib/README.md: -------------------------------------------------------------------------------- 1 | # CompetencyUiLib 2 | 3 | This project was generated with [Angular CLI](https://github.com/angular/angular-cli) version 8.3.27. 4 | 5 | ## Development server 6 | 7 | Run `ng serve` for a dev server. Navigate to `http://localhost:4200/`. The app will automatically reload if you change any of the source files. 8 | 9 | ## Code scaffolding 10 | 11 | Run `ng generate component component-name` to generate a new component. You can also use `ng generate directive|pipe|service|class|guard|interface|enum|module`. 12 | 13 | ## Build 14 | 15 | Run `ng build` to build the project. The build artifacts will be stored in the `dist/` directory. Use the `--prod` flag for a production build. 16 | 17 | ## Running unit tests 18 | 19 | Run `ng test` to execute the unit tests via [Karma](https://karma-runner.github.io). 20 | 21 | ## Running end-to-end tests 22 | 23 | Run `ng e2e` to execute the end-to-end tests via [Protractor](http://www.protractortest.org/). 24 | 25 | ## Further help 26 | 27 | To get more help on the Angular CLI use `ng help` or go check out the [Angular CLI README](https://github.com/angular/angular-cli/blob/master/README.md). 28 | -------------------------------------------------------------------------------- /competency-ui-lib/projects/competency-ui/self-assessment/components/self-assessment-card/self-assessment-card.component.scss: -------------------------------------------------------------------------------- 1 | @import '../../../assets/styles/global.scss'; 2 | .card_box { 3 | margin: 7px 2px 15px; 4 | padding: 16px 10px 20px 14px; 5 | box-shadow: 0px 0px 4px rgba(0, 0, 0, 0.15); 6 | border-radius: $radius-m; 7 | background: #FFFFFF; 8 | } 9 | 10 | .title { 11 | font-size: $size-xl; 12 | line-height: 29px; 13 | letter-spacing: $spacing; 14 | margin-bottom: 7px; 15 | } 16 | 17 | .description { 18 | font-size: $size-m; 19 | line-height: 17px; 20 | letter-spacing: $spacing; 21 | } 22 | 23 | .startBtn { 24 | background-color: #1C5D95 !important; 25 | border-radius: $radius-l; 26 | padding: 8px 32px; 27 | gap: 8px; 28 | font-size: 16px; 29 | line-height: 19px; 30 | color: #FFFFFF !important; 31 | margin-top: 10px; 32 | border: none; 33 | } 34 | 35 | .proficiency { 36 | color: #1C5D96; 37 | font-style: italic; 38 | font-size: $size-m; 39 | line-height: 17px; 40 | cursor: pointer; 41 | margin-top: 4px; 42 | } -------------------------------------------------------------------------------- /competency-ui-lib/projects/competency-ui/README.md: -------------------------------------------------------------------------------- 1 | # CompetencyUi 2 | 3 | This library was generated with [Angular CLI](https://github.com/angular/angular-cli) version 8.2.14. 4 | 5 | ## Code scaffolding 6 | 7 | Run `ng generate component component-name --project competency-ui` to generate a new component. You can also use `ng generate directive|pipe|service|class|guard|interface|enum|module --project competency-ui`. 8 | > Note: Don't forget to add `--project competency-ui` or else it will be added to the default project in your `angular.json` file. 9 | 10 | ## Build 11 | 12 | Run `ng build competency-ui` to build the project. The build artifacts will be stored in the `dist/` directory. 13 | 14 | ## Publishing 15 | 16 | After building your library with `ng build competency-ui`, go to the dist folder `cd dist/competency-ui` and run `npm publish`. 17 | 18 | ## Running unit tests 19 | 20 | Run `ng test competency-ui` to execute the unit tests via [Karma](https://karma-runner.github.io). 21 | 22 | ## Further help 23 | 24 | To get more help on the Angular CLI use `ng help` or go check out the [Angular CLI README](https://github.com/angular/angular-cli/blob/master/README.md). 25 | -------------------------------------------------------------------------------- /competency-ui-lib/projects/competency-ui/karma.conf.js: -------------------------------------------------------------------------------- 1 | // Karma configuration file, see link for more information 2 | // https://karma-runner.github.io/1.0/config/configuration-file.html 3 | 4 | module.exports = function (config) { 5 | config.set({ 6 | basePath: '', 7 | frameworks: ['jasmine', '@angular-devkit/build-angular'], 8 | plugins: [ 9 | require('karma-jasmine'), 10 | require('karma-chrome-launcher'), 11 | require('karma-jasmine-html-reporter'), 12 | require('karma-coverage-istanbul-reporter'), 13 | require('@angular-devkit/build-angular/plugins/karma') 14 | ], 15 | client: { 16 | clearContext: false // leave Jasmine Spec Runner output visible in browser 17 | }, 18 | coverageIstanbulReporter: { 19 | dir: require('path').join(__dirname, '../../coverage/competency-ui'), 20 | reports: ['html', 'lcovonly', 'text-summary'], 21 | fixWebpackSourcePaths: true 22 | }, 23 | reporters: ['progress', 'kjhtml'], 24 | port: 9876, 25 | colors: true, 26 | logLevel: config.LOG_INFO, 27 | autoWatch: true, 28 | browsers: ['Chrome'], 29 | singleRun: false, 30 | restartOnFileChange: true 31 | }); 32 | }; 33 | -------------------------------------------------------------------------------- /competency-ui-lib/projects/competency-ui/competency/competency.module.ts: -------------------------------------------------------------------------------- 1 | import { NgModule } from '@angular/core'; 2 | import { CommonModule } from '@angular/common'; 3 | import { HttpClientModule } from '@angular/common/http' 4 | import { RequiredComptencyCardComponent } from './components/required-comptency-card/required-comptency-card.component'; 5 | import { GainedComptencyCardComponent } from './components/gained-comptency-card/gained-comptency-card.component'; 6 | import { CompetencyDashboardComponent } from './components/competency-dashboard/competency-dashboard.component'; 7 | import { ActiveSummaryComponent } from './components/active-summary/active-summary.component'; 8 | import { MatTabsModule, MatIconModule, MatExpansionModule } from '@angular/material'; 9 | import { CoreModule } from '@aastrika_npmjs/comptency/core'; 10 | @NgModule({ 11 | declarations: [ 12 | RequiredComptencyCardComponent, 13 | GainedComptencyCardComponent, 14 | CompetencyDashboardComponent, 15 | ActiveSummaryComponent], 16 | imports: [ 17 | CommonModule, 18 | MatTabsModule, 19 | MatIconModule, 20 | MatExpansionModule, 21 | HttpClientModule, 22 | CoreModule 23 | ], 24 | exports: [RequiredComptencyCardComponent, 25 | GainedComptencyCardComponent, 26 | CompetencyDashboardComponent, 27 | ActiveSummaryComponent 28 | ] 29 | }) 30 | export class CompetencyModule { } 31 | -------------------------------------------------------------------------------- /competency-ui-lib/projects/competency-ui/entry-module/entry-module.ts: -------------------------------------------------------------------------------- 1 | import { NgModule ,ModuleWithProviders} from '@angular/core'; 2 | import { CommonModule } from '@angular/common'; 3 | import { SlefAssessmentEntryComponent } from './components/slef-assessment-entry/slef-assessment-entry.component'; 4 | import { CompetencyEntryComponent } from './components/competency-entry/competency-entry.component'; 5 | import { MatIconModule } from '@angular/material'; 6 | import { RouterModule } from '@angular/router'; 7 | import { ConfigurationContext } from './services/configuration-context'; 8 | @NgModule({ 9 | declarations: [SlefAssessmentEntryComponent, CompetencyEntryComponent,], 10 | imports: [ 11 | CommonModule, 12 | RouterModule, 13 | MatIconModule, 14 | ], 15 | exports: [ 16 | SlefAssessmentEntryComponent, 17 | CompetencyEntryComponent, 18 | ], 19 | providers:[] 20 | }) 21 | export class EntryModule { 22 | /** 23 | * Take the config from consuming apps 24 | * 25 | * @author Aman Kumar Sharma 26 | */ 27 | static forRoot(configContext: ConfigurationContext): ModuleWithProviders { 28 | console.log(`Preparing to handle configuration context.`); 29 | console.log('config data ------',configContext.config) 30 | return { 31 | ngModule: EntryModule, 32 | providers: [ 33 | {provide: ConfigurationContext, useValue: configContext.config} 34 | ] 35 | } 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /competency-ui-lib/angular.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "./node_modules/@angular/cli/lib/config/schema.json", 3 | "version": 1, 4 | "newProjectRoot": "projects", 5 | "projects": { 6 | "competency-ui": { 7 | "projectType": "library", 8 | "root": "projects/competency-ui", 9 | "sourceRoot": "projects/competency-ui/src", 10 | "prefix": "lib", 11 | "architect": { 12 | "build": { 13 | "builder": "@angular-devkit/build-ng-packagr:build", 14 | "options": { 15 | "tsConfig": "projects/competency-ui/tsconfig.lib.json", 16 | "project": "projects/competency-ui/ng-package.json" 17 | } 18 | }, 19 | "test": { 20 | "builder": "@angular-devkit/build-angular:karma", 21 | "options": { 22 | "main": "projects/competency-ui/src/test.ts", 23 | "tsConfig": "projects/competency-ui/tsconfig.spec.json", 24 | "karmaConfig": "projects/competency-ui/karma.conf.js" 25 | } 26 | }, 27 | "lint": { 28 | "builder": "@angular-devkit/build-angular:tslint", 29 | "options": { 30 | "tsConfig": [ 31 | "projects/competency-ui/tsconfig.lib.json", 32 | "projects/competency-ui/tsconfig.spec.json" 33 | ], 34 | "exclude": [ 35 | "**/node_modules/**" 36 | ] 37 | } 38 | } 39 | } 40 | }}, 41 | "defaultProject": "competency-ui", 42 | "schematics": { 43 | "@schematics/angular:component": { 44 | "styleext": "scss" 45 | } 46 | } 47 | } -------------------------------------------------------------------------------- /competency-ui-lib/projects/competency-ui/assets/styles/global.scss: -------------------------------------------------------------------------------- 1 | 2 | :root { 3 | font-size: 16px; 4 | // base colors 5 | --blue: #1C5D95; 6 | --yellow: #FFF4DF; 7 | --teal: #A4DFCA; 8 | --black: #000000; 9 | --white: #ffffff; 10 | --light-gray: #eff6fc; 11 | --grey-100: #DFEDF9; 12 | --gray-200: #8E8E8E; 13 | --gray-300: #989898; 14 | --gray-400: #808080; 15 | --grey-500: #919191; 16 | --yellow-500: #FFFBB0; 17 | --blue-500: #7CB5E6; 18 | } 19 | 20 | $size-s: 12px; 21 | $size-m: 14px; 22 | $size-l: 16px; 23 | $size-lg: 20px; 24 | $size-xl: 24px; 25 | 26 | $spacing: -.02em; 27 | $radius-circle: 50%; 28 | $radius-m: 10px; 29 | $radius-l: 50px; 30 | $cursor: pointer; 31 | 32 | @mixin breakpoint-xs { 33 | @media only screen and (max-width: 599px) { 34 | @content; 35 | } 36 | } 37 | 38 | @mixin breakpoint-s { 39 | @media only screen and (min-width: 600px) and (max-width: 959px) { 40 | @content; 41 | } 42 | } 43 | 44 | @mixin breakpoint-m { 45 | @media only screen and (min-width: 960px) and (max-width: 1279px) { 46 | @content; 47 | } 48 | } 49 | 50 | @mixin breakpoint-l { 51 | @media only screen and (min-width: 1280px) and (max-width: 1919px) { 52 | @content; 53 | } 54 | } 55 | 56 | @mixin breakpoint-xl { 57 | @media only screen and (min-width: 1920px) { 58 | @content; 59 | } 60 | } 61 | 62 | .button-primary { 63 | background-color: var(--blue) !important; 64 | border-radius: $radius-l; 65 | gap: 8px; 66 | color: var(--white) !important; 67 | border: none; 68 | } 69 | 70 | .mat-primary-background { 71 | padding: 9px 40px; 72 | width: 310px; 73 | cursor: $cursor; 74 | } -------------------------------------------------------------------------------- /competency-ui-lib/projects/competency-ui/competency/components/required-comptency-card/required-comptency-card.component.html: -------------------------------------------------------------------------------- 1 |
3 | 4 | 9 | 14 | 15 | 16 |
{{ competency?.title }}
17 |
18 |
19 | 24 |
25 | 26 | 27 |
28 | Levels: 29 | 30 |
31 | 32 | {{ log.index }} : {{ log.header }} 35 | 36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 | -------------------------------------------------------------------------------- /competency-ui-lib/projects/competency-ui/competency/components/gained-comptency-card/gained-comptency-card.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit } from '@angular/core'; 2 | import { pipe } from 'rxjs'; 3 | import { forkJoin } from 'rxjs'; 4 | import { GainedService } from '../../services/gained.service'; 5 | import { RequestUtil } from '../../services/request-util'; 6 | import * as _ from 'lodash-es'; 7 | @Component({ 8 | selector: 'lib-gained-comptency-card', 9 | templateUrl: './gained-comptency-card.component.html', 10 | styleUrls: ['./gained-comptency-card.component.scss'] 11 | }) 12 | export class GainedComptencyCardComponent implements OnInit { 13 | 14 | requestUtil: any 15 | loading = false 16 | panelOpenState: Boolean = false; 17 | gainedproficencyData:any 18 | constructor( 19 | public gainedService: GainedService 20 | 21 | ) { 22 | this.requestUtil = new RequestUtil() 23 | } 24 | 25 | ngOnInit() { 26 | this.loading = true 27 | const allEntity = this.getAllEntity() 28 | const userPassbook = this.getAllUserPassbook() 29 | forkJoin([allEntity,userPassbook]).subscribe((res)=>{ 30 | const response = this.requestUtil.formatedGainedCompetency(res[0].result.response, res[1].result.content) 31 | this.gainedproficencyData = response 32 | this.loading = false 33 | }) 34 | } 35 | 36 | private getAllUserPassbook() { 37 | const reqBody = { 38 | "request": { 39 | "typeName": "competency" 40 | } 41 | }; 42 | return this.gainedService.fetchUserPassbook(reqBody) 43 | } 44 | 45 | 46 | private getAllEntity() { 47 | const reqBody = { 48 | "search": { 49 | "type": "Competency" 50 | } 51 | }; 52 | return this.gainedService.fetchAllEntity(reqBody) 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /competency-ui-lib/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@aastrika_npmjs/comptency-ui-lib", 3 | "version": "0.0.0", 4 | "scripts": { 5 | "ng": "ng", 6 | "start": "ng serve", 7 | "build": "ng build", 8 | "test": "ng test", 9 | "lint": "ng lint", 10 | "e2e": "ng e2e" 11 | }, 12 | "private": true, 13 | "dependencies": { 14 | "@angular/animations": "~8.2.14", 15 | "@angular/cdk": "~8.2.3", 16 | "@angular/common": "~8.2.14", 17 | "@angular/compiler": "~8.2.14", 18 | "@angular/core": "~8.2.14", 19 | "@angular/forms": "~8.2.14", 20 | "@angular/material": "^8.2.3", 21 | "@angular/platform-browser": "~8.2.14", 22 | "@angular/platform-browser-dynamic": "~8.2.14", 23 | "@angular/router": "~8.2.14", 24 | "hammerjs": "^2.0.8", 25 | "rxjs": "~6.4.0", 26 | "tslib": "^1.10.0", 27 | "zone.js": "~0.9.1", 28 | "lodash-es": "^4.17.15" 29 | }, 30 | "devDependencies": { 31 | "@angular-devkit/build-angular": "~0.803.29", 32 | "@angular-devkit/build-ng-packagr": "~0.803.29", 33 | "@angular/cli": "~8.3.27", 34 | "@angular/compiler-cli": "~8.2.14", 35 | "@angular/language-service": "~8.2.14", 36 | "@types/node": "~8.9.4", 37 | "@types/jasmine": "~3.3.8", 38 | "@types/jasminewd2": "~2.0.3", 39 | "@types/lodash": "4.14.104", 40 | "codelyzer": "^5.0.0", 41 | "jasmine-core": "~3.4.0", 42 | "jasmine-spec-reporter": "~4.2.1", 43 | "karma": "~4.1.0", 44 | "karma-chrome-launcher": "~2.2.0", 45 | "karma-coverage-istanbul-reporter": "~2.0.1", 46 | "karma-jasmine": "~2.0.1", 47 | "karma-jasmine-html-reporter": "^1.4.0", 48 | "ng-packagr": "^5.4.0", 49 | "protractor": "~7.0.0", 50 | "ts-node": "~7.0.0", 51 | "tsickle": "^0.37.0", 52 | "tslint": "~5.15.0", 53 | "typescript": "~3.5.3" 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /competency-ui-lib/projects/competency-ui/competency/components/active-summary/active-summary.component.html: -------------------------------------------------------------------------------- 1 | 2 | 3 |
4 | 5 | 10 | 15 | 16 | 17 |
{{ role?.roles }}
18 |
19 |
20 |
21 | 22 |
23 | 26 |
27 | {{ i + 1 }}.{{ activity.title }} 28 |
29 |
30 |
{{ activity.competency }}
31 |
32 | 33 | {{ level }} 34 | 35 |
36 |
37 |
38 |
39 |
40 |
41 | 42 |
43 |
44 | -------------------------------------------------------------------------------- /competency-ui-lib/projects/competency-ui/competency/components/required-comptency-card/required-comptency-card.component.scss: -------------------------------------------------------------------------------- 1 | @import '../../../assets/styles/global.scss'; 2 | 3 | .card-container { 4 | margin: 15px 2px; 5 | padding: 16px 10px 20px 14px; 6 | box-shadow: 0px 0px 4px rgba(0, 0, 0, 0.15); 7 | border-radius: $radius-m; 8 | background: #ffffff; 9 | } 10 | 11 | .title { 12 | font-size: 16px; 13 | line-height: 19px; 14 | letter-spacing: $spacing; 15 | 16 | color: #000000; 17 | } 18 | 19 | .description { 20 | font-size: $size-m; 21 | line-height: 17px; 22 | letter-spacing: $spacing; 23 | } 24 | 25 | .start-btn { 26 | background-color: #1c5d95 !important; 27 | border-radius: $radius-l; 28 | padding: 8px 32px; 29 | gap: 8px; 30 | font-size: 16px; 31 | line-height: 19px; 32 | color: #ffffff !important; 33 | margin-top: 10px; 34 | border: none; 35 | } 36 | 37 | .proficiency { 38 | color: #1c5d96; 39 | font-size: $size-lg; 40 | cursor: pointer; 41 | margin-top: 15px; 42 | } 43 | 44 | .log-title { 45 | font-size: $size-m; 46 | line-height: 24px; 47 | letter-spacing: $spacing; 48 | color: #1c5d95; 49 | } 50 | 51 | .log { 52 | border-bottom: 1px solid #dddddd; 53 | padding-bottom: 9px; 54 | margin-top: 10px; 55 | } 56 | 57 | .logs{ 58 | padding: 5px 5px; 59 | } 60 | 61 | .log-items { 62 | font-size: 16px; 63 | line-height: 19px; 64 | letter-spacing: $spacing; 65 | 66 | color: #000000; 67 | } 68 | 69 | ::ng-deep .mat-expansion-panel-header { 70 | padding: 0 5px !important; 71 | } 72 | :host ::ng-deep .mat-expansion-panel-header:hover { 73 | background: rgb(255 255 255 / 98%) !important; 74 | } 75 | 76 | // .disable_ripple:hover{ 77 | // background: rgb(255 255 255 / 98%) !important; 78 | // } 79 | 80 | :host ::ng-deep .mat-content { 81 | display: flex !important; 82 | } 83 | 84 | .level { 85 | place-self: flex-end; 86 | } 87 | -------------------------------------------------------------------------------- /competency-ui-lib/projects/competency-ui/competency/components/competency-dashboard/competency-dashboard.component.html: -------------------------------------------------------------------------------- 1 |
2 | chevron_left 3 | 4 |

Competency Dashboard

5 | 6 |
7 | 8 |
9 | 10 |
11 |
12 | 14 | 15 | 16 | 17 |
18 |
19 |
Self Assessment
20 |
21 |
Course
22 |
23 |
Admin added
24 |
25 | 26 |
27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 |
36 | 37 |
38 |
39 | 40 |
41 |
42 | 43 | 44 | 45 |
46 | 47 | 48 |
49 |
-------------------------------------------------------------------------------- /competency-ui-lib/projects/competency-ui/competency/components/active-summary/active-summary.component.scss: -------------------------------------------------------------------------------- 1 | @import '../../../assets/styles/global.scss'; 2 | 3 | .card-container { 4 | margin: 15px 2px; 5 | padding: 16px 10px 20px 14px; 6 | box-shadow: 0px 0px 4px rgba(0, 0, 0, 0.15); 7 | border-radius: $radius-m; 8 | background: var(--light-gray) !important; 9 | } 10 | .spinner-loading { 11 | display: flex; 12 | justify-content: center; 13 | } 14 | 15 | .title { 16 | font-size: $size-l; 17 | line-height: 19px; 18 | letter-spacing: $spacing; 19 | color: var(--blue); 20 | } 21 | 22 | .icon-down { 23 | place-self: flex-end; 24 | color: var(--blue) !important; 25 | } 26 | 27 | :host ::ng-deep .mat-expansion-panel { 28 | margin: 10px 0px; 29 | //padding: 10px 0px !important; 30 | height: auto; 31 | } 32 | 33 | :host ::ng-deep .mat-expansion-panel-header:hover { 34 | background: rgb(239 246 252) !important; 35 | } 36 | 37 | :host ::ng-deep .mat-expansion-panel-header { 38 | padding: 15px !important; 39 | background-color: var(--light-gray) !important; 40 | border-radius: $radius-m !important; 41 | } 42 | :host ::ng-deep .mat-expansion-indicator:after{ 43 | color: var(--blue) !important; 44 | } 45 | 46 | .activity-title { 47 | font-size: $size-xl; 48 | line-height: 28px; 49 | letter-spacing: $spacing; 50 | color: var(--black); 51 | } 52 | 53 | .competency-container{ 54 | background: var(--white); 55 | box-shadow: 0px 0px 4px rgb(0 0 0 / 15%); 56 | border-radius: $radius-m; 57 | padding: 10px; 58 | margin: 18px 0 15px; 59 | 60 | .competency-title{ 61 | font-size: $size-lg; 62 | line-height: 25px; 63 | letter-spacing: $spacing; 64 | color: var(--black); 65 | margin-bottom: 20px; 66 | } 67 | 68 | .level{ 69 | font-size: $size-xl; 70 | line-height: 24px; 71 | letter-spacing: $spacing; 72 | color: var(--blue); 73 | } 74 | } 75 | 76 | .expand-container{ 77 | padding: 15px 15px 0; 78 | } -------------------------------------------------------------------------------- /competency-ui-lib/tslint.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "tslint:recommended", 3 | "rulesDirectory": [ 4 | "codelyzer" 5 | ], 6 | "rules": { 7 | "array-type": false, 8 | "arrow-parens": false, 9 | "deprecation": { 10 | "severity": "warning" 11 | }, 12 | "import-blacklist": [ 13 | true, 14 | "rxjs/Rx" 15 | ], 16 | "interface-name": false, 17 | "max-classes-per-file": false, 18 | "max-line-length": [ 19 | true, 20 | 140 21 | ], 22 | "member-access": false, 23 | "member-ordering": [ 24 | true, 25 | { 26 | "order": [ 27 | "static-field", 28 | "instance-field", 29 | "static-method", 30 | "instance-method" 31 | ] 32 | } 33 | ], 34 | "no-consecutive-blank-lines": false, 35 | "no-console": [ 36 | true, 37 | "debug", 38 | "info", 39 | "time", 40 | "timeEnd", 41 | "trace" 42 | ], 43 | "no-empty": false, 44 | "no-inferrable-types": [ 45 | true, 46 | "ignore-params" 47 | ], 48 | "no-non-null-assertion": true, 49 | "no-redundant-jsdoc": true, 50 | "no-switch-case-fall-through": true, 51 | "no-var-requires": false, 52 | "object-literal-key-quotes": [ 53 | true, 54 | "as-needed" 55 | ], 56 | "object-literal-sort-keys": false, 57 | "ordered-imports": false, 58 | "quotemark": [ 59 | true, 60 | "single" 61 | ], 62 | "trailing-comma": false, 63 | "component-class-suffix": true, 64 | "contextual-lifecycle": true, 65 | "directive-class-suffix": true, 66 | "no-conflicting-lifecycle": true, 67 | "no-host-metadata-property": true, 68 | "no-input-rename": true, 69 | "no-inputs-metadata-property": true, 70 | "no-output-native": true, 71 | "no-output-on-prefix": true, 72 | "no-output-rename": true, 73 | "no-outputs-metadata-property": true, 74 | "template-banana-in-box": true, 75 | "template-no-negated-async": true, 76 | "use-lifecycle-interface": true, 77 | "use-pipe-transform-interface": true 78 | } 79 | } 80 | -------------------------------------------------------------------------------- /competency-ui-lib/projects/competency-ui/core/services/data.service.ts: -------------------------------------------------------------------------------- 1 | import { Injectable } from '@angular/core'; 2 | import { HttpClient } from '@angular/common/http'; 3 | import {mergeMap} from 'rxjs/operators' 4 | import { of as observableOf, throwError as observableThrowError, Observable } from 'rxjs'; 5 | /** 6 | * DataService to make http call 7 | * 8 | * @author Aman Kumar Sharma 9 | */ 10 | @Injectable({ 11 | providedIn: 'root' 12 | }) 13 | export class DataService { 14 | /** 15 | * Contains base Url for api end points 16 | */ 17 | baseUrl: string; 18 | /** 19 | * angular HttpClient 20 | */ 21 | http: HttpClient; 22 | constructor(http:HttpClient) { 23 | this.http = http 24 | } 25 | /** 26 | * for making get api calls 27 | * 28 | * @param requestParam interface 29 | */ 30 | get(requestParam:any):Observable{ 31 | const httpOptions: any = { 32 | headers: requestParam.header ? requestParam.header : this.getHeader(), 33 | params: requestParam.param, 34 | observe: 'response' 35 | }; 36 | return this.http.get(this.baseUrl + requestParam.url, httpOptions).pipe( 37 | mergeMap(({ body, headers }: any) => { 38 | if (body.responseCode !== 'OK') { 39 | return observableThrowError(body); 40 | } 41 | return observableOf(body); 42 | })); 43 | } 44 | /** 45 | * for making get api calls 46 | * 47 | * @param requestParam interface 48 | */ 49 | post(requestParam:any){ 50 | const httpOptions:any = { 51 | headers: requestParam.header ? this.getHeader(requestParam.header) : this.getHeader(), 52 | params: requestParam.param 53 | } 54 | // console.log('log in data service',requestParam) 55 | return this.http.post(requestParam.url,requestParam.data,httpOptions).pipe( 56 | mergeMap((data:any)=>{ 57 | if(data.responseCode === 200 || data.responseCode === 'OK'){ 58 | return observableOf(data); 59 | }else { 60 | return observableThrowError(data); 61 | } 62 | 63 | }) 64 | ) 65 | } 66 | /** 67 | * for preparing headers 68 | */ 69 | private getHeader(headers?: any): any { 70 | 71 | const default_headers = { 72 | 'Accept': 'application/json', 73 | 74 | }; 75 | 76 | if (headers) { 77 | return { ...default_headers, ...headers }; 78 | } else { 79 | return { ...default_headers }; 80 | } 81 | } 82 | } 83 | -------------------------------------------------------------------------------- /competency-ui-lib/projects/competency-ui/competency/components/gained-comptency-card/gained-comptency-card.component.scss: -------------------------------------------------------------------------------- 1 | @import '../../../assets/styles/global.scss'; 2 | .date { 3 | font-size: $size-s; 4 | line-height: 14px; 5 | letter-spacing: $spacing; 6 | color: var(--gray-300); 7 | } 8 | 9 | .justify-end { 10 | display: flex; 11 | justify-content: flex-end; 12 | } 13 | 14 | .card-container { 15 | margin: 15px 2px; 16 | padding: 14px 10px 20px 14px; 17 | box-shadow: 0px 0px 4px rgba(0, 0, 0, 0.15); 18 | border-radius: $radius-m; 19 | background: var(--white); 20 | } 21 | 22 | .title { 23 | font-size: $size-xl; 24 | line-height: 29px; 25 | letter-spacing: $spacing; 26 | margin-bottom: 18px; 27 | } 28 | 29 | .levelsTitle { 30 | font-size: $size-m; 31 | line-height: 24px; 32 | letter-spacing: $spacing; 33 | color: var(--black); 34 | } 35 | 36 | .panel { 37 | box-shadow: 0px 0px 0px 0px !important; 38 | padding: 1px 3px 1px 0px; 39 | pointer-events: none; 40 | } 41 | 42 | .panel-header { 43 | padding: 0px !important; 44 | background: none !important; 45 | } 46 | 47 | .panel-header-description { 48 | margin: 0px !important; 49 | padding: 1px; 50 | } 51 | 52 | .pointer-events { 53 | pointer-events: all; 54 | cursor: pointer; 55 | } 56 | 57 | .arrowReverse { 58 | transform: rotateX(180deg); 59 | } 60 | 61 | .level { 62 | width: 47px; 63 | max-width: 16.6%; 64 | height: 36px; 65 | display: flex; 66 | justify-content: center; 67 | align-items: center; 68 | box-shadow: 0px 0px 2.17333px #00000040; 69 | } 70 | 71 | .log-header { 72 | font-size: $size-m; 73 | line-height: 24px; 74 | letter-spacing: $spacing; 75 | color: var(--black); 76 | } 77 | 78 | .log { 79 | font-style: italic; 80 | font-size: $size-m; 81 | line-height: 16px;; 82 | letter-spacing: $spacing; 83 | color: var(--gray-400); 84 | border-bottom: 1px solid #DDDDDD; 85 | padding-bottom: 9px; 86 | margin-top: 10px; 87 | } 88 | 89 | .log-date { 90 | font-style: normal; 91 | font-size: $size-s; 92 | line-height: 14px; 93 | letter-spacing: $spacing; 94 | color: var(--gray-400); 95 | } 96 | 97 | ::ng-deep .mat-expansion-panel-body { 98 | padding: 0px !important; 99 | } 100 | 101 | :host ::ng-deep .mat-content { 102 | display: unset !important; 103 | } 104 | 105 | .hideContent { 106 | display: none; 107 | } 108 | -------------------------------------------------------------------------------- /competency-ui-lib/projects/competency-ui/competency/components/competency-dashboard/competency-dashboard.component.scss: -------------------------------------------------------------------------------- 1 | // @import 'ws-mixins'; 2 | @import '../../../assets/styles/global.scss'; 3 | 4 | .content { 5 | padding: 60px 0px 50px; 6 | margin: auto; 7 | 8 | @media only screen and (min-width: 960px) { 9 | max-width: 30%; 10 | padding: 20px 20px 0px; 11 | } 12 | 13 | @media only screen and (min-width: 1280px){ 14 | max-width: 35%; 15 | } 16 | 17 | @media only screen and (min-width: 1920px) { 18 | max-width: 30%; 19 | } 20 | 21 | @media only screen and (min-width: 600px) and (max-width: 959px) { 22 | max-width: 50%; 23 | } 24 | 25 | @media only screen and (max-width: 599px){ 26 | max-width: 90%; 27 | } 28 | } 29 | 30 | .remove-border-bottom .mat-tab-header { 31 | border-bottom: none; 32 | } 33 | 34 | :host ::ng-deep .remove-border-bottom .mat-tab-header { 35 | border-bottom: none !important; 36 | } 37 | 38 | ::ng-deep .mat-tab-label { 39 | padding: 0 !important; 40 | min-width: 65px !important; 41 | color: var(--gray-200) !important; 42 | opacity: 1.6 !important; 43 | font-size: 16px !important; 44 | margin-right: 10px; 45 | 46 | } 47 | 48 | ::ng-deep .mat-tab-label-active { 49 | color: var(--blue) !important; 50 | 51 | } 52 | 53 | :host ::ng-deep .mat-ink-bar { 54 | height: 3px !important; 55 | background: var(--blue) !important; 56 | border-radius: 5px !important; 57 | } 58 | 59 | ::ng-deep .theme-igot.day-mode .mat-ink-bar { 60 | background-color: var(--blue) !important; 61 | } 62 | 63 | 64 | 65 | 66 | .legend-container { 67 | display: flex; 68 | gap: 10px; 69 | margin-top: 20px; 70 | align-items: center; 71 | margin-bottom: 20px; 72 | 73 | @media only screen and (max-width: 599px){ 74 | gap: 5px; 75 | } 76 | 77 | h5{ 78 | margin: 0; 79 | font-weight: 400; 80 | font-size: 16px; 81 | @media only screen and (max-width: 599px){ 82 | font-size: 12px; 83 | } 84 | } 85 | 86 | .legend { 87 | min-width: 15px; 88 | height: 15px; 89 | background:#DFEDF9; 90 | border-radius: 50%; 91 | } 92 | 93 | .legend-green { 94 | background: var(--teal); 95 | } 96 | .legend-blue { 97 | background: #7CB5E6; 98 | } 99 | .legend-yellow { 100 | background: #FFFBB0; 101 | ; 102 | } 103 | 104 | 105 | 106 | } 107 | 108 | .required-comperencies { 109 | height: calc(100vh - 270px); 110 | overflow: auto; 111 | } 112 | 113 | .btn-start{ 114 | width: 311px; 115 | height: 35px; 116 | background: var(--blue); 117 | border-radius: 50px; 118 | border: none ; 119 | color: var(--white); 120 | } 121 | 122 | .tab-container{ 123 | display: flex; 124 | flex-direction: column; 125 | gap: 10px; 126 | position: relative; 127 | 128 | .btn-container{ 129 | display: flex; 130 | justify-content: center; 131 | 132 | } 133 | 134 | .sortIcon { 135 | position: absolute; 136 | right: 0px; 137 | top: 13px; 138 | width: 20px; 139 | } 140 | } 141 | 142 | .mat-tab-header-sortIcon { 143 | ::ng-deep .mat-tab-header { 144 | width: calc(100% - 25px); 145 | } 146 | } -------------------------------------------------------------------------------- /competency-ui-lib/projects/competency-ui/competency/components/gained-comptency-card/gained-comptency-card.component.html: -------------------------------------------------------------------------------- 1 | 2 | 3 |
4 | 7 | 8 |
{{proficency?.title}}
9 |
10 | 11 |
12 | Levels: 13 |
14 | 15 | 17 | 18 | 19 | 20 | 21 |
22 | {{proficiency?.displayLevel}} 23 |
24 |
25 | 26 |
27 | {{proficiency?.displayLevel}} 28 |
29 |
30 |
31 |
32 | keyboard_arrow_down 33 |
34 |
35 |
36 |
37 | Log: 38 | 39 |
40 |
41 | 42 | Level {{log.level}}: {{log.header}} 43 | {{log?.date| date:'dd/MM/yyyy'}} 44 | 45 |
46 | 47 |
{{log.description}}
48 |
49 | keyboard_arrow_down 50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
-------------------------------------------------------------------------------- /competency-ui-lib/projects/competency-ui/competency/components/active-summary/active-summary.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit,OnDestroy } from '@angular/core'; 2 | import { RequestUtil } from '../../services/request-util'; 3 | import { ActiveSummaryService } from '../../services/active-summary.service'; 4 | import { mergeMap } from 'rxjs/operators'; 5 | import { forkJoin, of, Subscription } from 'rxjs'; 6 | import * as _ from 'lodash-es'; 7 | import { ConfigService } from '@aastrika_npmjs/comptency/entry-module'; 8 | @Component({ 9 | selector: 'lib-active-summary', 10 | templateUrl: './active-summary.component.html', 11 | styleUrls: ['./active-summary.component.scss'] 12 | }) 13 | export class ActiveSummaryComponent implements OnInit { 14 | /** 15 | * Core Module 16 | * 17 | * @author Aman Kumar Sharma 18 | */ 19 | panelOpenState: Boolean = true 20 | requestUtil: any 21 | private unsubscribe: Subscription; 22 | roleactivitySummaries:any 23 | activitySummaries:any 24 | loading = false 25 | acordianLoading = false 26 | profileData:any 27 | constructor(public activeSummaryService: ActiveSummaryService, public configService: ConfigService) { 28 | this.requestUtil = new RequestUtil() 29 | 30 | } 31 | 32 | ngOnInit() { 33 | this.loading = true 34 | this.unsubscribe = this.getActivityByRole().pipe(mergeMap((res:any)=>{ 35 | const formatedResponse = this.requestUtil.formatedActivitityByPostion(res) 36 | return of(formatedResponse) 37 | })).subscribe((res: any) => { 38 | this.loading = false 39 | this.roleactivitySummaries = res 40 | }) 41 | 42 | this.profileData = JSON.parse(this.configService.getConfig())!.profileData[0].designation 43 | 44 | } 45 | 46 | private getActivityByRole() { 47 | const reqBody = { 48 | filter: { 49 | "isDetail": true 50 | }, 51 | id: this.profileData === 'AWW' ? 95 : 1 52 | }; 53 | return this.activeSummaryService.getActivityById(reqBody) 54 | } 55 | 56 | public getActivityByRoleId(id:any){ 57 | this.panelOpenState = true 58 | this.acordianLoading = true 59 | const index = _.findIndex(this.roleactivitySummaries, {'id': id}) 60 | this.roleactivitySummaries[index]['activities'] = [] 61 | this.getEntityById(id).pipe(mergeMap((res)=>{ 62 | const respone = this.requestUtil.formatedActivitityByRoleId(res) 63 | this.roleactivitySummaries[index]['activities'] = respone 64 | const cidArr = _.map(this.roleactivitySummaries[index]['activities'], 'cid') 65 | let calls = []; 66 | _.forEach(cidArr,(value:any)=>{ 67 | calls.push(this.getEntityById(value)) 68 | }) 69 | this.acordianLoading = false 70 | return forkJoin(...calls) 71 | })).subscribe((res:any)=>{ 72 | 73 | const response = this.requestUtil.formatedCompetency(res) 74 | this.roleactivitySummaries[index]['activities'] = _.values( _.merge(_.keyBy(response, 'cid'), 75 | _.keyBy(this.roleactivitySummaries[index]['activities'], 'cid'))) 76 | }) 77 | 78 | } 79 | getEntityById(id:any){ 80 | const reqBody = { 81 | filter: { 82 | "isDetail": true 83 | }, 84 | id: id 85 | }; 86 | return this.activeSummaryService.getActivityById(reqBody) 87 | } 88 | ngOnDestroy() { 89 | this.unsubscribe.unsubscribe() 90 | } 91 | } 92 | -------------------------------------------------------------------------------- /competency-ui-lib/projects/competency-ui/competency/components/required-comptency-card/required-comptency-card.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnDestroy, OnInit } from '@angular/core'; 2 | import { of, Subscription } from 'rxjs'; 3 | import { mergeMap } from 'rxjs/operators'; 4 | import { RequestUtil } from '../../services/request-util'; 5 | import { RequiredCompetencyService } from '../../services/required-competency.service'; 6 | 7 | @Component({ 8 | selector: 'lib-required-comptency-card', 9 | templateUrl: './required-comptency-card.component.html', 10 | styleUrls: ['./required-comptency-card.component.scss'] 11 | }) 12 | export class RequiredComptencyCardComponent implements OnInit, OnDestroy { 13 | 14 | competencyData = [ 15 | { 16 | title: 'Procurement and Distribution of HCM', 17 | description: 'Manages procurement and store raw materials for HCMs as per the pre-decided menu Supervises the preparation and distribution of HCM by Anganwadi Helper (AWH)', 18 | requiredLevel: 'level 4' 19 | }, 20 | { 21 | title: 'Store management and planning and coordination of THR and Dry ration', 22 | description: 'Mobilizes children and conducts ECCE activities as per the yearly activity calendar and the ECCE manual ', 23 | requiredLevel: 'level 4' 24 | }, 25 | { 26 | title: 'Procurement and Distribution of HCM', 27 | description: 'Manages procurement and store raw materials for HCMs as per the pre-decided menu Supervises the preparation and distribution of HCM by Anganwadi Helper (AWH)', 28 | requiredLevel: 'level 4' 29 | }, 30 | { 31 | title: 'Early Childhood Care Education', 32 | description: 'Mobilizes children and conducts ECCE activities as per the yearly activity calendar and the ECCE manual ', 33 | requiredLevel: 'level 4' 34 | }, 35 | { 36 | title: 'Procurement and Distribution of HCM', 37 | description: 'Manages procurement and store raw materials for HCMs as per the pre-decided menu Supervises the preparation and distribution of HCM by Anganwadi Helper (AWH)', 38 | requiredLevel: 'level 4' 39 | }, 40 | { 41 | title: 'Early Childhood Care Education', 42 | description: 'Mobilizes children and conducts ECCE activities as per the yearly activity calendar and the ECCE manual ', 43 | requiredLevel: 'level 4' 44 | }, 45 | ] 46 | 47 | panelOpenState: Boolean = true 48 | customCollapsedHeight = '100px' 49 | customExpandedHeight = '100px' 50 | private unsubscribe: Subscription; 51 | requestUtil: any 52 | loading = false 53 | 54 | constructor( 55 | private requiredCompetencyService: RequiredCompetencyService 56 | ) { 57 | this.requestUtil = new RequestUtil() 58 | } 59 | 60 | ngOnInit() { 61 | // this.loading = true 62 | this.unsubscribe = this.getRequiredByPostion().pipe(mergeMap((res:any)=>{ 63 | const formatedResponse = this.requestUtil.formatedActivitityById(res) 64 | return of(formatedResponse) 65 | })).subscribe((res: any) => { 66 | console.log(res) 67 | }) 68 | } 69 | 70 | private getRequiredByPostion() { 71 | const reqBody = { 72 | filter: { 73 | "isDetail": true 74 | } 75 | }; 76 | return this.requiredCompetencyService.getRequiredCompetencyById(reqBody) 77 | } 78 | 79 | logs = [ 80 | { 81 | index: 1, 82 | header: 'Understands HCM guidelines', 83 | }, 84 | { 85 | index: 2, 86 | header: 'Lists raw material required', 87 | }, 88 | { 89 | index: 3, 90 | header: 'Plans for storage', 91 | }, 92 | { 93 | index: 4, 94 | header: 'Motivates the AWH and children on optimal hygiene and handwashing practices', 95 | }, 96 | { 97 | index: 5, 98 | header: 'Course-Name Completion', 99 | }, 100 | 101 | ] 102 | 103 | ngOnDestroy() { 104 | this.unsubscribe.unsubscribe() 105 | } 106 | } 107 | -------------------------------------------------------------------------------- /competency-ui-lib/projects/competency-ui/competency/services/request-util.ts: -------------------------------------------------------------------------------- 1 | import * as _ from 'lodash'; 2 | export class RequestUtil { 3 | formatedActivities = (data: any) => { 4 | if (!_.isEmpty(data)) { 5 | return data 6 | } 7 | 8 | } 9 | formatedActivitityByPostion = (data: any) => { 10 | if (_.get(data, 'result')) { 11 | const children = _.get(data, 'result.response').children 12 | if (children.length > 0) { 13 | const result = _.reduce(children, (result, value) => { 14 | result.push({ 15 | 'roles': _.get(value, 'name'), 16 | 'id': _.get(value, 'id'), 17 | 'description': _.get(value, 'description'), 18 | }) 19 | return result 20 | }, []) 21 | return result 22 | } 23 | 24 | } 25 | 26 | } 27 | formatedActivitityByRoleId = (data: any) => { 28 | if (_.get(data, 'result')) { 29 | const children = _.get(data, 'result.response').children 30 | if (children.length > 0) { 31 | const result = _.reduce(children, (result, value) => { 32 | result.push({ 33 | 'title': _.get(value, 'name'), 34 | 'cid': _.get(value, 'id'), 35 | 'description': _.get(value, 'description') 36 | }) 37 | return result 38 | },[]) 39 | return result 40 | } 41 | 42 | } 43 | 44 | } 45 | formatedCompetency = (data: any) => { 46 | let result = [] 47 | _.forEach(data,(data:any)=>{ 48 | if (_.get(data, 'result')) { 49 | const children = _.get(data, 'result.response').children 50 | if (children.length > 0) { 51 | _.forEach(children, (value:any)=>{ 52 | result.push({ 53 | 'competency': _.get(value, 'name'), 54 | 'id': _.get(value, 'id'), 55 | 'description': _.get(value, 'description'), 56 | 'levels': ['Level 4', 'Level 5'], 57 | 'cid': _.get(data, 'result.response').id 58 | }) 59 | }) 60 | } 61 | } 62 | }) 63 | return result 64 | } 65 | 66 | /** 67 | * util method to formate the gained competency 68 | * for user 69 | */ 70 | 71 | formatedGainedCompetency(entity:any, passbook:any){ 72 | let response = [] 73 | _.forEach(entity,(value:any)=>{ 74 | const cid = _.get(value, 'id') 75 | _.forEach(passbook,(passbookValue:any)=>{ 76 | if(passbookValue.competencies.hasOwnProperty(cid)){ 77 | const competency = passbookValue.competencies[cid] 78 | response.push({ 79 | 'title': _.get(competency,'additionalParams.competencyName'), 80 | 'logs': this.acquiredPassbookLogs(_.get(competency, 'acquiredDetails')), 81 | 'proficiencyLevels': this.acauiredChannelColourCode(_.get(competency, 'acquiredDetails')) 82 | }) 83 | 84 | } 85 | }) 86 | }) 87 | return response 88 | } 89 | acquiredPassbookLogs(acquiredDetails:any){ 90 | let response = [] 91 | if(acquiredDetails.length>0){ 92 | _.forEach(acquiredDetails,(value:any)=>{ 93 | response.push({ 94 | 'header': _.get(value, 'courseName') ? _.get(value, 'courseName') : '', 95 | 'date': _.get(value,'createdDate'), 96 | 'description': _.get(value, 'additionalParams.description'), 97 | 'keyboardArrowUp':true, 98 | 'level': _.get(value,'competencyLevelId') 99 | }) 100 | }) 101 | } 102 | return response 103 | } 104 | acauiredChannelColourCode(acquiredDetails:any){ 105 | let response = [ 106 | { 107 | 'color': '#FFFBB0', 108 | 'displayLevel': 1, 109 | 'selected': false, 110 | }, 111 | { 112 | 'color': '#FFFBB0', 113 | 'displayLevel': 2, 114 | 'selected': false, 115 | }, 116 | { 117 | 'color': '#FFFBB0', 118 | 'displayLevel': 3, 119 | 'selected': false, 120 | }, 121 | { 122 | 'color': '#FFFBB0', 123 | 'displayLevel': 4, 124 | 'selected': false, 125 | }, 126 | { 127 | 'color': '#FFFBB0', 128 | 'displayLevel': 5, 129 | 'selected': false, 130 | } 131 | ] 132 | 133 | _.forEach(acquiredDetails,(value:any)=>{ 134 | const channel = _.get(value,'acquiredChannel') 135 | switch(channel) { 136 | case 'course':{ 137 | _.forEach(response, (level:any)=>{ 138 | if(level.displayLevel == _.get(value,'competencyLevelId')){ 139 | level.color = '#FFFBB0'; 140 | level.selected = true 141 | } 142 | } ) 143 | 144 | break; 145 | } 146 | case 'selfAssessment':{ 147 | _.forEach(response, (level:any)=>{ 148 | if(level.displayLevel == _.get(value,'competencyLevelId')){ 149 | level.color = '#7CB5E6'; 150 | level.selected = true 151 | 152 | } 153 | } ) 154 | 155 | break; 156 | } 157 | case 'admin':{ 158 | _.forEach(response, (level:any)=>{ 159 | if(level.displayLevel == _.get(value,'competencyLevelId')){ 160 | level.color = '#A4DFCA'; 161 | level.selected = true 162 | } 163 | } ) 164 | 165 | break; 166 | } 167 | default: { 168 | _.forEach(response, (level:any)=>{ 169 | if(level.displayLevel == _.get(value,'competencyLevelId')){ 170 | level.color = '#FFFBB0'; 171 | level.selected = false; 172 | } 173 | } ) 174 | 175 | break; 176 | } 177 | } 178 | }) 179 | return response 180 | } 181 | } 182 | 183 | 184 | 185 | --------------------------------------------------------------------------------