-
Notifications
You must be signed in to change notification settings - Fork 9
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
feat(arcgis): auth slice #332
feat(arcgis): auth slice #332
Conversation
This pull request is automatically being deployed by Amplify Hosting (learn more). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
<AuthContainer id="dashboard-container" layout={layout}> | ||
</AuthContainer> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
<AuthContainer id="dashboard-container" layout={layout}> | |
</AuthContainer> | |
<AuthContainer id="auth-container" layout={layout} /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not done
@@ -0,0 +1,118 @@ | |||
import styled, { useTheme } from "styled-components"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add unit tests for the file
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
</IconContainer> | ||
<ContentContainer> | ||
<Title>{title}</Title> | ||
{typeof content === "function" ? content() : content} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would use "children" for the custom content. content()
option is not clear. It is an unnecessary complexity on my opinion. It is always possible to call it in the parent component if needed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
<AuthContainer id="dashboard-container" layout={layout}> | ||
</AuthContainer> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not done
@@ -0,0 +1,43 @@ | |||
import { createSlice, createAsyncThunk } from "@reduxjs/toolkit"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add test for the slice
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
src/utils/arcgis-auth.spec.ts
Outdated
OLD_ENV = process.env; | ||
}); | ||
|
||
describe("getAuthenticatedUser", () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The test suite is testing "getAuthenticatedUser", "arcGisRequestLogin" and "arcGisRequestLogout", but the describe is about only getAuthenticatedUser
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
src/utils/arcgis-auth.spec.ts
Outdated
expect(email).toEqual(mockEmailExpected); | ||
}); | ||
|
||
it("Should return session", async () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The description is about "getAuthenticatedUser Should return session" but testing getAuthenticatedUser
instead
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
display: flex; | ||
justify-content: center; | ||
align-items: center; | ||
background: #00000099; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
By figma:
#232430 50% . Use global constants for colors.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
display: flex; | ||
flex-direction: column; | ||
border-radius: 8px; | ||
background: ${({ theme }) => theme.colors.mainColor}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This background is not by Figma (white theme).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
const theme = useTheme(); | ||
|
||
return ( | ||
<Overlay> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overlay
trasparency is applied on child components. We cannot use this approach. Instead, we should create another WrapperContainer
with position: fixed
and so on with visibility: hidden
. We set visibility: visible
for the child and it will be shown in the center.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The version that is submitted uses this approach, but actually it doesn't work. The problem is that the "ModalDialog" component is a child of some other component that uses opaque. It's out of my control.
I think we have to use the Popover that renders the dialog in the body, out of any other components.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
2 minor comment. Fix and merge
const onCancel = jest.fn(); | ||
const onConfirm = jest.fn(); | ||
|
||
const callRender = (renderFunc, props = {}, store = setupStore()) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fix warning
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
<Overlay /> | ||
<WrapperContainer> | ||
<Container data-testid="modal-dialog-content"> | ||
<IconContainer> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
could you add cursor: pointer
for the close button?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
No description provided.