Skip to content

Commit

Permalink
Remove surveyor from assignment button (#644)
Browse files Browse the repository at this point in the history
* Add a button to remove surveyors from individual assignments

* update rexml gem
  • Loading branch information
Andrewy-gh authored Nov 11, 2024
1 parent a3c95f6 commit b1d167a
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 11 deletions.
1 change: 0 additions & 1 deletion backend/Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,6 @@ GEM
rubocop (>= 1.52.0, < 2.0)
rubocop-ast (>= 1.31.1, < 2.0)
ruby-progressbar (1.13.0)
ruby2_keywords (0.0.5)
ruby_http_client (3.5.5)
sendgrid-actionmailer (3.2.0)
mail (~> 2.7)
Expand Down
23 changes: 13 additions & 10 deletions frontend/front/src/pages/Admin/assignment/AssignTable.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Box, Button, MenuItem, Stack } from "@mui/material";
import { Box, Button, Chip, MenuItem, Stack } from "@mui/material";
import React, { useMemo, useState } from "react";
import {
useAddAssignmentsToSurveyorMutation,
Expand Down Expand Up @@ -135,21 +135,24 @@ const AssignTable = () => {
maxWidth="100%"
justifyContent="flex-start"
overflow="scroll"
sx={{ overflowY: "auto", overflowX: "auto" }}
sx={{ overflowY: "auto", overflowX: "auto", pl: 2 }}
flexWrap="wrap"
>
{params.row.surveyorData.map((surveyor) => {
return (
<Button
<Chip
key={`surveyor-${surveyor.id}`}
label={`${surveyor.firstname} ${surveyor.lastname}`}
color="primary"
variant="outlined"
onClick={() => handleUserLink(surveyor)}
sx={{
textAlign: "left",
minWidth: "max-content",
}}
>
{`${surveyor.firstname} ${surveyor.lastname}`}
</Button>
onDelete={() =>
removeAssignmentsFromSurveyor({
surveyorId: surveyor.id,
assignmentIds: [params.row.id],
})
}
/>
);
})}
</Stack>
Expand Down

0 comments on commit b1d167a

Please sign in to comment.