Chocobozzz/PeerTube

View on GitHub
client/src/app/shared/standalone-upload/upload-progress.component.html

Summary

Maintainability
Test Coverage
<!-- Upload progress/cancel/error/success header -->
<div *ngIf="isUploading && !error" class="upload-progress-cancel">
  <my-progress-bar
    i18n-label label="Total uploaded" theme="green"
    [value]="uploadPercents" [valueFormatted]="getUploadingLabel()"
  >
  </my-progress-bar>

  <input
    *ngIf="uploaded === false"
    type="button" class="peertube-button grey-button ms-1" i18n-value="Cancel ongoing upload" value="Cancel" (click)="cancel.emit()"
  />
</div>

<div *ngIf="error && enableRetryAfterError" class="upload-progress-retry">
  <my-progress-bar
    [label]="error" value="100" [valueFormatted]="error"
    theme="red"
  >
  </my-progress-bar>

  <input type="button" class="peertube-button grey-button ms-1" i18n-value="Retry failed upload" value="Retry" (click)="retry.emit()" />
  <input type="button" class="peertube-button grey-button ms-1" i18n-value="Cancel ongoing upload" value="Cancel" (click)="cancel.emit()" />
</div>

<my-alert *ngIf="error && !enableRetryAfterError" type="danger">
  <div i18n>Sorry, but something went wrong</div>
  {{ error }}
</my-alert>