Skip to content

Commit

Permalink
Merge pull request #574 from sunbird-cb/odcs-mapping
Browse files Browse the repository at this point in the history
Odcs mapping
  • Loading branch information
bharathravi-in authored Jul 23, 2024
2 parents bd53ffb + cb955fb commit c7ff505
Show file tree
Hide file tree
Showing 38 changed files with 2,099 additions and 17 deletions.
4 changes: 3 additions & 1 deletion angular.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
"main": "src/main.ts",
"polyfills": "src/polyfills.ts",
"tsConfig": "tsconfig.app.json",
"preserveSymlinks": true,
"assets": [
"src/favicon.png",
"src/mdo-assets/icons/",
Expand Down Expand Up @@ -88,7 +89,8 @@
"scripts": [
"node_modules/jquery/dist/jquery.min.js",
"node_modules/@project-sunbird/telemetry-sdk/index.js",
"node_modules/shepherd.js/dist/js/shepherd.min.js"
"node_modules/shepherd.js/dist/js/shepherd.min.js",
"node_modules/leader-line/leader-line.min.js"
]
},
"configurations": {
Expand Down
8 changes: 5 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,12 @@
"@project-sunbird/telemetry-sdk": "0.0.26",
"@sunbird-cb/collection": "^1.0.44",
"@sunbird-cb/design-system": "0.0.1",
"@sunbird-cb/micro-surveys": "2.0.13",
"@sunbird-cb/rain-dashboards": "0.4.33",
"@sunbird-cb/resolver": "^1.0.0",
"@sunbird-cb/utils": "^1.0.17",
"@sunbird-cb/taxonomy-editor": "^0.0.15",
"@sunbird-cb/utils": "^1.0.18",
"@types/file-saver": "^2.0.1",
"@sunbird-cb/micro-surveys": "2.0.13",
"brace": "^0.11.1",
"chart.js": "^2.8.0",
"d3": "^5.9.7",
Expand All @@ -60,6 +61,7 @@
"jspdf": "^2.3.1",
"jsplumb": "2.11.2",
"keycloak-angular": "^6.1.0",
"leader-line": "1.0.7",
"lodash": "4.17.21",
"material-icons": "^0.7.1",
"moment": "^2.29.1",
Expand Down Expand Up @@ -118,6 +120,7 @@
"@types/zip.js": "2.0.28",
"angular-cli-alias": "^1.0.9",
"codelyzer": "^5.1.0",
"d3-funnel": "^2.1.1",
"gzipper": "^2.8.1",
"jasmine-core": "~3.4.0",
"jasmine-spec-reporter": "~4.2.1",
Expand All @@ -135,7 +138,6 @@
"tslint-config-airbnb": "^5.11.1",
"typescript": "~3.5.3",
"typescript-tslint-plugin": "^0.5.4",
"d3-funnel": "^2.1.1",
"webpack-bundle-analyzer": "^4.4.0"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
}

::ng-deep .mat-drawer-container {
z-index: 999;
// z-index: 999;
}

