some linting w/ burnettk

This commit is contained in:
jasquat 2025-01-27 16:36:22 -05:00
parent 16299c2c9f
commit 536ec8b0b0
No known key found for this signature in database
10 changed files with 42 additions and 29 deletions

View File

@ -14,9 +14,9 @@ type OwnProps = {
title?: string;
confirmButtonLabel?: string;
kind?: 'text' | 'outlined' | 'contained';
renderIcon?: JSX.Element;
renderIcon?: Element;
iconDescription?: string | null;
hasIconOnly?: boolean;
// hasIconOnly?: boolean;
classNameForModal?: string;
};
@ -30,7 +30,7 @@ export default function ButtonWithConfirmation({
kind = 'contained',
renderIcon,
iconDescription = null,
hasIconOnly = false,
// hasIconOnly = false,
classNameForModal,
}: OwnProps) {
const [showConfirmationPrompt, setShowConfirmationPrompt] = useState(false);

View File

@ -188,7 +188,7 @@ export default function DataStoreForm({
data-qa="data-store-name-input"
name="name"
error={nameInvalid}
helperText={nameInvalid ? "Name is required." : ""}
helperText={nameInvalid ? 'Name is required.' : ''}
label="Name*"
value={dataStore.name}
onChange={(event: any) => onNameChanged(event.target.value)}
@ -203,7 +203,11 @@ export default function DataStoreForm({
readOnly: mode === 'edit',
}}
error={identifierInvalid}
helperText={identifierInvalid ? "Identifier is required and must be all lowercase characters and hyphens." : ""}
helperText={
identifierInvalid
? 'Identifier is required and must be all lowercase characters and hyphens.'
: ''
}
label="Identifier*"
value={dataStore.id}
onChange={(event: any) => {
@ -245,7 +249,7 @@ export default function DataStoreForm({
</MenuItem>
))}
</Select>
</FormControl>
</FormControl>,
);
}
@ -254,7 +258,9 @@ export default function DataStoreForm({
id="data-store-schema"
name="schema"
error={schemaInvalid}
helperText={schemaInvalid ? "Schema is required and must be valid JSON." : ""}
helperText={
schemaInvalid ? 'Schema is required and must be valid JSON.' : ''
}
label="Schema*"
multiline
minRows={3}
@ -280,7 +286,11 @@ export default function DataStoreForm({
};
const formButtons = () => {
return <Button type="submit" variant="contained">Submit</Button>;
return (
<Button type="submit" variant="contained">
Submit
</Button>
);
};
return (

View File

@ -6,7 +6,6 @@ import {
TableBody,
TableCell,
TableContainer,
TablePagination,
Paper,
MenuItem,
Select,
@ -127,13 +126,17 @@ export default function DataStoreListTable() {
return (
<>
<FormControl fullWidth>
<InputLabel id="data-store-dropdown-label">Select Data Store</InputLabel>
<InputLabel id="data-store-dropdown-label">
Select Data Store
</InputLabel>
<Select
labelId="data-store-dropdown-label"
id="data-store-dropdown"
value={dataStore ? dataStore.id : ''}
onChange={(event) => {
const selectedDataStore = dataStores.find(ds => ds.id === event.target.value);
const selectedDataStore = dataStores.find(
(ds) => ds.id === event.target.value,
);
if (selectedDataStore) {
setDataStore(selectedDataStore);
searchParams.set('datastore_page', '1');

View File

@ -163,7 +163,13 @@ export function errorDisplayStateless(
<Alert
severity="error"
onClose={onClose}
action={hideCloseButton ? null : <button onClick={onClose}>Close</button>}
action={
hideCloseButton ? null : (
<button type="button" onClick={onClose}>
Close
</button>
)
}
>
<AlertTitle>{title}</AlertTitle>
{childrenForErrorObject(errorObject)}

View File

@ -1,7 +1,7 @@
import { useEffect, useState } from 'react';
import { Box, Typography } from '@mui/material';
import HttpService from '../services/HttpService';
// Import MUI components
import { Box, Typography } from '@mui/material';
// Define the props type
type OwnProps = {

View File

@ -59,6 +59,7 @@ export function Notification({
open
autoHideDuration={timeout}
onClose={onClose}
// eslint-disable-next-line react/jsx-props-no-spreading
{...additionalProps}
>
<Alert

View File

@ -1,5 +1,6 @@
import { useSearchParams } from 'react-router-dom';
import { TablePagination } from '@mui/material';
import { ChangeEvent, MouseEvent } from 'react';
import { PaginationObject } from '../interfaces';
type OwnProps = {
@ -30,16 +31,14 @@ export default function PaginationForTable({
: '';
const updateRows = (
event: React.MouseEvent<HTMLButtonElement> | null,
event: MouseEvent<HTMLButtonElement> | null,
newPage: number,
) => {
searchParams.set(`${paginationQueryParamPrefixToUse}page`, newPage + 1);
setSearchParams(searchParams);
};
const handleChangeRowsPerPage = (
event: React.ChangeEvent<HTMLInputElement>,
) => {
const handleChangeRowsPerPage = (event: ChangeEvent<HTMLInputElement>) => {
const newPerPage = parseInt(event.target.value, 10);
searchParams.set(`${paginationQueryParamPrefixToUse}per_page`, newPerPage);
setSearchParams(searchParams);

View File

@ -1,4 +1,4 @@
import { useEffect, useState } from 'react';
import { ChangeEvent, useEffect, useState } from 'react';
import { useLocation, useNavigate } from 'react-router-dom';
import { Tabs, Tab } from '@mui/material'; // Importing MUI components
import { SpiffTab } from '../interfaces';
@ -22,7 +22,7 @@ export default function SpiffTabs({ tabs }: OwnProps) {
setSelectedTabIndex(newSelectedTabIndex);
}, [location, tabs]);
const handleTabChange = (event: React.ChangeEvent<{}>, newValue: number) => {
const handleTabChange = (event: ChangeEvent<{}>, newValue: number) => {
navigate(tabs[newValue].path);
};
@ -34,8 +34,8 @@ export default function SpiffTabs({ tabs }: OwnProps) {
onChange={handleTabChange}
aria-label="List of tabs"
>
{tabs.map((spiffTab: SpiffTab, index: number) => (
<Tab key={index} label={spiffTab.display_name} />
{tabs.map((spiffTab: SpiffTab) => (
<Tab key={spiffTab.display_name} label={spiffTab.display_name} />
))}
</Tabs>
<br />

View File

@ -12,19 +12,13 @@ type HomepageProps = {
viewMode: 'table' | 'tile';
setViewMode: React.Dispatch<React.SetStateAction<'table' | 'tile'>>;
isMobile: boolean;
isLongFadeIn?: boolean;
};
type GroupedItems = {
[key: string]: ProcessInstanceTask[];
};
function Homepage({
viewMode,
setViewMode,
isMobile,
isLongFadeIn,
}: HomepageProps) {
function Homepage({ viewMode, setViewMode, isMobile }: HomepageProps) {
const [lastProcessInstanceId, setLastProcessInstanceId] = useState<
number | null
>(null);

View File

@ -1,12 +1,12 @@
import { useState, useEffect } from 'react';
import { useParams } from 'react-router-dom';
// @ts-ignore
import { Typography, Container } from '@mui/material'; // Import MUI components
import ProcessBreadcrumb from '../components/ProcessBreadcrumb';
import HttpService from '../services/HttpService';
import ProcessModelForm from '../components/ProcessModelForm';
import { ProcessModel } from '../interfaces';
import { setPageTitle } from '../helpers';
import { Typography, Container } from '@mui/material'; // Import MUI components
export default function ProcessModelEdit() {
const params = useParams();