Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 0 additions & 22 deletions app/components/events/view/export/download-zip.js
Original file line number Diff line number Diff line change
@@ -1,27 +1,5 @@
import Component from '@ember/component';
import { action } from '@ember/object';

export default class extends Component {
@action
async exportEventDownload(eventDownloadUrl) {
this.set('isLoading', true);
try {
const res = await this.loader.downloadFile(`${eventDownloadUrl}`);
const anchor = document.createElement('a');
anchor.style.display = 'none';
anchor.href = URL.createObjectURL(new Blob([res], { type: 'octet/stream' }));
anchor.download = 'EventExport.zip';
anchor.click();
this.notify.success(this.l10n.t('Exported Event Downloaded successfully.'), {
id: 'export_succ'
});
} catch (e) {
console.error(e);
this.notify.error(this.l10n.t(e), {
id: 'err_down'
});
}
this.set('isLoading', false);
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
<button class="ui blue button" {{action startGeneration}}>
{{t 'Start'}}
</button>
<a href="#" class="ui button {{if isDownloadDisabled 'disabled' ''}}" {{action exportEventDownload eventDownloadUrl }}>
<a href="{{eventDownloadUrl}}" class="ui button {{if isDownloadDisabled 'disabled' ''}}">
{{t 'Download'}}
</a>
<div class="hidden divider"></div>
Expand Down