src/app/modules/workspace/components/workspacesidebar/workspacesidebar.component.ts
The Workspace side component shows the sidebar for workspace
OnInit
selector | app-workspacesidebar |
templateUrl | ./workspacesidebar.component.html |
Properties |
|
Methods |
constructor(config: ConfigService, resourceService: ResourceService, permissionService: PermissionService, router: Router, workSpaceService: WorkSpaceService)
|
||||||||||||||||||||||||
Constructor to create injected service(s) object Default method of Draft Component class
Parameters :
|
ngOnInit |
ngOnInit()
|
Returns :
void
|
setInteractData | ||||
setInteractData(id)
|
||||
Parameters :
|
allContentRole |
Type : Array<string>
|
allContentRole access roles |
alltextbookRole |
Type : Array<string>
|
roles for which admin to be shown |
alluploadsRole |
Type : Array<string>
|
alluploadsRole access roles |
collaboratingRole |
Type : Array<string>
|
allContentRole access roles |
Public config |
Type : ConfigService
|
reference of config service. |
courseBatchRoles |
Type : Array<string>
|
courseBatchRoles access roles |
createRole |
Type : Array<string>
|
draftRole |
Type : Array<string>
|
Draft access roles |
flaggedRole |
Type : Array<string>
|
flaggedRole access roles |
flagReviewer |
Type : Array<string>
|
flagReviewer access roles |
inreviewRole |
Type : Array<string>
|
inreviewRole access roles |
limitedPublishingRole |
Type : Array<string>
|
limitedPublishingRole access roles |
Public permissionService |
Type : PermissionService
|
reference of permissionService service. |
publishedRole |
Type : Array<string>
|
publishedRole access roles |
Public resourceService |
Type : ResourceService
|
To call resource service which helps to use language constant |
Private router |
Type : Router
|
reference of Router. |
startRole |
Type : Array<string>
|
start access roles |
trainingRole |
Type : Array<string>
|
roles for which training sub-tab to be shown |
upForReviewRole |
Type : Array<string>
|
upForReviewRole access roles |
Public workSpaceService |
Type : WorkSpaceService
|
import { Component, OnInit } from '@angular/core';
import { ResourceService, ConfigService } from '@sunbird/shared';
import { PermissionService } from '@sunbird/core';
import {Router} from '@angular/router';
import { WorkSpaceService } from './../../services';
/**
* The Workspace side component shows the sidebar for workspace
*/
@Component({
selector: 'app-workspacesidebar',
templateUrl: './workspacesidebar.component.html'
})
export class WorkspacesidebarComponent implements OnInit {
/**
* To call resource service which helps to use language constant
*/
public resourceService: ResourceService;
/**
* reference of permissionService service.
*/
public permissionService: PermissionService;
/**
* reference of config service.
*/
public config: ConfigService;
/*
roles allowed to create content
*/
createRole: Array<string>;
/**
* Draft access roles
*/
draftRole: Array<string>;
/**
* inreviewRole access roles
*/
inreviewRole: Array<string>;
/**
* publishedRole access roles
*/
publishedRole: Array<string>;
/**
* alluploadsRole access roles
*/
alluploadsRole: Array<string>;
/**
* upForReviewRole access roles
*/
upForReviewRole: Array<string>;
/**
* courseBatchRoles access roles
*/
courseBatchRoles: Array<string>;
/**
* flaggedRole access roles
*/
flaggedRole: Array<string>;
/**
* limitedPublishingRole access roles
*/
limitedPublishingRole: Array<string>;
/**
* start access roles
*/
startRole: Array<string>;
/**
* allContentRole access roles
*/
allContentRole: Array<string>;
/**
* flagReviewer access roles
*/
flagReviewer: Array<string>;
/**
* allContentRole access roles
*/
collaboratingRole: Array<string>;
/**
* roles for which training sub-tab to be shown
*/
trainingRole: Array<string>;
/**
* roles for which admin to be shown
*/
alltextbookRole: Array<string>;
/**
* reference of Router.
*/
private router: Router;
/**
* Constructor to create injected service(s) object
Default method of Draft Component class
* @param {ResourceService} resourceService Reference of ResourceService
* @param {PermissionService} permissionService Reference of PermissionService
* @param {ConfigService} config Reference of ConfigService
*/
constructor(config: ConfigService, resourceService: ResourceService, permissionService: PermissionService,
router: Router, public workSpaceService: WorkSpaceService) {
this.resourceService = resourceService;
this.permissionService = permissionService;
this.config = config;
this.router = router;
}
ngOnInit() {
this.workSpaceService.getQuestionSetCreationStatus();
this.alltextbookRole = this.config.rolesConfig.workSpaceRole.alltextbookRole;
this.createRole = this.config.rolesConfig.workSpaceRole.createRole;
this.draftRole = this.config.rolesConfig.workSpaceRole.draftRole;
this.inreviewRole = this.config.rolesConfig.workSpaceRole.inreviewRole;
this.publishedRole = this.config.rolesConfig.workSpaceRole.publishedRole;
this.alluploadsRole = this.config.rolesConfig.workSpaceRole.alluploadsRole;
this.upForReviewRole = this.config.rolesConfig.workSpaceRole.upForReviewRole;
this.courseBatchRoles = this.config.rolesConfig.workSpaceRole.courseBatchRoles;
this.flaggedRole = this.config.rolesConfig.workSpaceRole.flaggedRole;
this.limitedPublishingRole = this.config.rolesConfig.workSpaceRole.limitedPublishingRole;
this.startRole = this.config.rolesConfig.workSpaceRole.startRole;
this.allContentRole = this.config.rolesConfig.workSpaceRole.allContentRole;
this.flagReviewer = this.config.rolesConfig.workSpaceRole.flagReviewer;
this.collaboratingRole = this.config.rolesConfig.workSpaceRole.collaboratingRole;
}
setInteractData(id) {
return {
id,
type: 'click',
pageid: 'workspace'
};
}
}
<h4 class="workspaceicon ui header sectionHeading mt-20"><i class="database icon"></i>
<span>
{{resourceService?.frmelmnts?.scttl?.myworkspace}}
</span>
</h4>
<div class="publicmenusection ui secondary vertical menu">
<a appTelemetryInteract [telemetryInteractEdata]="setInteractData('create-button')" *ngIf='permissionService.permissionAvailable' appPermission [permission]='createRole' class="item" [routerLink]="['create']" routerLinkActive="active" matTooltip="Create Resource, Course, Book, Collection, Lesson Plan or Upload"
[matTooltipPosition]="'right'">
{{resourceService?.frmelmnts?.snav?.start}}
</a>
<a appTelemetryInteract [telemetryInteractEdata]="setInteractData('alltextbooks-button')" *ngIf='permissionService.permissionAvailable' [class.active]="router.isActive('/workspace/content/alltextbooks',false) "
appPermission [permission]='alltextbookRole' class="item" [routerLink]="['alltextbooks',1]" matTooltip="View all Textbooks"
[matTooltipPosition]="'right'">
{{resourceService?.frmelmnts?.snav?.alltextbook}}
</a>
<a appTelemetryInteract [telemetryInteractEdata]="setInteractData('allmycontents-button')" *ngIf='permissionService.permissionAvailable' [class.active]="router.isActive('/workspace/content/allcontent',false) "
appPermission [permission]='allContentRole' class="item" [routerLink]="['allcontent',1]" matTooltip="View all your content in draft, review, published and more"
[matTooltipPosition]="'right'">
{{resourceService?.frmelmnts?.snav?.allmycontents}}
</a>
<a appTelemetryInteract [telemetryInteractEdata]="setInteractData('draft-button')" *ngIf='permissionService.permissionAvailable' [class.active]="router.isActive('/workspace/content/draft',false) " appPermission
[permission]='draftRole' class="item" [routerLink]="['draft',1]" matTooltip="View drafts you are working on. Submit them for review when completed"
[matTooltipPosition]="'right'">
{{resourceService?.frmelmnts?.snav?.draft}}
</a>
<a class="item" appTelemetryInteract [telemetryInteractEdata]="setInteractData('submittedForReview-button')" *ngIf='permissionService.permissionAvailable' appPermission [permission]='inreviewRole' [routerLink]="['review',1]"
[class.active]="router.isActive('/workspace/content/review',false)" matTooltip="View all content you have submitted for review"
[matTooltipPosition]="'right'">
{{resourceService?.frmelmnts?.snav?.submittedForReview}}
</a>
<a class="item" appTelemetryInteract [telemetryInteractEdata]="setInteractData('publish-button')" *ngIf='permissionService.permissionAvailable' appPermission [permission]='publishedRole' [routerLink]="['published',1]"
[class.active]="router.isActive('/workspace/content/published',false)" matTooltip="View all your published content"
[matTooltipPosition]="'right'">
{{resourceService?.frmelmnts?.snav?.published}}
</a>
<a appTelemetryInteract [telemetryInteractEdata]="setInteractData('alluploads-button')" class="item" *ngIf='permissionService.permissionAvailable' appPermission [permission]='alluploadsRole' [routerLink]="['uploaded',1]"
[class.active]="router.isActive('/workspace/content/uploaded',false)" matTooltip="View all your uploads"
[matTooltipPosition]="'right'">
{{resourceService?.frmelmnts?.snav?.alluploads}}
</a>
<!-- <a class="item" [routerLink]="['upForReview',1]" routerLinkActive="active"> -->
<a appTelemetryInteract [telemetryInteractEdata]="setInteractData('upforreview-button')" class="item" *ngIf='permissionService.permissionAvailable' [class.active]="router.isActive('/workspace/content/upForReview',false)"
[routerLink]="['upForReview',1]" appPermission [permission]='upForReviewRole' matTooltip="Content awaiting your review"
[matTooltipPosition]="'right'">
{{resourceService?.frmelmnts?.snav?.upForReview}}
</a>
<a appTelemetryInteract [telemetryInteractEdata]="setInteractData('flagreview-button')" class="item" *ngIf='permissionService.permissionAvailable' [class.active]="router.isActive('/workspace/content/flagreviewer',false)"
[routerLink]="['flagreviewer',1]" appPermission [permission]='flagReviewer'>
{{resourceService?.frmelmnts?.snav?.flagReviewer}}
</a>
<a appTelemetryInteract [telemetryInteractEdata]="setInteractData('coursebatch-button')" class="item" *ngIf='permissionService.permissionAvailable' appPermission [permission]='courseBatchRoles' [routerLink]="['batches','created']"
[class.active]="router.isActive('/workspace/content/batches',false)" matTooltip="Manage course batches"
[matTooltipPosition]="'right'">
{{resourceService?.frmelmnts?.lnk?.coursebacthes}}
</a>
<a appTelemetryInteract [telemetryInteractEdata]="setInteractData('createdbyme-button')" class="item ml-15 fs-0-785" *ngIf='permissionService.permissionAvailable' appPermission [permission]='courseBatchRoles'
[routerLink]="['batches','created']" [class.active]="router.isActive('/workspace/content/batches/created',false)">
{{resourceService?.frmelmnts?.lnk?.createdByMe}}<span></span>
</a>
<a appTelemetryInteract [telemetryInteractEdata]="setInteractData('assignedtome-button')" class="item ml-15 fs-0-785" *ngIf='permissionService.permissionAvailable' appPermission [permission]='courseBatchRoles'
[routerLink]="['batches','assigned']" [class.active]="router.isActive('/workspace/content/batches/assigned',false)">
{{resourceService?.frmelmnts?.lnk?.assignedToMe}}<span></span>
</a>
<a appTelemetryInteract [telemetryInteractEdata]="setInteractData('flag-button')" class="item" *ngIf='permissionService.permissionAvailable' appPermission [permission]='flaggedRole' [routerLink]="['flagged',1]"
[class.active]="router.isActive('/workspace/content/flagged',false)">
{{resourceService?.frmelmnts?.snav?.flagged}}
</a>
<a appTelemetryInteract [telemetryInteractEdata]="setInteractData('sharevialink-button')" class="item" *ngIf='permissionService.permissionAvailable' appPermission [permission]='limitedPublishingRole' [routerLink]="['limited-publish',1]"
[class.active]="router.isActive('/workspace/content/limited-publish',false)" matTooltip="View content shared via link. This is not searchable until published by submitting for review"
[matTooltipPosition]="'right'">
{{resourceService?.frmelmnts?.snav?.shareViaLink}}
</a>
<a appTelemetryInteract [telemetryInteractEdata]="setInteractData('collaborations-button')" class="item" *ngIf='permissionService.permissionAvailable' appPermission [permission]='collaboratingRole' [routerLink]="['collaborating-on',1]"
[class.active]="router.isActive('/workspace/content/collaborating-on',false)" matTooltip="View content you are collaborating on" [matTooltipPosition]="'right'">
{{resourceService?.frmelmnts?.snav?.Collaboratingon}}
</a>
</div>