[Glitch] Fix server rules and custom closed registrations message
Port ab8f9d94ea4cd2e3664f1d1da945346ea3602750 to glitch-soc Signed-off-by: Claire <claire.github-309c@sitedethib.com>
This commit is contained in:
parent
3cf0fb7ba0
commit
524d3a0d7f
@ -7,7 +7,7 @@ import { fetchServer } from 'flavours/glitch/actions/server';
|
||||
import { domain } from 'flavours/glitch/initial_state';
|
||||
|
||||
const mapStateToProps = state => ({
|
||||
message: state.getIn(['server', 'server', 'registrations', 'message']),
|
||||
message: state.getIn(['server', 'server', 'item', 'registrations', 'message']),
|
||||
});
|
||||
|
||||
class ClosedRegistrationsModal extends ImmutablePureComponent {
|
||||
|
||||
@ -26,14 +26,14 @@ const messages = defineMessages({
|
||||
});
|
||||
|
||||
const mapStateToProps = state => ({
|
||||
rules: state.getIn(['server', 'server', 'rules'], ImmutableList()),
|
||||
rules: state.getIn(['server', 'server', 'item', 'rules'], []),
|
||||
});
|
||||
|
||||
class Category extends PureComponent {
|
||||
|
||||
static propTypes = {
|
||||
onNextStep: PropTypes.func.isRequired,
|
||||
rules: ImmutablePropTypes.list,
|
||||
rules: PropTypes.arrayOf(PropTypes.object),
|
||||
category: PropTypes.string,
|
||||
onChangeCategory: PropTypes.func.isRequired,
|
||||
startedFrom: PropTypes.oneOf(['status', 'account']),
|
||||
@ -67,7 +67,7 @@ class Category extends PureComponent {
|
||||
render () {
|
||||
const { category, startedFrom, rules, intl } = this.props;
|
||||
|
||||
const options = rules.size > 0 ? [
|
||||
const options = rules.length > 0 ? [
|
||||
'spam',
|
||||
'violation',
|
||||
'other',
|
||||
|
||||
@ -11,7 +11,7 @@ import { Button } from 'flavours/glitch/components/button';
|
||||
import Option from './components/option';
|
||||
|
||||
const mapStateToProps = state => ({
|
||||
rules: state.getIn(['server', 'server', 'rules']),
|
||||
rules: state.getIn(['server', 'server', 'item', 'rules']),
|
||||
locale: state.getIn(['meta', 'locale']),
|
||||
});
|
||||
|
||||
@ -19,7 +19,7 @@ class Rules extends PureComponent {
|
||||
|
||||
static propTypes = {
|
||||
onNextStep: PropTypes.func.isRequired,
|
||||
rules: ImmutablePropTypes.list,
|
||||
rules: PropTypes.arrayOf(PropTypes.object),
|
||||
locale: PropTypes.string,
|
||||
selectedRuleIds: ImmutablePropTypes.set.isRequired,
|
||||
onToggle: PropTypes.func.isRequired,
|
||||
@ -46,12 +46,12 @@ class Rules extends PureComponent {
|
||||
<div>
|
||||
{rules.map(item => (
|
||||
<Option
|
||||
key={item.get('id')}
|
||||
key={item.id}
|
||||
name='rule_ids'
|
||||
value={item.get('id')}
|
||||
checked={selectedRuleIds.includes(item.get('id'))}
|
||||
value={item.id}
|
||||
checked={selectedRuleIds.includes(item.id)}
|
||||
onToggle={this.handleRulesToggle}
|
||||
label={item.getIn(['translations', locale, 'text']) || item.getIn(['translations', locale.split('-')[0], 'text']) || item.get('text')}
|
||||
label={item.translations?.[locale]?.text || item.translations?.[locale.split('-')[0]]?.text || item.text}
|
||||
multiple
|
||||
/>
|
||||
))}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user