.sidenav-wrap {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,13 +64,13 @@ export class RequestListComponent implements OnInit {
fullProfile: any
rootOrgId: any
constructor(private sanitizer: DomSanitizer,
private homeService: ProfileV2Service,
private datePipe: DatePipe,
private activeRoute: ActivatedRoute,
private dialog: MatDialog,
private router: Router,
private snackBar: MatSnackBar,
private loaderService: LoaderService,
private homeService: ProfileV2Service,
private datePipe: DatePipe,
private activeRoute: ActivatedRoute,
private dialog: MatDialog,
private router: Router,
private snackBar: MatSnackBar,
private loaderService: LoaderService,
) { }
requestList: any[] = [
`You can request new content by filling out the request form. You will have the option to choose your content provider and
Expand Down Expand Up @@ -242,7 +242,7 @@ export class RequestListComponent implements OnInit {
if (res) {
setTimeout(() => {
this.getRequestList()
}, 1000)
}, 1000)
}

this.snackBar.open('Marked as Invalid')
Expand All @@ -264,7 +264,7 @@ export class RequestListComponent implements OnInit {
if (_res && _res.data === 'confirmed') {
setTimeout(() => {
this.getRequestList()
}, 1000)
}, 1000)
this.snackBar.open('Assigned submitted Successfully')
} else {
// this.snackBar.open('error')
Expand All @@ -285,7 +285,7 @@ export class RequestListComponent implements OnInit {
if (_res && _res.data === 'confirmed') {
setTimeout(() => {
this.getRequestList()
}, 1000)
}, 1000)

this.snackBar.open('Re-assign submitted Successfully')
} else {
Expand Down
19 changes: 18 additions & 1 deletion project/ws/app/src/lib/routes/home/home.module.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { NgModule } from '@angular/core'
import { CUSTOM_ELEMENTS_SCHEMA, NgModule } from '@angular/core'
import { CommonModule } from '@angular/common'
import { PipeDurationTransformModule, PipeFilterModule, PipeHtmlTagRemovalModule, PipeOrderByModule, PipeRelativeTimeModule } from '@sunbird-cb/utils'
import { MatGridListModule } from '@angular/material/grid-list'
Expand All @@ -11,6 +11,7 @@ import {
MatChipsModule, MatProgressSpinnerModule, MatProgressBarModule, MatRadioModule,
MatTabsModule, MatCheckboxModule, MatDatepickerModule, MatAutocompleteModule, MatSlideToggleModule,
} from '@angular/material'
import { MatDialogRef, MAT_DIALOG_DATA } from '@angular/material/dialog'
import { MatMenuModule } from '@angular/material/menu'
import { MatPaginatorModule } from '@angular/material/paginator'
import { MatCardModule } from '@angular/material/card'
Expand Down Expand Up @@ -80,6 +81,11 @@ import { CreateRequestFormComponent } from './components/request-list/create-req
import { CompetencyViewComponent } from './components/request-list/competency-view/competency-view.component'
import { AssignListPopupComponent } from './components/request-list/assign-list-popup/assign-list-popup.component'
import { SingleAssignPopupComponent } from './components/request-list/single-assign-popup/single-assign-popup.component'
import { HttpClientModule } from '@angular/common/http'
import { DesignationModule } from './routes/designation/designation.module'
import { OdcsMappingComponent } from './routes/odcs-mapping/odcs-mapping.component'
import { environment } from '../../../../../../../src/environments/environment'
import { TaxonomyEditorModule } from '@sunbird-cb/taxonomy-editor'

@NgModule({
declarations: [
Expand Down Expand Up @@ -125,6 +131,7 @@ import { SingleAssignPopupComponent } from './components/request-list/single-ass
CompetencyViewComponent,
AssignListPopupComponent,
SingleAssignPopupComponent,
OdcsMappingComponent,
],
imports: [
CommonModule,
Expand Down Expand Up @@ -180,6 +187,9 @@ import { SingleAssignPopupComponent } from './components/request-list/single-ass
FilterSearchPipeModule,
MatAutocompleteModule,
MatSlideToggleModule,
HttpClientModule,
DesignationModule,
TaxonomyEditorModule,
],
entryComponents: [
AdduserpopupComponent,
Expand All @@ -198,12 +208,19 @@ import { SingleAssignPopupComponent } from './components/request-list/single-ass
SingleAssignPopupComponent,
],
providers: [
{ provide: 'environment', useValue: environment },
{
provide: MatDialogRef,
useValue: {},
},
{ provide: MAT_DIALOG_DATA, useValue: {} },
InitResolver,
MdoInfoService,
UploadService,
TrainingPlanDashboardService,
UsersService,
],
schemas: [CUSTOM_ELEMENTS_SCHEMA],
})
export class HomeModule {

Expand Down
20 changes: 19 additions & 1 deletion project/ws/app/src/lib/routes/home/home.rounting.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ import { UserCreationComponent } from './routes/users-view/user-creation/user-cr
import { BulkUploadApprovalComponent } from './routes/approvals/bulk-upload/bulk-upload.component'
import { RequestListComponent } from './components/request-list/request-list.component'
import { CreateRequestFormComponent } from './components/request-list/create-request-form/create-request-form.component'
import { OdcsMappingComponent } from './routes/odcs-mapping/odcs-mapping.component'

const routes: Routes = [
{
Expand Down Expand Up @@ -338,7 +339,24 @@ const routes: Routes = [
pageData: PageResolve,
},
},

{
path: 'org-designations',
loadChildren: () => import('./routes/designation/designation.module').then(m => m.DesignationModule),
},
{
path: 'odcs-mapping',
component: OdcsMappingComponent,
data: {
pageId: 'home/odcs-mapping',
module: 'odcs-mapping',
pageType: 'feature',
pageKey: 'odcs',
},
resolve: {
configService: ConfigResolveService,
pageData: PageResolve,
},
},
],
},
{
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
<div class="flex flex-4 flex-column">
<mat-card>
<mat-card-title class="flex-4 mobile-margin mat-h2">
My Designation Master
</mat-card-title>
<mat-card-content class="designationTable pt-4">
<ng-container *ngIf="!showCreateLoader; else fw_create_loader">
<div class="w-full flex justify-between items-center mb-6">
<div class="flex items-center">
<div class="search">
<div class=rsearch>
<mat-icon class="color-60 search-icon">search</mat-icon>
<input [formControl]="searchControl" class="sinput color-60" type="Standard" placeholder="Search">
</div>
</div>
</div>
<div class="flex items-center">
<button class="font-normal ws-mat-primary-border attendBtn mat-raised-button"
[routerLink]="'import-designation'" type="button">
Import from Igot master
</button>
</div>
</div>
<ng-container *ngIf="!showLoader">
<ng-container *ngIf="designationsList.length === 0; else designationsTable">
<div class="w-full flex flex-col justify-center items-center emptyDesignations">
<div></div>
<div>
<p>No designations have been added to your master's list yet</p>
</div>
<div class="mt-4">
<button mat-raised-button [routerLink]="'import-designation'">
<mat-icon class="download-icon">download</mat-icon>Start Importing</button>
</div>
</div>
</ng-container>
<ng-template #designationsTable>
<ws-widget-org-user-table [tableData]="tableData" [data]="filteredDesignationsList"
[actionMenuItem]="actionMenuItem" [isSearchBar]=false
(actionsClick)="menuSelected($event)"></ws-widget-org-user-table>
</ng-template>
</ng-container>
<ng-container *ngIf="showLoader">
<div class="flex flex-1 items-center justify-center loader-box w-full designations-loader">
<mat-spinner strokeWidth="3" diameter="50"></mat-spinner>
</div>
</ng-container>
</ng-container>
<ng-template #fw_create_loader>
<div class="flex flex-col flex-1 w-100 items-center pt-5 text-center">
<mat-spinner class="display-inline-block mb-5" [diameter]="50" [strokeWidth]="3"></mat-spinner>
<p>{{loaderMsg}}</p>
</div>
</ng-template>
</mat-card-content>
</mat-card>
</div>
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
:host ::ng-deep .designationTable {
.mat-column-CBP-Menu {
max-width: 100px;
}
}

.organisation-lable {
font-family: 'lato';
font-weight: 700;
font-size: 14px;
line-height: 21px;
}

.organisation {
width: 300px;
}

.btn-upload {
background: #1b4ca1 !important;
color: white !important;
font-family: 'Lato';
font-weight: 700;
font-size: 14px;
height: 40px;
}

.btn-create-designation {
width: auto;
border: 1px solid #0075B7;
border-radius: 4px;
color: #0075B7 !important;
height: 40px;
}

.search {

.search-icon {
position: absolute;
top: 9px;
font-size: 20px;
left: 10px;
}

.rsearch {
display: flex;
position: relative;
flex: 1 1 auto;
}

.sinput {
width: 315px;
border-radius: 4px;
border: 1px solid #d5d0d0;
padding: 9px 9px 9px 35px;
margin-top: 0;
font: normal 14px Lato;
font-weight: 400;
}
}

.emptyDesignations{
height: calc(100vh - 300px);
}

.download-icon {
margin-right: 5px;
}

.designations-loader {
height: 100px;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import { async, ComponentFixture, TestBed } from '@angular/core/testing'

import { DesignationsComponent } from './designations.component'

describe('DesignationsComponent', () => {
let component: DesignationsComponent
let fixture: ComponentFixture<DesignationsComponent>

beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [DesignationsComponent],
})
.compileComponents()
}))

beforeEach(() => {
fixture = TestBed.createComponent(DesignationsComponent)
component = fixture.componentInstance
fixture.detectChanges()
})

it('should create', () => {
expect(component).toBeTruthy()
})
})
Loading

0 comments on commit c7ff505

Please sign in to comment.