File

src/app/modules/workspace/components/published/published.component.ts

Description

The published component search for all the published component

Extends

WorkSpace

Implements

OnInit AfterViewInit

Metadata

Index

Properties
Methods

Constructor

constructor(modalService: SuiModalService, searchService: SearchService, workSpaceService: WorkSpaceService, frameworkService: FrameworkService, paginationService: PaginationService, activatedRoute: ActivatedRoute, route: Router, userService: UserService, toasterService: ToasterService, resourceService: ResourceService, config: ConfigService, navigationhelperService: NavigationHelperService, coursesService: CoursesService)

Constructor to create injected service(s) object Default method of Draft Component class

Parameters :
Name Type Optional Description
modalService SuiModalService No
searchService SearchService No
workSpaceService WorkSpaceService No
frameworkService FrameworkService No
paginationService PaginationService No

Reference of PaginationService

activatedRoute ActivatedRoute No

Reference of ActivatedRoute

route Router No

Reference of Router

userService UserService No
toasterService ToasterService No
resourceService ResourceService No
config ConfigService No

Reference of ConfigService

navigationhelperService NavigationHelperService No
coursesService CoursesService No

Methods

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 :
Name Optional
modal No
Returns : void
contentClick
contentClick(param, content)

This method launch the content editior

Parameters :
Name Optional
param No
content No
Returns : void
Public deleteContent
deleteContent(contentIds)

This method deletes content using the content id.

Parameters :
Name Optional
contentIds No
Returns : void
fetchPublishedContent
fetchPublishedContent(limit: number, pageNumber: number, bothParams?: object)

This method sets the make an api call to get all Published content with page No and offset

Parameters :
Name Type Optional
limit number No
pageNumber number No
bothParams object Yes
Returns : void
getCourseQRCsv
getCourseQRCsv()
Returns : void
inview
inview(event)

get inview Data

Parameters :
Name Optional
event No
Returns : void
isPublishedCourse
isPublishedCourse()
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 :
Name Type Optional Description
page number No

Variable to know which page has been clicked

Example :
navigateToPage(1)
Returns : undefined | void
ngAfterViewInit
ngAfterViewInit()
Returns : void
ngOnInit
ngOnInit()
Returns : void
delete
delete(contentIds)
Inherited from WorkSpace
Defined in WorkSpace:111

Delete Api call .

Parameters :
Name Optional
contentIds No
Returns : any
getBatches
getBatches(searchParams)
Inherited from WorkSpace
Defined in WorkSpace:128

Batchlist Api call

Parameters :
Name Optional
searchParams No
Returns : any
getChannelDetails
getChannelDetails(channelId)
Inherited from WorkSpace
Defined in WorkSpace:164

get channel Api call

Parameters :
Name Optional
channelId No
Returns : any
getLinkedCollections
getLinkedCollections(contentId: ContentIDParam)
Inherited from WorkSpace
Defined in WorkSpace:157

search collection Api call

Parameters :
Name Type Optional
contentId ContentIDParam No
Returns : any
handleContentLockError
handleContentLockError(errObj)
Inherited from WorkSpace
Defined in WorkSpace:142

handle content lock api error

Parameters :
Name Optional
errObj No
Returns : string
lockContent
lockContent(content)
Inherited from WorkSpace
Defined in WorkSpace:97

this call will prepare reuest object and call lock api

Parameters :
Name Optional
content No
Returns : any
removeContent
removeContent(contentList, requestData)
Inherited from WorkSpace
Defined in WorkSpace:120

Method to remove content localcaly

Parameters :
Name Optional
contentList No
requestData No
Returns : any
search
search(searchParams)
Inherited from WorkSpace
Defined in WorkSpace:33

Search Api call

Parameters :
Name Optional
searchParams No
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 :
Name Optional
searchParams No
Returns : any
UserList
UserList(searchParams)
Inherited from WorkSpace
Defined in WorkSpace:135

userList Api call

Parameters :
Name Optional
searchParams No
Returns : any

Properties

Private activatedRoute
Type : ActivatedRoute

To send activatedRoute.snapshot to router navigation service for redirection to draft component

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

Public coursesService
Type : CoursesService
Private currentContentId
Type : ContentIDParam

To store deleting content id

Private deleteModal
Type : any

To store modal object of first yes/No modal

Public frameworkService
Type : FrameworkService
Private headers
Type : any

To define collection modal table header

inviewLogs
Type : []
Default value : []

inviewLogs

Public isQuestionSetEnabled
Type : boolean

To check if questionSet enabled

loaderMessage
Type : ILoaderMessage

loader message

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
Default value : 9

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 inbox view

Private paginationService
Type : PaginationService

For showing pagination on draft list

publishedContent
Type : Array<IContents>
Default value : []

Contains list of published conten(s) of logged-in user

