Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Download popup tweaks #625

Merged
merged 2 commits into from
Feb 1, 2023
Merged
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
12 changes: 6 additions & 6 deletions ckanext/nhm/theme/assets/scripts/apps/search/dist/search.js

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,13 @@
<!-- the download is set to null *before* the dismiss method runs, so if v-if
is used instead of v-show, the dismiss method can't find these buttons inside
the main popup and assumes they're outside of it. -->
<p v-if="download !== null">Success! Check the <a :href="statusPage">status page</a> to follow your
download's progress.</p>
<p v-if="download !== null">Success! Check the <a :href="statusPage">status
page</a>
to follow your
download's progress.</p>
<div class="flex-container flex-around pad-v">
<a :href="statusPage" class="btn btn-primary text-right" v-if="download !== null"><i
<a :href="statusPage" class="btn btn-primary text-right"
v-if="download !== null"><i
class="fas fa-hourglass-half"></i>
Download status
</a>
Expand Down Expand Up @@ -105,7 +108,14 @@
</template>
</div>
</div>

<div class="form-row"><small>See <a href="https://dwc.tdwg.org"
target="_blank">TDWG</a> and
<a href="https://www.gbif.org/darwin-core" target="_blank">GBIF</a>
for more details on the Darwin Core
format and what <a
href="https://rs.gbif.org" target="_blank">these
extensions</a>
are.</small></div>
</template>
</template>
</div>
Expand All @@ -132,13 +142,15 @@
<template v-if="downloadForm.notifier.type === 'email'">
<div class="form-row">
<label for="download-email">
Email address
Email address(es)
</label>
<input id="download-email"
type="text"
class="full-width-input"
v-model="downloadForm.notifier.type_args['emails']"
placeholder="data@nhm.ac.uk">
<p><small>Multiple email addresses can be added as a
comma-separated list.</small></p>
</div>
</template>
<template v-else-if="downloadForm.notifier.type === 'webhook'">
Expand Down Expand Up @@ -196,6 +208,7 @@
<script>
import BasePopup from './BasePopup.vue';
import { mapActions, mapState } from 'vuex';
import { trim } from 'core-js/internals/string-trim';

export default {
name: 'Download',
Expand Down Expand Up @@ -292,7 +305,7 @@ export default {
switch (this.downloadForm.notifier.type) {
case 'email':
typeArgs = {
email: ''
emails: ''
};
break;
case 'webhook':
Expand Down Expand Up @@ -321,6 +334,11 @@ export default {
});
}

if (this.downloadForm.notifier.type === 'email') {
this.downloadForm.notifier.type_args.emails = this.downloadForm.notifier.type_args.emails.split(',')
.map(trim);
}

this.getDownload(this.downloadForm);
}
},
Expand Down