Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update dependencies #115

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
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
235 changes: 113 additions & 122 deletions backend/Pipfile.lock

Large diffs are not rendered by default.

3 changes: 1 addition & 2 deletions frontend/.eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@
"extends": [
"airbnb",
"react-app",
"prettier",
"prettier/react"
"prettier"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why did you remove prettier/react? Looks like this is accessing additional prettier config specific to react: https://eslint.org/docs/developer-guide/shareable-configs#sharing-multiple-configs

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Turns out prettier/react was merged into prettier so this is no longer necessary since 8.0

],
"env": {
"browser": true
Expand Down
110 changes: 56 additions & 54 deletions frontend/components/Accounts/Forms/ContactInput.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -49,14 +49,14 @@ const DropdownItem = styled.div`
}
`;

const FieldInput = ({
const FieldInput = function ({
mutate,
contactType,
setShowAdd,
setVerifyContact,
setShowModal,
onCancel,
}) => {
}) {
const { addToast } = useToasts();
const [text, setText] = useState("");

Expand Down Expand Up @@ -101,69 +101,67 @@ const FieldInput = ({
);
};

const MoreIndicator = ({
const MoreIndicator = function ({
onDelete,
onMakePrimary,
onReverify,
isVerified,
isPrimary,
}) => {
}) {
const [isVisible, setIsVisible] = useState(false);
const ref = useOnClickOutside(() => setIsVisible(false), !isVisible);
return (
<>
<Span position="relative">
<Indicator src="/more.svg" onClick={() => setIsVisible(true)} />
<Dropdown ref={ref as any} isVisible={isVisible}>
{!isPrimary && isVerified && (
<DropdownItem
onClick={() => {
onMakePrimary();
setIsVisible(false);
}}
>
<Text weight="400" size="0.7rem">
Set primary
</Text>
</DropdownItem>
)}
<Span position="relative">
<Indicator src="/more.svg" onClick={() => setIsVisible(true)} />
<Dropdown ref={ref as any} isVisible={isVisible}>
{!isPrimary && isVerified && (
<DropdownItem
onClick={() => {
onDelete();
onMakePrimary();
setIsVisible(false);
}}
>
<Text weight="400" size="0.7rem">
Remove
Set primary
</Text>
</DropdownItem>
{!isVerified && (
<DropdownItem
onClick={() => {
onReverify();
setIsVisible(false);
}}
>
<Text weight="400" size="0.7rem">
Verify
</Text>
</DropdownItem>
)}
</Dropdown>
</Span>
</>
)}
<DropdownItem
onClick={() => {
onDelete();
setIsVisible(false);
}}
>
<Text weight="400" size="0.7rem">
Remove
</Text>
</DropdownItem>
{!isVerified && (
<DropdownItem
onClick={() => {
onReverify();
setIsVisible(false);
}}
>
<Text weight="400" size="0.7rem">
Verify
</Text>
</DropdownItem>
)}
</Dropdown>
</Span>
);
};

export const ExistingInput = ({
export const ExistingInput = function ({
contactType,
text,
onDelete,
onMakePrimary,
onReverify,
isPrimary,
isVerified,
}) => {
}) {
const [modalIsOpen, setModalIsOpen] = useState(false);

return (
Expand Down Expand Up @@ -203,23 +201,27 @@ export const ExistingInput = ({
);
};

export const AddInput = ({ text, onClick, margin }) => (
<AddButton onClick={onClick} marginTop={margin}>
{text}
</AddButton>
);
export const AddInput = function ({ text, onClick, margin }) {
return (
<AddButton onClick={onClick} marginTop={margin}>
{text}
</AddButton>
);
};

export const EditInput = ({ onConfirm, value, onChange, onCancel }) => (
<Flex childMargin="0.2rem" width="100%">
<FormInput height="2rem" value={value} onChange={onChange} />
<Button type="button" onClick={onConfirm}>
Confirm
</Button>
<Indicator src="/x-circle.svg" width="1.3rem" onClick={onCancel} />
</Flex>
);
export const EditInput = function ({ onConfirm, value, onChange, onCancel }) {
return (
<Flex childMargin="0.2rem" width="100%">
<FormInput height="2rem" value={value} onChange={onChange} />
<Button type="button" onClick={onConfirm}>
Confirm
</Button>
<Indicator src="/x-circle.svg" width="1.3rem" onClick={onCancel} />
</Flex>
);
};

const ContactInput = ({ route, addText, initialData, contactType }) => {
const ContactInput = function ({ route, addText, initialData, contactType }) {
const { addToast } = useToasts();
const { data, mutate } = useResourceList<ContactInfo>(
route,
Expand Down
2 changes: 1 addition & 1 deletion frontend/components/Accounts/Forms/Input.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { useField } from "formik";

import { FormInput } from "../ui";

export const FormikInput = ({ fieldName, ...props }) => {
export const FormikInput = function ({ fieldName, ...props }) {
const [field, meta] = useField(fieldName);

return (
Expand Down
3 changes: 1 addition & 2 deletions frontend/components/Accounts/Forms/SelectInput.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ interface SelectOption {
const toSelectOptions = (options) =>
options.map((obj) => ({ value: obj.name, label: obj.name }));

export const FormikSelectInput = ({ route, fieldName }) => {
export const FormikSelectInput = function ({ route, fieldName }) {
const { data: rawData } = useResourceList<SelectOption>(
route,
(id) => `${route}${id}/`
Expand All @@ -27,7 +27,6 @@ export const FormikSelectInput = ({ route, fieldName }) => {
const values = field.value || [];
return (
<Select
defaultOptions
isMulti
styles={selectStyles}
options={options}
Expand Down
2 changes: 1 addition & 1 deletion frontend/components/Accounts/Modals/Delete.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ interface DeleteModalProps {
closeFunc: () => void;
}

const DeleteModal = (props: DeleteModalProps) => {
const DeleteModal = function (props: DeleteModalProps) {
const { show, closeFunc, type, contact, onDelete } = props;
const prettyType = type === ContactType.Email ? "email" : "phone number";
return (
Expand Down
4 changes: 2 additions & 2 deletions frontend/components/Accounts/Modals/Verification.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ interface CodeInputRef extends ReactCodeInput {
state: CodeInputRefState;
}

const VerificationForm = (props: VerificationFormProps) => {
const VerificationForm = function (props: VerificationFormProps) {
const { addToast } = useToasts();
const { type, id, closeFunc, mutate } = props;
const codeInput = useRef<CodeInputRef>(null);
Expand Down Expand Up @@ -62,7 +62,7 @@ interface VerificationModalProps {
closeFunc: () => void;
mutate: mutateResourceListFunction<ContactInfo>;
}
const VerificationModal = (props: VerificationModalProps) => {
const VerificationModal = function (props: VerificationModalProps) {
const { show, closeFunc, type, contact, id, mutate } = props;
const prettyType = type === ContactType.Email ? "Email" : "Phone Number";
return (
Expand Down
2 changes: 1 addition & 1 deletion frontend/components/Accounts/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ const selectFields = (form: User) => {
};
};

const Accounts = ({ user: initialUser }: { user: User }) => {
const Accounts = function ({ user: initialUser }: { user: User }) {
const { addToast } = useToasts();
const { data: userPartial, mutate } = useResource<User>("/accounts/me/", {
initialData: initialUser,
Expand Down
5 changes: 4 additions & 1 deletion frontend/next-env.d.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
/// <reference types="next" />
/// <reference types="next/types/global" />
/// <reference types="next/image-types/global" />

// NOTE: This file should not be edited
// see https://nextjs.org/docs/basic-features/typescript for more information.
67 changes: 33 additions & 34 deletions frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,47 +13,46 @@
},
"dependencies": {
"@pennlabs/rest-hooks": "^0.1.8",
"@sentry/browser": "^6.2.0",
"@sentry/node": "^6.2.0",
"@types/lodash": "^4.14.173",
"@types/styled-components": "^5.1.9",
"@sentry/browser": "^6.16.1",
"@sentry/node": "^6.16.1",
"@types/lodash": "^4.14.178",
"@types/styled-components": "^5.1.18",
"babel-plugin-styled-components": "^2.0.2",
"babel-preset-next": "^1.4.0",
"babel-plugin-styled-components": "^1.13.2",
"bulma": "^0.9.3",
"express": "^4.17.1",
"formik": "^2.2.6",
"http-proxy-middleware": "^1.0.5",
"libphonenumber-js": "^1.9.11",
"formik": "^2.2.9",
"http-proxy-middleware": "^2.0.1",
"libphonenumber-js": "^1.9.44",
"lodash": "^4.17.21",
"next": "10.0.6",
"react": "17.0.1",
"next": "12.0.7",
"react": "17.0.2",
"react-bulma-components": "^4.0.7",
"react-code-input": "^3.10.0",
"react-dom": "17.0.1",
"react-select": "^4.0.2",
"react-toast-notifications": "^2.4.4",
"styled-components": "^5.2.3",
"react-code-input": "^3.10.1",
"react-dom": "17.0.2",
"react-select": "^5.2.1",
"react-toast-notifications": "^2.5.1",
"styled-components": "^5.3.3",
"swr": "^0.3.11",
"typescript": "^4.1.3",
"yup": "^0.32.9"
"typescript": "^4.5.4",
"yup": "^0.32.11"
},
"devDependencies": {
"@babel/eslint-parser": "^7.12.1",
"@types/node": "^14.0.23",
"@types/react": "^17.0.0",
"@types/react-select": "^4.0.10",
"@typescript-eslint/eslint-plugin": "^4.14.1",
"@typescript-eslint/parser": "^4.14.1",
"eslint": "^7.32.0",
"eslint-config-airbnb": "^18.2.0",
"eslint-config-prettier": "^7.2.0",
"eslint-config-react-app": "^6.0.0",
"eslint-plugin-flowtype": "^5.2.0",
"eslint-plugin-import": "^2.18.2",
"eslint-plugin-jsx-a11y": "^6.2.3",
"eslint-plugin-prettier": "^3.1.3",
"eslint-plugin-react": "^7.16.0",
"eslint-plugin-react-hooks": "^4.0.8",
"prettier": "^2.2.1"
"@babel/eslint-parser": "^7.16.5",
"@types/node": "^17.0.0",
"@types/react": "^17.0.37",
"@typescript-eslint/eslint-plugin": "^5.7.0",
"@typescript-eslint/parser": "^5.7.0",
"eslint": "^8.4.1",
"eslint-config-airbnb": "^19.0.2",
"eslint-config-prettier": "^8.3.0",
"eslint-config-react-app": "^7.0.0",
"eslint-plugin-flowtype": "^8.0.3",
"eslint-plugin-import": "^2.25.3",
"eslint-plugin-jsx-a11y": "^6.5.1",
"eslint-plugin-prettier": "^4.0.0",
"eslint-plugin-react": "^7.27.1",
"eslint-plugin-react-hooks": "^4.3.0",
"prettier": "^2.5.1"
}
}
12 changes: 7 additions & 5 deletions frontend/pages/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,13 @@ interface AccountPageProps {
user: User;
}

const AccountPage = ({ user }: AccountPageProps) => (
<ToastProvider placement="bottom-center" autoDismiss={true}>
<Accounts user={user} />
</ToastProvider>
);
const AccountPage = function ({ user }: AccountPageProps) {
return (
<ToastProvider placement="bottom-center" autoDismiss={true}>
<Accounts user={user} />
</ToastProvider>
);
};

async function getServerSidePropsInner(_context: GetServerSidePropsContext) {
return { props: {} };
Expand Down
3 changes: 2 additions & 1 deletion frontend/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@
"resolveJsonModule": true,
"isolatedModules": true,
"jsx": "preserve",
"strict": false
"strict": false,
"incremental": true
},
"exclude": [
"node_modules"
Expand Down
Loading