Skip to content

Commit

Permalink
[Forum] fixes all messages moved to moderation
Browse files Browse the repository at this point in the history
  • Loading branch information
Elorfin committed Feb 28, 2023
1 parent c4c25fc commit 6906739
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 5 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<?php

namespace Claroline\ForumBundle\Installation\Migrations\pdo_mysql;

use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;

/**
* Auto-generated migration based on mapping information: modify it with caution.
*
* Generation date: 2023/02/16 10:26:09
*/
class Version20230228090000 extends AbstractMigration
{
public function up(Schema $schema): void
{
$this->addSql('
UPDATE claro_forum_message SET moderation = "NONE" WHERE moderation = "none"
');
}

public function down(Schema $schema): void
{
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import {Moderation} from '#/plugin/forum/resources/forum/moderation/components/m
import {Editor} from '#/plugin/forum/resources/forum/editor/components/editor'
import {Player} from '#/plugin/forum/resources/forum/player/components/player'
import {Forum as ForumType} from '#/plugin/forum/resources/forum/prop-types'
import {constants} from '#/plugin/forum/resources/forum/constants'

const ForumResource = props =>
<ResourcePage
Expand Down Expand Up @@ -46,17 +47,15 @@ const ForumResource = props =>
icon: 'fa fa-fw fa-gavel',
label: trans('blocked_messages_subjects', {}, 'forum'),
group: trans('moderation', {}, 'forum'),
displayed: !!get(props.forum, 'restrictions.moderator'),
target: `${props.path}/moderation/blocked/subjects`,
exact: true
displayed: constants.VALIDATE_NONE !== get(props.forum, 'moderation') && !!get(props.forum, 'restrictions.moderator'),
target: `${props.path}/moderation/blocked/subjects`
}, {
type: LINK_BUTTON,
icon: 'fa fa-fw fa-flag',
label: trans('flagged_messages_subjects', {}, 'forum'),
group: trans('moderation', {}, 'forum'),
displayed: !!get(props.forum, 'restrictions.moderator'),
target: `${props.path}/moderation/flagged/subjects`,
exact: true
target: `${props.path}/moderation/flagged/subjects`
}
]}
routes={[
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,8 @@ const MODERATION_MODES = {

export const constants = {
MESSAGE_SORT_DISPLAY,
VALIDATE_NONE,
VALIDATE_PRIOR_ONCE,
VALIDATE_PRIOR_ALL,
MODERATION_MODES
}

0 comments on commit 6906739

Please sign in to comment.