diff --git a/app/helpers/social_helper.rb b/app/helpers/social_helper.rb index 6925c259..c4d8b329 100644 --- a/app/helpers/social_helper.rb +++ b/app/helpers/social_helper.rb @@ -13,9 +13,4 @@ module SocialHelper protocol: (APP_CONFIG["https"] ? :https : :http), ) end - - def answer_copy_content(answer) - # copy content template: "question - answer [link]" - "#{answer.question.content} - #{answer.content} [#{answer_share_url(answer)}]" - end end diff --git a/app/javascript/retrospring/controllers/share_controller.ts b/app/javascript/retrospring/controllers/share_controller.ts index e48daceb..c1b5d350 100644 --- a/app/javascript/retrospring/controllers/share_controller.ts +++ b/app/javascript/retrospring/controllers/share_controller.ts @@ -5,14 +5,12 @@ export default class extends Controller { static values = { url: String, text: String, - title: String, - copyContent: String + title: String }; declare readonly urlValue: string; declare readonly textValue: string; declare readonly titleValue: string; - declare readonly copyContentValue: string; share() { let shareConfiguration = {}; @@ -44,8 +42,4 @@ export default class extends Controller { }) .catch(noop); } - - async copyToClipboard(){ - await navigator.clipboard.writeText(this.copyContentValue) - } } diff --git a/spec/helpers/social_helper_spec.rb b/spec/helpers/social_helper_spec.rb index 8b2fd443..b56d6ab3 100644 --- a/spec/helpers/social_helper_spec.rb +++ b/spec/helpers/social_helper_spec.rb @@ -30,14 +30,4 @@ describe SocialHelper, type: :helper do URL end end - - describe "#answer_copy_content" do - subject { answer_copy_content(answer) } - - it "returns a formatted content to copy" do - expected_content = "#{answer.question.content} - #{answer.content} [https://example.com/@#{answer.user.screen_name}/a/#{answer.id}]" - - expect(subject).to eq(expected_content) - end - end end