Skip to content

Commit 24028ee

Browse files
committed
Fix more conflicts
1 parent 54fe75c commit 24028ee

5 files changed

Lines changed: 123 additions & 84 deletions

File tree

moped-editor/src/views/dashboard/DashboardView.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -338,8 +338,8 @@ const DashboardView = () => {
338338
width: "100%",
339339
}}
340340
>
341-
<DataGridPro
342-
sx={dataGridProStyleOverrides}
341+
<MopedDataGrid
342+
density="standard"
343343
columns={dataGridColumns}
344344
rows={rows || []}
345345
loading={loading || !data}

moped-editor/src/views/dev/LookupsView/index.js

Lines changed: 104 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ const LookupsView = () => {
101101
<Typography
102102
variant="h1"
103103
color="primary"
104-
sx={(theme) => ({ marginTop: theme.spacing(3) })}
104+
sx={(theme) => ({ paddingTop: theme.spacing(3) })}
105105
>
106106
Data dictionary
107107
</Typography>
@@ -127,58 +127,118 @@ const LookupsView = () => {
127127
</Paper>
128128

129129
{SETTINGS.map((recordType) => (
130-
<Paper sx={{ paddingLeft: 3 }} key={recordType.key}>
130+
<Paper sx={{ px: 3, pb: 3 }} key={recordType.key}>
131131
<Grid2
132132
container
133133
spacing={3}
134134
sx={{ marginTop: 3 }}
135135
ref={refs[recordType.key]}
136136
>
137137
<Grid2 size={12}>
138-
<Grid2
139-
container
140-
direction="row"
141-
spacing={1}
142-
sx={(theme) => ({
143-
marginTop: theme.spacing(3),
144-
alignItems: "center",
145-
})}
146-
>
147-
<Grid2>
148-
<Typography variant="h2">{recordType.label}</Typography>
149-
</Grid2>
150-
<Grid2>
151-
<Tooltip title="Return to top of page">
152-
<IconButton
153-
component={Link}
154-
to={"#"}
155-
onClick={(e) => {
156-
e.preventDefault();
157-
scrollToTable("_scroll_to_top", refs);
158-
history.replace("");
159-
}}
160-
size="large"
138+
{TAG_TABLE_KEYS.includes(recordType.key) ? (
139+
<Can
140+
perform="lookups:edit"
141+
yes={
142+
recordType.key === "moped_component_tags" ? (
143+
<ComponentTagsTable
144+
canEdit={true}
145+
handleSnackbar={handleSnackbar}
146+
onScrollToTop={() => {
147+
scrollToTable("_scroll_to_top", refs);
148+
history.replace("");
149+
}}
150+
/>
151+
) : (
152+
<ProjectTagsTable
153+
canEdit={true}
154+
handleSnackbar={handleSnackbar}
155+
onScrollToTop={() => {
156+
scrollToTable("_scroll_to_top", refs);
157+
history.replace("");
158+
}}
159+
/>
160+
)
161+
}
162+
no={
163+
recordType.key === "moped_component_tags" ? (
164+
<ComponentTagsTable
165+
canEdit={false}
166+
handleSnackbar={handleSnackbar}
167+
onScrollToTop={() => {
168+
scrollToTable("_scroll_to_top", refs);
169+
history.replace("");
170+
}}
171+
/>
172+
) : (
173+
<ProjectTagsTable
174+
canEdit={false}
175+
handleSnackbar={handleSnackbar}
176+
onScrollToTop={() => {
177+
scrollToTable("_scroll_to_top", refs);
178+
history.replace("");
179+
}}
180+
/>
181+
)
182+
}
183+
/>
184+
) : (
185+
<Grid2
186+
container
187+
direction="row"
188+
spacing={1}
189+
sx={(theme) => ({
190+
paddingTop: theme.spacing(3),
191+
alignItems: "center",
192+
justifyContent: "space-between",
193+
})}
194+
>
195+
<Grid2>
196+
<Grid2
197+
container
198+
direction="row"
199+
spacing={1}
200+
sx={{ alignItems: "center" }}
161201
>
162-
<ArrowUpwardIcon fontSize="small" />
163-
</IconButton>
164-
</Tooltip>
165-
</Grid2>
166-
<Grid2>
167-
<CopyTextButton
168-
copyButtonText="Copy link"
169-
textToCopy={`${
170-
window.location.origin
171-
}${pathname}${createRecordKeyHash(recordType.key)}`}
172-
/>
173-
</Grid2>
174-
<Grid2 size={12}>
175-
<RecordTable
176-
rows={data?.[recordType.key]}
177-
columns={recordType.columns}
178-
loading={loading}
179-
/>
202+
<Grid2>
203+
<Typography variant="h2">
204+
{recordType.label}
205+
</Typography>
206+
</Grid2>
207+
<Grid2>
208+
<Tooltip title="Return to top of page">
209+
<IconButton
210+
component={Link}
211+
to={"#"}
212+
onClick={(e) => {
213+
e.preventDefault();
214+
scrollToTable("_scroll_to_top", refs);
215+
history.replace("");
216+
}}
217+
size="large"
218+
>
219+
<ArrowUpwardIcon fontSize="small" />
220+
</IconButton>
221+
</Tooltip>
222+
</Grid2>
223+
</Grid2>
224+
</Grid2>
225+
<Grid2>
226+
<CopyTextButton
227+
copyButtonText="Copy link"
228+
textToCopy={`${
229+
window.location.origin
230+
}${pathname}${createRecordKeyHash(recordType.key)}`}
231+
/>
232+
</Grid2>
233+
<Grid2 size={12}>
234+
<RecordTable
235+
rows={data?.[recordType.key]}
236+
columns={recordType.columns}
237+
loading={loading}
238+
/>
239+
</Grid2>
180240
</Grid2>
181-
</Grid2>
241+
)}
182242
</Grid2>
183243
</Grid2>
184244
</Paper>

moped-editor/src/views/projects/projectView/ProjectSummary/ProjectSummary.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -172,9 +172,7 @@ const ProjectSummary = ({
172172
data?.moped_project[0]?.ecapris_subproject_id
173173
}
174174
loading={loading}
175-
eCaprisSubprojectId={
176-
data?.moped_project?.[0]?.ecapris_subproject_id
177-
}
175+
options={data?.ecapris_subproject_funding ?? []}
178176
refetch={refetch}
179177
handleSnackbar={handleSnackbar}
180178
/>

moped-editor/src/views/projects/projectView/ProjectSummary/ProjectSummaryProjectECapris.js

Lines changed: 14 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
1-
import React, { useEffect, useState } from "react";
2-
import { Box, Grid2, Stack, TextField, Typography } from "@mui/material";
1+
import React, { useState } from "react";
2+
import ProjectSummaryIconButtons from "src/views/projects/projectView/ProjectSummary/ProjectSummaryIconButtons";
3+
import ProjectSummaryLabel from "src/views/projects/projectView/ProjectSummary/ProjectSummaryLabel";
4+
import CopyTextButton from "src/components/CopyTextButton";
5+
import ExternalLink, { createBugReportLink } from "src/components/ExternalLink";
6+
import Autocomplete from "@mui/material/Autocomplete";
7+
import TextField from "@mui/material/TextField";
8+
import { Box, Grid2, Stack, Typography } from "@mui/material";
9+
import { useMutation } from "@apollo/client";
10+
import { useUser } from "src/auth/user";
311

412
import {
513
fieldBox,
@@ -12,26 +20,6 @@ import {
1220
PROJECT_CLEAR_ECAPRIS_SUBPROJECT_ID,
1321
} from "src/queries/project";
1422

15-
/**
16-
* Custom wrapper for the eCapris edit field
17-
* @param {JSX.Element} children - Any children
18-
* @param {boolean} noWrapper - If false, it provides a null wrapper
19-
* @returns {JSX.Element}
20-
* @constructor
21-
*/
22-
const WrapperComponent = ({ children, noWrapper }) =>
23-
noWrapper ? (
24-
<>
25-
<Typography sx={fieldLabel}>eCAPRIS Subproject ID</Typography>
26-
{children}
27-
</>
28-
) : (
29-
<Grid2 sx={fieldGridItem} size={12}>
30-
<Typography sx={fieldLabel}>eCAPRIS Subproject ID</Typography>
31-
{children}
32-
</Grid2>
33-
);
34-
3523
/**
3624
* ProjectSummaryProjectECapris Component
3725
* @param {Number} projectId - The id of the current project being viewed
@@ -110,16 +98,9 @@ const ProjectSummaryProjectECapris = ({
11098
};
11199

112100
return (
113-
<WrapperComponent noWrapper={noWrapper}>
114-
<Box
115-
sx={[
116-
{
117-
display: "flex",
118-
justifyContent: "flex-start",
119-
},
120-
...(Array.isArray(fieldBox) ? fieldBox : [fieldBox]),
121-
]}
122-
>
101+
<Grid2 size={12} sx={fieldGridItem}>
102+
<Typography sx={fieldLabel}>eCAPRIS subproject ID</Typography>
103+
<Box display="flex" justifyContent="flex-start" sx={fieldBox}>
123104
{editMode && (
124105
<>
125106
<Autocomplete
@@ -197,7 +178,7 @@ const ProjectSummaryProjectECapris = ({
197178
</Stack>
198179
)}
199180
</Box>
200-
</Grid>
181+
</Grid2>
201182
);
202183
};
203184

moped-editor/src/views/projects/projectsListView/components/MapDrawer.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,8 +98,8 @@ function DrawerContent({
9898
onClick={toggleDrawer}
9999
sx={(theme) => ({
100100
position: "absolute",
101-
right: theme.spacing(0.5),
102-
top: theme.spacing(0.5),
101+
right: open ? theme.spacing(1) : null,
102+
top: open ? theme.spacing(1) : null,
103103
zIndex: 2,
104104
})}
105105
>

0 commit comments

Comments
 (0)