Skip to content

Commit

Permalink
Merge branch 'main' into run-e2e-tests-on-windows
Browse files Browse the repository at this point in the history
  • Loading branch information
oo-bldrs committed Aug 11, 2023
2 parents 8bb6160 + a3025a7 commit 93132fe
Show file tree
Hide file tree
Showing 63 changed files with 1,373 additions and 796 deletions.
7 changes: 6 additions & 1 deletion .cosmos.webpack.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,12 @@ module.exports = {
},
{
test: /\.svg$/i,
use: ['@svgr/webpack'],
use: {
loader: '@svgr/webpack',
options: {
dimensions: false
}
}
},
],
},
Expand Down
20 changes: 5 additions & 15 deletions .github/workflows/end-to-end-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ on:
branches:
- main

workflow_dispatch:

jobs:
install-cypress:
runs-on: ubuntu-20.04
Expand All @@ -35,13 +37,8 @@ jobs:
run-cypress-on-linux:
runs-on: ubuntu-20.04
needs: install-cypress
strategy:
fail-fast: false
matrix:
containers: [1, 2, 3, 4]

steps:
- name: Checkout
- name: checkout
id: checkout
uses: actions/checkout@v3

Expand All @@ -50,24 +47,18 @@ jobs:
uses: actions/download-artifact@v3
with:
name: build
path: docs/

- name: E2E Tests on Google Chrome
id: e2e-on-google-chrome
uses: cypress-io/github-action@v5
with:
record: true
parallel: true
browser: chrome
start: node config/serve.js

run-cypress-on-windows:
runs-on: windows-latest
needs: install-cypress
strategy:
fail-fast: false
matrix:
containers: [1, 2, 3, 4]

steps:
- name: Checkout
id: checkout
Expand All @@ -78,12 +69,11 @@ jobs:
uses: actions/download-artifact@v3
with:
name: build
path: docs/

