Skip to content

Commit

Permalink
Supervisor profile (pr #144 by @brunocgc)
Browse files Browse the repository at this point in the history
  • Loading branch information
allgood committed Aug 23, 2024
1 parent 5398b0c commit 1032f8c
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 4 deletions.
10 changes: 6 additions & 4 deletions frontend/src/components/TicketsManagerTabs/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -116,11 +116,13 @@ const TicketsManagerTabs = () => {
const [selectedUsers, setSelectedUsers] = useState([]);

useEffect(() => {
if (user.profile.toUpperCase() === "ADMIN") {
if (
user.profile.toUpperCase() === "ADMIN" ||
user.profile.toUpperCase() === "SUPERVISOR"
) {
setShowAllTickets(true);
}
// eslint-disable-next-line react-hooks/exhaustive-deps
}, []);
}, [user]);

useEffect(() => {
if (tab === "search") {
Expand Down Expand Up @@ -320,7 +322,7 @@ const TicketsManagerTabs = () => {
</TabPanel>
<TabPanel value={tab} name="search" className={classes.ticketsWrapper}>
<TagsFilter onFiltered={handleSelectedTags} />
{profile === "admin" && (
{(profile === "admin" || profile === "supervisor") && (
<UsersFilter onFiltered={handleSelectedUsers} />
)}
<TicketsList
Expand Down
1 change: 1 addition & 0 deletions frontend/src/components/UserModal/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,7 @@ const UserModal = ({ open, onClose, userId }) => {
required
>
<MenuItem value="admin">Admin</MenuItem>
<MenuItem value="supervisor">Supervisor</MenuItem>
<MenuItem value="user">User</MenuItem>
</Field>
</>
Expand Down
10 changes: 10 additions & 0 deletions frontend/src/rules.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,16 @@ const rules = {
static: [],
},

supervisor: {
static: [
"dashboard:view",
"tickets-manager:showall",
"ticket-options:deleteTicket",
"contacts-page:deleteContact",
"contact-modal:editUserDefault",
],
},

admin: {
static: [
//"dashboard:view",
Expand Down

0 comments on commit 1032f8c

Please sign in to comment.