New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open Roles in React is not defined #6733
Comments
Hello, System
|
Same here on Strapi version: 3.0.3 |
Same problem here on strapi version 3.0.3 |
Some problem, version: 3.0.3 |
Same problem, version: 3.0.3 |
Also receiving this issue on v 3.0.3 |
Same problem, version 3.0.3 |
1 similar comment
Same problem, version 3.0.3 |
Same problem |
Same problem |
same problem. Strapi version: 3.0.3 (node v12.18.1) I followed the docs - Quick Start Guild to install & get familiar with Strapi, when I try to do "7. Set Roles and Permissions", this error shows. |
@alexandrebodin may be related to this pull #6663, I think you should make new release, as strapi is now stable & this is breaking |
same problem! |
Hello @everyone there is an open PR that fixes the issue. We are really sorry about this issue and it should not have happened. In the meantime, until the release is made here's a workaround to make your administration works:
mkdir -p extensions/users-permissions/admin/src/components/Controller
touch extensions/users-permissions/admin/src/components/Controller/index.js
/**
*
* Controller
*
*/
import React from 'react';
import PropTypes from 'prop-types';
import { get, map } from 'lodash';
import { FormattedMessage } from 'react-intl';
import pluginId from '../../pluginId';
import { useEditPageContext } from '../../contexts/EditPage';
import InputCheckbox from '../InputCheckboxPlugin';
import { Header, Label, Separator, Wrapper } from './Components';
function Controller({ actions, inputNamePath, isOpen, name, inputSelected, setInputSelected }) {
const { selectAllActions } = useEditPageContext();
const areAllActionsSelected = () => {
return Object.keys(actions).every(action => actions[action].enabled === true);
};
const handleChange = () => {
selectAllActions(`${inputNamePath}.controllers.${name}`, !areAllActionsSelected());
};
const hasSomeActionsSelected = () => {
return Object.keys(actions).some(action => actions[action].enabled === true);
};
const setNewInputSelected = name => {
setInputSelected(name);
};
const labelId = areAllActionsSelected() ? 'unselectAll' : 'selectAll';
return (
<Wrapper>
<Header>
<div>{name}</div>
<Separator />
<div className="checkbox-wrapper">
<div className="form-check">
<Label
className={`form-check-label ${areAllActionsSelected() &&
'checked'} ${!areAllActionsSelected() &&
hasSomeActionsSelected() &&
'some-checked'}`}
htmlFor={name}
>
<input
className="form-check-input"
checked={areAllActionsSelected()}
id={name}
name={name}
onChange={handleChange}
type="checkbox"
/>
<FormattedMessage id={`${pluginId}.Controller.${labelId}`} />
</Label>
</div>
</div>
</Header>
<div className="row">
{map(Object.keys(actions).sort(), actionKey => (
<InputCheckbox
inputSelected={inputSelected}
isOpen={isOpen}
key={actionKey}
label={actionKey}
name={`${inputNamePath}.controllers.${name}.${actionKey}.enabled`}
setNewInputSelected={setNewInputSelected}
value={get(actions[actionKey], 'enabled')}
/>
))}
</div>
</Wrapper>
);
}
Controller.defaultProps = {
actions: {},
inputNamePath: 'permissions.application',
name: '',
};
Controller.propTypes = {
actions: PropTypes.object,
inputNamePath: PropTypes.string,
isOpen: PropTypes.bool.isRequired,
name: PropTypes.string,
};
export default Controller;
# Using yarn
yarn strapi build --clean
# Using npm
npm run strapi build --clean |
Signed-off-by: soupette <cyril.lpz@gmail.com> Signed-off-by: harimkims <harimkims@gmail.com>
* Fixes #6733 Signed-off-by: soupette <cyril.lpz@gmail.com> * v3.0.4 * Added instructions for installing the `pg` node module I believe this is necessary to deploy to Google app engine - my deployment didn't work until I did this * Revert "Added instructions for installing the `pg` node module" This reverts commit 3da33ec. Co-authored-by: soupette <cyril.lpz@gmail.com> Co-authored-by: Alexandre BODIN <alexandrebodin@users.noreply.github.com> Co-authored-by: Alexandre Bodin <bodin.alex@gmail.com>
Describe the bug
When you try to configure some role it fails that React is not defined
Steps to reproduce the behavior
Screenshots
System
The text was updated successfully, but these errors were encountered: