File

src/app/modules/public/module/offline/components/content-manager-info-pop-up/content-manager-info-pop-up.component.ts

Implements

OnInit

Metadata

Index

Properties
Methods
Inputs
Outputs

Constructor

constructor(resourceService: ResourceService, router: Router)
Parameters :
Name Type Optional
resourceService ResourceService No
router Router No

Inputs

drives
Type : any
failedList
Type : any
showContentChangeWarning
Type : boolean

Outputs

dismissed
Type : EventEmitter
submit
Type : EventEmitter

Methods

closeModal
closeModal(selectedDrive?: string)
Parameters :
Name Type Optional
selectedDrive string Yes
Returns : void
getDriveSelectInteractEdata
getDriveSelectInteractEdata(selectedDrive)
Parameters :
Name Optional
selectedDrive No
ngOnInit
ngOnInit()
Returns : void
setPopupInteractEdata
setPopupInteractEdata()
Returns : void

Properties

modal
Decorators :
@ViewChild('modal')
popupInteractEdata
Type : IInteractEventEdata
Public resourceService
Type : ResourceService
Public router
Type : Router
selectedDrive
Type : string
import { Component, OnInit, Input, ViewChild, Output, EventEmitter } from '@angular/core';
import { ResourceService } from '@sunbird/shared';
import { IInteractEventEdata } from '@sunbird/telemetry';
import { Router } from '@angular/router';

@Component({
  selector: 'app-content-manager-info-pop-up',
  templateUrl: './content-manager-info-pop-up.component.html',
  styleUrls: ['./content-manager-info-pop-up.component.scss']
})
export class ContentManagerInfoPopUpComponent implements OnInit {

  @ViewChild('modal') modal;
  @Input() failedList;
  @Input() showContentChangeWarning: boolean;
  @Input() drives: any;
  @Output() dismissed = new EventEmitter<any>();
  @Output() submit = new EventEmitter<any>();

  selectedDrive: string;
  popupInteractEdata: IInteractEventEdata;
  constructor(public resourceService: ResourceService, public router: Router) { }

  ngOnInit() {
    this.setPopupInteractEdata();
  }

  closeModal(selectedDrive?: string) {
    this.modal.deny();
    this.dismissed.emit({ selectedDrive: selectedDrive });
  }

  getDriveSelectInteractEdata(selectedDrive) {
    const selectDriveInteractEdata: IInteractEventEdata = {
      id: 'content-location-select-button',
      type: 'click',
      pageid: this.router.url.split('/')[1] || 'library'
    };

    /* istanbul ignore else*/
    if (selectedDrive) {
      selectDriveInteractEdata['extra'] = {
        drive: selectedDrive.name
      };
    }

    return selectDriveInteractEdata;
  }

  setPopupInteractEdata() {
    this.popupInteractEdata = {
      id: 'low-disk-space-warning-popup-close-button',
      type: 'click',
      pageid: this.router.url.split('/')[1] || 'library'
    };
  }
}
<app-modal-wrapper [config]="{disableClose: true, size: 'normal'}" (dismiss)="closeModal()" #modal>
  <ng-template sbModalContent>
    <div class="sb-modal">
      <div class="transition ui dimmer page modals active visible">
        <div class="ui modal transition active visible normal">
          <div class="sb-modal-header">
            {{resourceService?.frmelmnts?.lbl?.desktop?.storageSpaceRunningOutHeader}}
          </div>

          <div class="sb-modal-content flex-dc">
            <div *ngIf="!showContentChangeWarning">
              <p class="text-center fmedium import-content">
                {{resourceService?.frmelmnts?.lbl?.desktop?.failedListLabel}}
              </p>
              <div class="custom-height">
                <div class="p-8 warning-ecar-list" *ngFor="let items of failedList">
                  {{items['name']}}
                </div>
              </div>
            </div>

            <div *ngIf="showContentChangeWarning">
              <p class="text-center fmedium import-content">
                {{resourceService?.messages?.stmsg?.changeContentLocationWarning }}
              </p>
              <div class="ui segments">
                <div class="ui segment">
                  <p>{{resourceService?.frmelmnts?.lbl?.chooseContentLocationDrive}}</p>
                  <sui-select class="selection min-width-18" [(ngModel)]="selectedDrive"
                    [placeholder]="resourceService?.frmelmnts?.lbl?.selectDrive" [options]="drives" #drivesOption
                    labelField="label">
                    <sui-select-option *ngFor="let drive of drivesOption?.filteredOptions" [value]="drive"
                      [ngClass]="{disabled: drive?.isCurrentContentLocation}" appTelemetryInteract
                      [telemetryInteractEdata]="getDriveSelectInteractEdata(drive)">
                    </sui-select-option>
                  </sui-select>
                </div>
              </div>
            </div>
          </div>

          <div class="sb-modal-actions">
            <button class="sb-btn sb-btn-normal sb-btn-outline-warning" tabindex="0" (click)="closeModal(selectedDrive)"
              appTelemetryInteract [telemetryInteractEdata]="popupInteractEdata">
              {{resourceService?.frmelmnts?.btn?.ok}}
            </button>
          </div>
        </div>
      </div>
    </div>
  </ng-template>
</app-modal-wrapper>

./content-manager-info-pop-up.component.scss

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

.warning-ecar-list {
    width: 100%;
    line-height: normal;
    border-top: calculateRem(1px) solid var(--rc-dddddd);
    font-size:calculateRem(14px);
}
.sb-modal-content .warning-ecar-list:last-of-type{
    border-bottom: calculateRem(1px) solid var(--rc-dddddd);
}
.import-content{
    color:var(--tertiary-100); 
}
.custom-height {
    max-height: calculateRem(320px);
    overflow-y: auto;
    width: 100%;
} 
.min-width-18 {
    min-width: 18em !important;
}
Legend
Html element
Component
Html element with directive

results matching ""

    No results matching ""