query
Type : string
queryParams
Type : object
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:182
Private showCollectionLoader
Type : boolean

Flag to show/hide loader on first modal

showCourseQRCodeBtn
Default value : false
showError
Default value : false

To show / hide error when no result found

showLoader
Default value : true

To show / hide loader

sort
Type : object
state
Type : string

state for content editior

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:183
Public userService
Type : UserService
Inherited from WorkSpace
Defined in WorkSpace:26
import { debounceTime, map } from 'rxjs/operators';
import { Component, OnInit, ViewChild, AfterViewInit } from '@angular/core';
import { ActivatedRoute, Router } from '@angular/router';
import { WorkSpace } from '../../classes/workspace';
import { SearchService, UserService, CoursesService, FrameworkService } from '@sunbird/core';
import {
  ServerResponse, ConfigService, PaginationService, IPagination,
  IContents, ToasterService, ResourceService, ILoaderMessage, INoResultMessage,
  NavigationHelperService
} from '@sunbird/shared';
import { WorkSpaceService } from '../../services';
import * as _ from 'lodash-es';
import { IImpressionEventInput } from '@sunbird/telemetry';
import { combineLatest, forkJoin } from 'rxjs';
import { ContentIDParam } from '../../interfaces/delteparam';

/**
 * Interface for passing the configuartion for modal
*/

import { SuiModalService, TemplateModalConfig, ModalTemplate } from 'ng2-semantic-ui-v9';

/**
 * The published  component search for all the published component
*/

