File
Implements
Methods
ngAfterViewInit
|
ngAfterViewInit()
|
|
|
assessmentRole
|
Type : Array<string>
|
|
|
collectionRole
|
Type : Array<string>
|
|
collectionRole access roles
|
Public
configService
|
Type : ConfigService
|
|
reference of config service.
|
contentUploadRole
|
Type : Array<string>
|
|
lessonplanRole access roles
|
courseRole
|
Type : Array<string>
|
|
|
Public
enableQuestionSetCreation
|
|
lessonplanRole
|
Type : Array<string>
|
|
lessonplanRole access roles
|
lessonRole
|
Type : Array<string>
|
|
|
Public
permissionService
|
Type : PermissionService
|
|
reference of permissionService service.
|
Public
resourceService
|
Type : ResourceService
|
|
To call resource service which helps to use language constant
|
textBookRole
|
Type : Array<string>
|
|
import { ActivatedRoute } from '@angular/router';
import { Component, OnInit, AfterViewInit } from '@angular/core';
import { ResourceService, ConfigService, NavigationHelperService } from '@sunbird/shared';
import { FrameworkService, PermissionService, UserService } from '@sunbird/core';
import { IImpressionEventInput } from '@sunbird/telemetry';
import { WorkSpaceService } from './../../services';
@Component({
selector: 'app-create-content',
templateUrl: './create-content.component.html'
})
export class CreateContentComponent implements OnInit, AfterViewInit {
/*
roles allowed to create textBookRole
*/
textBookRole: Array<string>;
/**
* lessonRole access roles
*/
lessonRole: Array<string>;
/**
* collectionRole access roles
*/
collectionRole: Array<string>;
/**
* lessonplanRole access roles
*/
lessonplanRole: Array<string>;
/**
* lessonplanRole access roles
*/
contentUploadRole: Array<string>;
/**
* courseRole access roles
*/
courseRole: Array<string>;
/**
* assesment access role
*/
assessmentRole: Array<string>;
/**
* To call resource service which helps to use language constant
*/
public resourceService: ResourceService;
/**
* Reference for framework service
*/
public frameworkService: FrameworkService;
/**
* reference of permissionService service.
*/
public permissionService: PermissionService;
/**
* reference of config service.
*/
public configService: ConfigService;
/**
* telemetryImpression
*/
telemetryImpression: IImpressionEventInput;
public enableQuestionSetCreation;
/**
* Constructor to create injected service(s) object
*
* Default method of DeleteComponent class
* @param {ResourceService} resourceService Reference of ResourceService
*/
constructor(configService: ConfigService, resourceService: ResourceService,
frameworkService: FrameworkService, permissionService: PermissionService,
private activatedRoute: ActivatedRoute, public userService: UserService,
public navigationhelperService: NavigationHelperService,
public workSpaceService: WorkSpaceService) {
this.resourceService = resourceService;
this.frameworkService = frameworkService;
this.permissionService = permissionService;
this.configService = configService;
}
ngOnInit() {
this.frameworkService.initialize();
this.textBookRole = this.configService.rolesConfig.workSpaceRole.textBookRole;
this.lessonRole = this.configService.rolesConfig.workSpaceRole.lessonRole;
this.collectionRole = this.configService.rolesConfig.workSpaceRole.collectionRole;
this.lessonplanRole = this.configService.rolesConfig.workSpaceRole.lessonplanRole;
this.contentUploadRole = this.configService.rolesConfig.workSpaceRole.contentUploadRole;
this.assessmentRole = this.configService.rolesConfig.workSpaceRole.assessmentRole;
this.courseRole = this.configService.rolesConfig.workSpaceRole.courseRole;
this.workSpaceService.questionSetEnabled$.subscribe(
(response: any) => {
this.enableQuestionSetCreation = response.questionSetEnablement;
}
);
}
ngAfterViewInit () {
setTimeout(() => {
this.telemetryImpression = {
context: {
env: this.activatedRoute.snapshot.data.telemetry.env
},
edata: {
type: this.activatedRoute.snapshot.data.telemetry.type,
pageid: this.activatedRoute.snapshot.data.telemetry.pageid,
uri: this.activatedRoute.snapshot.data.telemetry.uri,
duration: this.navigationhelperService.getPageLoadTime()
}
};
});
}
}
<div class="ui grid mt-5">
<div class="twelve wide column ">
<div class="ui grid">
<div class="three wide column" *ngIf='permissionService.permissionAvailable' appPermission
[permission]='textBookRole' [appTelemetryImpression]="telemetryImpression">
<div class="ui link card" routerLink="textbook" appTelemetryInteract
[telemetryInteractEdata]="{id:'createTextbook',type:'click',pageid:'create-textbook'}">
<div class="content">
<div class="textcontent">
<i class='my-icon file text outline icon '></i>
<span class="my-text">{{resourceService?.frmelmnts?.lbl?.textbook}}</span>
</div>
</div>
</div>
<p class="workspaceinstuction">{{resourceService?.frmelmnts?.lbl?.textbookdescription}}</p>
</div>
<div class="three wide column" *ngIf='permissionService.permissionAvailable' appPermission
[permission]='courseRole'>
<div class="ui link card" routerLink="course" [queryParams]="{showFrameworkSelection: true}" appTelemetryInteract
[telemetryInteractEdata]="{id:'createCourse',type:'click',pageid:'create-course'}">
<div class="content">
<div class="textcontent">
<i class='my-icon file text outline icon'></i>
<span class="my-text">{{resourceService?.frmelmnts?.lbl?.course}}</span>
</div>
</div>
</div>
<p class="workspaceinstuction">{{resourceService?.frmelmnts?.lbl?.coursedescription}}</p>
</div>
<div class="three wide column" *ngIf='permissionService.permissionAvailable' appPermission
[permission]='lessonRole'>
<div class="ui link card" routerLink="studymaterial" appTelemetryInteract
[telemetryInteractEdata]="{id:'createStudyMaterial',type:'click',pageid:'create-study-material'}">
<div class="content">
<div class="textcontent">
<i class='my-icon file text icon'></i>
<span class="my-text">{{resourceService?.frmelmnts?.lbl?.lesson}}</span>
</div>
</div>
</div>
<p class="workspaceinstuction">{{resourceService?.frmelmnts?.lbl?.lessondescription}}</p>
</div>
<div class="three wide column" *ngIf='permissionService.permissionAvailable' appPermission
[permission]='collectionRole'>
<div class="ui link card" routerLink="collection" appTelemetryInteract
[telemetryInteractEdata]="{id:'createColllection',type:'click',pageid:'create-collection'}">
<div class="content">
<div class="textcontent">
<i class='my-icon folder open outline icon'></i>
<span class="my-text">{{resourceService?.frmelmnts?.lbl?.collection}}</span>
</div>
</div>
</div>
<p class="workspaceinstuction">{{resourceService?.frmelmnts?.lbl?.collectiondescription}}</p>
</div>
</div>
</div>
<div class="twelve wide column ">
<div class="ui grid">
<div class="three wide column" *ngIf='permissionService.permissionAvailable' appPermission
[permission]='lessonplanRole'>
<div class="ui link card" routerLink="lessonplan">
<div class="content" appTelemetryInteract
[telemetryInteractEdata]="{id:'createLessonPlan',type:'click',pageid:'create-lesson-plan'}">
<div class="textcontent">
<i class='my-icon file text outline icon'></i>
<span class="my-text">{{resourceService?.frmelmnts?.lbl?.lessonplan}}</span>
</div>
</div>
</div>
<p class="workspaceinstuction">{{resourceService?.frmelmnts?.lbl?.lessonplandescription}}</p>
</div>
<div class="three wide column" *ngIf='permissionService.permissionAvailable' appPermission
[permission]='contentUploadRole'>
<div class="ui link card" routerLink="../edit/generic/" appTelemetryInteract
[telemetryInteractEdata]="{id:'uploadContent',type:'click',pageid:'upload-content'}">
<div class="content">
<div class="textcontent">
<i class='my-icon upload icon'></i>
<span class="my-text">{{resourceService?.frmelmnts?.lbl?.contentupload}}</span>
</div>
</div>
</div>
<p class="workspaceinstuction">{{resourceService?.frmelmnts?.lbl?.contentuploaddescription}}</p>
</div>
<div class="three wide column" *ngIf='permissionService.permissionAvailable' appPermission
[permission]='contentUploadRole'>
<div class="ui link card" routerLink="../edit/editorforlargecontent/" appTelemetryInteract
[telemetryInteractEdata]="{id:'uploadContent',type:'click',pageid:'upload-content'}">
<div class="content">
<div class="textcontent">
<i class='my-icon upload icon'></i>
<span class="my-text">{{resourceService?.frmelmnts?.lbl?.contentuploadlarge}}</span>
</div>
</div>
</div>
<p class="workspaceinstuction">{{resourceService?.frmelmnts?.lbl?.contentuploaddescription}}</p>
</div>
<!-- Assessment -->
<div class="three wide column" *ngIf='permissionService.permissionAvailable' appPermission
[permission]='assessmentRole'>
<div class="ui link card" routerLink="assessment" appTelemetryInteract
[telemetryInteractEdata]="{id:'createAssessment',type:'click',pageid:'create-assessment'}" [telemetryInteractCdata]="[{ id: 'user:workspace:assessment:create', type: 'Feature' }, { id: 'SB-17206', type: 'Task' }]">
<div class="content">
<div class="textcontent">
<img src="./assets/images/checklist.png" width="36" class="ml-8" />
<span class="my-text ml-12">{{resourceService?.frmelmnts?.lbl?.assessment}}</span>
</div>
</div>
</div>
<p class="workspaceinstuction">{{resourceService?.frmelmnts?.lbl?.assessmentdescription}}</p>
</div>
</div>
</div>
<div class="twelve wide column ">
<div class="ui grid">
<div class="three wide column" *ngIf='permissionService.permissionAvailable && enableQuestionSetCreation === true' appPermission
[permission]='collectionRole'>
<div class="ui link card" routerLink="questionset">
<div class="content" appTelemetryInteract
[telemetryInteractEdata]="{id:'QuestionSet',type:'click',pageid:'create-questionset'}">
<div class="textcontent">
<i class='my-icon file text outline icon'></i>
<span class="my-text">QuestionSet</span>
</div>
</div>
</div>
<p class="workspaceinstuction">Create Questionsets</p>
</div>
</div>
</div>
<div class="twelve wide column sb-bulk-upload hide">
<div class="ui grid">
<div class="six wide column">
<h4 class="my-16 bulk-upload-title">Bulk Content Upload</h4>
<button class="sb-btn sb-btn-primary sb-btn-normal" routerLink="bulkupload">
<i class="upload icon"></i> Upload .CSV file
</button>
<div class="bulk-content-upload-info mt-16">
<p>Please upload the CSV file in the required format “Sample Upload CSV File”. Refer “user Guide” for
instructions and guidelines to follow.</p>
</div>
</div>
</div>
<h4 class="mt-16 bulk-upload-title">Last upload file</h4>
<div class="sb-bulk-upload-details-report-info d-flex flex-ai-center">
<div class="py-16 sb-bulk-upload-file d-flex flex-ai-center">
<img src="" alt="" class="sb-upload-file mr-15">
<span class="sb-bulk-upload-content-title">Dummy Text.CSV</span>
</div>
<div class="sb-bulk-upload-status">
<div class="sb-label sb-label-table sb-label-gray-0">In progress</div>
</div>
<div class="sb-bulk-upload-details-report flex-jc-flex-end d-flex">
<button type="button" class="sb-btn sb-btn-outline-primary sb-btn-normal ">View Report</button>
</div>
</div>
<div class="sb-bulk-upload-details-report-info d-flex flex-ai-center">
<div class="py-16 sb-bulk-upload-file d-flex flex-ai-center">
<img src="" alt="" class="sb-upload-file mr-15">
<span class="sb-bulk-upload-content-title">Dummy Text.CSV</span>
</div>
<div class="sb-bulk-upload-status">
<div class="sb-label sb-label-table sb-label-error-0"><i class="exclamation circle icon"></i>Completed
with errors</div>
</div>
<div class="sb-bulk-upload-details-report flex-jc-flex-end d-flex">
<button type="button" class="sb-btn sb-btn-outline-primary sb-btn-normal ">View Report</button>
</div>
</div>
<div class="sb-bulk-upload-details-report-info d-flex flex-ai-center">
<div class="py-16 sb-bulk-upload-file d-flex flex-ai-center">
<img src="" alt="" class="sb-upload-file mr-15">
<span class="sb-bulk-upload-content-title">Dummy Text.CSV</span>
</div>
<div class="sb-bulk-upload-status">
<div class="sb-label sb-label-table sb-label-success-0">completed</div>
</div>
<div class="sb-bulk-upload-details-report flex-jc-flex-end d-flex">
<button type="button" class="sb-btn sb-btn-outline-primary sb-btn-normal ">View Report</button>
</div>
</div>
</div>
</div>
<router-outlet></router-outlet>
Legend
Html element with directive