Skip to content
This repository has been archived by the owner on Oct 20, 2023. It is now read-only.

Commit

Permalink
Merge branch 'develop' into cypress/rerun-failed-tests-only
Browse files Browse the repository at this point in the history
  • Loading branch information
sang2925 committed Mar 15, 2023
2 parents 10952b9 + 05d15ad commit 372d8c6
Show file tree
Hide file tree
Showing 71 changed files with 1,522 additions and 1,511 deletions.
13 changes: 4 additions & 9 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@

name: Build Check

concurrency:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

on:
push:
branches:
Expand All @@ -23,20 +22,16 @@ jobs:

steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Use Node.js ${{ matrix.node-version }}
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: CYPRESS_INSTALL_BINARY=0 yarn install --immutable --inline-builds
- run: CYPRESS_INSTALL_BINARY=0 yarn moon ci
- uses: 'moonrepo/run-report-action@v1'
if: success() || failure()
with:
access-token: ${{ secrets.GITHUB_TOKEN }}


70 changes: 34 additions & 36 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,10 @@ name: Release

on:
push:
branches: [ "main" ]
branches: ['main']

jobs:
build:

runs-on: ubuntu-latest

strategy:
Expand All @@ -18,37 +17,36 @@ jobs:
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/

steps:
- uses: actions/checkout@v3
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: 16.19.0
cache: 'yarn'
- run: |
npm install -g pkg-fetch
pkg-fetch --platform linux --node-range node16
pkg-fetch --platform mac --node-range node16
pkg-fetch --platform win --node-range node16
- run: |
git fetch
git config pull.rebase true
git pull origin $GITHUB_HEAD_REF
yarn install --immutable --inline-builds
yarn run release:all
chmod +x release/mac/RedEye
chmod +x release/linux/RedEye
- name: Archive mac production artifacts
uses: actions/upload-artifact@v3
with:
name: mac
path: release/mac
- name: Archive linux production artifacts
uses: actions/upload-artifact@v3
with:
name: linux
path: release/linux
- name: Archive windows production artifacts
uses: actions/upload-artifact@v3
with:
name: windows
path: release/windows
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: 16.19.0
cache: 'yarn'
- run: |
npm install -g pkg-fetch
pkg-fetch --platform linux --node-range node16
pkg-fetch --platform mac --node-range node16
pkg-fetch --platform win --node-range node16
- run: |
yarn install --immutable --inline-builds
yarn run release:all
chmod +x release/mac/RedEye
chmod +x release/linux/RedEye
- name: Archive mac production artifacts
uses: actions/upload-artifact@v3
with:
name: mac
path: release/mac
- name: Archive linux production artifacts
uses: actions/upload-artifact@v3
with:
name: linux
path: release/linux
- name: Archive windows production artifacts
uses: actions/upload-artifact@v3
with:
name: windows
path: release/windows
12 changes: 4 additions & 8 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -67,6 +65,8 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Cache
uses: actions/setup-node@v3
Expand All @@ -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]
Expand Down
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ node_modules
dist
build
@redeye/darwin-x64
dev-databases
applications/server/dev-databases
applications/server/campaign
.eslintcache

.yarn/*
Expand All @@ -25,7 +26,6 @@ junit.xml
.vim
.nova

server/.env
[diff]
tool = vscode
[difftool "vscode"]
Expand Down
1 change: 0 additions & 1 deletion .moon/workspace.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ projects:
- 'applications/*'
- 'packages/*'


# Configures the version control system to utilize within the workspace. A VCS
# is required for determining touched (added, modified, etc) files, calculating file hashes,
# computing affected files, and much more.
Expand Down
4 changes: 2 additions & 2 deletions .prettierrc.yaml
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
62 changes: 25 additions & 37 deletions applications/client/src/components/AuthCheck.tsx
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 &quot;Login&quot; 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;
}
`;
35 changes: 35 additions & 0 deletions applications/client/src/components/Dialogs/AlertEx.tsx
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;
}
}
`;
7 changes: 7 additions & 0 deletions applications/client/src/components/Dialogs/DialogBodyEx.tsx
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; */
`;
Loading

0 comments on commit 372d8c6

Please sign in to comment.