diff --git a/packages/strapi-admin/admin/src/components/UpgradePlanModal/index.js b/packages/strapi-admin/admin/src/components/UpgradePlanModal/index.js
index b1f6bf392d..eb6fbcc5d4 100644
--- a/packages/strapi-admin/admin/src/components/UpgradePlanModal/index.js
+++ b/packages/strapi-admin/admin/src/components/UpgradePlanModal/index.js
@@ -65,7 +65,7 @@ const UpgradePlanModal = ({ isOpen, onToggle }) => {
};
UpgradePlanModal.defaultProps = {
- isOpen: true,
+ isOpen: false,
onToggle: () => {},
};
diff --git a/packages/strapi-admin/admin/src/containers/Roles/ListPage/index.js b/packages/strapi-admin/admin/src/containers/Roles/ListPage/index.js
index d1cc5cc34a..1204378b60 100644
--- a/packages/strapi-admin/admin/src/containers/Roles/ListPage/index.js
+++ b/packages/strapi-admin/admin/src/containers/Roles/ListPage/index.js
@@ -1,10 +1,12 @@
-import React, { useEffect } from 'react';
+import React, { useCallback, useEffect, useState } from 'react';
import { List, Header } from '@buffetjs/custom';
-import { Pencil } from '@buffetjs/icons';
+import { Button } from '@buffetjs/core';
+import { Duplicate, Pencil, Plus } from '@buffetjs/icons';
import matchSorter from 'match-sorter';
import { useIntl } from 'react-intl';
import { useHistory } from 'react-router-dom';
-import { useGlobalContext, useQuery, useUserPermissions } from 'strapi-helper-plugin';
+import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
+import { ListButton, useGlobalContext, useQuery, useUserPermissions } from 'strapi-helper-plugin';
import adminPermissions from '../../../permissions';
import PageTitle from '../../../components/SettingsPageTitle';
import { EmptyRole, RoleListWrapper, RoleRow } from '../../../components/Roles';
@@ -15,6 +17,7 @@ import BaselineAlignment from './BaselineAlignment';
const RoleListPage = () => {
const { formatMessage } = useIntl();
const { push } = useHistory();
+ const [isOpen, setIsOpen] = useState(false);
const { settingsBaseURL } = useGlobalContext();
const { roles, isLoading } = useRolesList();
const { toggleHeaderSearch } = useSettingsHeaderSearchContext();
@@ -34,6 +37,21 @@ const RoleListPage = () => {
// eslint-disable-next-line react-hooks/exhaustive-deps
}, []);
+ const handleToggle = useCallback(() => setIsOpen(prev => !prev), []);
+
+ const headerActions = [
+ {
+ label: formatMessage({
+ id: 'Settings.roles.list.button.add',
+ defaultMessage: 'Add new role',
+ }),
+ onClick: handleToggle,
+ color: 'primary',
+ type: 'button',
+ icon: true,
+ },
+ ];
+
const resultsCount = results.length;
return (
@@ -53,6 +71,7 @@ const RoleListPage = () => {
})}
// Show a loader in the header while requesting data
isLoading={isLoading}
+ actions={headerActions}
/>
@@ -69,18 +88,36 @@ const RoleListPage = () => {
,
+ onClick: handleToggle,
+ },
{
icon: canUpdate ? : null,
onClick: () => push(`${settingsBaseURL}/roles/${role.id}`),
},
+ {
+ icon: ,
+ onClick: handleToggle,
+ },
]}
role={role}
/>
)}
/>
{!resultsCount && !isLoading && }
+
+ }
+ label={formatMessage({
+ id: 'Settings.roles.list.button.add',
+ defaultMessage: 'Add new role',
+ })}
+ />
+
-
+
>
);
};
diff --git a/packages/strapi-admin/is_ee_env.js b/packages/strapi-admin/is_ee_env.js
index 1f09af8107..2906269c0a 100644
--- a/packages/strapi-admin/is_ee_env.js
+++ b/packages/strapi-admin/is_ee_env.js
@@ -4,4 +4,4 @@ const fs = require('fs-extra');
const path = require('path');
const appAdminPath = path.join(__dirname, 'admin');
-module.exports = fs.existsSync(path.join(appAdminPath, 'eee'));
+module.exports = fs.existsSync(path.join(appAdminPath, 'ee'));