src/app/modules/workspace/components/all-textbooks/all-textbooks.component.ts
OnInit
AfterViewInit
selector | app-all-textbooks |
templateUrl | ./all-textbooks.component.html |
constructor(searchService: SearchService, navigationhelperService: NavigationHelperService, workSpaceService: WorkSpaceService, paginationService: PaginationService, activatedRoute: ActivatedRoute, route: Router, userService: UserService, toasterService: ToasterService, resourceService: ResourceService, config: ConfigService, modalService: SuiModalService)
|
||||||||||||||||||||||||||||||||||||||||||||||||
Constructor to create injected service(s) object Default method of Draft Component class
Parameters :
|
Public checkLinkedCollections | ||||
checkLinkedCollections(modal)
|
||||
This method checks whether deleting content is linked to any collections, if linked to collection displays collection list pop modal.
Parameters :
Returns :
void
|
contentClick | ||||
contentClick(content)
|
||||
Parameters :
Returns :
void
|
Public deleteConfirmModal | ||||||
deleteConfirmModal(contentIds, mimeType)
|
||||||
Parameters :
Returns :
void
|
deleteContent | ||||
deleteContent(contentId)
|
||||
This method deletes content using the content id.
Parameters :
Returns :
void
|
fetchAllTextBooks |
fetchAllTextBooks(limit: number, pageNumber: number, bothParams)
|
This method sets the make an api call to get all textbooks with page No and offset
Returns :
void
|
inview | ||||
inview(event)
|
||||
Parameters :
Returns :
void
|
navigateToPage | ||||||||
navigateToPage(page: number)
|
||||||||
This method helps to navigate to different pages. If page number is less than 1 or page number is greater than total number of pages is less which is not possible, then it returns.
Parameters :
Example :
Returns :
undefined | void
|
ngAfterViewInit |
ngAfterViewInit()
|
Returns :
void
|
ngOnInit |
ngOnInit()
|
Returns :
void
|
Public onCloseLockInfoPopup |
onCloseLockInfoPopup()
|
Returns :
void
|
removeAllMyContent | ||||||
removeAllMyContent(contentList, requestData)
|
||||||
Parameters :
Returns :
any
|
delete | ||||
delete(contentIds)
|
||||
Inherited from
WorkSpace
|
||||
Defined in
WorkSpace:111
|
||||
Delete Api call .
Parameters :
Returns :
any
|
getBatches | ||||
getBatches(searchParams)
|
||||
Inherited from
WorkSpace
|
||||
Defined in
WorkSpace:128
|
||||
Batchlist Api call
Parameters :
Returns :
any
|
getChannelDetails | ||||
getChannelDetails(channelId)
|
||||
Inherited from
WorkSpace
|
||||
Defined in
WorkSpace:164
|
||||
get channel Api call
Parameters :
Returns :
any
|
getLinkedCollections | ||||||
getLinkedCollections(contentId: ContentIDParam)
|
||||||
Inherited from
WorkSpace
|
||||||
Defined in
WorkSpace:157
|
||||||
search collection Api call
Parameters :
Returns :
any
|
handleContentLockError | ||||
handleContentLockError(errObj)
|
||||
Inherited from
WorkSpace
|
||||
Defined in
WorkSpace:142
|
||||
handle content lock api error
Parameters :
Returns :
string
|
lockContent | ||||
lockContent(content)
|
||||
Inherited from
WorkSpace
|
||||
Defined in
WorkSpace:97
|
||||
this call will prepare reuest object and call lock api
Parameters :
Returns :
any
|
removeContent | ||||||
removeContent(contentList, requestData)
|
||||||
Inherited from
WorkSpace
|
||||||
Defined in
WorkSpace:120
|
||||||
Method to remove content localcaly
Parameters :
Returns :
any
|
search | ||||
search(searchParams)
|
||||
Inherited from
WorkSpace
|
||||
Defined in
WorkSpace:33
|
||||
Search Api call
Parameters :
Returns :
any
|
searchContentWithLockStatus | ||||
searchContentWithLockStatus(searchParams)
|
||||
Inherited from
WorkSpace
|
||||
Defined in
WorkSpace:40
|
||||
Search Api call and returns contents with lock status of each one
Parameters :
Returns :
any
|
UserList | ||||
UserList(searchParams)
|
||||
Inherited from
WorkSpace
|
||||
Defined in
WorkSpace:135
|
||||
userList Api call
Parameters :
Returns :
any
|
Private activatedRoute |
Type : ActivatedRoute
|
To send activatedRoute.snapshot to router navigation service for redirection to draft component |
alltextbooks |
Type : Array<IContents>
|
Default value : []
|
Contains list of published course(s) of logged-in user |
Public collectionData |
Type : Array<any>
|
To store all the collection details to be shown in collection modal |
Public collectionListModal |
Default value : false
|
To show/hide collection modal |
Public config |
Type : ConfigService
|
To get url, app configs |
contentIds |
Type : string
|
Contains unique contentIds id |
Private contentMimeType |
Type : string
|
To store deleteing content type |
Private currentContentId |
Type : ContentIDParam
|
To store deleting content id |
Private deleteModal |
Type : any
|
To store modal object of first yes/No modal |
Public filterType |
Type : string
|
filterType; |
Private headers |
Type : any
|
To define collection modal table header |
inviewLogs |
Type : []
|
Default value : []
|
inviewLogs |
loaderMessage |
Type : ILoaderMessage
|
loader message |
lockPopupData |
Type : object
|
lock popup data for locked contents |
Public modalService |
Type : SuiModalService
|
Public modalTemplate |
Type : ModalTemplate<literal type | string | string>
|
Decorators :
@ViewChild('modalTemplate')
|
Public navigationhelperService |
Type : NavigationHelperService
|
noResult |
Default value : false
|
To show / hide no result message when no result found |
noResultMessage |
Type : INoResultMessage
|
no result message |
pageLimit |
Type : number
|
Contains page limit of inbox list |
pageNumber |
Type : number
|
Default value : 1
|
Current page number of inbox list |
pager |
Type : IPagination
|
Contains returned object of the pagination service which is needed to show the pagination on all content view |
Private paginationService |
Type : PaginationService
|
For showing pagination on draft list |
query |
Type : string
|
value typed |
queryParams |
Type : any
|
route query param; |
Public redirectUrl |
Type : string
|
redirectUrl; |
Public resourceService |
Type : ResourceService
|
To call resource service which helps to use language constant |
route |
Type : Router
|
To navigate to other pages |
Public searchService |
Type : SearchService
|
Inherited from
WorkSpace
|
Defined in
WorkSpace:203
|
Private showCollectionLoader |
Type : boolean
|
Flag to show/hide loader on first modal |
showError |
Default value : false
|
To show / hide error |
showLoader |
Default value : true
|
To show / hide loader |
showLockedContentModal |
Default value : false
|
To show content locked modal |
sort |
Type : object
|
sort for filter; |
sortByOption |
Type : string
|
sortingOptions ; |
Public sortingOptions |
Type : Array<ISort>
|
sortingOptions ; |
state |
Type : string
|
state for content editior |
status |
Type : string
|
status for preselection; |
telemetryImpression |
Type : IImpressionEventInput
|
telemetryImpression |
Private toasterService |
Type : ToasterService
|
To show toaster(error, success etc) after any API calls |
totalCount |
Type : Number
|
totalCount of the list |
Public workSpaceService |
Type : WorkSpaceService
|
Inherited from
WorkSpace
|
Defined in
WorkSpace:205
|
Public userService |
Type : UserService
|
Inherited from
WorkSpace
|
Defined in
WorkSpace:26
|
import { combineLatest as observableCombineLatest, forkJoin } from 'rxjs';
import { Component, OnInit, ViewChild, AfterViewInit } from '@angular/core';
import { ActivatedRoute, Router } from '@angular/router';
import { WorkSpace } from '../../classes/workspace';
import { SearchService, UserService, ISort } from '@sunbird/core';
import {
ServerResponse, PaginationService, ConfigService, ToasterService, IPagination,
ResourceService, ILoaderMessage, INoResultMessage, IContents, NavigationHelperService
} from '@sunbird/shared';
import { WorkSpaceService } from '../../services';
import * as _ from 'lodash-es';
import { IImpressionEventInput } from '@sunbird/telemetry';
import { SuiModalService, TemplateModalConfig, ModalTemplate } from 'ng2-semantic-ui-v9';
import { debounceTime, map } from 'rxjs/operators';
import { ContentIDParam } from '../../interfaces/delteparam';
@Component({
selector: 'app-all-textbooks',
templateUrl: './all-textbooks.component.html'
})
export class AllTextbooksComponent extends WorkSpace implements OnInit, AfterViewInit {
@ViewChild('modalTemplate')
public modalTemplate: ModalTemplate<{ data: string }, string, string>;
/**
* state for content editior
*/
state: string;
/**
* To navigate to other pages
*/
route: Router;
/**
* To send activatedRoute.snapshot to router navigation
* service for redirection to draft component
*/
private activatedRoute: ActivatedRoute;
/**
* Contains unique contentIds id
*/
contentIds: string;
/**
* Contains list of published course(s) of logged-in user
*/
alltextbooks: Array<IContents> = [];
// pageLoadTime = new PageLoadTime()
/**
* To show / hide loader
*/
showLoader = true;
/**
* loader message
*/
loaderMessage: ILoaderMessage;
/**
* To show / hide no result message when no result found
*/
noResult = false;
/**
* lock popup data for locked contents
*/
lockPopupData: object;
/**
* To show content locked modal
*/
showLockedContentModal = false;
/**
* To show / hide error
*/
showError = false;
/**
* no result message
*/
noResultMessage: INoResultMessage;
/**
* For showing pagination on draft list
*/
private paginationService: PaginationService;
/**
* To get url, app configs
*/
public config: ConfigService;
/**
* Contains page limit of inbox list
*/
pageLimit: number;
/**
* Current page number of inbox list
*/
pageNumber = 1;
/**
* totalCount of the list
*/
totalCount: Number;
/**
status for preselection;
*/
status: string;
/**
route query param;
*/
queryParams: any;
/**
redirectUrl;
*/
public redirectUrl: string;
/**
filterType;
*/
public filterType: string;
/**
sortingOptions ;
*/
public sortingOptions: Array<ISort>;
/**
sortingOptions ;
*/
sortByOption: string;
/**
sort for filter;
*/
sort: object;
/**
* inviewLogs
*/
inviewLogs = [];
/**
* value typed
*/
query: string;
/**
* Contains returned object of the pagination service
* which is needed to show the pagination on all content view
*/
pager: IPagination;
/**
* To show toaster(error, success etc) after any API calls
*/
private toasterService: ToasterService;
/**
* telemetryImpression
*/
telemetryImpression: IImpressionEventInput;
/**
* To call resource service which helps to use language constant
*/
public resourceService: ResourceService;
/**
* To store all the collection details to be shown in collection modal
*/
public collectionData: Array<any>;
/**
* Flag to show/hide loader on first modal
*/
private showCollectionLoader: boolean;
/**
* To define collection modal table header
*/
private headers: any;
/**
* To store deleting content id
*/
private currentContentId: ContentIDParam;
/**
* To store deleteing content type
*/
private contentMimeType: string;
/**
* To store modal object of first yes/No modal
*/
private deleteModal: any;
/**
* To show/hide collection modal
*/
public collectionListModal = false;
/**
* Constructor to create injected service(s) object
Default method of Draft Component class
* @param {SearchService} SearchService Reference of SearchService
* @param {UserService} UserService Reference of UserService
* @param {Router} route Reference of Router
* @param {PaginationService} paginationService Reference of PaginationService
* @param {ActivatedRoute} activatedRoute Reference of ActivatedRoute
* @param {ConfigService} config Reference of ConfigService
*/
constructor(public searchService: SearchService,
public navigationhelperService: NavigationHelperService,
public workSpaceService: WorkSpaceService,
paginationService: PaginationService,
activatedRoute: ActivatedRoute,
route: Router, userService: UserService,
toasterService: ToasterService, resourceService: ResourceService,
config: ConfigService, public modalService: SuiModalService) {
super(searchService, workSpaceService, userService);
this.paginationService = paginationService;
this.route = route;
this.activatedRoute = activatedRoute;
this.toasterService = toasterService;
this.resourceService = resourceService;
this.config = config;
this.state = 'alltextbooks';
this.loaderMessage = {
'loaderMessage': this.resourceService.messages.stmsg.m0127,
};
this.sortingOptions = this.config.dropDownConfig.FILTER.RESOURCES.sortingOptions;
}
ngOnInit() {
this.filterType = this.config.appConfig.alltextbooks.filterType;
this.redirectUrl = this.config.appConfig.alltextbooks.inPageredirectUrl;
observableCombineLatest(
this.activatedRoute.params,
this.activatedRoute.queryParams).pipe(
debounceTime(10),
map(([params, queryParams]) => ({ params, queryParams })
))
.subscribe(bothParams => {
if (bothParams.params.pageNumber) {
this.pageNumber = Number(bothParams.params.pageNumber);
}
this.queryParams = bothParams.queryParams;
this.query = this.queryParams['query'];
this.fetchAllTextBooks(this.config.appConfig.WORKSPACE.PAGE_LIMIT, this.pageNumber, bothParams);
});
}
/**
* This method sets the make an api call to get all textbooks with page No and offset
*/
fetchAllTextBooks(limit: number, pageNumber: number, bothParams) {
this.showLoader = true;
if (bothParams.queryParams.sort_by) {
const sort_by = bothParams.queryParams.sort_by;
const sortType = bothParams.queryParams.sortType;
this.sort = {
[sort_by]: _.toString(sortType)
};
} else {
this.sort = { lastUpdatedOn: this.config.appConfig.WORKSPACE.lastUpdatedOn };
}
const preStatus = ['Draft', 'FlagDraft', 'Review', 'Processing', 'Live', 'Unlisted', 'FlagReview'];
const searchParams = {
filters: {
status: bothParams.queryParams.status ? bothParams.queryParams.status : preStatus,
contentType: this.config.appConfig.WORKSPACE.adminHandledContentType,
objectType: this.config.appConfig.WORKSPACE.objectType,
board: bothParams.queryParams.board,
subject: bothParams.queryParams.subject,
medium: bothParams.queryParams.medium,
gradeLevel: bothParams.queryParams.gradeLevel,
channel: this.userService.channel
},
limit: limit,
offset: (pageNumber - 1) * (limit),
query: _.toString(bothParams.queryParams.query),
sort_by: this.sort
};
this.searchContentWithLockStatus(searchParams).subscribe(
(data: ServerResponse) => {
if (data.result.count && !_.isEmpty(data.result.content)) {
this.alltextbooks = data.result.content;
this.totalCount = data.result.count;
this.pager = this.paginationService.getPager(data.result.count, pageNumber, limit);
this.showLoader = false;
this.noResult = false;
} else {
this.showError = false;
this.noResult = true;
this.showLoader = false;
this.noResultMessage = {
'messageText': 'messages.stmsg.m0006'
};
}
},
(err: ServerResponse) => {
this.showLoader = false;
this.noResult = false;
this.showError = true;
this.toasterService.error(this.resourceService.messages.fmsg.m0081);
}
);
}
public deleteConfirmModal(contentIds, mimeType) {
this.currentContentId = contentIds;
this.contentMimeType = mimeType;
this.showCollectionLoader = false;
const config = new TemplateModalConfig<{ data: string }, string, string>(this.modalTemplate);
config.isClosable = false;
config.size = 'small';
config.transitionDuration = 0;
config.mustScroll = true;
this.modalService
.open(config);
}
/**
* This method checks whether deleting content is linked to any collections, if linked to collection displays collection list pop modal.
*/
public checkLinkedCollections(modal) {
if (!_.isUndefined(modal)) {
this.deleteModal = modal;
}
this.showCollectionLoader = false;
if (this.contentMimeType === 'application/vnd.ekstep.content-collection') {
this.deleteContent(this.currentContentId);
return;
}
this.getLinkedCollections(this.currentContentId)
.subscribe((response) => {
const count = _.get(response, 'result.count');
if (!count) {
this.deleteContent(this.currentContentId);
return;
}
this.showCollectionLoader = true;
const collections = _.get(response, 'result.content', []);
const channels = _.map(collections, (collection) => {
return _.get(collection, 'channel');
});
const channelMapping = {};
forkJoin(_.map(channels, (channel: string) => {
return this.getChannelDetails(channel);
})).subscribe((forkResponse) => {
this.collectionData = [];
_.forEach(forkResponse, channelResponse => {
const channelId = _.get(channelResponse, 'result.channel.code');
const channelName = _.get(channelResponse, 'result.channel.name');
channelMapping[channelId] = channelName;
});
_.forEach(collections, collection => {
const obj = _.pick(collection, ['contentType', 'board', 'medium', 'name', 'gradeLevel', 'subject', 'channel']);
obj['channel'] = channelMapping[obj.channel];
this.collectionData.push(obj);
});
this.headers = {
type: 'Type',
name: 'Name',
subject: 'Subject',
grade: 'Grade',
medium: 'Medium',
board: 'Board',
channel: 'Tenant Name'
};
if (!_.isUndefined(modal)) {
this.deleteModal.deny();
}
this.collectionListModal = true;
},
(error) => {
this.toasterService.error(_.get(this.resourceService, 'messages.emsg.m0014'));
console.log(error);
});
},
(error) => {
this.toasterService.error(_.get(this.resourceService, 'messages.emsg.m0015'));
console.log(error);
});
}
/**
* This method deletes content using the content id.
*/
deleteContent(contentId) {
this.showLoader = true;
this.loaderMessage = {
'loaderMessage': this.resourceService.messages.stmsg.m0034,
};
this.delete(contentId).subscribe(
(data: ServerResponse) => {
this.showLoader = false;
this.alltextbooks = this.removeAllMyContent(this.alltextbooks, contentId);
if (this.alltextbooks.length === 0) {
this.ngOnInit();
}
this.toasterService.success(this.resourceService.messages.smsg.m0006);
},
(err: ServerResponse) => {
this.showLoader = false;
this.toasterService.error(this.resourceService.messages.fmsg.m0022);
}
);
if (!_.isUndefined(this.deleteModal)) {
this.deleteModal.deny();
}
}
/**
* This method helps to navigate to different pages.
* If page number is less than 1 or page number is greater than total number
* of pages is less which is not possible, then it returns.
*
* @param {number} page Variable to know which page has been clicked
*
* @example navigateToPage(1)
*/
navigateToPage(page: number): undefined | void {
if (page < 1 || page > this.pager.totalPages) {
return;
}
this.pageNumber = page;
this.route.navigate(['workspace/content/alltextbooks', this.pageNumber], { queryParams: this.queryParams });
}
contentClick(content) {
console.log(content);
if (content.originData) {
const originData = JSON.parse(content.originData);
if (originData.copyType === 'shallow') {
const errMsg = (this.resourceService.messages.emsg.m1414).replace('{instance}', originData.organisation[0]);
this.toasterService.error(errMsg);
return;
}
}
if (_.size(content.lockInfo)) {
this.lockPopupData = content;
this.showLockedContentModal = true;
} else {
const status = content.status.toLowerCase();
if (status === 'processing') {
return;
}
if (status === 'draft') { // only draft state contents need to be locked
this.workSpaceService.navigateToContent(content, this.state);
} else {
this.workSpaceService.navigateToContent(content, this.state);
}
}
}
public onCloseLockInfoPopup () {
this.showLockedContentModal = false;
}
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,
subtype: this.activatedRoute.snapshot.data.telemetry.subtype,
uri: this.activatedRoute.snapshot.data.telemetry.uri + '/' + this.activatedRoute.snapshot.params.pageNumber,
visits: this.inviewLogs,
duration: this.navigationhelperService.getPageLoadTime()
}
};
this.inview({ inview: [] });
});
}
inview(event) {
_.forEach(event.inview, (inview, key) => {
const obj = _.find(this.inviewLogs, (o) => {
return o.objid === inview.data.identifier;
});
if (obj === undefined) {
this.inviewLogs.push({
objid: inview.data.identifier,
objtype: inview.data.contentType,
index: inview.id
});
}
});
this.telemetryImpression.edata.visits = this.inviewLogs;
this.telemetryImpression.edata.subtype = 'pageexit';
this.telemetryImpression = Object.assign({}, this.telemetryImpression);
}
removeAllMyContent(contentList, requestData) {
return contentList.filter((content) => {
return requestData.indexOf(content.identifier) === -1;
});
}
}
<app-workspace-content-filter ></app-workspace-content-filter>
<div class="twelve wide column mt-20" *ngIf="showLoader ">
<app-loader [data]="loaderMessage"></app-loader>
</div>
<div *ngIf="noResult && !showLoader">
<app-no-result [data]="noResultMessage"></app-no-result>
</div>
<table class="ui upForReviewTable table" *ngIf="alltextbooks.length > 0 && !showLoader && !noResult ">
<thead>
<tr>
<th class="six wide UpReviewTableHeader">{{ resourceService?.frmelmnts?.lbl?.contentLabel}}
</th>
<th class="four wide UpReviewTableHeader">{{ resourceService?.frmelmnts?.lbl?.lastupdatedCaps}}
</th>
<th class="two wide UpReviewTableHeader">{{ resourceService?.frmelmnts?.lbl?.status}}
</th>
<th class="two wide UpReviewTableHeader">
</th>
<th class="two wide UpReviewTableHeader">
</th>
</tr>
</thead>
<tbody [appTelemetryImpression]="telemetryImpression" [throttle]="[1000]" [trigger]="alltextbooks">
<tr class="UpForReviewListHover cursor-pointer" *ngFor="let content of alltextbooks let i = index;" [id]="i" [data]="content"
appTelemetryInteract [telemetryInteractObject]="{id:content.identifier,type:content.contentType,ver:content.pkgVersion ? content.pkgVersion.toString(): '1.0' }"
[telemetryInteractEdata]="{id:'alltextbooks',type:'click',pageid:'alltextbooks'}">
<td tabindex="0" (click)="contentClick(content)">
<h5 class="ui image header">
<img src="{{content.appIcon || 'assets/images/default.png' | cdnprefixurl}}" class="ui tiny image UpReviewTinyImage">
<div class="content ">
<div class="UpReviewHeader">{{content.name | slice:0:30}}
<i *ngIf="content.name.length > 30">...</i>
</div>
<div class="UpReviewSubHeader">{{(content?.contentType).toLowerCase() === 'selfassess' ? resourceService?.frmelmnts?.lbl?.courseassessment : content?.contentType}}
</div>
</div>
</h5>
</td>
<td>
<h5 class="ui image header">
<div class="content">
<div class="UpReviewSubHeader">{{content.lastUpdatedOn | fromNow }}
</div>
</div>
</h5>
</td>
<td class="UpForReviewStatusOrange">{{content.status}}</td>
<td>
<i *ngIf="!(content.pkgVersion && content.pkgVersion > 0 && (content.status === 'Review' || content.status === 'Draft'))" appTelemetryInteract [telemetryInteractObject]="{id:content.identifier,type:content.contentType,ver:content.pkgVersion ? content.pkgVersion.toString(): '1.0' }"
[telemetryInteractEdata]="{id:'deleteContent',type:'click',pageid:'alltextbooks'}" class="trash large icon" tabindex="0" (click)="deleteConfirmModal(content.identifier, content.mimeType); $event.stopPropagation()">
</i>
</td>
<td>
<span *ngIf="content.lockInfo" matTooltip="{{resourceService?.frmelmnts?.lbl?.lockPopupTitle | interpolate:'{collaborator}':content?.lockInfo?.creatorInfo?.name | interpolate:'{contentName}':content?.name}}" [matTooltipPosition]="'left'">
<i class="lock icon large" ></i>
</span>
</td>
</tr>
</tbody>
</table>
<div class="ui grid">
<div class="two wide column"></div>
<div class="ten wide column">
<div class="pb-10" *ngIf="alltextbooks && totalCount > config.appConfig.WORKSPACE.PAGE_LIMIT && !showLoader && !showError && !noResult">
<div class="ui pagination menu mt-10 right-floated p-0 " *ngIf="pager.pages.length ">
<a [ngClass]="{disabled:pager.currentPage===1 }" class="item " tabindex="0" (click)="navigateToPage(1) ">First</a>
<a [ngClass]="{disabled:pager.currentPage===1 }" class="item " tabindex="0" (click)="navigateToPage(pager.currentPage - 1)">Previous</a>
<a *ngFor="let page of pager.pages" [ngClass]="{active:pager.currentPage===page}" tabindex="0" (click)="navigateToPage(page)" class="item">{{page}}</a>
<a [ngClass]="{disabled:pager.currentPage=== pager.totalPages}" tabindex="0" (click)="navigateToPage(pager.currentPage + 1)" class="item">Next</a>
<a [ngClass]="{disabled:pager.currentPage=== pager.totalPages}" tabindex="0" (click)="navigateToPage(pager.totalPages)" class="item ">Last</a>
</div>
</div>
</div>
</div>
<ng-template let-context let-modal="modal" #modalTemplate>
<div class="sb-modal sb-error">
<div class="ui modal visible active small">
<i class="icon close" (click)="modal.deny('denied')" tabindex="0"></i>
<!--Header-->
<div class="sb-modal-header">
{{resourceService?.frmelmnts?.lbl?.deletecontent}}
</div>
<!--/Header-->
<!--Content-->
<div class="sb-modal-content">
<p [class.sb-color-gray-100]="showCollectionLoader">{{resourceService?.frmelmnts?.lbl?.deleteconfirm}}</p>
<div class="py-30">
<div *ngIf="showCollectionLoader" class="sb-loader sb-gray-loader pb-20"></div>
</div>
</div>
<!--/Content-->
<!--Actions-->
<div class="sb-modal-actions flex-jc-space-between">
<div>
<button
class="sb-btn sb-btn-normal sb-btn-outline-error mr-10"
[class.fadInButton]="showCollectionLoader"
tabindex="0" (click)="modal.deny('denied')"
[disabled]="showCollectionLoader"
>
{{resourceService?.frmelmnts?.btn?.no}}
</button>
<button
class="sb-btn sb-btn-normal sb-btn-error ui disabled"
[class.fadInButton]="showCollectionLoader"
tabindex="0" (click)="checkLinkedCollections(modal)"
autofocus
[disabled]="showCollectionLoader"
>
{{resourceService?.frmelmnts?.btn?.yes}}
</button>
</div>
<div *ngIf="showCollectionLoader">Scanning for linked content</div>
</div>
<!--/Actions-->
</div>
</div>
</ng-template>
<sui-modal *ngIf="collectionListModal" [mustScroll]="true" [isClosable]="true" [transitionDuration]="0" [size]="'large'"
class="sb-modal custom-lg-modal" (dismissed)="this.collectionListModal = false" #modal>
<div class="sb-modal-header">
</div>
<div class="sb-modal-content">
<h5 class="font-weight-bold sb-color-red">{{resourceService?.frmelmnts?.lbl?.linkedContentErrorMessage}}</h5>
<div class="sb-table-responsive">
<table aria-hidden="true" class="sb-table sb-table-striped sb-table-sortable sb-table-blue-strip">
<thead>
<th class="w-10" id="contentType">{{headers.type}}</th>
<th class="w-30" id="contentName">{{headers.name}}</th>
<th class="w-10" id="contentSubject">{{headers.subject}}</th>
<th class="w-10" id="contentGrade">{{headers.grade}}</th>
<th class="w-10" id="contentMedium">{{headers.medium}}</th>
<th class="w-10" id="contentBoard">{{headers.board}}</th>
<th class="w-20" id="contentchannel">{{headers.channel}}</th>
</thead>
<tbody>
<tr *ngFor = "let row of collectionData">
<td class="white-space-inherit">{{row['contentType']}}</td>
<td class="white-space-inherit font-weight-bold">{{row['name']}}</td>
<td class="white-space-inherit">{{row['subject']?.join(", ") || '-'}}</td>
<td class="white-space-inherit">{{row['gradeLevel']?.join(", ") || '-'}}</td>
<td class="white-space-inherit">{{row['medium']?.join(", ") || '-'}}</td>
<td class="white-space-inherit">{{row['board']}}</td>
<td class="white-space-inherit">{{row['channel']}}</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="sb-modal-actions">
<button class="sb-btn sb-btn-normal sb-btn-primary" tabindex="0" (click)="modal.deny('denied')">
{{resourceService?.frmelmnts?.btn?.close}}
</button>
</div>
</sui-modal>
<app-contentlock-info-popup [content]="lockPopupData" (closeEvent)="onCloseLockInfoPopup($event)" *ngIf="showLockedContentModal"></app-contentlock-info-popup>