- name: E2E Tests on Google Chrome
id: e2e-on-google-chrome
uses: cypress-io/github-action@v5
with:
record: true
parallel: true
browser: chrome
start: node config/serve.js
2 changes: 1 addition & 1 deletion config/common.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ export const build = {
},
plugins: [
progress(),
svgrPlugin(),
svgrPlugin({plugins: ['@svgr/plugin-jsx'], dimensions: false}),
copyStaticFiles({
src: assetsDir,
dest: buildDir,
Expand Down
7 changes: 4 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "bldrs",
"version": "1.0.0-r682",
"version": "1.0.0-r689",
"main": "src/index.jsx",
"license": "MIT",
"homepage": "https://github.com/bldrs-ai/Share",
Expand Down Expand Up @@ -72,7 +72,8 @@
"@bahmutov/cypress-esbuild-preprocessor": "^2.1.3",
"@mui/types": "^7.2.3",
"@pablo-mayrgundter/cookies.js": "^1.0.0",
"@svgr/webpack": "^6.5.1",
"@svgr/webpack": "^8.0.1",
"@svgr/plugin-jsx": "^8.0.1",
"@testing-library/cypress": "^9.0.0",
"@testing-library/dom": "^8.19.1",
"@testing-library/jest-dom": "^5.16.5",
Expand All @@ -91,7 +92,7 @@
"esbuild-clean-plugin": "^1.0.0",
"esbuild-copy-static-files": "^0.1.0",
"esbuild-plugin-progress": "^1.0.1",
"esbuild-plugin-svgr": "^1.0.1",
"esbuild-plugin-svgr": "^2.0.0",
"eslint": "^8.22.0",
"eslint-config-google": "^0.14.0",
"eslint-plugin-cypress": "^2.12.1",
Expand Down
11 changes: 3 additions & 8 deletions src/Components/About/AboutControl.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,7 @@ export default function AboutControl() {
isDialogDisplayed={isDialogDisplayed}
setIsDialogDisplayed={setIsDialogDisplayedLocal}
icon={
<AboutIcon
style={{
width: '20px',
height: '20px',
}}
/>
<AboutIcon className='icon-share'/>
}
dialog={
<AboutDialog
Expand All @@ -69,8 +64,8 @@ export function AboutDialog({isDialogDisplayed, setIsDialogDisplayed}) {
<Dialog
icon={
<Box sx={{display: 'inline-flex', flexDirection: 'column', textAlign: 'center'}}>
<LogoB style={{width: '60px', height: '60px'}}/>
<Typography variant='h6' sx={{marginLeft: '-9px', marginTop: '6px'}}>bldrs.ai</Typography>
<LogoB/>
<Typography variant='h6'>bldrs.ai</Typography>
</Box>
}
headerText={''}
Expand Down
22 changes: 9 additions & 13 deletions src/Components/About/AboutDialog.fixture.jsx
Original file line number Diff line number Diff line change
@@ -1,21 +1,17 @@
import React from 'react'
import {HelmetProvider} from 'react-helmet-async'
import {ThemeProvider} from '@mui/material/styles'
import useShareTheme from '../../theme/Theme'
import FixtureContext from '../../FixtureContext'
import {AboutDialog} from './AboutControl'


/** @return {React.Component} */
export default function Example() {
export default function AboutDialogFixture() {
return (
<HelmetProvider>
<ThemeProvider theme={useShareTheme()}>
<AboutDialog
isDialogDisplayed={true}
// eslint-disable-next-line no-empty-function
setIsDialogDisplayed={() => {}}
/>
</ThemeProvider>
</HelmetProvider>
<FixtureContext>
<AboutDialog
isDialogDisplayed={true}
// eslint-disable-next-line no-empty-function
setIsDialogDisplayed={() => {}}
/>
</FixtureContext>
)
}
5 changes: 3 additions & 2 deletions src/Components/Buttons.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ export function ControlButton({
onClick={() => setIsDialogDisplayed(true)}
icon={icon}
selected={isDialogDisplayed}
className='icon-share'
/>
{isDialogDisplayed && dialog}
</>
Expand All @@ -102,9 +103,9 @@ export function CloseButton({onClick}) {
title='Close'
onClick={onClick}
placement='bottom'
icon={<CloseIcon style={{width: '15px', height: '15px'}}/>}
size='medium'
icon={<CloseIcon className='icon-share icon-small'/>}
aboutInfo={false}
className='closeButton'
/>
)
}
Expand Down
2 changes: 1 addition & 1 deletion src/Components/CutPlaneMenu.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ export default function CutPlaneMenu() {
<>
<TooltipIconButton
title={'Section'}
icon={<CutPlaneIcon/>}
icon={<CutPlaneIcon className='icon-share'/>}
onClick={handleClick}
selected={anchorEl !== null || !!cutPlanes.length}
/>
Expand Down
27 changes: 15 additions & 12 deletions src/Components/Dialog.fixture.jsx
Original file line number Diff line number Diff line change
@@ -1,19 +1,22 @@
import React from 'react'
import FixtureContext from '../FixtureContext'
import Dialog from './Dialog'
import AttentionIcon from '../assets/icons/Attention.svg'


export default (
<Dialog
icon={<AttentionIcon/>}
headerText={'Here\'s the thing!'}
isDialogDisplayed={true}
// eslint-disable-next-line no-empty-function
setIsDialogDisplayed={() => {}}
content={'What you should know about doing the thing'}
actionTitle={'Do do the thing?'}
actionCb={() => {
alert('You did the thing')
}}
/>
<FixtureContext>
<Dialog
icon={<AttentionIcon className='icon-share'/>}
headerText={'Here\'s the thing!'}
isDialogDisplayed={true}
// eslint-disable-next-line no-empty-function
setIsDialogDisplayed={() => {}}
content={'What you should know about doing the thing'}
actionTitle={'Do do the thing?'}
actionCb={() => {
alert('You did the thing')
}}
/>
</FixtureContext>
)
50 changes: 8 additions & 42 deletions src/Components/Dialog.jsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import React from 'react'
import DialogActions from '@mui/material/DialogActions'
import DialogContent from '@mui/material/DialogContent'
import DialogTitle from '@mui/material/DialogTitle'
import MuiDialog from '@mui/material/Dialog'
import Typography from '@mui/material/Typography'
import {RectangularButton, CloseButton} from '../Components/Buttons'
import {assertDefined} from '../utils/assert'

Expand Down Expand Up @@ -38,49 +38,15 @@ export default function Dialog({
<MuiDialog
open={isDialogDisplayed}
onClose={close}
sx={{
textAlign: 'center',
zIndex: 1000,
}}
PaperProps={{variant: 'control'}}
>
<DialogContent>
<div
style={{
position: 'absolute',
top: 0,
right: 0,
margin: '0.5em',
opacity: .5,
}}
>
<CloseButton onClick={close}/>
</div>
<Typography
variant='h1'
sx={{
'margin': '1em 0',
'textAlign': 'center',
'display': 'inline-flex',
'alignItems': 'center',
'justifyContent': 'center',
'& svg': {
marginRight: '0.5em',
},
}}
>
{icon && icon} {headerText}
</Typography>
{content}
</DialogContent>
<DialogActions
sx={{
overflowY: 'hidden',
padding: '0em 0em 2em 0em',
display: 'flex',
justifyContent: 'center',
}}
>
<CloseButton onClick={close}/>
<DialogTitle>
{icon}<br/>
{headerText}
</DialogTitle>
<DialogContent>{content}</DialogContent>
<DialogActions>
<RectangularButton title={actionTitle} icon={actionIcon} onClick={actionCb}/>
</DialogActions>
</MuiDialog>
Expand Down
22 changes: 19 additions & 3 deletions src/Components/HideToggleButton.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import VisibilityIcon from '@mui/icons-material/Visibility'
import VisibilityOffIcon from '@mui/icons-material/VisibilityOff'
import GlassesIcon from '../assets/icons/Glasses.svg'


/**
* @param {IfcIsolator} The IFC isoaltor
* @param {number} IFC element id
Expand Down Expand Up @@ -48,10 +49,25 @@ export default function HideToggleButton({elementId}) {
}

if (isIsolated) {
return <GlassesIcon style={iconStyle}/>
return <GlassesIcon style={iconStyle} className='icon-share icon-nav-glasses'/>
} else if (!isHidden) {
return <VisibilityIcon data-testid='hide-icon' style={iconStyle} onClick={toggleHide}/>
return (
<VisibilityIcon
onClick={toggleHide}
className='icon-share icon-nav-eye'
style={iconStyle}
data-testid='hide-icon'
/>
)
} else {
return <VisibilityOffIcon data-testid='unhide-icon' style={iconStyle} onClick={toggleHide}/>
return (
<VisibilityOffIcon
onClick={toggleHide}
className='icon-share icon-nav-eye'
data-testid='unhide-icon'
style={iconStyle}
fill={undefined}
/>
)
}
}
5 changes: 4 additions & 1 deletion src/Components/Loader.fixture.jsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
import React from 'react'
import FixtureContext from '../FixtureContext'
import Loader from './Loader'


export default (
<Loader/>
<FixtureContext>
<Loader/>
</FixtureContext>
)
4 changes: 2 additions & 2 deletions src/Components/LoginButton.jsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from 'react'
import {useAuth0} from '@auth0/auth0-react'
import {TooltipIconButton} from './Buttons'
import GitHubIcon from '@mui/icons-material/GitHub'
import GitHubIcon from '../assets/icons/GitHub.svg'


const LoginButton = ({
Expand All @@ -22,7 +22,7 @@ const LoginButton = ({
return (
<TooltipIconButton
title={'Log in with GitHub'}
icon={<GitHubIcon/>}
icon={<GitHubIcon className='icon-share'/>}
onClick={onClick}
/>
)
Expand Down
4 changes: 1 addition & 3 deletions src/Components/Logo.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@ export default function Logo({onClick}) {
'bottom': '1em',
'left': '1em',
'& svg': {
'width': '50px',
'height': '50px',
'marginBottom': '4px',
'marginTop': '4px',
'@media (max-width: 900px)': {
Expand All @@ -40,7 +38,7 @@ export default function Logo({onClick}) {
>
<TooltipIconButton
title={`Bldrs: ${PkgJson.version}`}
placement="right"
placement='right'
icon={<LogoIcon/>}
onClick={onClick}
aboutInfo={false}
Expand Down

0 comments on commit 93132fe

Please sign in to comment.