FIX: review q issues (#20558)
* DEV: specify type of flag in status * FIX: passing missing parameter * DEV: pass type for reviewable score table * UX: add missing queued-topic styling * UX: fix img overflow * UX: add styling for queued user * UX: fix user flag color * UX: prevent overflow * UX: add copy for filters * FIX: fix typo in css for akismet flagging * UX: copy change for flag something else * UX: prevent overflow * Fixing reviewable-status css classes * Changes based on no longer using humanType * Need to use type rather than humanType for reviewable-status * FIX: linting --------- Co-authored-by: Martin Brennan <martin@discourse.org>
This commit is contained in:
parent
673cd4196f
commit
dd07e0dbd0
|
@ -19,7 +19,7 @@
|
||||||
>{{age-with-tooltip this.reviewable.created_at}}</LinkTo>
|
>{{age-with-tooltip this.reviewable.created_at}}</LinkTo>
|
||||||
</span>
|
</span>
|
||||||
<span class="status">
|
<span class="status">
|
||||||
{{reviewable-status this.reviewable.status}}
|
{{reviewable-status this.reviewable.status this.reviewable.type}}
|
||||||
</span>
|
</span>
|
||||||
<a
|
<a
|
||||||
href
|
href
|
||||||
|
|
|
@ -34,7 +34,7 @@
|
||||||
</td>
|
</td>
|
||||||
|
|
||||||
<td>
|
<td>
|
||||||
{{reviewable-status this.rs.status}}
|
{{reviewable-status this.rs.status this.reviewable.type}}
|
||||||
</td>
|
</td>
|
||||||
|
|
||||||
{{else}}
|
{{else}}
|
||||||
|
|
|
@ -9,23 +9,64 @@ import I18n from "I18n";
|
||||||
import { htmlHelper } from "discourse-common/lib/helpers";
|
import { htmlHelper } from "discourse-common/lib/helpers";
|
||||||
import { iconHTML } from "discourse-common/lib/icon-library";
|
import { iconHTML } from "discourse-common/lib/icon-library";
|
||||||
|
|
||||||
function dataFor(status) {
|
function dataFor(status, type) {
|
||||||
switch (status) {
|
switch (status) {
|
||||||
case PENDING:
|
case PENDING:
|
||||||
return { name: "pending" };
|
return { name: "pending" };
|
||||||
case APPROVED:
|
case APPROVED:
|
||||||
return { icon: "check", name: "approved" };
|
switch (type) {
|
||||||
|
case "ReviewableQueuedPost":
|
||||||
|
return {
|
||||||
|
icon: "check",
|
||||||
|
name: "approved_post",
|
||||||
|
cssClass: "approved",
|
||||||
|
};
|
||||||
|
case "User":
|
||||||
|
return {
|
||||||
|
icon: "check",
|
||||||
|
name: "approved_user",
|
||||||
|
cssClass: "approved",
|
||||||
|
};
|
||||||
|
default:
|
||||||
|
return {
|
||||||
|
icon: "check",
|
||||||
|
name: "approved_flag",
|
||||||
|
cssClass: "approved",
|
||||||
|
};
|
||||||
|
}
|
||||||
case REJECTED:
|
case REJECTED:
|
||||||
return { icon: "times", name: "rejected" };
|
switch (type) {
|
||||||
|
case "ReviewableQueuedPost":
|
||||||
|
return {
|
||||||
|
icon: "times",
|
||||||
|
name: "rejected_post",
|
||||||
|
cssClass: "rejected",
|
||||||
|
};
|
||||||
|
case "User":
|
||||||
|
return {
|
||||||
|
icon: "times",
|
||||||
|
name: "rejected_user",
|
||||||
|
cssClass: "rejected",
|
||||||
|
};
|
||||||
|
default:
|
||||||
|
return {
|
||||||
|
icon: "times",
|
||||||
|
name: "rejected_flag",
|
||||||
|
cssClass: "rejected",
|
||||||
|
};
|
||||||
|
}
|
||||||
case IGNORED:
|
case IGNORED:
|
||||||
return { icon: "external-link-alt", name: "ignored" };
|
return {
|
||||||
|
icon: "external-link-alt",
|
||||||
|
name: "ignored",
|
||||||
|
};
|
||||||
case DELETED:
|
case DELETED:
|
||||||
return { icon: "trash-alt", name: "deleted" };
|
return { icon: "trash-alt", name: "deleted" };
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export function htmlStatus(status) {
|
export function htmlStatus(status, type) {
|
||||||
let data = dataFor(status);
|
let data = dataFor(status, type);
|
||||||
if (!data) {
|
if (!data) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -33,13 +74,13 @@ export function htmlStatus(status) {
|
||||||
let icon = data.icon ? iconHTML(data.icon) : "";
|
let icon = data.icon ? iconHTML(data.icon) : "";
|
||||||
|
|
||||||
return `
|
return `
|
||||||
<span class="${data.name}">
|
<span class="${data.cssClass || data.name}">
|
||||||
${icon}
|
${icon}
|
||||||
${I18n.t("review.statuses." + data.name + ".title")}
|
${I18n.t("review.statuses." + data.name + ".title")}
|
||||||
</span>
|
</span>
|
||||||
`;
|
`;
|
||||||
}
|
}
|
||||||
|
|
||||||
export default htmlHelper((status) => {
|
export default htmlHelper((status, type) => {
|
||||||
return htmlStatus(status);
|
return htmlStatus(status, type);
|
||||||
});
|
});
|
||||||
|
|
|
@ -76,6 +76,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
.reviewable-user-info {
|
.reviewable-user-info {
|
||||||
|
max-width: 100%;
|
||||||
margin: 0.5em 0;
|
margin: 0.5em 0;
|
||||||
.reviewable-user-fields {
|
.reviewable-user-fields {
|
||||||
margin-bottom: 2em;
|
margin-bottom: 2em;
|
||||||
|
@ -231,13 +232,14 @@
|
||||||
color: var(--secondary);
|
color: var(--secondary);
|
||||||
border-radius: 8px;
|
border-radius: 8px;
|
||||||
&.-flagged-post,
|
&.-flagged-post,
|
||||||
&.-user,
|
|
||||||
&.-flagged-chat-message,
|
&.-flagged-chat-message,
|
||||||
&.-aksimet-flagged-post,
|
&.-akismet-flagged-post,
|
||||||
&.-aksimet-flagged-user {
|
&.-akismet-flagged-user {
|
||||||
background-color: var(--danger-medium);
|
background-color: var(--danger-medium);
|
||||||
}
|
}
|
||||||
&.-queued-post {
|
&.-queued-post,
|
||||||
|
&.-queued-topic,
|
||||||
|
&.-user {
|
||||||
background-color: var(--tertiary);
|
background-color: var(--tertiary);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -446,6 +448,7 @@
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
width: var(--topic-body-width);
|
width: var(--topic-body-width);
|
||||||
align-items: center;
|
align-items: center;
|
||||||
|
max-width: 100%;
|
||||||
|
|
||||||
.reviewable-reply-to {
|
.reviewable-reply-to {
|
||||||
display: flex;
|
display: flex;
|
||||||
|
@ -490,6 +493,11 @@
|
||||||
margin: 0 0 1em 0;
|
margin: 0 0 1em 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
img {
|
||||||
|
max-width: 100%;
|
||||||
|
height: auto;
|
||||||
|
}
|
||||||
|
|
||||||
pre,
|
pre,
|
||||||
code {
|
code {
|
||||||
word-break: break-all;
|
word-break: break-all;
|
||||||
|
|
|
@ -592,22 +592,34 @@ en:
|
||||||
pending:
|
pending:
|
||||||
title: "Pending"
|
title: "Pending"
|
||||||
approved:
|
approved:
|
||||||
|
title: "Approved"
|
||||||
|
approved_flag:
|
||||||
title: "Flag approved"
|
title: "Flag approved"
|
||||||
|
approved_user:
|
||||||
|
title: "User approved"
|
||||||
|
approved_post:
|
||||||
|
title: "Post approved"
|
||||||
rejected:
|
rejected:
|
||||||
|
title: "Rejected"
|
||||||
|
rejected_flag:
|
||||||
title: "Flag rejected"
|
title: "Flag rejected"
|
||||||
|
rejected_user:
|
||||||
|
title: "User rejected"
|
||||||
|
rejected_post:
|
||||||
|
title: "Post rejected"
|
||||||
ignored:
|
ignored:
|
||||||
title: "Flag ignored"
|
title: "Flag ignored"
|
||||||
deleted:
|
deleted:
|
||||||
title: "Topic or post deleted"
|
title: "Topic or post deleted"
|
||||||
reviewed:
|
reviewed:
|
||||||
title: "(all reviewed)"
|
title: "All reviewed"
|
||||||
all:
|
all:
|
||||||
title: "(everything)"
|
title: "Everything"
|
||||||
|
|
||||||
context_question:
|
context_question:
|
||||||
is_this_post: "Is this post %{reviewable_human_score_types}?"
|
is_this_post: "Is this post %{reviewable_human_score_types}?"
|
||||||
delimiter: "or"
|
delimiter: "or"
|
||||||
something_else_wrong: "Is there something else wrong with this post?"
|
something_else_wrong: "Is there something wrong with this post?"
|
||||||
|
|
||||||
types:
|
types:
|
||||||
reviewable_flagged_post:
|
reviewable_flagged_post:
|
||||||
|
|
Loading…
Reference in New Issue