-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' of github.com:theopensystemslab/planx-new into je…
…ss/notify-flow-status-change
- Loading branch information
Showing
12 changed files
with
140 additions
and
160 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
36 changes: 3 additions & 33 deletions
36
api.planx.uk/tests/nocks/fetching-digital-land-gis-data.b444e1f9.json
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
86 changes: 86 additions & 0 deletions
86
editor.planx.uk/src/pages/FlowEditor/components/Team/MembersTable.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,86 @@ | ||
import Chip from "@mui/material/Chip"; | ||
import Table from "@mui/material/Table"; | ||
import TableBody from "@mui/material/TableBody"; | ||
import TableCell from "@mui/material/TableCell"; | ||
import TableContainer from "@mui/material/TableContainer"; | ||
import TableHead from "@mui/material/TableHead"; | ||
import TableRow from "@mui/material/TableRow"; | ||
import React from "react"; | ||
|
||
import { StyledAvatar, StyledTableRow } from "./styles"; | ||
import { TeamMember } from "./types"; | ||
|
||
export const MembersTable: React.FC<{ members: TeamMember[] }> = ({ | ||
members, | ||
}) => { | ||
const roleLabels: Record<string, string> = { | ||
platformAdmin: "Admin", | ||
teamEditor: "Editor", | ||
teamViewer: "Viewer", | ||
}; | ||
|
||
const getRoleLabel = (role: string) => { | ||
return roleLabels[role] || role; | ||
}; | ||
|
||
if (members.length === 0) { | ||
return ( | ||
<Table> | ||
<TableHead> | ||
<TableRow> | ||
<TableCell> | ||
<strong>No members found</strong> | ||
</TableCell> | ||
</TableRow> | ||
</TableHead> | ||
</Table> | ||
); | ||
} | ||
|
||
return ( | ||
<TableContainer> | ||
<Table> | ||
<TableHead> | ||
<StyledTableRow> | ||
<TableCell sx={{ width: 300 }}> | ||
<strong>User</strong> | ||
</TableCell> | ||
<TableCell sx={{ width: 200 }}> | ||
<strong>Role</strong> | ||
</TableCell> | ||
<TableCell> | ||
<strong>Email</strong> | ||
</TableCell> | ||
</StyledTableRow> | ||
</TableHead> | ||
<TableBody> | ||
{members.map((member) => ( | ||
<StyledTableRow key={member.id}> | ||
<TableCell | ||
sx={{ | ||
display: "flex", | ||
flexDirection: "row", | ||
alignItems: "center", | ||
}} | ||
> | ||
<StyledAvatar> | ||
{member.firstName[0]} | ||
{member.lastName[0]} | ||
</StyledAvatar> | ||
{member.firstName} {member.lastName} | ||
</TableCell> | ||
<TableCell> | ||
<Chip | ||
label={getRoleLabel(member.role)} | ||
size="small" | ||
sx={{ background: "#ddd" }} | ||
/> | ||
</TableCell> | ||
<TableCell>{member.email}</TableCell> | ||
</StyledTableRow> | ||
))} | ||
</TableBody> | ||
</Table> | ||
</TableContainer> | ||
); | ||
}; |
107 changes: 2 additions & 105 deletions
107
editor.planx.uk/src/pages/FlowEditor/components/Team/TeamMembers.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
18 changes: 18 additions & 0 deletions
18
editor.planx.uk/src/pages/FlowEditor/components/Team/styles.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import Avatar from "@mui/material/Avatar"; | ||
import { styled } from "@mui/material/styles"; | ||
import TableRow from "@mui/material/TableRow"; | ||
import { FONT_WEIGHT_SEMI_BOLD } from "theme"; | ||
|
||
export const StyledAvatar = styled(Avatar)(({ theme }) => ({ | ||
background: theme.palette.background.dark, | ||
color: theme.palette.common.white, | ||
fontSize: "1em", | ||
fontWeight: FONT_WEIGHT_SEMI_BOLD, | ||
marginRight: theme.spacing(1), | ||
})); | ||
|
||
export const StyledTableRow = styled(TableRow)(({ theme }) => ({ | ||
"&:nth-of-type(even)": { | ||
background: theme.palette.background.paper, | ||
}, | ||
})); |
9 changes: 9 additions & 0 deletions
9
editor.planx.uk/src/pages/FlowEditor/components/Team/types.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import { Role, User } from "@opensystemslab/planx-core/types"; | ||
|
||
export type TeamMember = Omit<User, "teams" | "isPlatformAdmin"> & { | ||
role: Role; | ||
}; | ||
|
||
export interface Props { | ||
teamMembersByRole: Record<string, TeamMember[]>; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters