Skip to content

Commit 8b42628

Browse files
authored
Merge pull request #272 from kleros/fix/remove-cors-proxy
Remove CORS proxy
2 parents fdc729c + 5c940dc commit 8b42628

File tree

10 files changed

+23
-210
lines changed

10 files changed

+23
-210
lines changed

.env.example

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,6 @@ REACT_APP_TX_BATCHER_ADDRESSES={"5":"0x394E870A068E9C623aC6Bc51d53cc4a040420e8e"
2323
REACT_APP_SUBGRAPH_URL={"1":"https://api.thegraph.com/subgraphs/name/kleros/curate","5":"https://api.thegraph.com/subgraphs/name/greenlucid/curate-goerli","42":"https://api.thegraph.com/subgraphs/name/eccentricexit/light-curate-kovan-ii","100":"https://api.thegraph.com/subgraphs/name/eccentricexit/curate-xdai-ii","421611":"https://api.thegraph.com/subgraphs/name/greenlucid/curate-arbitrum-rinkeby"}
2424
REACT_APP_REJECT_ALL_POLICY_URI="/ipfs/QmZ7RVU7re1g8nXDbAFMHV99pyie3dn4cY7Ga2X4h8mDpV/reject-all-policy.pdf"
2525

26-
# Twitter client
27-
REACT_APP_BEARER_TOKEN=
28-
29-
# CORS Proxy
30-
# Do not include / at the end.
31-
REACT_APP_CORS_PROXY_URL=https://curate-cors.herokuapp.com
32-
3326
# All fields below this line are optional -------------
3427

3528
REACT_APP_WALLETCONNECT_BRIDGE_URL=https://bridge.walletconnect.org

src/components/display-selector.js

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ import { Typography, Avatar, Checkbox } from 'antd'
33
import styled from 'styled-components/macro'
44
import PropTypes from 'prop-types'
55
import GTCRAddress from './gtcr-address'
6-
import TwitterUser from './twitter-user'
76
import { ItemTypes } from '@kleros/gtcr-encoder'
87
import { ZERO_ADDRESS } from '../utils/string'
98
import RichAddress from './rich-address'
@@ -68,8 +67,6 @@ const DisplaySelector = ({ type, value, linkImage, allowedFileTypes }) => {
6867
<Typography.Text>{value}</Typography.Text>
6968
</a>
7069
)
71-
case ItemTypes.TWITTER_USER_ID:
72-
return <TwitterUser userID={value} />
7370
default:
7471
return (
7572
<Typography.Paragraph>

src/components/input-selector.js

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ import { ItemTypes } from '@kleros/gtcr-encoder'
88
import CustomInput from './custom-input.js'
99
import ipfsPublish from '../utils/ipfs-publish.js'
1010
import { sanitize } from '../utils/string.js'
11-
import TwitterUserInput from './twitter-input.js'
1211
import AddressInput from './address-input.js'
1312
import RichAddressInput from './rich-address-input.js'
1413

@@ -216,14 +215,6 @@ const InputSelector = ({
216215
</StyledUpload>
217216
</>
218217
)
219-
case ItemTypes.TWITTER_USER_ID:
220-
return (
221-
<TwitterUserInput
222-
name={name}
223-
label={label}
224-
setFieldValue={setFieldValue}
225-
/>
226-
)
227218
default:
228219
throw new Error(`Unhandled input type ${type}`)
229220
}

src/components/item-card-content.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,7 @@ const ItemCardContent = ({ item, chainId, tcrAddress }) => (
3232
col =>
3333
col.isIdentifier ||
3434
col.type === ItemTypes.IMAGE ||
35-
col.type === ItemTypes.FILE ||
36-
col.type === ItemTypes.TWITTER_USER_ID
35+
col.type === ItemTypes.FILE
3736
)
3837
.map((column, j) => (
3938
<StyledItemCol key={j}>

src/components/light-item-card-content.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,7 @@ const LightItemCardContent = ({ item, chainId, tcrAddress }) => (
3232
col =>
3333
col.isIdentifier ||
3434
col.type === ItemTypes.IMAGE ||
35-
col.type === ItemTypes.FILE ||
36-
col.type === ItemTypes.TWITTER_USER_ID
35+
col.type === ItemTypes.FILE
3736
)
3837
.map((column, j) => (
3938
<StyledItemCol key={j}>

src/components/twitter-input.js

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

src/components/twitter-user.js

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

src/pages/factory-classic/item-params.js

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,13 @@ import * as yup from 'yup'
1919
import styled from 'styled-components/macro'
2020
import CustomInput from 'components/custom-input'
2121
import ItemDetailsCard from 'components/item-details-card'
22-
import { ItemTypes } from '@kleros/gtcr-encoder'
22+
import { ItemTypes as AllItemTypes } from '@kleros/gtcr-encoder'
2323
import { STATUS_CODE } from 'utils/item-status'
24+
import objectWithoutKey from 'utils/object-without-key'
2425

25-
const { IMAGE, FILE, GTCR_ADDRESS, TWITTER_USER_ID, LONG_TEXT } = ItemTypes
26+
const ItemTypes = objectWithoutKey(AllItemTypes, 'TWITTER_USER_ID')
27+
28+
const { IMAGE, FILE, GTCR_ADDRESS, LONG_TEXT } = ItemTypes
2629

2730
const StyledAlert = styled(Alert)`
2831
margin-bottom: 42px;
@@ -220,8 +223,7 @@ const ItemParams = ({
220223
columns[index].isIdentifier) &&
221224
columns[index].type !== LONG_TEXT &&
222225
columns[index].type !== IMAGE &&
223-
columns[index].type !== FILE &&
224-
columns[index].type !== TWITTER_USER_ID ? ( // Image, file, twitter user and long text cannot be identifiers.
226+
columns[index].type !== FILE ? ( // Image, file and long text cannot be identifiers.
225227
<Col span={3}>
226228
<Field name={`columns[${index}].isIdentifier`}>
227229
{({ field }) => (

src/pages/factory/item-params.js

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,13 @@ import * as yup from 'yup'
1919
import styled from 'styled-components/macro'
2020
import CustomInput from 'components/custom-input'
2121
import ItemDetailsCard from 'components/item-details-card'
22-
import { ItemTypes } from '@kleros/gtcr-encoder'
22+
import { ItemTypes as AllItemTypes } from '@kleros/gtcr-encoder'
2323
import { STATUS_CODE } from 'utils/item-status'
24+
import objectWithoutKey from 'utils/object-without-key'
2425

25-
const { IMAGE, FILE, GTCR_ADDRESS, TWITTER_USER_ID, LONG_TEXT } = ItemTypes
26+
const ItemTypes = objectWithoutKey(AllItemTypes, 'TWITTER_USER_ID')
27+
28+
const { IMAGE, FILE, GTCR_ADDRESS, LONG_TEXT } = AllItemTypes
2629

2730
const StyledAlert = styled(Alert)`
2831
margin-bottom: 42px;
@@ -220,8 +223,7 @@ const ItemParams = ({
220223
columns[index].isIdentifier) &&
221224
columns[index].type !== LONG_TEXT &&
222225
columns[index].type !== IMAGE &&
223-
columns[index].type !== FILE &&
224-
columns[index].type !== TWITTER_USER_ID ? ( // Image, file, twitter user and long text cannot be identifiers.
226+
columns[index].type !== FILE ? ( // Image, file and long text cannot be identifiers.
225227
<Col span={3}>
226228
<Field name={`columns[${index}].isIdentifier`}>
227229
{({ field }) => (

src/utils/object-without-key.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
// i don't want to have to import lodash just for this
2+
3+
const objectWithoutKey = (object, key) => {
4+
// eslint-disable-next-line no-unused-vars
5+
const { [key]: nothing, ...otherKeys } = object
6+
return otherKeys
7+
}
8+
9+
export default objectWithoutKey

0 commit comments

Comments
 (0)