Skip to content

Commit c3e0ae0

Browse files
committed
Prettier and lint fixes
1 parent e93b7fc commit c3e0ae0

File tree

14 files changed

+173
-126
lines changed

14 files changed

+173
-126
lines changed

web-ui/src/App.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ function SchemeToggle() {
4646

4747
const theme = createTheme({
4848
cssVariables: {
49-
colorSchemeSelector: 'data',
49+
colorSchemeSelector: 'data'
5050
},
5151
colorSchemes: {
5252
light: {

web-ui/src/components/expand-more/ExpandMore.jsx

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -9,24 +9,20 @@ const ExpandMore = styled(props => {
99
{props.children ? props.children : <ExpandMoreIcon />}
1010
</IconButton>
1111
);
12-
})(({
13-
theme
14-
}) => ({
12+
})(({ theme }) => ({
1513
transform: 'rotate(180deg)',
1614
marginLeft: 'auto',
1715
transition: theme.transitions.create('transform', {
1816
duration: theme.transitions.duration.shortest
1917
}),
20-
variants: [{
21-
props: (
22-
{
23-
expand
18+
variants: [
19+
{
20+
props: ({ expand }) => !expand,
21+
style: {
22+
transform: 'rotate(0deg)'
2423
}
25-
) => !expand,
26-
style: {
27-
transform: 'rotate(0deg)'
2824
}
29-
}]
25+
]
3026
}));
3127

3228
export default ExpandMore;

web-ui/src/components/notes/Note.jsx

Lines changed: 34 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ const Notes = props => {
100100
}
101101

102102
setNote(note => {
103-
const newNote = { ...note, description: content };
103+
const newNote = { ...note, description: content };
104104
updateNote(newNote, csrf);
105105
return newNote;
106106
});
@@ -125,32 +125,39 @@ const Notes = props => {
125125
</div>
126126
) : (
127127
<>
128-
<div style={{display:"none"}} data-testid="tiny-mce-checkin-notes" />
129-
<Editor
130-
apiKey="246ojmsp6c7qtnr9aoivktvi3mi5t7ywuf0vevn6wllfcn9e"
131-
id="tiny-mce-checkin-notes"
132-
value={note && note.description ? note.description : ''}
133-
onEditorChange={handleNoteChange}
134-
readOnly={
135-
currentCheckin?.completed ||
136-
note === undefined ||
137-
Object.keys(note) === 0
138-
}
139-
init={{
140-
promotion: false,
141-
plugins: 'lists',
142-
toolbar:
143-
'undo redo | blocks | ' +
144-
'bold italic underline strikethrough forecolor | alignleft aligncenter ' +
145-
'alignright alignjustify | bullist numlist outdent indent | ' +
146-
'removeformat | help',
147-
skin: document.querySelector('[data-dark]') ? 'oxide-dark' : 'oxide',
148-
content_css: document.querySelector('[data-dark]') ? 'dark' : 'default'
149-
}}
150-
tinymceScriptSrc={
151-
import.meta.env.VITE_APP_API_URL + '/js/tinymce/tinymce.min.js'
152-
}
153-
/>
128+
<div
129+
style={{ display: 'none' }}
130+
data-testid="tiny-mce-checkin-notes"
131+
/>
132+
<Editor
133+
apiKey="246ojmsp6c7qtnr9aoivktvi3mi5t7ywuf0vevn6wllfcn9e"
134+
id="tiny-mce-checkin-notes"
135+
value={note && note.description ? note.description : ''}
136+
onEditorChange={handleNoteChange}
137+
readOnly={
138+
currentCheckin?.completed ||
139+
note === undefined ||
140+
Object.keys(note) === 0
141+
}
142+
init={{
143+
promotion: false,
144+
plugins: 'lists',
145+
toolbar:
146+
'undo redo | blocks | ' +
147+
'bold italic underline strikethrough forecolor | alignleft aligncenter ' +
148+
'alignright alignjustify | bullist numlist outdent indent | ' +
149+
'removeformat | help',
150+
skin: document.querySelector('[data-dark]')
151+
? 'oxide-dark'
152+
: 'oxide',
153+
content_css: document.querySelector('[data-dark]')
154+
? 'dark'
155+
: 'default'
156+
}}
157+
tinymceScriptSrc={
158+
import.meta.env.VITE_APP_API_URL + '/js/tinymce/tinymce.min.js'
159+
}
160+
/>
154161
</>
155162
)}
156163
</CardContent>

web-ui/src/components/notes/Note.test.jsx

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -65,17 +65,21 @@ const notes = [
6565
];
6666

6767
const server = setupServer(
68-
http.get(`http://localhost:8080/services/checkin-notes?checkinid=${checkin.id}`, () => {
69-
return HttpResponse.json(notes);
70-
}),
68+
http.get(
69+
`http://localhost:8080/services/checkin-notes?checkinid=${checkin.id}`,
70+
() => {
71+
return HttpResponse.json(notes);
72+
}
73+
)
7174
);
7275

7376
beforeAll(() => server.listen({ onUnhandledRequest(request, print) {} }));
7477
afterEach(() => server.resetHandlers());
7578
afterAll(() => server.close());
7679

7780
it('renders correctly', async () => {
78-
await waitForSnapshot('tiny-mce-checkin-notes',
81+
await waitForSnapshot(
82+
'tiny-mce-checkin-notes',
7983
<Router history={history}>
8084
<AppContextProvider value={initialState}>
8185
<Notes

web-ui/src/components/private-note/PrivateNote.jsx

Lines changed: 41 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -163,38 +163,46 @@ const PrivateNote = () => {
163163
</div>
164164
) : (
165165
<>
166-
<div style={{ display: "none" }} data-testid="tiny-mce-checkin-private-notes" />
167-
<Editor
168-
apiKey="246ojmsp6c7qtnr9aoivktvi3mi5t7ywuf0vevn6wllfcn9e"
169-
id="tiny-mce-checkin-private-notes"
170-
value={note && note.description ? note.description : ''}
171-
onEditorChange={handleNoteChange}
172-
readOnly={
173-
currentCheckin?.completed ||
174-
note === undefined ||
175-
Object.keys(note) === 0
176-
}
177-
init={{
178-
promotion: false,
179-
plugins: 'lists',
180-
toolbar:
181-
'undo redo | blocks | ' +
182-
'bold italic underline strikethrough forecolor | alignleft aligncenter ' +
183-
'alignright alignjustify | bullist numlist outdent indent | ' +
184-
'removeformat | help',
185-
skin: document.querySelector('[data-dark]') ? 'oxide-dark' : 'oxide',
186-
content_css: document.querySelector('[data-dark]') ? 'dark' : 'default'
187-
}}
188-
tinymceScriptSrc={
189-
import.meta.env.VITE_APP_API_URL + '/js/tinymce/tinymce.min.js'
190-
}
191-
/>
166+
<div
167+
style={{ display: 'none' }}
168+
data-testid="tiny-mce-checkin-private-notes"
169+
/>
170+
<Editor
171+
apiKey="246ojmsp6c7qtnr9aoivktvi3mi5t7ywuf0vevn6wllfcn9e"
172+
id="tiny-mce-checkin-private-notes"
173+
value={note && note.description ? note.description : ''}
174+
onEditorChange={handleNoteChange}
175+
readOnly={
176+
currentCheckin?.completed ||
177+
note === undefined ||
178+
Object.keys(note) === 0
179+
}
180+
init={{
181+
promotion: false,
182+
plugins: 'lists',
183+
toolbar:
184+
'undo redo | blocks | ' +
185+
'bold italic underline strikethrough forecolor | alignleft aligncenter ' +
186+
'alignright alignjustify | bullist numlist outdent indent | ' +
187+
'removeformat | help',
188+
skin: document.querySelector('[data-dark]')
189+
? 'oxide-dark'
190+
: 'oxide',
191+
content_css: document.querySelector('[data-dark]')
192+
? 'dark'
193+
: 'default'
194+
}}
195+
tinymceScriptSrc={
196+
import.meta.env.VITE_APP_API_URL +
197+
'/js/tinymce/tinymce.min.js'
198+
}
199+
/>
192200
</>
193-
)}
194-
</CardContent>
195-
</Card>
196-
)
197-
);
198-
};
201+
)}
202+
</CardContent>
203+
</Card>
204+
)
205+
);
206+
};
199207

200-
export default PrivateNote;
208+
export default PrivateNote;

web-ui/src/components/private-note/PrivateNote.test.jsx

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -75,17 +75,21 @@ const notes = [
7575
];
7676

7777
const server = setupServer(
78-
http.get(`http://localhost:8080/services/private-notes?checkinid=${checkin.id}`, () => {
79-
return HttpResponse.json(notes);
80-
}),
78+
http.get(
79+
`http://localhost:8080/services/private-notes?checkinid=${checkin.id}`,
80+
() => {
81+
return HttpResponse.json(notes);
82+
}
83+
)
8184
);
8285

8386
beforeAll(() => server.listen({ onUnhandledRequest(request, print) {} }));
8487
afterEach(() => server.resetHandlers());
8588
afterAll(() => server.close());
8689

8790
it('renders correctly', async () => {
88-
await waitForSnapshot('tiny-mce-checkin-private-notes',
91+
await waitForSnapshot(
92+
'tiny-mce-checkin-private-notes',
8993
<Router history={history}>
9094
<AppContextProvider value={initialState}>
9195
<PrivateNote

web-ui/src/components/reviews/periods/ReviewPeriods.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -514,4 +514,4 @@ const ReviewPeriods = ({ onPeriodSelected, mode }) => {
514514
};
515515
ReviewPeriods.propTypes = propTypes;
516516
ReviewPeriods.displayName = displayName;
517-
export default ReviewPeriods;
517+
export default ReviewPeriods;

web-ui/src/pages/CheckinsPage.test.jsx

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -81,9 +81,12 @@ const server = setupServer(
8181
http.get('http://localhost:8080/services/document/1', () => {
8282
return HttpResponse.json(mockuments);
8383
}),
84-
http.get(`http://localhost:8080/services/checkin-notes?checkinid=${mockCheckinId}`, () => {
85-
return HttpResponse.json(notes);
86-
}),
84+
http.get(
85+
`http://localhost:8080/services/checkin-notes?checkinid=${mockCheckinId}`,
86+
() => {
87+
return HttpResponse.json(notes);
88+
}
89+
)
8790
);
8891

8992
beforeAll(() => server.listen({ onUnhandledRequest(request, print) {} }));

web-ui/src/pages/CloseWindow.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { useEffect } from 'react';
33

44
export default function CloseWindow() {
55
useEffect(() => {
6-
window.close();
6+
window.close();
77
}, []);
88
return <></>;
99
}

web-ui/src/pages/EmailPage.css

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,15 +25,16 @@
2525

2626
.email-page .email-format-container .email-format-button-selected {
2727
color: #313131;
28-
background-color: rgba(var(--mui-palette-primary-mainChannel) / var(--mui-palette-action-selectedOpacity));;
28+
background-color: rgba(
29+
var(--mui-palette-primary-mainChannel) /
30+
var(--mui-palette-action-selectedOpacity)
31+
);
2932
border: 2px solid green;
3033
text-align: center;
3134
margin: 0.5rem 3rem;
3235
}
3336

34-
.email-page
35-
.email-format-container
36-
.email-format-button-content {
37+
.email-page .email-format-container .email-format-button-content {
3738
width: 250px;
3839
color: var(--mui-palette-primary-text);
3940
height: 250px;

0 commit comments

Comments
 (0)