Skip to content

Commit b1be577

Browse files
committed
Fixed implementation to pass lint check at the CI processing
1 parent 9423d02 commit b1be577

File tree

4 files changed

+43
-32
lines changed

4 files changed

+43
-32
lines changed

entry/api_v2/views.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -869,8 +869,8 @@ def delete(self, request: Request, *args, **kwargs) -> Response:
869869
if isAll and target_model is not None:
870870
entries = Entry.objects.filter(schema=target_model, is_active=True).exclude(id__in=ids)
871871
for entry in entries:
872-
job: Job = Job.new_delete_entry_v2(user, entry)
873-
job.run()
872+
another_job: Job = Job.new_delete_entry_v2(user, entry)
873+
another_job.run()
874874

875875
return Response(status=status.HTTP_204_NO_CONTENT)
876876

frontend/src/components/common/Confirmable.tsx

+9-4
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,11 @@
1-
import { Box, Button, Dialog, DialogActions, DialogTitle, DialogContent } from "@mui/material";
1+
import {
2+
Box,
3+
Button,
4+
Dialog,
5+
DialogActions,
6+
DialogTitle,
7+
DialogContent,
8+
} from "@mui/material";
29
import React, { ReactElement, FC, SyntheticEvent, useState } from "react";
310

411
interface Props {
@@ -40,9 +47,7 @@ export const Confirmable: FC<Props> = ({
4047
>
4148
<DialogTitle id="alert-dialog-title">{dialogTitle}</DialogTitle>
4249
<DialogContent>
43-
<>
44-
{content}
45-
</>
50+
<>{content}</>
4651
</DialogContent>
4752
<DialogActions>
4853
<Button onClick={handleConfirmed} color="primary" autoFocus>

frontend/src/pages/AdvancedSearchResultsPage.tsx

+13-7
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,8 @@ import {
1111
Button,
1212
Checkbox,
1313
FormControlLabel,
14-
FormGroup,
1514
IconButton,
16-
Typography
15+
Typography,
1716
} from "@mui/material";
1817
import { useSnackbar } from "notistack";
1918
import React, { FC, useEffect, useMemo, useState } from "react";
@@ -171,7 +170,10 @@ export const AdvancedSearchResultsPage: FC = () => {
171170

172171
const handleBulkDelete = async () => {
173172
try {
174-
await aironeApiClient.destroyEntries(bulkOperationEntryIds, isDeleteAllItems);
173+
await aironeApiClient.destroyEntries(
174+
bulkOperationEntryIds,
175+
isDeleteAllItems
176+
);
175177
enqueueSnackbar("複数アイテムの削除に成功しました", {
176178
variant: "success",
177179
});
@@ -260,10 +262,14 @@ export const AdvancedSearchResultsPage: FC = () => {
260262
dialogTitle="本当に削除しますか?"
261263
onClickYes={handleBulkDelete}
262264
content={
263-
bulkOperationEntryIds.length == AdvancedSerarchResultListParam.MAX_ROW_COUNT ? (
264-
<FormControlLabel control={
265-
<Checkbox onChange={(e) => setIsDeleteAllItems(true)} />
266-
} label="未選択のアイテムもまとめて削除する" />
265+
bulkOperationEntryIds.length ==
266+
AdvancedSerarchResultListParam.MAX_ROW_COUNT ? (
267+
<FormControlLabel
268+
control={
269+
<Checkbox onChange={() => setIsDeleteAllItems(true)} />
270+
}
271+
label="未選択のアイテムもまとめて削除する"
272+
/>
267273
) : (
268274
<></>
269275
)

frontend/src/repository/AironeApiClient.ts

+19-19
Original file line numberDiff line numberDiff line change
@@ -218,17 +218,17 @@ class AironeApiClient {
218218
): Promise<PaginatedEntityListList> {
219219
const params: EntityApiV2ListRequest = page
220220
? {
221-
offset: (page - 1) * EntityListParam.MAX_ROW_COUNT,
222-
limit: EntityListParam.MAX_ROW_COUNT,
223-
search: search,
224-
isToplevel: isToplevel,
225-
}
221+
offset: (page - 1) * EntityListParam.MAX_ROW_COUNT,
222+
limit: EntityListParam.MAX_ROW_COUNT,
223+
search: search,
224+
isToplevel: isToplevel,
225+
}
226226
: {
227-
// Any better way to get all the entities?
228-
limit: Number.MAX_SAFE_INTEGER,
229-
search: search,
230-
isToplevel: isToplevel,
231-
};
227+
// Any better way to get all the entities?
228+
limit: Number.MAX_SAFE_INTEGER,
229+
search: search,
230+
isToplevel: isToplevel,
231+
};
232232

233233
return await this.entity.entityApiV2List(params);
234234
}
@@ -635,16 +635,16 @@ class AironeApiClient {
635635
return await this.category.categoryApiV2List(
636636
page
637637
? {
638-
limit: EntityListParam.MAX_ROW_COUNT,
639-
offset: (page - 1) * EntityListParam.MAX_ROW_COUNT,
640-
ordering: ordering,
641-
search: search,
642-
}
638+
limit: EntityListParam.MAX_ROW_COUNT,
639+
offset: (page - 1) * EntityListParam.MAX_ROW_COUNT,
640+
ordering: ordering,
641+
search: search,
642+
}
643643
: {
644-
limit: EntityListParam.MAX_ROW_COUNT,
645-
ordering: ordering,
646-
search: search,
647-
}
644+
limit: EntityListParam.MAX_ROW_COUNT,
645+
ordering: ordering,
646+
search: search,
647+
}
648648
);
649649
}
650650

0 commit comments

Comments
 (0)