Merge pull request #911 from coralproject/premodqueue

Create both a PreMod and a New Queue when stream is switched from one status to another
This commit is contained in:
Kim Gardner
2017-09-01 10:30:13 +01:00
committed by GitHub
2 changed files with 17 additions and 11 deletions
@@ -208,17 +208,22 @@ class ModerationContainer extends Component {
// Still loading.
return <Spinner />;
}
} else if(asset !== undefined || !('premodCount' in root)) {
} else if (asset !== undefined || !('premodCount' in root)) {
// loading.
return <Spinner />;
}
const premodEnabled = assetId ? isPremod(asset.settings.moderation) : isPremod(settings.moderation);
const premodEnabled = assetId ? isPremod(asset.settings.moderation) :
isPremod(settings.moderation);
const currentQueueConfig = Object.assign({}, this.props.queueConfig);
if (premodEnabled) {
if (premodEnabled && root.newCount === 0) {
delete currentQueueConfig.new;
} else {
}
if (!premodEnabled && root.premodCount === 0) {
delete currentQueueConfig.premod;
}
@@ -355,8 +360,9 @@ const withModQueueQuery = withQuery(({queueConfig}) => gql`
variables: {
asset_id: id,
sortOrder: props.moderation.sortOrder,
allAssets: id === null
}
allAssets: id === null,
},
fetchPolicy: 'network-only'
};
},
});
@@ -1,16 +1,16 @@
import t from 'coral-framework/services/i18n';
export default {
new: {
statuses: ['NONE'],
icon: 'question_answer',
name: t('modqueue.new'),
},
premod: {
statuses: ['PREMOD'],
icon: 'access_time',
name: t('modqueue.premod'),
},
new: {
statuses: ['NONE', 'PREMOD'],
icon: 'question_answer',
name: t('modqueue.new'),
},
reported: {
action_type: 'FLAG',
statuses: ['NONE', 'PREMOD'],