FIX: disable flagging hidden posts
This commit is contained in:
parent
5cd055fd30
commit
94f628fb4c
|
@ -109,7 +109,7 @@ registerButton("like-count", attrs => {
|
||||||
});
|
});
|
||||||
|
|
||||||
registerButton("flag", attrs => {
|
registerButton("flag", attrs => {
|
||||||
if (attrs.canFlag) {
|
if (attrs.canFlag && !attrs.hidden) {
|
||||||
return {
|
return {
|
||||||
action: "showFlags",
|
action: "showFlags",
|
||||||
title: "post.controls.flag",
|
title: "post.controls.flag",
|
||||||
|
|
|
@ -389,6 +389,16 @@ widgetTest(`flagging: can't flag`, {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
widgetTest(`flagging: can't flag when post is hidden`, {
|
||||||
|
template: '{{mount-widget widget="post" args=args}}',
|
||||||
|
beforeEach() {
|
||||||
|
this.set("args", { canFlag: true, hidden: true });
|
||||||
|
},
|
||||||
|
test(assert) {
|
||||||
|
assert.ok(this.$("button.create-flag").length === 0);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
widgetTest(`read indicator`, {
|
widgetTest(`read indicator`, {
|
||||||
template: '{{mount-widget widget="post" args=args}}',
|
template: '{{mount-widget widget="post" args=args}}',
|
||||||
beforeEach() {
|
beforeEach() {
|
||||||
|
|
Loading…
Reference in New Issue