This repository has been archived by the owner on Oct 20, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 276
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'develop' into cypress/rerun-failed-tests-only
- Loading branch information
Showing
71 changed files
with
1,522 additions
and
1,511 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -34,17 +34,15 @@ jobs: | |
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Cache | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: 16.19.0 | ||
cache: 'yarn' | ||
|
||
- run: | | ||
git fetch | ||
git config pull.rebase true | ||
git pull origin $GITHUB_HEAD_REF | ||
- run: yarn install --immutable --inline-builds | ||
- run: yarn moon run server:build client:build | ||
|
||
|
@@ -67,6 +65,8 @@ jobs: | |
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Cache | ||
uses: actions/setup-node@v3 | ||
|
@@ -80,10 +80,6 @@ jobs: | |
name: moon-cache | ||
path: .moon/cache | ||
|
||
- run: | | ||
git fetch | ||
git config pull.rebase true | ||
git pull origin $GITHUB_HEAD_REF | ||
- run: yarn install --immutable --inline-builds | ||
- name: Red Team Tests - Chrome v${{ matrix.node }} | ||
uses: cypress-io/[email protected] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
printWidth: 120 | ||
semi: true | ||
singleQuote: true | ||
trailingComma: "es5" | ||
endOfLine: "lf" | ||
trailingComma: 'es5' | ||
endOfLine: 'lf' | ||
tabWidth: 2 | ||
useTabs: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,66 +1,54 @@ | ||
import type { DialogProps } from '@blueprintjs/core'; | ||
import { Button, Classes, Dialog, Intent } from '@blueprintjs/core'; | ||
import { Button, Intent } from '@blueprintjs/core'; | ||
import { WarningAlt16 } from '@carbon/icons-react'; | ||
import { css } from '@emotion/react'; | ||
import { CarbonIcon } from '@redeye/client/components'; | ||
import { CarbonIcon, DialogEx } from '@redeye/client/components'; | ||
import { RedEyeRoutes, useStore } from '@redeye/client/store'; | ||
import { observer } from 'mobx-react-lite'; | ||
import { useEffect } from 'react'; | ||
import { DialogBodyEx } from './Dialogs/DialogBodyEx'; | ||
import { DialogFooterEx } from './Dialogs/DialogFooterEx'; | ||
|
||
type AuthCheckProps = Partial<DialogProps> & {}; | ||
|
||
export const AuthCheck = observer<AuthCheckProps>(({ ...props }) => { | ||
const store = useStore(); | ||
|
||
// Redirect to login if the app loads with no session/connection to the server | ||
useEffect(() => { | ||
setTimeout(() => { | ||
if (!store.appMeta.blueTeam) store.auth.checkServerConnection(); | ||
}, 1000); | ||
}, []); | ||
const close = () => { | ||
|
||
const onClose = () => { | ||
store.auth.setPromptAuth(false); | ||
store.auth.setHasClickedAuthDialog(true); | ||
}; | ||
|
||
const onLogin = () => { | ||
onClose(); | ||
store.router.updateRoute({ path: RedEyeRoutes.LOGIN }); | ||
}; | ||
|
||
return ( | ||
<Dialog | ||
<DialogEx | ||
isOpen={store.auth.promptAuth} | ||
icon={<CarbonIcon icon={WarningAlt16} />} | ||
title="Unable to authenticate" | ||
onClose={close} | ||
onClose={onClose} | ||
{...props} | ||
> | ||
<div className={Classes.DIALOG_BODY}> | ||
<DialogBodyEx> | ||
The application was unable to authenticate with the server. Click "Login" to re-authenticate. | ||
</div> | ||
<div className={Classes.DIALOG_FOOTER} css={footerStyles}> | ||
<Button | ||
onClick={() => { | ||
close(); | ||
}} | ||
> | ||
Close | ||
</Button> | ||
<Button | ||
intent={Intent.PRIMARY} | ||
onClick={() => { | ||
close(); | ||
store.router.updateRoute({ path: RedEyeRoutes.LOGIN }); | ||
}} | ||
> | ||
Login | ||
</Button> | ||
</div> | ||
</Dialog> | ||
</DialogBodyEx> | ||
<DialogFooterEx | ||
actions={ | ||
<> | ||
<Button onClick={onClose} text="Close" /> | ||
<Button intent={Intent.PRIMARY} onClick={onLogin} text="Login" /> | ||
</> | ||
} | ||
/> | ||
</DialogEx> | ||
); | ||
}); | ||
|
||
const footerStyles = css` | ||
display: flex; | ||
flex-direction: row; | ||
justify-content: end; | ||
& .${Classes.BUTTON} { | ||
margin-left: 10px; | ||
} | ||
`; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
import { Alert, Classes } from '@blueprintjs/core'; | ||
import styled from '@emotion/styled'; | ||
import { AdvancedTokens } from '@redeye/ui-styles'; | ||
|
||
export const AlertEx = styled(Alert)` | ||
padding: 0; | ||
margin: 3rem; | ||
align-self: start; | ||
.${Classes.ALERT_BODY} { | ||
padding: 16px; | ||
} | ||
.${Classes.ALERT_FOOTER} { | ||
margin: 0; | ||
gap: 1px; | ||
} | ||
.${Classes.BUTTON} { | ||
margin: 0; | ||
// fill | ||
flex: 1 1; | ||
// large | ||
height: ${AdvancedTokens.PtButtonHeightLarge}; | ||
padding: 4px 16px; | ||
// alignText='left' | ||
text-align: left; | ||
.${Classes.BUTTON_TEXT} { | ||
flex: 1 1 auto; | ||
} | ||
} | ||
`; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import { DialogBody } from '@blueprintjs/core'; | ||
import styled from '@emotion/styled'; | ||
|
||
export const DialogBodyEx = styled(DialogBody)` | ||
// to control style if we need it later | ||
/* padding: 1.5rem; */ | ||
`; |
Oops, something went wrong.