From cb19ab287f2b884e37fc9f5909860ed3451c24a4 Mon Sep 17 00:00:00 2001 From: Eliot Berriot <contact@eliotberriot.com> Date: Mon, 23 Sep 2019 13:54:41 +0200 Subject: [PATCH] Fix #878: Added a info message on embed wizard when anonymous access to content is disabled --- changes/changelog.d/878.enhancement | 1 + front/src/components/audio/EmbedWizard.vue | 21 ++++++++++++++++++++- 2 files changed, 21 insertions(+), 1 deletion(-) create mode 100644 changes/changelog.d/878.enhancement diff --git a/changes/changelog.d/878.enhancement b/changes/changelog.d/878.enhancement new file mode 100644 index 0000000000..9cad7bd5db --- /dev/null +++ b/changes/changelog.d/878.enhancement @@ -0,0 +1 @@ +Added a info message on embed wizard when anonymous access to content is disabled (#878) diff --git a/front/src/components/audio/EmbedWizard.vue b/front/src/components/audio/EmbedWizard.vue index 0338f7ab98..04a6fe62fb 100644 --- a/front/src/components/audio/EmbedWizard.vue +++ b/front/src/components/audio/EmbedWizard.vue @@ -1,5 +1,15 @@ <template> <div> + <div class="ui warning message" v-if="!anonymousCanListen"> + <p> + <strong> + <translate translate-context="Content/Embed/Message">Sharing will not work because this pod doesn't allow anonymous users to access content.</translate> + </strong> + </p> + <p> + <translate translate-context="Content/Embed/Message">Please contact your admins and ask them to update the corresponding setting.</translate> + </p> + </div> <div class="ui form"> <div class="two fields"> <div class="field"> @@ -41,6 +51,9 @@ <script> +import { mapState } from "vuex" +import _ from '@/lodash' + export default { props: ['type', 'id'], data () { @@ -57,6 +70,12 @@ export default { return d }, computed: { + ...mapState({ + nodeinfo: state => state.instance.nodeinfo, + }), + anonymousCanListen () { + return _.get(this.nodeinfo, 'metadata.library.anonymousCanListen', false) + }, iframeSrc () { let base = process.env.BASE_URL if (base.startsWith('/')) { @@ -99,7 +118,7 @@ export default { <!-- Add "scoped" attribute to limit CSS to this component only --> <style scoped> -.message { +p.message { position: absolute; right: 0; bottom: -2em; -- GitLab