Skip to content

Commit 22e3d7a

Browse files
authored
fix: Merge pull request #138 from UniversalDataTool/refactoring-aws-import-export
S3 Refactoring Import / Export, React Warning Fixes
2 parents 05a5176 + 328675f commit 22e3d7a

File tree

82 files changed

+811
-821
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

82 files changed

+811
-821
lines changed

.github/workflows/browser-tests.yml

Lines changed: 0 additions & 18 deletions
This file was deleted.

.github/workflows/test.yml

Lines changed: 26 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name: Test
2-
on: ["push", "pull_request"]
2+
on: ["pull_request"]
33
jobs:
4-
test:
4+
iscodeclean:
55
if: "!contains(github.event.head_commit.message, 'skip ci')"
66
name: Test
77
runs-on: ubuntu-18.04
@@ -14,3 +14,27 @@ jobs:
1414
node-version: 12
1515
- name: Run Prettier Test
1616
run: npx prettier --check "src/**/*.js"
17+
- name: Run Lint Test
18+
run: |
19+
rm package.json
20+
rm package-lock.json
21+
npm init -y
22+
npm install react-scripts
23+
echo '{"extends": "react-app"}' > .eslintrc
24+
npx eslint src
25+
cypress-run:
26+
needs: iscodeclean
27+
runs-on: ubuntu-16.04
28+
steps:
29+
- name: Checkout
30+
uses: actions/checkout@v1
31+
# Install NPM dependencies, cache them correctly
32+
# and run all Cypress tests
33+
- name: Cypress run
34+
uses: cypress-io/github-action@v1
35+
with:
36+
start: npm run start
37+
wait-on: http://localhost:6001
38+
record: true
39+
env:
40+
CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }}

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,7 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d
9696

9797
<!-- markdownlint-enable -->
9898
<!-- prettier-ignore-end -->
99+
99100
<!-- ALL-CONTRIBUTORS-LIST:END -->
100101

101102
This project follows the [all-contributors](https://github.com/all-contributors/all-contributors) specification. Contributions of any kind welcome!

package-lock.json

Lines changed: 0 additions & 20 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
"gh-pages": "npm run build:web && npm run build:vanilla && cp lib/vanilla.js build/vanilla.js && cp ./CNAME ./build/CNAME && gh-pages -d build",
2626
"prettier": "prettier --write \"src/**/*.js\"",
2727
"test:prettier": "prettier --check \"src/**/*.js\"",
28+
"test:lint": "npx eslint src",
2829
"test:integration:dev": "./node_modules/cypress/bin/cypress open",
2930
"test:integration": "./node_modules/cypress/bin/cypress run"
3031
},

src/components/AddAuthFromTemplateDialog/index.js

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,8 @@
22

