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

#1414 share channels #2859

Merged
merged 5 commits into from
Nov 14, 2022
Merged

Conversation

Alhuin
Copy link
Contributor

@Alhuin Alhuin commented Nov 12, 2022

#1414 Add button to share channel link on channel views

Pull Request Type

  • Bugfix
  • Feature Implementation
  • Documentation
  • Other

Related issue

closes #1414

Description

Add a new share icon in the Channel view.

At first, I implemented this as a dropdown button but this wasn't pretty in terms of UI.

In a second step, I wrote a component ft-share-channel-button, but it was clearly a duplicate of the ft-share-button with less content.

I finally edited the ft-share-button so that it takes a new optionnal parameter: mediaType shareTargetType:

  • Not providing it keeps the original behaviour ( by default the mediaType shareTargetType is 'Video')
  • Setting it as 'Channel' computes the urls as: {{ provider }}/channel/{{ id }} and renders only Copy and Open links for Youtube and Invidious, as there is no way (as far as I know) to provide an embed link to a Channel.

One consequence: The property getTimestamp is not required anymore.
I would have liked to do something like required=this.mediaType === 'Video' but could not make this work, so I implemented a mount() function to check the case where the component would be instanciated for a video without it, it will only console.error.

Screenshots

Before

image
image

After

image
image

image
image
Screenshot from 2022-11-12 18-24-32
Screenshot from 2022-11-12 18-28-27

Testing

Click on the share icon on any Channel view.

Desktop

  • OS: Fedora
  • OS Version: Fedora Linux 37 (Workstation Edition)
  • FreeTube version: 0.18.0

Additional context

This is my first contribution to an open source project and first time using VueJs and Electron, any feedback on the worflow or the code style will be greatly appreciated !

- Update src/renderer/components/ft-share-button to handle Channels
- Update english locale entries for 'Share channel'
- update youtubeShareURL() in src/renderer/components/ft-share-button
- implemented the new button in src/renderer/views/Channel
@FreeTubeBot FreeTubeBot enabled auto-merge (squash) November 12, 2022 17:37
@github-actions github-actions bot added the PR: waiting for review For PRs that are complete, tested, and ready for review label Nov 12, 2022
@efb4f5ff-1298-471a-8973-3d47447115dc efb4f5ff-1298-471a-8973-3d47447115dc added PR: changes requested and removed PR: waiting for review For PRs that are complete, tested, and ready for review labels Nov 13, 2022
- renamed mediaType to shareTargetType in ft-share-button.js
- switched logic from !isChannel to isVideo in ft-share-button.vue
- renamed target type in ft-share-button.vue
- updated implementation in Channel.vue
auto-merge was automatically disabled November 13, 2022 01:29

Head branch was pushed to by a user without write access

@FreeTubeBot FreeTubeBot enabled auto-merge (squash) November 13, 2022 01:29
@FreeTubeBot FreeTubeBot enabled auto-merge (squash) November 13, 2022 08:59
@efb4f5ff-1298-471a-8973-3d47447115dc efb4f5ff-1298-471a-8973-3d47447115dc added PR: waiting for review For PRs that are complete, tested, and ready for review and removed PR: changes requested labels Nov 13, 2022
Copy link
Collaborator

@PikachuEXE PikachuEXE left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested locally

@FreeTubeBot FreeTubeBot merged commit 3d473d9 into FreeTubeApp:development Nov 14, 2022
@github-actions github-actions bot removed the PR: waiting for review For PRs that are complete, tested, and ready for review label Nov 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add button to copy channel link on channel pages
5 participants