Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions client/eslint.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ export default defineConfig([
{
files: ['**/*.{js,mjs,cjs,ts,mts,cts,jsx,tsx}'],
plugins: { js },
languageOptions: { globals: globals.jest, },
...js.configs.recommended,
},
// tseslint.configs.recommended,
pluginReact.configs.flat.recommended,
Expand Down Expand Up @@ -40,6 +42,11 @@ export default defineConfig([
'react-hooks/refs': 0,
'react/display-name': 0,
'react/prop-types': 0,
"no-unused-vars": ["error", {
"argsIgnorePattern": "^_",
"varsIgnorePattern": "^_",
"caughtErrorsIgnorePattern": "^_"
}],
},
},
]);
2 changes: 1 addition & 1 deletion client/src/components/Allocations/AllocationsCells.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ export const Remaining = ({ cell }) => {
};
return (
<div className="sub-table-row">
{cell.value.map(({ remaining, ratio, type, id }) => (
{cell.value.map(({ remaining, ratio, type, _id }) => (
<div key={uuidv4()} className="sub-table-cell">
<span>
<Badge
Expand Down
15 changes: 3 additions & 12 deletions client/src/components/Allocations/AllocationsLayout.jsx
Original file line number Diff line number Diff line change
@@ -1,16 +1,8 @@
import React from 'react';
import { useSelector } from 'react-redux';
import {
Link,
NavLink as RRNavLink,
Route,
useHistory,
Switch,
Redirect,
} from 'react-router-dom';
import { Nav, NavItem, NavLink } from 'reactstrap';
import { Link, Route, useHistory, Switch, Redirect } from 'react-router-dom';
import { string } from 'prop-types';
import { Icon, LoadingSpinner, Section, SectionTableWrapper } from '_common';
import { LoadingSpinner, Section, SectionTableWrapper } from '_common';
import { AllocationsTable } from './AllocationsTables';
import { AllocationsTeamViewModal } from './AllocationsModals';
import * as ROUTES from '../../constants/routes';
Expand All @@ -29,8 +21,7 @@ export const Header = ({ page }) => {
};
Header.propTypes = { page: string.isRequired };

export const Actions = ({ page }) => {
const root = `${ROUTES.WORKBENCH}${ROUTES.ALLOCATIONS}/${page}`;
export const Actions = ({ _page }) => {
return (
<a
className="btn btn-primary"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ const AllocationsManageTeamTable = ({ rawData, projectId }) => {
<Button
type="link"
disabled={removingUserOperation.loading}
onClick={(e) => {
onClick={(_e) => {
dispatch({
type: 'REMOVE_USER_FROM_TAS_PROJECT',
payload: {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import React from 'react';
import { vi } from 'vitest';
import { render, fireEvent } from '@testing-library/react';
import { BrowserRouter } from 'react-router-dom';
import { fireEvent } from '@testing-library/react';
import configureStore from 'redux-mock-store';
import { AllocationsTeamViewModal } from './index';
import renderComponent from 'utils/testing';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import React from 'react';
import { MemoryRouter } from 'react-router-dom';
import { render, fireEvent, waitFor } from '@testing-library/react';
import { Provider } from 'react-redux';
import { createMemoryHistory } from 'history';
import configureStore from 'redux-mock-store';
import { AllocationsTable } from '../AllocationsTables';

Expand All @@ -21,7 +20,7 @@ const mockInitialState = {
};
const mockStore = configureStore();
describe('Allocations Table', () => {
let getByText, rerender, debug;
let getByText, rerender;
beforeEach(() => {
const utils = render(
<Provider
Expand All @@ -36,7 +35,6 @@ describe('Allocations Table', () => {
);
getByText = utils.getByText;
rerender = utils.rerender;
debug = utils.debug;
});

it('should have relevant columns for data for the Allocations Table', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ describe('App Browser', () => {
const store = mockStore({
apps: { ...appTrayExpectedFixture, defaultTab: 'Simulation' },
});
const { container, getByText } = renderComponent(<AppBrowser />, store);
const { getByText } = renderComponent(<AppBrowser />, store);
expect(
getByText('Simulation [1]', { selector: '.active.nav-link .nav-text' })
).toBeDefined();
Expand Down
10 changes: 5 additions & 5 deletions client/src/components/Applications/AppForm/AppForm.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -492,7 +492,7 @@ export const AppSchemaForm = ({ app }) => {
validateOnMount={isFirstRender.current}
initialValues={initialValues}
initialTouched={initialValues}
validationSchema={(props) => {
validationSchema={(_props) => {
if (jobSubmission.submitting) {
/* to to avoid a strange error where values are valid but yup returns invalid,
we stop invalidating during submission. This occurs only when validateOnMount is set.
Expand Down Expand Up @@ -556,7 +556,7 @@ export const AppSchemaForm = ({ app }) => {
? getAllocationValidation(allocations).test(
'exec-systems-check',
'You need an allocation with access to at least one system to run this application.',
function (value) {
function (_value) {
const isValidExecSystems =
!isAppUsingDynamicExecSystem(app) ||
(isAppUsingDynamicExecSystem(app) &&
Expand All @@ -568,7 +568,7 @@ export const AppSchemaForm = ({ app }) => {
});
});
}}
onSubmit={(values, { setSubmitting, resetForm }) => {
onSubmit={(values, { _setSubmitting, _resetForm }) => {
const job = cloneDeep(values);
job.name = job.name.trim();

Expand Down Expand Up @@ -705,7 +705,7 @@ export const AppSchemaForm = ({ app }) => {
>
{({
values,
errors,
_errors,
isValid,
isSubmitting,
handleReset,
Expand Down Expand Up @@ -819,7 +819,7 @@ export const AppSchemaForm = ({ app }) => {
)}
{Object.entries(appFields.parameterSet)
.map(
([parameterSet, parameterValue]) =>
([_parameterSet, parameterValue]) =>
Object.keys(parameterValue).length
)
.reduce((a, b) => a + b) > 0 && (
Expand Down
5 changes: 1 addition & 4 deletions client/src/components/Applications/AppForm/AppForm.test.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -706,10 +706,7 @@ describe('AppSchemaForm', () => {
},
execSystems: execSystemsFixture,
};
const { getByText, container } = renderAppSchemaFormComponent(
store,
appFixture
);
const { container } = renderAppSchemaFormComponent(store, appFixture);
const execSystemDropDown = container.querySelector(
'select[name="execSystemId"]'
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ const FormSchema = (app) => {
regex,
param.notes.validator.message
);
} catch (SyntaxError) {
} catch (_SyntaxError) {
console.warn('Invalid regex pattern for app');
}
}
Expand Down
11 changes: 0 additions & 11 deletions client/src/components/Applications/AppForm/AppFormUtils.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,17 +23,6 @@ describe('AppFormUtils', () => {
},
};

const serialFronteraApp = {
...helloWorldAppFixture,
definition: {
...helloWorldAppFixture.definition,
notes: {
...helloWorldAppFixture.definition.notes,
hideNodeCountAndCoresPerNode: true,
},
},
};

const exampleFormValue = {
execSystemLogicalQueue: 'normal',
nodeCount: 1,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,6 @@ export const execSystemsFixture = [
batchSchedulerProfile: 'tacc-apptainer',
jobCapabilities: [],
tags: [],
tags: [],
notes: {
label: 'Frontera custom',
},
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from 'react';
import { render } from '@testing-library/react';
import { Provider, useSelector } from 'react-redux';
import { Provider } from 'react-redux';
import configureStore from 'redux-mock-store';
import AppsRoutes, { AppsLayout } from './AppLayout';
import { MemoryRouter, Route } from 'react-router-dom';
Expand Down Expand Up @@ -31,7 +31,7 @@ describe('AppsLayout', () => {
const store = mockStore({
apps: { ...appTrayExpectedFixture, loading: true, categoryDict: {} },
});
const { getByText, getByTestId } = renderComponent(<AppsLayout />, store);
const { getByTestId } = renderComponent(<AppsLayout />, store);
expect(getByTestId('loading-spinner')).toBeDefined();
});
it('Display the correct error message', () => {
Expand Down
2 changes: 1 addition & 1 deletion client/src/components/Dashboard/Dashboard.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ function Dashboard() {
const panelCount = getPanelCount(
['DashboardTickets'],
[hideApps, hideSystemMonitor].filter((isHidden) => !isHidden),
...(Boolean(customDashboardSection) ? [['customDashboardSection']] : [])
...(customDashboardSection ? [['customDashboardSection']] : [])
);

const contentLayoutName =
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import React from 'react';
import { useState } from 'react';
import { useDispatch } from 'react-redux';
import { Button } from '_common';
import PropTypes from 'prop-types';
Expand Down Expand Up @@ -117,9 +116,9 @@ const DataFilesBreadcrumbs = ({
scheme,
system,
path,
section,
operation,
isPublic,
_section,
_operation,
_isPublic,
className,
}) => {
const paths = [];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import renderComponent from 'utils/testing';
import DataFilesBreadcrumbs from './DataFilesBreadcrumbs';
import systemsFixture from '../fixtures/DataFiles.systems.fixture';
import filesFixture from '../fixtures/DataFiles.files.fixture';
import { initialSystemState } from '../../../redux/reducers/datafiles.reducers';
import { projectsFixture } from '../../../redux/sagas/fixtures/projects.fixture';
import { fireEvent } from '@testing-library/react';

Expand Down Expand Up @@ -118,7 +117,6 @@ describe('DataFilesBreadcrumbs', () => {
const store = mockStore({
systems: systemsFixture,
});
const history = createMemoryHistory();
const { getByText } = renderComponent(
<DataFilesBreadcrumbs
api="tapis"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ const BreadcrumbsDropdown = ({
scheme,
system,
path,
section,
_section,
isPublic,
}) => {
const paths = [];
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { useMemo } from 'react';
import React from 'react';
import { useSelector, useDispatch, shallowEqual } from 'react-redux';
import { Modal, ModalHeader, ModalBody, ModalFooter, Input } from 'reactstrap';
import { Button, FormField, InlineMessage, SectionMessage } from '_common';
Expand All @@ -16,11 +16,6 @@ const DataFilesDownloadMessageModal = () => {

const isOpen = useSelector((state) => state.files.modals.downloadMessage);

const params = useSelector(
(state) => state.files.params.FilesListing,
shallowEqual
);

const selectedFiles = useSelector(
({ files: { selected, listing } }) =>
selected.FilesListing.map((i) => ({
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React, { useMemo } from 'react';
import { useSelector, useDispatch } from 'react-redux';
import { useDispatch } from 'react-redux';
import { Modal, ModalHeader, ModalBody, ModalFooter } from 'reactstrap';
import { Button, InlineMessage } from '_common';
import { useHistory, useLocation } from 'react-router-dom';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,15 +40,15 @@ const DataFilesLinkActions = ({ status, onClick }) => {
disabled={disabled}
type="primary"
size="medium"
onClick={(e) => onClick('delete')}
onClick={(_e) => onClick('delete')}
>
Delete
</Button>
<Button
disabled={disabled}
type="primary"
size="medium"
onClick={(e) => onClick('put')}
onClick={(_e) => onClick('put')}
>
Replace Link
</Button>
Expand All @@ -61,7 +61,7 @@ const DataFilesLinkActions = ({ status, onClick }) => {
disabled={disabled}
type="primary"
size="long"
onClick={(e) => onClick('post')}
onClick={(_e) => onClick('post')}
>
Generate Link
</Button>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import {
import DataFilesTable from '../../DataFilesTable/DataFilesTable';
import { FileIcon } from '../../DataFilesListing/DataFilesListingCells';
import styles from './DataFilesModalListingTable.module.scss';
import { useSelector, shallowEqual } from 'react-redux';

export function getCurrentDirectory(path) {
return path.split('/').pop();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,8 @@
import React, { useCallback, useMemo, useState } from 'react';
import { useDispatch, useSelector } from 'react-redux';
import { useDispatch } from 'react-redux';
import { Modal, ModalHeader, ModalBody } from 'reactstrap';
import { useHistory, useLocation } from 'react-router-dom';
import {
useSelectedFiles,
useFileListing,
useSystems,
useModal,
} from 'hooks/datafiles';
import { useSelectedFiles, useFileListing, useModal } from 'hooks/datafiles';

import { useMove } from 'hooks/datafiles/mutations';
import DataFilesBreadcrumbs from '../DataFilesBreadcrumbs/DataFilesBreadcrumbs';
Expand All @@ -28,11 +23,6 @@ const DataFilesMoveModal = React.memo(() => {
const { move, status, setStatus } = useMove();

const dispatch = useDispatch();
const { data: systems } = useSystems();

const { fetchSelectedSystem } = useSystems();

const selectedSystem = fetchSelectedSystem(params);

const reloadPage = () => {
history.push(location.pathname);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,14 @@ const DataFilesRenameModal = () => {
params: { api, scheme },
} = useFileListing('FilesListing');

const { rename: renameCallback, setStatus } = useRename();
const { rename: renameCallback, _setStatus } = useRename();

const toggle = () => toggleModal({ operation: 'rename', props: {} });

const dispatch = useDispatch();
const history = useHistory();
const location = useLocation();
const reloadPage = (name, newPath) => {
const reloadPage = (_name, _newPath) => {
history.push(location.pathname);
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ function DataFilesUploadModalListingTable({
</tr>
</thead>
<tbody>
{uploadedFiles.map((file, i) => (
{uploadedFiles.map((file, _i) => (
<tr key={file.id}>
<td style={{ verticalAlign: 'middle' }}>{file.data.name}</td>
<td style={{ verticalAlign: 'middle' }}>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,7 @@ import DataFilesToolbarAppsModalFixture, {
compressAppFixture,
} from './DataFilesToolbarAppsModals.fixture';
import DataFilesCompressModal from '../DataFilesCompressModal';
import {
getAllocationForToolbarAction,
getAppUtil,
} from 'hooks/datafiles/mutations/toolbarAppUtils';
import { getAppUtil } from 'hooks/datafiles/mutations/toolbarAppUtils';

vi.mock('@tanstack/react-query');
vi.mock('hooks/datafiles/mutations/toolbarAppUtils');
Expand Down
Loading