Skip to content

Commit

Permalink
fix: minor frontend issues, remove prop-types
Browse files Browse the repository at this point in the history
  • Loading branch information
spwoodcock committed May 31, 2024
1 parent 57b2ae4 commit 62921c5
Show file tree
Hide file tree
Showing 10 changed files with 12 additions and 14 deletions.
2 changes: 1 addition & 1 deletion src/frontend/src/api/CreateProjectService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import {
OrganisationListModel,
} from '@/models/createproject/createProjectModel';
import { CommonActions } from '@/store/slices/CommonSlice';
import { ValidateCustomFormResponse } from 'store/types/ICreateProject';
import { ValidateCustomFormResponse } from '@/store/types/ICreateProject';
import { task_split_type } from '@/types/enums';

const CreateProjectService: Function = (
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
/* eslint-disable react/prop-types */
/* eslint-disable no-unused-vars */
import 'ol-layerswitcher/dist/ol-layerswitcher.css';
// import "../../node_modules/ol-layerswitcher/dist/ol-layerswitcher.css";
import LayerGroup from 'ol/layer/Group';
import Collection from 'ol/Collection.js';
import LayerTile from 'ol/layer/Tile';
import SourceOSM from 'ol/source/OSM';
import LayerSwitcher from 'ol-layerswitcher';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
/* eslint-disable no-console */
/* eslint-disable consistent-return */
/* eslint-disable react/forbid-prop-types */
import React, { useEffect, useState } from 'react';
import PropTypes from 'prop-types';
import { get } from 'ol/proj';
import { Circle as CircleStyle, Fill, Stroke, Style } from 'ol/style.js';
import GeoJSON from 'ol/format/GeoJSON';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
/* eslint-disable react/jsx-props-no-spreading */
/* eslint-disable react/jsx-no-useless-fragment */
import React from 'react';
import PropTypes from 'prop-types';
import '../map.scss';

const { Children, cloneElement, forwardRef } = React;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
// /* eslint-disable react/prop-types */
// /* eslint-disable jsx-a11y/anchor-has-content */
// /* eslint-disable func-names */
// /* eslint-disable jsx-a11y/control-has-associated-label */
Expand Down
2 changes: 0 additions & 2 deletions src/frontend/src/components/common/CustomTable.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
/* eslint-disable react/prop-types */
/* eslint-disable react/no-unknown-property */
/* eslint-disable react/self-closing-comp */
/* eslint-disable react/no-unused-prop-types */
/* eslint-disable react/no-array-index-key */
/* eslint-disable react/no-unstable-nested-components */
/* eslint-disable no-unused-vars */
Expand Down
1 change: 0 additions & 1 deletion src/frontend/src/components/common/InputTextField.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
/* eslint-disable react/no-unstable-nested-components */
import React from 'react';
// import PropTypes from 'prop-types';
export const blockInvalidChar = (e) => ['e', 'E', '+', '-'].includes(e.key) && e.preventDefault();

interface IInputTextFieldProps {
Expand Down
12 changes: 11 additions & 1 deletion src/frontend/src/main.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -72,4 +72,14 @@ axios.interceptors.request.use(
})();

// React 18 setup
createRoot(document.getElementById('app')!).render(<App />);
createRoot(document.getElementById('app')!, {
// // React 19 exposes hooks for Sentry
// // Callback called when an error is thrown and not caught by an Error Boundary.
// onUncaughtError: Sentry.reactErrorHandler((error, errorInfo) => {
// console.warn('Uncaught error', error, errorInfo.componentStack);
// }),
// // Callback called when React catches an error in an Error Boundary.
// onCaughtError: Sentry.reactErrorHandler(),
// // Callback called when React automatically recovers from errors.
// onRecoverableError: Sentry.reactErrorHandler(),
}).render(<App />);
1 change: 0 additions & 1 deletion src/frontend/src/utilities/BasicTabs.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import * as React from 'react';
import PropTypes from 'prop-types';
import windowDimention from '@/hooks/WindowDimension';
import CoreModules from '@/shared/CoreModules';

Expand Down
2 changes: 0 additions & 2 deletions src/frontend/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,6 @@ export default defineConfig(({ mode }) => {
},
test: {
globals: true,
environment: 'jsdom',
setupFiles: './setupTests.ts',
exclude: [...configDefaults.exclude, 'e2e', 'playwright-tests-examples'],
},
};
Expand Down

0 comments on commit 62921c5

Please sign in to comment.