Skip to content

Commit ff20f6b

Browse files
committed
fix: lint
1 parent 675a566 commit ff20f6b

11 files changed

Lines changed: 17 additions & 18 deletions

File tree

src/taxonomy/data/apiHooks.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
import { useQuery, useMutation, useQueryClient } from '@tanstack/react-query';
1414
import { camelCaseObject } from '@edx/frontend-platform';
1515
import { getAuthenticatedHttpClient } from '@edx/frontend-platform/auth';
16-
import { useIntl } from '@edx/frontend-platform/i18n';
1716
import { apiUrls, ALL_TAXONOMIES, getApiErrorMessage } from './api';
1817
import * as api from './api';
1918
import type { QueryOptions, TagListData } from './types';

src/taxonomy/tag-list/OptionalExpandLink.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { ExpandLess, ExpandMore } from '@openedx/paragon/icons';
44
import { Row } from '@tanstack/react-table';
55
import { useIntl } from '@edx/frontend-platform/i18n';
66

7-
import type { TreeRowData } from '../tree-table/types';
7+
import type { TreeRowData } from '@src/taxonomy/tree-table/types';
88
import messages from './messages';
99

1010
interface OptionalExpandLinkProps {

src/taxonomy/tag-list/TagListTable.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ import React, {
44
useEffect,
55
} from 'react';
66
import type { PaginationState } from '@tanstack/react-table';
7-
import { useTagListData, useCreateTag, useUpdateTag } from '../data/apiHooks';
7+
import { TableView } from '@src/taxonomy/tree-table';
8+
import { useTagListData, useCreateTag, useUpdateTag } from '@src/taxonomy/data/apiHooks';
89
import { TagTree } from './tagTree';
9-
import { TableView } from '../tree-table';
1010
import type {
1111
RowId,
1212
TreeColumnDef,

src/taxonomy/tag-list/UsageCountDisplay.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import {
44
import type { Row } from '@tanstack/react-table';
55
import type {
66
TreeRowData,
7-
} from '../tree-table/types';
7+
} from '@src/taxonomy/tree-table/types';
88
import { TagListRowData } from './types';
99

1010
const asTagListRowData = (row: Row<TreeRowData>): TagListRowData => (

src/taxonomy/tag-list/hooks.ts

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
import { useReducer } from 'react';
22
import { useIntl } from '@edx/frontend-platform/i18n';
33

4-
import { useCreateTag, useUpdateTag } from '../data/apiHooks';
4+
import globalMessages from '@src/messages';
5+
import { useCreateTag, useUpdateTag } from '@src/taxonomy/data/apiHooks';
6+
import type { RowId } from '@src/taxonomy/tree-table/types';
57
import { TagTree } from './tagTree';
68
import { TagListTableError } from './errors';
7-
import type { RowId } from '../tree-table/types';
89
import {
910
TABLE_MODES,
1011
TRANSITION_TABLE,
@@ -13,8 +14,6 @@ import {
1314
} from './constants';
1415

1516
import messages from './messages';
16-
import globalMessages from '../../messages';
17-
import { AxiosError } from 'axios';
1817

1918
/** Interface for table mode actions for React's `useReducer` hook.
2019
*
@@ -165,9 +164,9 @@ const useEditActions = ({
165164
return true;
166165
};
167166

168-
const getErrorMessage = (error: unknown): string => {
167+
const getErrorMessage = (error: any): string => {
169168
let errorMessage: string = '';
170-
if (error instanceof AxiosError) {
169+
if (error.name === 'AxiosError') {
171170
const responseData = error.response?.data;
172171
const tagError = Object.entries(responseData)?.find((errItem: [string, unknown]) => (
173172
['tag', 'value', 'updated_tag_value'].includes(errItem[0].toLowerCase())

src/taxonomy/tag-list/tagColumns.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,13 @@ import {
1111
import { FormattedMessage, useIntl } from '@edx/frontend-platform/i18n';
1212
import type { Row } from '@tanstack/react-table';
1313

14-
import messages from './messages';
1514
import type {
1615
RowId,
1716
TreeColumnDef,
1817
TreeRowData,
19-
} from '../tree-table/types';
18+
} from '@src/taxonomy/tree-table/types';
2019
import { TagListRowData } from './types';
20+
import messages from './messages';
2121
import OptionalExpandLink from './OptionalExpandLink';
2222
import UsageCountDisplay from './UsageCountDisplay';
2323

src/taxonomy/tag-list/tagTree.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1+
import type { TagData } from '@src/taxonomy/data/types';
12
import { TagTreeError } from './errors';
2-
import type { TagData } from '../data/types';
33

44
export interface TagTreeNode extends TagData {
55
subRows?: TagTreeNode[];

src/taxonomy/tag-list/types.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { TreeRowData } from '../tree-table/types';
1+
import { TreeRowData } from '@src/taxonomy/tree-table/types';
22

33
export interface TagListRowData extends TreeRowData {
44
depth: number;

src/taxonomy/tree-table/DraftRow.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@ import { useIntl } from '@edx/frontend-platform/i18n';
33
import { Button, Spinner } from '@openedx/paragon';
44
import { Row } from '@tanstack/react-table';
55

6+
import UsageCountDisplay from '@src/taxonomy/tag-list/UsageCountDisplay';
67
import { EditableCell } from './EditableCell';
78
import type { CreateRowMutationState, TreeRowData } from './types';
89
import messages from './messages';
9-
import UsageCountDisplay from '../tag-list/UsageCountDisplay';
1010

1111
interface DraftRowProps {
1212
draftError: string;

src/taxonomy/tree-table/EditableCell.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,9 @@ import React, {
77

88
import { Form } from '@openedx/paragon';
99
import { useIntl } from '@edx/frontend-platform/i18n';
10+
11+
import OptionalExpandLink from '@src/taxonomy/tag-list/OptionalExpandLink';
1012
import messages from './messages';
11-
import OptionalExpandLink from '../tag-list/OptionalExpandLink';
1213

1314
/**
1415
* Props for the EditableCell component.

0 commit comments

Comments
 (0)