2019-10-04 12:33:10 +03:00
|
|
|
<header class="modal-header" data-test-modal="import-members">
|
|
|
|
<h1>
|
2020-06-12 11:01:46 +03:00
|
|
|
{{#if this.importResponse}}
|
2020-06-05 16:03:43 +03:00
|
|
|
Import complete
|
2019-10-04 12:33:10 +03:00
|
|
|
{{else}}
|
2020-06-05 16:03:43 +03:00
|
|
|
Import members
|
2019-10-04 12:33:10 +03:00
|
|
|
{{/if}}
|
|
|
|
</h1>
|
|
|
|
</header>
|
2020-05-28 19:11:21 +03:00
|
|
|
<a class="close" href="" role="button" title="Close" {{action "closeModal"}}>{{svg-jar "close"}}<span class="hidden">Close</span></a>
|
2019-10-04 12:33:10 +03:00
|
|
|
|
2020-06-12 11:01:46 +03:00
|
|
|
{{#if this.importResponse}}
|
2020-06-05 15:20:23 +03:00
|
|
|
<div class="modal-body bg-whitegrey-l2 ba b--whitegrey br3">
|
2019-10-04 14:55:52 +03:00
|
|
|
<table class="gh-members-import-results">
|
2019-10-04 12:33:10 +03:00
|
|
|
<tr>
|
|
|
|
<td>Imported:</td>
|
2020-06-12 11:01:46 +03:00
|
|
|
<td align="left" data-test-text="import-members-imported">{{this.importResponse.imported.count}}</td>
|
2019-10-04 12:33:10 +03:00
|
|
|
</tr>
|
2020-06-12 11:01:46 +03:00
|
|
|
{{#if this.importResponse.invalid.count}}
|
2019-10-04 12:33:10 +03:00
|
|
|
<tr>
|
2020-06-12 11:01:46 +03:00
|
|
|
<td class="red">Invalid:</td>
|
|
|
|
<td align="left" data-test-text="import-members-invalid" class="red">{{this.importResponse.invalid.count}}</td>
|
2019-10-04 12:33:10 +03:00
|
|
|
</tr>
|
2020-06-15 13:42:48 +03:00
|
|
|
{{#if this.config.enableDeveloperExperiments}}
|
2019-10-04 12:33:10 +03:00
|
|
|
<tr>
|
2020-06-12 11:01:46 +03:00
|
|
|
<td colspan="2">Details:</td>
|
2019-10-04 12:33:10 +03:00
|
|
|
</tr>
|
2020-06-12 11:01:46 +03:00
|
|
|
{{#each this.importResponse.invalid.errors as |error|}}
|
|
|
|
<tr>
|
|
|
|
<td>{{error.message}}</td>
|
|
|
|
<td>{{error.count}}</td>
|
|
|
|
</tr>
|
|
|
|
{{/each}}
|
2020-06-15 13:42:48 +03:00
|
|
|
{{/if}}
|
2019-10-04 12:33:10 +03:00
|
|
|
{{/if}}
|
|
|
|
</table>
|
2020-06-05 15:20:23 +03:00
|
|
|
</div>
|
|
|
|
{{else}}
|
|
|
|
<div class="modal-body">
|
|
|
|
{{#if (and this.filePresent (not this.failureMessage))}}
|
2020-06-16 20:08:37 +03:00
|
|
|
{{#if validationErrors}}
|
|
|
|
<div class="failed flex items-start gh-members-upload-errorcontainer gh-members-upload-warningmessage">
|
|
|
|
<div class="mr2">{{svg-jar "warning" class="nudge-top--2 w5 h5 fill-yellow-d1"}}</div>
|
|
|
|
<div>
|
2020-06-18 11:30:15 +03:00
|
|
|
{{#each validationErrors as |error|}}
|
|
|
|
<p class="ma0 pa0 gh-members-import-errorheading">{{{error.message}}}</p>
|
|
|
|
{{/each}}
|
2020-06-16 20:08:37 +03:00
|
|
|
</div>
|
2020-06-12 08:22:36 +03:00
|
|
|
</div>
|
2020-06-16 20:08:37 +03:00
|
|
|
{{/if}}
|
2020-06-05 13:57:07 +03:00
|
|
|
<GhFormGroup>
|
2020-06-18 08:47:04 +03:00
|
|
|
{{#if this.config.enableDeveloperExperiments}}
|
2020-06-18 12:33:34 +03:00
|
|
|
<h4 class="fw6 f8 dib mb1">Preview</h4>
|
2020-06-18 08:47:04 +03:00
|
|
|
<GhMembersImportTable @importData={{this.fileData}}/>
|
|
|
|
{{/if}}
|
|
|
|
|
2020-06-05 15:20:23 +03:00
|
|
|
<div class="mt4">
|
|
|
|
<label for="label-input"><span class="fw6 f8 dib mb1">Labels</span></label>
|
|
|
|
<GhMemberLabelInput @member={{this.labels}} @triggerId="label-input" />
|
|
|
|
<p>Will be applied to all newly imported members</p>
|
|
|
|
</div>
|
2020-06-05 13:57:07 +03:00
|
|
|
</GhFormGroup>
|
|
|
|
{{else}}
|
2020-06-05 15:20:23 +03:00
|
|
|
{{#if this.failureMessage}}
|
2020-06-16 20:08:37 +03:00
|
|
|
<div class="failed flex items-start gh-members-upload-errorcontainer gh-members-upload-errormessage">
|
|
|
|
<div class="mr2">{{svg-jar "warning" class="nudge-top--2 w4 h4 fill-red"}}</div>
|
|
|
|
<p class="ma0 pa0">{{this.failureMessage}}</p>
|
2020-06-05 15:20:23 +03:00
|
|
|
</div>
|
|
|
|
{{/if}}
|
|
|
|
<div class="upload-form bg-whitegrey-l2 ba b--whitegrey br3">
|
|
|
|
<section class="gh-image-uploader gh-members-import-uploader {{this.dragClass}}">
|
2020-06-05 13:57:07 +03:00
|
|
|
<GhFileInput @multiple={{false}} @alt={{this.labelText}} @action={{action "fileSelected"}} @accept={{this.accept}}>
|
2020-06-05 15:20:23 +03:00
|
|
|
<div class="flex flex-column items-center">
|
|
|
|
{{svg-jar "upload" class="w9 h9 mb1 stroke-midgrey"}}
|
|
|
|
<div class="description midgrey">{{this.labelText}}</div>
|
|
|
|
</div>
|
2020-06-05 13:57:07 +03:00
|
|
|
</GhFileInput>
|
|
|
|
</section>
|
|
|
|
</div>
|
|
|
|
{{/if}}
|
2020-06-05 15:20:23 +03:00
|
|
|
</div>
|
|
|
|
{{/if}}
|
2019-10-04 12:33:10 +03:00
|
|
|
|
2020-06-12 11:01:46 +03:00
|
|
|
<div class="modal-footer {{if (and this.filePresent (not this.failureMessage) (not this.importResponse)) "modal-footer-spread"}}">
|
|
|
|
{{#if this.importResponse}}
|
2020-06-05 16:03:43 +03:00
|
|
|
<button {{action "closeModal"}} disabled={{this.closeDisabled}} class="gh-btn gh-btn-blue" data-test-button="close-import-members">
|
|
|
|
<span>Done</span>
|
|
|
|
</button>
|
|
|
|
{{else if (and this.filePresent (not this.failureMessage))}}
|
2020-06-05 15:20:23 +03:00
|
|
|
<button {{action "reset"}} class="gh-btn" data-test-button="close-import-members">
|
|
|
|
<span>Start over</span>
|
2020-06-05 13:57:07 +03:00
|
|
|
</button>
|
2020-06-12 15:51:19 +03:00
|
|
|
<button class="gh-btn gh-btn-green" {{action "upload"}} disabled={{this.importDisabled}}>
|
|
|
|
<span>Import{{#if this.fileData.length}} {{pluralize this.fileData.length 'member'}}{{/if}}</span>
|
|
|
|
</button>
|
2020-06-05 13:57:07 +03:00
|
|
|
{{else}}
|
|
|
|
<button {{action "closeModal"}} disabled={{this.closeDisabled}} class="gh-btn" data-test-button="close-import-members">
|
2020-06-05 15:20:23 +03:00
|
|
|
<span>Close</span>
|
2020-06-05 13:57:07 +03:00
|
|
|
</button>
|
|
|
|
{{/if}}
|
2019-10-04 12:33:10 +03:00
|
|
|
</div>
|