Various linting fixes
This commit is contained in:
@@ -1,7 +1,6 @@
|
|||||||
const express = require('express')
|
const express = require('express')
|
||||||
var cors = require('cors')
|
var cors = require('cors')
|
||||||
const axios = require('axios')
|
const axios = require('axios')
|
||||||
const { restart } = require('nodemon')
|
|
||||||
const app = express()
|
const app = express()
|
||||||
const port = 8080
|
const port = 8080
|
||||||
app.use(express.json())
|
app.use(express.json())
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import * as Sentry from '@sentry/node'
|
import * as Sentry from '@sentry/node'
|
||||||
import { context, Config, ApolloError } from '@redwoodjs/api'
|
import { Config, ApolloError } from '@redwoodjs/api'
|
||||||
|
|
||||||
let sentryInitialized = false
|
let sentryInitialized = false
|
||||||
if (process.env.SENTRY_DSN && !sentryInitialized) {
|
if (process.env.SENTRY_DSN && !sentryInitialized) {
|
||||||
|
|||||||
@@ -12,7 +12,6 @@ import {
|
|||||||
} from 'src/services/helpers'
|
} from 'src/services/helpers'
|
||||||
import { requireAuth } from 'src/lib/auth'
|
import { requireAuth } from 'src/lib/auth'
|
||||||
import { requireOwnership, requireProjectOwnership } from 'src/lib/owner'
|
import { requireOwnership, requireProjectOwnership } from 'src/lib/owner'
|
||||||
import { socialCard } from '../socialCards/socialCards'
|
|
||||||
|
|
||||||
export const projects = ({ userName }) => {
|
export const projects = ({ userName }) => {
|
||||||
if (!userName) {
|
if (!userName) {
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ const EditableProjectTitle = ({
|
|||||||
const [newTitle, setNewTitle] = useState(projectTitle)
|
const [newTitle, setNewTitle] = useState(projectTitle)
|
||||||
const inputRef = React.useRef(null)
|
const inputRef = React.useRef(null)
|
||||||
|
|
||||||
const { updateProject, loading, error } = useUpdateProject({
|
const { updateProject } = useUpdateProject({
|
||||||
onCompleted: ({ updateProject }) => {
|
onCompleted: ({ updateProject }) => {
|
||||||
const routeVars = {
|
const routeVars = {
|
||||||
userName: updateProject.user.userName,
|
userName: updateProject.user.userName,
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ const EditorMenu = () => {
|
|||||||
key={menu.label + '-dropdown'}
|
key={menu.label + '-dropdown'}
|
||||||
>
|
>
|
||||||
{menu.items.map((itemConfig) => (
|
{menu.items.map((itemConfig) => (
|
||||||
<itemConfig.component
|
<itemConfig.Component
|
||||||
state={state}
|
state={state}
|
||||||
thunkDispatch={thunkDispatch}
|
thunkDispatch={thunkDispatch}
|
||||||
config={itemConfig}
|
config={itemConfig}
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ const fileMenuConfig: EditorMenuConfig = {
|
|||||||
label: 'Save & Render',
|
label: 'Save & Render',
|
||||||
shortcut: 'ctrl+s, command+s',
|
shortcut: 'ctrl+s, command+s',
|
||||||
shortcutLabel: cmdOrCtrl() + ' S',
|
shortcutLabel: cmdOrCtrl() + ' S',
|
||||||
component: (props) => {
|
Component: (props) => {
|
||||||
const { state, config } = props
|
const { state, config } = props
|
||||||
const handleRender = useRender()
|
const handleRender = useRender()
|
||||||
const saveCode = useSaveCode()
|
const saveCode = useSaveCode()
|
||||||
@@ -37,7 +37,7 @@ const fileMenuConfig: EditorMenuConfig = {
|
|||||||
label: 'Download STL',
|
label: 'Download STL',
|
||||||
shortcut: 'ctrl+shift+d, command+shift+d',
|
shortcut: 'ctrl+shift+d, command+shift+d',
|
||||||
shortcutLabel: cmdOrCtrl() + ' Shift D',
|
shortcutLabel: cmdOrCtrl() + ' Shift D',
|
||||||
component: (props) => {
|
Component: (props) => {
|
||||||
const { state, thunkDispatch, config } = props
|
const { state, thunkDispatch, config } = props
|
||||||
const handleStlDownload = makeStlDownloadHandler({
|
const handleStlDownload = makeStlDownloadHandler({
|
||||||
type: state.objectData?.type,
|
type: state.objectData?.type,
|
||||||
@@ -98,7 +98,7 @@ export interface EditorMenuItemConfig {
|
|||||||
label: string
|
label: string
|
||||||
shortcut: string
|
shortcut: string
|
||||||
shortcutLabel: React.ReactElement | string
|
shortcutLabel: React.ReactElement | string
|
||||||
component: (props: any) => React.ReactElement
|
Component: (props: any) => React.ReactElement
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface EditorMenuConfig {
|
export interface EditorMenuConfig {
|
||||||
|
|||||||
@@ -1,8 +1,6 @@
|
|||||||
import {
|
import {
|
||||||
CadhubNumberChoiceParam,
|
|
||||||
CadhubNumberOption,
|
CadhubNumberOption,
|
||||||
CadhubParams,
|
CadhubParams,
|
||||||
CadhubStringChoiceParam,
|
|
||||||
CadhubStringOption,
|
CadhubStringOption,
|
||||||
} from 'src/components/Customizer/customizerConverter'
|
} from 'src/components/Customizer/customizerConverter'
|
||||||
|
|
||||||
|
|||||||
@@ -5,8 +5,6 @@ const setPoints = (points, p, i) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function CSG2Vertices(csg) {
|
function CSG2Vertices(csg) {
|
||||||
const idx = 0
|
|
||||||
|
|
||||||
let vLen = 0,
|
let vLen = 0,
|
||||||
iLen = 0
|
iLen = 0
|
||||||
for (const poly of csg.polygons) {
|
for (const poly of csg.polygons) {
|
||||||
@@ -178,7 +176,6 @@ function parseParams(script) {
|
|||||||
|
|
||||||
let i = 0,
|
let i = 0,
|
||||||
line,
|
line,
|
||||||
next,
|
|
||||||
lineNum
|
lineNum
|
||||||
while (i < lines.length) {
|
while (i < lines.length) {
|
||||||
line = lines[i].code.trim()
|
line = lines[i].code.trim()
|
||||||
@@ -194,7 +191,6 @@ function parseParams(script) {
|
|||||||
while (i < lines.length) {
|
while (i < lines.length) {
|
||||||
line = lines[i].code
|
line = lines[i].code
|
||||||
lineNum = lines[i].line
|
lineNum = lines[i].line
|
||||||
next = lines[i + 1] ? lines[i + 1].code : ''
|
|
||||||
if (line[0] === '}') break
|
if (line[0] === '}') break
|
||||||
|
|
||||||
if (line[0] === '/') {
|
if (line[0] === '/') {
|
||||||
@@ -593,7 +589,7 @@ const makeRenderWorker = () => {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const updateAndRender = (timestamp) => {
|
const updateAndRender = () => {
|
||||||
renderTimer = null
|
renderTimer = null
|
||||||
doRotatePanZoom()
|
doRotatePanZoom()
|
||||||
|
|
||||||
@@ -607,7 +603,6 @@ const makeRenderWorker = () => {
|
|||||||
state.camera.position = updates.camera.position
|
state.camera.position = updates.camera.position
|
||||||
perspectiveCamera.update(state.camera)
|
perspectiveCamera.update(state.camera)
|
||||||
renderOptions.entities = [gridOptions, axisOptions, ...entities]
|
renderOptions.entities = [gridOptions, axisOptions, ...entities]
|
||||||
const time = Date.now()
|
|
||||||
renderer(renderOptions)
|
renderer(renderOptions)
|
||||||
if (updateRender) {
|
if (updateRender) {
|
||||||
updateRender = ''
|
updateRender = ''
|
||||||
|
|||||||
@@ -75,7 +75,7 @@ export const render = async ({ code, settings }: RenderArgs) => {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export const stl = async ({ code, settings }: RenderArgs) => {
|
export const stl = async ({ code /*settings*/ }: RenderArgs) => {
|
||||||
const body = JSON.stringify({
|
const body = JSON.stringify({
|
||||||
settings: {},
|
settings: {},
|
||||||
file: code,
|
file: code,
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ export const canvasToBlob = async (
|
|||||||
}
|
}
|
||||||
const oldSize = threeInstance.size
|
const oldSize = threeInstance.size
|
||||||
updateCanvasSize({ width, height })
|
updateCanvasSize({ width, height })
|
||||||
const imgBlobPromise: Promise<Blob> = new Promise((resolve, reject) => {
|
const imgBlobPromise: Promise<Blob> = new Promise((resolve) => {
|
||||||
threeInstance.gl.domElement.toBlob(
|
threeInstance.gl.domElement.toBlob(
|
||||||
(blob) => {
|
(blob) => {
|
||||||
resolve(blob)
|
resolve(blob)
|
||||||
@@ -34,8 +34,8 @@ export const canvasToBlob = async (
|
|||||||
return imgBlobPromise
|
return imgBlobPromise
|
||||||
}
|
}
|
||||||
|
|
||||||
export const blobTo64 = async (blob: Blob): Promise<string> => {
|
export const blobTo64 = (blob: Blob): Promise<string> => {
|
||||||
return new Promise(async (resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
const reader = new FileReader()
|
const reader = new FileReader()
|
||||||
reader.onloadend = () => {
|
reader.onloadend = () => {
|
||||||
if (typeof reader.result === 'string') {
|
if (typeof reader.result === 'string') {
|
||||||
|
|||||||
@@ -22,28 +22,6 @@ const MainLayout = ({ children, shouldRemoveFooterInIde }) => {
|
|||||||
const { logOut, isAuthenticated, currentUser, client } = useAuth()
|
const { logOut, isAuthenticated, currentUser, client } = useAuth()
|
||||||
const { user, loading } = useUser()
|
const { user, loading } = useUser()
|
||||||
const [isLoginModalOpen, setIsLoginModalOpen] = useState(false)
|
const [isLoginModalOpen, setIsLoginModalOpen] = useState(false)
|
||||||
const [isOpen, setIsOpen] = useState(false)
|
|
||||||
const [anchorEl, setAnchorEl] = useState(null)
|
|
||||||
const [popoverId, setPopoverId] = useState(undefined)
|
|
||||||
const openPopover = (target) => {
|
|
||||||
setAnchorEl(target)
|
|
||||||
setPopoverId('simple-popover')
|
|
||||||
setIsOpen(true)
|
|
||||||
}
|
|
||||||
|
|
||||||
const closePopover = () => {
|
|
||||||
setAnchorEl(null)
|
|
||||||
setPopoverId(undefined)
|
|
||||||
setIsOpen(false)
|
|
||||||
}
|
|
||||||
|
|
||||||
const togglePopover = ({ currentTarget }) => {
|
|
||||||
if (isOpen) {
|
|
||||||
return closePopover()
|
|
||||||
}
|
|
||||||
|
|
||||||
openPopover(currentTarget)
|
|
||||||
}
|
|
||||||
|
|
||||||
const recordedLogin = () => {
|
const recordedLogin = () => {
|
||||||
ReactGA.event({
|
ReactGA.event({
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
import { Link, routes } from '@redwoodjs/router'
|
|
||||||
import SocialCardCell from 'src/components/SocialCardCell'
|
import SocialCardCell from 'src/components/SocialCardCell'
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
|
|||||||
Reference in New Issue
Block a user