Skip to content

Commit

Permalink
Reverted History Major version bump, fixed linter errors
Browse files Browse the repository at this point in the history
  • Loading branch information
sjkobori committed Jun 27, 2024
1 parent ede346f commit 06e7511
Show file tree
Hide file tree
Showing 7 changed files with 45 additions and 125 deletions.
137 changes: 28 additions & 109 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
"@babel/plugin-proposal-class-properties": "7.18.6",
"@babel/preset-react": "7.24.7",
"@types/dompurify": "3.0.5",
"@types/history": "5.0.0",
"@types/history": "4.7.11",
"@types/lodash": "4.17.5",
"@types/react": "18.3.3",
"@types/react-modal": "3.16.3",
Expand All @@ -79,7 +79,7 @@
"eslint-plugin-flowtype": "8.0.3",
"eslint-plugin-react": "7.34.3",
"google-auth-library": "9.11.0",
"history": "5.3.0",
"history": "4.10.1",
"html-webpack-plugin": "5.6.0",
"prop-types": "15.8.1",
"react-error-overlay": "6.0.11",
Expand Down
6 changes: 3 additions & 3 deletions src/components/SignInButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@ interface ErrorInfo {
description?: string;
}

type ErrorDisplay = ErrorInfo | JSX.Element;

interface HttpError extends Error {
status?: number;
}
Expand All @@ -34,9 +32,11 @@ export const SignInButton = (props: SignInButtonProps) => {
const [isLoading, setIsLoading] = useState<boolean>(false);
const [showError, setShowError] = useState<boolean>(false);
const { style } = props;

const history = useHistory();

const onSuccess = async (response: OidcUser) => {
// eslint-disable-next-line no-unused-vars
const onSuccess = async (_: OidcUser) => {

const redirectTo = getRedirectTo();
const shouldRedirect = shouldRedirectTo(redirectTo);
Expand Down
4 changes: 2 additions & 2 deletions src/libs/ajax/OAuth2.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import axios from "axios";
import { Config } from "../config";
import axios from 'axios';
import { Config } from '../config';

export interface OAuthConfig {
clientId: string;
Expand Down
12 changes: 6 additions & 6 deletions src/libs/ajax/User.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@ import { Config } from '../config';
import axios from 'axios';
import { getApiUrl, fetchOk, fetchAny } from '../ajax';

export type UserRoleName =
'Admin' | 'Chairperson' | 'Member' | 'Researcher' |
export type UserRoleName =
'Admin' | 'Chairperson' | 'Member' | 'Researcher' |
'Alumni' | 'SigningOfficial' | 'DataSubmitter' | 'All';

export interface UserRole {
roleId: number,
roleId: number,
name: UserRoleName,
userId: number,
userRoleId: number,
userId: number,
userRoleId: number,
}

export interface DuosUser {
Expand Down Expand Up @@ -83,7 +83,7 @@ export const User = {
update: async (user, userId) => {
const url = `${await getApiUrl()}/api/user/${userId}`;
// We should not be updating the user's create date, associated institution, or library cards
let filteredUser = flow(
const filteredUser = flow(
cloneDeep,
unset('updatedUser.createDate'),
unset('updatedUser.institution'),
Expand Down
2 changes: 1 addition & 1 deletion src/libs/auth/RedirectFromOAuth.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { useState } from 'react';
import React from 'react';
import { createRoot } from 'react-dom/client';
import { OidcBroker } from './oidcBroker';
import { Spinner } from '../../components/Spinner';
Expand Down
5 changes: 3 additions & 2 deletions src/libs/auth/auth.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*
/*
This file should abstract out the oidcBroker actions
and implement DUOS specific auth login (signIn, signOut, etc.)
*/
Expand All @@ -21,7 +21,8 @@ export const Auth = {
const um: UserManager = OidcBroker.getUserManager();
// UserManager events.
// For details of each event, see https://authts.github.io/oidc-client-ts/classes/UserManagerEvents.html
um.events.addUserLoaded((user: OidcUser) => {
// eslint-disable-next-line no-unused-vars
um.events.addUserLoaded((_: OidcUser) => {
//TODO: DUOS-3072 Add metrics for user loaded
});
um.events.addAccessTokenExpiring((): void => {
Expand Down

0 comments on commit 06e7511

Please sign in to comment.