1448, remove share#copyToClipboard changes
This commit is contained in:
parent
198b84efe1
commit
dee298fe33
|
@ -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
|
||||
|
|
|
@ -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)
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue