1448, remove share#copyToClipboard changes

This commit is contained in:
Ahmed Ejaz 2023-11-12 16:06:43 +05:00 committed by Andreas Nedbal
parent 198b84efe1
commit dee298fe33
3 changed files with 1 additions and 22 deletions

View File

@ -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

View File

@ -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)
}
}

View File

@ -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