-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1635 from UUDigitalHumanitieslab/feature/download…
…-tab Feature/download tab
- Loading branch information
Showing
26 changed files
with
454 additions
and
246 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,99 @@ | ||
<div class="level-item"> | ||
<div class="field has-addons"> | ||
<p class="control" iaBalloon="Only the first {{downloadLimit || directDownloadLimit}} results will be in the file!" | ||
[iaBalloonVisible]="hasLimitedResults ? undefined : false" iaBalloonLength="fit"> | ||
<button class="button is-primary" [ngClass]="{'is-loading':isDownloading}" type="download" | ||
(click)="chooseDownloadMethod()" [disabled]="downloadDisabled"> | ||
<span class="icon"> | ||
<fa-icon [icon]="actionIcons.download" aria-hidden="true"></fa-icon> | ||
</span> | ||
<span>Download csv</span> | ||
</button> | ||
</p> | ||
<p class="control" iaBalloon="Click here to select which fields should appear in the csv" iaBalloonLength="medium"> | ||
<ia-select-field [corpusFields]="availableCsvFields" filterCriterion="downloadable" | ||
(selection)="selectCsvFields($event)"> | ||
</ia-select-field> | ||
<ng-container *ngIf="totalResults.result$ | async as total"> | ||
<p class="block" aria-live="polite" aria-atomic="true">{{total}} results.</p> | ||
|
||
<p class="block"> | ||
You can download your search results as a CSV file. View the | ||
<a [routerLink]="['/manual', 'download']">manual</a> | ||
for more information. | ||
</p> | ||
|
||
<div class="message" *ngIf="downloadLimit < total"> | ||
<p class="message-body"> | ||
Only the first {{downloadLimit}} results will be included in the file. | ||
</p> | ||
</div> | ||
</div> | ||
<form> | ||
<div class="field"> | ||
<label class="label" id="fields-select-label">Fields</label> | ||
<div class="control"> | ||
<p-multiSelect [options]="availableCsvFields" | ||
[(ngModel)]="selectedCsvFields" | ||
optionLabel="displayName" | ||
placeholder="select fields" | ||
name="searchFields" | ||
ariaLabelledBy="fields-select-label"> | ||
</p-multiSelect> | ||
</div> | ||
<p class="help"> | ||
Select which fields should be included as columns in the CSV file. | ||
</p> | ||
</div> | ||
|
||
<div class="field"> | ||
<p class="label"> | ||
Sort results | ||
</p> | ||
<ia-search-sorting [pageResults]="resultsConfig"></ia-search-sorting> | ||
</div> | ||
|
||
<!-- TODO: show this option when query-in-context download is fixed --> | ||
<div class="field" *ngIf="queryModel.queryText" hidden> | ||
<div role="group" class="control"> | ||
<legend class="label"> | ||
Additional columns | ||
</legend> | ||
<label> | ||
<!-- checkbox: include query? --> | ||
<!-- checkbox: include user tags? --> | ||
<input type="checkbox" | ||
[checked]="(resultsConfig.highlight$ | async) !== undefined" | ||
(change)="onHighlightChange($event)"> | ||
Include "query in context" snippets | ||
</label> | ||
</div> | ||
</div> | ||
|
||
<ia-download-options [download]="pendingDownload" [isDownloading]="isDownloading" (cancel)="pendingDownload = undefined" | ||
(confirm)="confirmDirectDownload($event)"></ia-download-options> | ||
<ng-container *ngIf="(canDownloadDirectly$ | async); else longDownloadSubmit"> | ||
<div class="field"> | ||
<div role="group" class="control"> | ||
<legend class="label">File encoding</legend> | ||
<label class="radio" *ngFor="let encodingOption of encodingOptions"> | ||
<input type="radio" name="encoding" (click)="encoding=encodingOption" [checked]="encoding===encodingOption"> | ||
{{encodingOption}} | ||
</label> | ||
</div> | ||
<p class="help"> | ||
We recommend using utf-8 encoding for most applications, including Python and R. | ||
For importing files in Microsoft Excel, we recommend utf-16. | ||
</p> | ||
</div> | ||
<div class="block"> | ||
<button class="button is-primary" [ngClass]="{'is-loading':isDownloading}" | ||
type="submit" | ||
(click)="confirmDirectDownload()" [disabled]="total == 0"> | ||
<span class="icon"> | ||
<fa-icon [icon]="actionIcons.download" aria-hidden="true"></fa-icon> | ||
</span> | ||
<span>Download</span> | ||
</button> | ||
</div> | ||
</ng-container> | ||
<ng-template #longDownloadSubmit> | ||
<div class="message"> | ||
<p class="message-body"> | ||
Your download contains too many documents to be immediately available. | ||
You can request the download now, and receive an email when it's | ||
ready. | ||
</p> | ||
</div> | ||
<div class="block"> | ||
<button class="button is-primary" type="submit" (click)="longDownload()"> | ||
<span class="icon"> | ||
<fa-icon [icon]="actionIcons.wait"></fa-icon> | ||
</span> | ||
<span>Request download</span> | ||
</button> | ||
</div> | ||
</ng-template> | ||
</form> | ||
</ng-container> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.