@Component({
  selector: 'app-published',
  templateUrl: './published.component.html',
  styleUrls: ['./published.component.scss']
})
export class PublishedComponent 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 conten(s) of logged-in user
  */
  publishedContent: Array<IContents> = [];
  /**
     * To show / hide loader
  */
  showLoader = true;

  /**
   * loader message
  */
  loaderMessage: ILoaderMessage;

  showCourseQRCodeBtn = false;

  /**
   * To show / hide error when no result found
  */
  showError = false;
  /**
    * To show / hide no result message when no result found
  */
  noResult = false;
  /**
   * no result  message
  */
  noResultMessage: INoResultMessage;
  /**
    * For showing pagination on draft list
  */
  private paginationService: PaginationService;

  /**
     * Contains page limit of inbox list
  */
  pageLimit = 9;

  /**
    * Current page number of inbox list
  */
  pageNumber = 1;
  /**
  * totalCount of the list
   */
  totalCount: Number;

  /**
    * Contains returned object of the pagination service
    * which is needed to show the pagination on inbox view
  */
  pager: IPagination;

  /**
  * To show toaster(error, success etc) after any API calls
  */
  private toasterService: ToasterService;

  /**
  * To get url, app configs
  */
  public config: ConfigService;

  /**
  * To call resource service which helps to use language constant
  */
  public resourceService: ResourceService;
  /**
	 * telemetryImpression
	*/
  telemetryImpression: IImpressionEventInput;
  /**
	 * inviewLogs
	*/
  inviewLogs = [];
  queryParams: object;
  query: string;
  sort: object;

   /**
  * 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;
  /**
   * To check if questionSet enabled
   */
   public isQuestionSetEnabled: boolean;
  /**
    * 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 modalService: SuiModalService, public searchService: SearchService,
    public workSpaceService: WorkSpaceService,
    public frameworkService: FrameworkService,
    paginationService: PaginationService,
    activatedRoute: ActivatedRoute,
    route: Router, userService: UserService,
    toasterService: ToasterService, resourceService: ResourceService,
    config: ConfigService, public navigationhelperService: NavigationHelperService,
    public coursesService: CoursesService) {
    super(searchService, workSpaceService, userService);
    this.paginationService = paginationService;
    this.route = route;
    this.activatedRoute = activatedRoute;
    this.toasterService = toasterService;
    this.resourceService = resourceService;
    this.config = config;
    this.state = 'published';
  }

  ngOnInit() {
    this.workSpaceService.questionSetEnabled$.subscribe(
      (response: any) => {
          this.isQuestionSetEnabled = response?.questionSetEnablement;
        }
    );
    combineLatest(
      this.activatedRoute.params,
      this.activatedRoute.queryParams).pipe(
        debounceTime(100),
        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.fetchPublishedContent(this.config.appConfig.WORKSPACE.PAGE_LIMIT, this.pageNumber, bothParams);
      });
      this.isPublishedCourse();
  }
  isPublishedCourse() {
    const searchParams = {
      filters: {
        status: ['Live'],
        createdBy: this.userService.userid,
        contentType: ['Course'],
        objectType: this.config.appConfig.WORKSPACE.objectType,
      },
      sort_by: { lastUpdatedOn: 'desc' }
    };
      this.searchService.compositeSearch(searchParams).subscribe((data: ServerResponse) => {
        if (data?.result?.content && data?.result?.content?.length > 0) {
         this.showCourseQRCodeBtn = true;
       }
      });
  }
  getCourseQRCsv() {
    this.coursesService.getQRCodeFile().subscribe((data: any) => {
      const FileURL = _.get(data, 'result.fileUrl');
      if (FileURL) {
        window.open (FileURL, '_blank');
      }
    },
    (err: ServerResponse) => {
      this.toasterService.error(this.resourceService.messages.fmsg.m0095);
    });
  }
  /**
    * This method sets the make an api call to get all Published content with page No and offset
    */
  fetchPublishedContent(limit: number, pageNumber: number, bothParams?: object) {
    this.showLoader = true;
    this.pageNumber = pageNumber;
    this.pageLimit = limit;
    this.publishedContent = [];
    this.totalCount = 0;
    this.noResult = false;
    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 };
    }
    // tslint:disable-next-line:max-line-length
    const primaryCategories = _.compact(_.concat(this.frameworkService['_channelData'].contentPrimaryCategories, this.frameworkService['_channelData'].collectionPrimaryCategories));
    const searchParams = {
      filters: {
        status: ['Live'],
        createdBy: this.userService.userid,
        objectType: this.isQuestionSetEnabled ? this.config.appConfig.WORKSPACE.allowedObjectType : this.config.appConfig.WORKSPACE.objectType,
        // tslint:disable-next-line:max-line-length
        primaryCategory: _.get(bothParams, 'queryParams.primaryCategory') || (!_.isEmpty(primaryCategories) ? primaryCategories : this.config.appConfig.WORKSPACE.primaryCategory),
        // mimeType: this.config.appConfig.WORKSPACE.mimeType,
        board: bothParams['queryParams'].board,
        subject: bothParams['queryParams'].subject,
        medium: bothParams['queryParams'].medium,
        gradeLevel: bothParams['queryParams'].gradeLevel
      },
      limit: this.pageLimit,
      offset: (this.pageNumber - 1) * (this.pageLimit),
      query: _.toString(bothParams['queryParams'].query),
      sort_by: this.sort
    };
    this.loaderMessage = {
      'loaderMessage': this.resourceService.messages.stmsg.m0021,
    };
    this.search(searchParams).subscribe(
      (data: ServerResponse) => {
        const allContent= this.workSpaceService.getAllContent(data, this.isQuestionSetEnabled);
        if (allContent.length > 0) {
          this.publishedContent = allContent;
          this.totalCount = data.result.count;
          this.pager = this.paginationService.getPager(data.result.count, this.pageNumber, this.pageLimit);
          const constantData = this.config.appConfig.WORKSPACE.Published.constantData;
          const metaData = this.config.appConfig.WORKSPACE.Published.metaData;
          const dynamicFields = this.config.appConfig.WORKSPACE.Published.dynamicFields;
          this.publishedContent = this.workSpaceService.getDataForCard(allContent, constantData, dynamicFields, metaData);
          this.showLoader = false;
        } else {
          this.showError = false;
          this.showLoader = false;
          this.noResult = true;
          this.noResultMessage = {
            'messageText': 'messages.stmsg.m0022'
          };
        }
      },
      (err: ServerResponse) => {
        this.showLoader = false;
        this.noResult = false;
        this.showError = true;
        this.toasterService.error(this.resourceService.messages.fmsg.m0013);
      }
    );
  }
  /**
    * This method launch the content editior
  */
  contentClick(param, content) {
    this.contentMimeType = content.metaData.mimeType;
    if (param.data && param.data.originData) {
      const originData = JSON.parse(param.data.originData);
      if (originData.copyType === 'shallow') {
        const errMsg = (this.resourceService.messages.emsg.m1414).replace('{instance}', originData.organisation[0]);
        this.toasterService.error(errMsg);
        return;
      }
    }
    if (param.action.eventName === 'delete') {
      this.currentContentId = param.data.metaData.identifier;
      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);
      setTimeout(() => {
        let element = document.getElementsByTagName('sui-modal');
        if(element && element.length > 0)
          element[0].className = 'sb-modal';
      }, 10);
      this.showCollectionLoader = false;
    } else {
      this.workSpaceService.navigateToContent(param.data.metaData, this.state);
    }
  }

  /**
  * 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(this.deleteModal)) {
              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.
  */
  public deleteContent(contentIds) {
        this.showLoader = true;
        this.loaderMessage = {
          'loaderMessage': this.resourceService.messages.stmsg.m0034,
        };
        this.delete(contentIds).subscribe(
          (data: ServerResponse) => {
            this.showLoader = false;
            this.publishedContent = this.removeContent(this.publishedContent, contentIds);
            if (this.publishedContent.length === 0) {
              this.fetchPublishedContent(this.config.appConfig.WORKSPACE.PAGE_LIMIT, this.pageNumber);
            }
            this.toasterService.success(this.resourceService.messages.smsg.m0006);
          },
          (err: ServerResponse) => {
            this.showLoader = false;
            this.toasterService.success(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)
  */
  /**
* 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/published', this.pageNumber], { queryParams: this.queryParams });
  }

  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: [] });
    });
  }

  /**
  * get inview  Data
  */
  inview(event) {
    _.forEach(event.inview, (inview, key) => {
      const obj = _.find(this.inviewLogs, (o) => {
        return o.objid === inview.data.metaData.identifier;
      });
      if (obj === undefined) {
        this.inviewLogs.push({
          objid: inview.data.metaData.identifier,
          objtype: inview.data.metaData.contentType,
          index: inview.id
        });
      }
    });
    this.telemetryImpression.edata.visits = this.inviewLogs;
    this.telemetryImpression.edata.subtype = 'pageexit';
    this.telemetryImpression = Object.assign({}, this.telemetryImpression);
  }
}
<app-workspace-content-filter ></app-workspace-content-filter>
<!-- Loader -->
<div class="twelve wide column mt-20" *ngIf="showLoader">
  <app-loader [data] ="loaderMessage"></app-loader>
</div>

<div class="ui grid" *ngIf="!showLoader">
  <div *ngIf="showCourseQRCodeBtn" class="ml-auto mb-16">
    <button class="sb-btn sb-btn-normal sb-btn-secondary my-16" appTelemetryInteract 
      [telemetryInteractObject]="{id:course-qrdownload,type:'course-qrcode',ver:'1.0'}" 
      [telemetryInteractEdata]="{id:'download-qrcsv',type:'click',pageid:'course-qrcode'}" 
      [telemetryInteractCdata]="[{id: 'course:download:QRCode', type: 'Feature'},{id: 'SB-13798', type: 'Task'}]" tabindex="0" (click)=getCourseQRCsv();
      matTooltip="{{resourceService.frmelmnts?.lbl?.downloadQRCode?.tooltip}}" [matTooltipPosition]="'above'">
      {{resourceService?.frmelmnts?.lbl?.downloadCourseQRCode}}
  </button>
  </div> 
  <div class="twelve wide column" [appTelemetryImpression]="telemetryImpression">
    <div class="ui stackable three column grid" [throttle]="[1000]" [trigger]="publishedContent">
      <div  *ngFor="let content of publishedContent;let i = index;" [id]="i" [data]="content" class="column py-5 pl-10">
       <app-card-creation [data]="content" (clickEvent)="contentClick($event,content)"></app-card-creation>
      </div>
    </div>
    <div *ngIf="noResult">
      <app-no-result [data]="noResultMessage"></app-no-result>
    </div>
  </div>
</div>

<!--pagination -->
<div class="ui grid">
  <div class="two wide column"></div>
  <div class="ten wide column pt-0">
    <div class="pb-10" *ngIf="publishedContent && totalCount > config.appConfig.WORKSPACE.PAGE_LIMIT && !showLoader && !showError">
      <div class="ui pagination menu mt-10 right-floated pt-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>

<!-- Delete confirm Modal-->
<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">{{resourceService?.frmelmnts?.lbl?.scanningLinkedCollection}}</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>

./published.component.scss

@use "@project-sunbird/sb-styles/assets/mixins/mixins" as *;

.sb-gray-loader{
        &:after{
         content: '';
         width: 2rem;
         height: 2rem;
         border-radius: 50%;
         border: 0.125rem solid;
         border-color: var(--gray-100) var(--gray-100) transparent;
         -webkit-animation: loader 0.5s infinite;
         animation: loader 0.5s infinite;
         position: absolute;
         top: 50%;
         left: 50%;
         transform: translate(-50%, -50%);
        }
 }
 
 .sb-table-blue-strip{
         background: none;
         border: none;
         border-bottom: solid calculateRem(1px) var(--primary-400);
         th{
                 background: none;
                 color: var(--primary-400);
                 border-bottom: solid calculateRem(1px)  var(--primary-400);    
         }
         tbody{
                 tr:nth-child(odd){
                         background:  var(--primary-100);
                 }
                 tr:nth-child(even){
                         background: var(--white);
                 }
                 tr{
                         td:first-child{
                            border-left: solid calculateRem(1px)  var(--primary-400);     
                         }
                         td:last-child{
                                 border-right:  solid calculateRem(1px) var(--primary-400);     
                         }
                 }
         }
 }

 .bt-0{
         border-top: none;
 }

 .fadInButton{
         opacity:0.5 !important;
 }

 .white-space-inherit {
        white-space: inherit !important;
        word-wrap: break-word;
        max-width: calculateRem(1px);
}

.max-h-360 {
        max-height:calculateRem(360px);
}
Legend
Html element
Component
Html element with directive

results matching ""

    No results matching ""