From d0b1b6e632e711d3921fac8bcdca6ac3b582ad26 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ciar=C3=A1n=20Ainsworth?= <cda@rootkey.co.uk> Date: Fri, 11 Dec 2020 15:27:29 +0100 Subject: [PATCH] Resolve "Following channel with fediverse address not working" --- changes/changelog.d/1294.enhancement | 1 + changes/changelog.d/1295.bugfix | 1 + front/src/components/RemoteSearchForm.vue | 18 +++++++++++++++--- front/src/components/audio/artist/Card.vue | 3 ++- front/src/components/library/Podcasts.vue | 4 ++-- front/src/components/semantic/Modal.vue | 1 + front/src/views/channels/SubscriptionsList.vue | 4 ++-- 7 files changed, 24 insertions(+), 8 deletions(-) create mode 100644 changes/changelog.d/1294.enhancement create mode 100644 changes/changelog.d/1295.bugfix diff --git a/changes/changelog.d/1294.enhancement b/changes/changelog.d/1294.enhancement new file mode 100644 index 0000000000..3399782c01 --- /dev/null +++ b/changes/changelog.d/1294.enhancement @@ -0,0 +1 @@ +Added ability to choose fediverse addresses from channel subscription page/podcast screen (#1294) \ No newline at end of file diff --git a/changes/changelog.d/1295.bugfix b/changes/changelog.d/1295.bugfix new file mode 100644 index 0000000000..fad762cbc0 --- /dev/null +++ b/changes/changelog.d/1295.bugfix @@ -0,0 +1 @@ +Fixed an issue where modals would prevent users being able to interact with channels (#1295) \ No newline at end of file diff --git a/front/src/components/RemoteSearchForm.vue b/front/src/components/RemoteSearchForm.vue index 24f2f5ffca..3f91726ad9 100644 --- a/front/src/components/RemoteSearchForm.vue +++ b/front/src/components/RemoteSearchForm.vue @@ -1,5 +1,14 @@ <template> - <div> + <div v-if="type === 'both' || type === undefined" class="two ui buttons"> + <button class="ui left floated labeled icon button" @click.prevent="changeType('rss')"><i class="feed icon"></i> + <translate translate-context="Content/Search/Input.Label/Noun">RSS</translate> + </button> + <div class="or"></div> + <button class="ui right floated right labeled icon button" @click.prevent="changeType('artists')"><i class="globe icon"></i> + <translate translate-context="Content/Search/Input.Label/Noun">Fediverse</translate> + </button> + </div> + <div v-else> <form id="remote-search" :class="['ui', {loading: isLoading}, 'form']" @submit.stop.prevent="submit"> <div v-if="errors.length > 0" role="alert" class="ui negative message"> <h3 class="header"><translate translate-context="Content/*/Error message.Title">Error while fetching object</translate></h3> @@ -14,7 +23,7 @@ <p v-if="type === 'rss'"> <translate translate-context="Content/Fetch/Paragraph">Paste here the RSS url or the fediverse address to subscribe to its feed.</translate> </p> - <p v-else> + <p v-else-if="type === 'artists'"> <translate translate-context="Content/Fetch/Paragraph">Use this form to retrieve an object hosted somewhere else in the fediverse.</translate> </p> <input type="text" name="object-id" id="object-id" :placeholder="labels.fieldPlaceholder" v-model="id" required> @@ -54,7 +63,7 @@ export default { if (this.type === 'rss') { this.rssSubscribe() - } else { + } else if (this.type === 'artists') { this.createFetch() } } @@ -109,6 +118,9 @@ export default { }, methods: { + changeType(newType) { + this.type = newType + }, submit () { if (this.type === 'rss') { return this.rssSubscribe() diff --git a/front/src/components/audio/artist/Card.vue b/front/src/components/audio/artist/Card.vue index 46533fed93..f51c48bd6a 100644 --- a/front/src/components/audio/artist/Card.vue +++ b/front/src/components/audio/artist/Card.vue @@ -15,7 +15,8 @@ <tags-list label-classes="tiny" :truncate-size="20" :limit="2" :show-more="false" :tags="artist.tags"></tags-list> </div> <div class="extra content"> - <translate translate-context="*/*/*" :translate-params="{count: artist.tracks_count}" :translate-n="artist.tracks_count" translate-plural="%{ count } tracks">%{ count } track</translate> + <translate v-if="artist.content_category === 'music'" translate-context="*/*/*" :translate-params="{count: artist.tracks_count}" :translate-n="artist.tracks_count" translate-plural="%{ count } tracks">%{ count } track</translate> + <translate v-else translate-context="*/*/*" :translate-params="{count: artist.tracks_count}" :translate-n="artist.tracks_count" translate-plural="%{ count } episodes">%{ count } episode</translate> <play-button class="right floated basic icon" :dropdown-only="true" :is-playable="artist.is_playable" :dropdown-icon-classes="['ellipsis', 'horizontal', 'large really discrete']" :artist="artist"></play-button> </div> </div> diff --git a/front/src/components/library/Podcasts.vue b/front/src/components/library/Podcasts.vue index 410c91aad6..e4683407a8 100644 --- a/front/src/components/library/Podcasts.vue +++ b/front/src/components/library/Podcasts.vue @@ -94,11 +94,11 @@ </h2> <div class="scrolling content" ref="modalContent"> <remote-search-form - type="rss" + type="both" :show-submit="false" :standalone="false" @subscribed="showSubscribeModal = false; fetchData()" - :redirect="false"></remote-search-form> + :redirect="true"></remote-search-form> </div> <div class="actions"> <button class="ui basic deny button"> diff --git a/front/src/components/semantic/Modal.vue b/front/src/components/semantic/Modal.vue index 5ae134b218..785aebece0 100644 --- a/front/src/components/semantic/Modal.vue +++ b/front/src/components/semantic/Modal.vue @@ -29,6 +29,7 @@ export default { if (this.control) { $(this.$el).modal('hide') } + this.focusTrap.deactivate() $(this.$el).remove() }, methods: { diff --git a/front/src/views/channels/SubscriptionsList.vue b/front/src/views/channels/SubscriptionsList.vue index 27f92ca1fc..6ac12fd9da 100644 --- a/front/src/views/channels/SubscriptionsList.vue +++ b/front/src/views/channels/SubscriptionsList.vue @@ -16,11 +16,11 @@ </h2> <div class="scrolling content" ref="modalContent"> <remote-search-form - type="rss" + type="both" :show-submit="false" :standalone="false" @subscribed="showSubscribeModal = false; reloadWidget()" - :redirect="false"></remote-search-form> + :redirect="true"></remote-search-form> </div> <div class="actions"> <button class="ui basic deny button"> -- GitLab