Skip to content

Commit 600a01c

Browse files
committed
fix: lint
1 parent a44a221 commit 600a01c

6 files changed

Lines changed: 74 additions & 66 deletions

File tree

src/taxonomy/data/apiHooks.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,7 @@ export const useCreateTag = (taxonomyId: number) => {
230230
const queryClient = useQueryClient();
231231

232232
return useMutation({
233-
mutationFn: async ({ value, parentTagValue }: { value: string, parentTagValue?: string }) => {
233+
mutationFn: async ({ value, parentTagValue }: { value: string; parentTagValue?: string; }) => {
234234
await getAuthenticatedHttpClient().post(
235235
apiUrls.createTag(taxonomyId),
236236
{ tag: value, parent_tag_value: parentTagValue },
@@ -254,7 +254,7 @@ export const useUpdateTag = (taxonomyId: number) => {
254254
const queryClient = useQueryClient();
255255

256256
return useMutation({
257-
mutationFn: async ({ value, originalValue }: { value: string, originalValue: string }) => {
257+
mutationFn: async ({ value, originalValue }: { value: string; originalValue: string; }) => {
258258
await getAuthenticatedHttpClient().patch(
259259
apiUrls.updateTag(taxonomyId),
260260
{ tag: originalValue, updated_tag_value: value },

src/taxonomy/tag-list/UsageCountDisplay.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ const asTagListRowData = (row: Row<TreeRowData>): TagListRowData => (
1111
row.original as unknown as TagListRowData
1212
);
1313

14-
const UsageCountDisplay = ({ row }: { row: Row<TreeRowData> }) => {
14+
const UsageCountDisplay = ({ row }: { row: Row<TreeRowData>; }) => {
1515
const count = asTagListRowData(row).usageCount ?? 0;
1616

1717
if (count <= 0) {

src/taxonomy/tree-table/DraftRow.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@ const DraftRow: React.FC<DraftRowProps> = ({
3434
rowTestId,
3535
rowId,
3636
row,
37-
3837
}) => {
3938
const [rowValue, setRowValue] = useState(initialValue);
4039
const [saveDisabled, setSaveDisabled] = useState(true);

src/taxonomy/tree-table/NestedRows.tsx

Lines changed: 36 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -112,43 +112,43 @@ const NestedRows = ({
112112
const rowData = row.original || row;
113113
return (
114114
<React.Fragment key={String(rowData.id)}>
115-
{editingRowId === `${row.original.id}:${String(row.original.value)}` ? (
116-
<EditRow
117-
draftError={draftError}
118-
setDraftError={setDraftError}
119-
initialValue={String(row.original.value)}
120-
handleUpdateRow={(value) => handleUpdateRow(value, String(row.original.value))}
121-
cancelEditRow={() => {
122-
setEditingRowId(null);
123-
exitDraftWithoutSave();
124-
}}
125-
updateRowMutation={updateRowMutation}
126-
indent={indent}
127-
validate={validate}
128-
row={row}
129-
/>
130-
) : (
131-
<tr>
132-
{row.getVisibleCells()
133-
.map((cell, index) => {
134-
const content = flexRender(cell.column.columnDef.cell, cell.getContext());
135-
const isFirstColumn = index === 0;
115+
{editingRowId === `${row.original.id}:${String(row.original.value)}` ?
116+
(
117+
<EditRow
118+
draftError={draftError}
119+
setDraftError={setDraftError}
120+
initialValue={String(row.original.value)}
121+
handleUpdateRow={(value) => handleUpdateRow(value, String(row.original.value))}
122+
cancelEditRow={() => {
123+
setEditingRowId(null);
124+
exitDraftWithoutSave();
125+
}}
126+
updateRowMutation={updateRowMutation}
127+
indent={indent}
128+
validate={validate}
129+
row={row}
130+
/>
131+
) :
132+
(
133+
<tr>
134+
{row.getVisibleCells()
135+
.map((cell, index) => {
136+
const content = flexRender(cell.column.columnDef.cell, cell.getContext());
137+
const isFirstColumn = index === 0;
136138

137-
return (
138-
<td
139-
key={cell.id}
140-
className="p-1 tree-table-overflow-anywhere"
141-
>
142-
{isFirstColumn ? (
143-
<div className={`tree-table-indent tree-table-indent-${indent}`}>{content}</div>
144-
) : (
145-
content
146-
)}
147-
</td>
148-
);
149-
})}
150-
</tr>
151-
)}
139+
return (
140+
<td
141+
key={cell.id}
142+
className="p-1 tree-table-overflow-anywhere"
143+
>
144+
{isFirstColumn ?
145+
<div className={`tree-table-indent tree-table-indent-${indent}`}>{content}</div> :
146+
content}
147+
</td>
148+
);
149+
})}
150+
</tr>
151+
)}
152152
<NestedRows
153153
parentRow={row}
154154
childRowsData={row.subRows as TreeRow[]}

src/taxonomy/tree-table/SaveErrorAlert.tsx

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,18 @@ const SaveErrorAlert = ({ draftError, isError, isUpdateError }: SaveErrorAlertPr
3030
if (!alertOpen) { return null; }
3131

3232
return (
33-
<Alert variant="danger" icon={Info} dismissible onClose={() => { setAlertOpen(false); }}>
33+
<Alert
34+
variant="danger"
35+
icon={Info}
36+
dismissible
37+
onClose={() => {
38+
setAlertOpen(false);
39+
}}
40+
>
3441
<Alert.Heading>
3542
{intl.formatMessage(messages.errorSavingTitle)}
3643
</Alert.Heading>
37-
{intl.formatMessage(messages.errorSavingMessage, { errorMessage: draftError }) }
44+
{intl.formatMessage(messages.errorSavingMessage, { errorMessage: draftError })}
3845
</Alert>
3946
);
4047
};

src/taxonomy/tree-table/TableBody.tsx

Lines changed: 26 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -93,30 +93,32 @@ const TableBody = ({
9393

9494
{table.getRowModel().rows.filter(row => row.depth === 0).map(row => (
9595
<React.Fragment key={row.id}>
96-
{editingRowId === `${row.original.id}:${String(row.original.value)}` ? (
97-
<EditRow
98-
draftError={draftError}
99-
setDraftError={setDraftError}
100-
initialValue={String(row.original.value)}
101-
handleUpdateRow={(value) => handleUpdateRow(value, String(row.original.value))}
102-
cancelEditRow={() => {
103-
setEditingRowId(null);
104-
exitDraftWithoutSave();
105-
}}
106-
updateRowMutation={updateRowMutation}
107-
validate={validate}
108-
row={row}
109-
/>
110-
) : (
111-
<tr>
112-
{row.getVisibleCells()
113-
.map((cell) => (
114-
<td key={cell.id} className="p-1">
115-
{flexRender(cell.column.columnDef.cell, cell.getContext())}
116-
</td>
117-
))}
118-
</tr>
119-
)}
96+
{editingRowId === `${row.original.id}:${String(row.original.value)}` ?
97+
(
98+
<EditRow
99+
draftError={draftError}
100+
setDraftError={setDraftError}
101+
initialValue={String(row.original.value)}
102+
handleUpdateRow={(value) => handleUpdateRow(value, String(row.original.value))}
103+
cancelEditRow={() => {
104+
setEditingRowId(null);
105+
exitDraftWithoutSave();
106+
}}
107+
updateRowMutation={updateRowMutation}
108+
validate={validate}
109+
row={row}
110+
/>
111+
) :
112+
(
113+
<tr>
114+
{row.getVisibleCells()
115+
.map((cell) => (
116+
<td key={cell.id} className="p-1">
117+
{flexRender(cell.column.columnDef.cell, cell.getContext())}
118+
</td>
119+
))}
120+
</tr>
121+
)}
120122
<NestedRows
121123
parentRow={row}
122124
childRowsData={row.subRows}

0 commit comments

Comments
 (0)