File

files-repository/files-repository-upload.component.ts

Metadata

Index

Properties
Methods
Outputs

Constructor

constructor(alertService: AlertService, gainsightService: GainsightService, filesService: FilesService)
Parameters :
Name Type Optional
alertService AlertService No
gainsightService GainsightService No
filesService FilesService No

Outputs

onClose
Type : EventEmitter<literal type>

Emits an event when modal is closed. uploaded indicates if any files were uploaded.

Methods

onFileDroppedEvent
onFileDroppedEvent(event: File[])
Parameters :
Name Type Optional
event File[] No
Returns : void
Async upload
upload()
Returns : Promise<void>

Properties

dropFilesHereMessage
Type : string
Default value : gettext('Drop files here')
filesToUpload
Type : File[]
isLoading
Default value : false
uploadProgress
Type : IFetchWithProgress[]
uploadProgress$
Type : Observable<IFetchWithProgress[]>
uploadSubscription
Type : Subscription
<div class="c8y-viewport-modal">
  <div class="modal-header dialog-header">
    <i c8yIcon="upload"></i>
    <h4
      id="modal-title"
      translate
    >
      Upload files
    </h4>
  </div>
  <div class="modal-inner-scroll">
    <div
      class="modal-body"
      id="modal-body"
    >
      <c8y-file-picker-form-control
        #filePicker
        [uploadInProgress]="isLoading"
        (dropped)="onFileDroppedEvent($event)"
        [uploadProgress]="uploadProgress"
      ></c8y-file-picker-form-control>
    </div>
  </div>
  <div class="card-footer separator d-flex j-c-center">
    <button
      class="btn btn-default"
      title="{{ 'Cancel' | translate }}"
      type="button"
      (click)="onClose.emit({ uploaded: false })"
      [disabled]="isLoading"
      translate
    >
      Cancel
    </button>
    <button
      class="btn btn-primary btn-form"
      title="{{ 'Upload' | translate }}"
      type="button"
      (click)="upload()"
      [disabled]="!filePicker.valid || isLoading"
      translate
      data-cy="c8y-files-repository-upload--upload"
    >
      Upload
    </button>
  </div>
</div>

results matching ""

    No results matching ""