Skip to content

Commit

Permalink
lint fixes (including some that aren't mine)
Browse files Browse the repository at this point in the history
Signed-off-by: Steve Cassidy <[email protected]>
  • Loading branch information
stevecassidy committed Nov 11, 2024
1 parent 2fff637 commit ec10351
Show file tree
Hide file tree
Showing 10 changed files with 13 additions and 26 deletions.
6 changes: 0 additions & 6 deletions api/src/auth_routes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,6 @@ const AVAILABLE_AUTH_PROVIDER_DISPLAY_INFO: {[name: string]: any} = {
},
};

const HANDLER_OPTIONS: {[name: string]: any} = {
google: {
prompt: 'select_account',
},
};

passport.serializeUser((user: Express.User, done: DoneFunction) => {
done(null, user.user_id);
});
Expand Down
2 changes: 1 addition & 1 deletion api/src/buildconfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ function signing_key_id(): string {
// Generate public and private keys file names in the same way as makeInstanceKeys.sh

function key_file_path(): string {
let path = process.env.KEY_FILE_PATH;
const path = process.env.KEY_FILE_PATH;
if (path === '' || path === undefined) {
console.log('KEY_FILE_PATH not set, using default');
return '.';
Expand Down
6 changes: 1 addition & 5 deletions api/src/couchdb/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,7 @@ import {
} from '@faims3/data-model';
import PouchDB from 'pouchdb';
import {initialiseJWTKey} from '../authkeys/initJWTKeys';
import {
COUCHDB_INTERNAL_URL,
COUCHDB_PUBLIC_URL,
LOCAL_COUCHDB_AUTH,
} from '../buildconfig';
import {COUCHDB_INTERNAL_URL, LOCAL_COUCHDB_AUTH} from '../buildconfig';
import * as Exceptions from '../exceptions';
import {
initialiseAuthDb,
Expand Down
2 changes: 0 additions & 2 deletions api/src/couchdb/initialise.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
import {
AuthDatabaseSecurityDocument,
CLUSTER_ADMIN_GROUP_NAME,
getProjectDB,
permissionDocument,
viewsDocument,
} from '@faims3/data-model';
Expand All @@ -37,7 +36,6 @@ import {
getUserFromEmailOrUsername,
saveUser,
} from './users';
import {getUsersDB} from '.';

/**
* A helper to 1) clear out admins/members 2) add the specified roles 3) save
Expand Down
1 change: 0 additions & 1 deletion api/src/couchdb/notebooks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -772,7 +772,6 @@ export const streamNotebookRecordsAsCSV = async (
while (!done) {
// record might be null if there was an invalid db entry
if (record) {

const hrid = getRecordHRID(record);
const row = [
hrid,
Expand Down
11 changes: 8 additions & 3 deletions api/src/routes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,11 @@ import {
requireNotebookMembership,
} from './middleware';
import {validateProjectDatabase} from './couchdb/devtools';
import {databaseValidityReport, initialiseDatabases, verifyCouchDBConnection} from './couchdb';
import {
databaseValidityReport,
initialiseDatabases,
verifyCouchDBConnection,
} from './couchdb';

export {app};

Expand All @@ -76,7 +80,9 @@ app.get('/', async (req, res) => {
if (req.user && req.user._id) {
// Handlebars is pretty useless at including render logic in templates, just
// parse the raw, pre-processed string in...
const rendered_project_roles = render_project_roles(req.user.project_roles);
const rendered_project_roles = render_project_roles(
req.user.project_roles
);
const provider = Object.keys(req.user.profiles)[0];
// No need for a refresh here
const token = await generateUserToken(req.user, false);
Expand Down Expand Up @@ -112,7 +118,6 @@ app.get('/', async (req, res) => {
* even call initialiseDatabases, just redirect home
*/
app.post('/fallback-initialise', async (req, res) => {

if (!databaseValidityReport.valid) {
console.log('running initialise');
await initialiseDatabases();
Expand Down
2 changes: 1 addition & 1 deletion app/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ import {AuthReturn} from './gui/components/authentication/auth_return';
import CreateNewSurvey from './gui/components/workspace/CreateNewSurvey';
import NotFound404 from './gui/pages/404';
import {AppUrlListener} from './native_hooks';
import { NotificationProvider } from './context/popup';
import {NotificationProvider} from './context/popup';

// type AppProps = {};

Expand Down
5 changes: 1 addition & 4 deletions app/src/gui/components/authentication/appbarAuth.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,9 @@ import {checkToken} from '../../../utils/helpers';
import {Person} from '@mui/icons-material';
import {theme} from '../../themes';

interface SignInButtonComponentProps {}
const SignInButtonComponent = (props: SignInButtonComponentProps) => {
const SignInButtonComponent = () => {
/**
Component: SignInButtonComponent
*/
return (
<Button
Expand Down Expand Up @@ -69,7 +67,6 @@ const AuthenticatedDisplayComponent = (
) => {
/**
Component: AuthenticatedDisplayComponent
*/

/**
Expand Down
2 changes: 1 addition & 1 deletion app/src/gui/components/ui/tab-grid.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import {useNavigate} from 'react-router-dom';
import * as ROUTES from '../../../constants/routes';
import {useEffect, useState} from 'react';
import {theme} from '../../themes';
import { ACTIVATED_LABEL, NOT_ACTIVATED_LABEL } from '../workspace/notebooks';
import {ACTIVATED_LABEL, NOT_ACTIVATED_LABEL} from '../workspace/notebooks';

/**
* Renders a tabbed grid component.
Expand Down
2 changes: 0 additions & 2 deletions app/src/gui/themes/themes.d.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import {PaletteOptions, TypeBackground} from '@mui/material/styles';

declare module '@mui/material/styles' {
interface TypeBackground {
draftBackground: string;
Expand Down

0 comments on commit ec10351

Please sign in to comment.