-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1511 from cityofaustin/mike/20019_comp_work_types…
…_summary Add component work types summary field to project summary view
- Loading branch information
Showing
7 changed files
with
55 additions
and
12 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
2 changes: 1 addition & 1 deletion
2
moped-editor/src/views/projects/projectView/ProjectSummary/ProjectSummaryAutocomplete.js
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
37 changes: 37 additions & 0 deletions
37
...-editor/src/views/projects/projectView/ProjectSummary/ProjectSummaryComponentWorkTypes.js
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,37 @@ | ||
import Box from "@mui/material/Box"; | ||
import Grid from "@mui/material/Grid"; | ||
import Typography from "@mui/material/Typography"; | ||
import ProjectSummaryLabel from "src/views/projects/projectView/ProjectSummary/ProjectSummaryLabel"; | ||
|
||
/** | ||
* @param {Object} data - The query data | ||
* @param {Object} classes - The shared style settings | ||
* @return {JSX.Element} | ||
* @constructor | ||
*/ | ||
const ProjectSummaryComponentWorkTypes = ({ classes, data }) => { | ||
const componentWorkTypes = | ||
data?.project_list_view?.[0]?.component_work_type_names; | ||
/* component_work_type_names is a comma-separated list in the database view */ | ||
const componentWorkTypesArray = componentWorkTypes?.split(", ") ?? []; | ||
|
||
return ( | ||
<Grid item xs={12} className={classes.fieldGridItem}> | ||
<Typography className={classes.fieldLabel}> | ||
Component work types | ||
</Typography> | ||
<Box | ||
display="flex" | ||
justifyContent="flex-start" | ||
className={classes.fieldBox} | ||
> | ||
<ProjectSummaryLabel | ||
text={componentWorkTypesArray} | ||
className={classes.fieldLabelTextNoHover} | ||
/> | ||
</Box> | ||
</Grid> | ||
); | ||
}; | ||
|
||
export default ProjectSummaryComponentWorkTypes; |
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