[CORL-294] Moderate a single story + quick search (#2286)

* feat: allow passing a `storyID` to `Query.moderationQueues`

* feat: moderate by story

* feat: implement search story combobox

* feat: add translations

* fix: tests

* fix: duplicate id

* fix: rename file

* chore: add more comments

* fix: add missing translation

* review: use query parameter "q" instead of url path

* chore: move placeholder logic inside, maybe this makes it clearer :-D
This commit is contained in:
Kiwi
2019-04-26 14:23:46 +00:00
committed by Wyatt Johnson
parent a91de05af9
commit ab938985e4
86 changed files with 1934 additions and 319 deletions
@@ -45,8 +45,18 @@ async function createTestRenderer(
Query: {
settings: () => settings,
viewer: () => viewer,
moderationQueues: () => emptyModerationQueues,
comments: () => emptyRejectedComments,
moderationQueues: ({ variables }) => {
expectAndFail(variables).toEqual({
storyID: null,
});
return emptyModerationQueues;
},
comments: ({ variables }) => {
expectAndFail(variables).toEqual({
storyID: null,
});
return emptyRejectedComments;
},
},
}),
params.resolvers
@@ -382,6 +392,7 @@ describe("rejected queue", () => {
expectAndFail(variables).toEqual({
first: 5,
status: "REJECTED",
storyID: null,
});
return {
edges: [
@@ -418,6 +429,7 @@ describe("rejected queue", () => {
expectAndFail(variables).toEqual({
first: 5,
status: GQLCOMMENT_STATUS.REJECTED,
storyID: null,
});
return {
edges: [
@@ -440,6 +452,7 @@ describe("rejected queue", () => {
first: 10,
after: rejectedComments[1].createdAt,
status: GQLCOMMENT_STATUS.REJECTED,
storyID: null,
});
return {
edges: [
@@ -519,6 +532,7 @@ describe("rejected queue", () => {
expectAndFail(variables).toEqual({
first: 5,
status: "REJECTED",
storyID: null,
});
return {
edges: [
@@ -124,7 +124,19 @@ exports[`renders empty stories 1`] = `
<th
className="TableCell-root StoryTable-titleColumn TableCell-header"
>
Title
<span>
Title
</span>
<span
className="StoryTable-clickToModerate"
>
(
<span>
Click title to moderate story
</span>
)
</span>
</th>
<th
className="TableCell-root StoryTable-authorColumn TableCell-header"
@@ -152,7 +164,13 @@ exports[`renders empty stories 1`] = `
<td
className="TableCell-root StoryRow-titleColumn TableCell-body"
>
Finally a Cure for Cancer
<a
className="TextLink-root"
href="/admin/moderate/story-1"
onClick={[Function]}
>
Finally a Cure for Cancer
</a>
</td>
<td
className="TableCell-root StoryRow-authorColumn TableCell-body"
@@ -215,7 +233,13 @@ exports[`renders empty stories 1`] = `
<td
className="TableCell-root StoryRow-titleColumn TableCell-body"
>
First Colony on Mars
<a
className="TextLink-root"
href="/admin/moderate/story-2"
onClick={[Function]}
>
First Colony on Mars
</a>
</td>
<td
className="TableCell-root StoryRow-authorColumn TableCell-body"
@@ -403,7 +427,19 @@ exports[`renders stories 1`] = `
<th
className="TableCell-root StoryTable-titleColumn TableCell-header"
>
Title
<span>
Title
</span>
<span
className="StoryTable-clickToModerate"
>
(
<span>
Click title to moderate story
</span>
)
</span>
</th>
<th
className="TableCell-root StoryTable-authorColumn TableCell-header"
@@ -431,7 +467,13 @@ exports[`renders stories 1`] = `
<td
className="TableCell-root StoryRow-titleColumn TableCell-body"
>
Finally a Cure for Cancer
<a
className="TextLink-root"
href="/admin/moderate/story-1"
onClick={[Function]}
>
Finally a Cure for Cancer
</a>
</td>
<td
className="TableCell-root StoryRow-authorColumn TableCell-body"
@@ -494,7 +536,13 @@ exports[`renders stories 1`] = `
<td
className="TableCell-root StoryRow-titleColumn TableCell-body"
>
First Colony on Mars
<a
className="TextLink-root"
href="/admin/moderate/story-2"
onClick={[Function]}
>
First Colony on Mars
</a>
</td>
<td
className="TableCell-root StoryRow-authorColumn TableCell-body"