Replace slack app_redirect links to be workspace specific instead (#561)

This commit is contained in:
BananaJeans 2025-10-04 02:02:14 +03:00 committed by GitHub
parent 5ae07f5643
commit cb353b4414
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 4 additions and 4 deletions

View file

@ -169,7 +169,7 @@ export default class extends Controller {
const url = u.avatar_url || ''
const name = u.slack_uid ?
`<a href="https://slack.com/app_redirect?channel=${u.slack_uid}" target="_blank" class="text-blue-500 hover:underline">@${dis}</a>` :
`<a href="https://hackclub.slack.com/team/${u.slack_uid}" target="_blank" class="text-blue-500 hover:underline">@${dis}</a>` :
`<span class="text-white">${dis}</span>`
return `

View file

@ -1 +1 @@
<%= link_to SlackChannel.find_by_id(channel_id), "https://slack.com/app_redirect?channel=#{channel_id}", target: "_blank" %>
<%= link_to SlackChannel.find_by_id(channel_id), "https://hackclub.slack.com/archives/#{channel_id}", target: "_blank" %>

View file

@ -5,7 +5,7 @@
alt: "#{h(user.username)}'s avatar" if user.avatar_url %>
<span class="inline-flex items-center gap-1">
<% if local_assigns.fetch(:show, []).include?(:slack) && user.slack_uid.present? %>
<%= link_to "@#{h(user.display_name)}", "https://slack.com/app_redirect?channel=#{user.slack_uid}", target: "_blank", class: "text-blue-500 hover:underline" %>
<%= link_to "@#{h(user.display_name)}", "https://hackclub.slack.com/team/#{user.slack_uid}", target: "_blank", class: "text-blue-500 hover:underline" %>
<% else %>
<%= h(user.display_name) %>
<% end %>
@ -24,7 +24,7 @@
</span>
<% end %>
<% if local_assigns.fetch(:show, []).include?(:neighborhood) && user.slack_neighborhood_channel.present? %>
<%= link_to "🏘️", "https://slack.com/app_redirect?channel={user.slack_neighborhood_channel}", target: "_blank" %>
<%= link_to "🏘️", "https://hackclub.slack.com/archives/#{user.slack_neighborhood_channel}", target: "_blank" %>
<% end %>
<% unless current_user == user %>
<% admin_tool('', 'span') do %>