Skip to content

Commit fb33868

Browse files
committed
chore: rename the dropdown label from raw revision string to Revision N
1 parent 1ce5acc commit fb33868

File tree

1 file changed

+32
-11
lines changed

1 file changed

+32
-11
lines changed

src/components/DatasetDetailPage/MetaDataPanel.tsx

Lines changed: 32 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -166,24 +166,45 @@ const MetaDataPanel: React.FC<Props> = ({
166166
Revisions
167167
</Typography>
168168

169-
<FormControl fullWidth size="small" sx={{ mb: 1 }}>
169+
<FormControl
170+
fullWidth
171+
size="small"
172+
sx={{
173+
mb: 1,
174+
"& .MuiOutlinedInput-root": {
175+
"& fieldset": {
176+
borderColor: Colors.purple,
177+
},
178+
"&:hover fieldset": {
179+
borderColor: Colors.purple,
180+
},
181+
"&.Mui-focused fieldset": {
182+
borderColor: Colors.purple,
183+
},
184+
},
185+
"& .MuiInputLabel-root.Mui-focused": {
186+
color: Colors.purple,
187+
},
188+
}}
189+
>
170190
<InputLabel id="rev-select-label">Select revision</InputLabel>
171191
<Select
172192
labelId="rev-select-label"
173193
label="Select revision"
174194
value={revIdx}
175195
onChange={(e) => setRevIdx(Number(e.target.value))}
176196
>
177-
{revs.map((r, idx) => (
178-
<MenuItem key={r.rev} value={idx}>
179-
<Typography
180-
component="span"
181-
sx={{ fontFamily: "monospace" }}
182-
>
183-
{r.rev.slice(0, 8)}{r.rev.slice(-4)}
184-
</Typography>
185-
</MenuItem>
186-
))}
197+
{revs.map((r, idx) => {
198+
const [verNum, hash] = r.rev.split("-", 2);
199+
return (
200+
<MenuItem key={r.rev} value={idx}>
201+
<Typography component="span">
202+
Revision {verNum} ({r.rev.slice(0, 8)}{r.rev.slice(-4)}
203+
)
204+
</Typography>
205+
</MenuItem>
206+
);
207+
})}
187208
</Select>
188209
</FormControl>
189210

0 commit comments

Comments
 (0)