Merge pull request #2829 from basecamp/remove-tag-attachable

Remove dead Tag::Attachable code and tags prompt
This commit is contained in:
Stanko Krtalić
2026-04-10 09:05:48 +02:00
committed by GitHub
9 changed files with 8 additions and 54 deletions
@@ -1,9 +0,0 @@
class Prompts::TagsController < ApplicationController
def index
@tags = Current.account.tags.all.alphabetically
if stale? etag: @tags
render layout: false
end
end
end
-4
View File
@@ -7,10 +7,6 @@ module RichTextHelper
content_tag "lexxy-prompt", "", trigger: "@", src: prompts_users_path, name: "mention" content_tag "lexxy-prompt", "", trigger: "@", src: prompts_users_path, name: "mention"
end end
def tags_prompt
content_tag "lexxy-prompt", "", trigger: "#", src: prompts_tags_path, name: "tag"
end
def cards_prompt def cards_prompt
content_tag "lexxy-prompt", "", trigger: "#", src: prompts_cards_path, name: "card", "insert-editable-text": true, "remote-filtering": true, "supports-space-in-searches": true content_tag "lexxy-prompt", "", trigger: "#", src: prompts_cards_path, name: "card", "insert-editable-text": true, "remote-filtering": true, "supports-space-in-searches": true
end end
+1 -1
View File
@@ -1,5 +1,5 @@
class Tag < ApplicationRecord class Tag < ApplicationRecord
include Attachable, Filterable include Filterable
belongs_to :account, default: -> { Current.account } belongs_to :account, default: -> { Current.account }
has_many :taggings, dependent: :destroy has_many :taggings, dependent: :destroy
-11
View File
@@ -1,11 +0,0 @@
module Tag::Attachable
extend ActiveSupport::Concern
included do
include ActionText::Attachable
def attachable_plain_text_representation(...)
"##{title}"
end
end
end
-8
View File
@@ -1,8 +0,0 @@
<lexxy-prompt-item search="<%= tag.title %>" sgid="<%= tag.attachable_sgid %>">
<template type="menu">
#<%= tag.title %>
</template>
<template type="editor">
#<%= tag.title %>
</template>
</lexxy-prompt-item>
-1
View File
@@ -1 +0,0 @@
<%= render partial: "prompts/tags/tag", collection: @tags %>
-1
View File
@@ -190,7 +190,6 @@ Rails.application.routes.draw do
namespace :prompts do namespace :prompts do
resources :cards resources :cards
resources :tags
resources :users resources :users
resources :boards do resources :boards do
@@ -1,12 +0,0 @@
require "test_helper"
class Prompts::TagsControllerTest < ActionDispatch::IntegrationTest
setup do
sign_in_as :kevin
end
test "index" do
get prompts_tags_path
assert_response :success
end
end
@@ -44,11 +44,11 @@ class Account::DataTransfer::ActionText::RichTextRecordSetTest < ActiveSupport::
end end
test "transform_body_for_import skips GIDs belonging to another account" do test "transform_body_for_import skips GIDs belonging to another account" do
victim_tag = tags(:web) victim_user = users(:david)
attacker_account = accounts(:initech) attacker_account = accounts(:initech)
assert_not_equal attacker_account.id, victim_tag.account_id assert_not_equal attacker_account.id, victim_user.account_id
cross_tenant_gid = victim_tag.to_global_id.to_s cross_tenant_gid = victim_user.to_global_id.to_s
html = %(<action-text-attachment gid="#{cross_tenant_gid}"></action-text-attachment>) html = %(<action-text-attachment gid="#{cross_tenant_gid}"></action-text-attachment>)
record_set = Account::DataTransfer::ActionText::RichTextRecordSet.new(attacker_account) record_set = Account::DataTransfer::ActionText::RichTextRecordSet.new(attacker_account)
@@ -59,11 +59,11 @@ class Account::DataTransfer::ActionText::RichTextRecordSetTest < ActiveSupport::
end end
test "transform_body_for_import converts GIDs belonging to the same account" do test "transform_body_for_import converts GIDs belonging to the same account" do
own_tag = tags(:web) own_user = users(:david)
own_account = accounts(:"37s") own_account = accounts(:"37s")
assert_equal own_account.id, own_tag.account_id assert_equal own_account.id, own_user.account_id
same_account_gid = own_tag.to_global_id.to_s same_account_gid = own_user.to_global_id.to_s
html = %(<action-text-attachment gid="#{same_account_gid}"></action-text-attachment>) html = %(<action-text-attachment gid="#{same_account_gid}"></action-text-attachment>)
record_set = Account::DataTransfer::ActionText::RichTextRecordSet.new(own_account) record_set = Account::DataTransfer::ActionText::RichTextRecordSet.new(own_account)
@@ -74,7 +74,7 @@ class Account::DataTransfer::ActionText::RichTextRecordSetTest < ActiveSupport::
end end
test "transform_body_for_import handles non-existent record GIDs gracefully" do test "transform_body_for_import handles non-existent record GIDs gracefully" do
nonexistent_gid = "gid://fizzy/Tag/00000000000000000000000000" nonexistent_gid = "gid://fizzy/User/00000000000000000000000000"
html = %(<action-text-attachment gid="#{nonexistent_gid}"></action-text-attachment>) html = %(<action-text-attachment gid="#{nonexistent_gid}"></action-text-attachment>)
record_set = Account::DataTransfer::ActionText::RichTextRecordSet.new(accounts(:"37s")) record_set = Account::DataTransfer::ActionText::RichTextRecordSet.new(accounts(:"37s"))