33
import React, { useState } from "react"
44
import Button from "@material-ui/core/Button"
5-
import Dialog from "@material-ui/core/Dialog"
6-
import DialogTitle from "@material-ui/core/DialogTitle"
7-
import DialogContent from "@material-ui/core/DialogContent"
8-
import DialogActions from "@material-ui/core/DialogActions"
95
import { makeStyles } from "@material-ui/core/styles"
106
import authTemplates from "./authTemplates"
11-
import { grey } from "@material-ui/core/colors"
127
import SimpleDialog from "../SimpleDialog"
138
import isEmpty from "../../utils/isEmpty"
149
import Survey from "material-survey/components/Survey"
@@ -135,7 +130,7 @@ export default ({ open, onClose, onSelect, onFinish, onAuthConfigured }) => {
135130
onFinish={onFinish}
136131
>
137132
{isEmpty(authProvider) &&
138-
authTemplates.map((template) => (
133+
authTemplates.map((template, i) => (
139134
<Button
140135
key={template.name}
141136
onClick={() => {

src/components/BrushButton/index.js

Lines changed: 17 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,11 @@
11
// @flow
22

3-
import React, { useState, useMemo, useRef, useEffect } from "react"
4-
import { useLocalStorage } from "react-use"
5-
import { createPortal } from "react-dom"
3+
import React, { useState } from "react"
64
import IconButton from "@material-ui/core/IconButton"
75
import BrushIcon from "@material-ui/icons/Brush"
8-
import ArrowForwardIcon from "@material-ui/icons/ArrowForward"
96
import { styled } from "@material-ui/core/styles"
107
import * as colors from "@material-ui/core/colors"
118
import Button from "@material-ui/core/Button"
12-
import TextField from "@material-ui/core/TextField"
13-
import InputAdornment from "@material-ui/core/InputAdornment"
14-
import AddBoxTwoTone from "@material-ui/icons/AddBoxTwoTone"
15-
import ExitToAppIcon from "@material-ui/icons/ExitToApp"
16-
import CircularProgress from "@material-ui/core/CircularProgress"
179
import HeaderPopupBox from "../HeaderPopupBox"
1810
import useEventCallback from "use-event-callback"
1911
import memoize from "lodash/memoize"
@@ -36,17 +28,17 @@ const OtherColorContainers = styled("div")({
3628
flexWrap: "wrap",
3729
})
3830

39-
const StyledIconButton = styled(IconButton)(({ iconColor, selected }) => ({
31+
const StyledIconButton = styled(IconButton)(({ iconcolor, selected }) => ({
4032
display: "flex",
4133
justifyContent: "center",
4234
alignItems: "center",
43-
backgroundColor: iconColor[700],
44-
border: selected ? `4px solid ${iconColor["A200"]}` : "4px solid #fff",
35+
backgroundColor: iconcolor[700],
36+
border: selected ? `4px solid ${iconcolor["A200"]}` : "4px solid #fff",
4537
boxSizing: "content-box",
4638
margin: 4,
4739
transition: "transform 200ms linear",
4840
"&:hover": {
49-
backgroundColor: iconColor[800],
41+
backgroundColor: iconcolor[800],
5042
transform: "scale(1.2,1.2)",
5143
},
5244
"&:active": {
@@ -55,16 +47,16 @@ const StyledIconButton = styled(IconButton)(({ iconColor, selected }) => ({
5547
},
5648
}))
5749

58-
const StyledButton = styled(Button)(({ selected, iconColor }) => ({
50+
const StyledButton = styled(Button)(({ selected, iconcolor }) => ({
5951
justifyContent: "flex-start",
6052
marginTop: 4,
6153
marginBottom: 4,
6254
paddingTop: 8,
6355
paddingBottom: 8,
64-
backgroundColor: selected ? iconColor[50] : "#fff",
65-
border: selected ? `2px solid ${iconColor[200]}` : "2px solid #fff",
56+
backgroundColor: selected ? iconcolor[50] : "#fff",
57+
border: selected ? `2px solid ${iconcolor[200]}` : "2px solid #fff",
6658
"&:hover": {
67-
backgroundColor: selected ? iconColor[100] : "none",
59+
backgroundColor: selected ? iconcolor[100] : "none",
6860
},
6961
}))
7062

@@ -88,7 +80,7 @@ export default ({ selectedBrush, onChangeSelectedBrush }) => {
8880
<h1>Sample Brushes</h1>
8981
<StyledButton
9082
selected={selectedBrush === "complete" || selectedBrush === "blue"}
91-
iconColor={colors.blue}
83+
iconcolor={colors.blue}
9284
fullWidth
9385
onClick={handleClick("complete")}
9486
>
@@ -99,7 +91,7 @@ export default ({ selectedBrush, onChangeSelectedBrush }) => {
9991
selected={
10092
selectedBrush === "review" || selectedBrush === "deepOrange"
10193
}
102-
iconColor={colors.deepOrange}
94+
iconcolor={colors.deepOrange}
10395
fullWidth
10496
onClick={handleClick("review")}
10597
>
@@ -110,32 +102,32 @@ export default ({ selectedBrush, onChangeSelectedBrush }) => {
110102
<StyledIconButton
111103
onClick={handleClick("green")}
112104
selected={selectedBrush === "green"}
113-
iconColor={colors.green}
105+
iconcolor={colors.green}
114106
/>
115107
<StyledIconButton
116108
onClick={handleClick("purple")}
117109
selected={selectedBrush === "purple"}
118-
iconColor={colors.purple}
110+
iconcolor={colors.purple}
119111
/>
120112
<StyledIconButton
121113
onClick={handleClick("pink")}
122114
selected={selectedBrush === "pink"}
123-
iconColor={colors.pink}
115+
iconcolor={colors.pink}
124116
/>
125117
<StyledIconButton
126118
onClick={handleClick("cyan")}
127119
selected={selectedBrush === "cyan"}
128-
iconColor={colors.cyan}
120+
iconcolor={colors.cyan}
129121
/>
130122
<StyledIconButton
131123
onClick={handleClick("orange")}
132124
selected={selectedBrush === "orange"}
133-
iconColor={colors.orange}
125+
iconcolor={colors.orange}
134126
/>
135127
<StyledIconButton
136128
onClick={handleClick("indigo")}
137129
selected={selectedBrush === "indigo"}
138-
iconColor={colors.indigo}
130+
iconcolor={colors.indigo}
139131
/>
140132
</OtherColorContainers>
141133
</HeaderPopupBox>

src/components/CollaborateButton/index.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
// @flow
22

3-
import React, { useState, useMemo, useRef, useEffect } from "react"
3+
import React, { useState, useEffect } from "react"
44
import { useLocalStorage } from "react-use"
5-
import { createPortal } from "react-dom"
65
import IconButton from "@material-ui/core/IconButton"
76
import PeopleIcon from "@material-ui/icons/People"
87
import ArrowForwardIcon from "@material-ui/icons/ArrowForward"
@@ -159,13 +158,12 @@ export default ({
159158
{error && <ErrorText>{error}</ErrorText>}
160159
<CreateNewButton
161160
fullWidth
162-
disabled={error}
161+
disabled={!fileOpen || loadingSession || error}
163162
onClick={() => {
164163
posthog.capture("create_collaborative_session")
165164
onCreateSession()
166165
changeLoadingSession(true)
167166
}}
168-
disabled={!fileOpen || loadingSession}
169167
>
170168
{loadingSession ? (
171169
<CircularProgress className="icon" size={24} />

src/components/Composite/index.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ import InterfaceIcon from "../InterfaceIcon"
99
import KeyboardArrowRightIcon from "@material-ui/icons/KeyboardArrowRight"
1010
import Checkbox from "@material-ui/core/Checkbox"
1111
import Box from "@material-ui/core/Box"
12-
import NextIcon from "@material-ui/icons/KeyboardArrowRight"
1312

1413
const Title = styled("div")({
1514
fontSize: 18,

src/components/ConfigureComposite/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import React, { useEffect, useState } from "react"
1+
import React from "react"
22
import ConfigureInterface from "../ConfigureInterface"
33
import { styled } from "@material-ui/core/styles"
44
import ExpansionPanel from "@material-ui/core/ExpansionPanel"

0 commit comments

Comments
 (0)