mirror of
https://github.com/wassname/talk.git
synced 2026-07-05 10:34:56 +08:00
Query search goes to the specific queue
This commit is contained in:
@@ -8,8 +8,7 @@ import ModerationHeader from './ModerationHeader';
|
||||
import ModerationKeysModal from '../../../components/ModerationKeysModal';
|
||||
import UserDetail from '../containers/UserDetail';
|
||||
import StorySearch from '../containers/StorySearch';
|
||||
|
||||
const preModEnabled = (moderationSetting) => moderationSetting === 'PRE';
|
||||
import {isPremod} from '../../../utils';
|
||||
|
||||
export default class Moderation extends Component {
|
||||
constructor() {
|
||||
@@ -150,7 +149,7 @@ export default class Moderation extends Component {
|
||||
reportedCount={root.reportedCount}
|
||||
selectSort={this.props.setSortOrder}
|
||||
sort={this.props.moderation.sortOrder}
|
||||
premodEnabled={assetId ? preModEnabled(root.asset.settings.moderation) : preModEnabled(settings.moderation)}
|
||||
premodEnabled={assetId ? isPremod(root.asset.settings.moderation) : isPremod(settings.moderation)}
|
||||
/>
|
||||
<ModerationQueue
|
||||
data={this.props.data}
|
||||
|
||||
@@ -3,6 +3,7 @@ import PropTypes from 'prop-types';
|
||||
import styles from './StorySearch.css';
|
||||
import {Button, Spinner, Icon} from 'coral-ui';
|
||||
import Story from './Story';
|
||||
import {isPremod} from '../../../utils';
|
||||
|
||||
const StorySearch = (props) => {
|
||||
|
||||
@@ -64,6 +65,7 @@ const StorySearch = (props) => {
|
||||
? <Spinner />
|
||||
: assets.map((story, i) => {
|
||||
const storyOpen = story.closedAt === null || new Date(story.closedAt) > new Date();
|
||||
|
||||
return <Story
|
||||
key={i}
|
||||
id={story.id}
|
||||
@@ -71,7 +73,7 @@ const StorySearch = (props) => {
|
||||
createdAt={new Date(story.created_at).toISOString()}
|
||||
open={storyOpen}
|
||||
author={story.author}
|
||||
goToStory={props.goToStory}
|
||||
goToStory={() => props.goToStory(story.id, isPremod(story.settings.moderation))}
|
||||
/>;
|
||||
})
|
||||
}
|
||||
|
||||
@@ -57,15 +57,15 @@ class StorySearchContainer extends React.Component {
|
||||
this.props.storySearchChange(searchValue);
|
||||
}
|
||||
|
||||
goToStory = (id) => {
|
||||
goToStory = (id, premod) => {
|
||||
const {router} = this.props;
|
||||
router.push(`/admin/moderate/all/${id}`);
|
||||
router.push(`/admin/moderate/${premod ? 'premod' : 'new'}/${id}`);
|
||||
this.clearAndCloseSearch();
|
||||
}
|
||||
|
||||
goToModerateAll = () => {
|
||||
const {router} = this.props;
|
||||
router.push('/admin/moderate/all');
|
||||
router.push('/admin/moderate');
|
||||
this.clearAndCloseSearch();
|
||||
}
|
||||
|
||||
@@ -95,6 +95,9 @@ export const withAssetSearchQuery = withQuery(gql`
|
||||
created_at
|
||||
closedAt
|
||||
author
|
||||
settings {
|
||||
moderation
|
||||
}
|
||||
}
|
||||
}
|
||||
`, {
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
export const isPremod = (mod) => mod === 'PRE';
|
||||
Reference in New Issue
Block a user