Skip to content

Commit

Permalink
Merge pull request #424 from ensdomains/dev
Browse files Browse the repository at this point in the history
Version 1.1.4
  • Loading branch information
makoto authored Aug 14, 2019
2 parents c2537cc + 531a540 commit 6420ba7
Show file tree
Hide file tree
Showing 28 changed files with 1,320 additions and 178 deletions.
22 changes: 12 additions & 10 deletions cypress/integration/address.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,16 +75,18 @@ describe('Address', () => {
.should('have.value', NAME)

cy.get('.resolve-result').should('contain', ADDRESS)
cy.get('.blockies').should('have.attr', 'style').then((attr) => {
cy.get('.cmp-address:nth(4) input')
.clear()
.type(ADDRESS)
.should('have.value', ADDRESS)

cy.get('.resolve-result').should('contain', NAME)

cy.get('.blockies').should('have.attr', 'style', attr)
})
cy.get('.blockies')
.should('have.attr', 'style')
.then(attr => {
cy.get('.cmp-address:nth(4) input')
.clear()
.type(ADDRESS)
.should('have.value', ADDRESS)

cy.get('.resolve-result').should('contain', NAME)

cy.get('.blockies').should('have.attr', 'style', attr)
})
})

it('test #6 check onResolve', () => {
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": "ens-app",
"version": "1.0.0",
"version": "1.1.4",
"private": true,
"homepage": "https://manager.ens.domains",
"dependencies": {
Expand All @@ -12,7 +12,7 @@
"@ensdomains/ethregistrar": "^1.2.2",
"@ensdomains/react-ens-address": "^0.0.11",
"@ensdomains/resolver": "^0.1.6",
"@ensdomains/ui": "^1.0.93",
"@ensdomains/ui": "^1.1.5",
"apollo-cache-inmemory": "^1.2.9",
"apollo-client": "^2.4.5",
"apollo-link": "^1.2.2",
Expand Down Expand Up @@ -56,6 +56,7 @@
"test:coverage": "npm test -- --coverage",
"eject": "react-scripts eject",
"preTest": "node -r esm src/testing-utils/preTest.js",
"preTest:dnssec": "node -r esm src/testing-utils/preTest.js default dnssec",
"subgraph": "node scripts/subgraph.js",
"advance": "node src/testing-utils/advance.js",
"cypress:open": "yarn run cypress open",
Expand All @@ -73,7 +74,7 @@
}
},
"devDependencies": {
"@ensdomains/mock": "^1.0.12",
"@ensdomains/mock": "^1.0.13",
"apollo-client-mock": "0.0.8",
"apollo-link-schema": "^1.1.0",
"babel-plugin-macros": "^2.4.2",
Expand Down
45 changes: 45 additions & 0 deletions src/api/dnssecmodes.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
export default [
// 0
{
state: 'ENABLE_DNSSEC',
title: 'Problem fetching data from DNS',
displayError: true
},
// 1
{
state: 'ENABLE_DNSSEC',
title: 'DNS entry does not exist.',
displayError: true
},
// 2
{
state: 'ENABLE_DNSSEC',
title: 'Please enable DNSSEC'
},
// 3
{
state: 'ADD_TEXT',
title: 'Please add text record into _ens.name.tld'
},
// 4,
{
state: 'ADD_TEXT',
title: 'DNS Record is invalid',
displayError: true
},
// 5,
{
state: 'SUBMIT_PROOF',
title: 'Ready to register',
explainer:
"*Click 'refresh' if you make changes to the domain in the DNS Registrar."
},
// 6,
{
state: 'SUBMIT_PROOF',
title: 'DNS is out of sync',
explainer:
"The Controller and DNS Owner are out of sync. Click 'sync' to make the DNS Owner the Controller. Click 'refresh' if you make changes to the domain in the DNS Registrar.",
outOfSync: true
}
]
29 changes: 26 additions & 3 deletions src/api/manager/resolvers.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
import {
getOwner,
getEntry,
getDNSEntry,
isDNSRegistrar,
setSubnodeOwner,
getDomainDetails,
getSubdomains,
getName,
getNetworkId,
getAddress,
claimAndSetReverseRecordName,
setOwner,
Expand All @@ -16,13 +20,11 @@ import {
expiryTimes,
isDecrypted
} from '@ensdomains/ui'
import { getEntry } from '@ensdomains/ui'
import { query } from '../subDomainRegistrar'
import modeNames from '../modes'
import { getNetworkId } from '@ensdomains/ui'
import domains from '../../constants/domains.json'
import { sendHelper } from '../resolverUtils'

import { emptyAddress } from '../../utils/utils'
import {
GET_FAVOURITES,
GET_SUBDOMAIN_FAVOURITES,
Expand Down Expand Up @@ -66,6 +68,7 @@ const resolvers = {
migrationStartDate: null,
currentBlockDate: null,
transferEndDate: null,
gracePeriodEndDate: null,
value: null,
highestBid: null,
state: null,
Expand All @@ -79,6 +82,8 @@ const resolvers = {
contentType: null,
expiryTime: null,
isNewRegistrar: null,
isDNSRegistrar: null,
dnsOwner: null,
deedOwner: null,
registrant: null
}
Expand All @@ -93,6 +98,7 @@ const resolvers = {
migrationStartDate,
currentBlockDate,
transferEndDate,
gracePeriodEndDate,
revealDate,
value,
highestBid,
Expand All @@ -106,6 +112,7 @@ const resolvers = {
name: `${name}`,
state: modeNames[state],
registrationDate,
gracePeriodEndDate: gracePeriodEndDate || null,
migrationStartDate: migrationStartDate || null,
currentBlockDate: currentBlockDate || null,
transferEndDate: transferEndDate || null,
Expand Down Expand Up @@ -141,6 +148,22 @@ const resolvers = {
state: subdomain.available ? 'Open' : 'Owned'
}
}
} else {
// either dnssect domain or non existing domain
let tld = nameArray[1]
let owner
let tldowner = (await getOwner(tld)).toLocaleLowerCase()
try {
owner = (await getOwner(name)).toLocaleLowerCase()
} catch {}

let isDNSRegistrarSupported = await isDNSRegistrar(tld)
if (isDNSRegistrarSupported && tldowner !== emptyAddress) {
const dnsEntry = await getDNSEntry(name, tldowner, owner)
node.isDNSRegistrar = true
node.dnsOwner = dnsEntry.dnsOwner || emptyAddress
node.state = dnsEntry.state
}
}

console.log(node)
Expand Down
6 changes: 6 additions & 0 deletions src/api/registrar/resolvers.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,10 @@ import {
releaseDeed,
transferOwner,
reclaim,
submitProof,
getOwner
} from '@ensdomains/ui'

import modeNames from '../modes'
import { sendHelper } from '../resolverUtils'

Expand Down Expand Up @@ -114,6 +116,10 @@ const resolvers = {
async releaseDeed(_, { label }) {
const tx = await releaseDeed(label)
return sendHelper(tx)
},
async submitProof(_, { name, parentOwner }) {
const tx = await submitProof(name, parentOwner)
return sendHelper(tx)
}
}
}
Expand Down
3 changes: 3 additions & 0 deletions src/api/schema.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,10 @@ const typeDefs = `
migrationStartDate: Int
currentBlockDate: Int
transferEndDate: Int
gracePeriodEndDate: Int
isNewRegistrar: Boolean
isDNSRegistrar: Boolean
dnsOwner: String
}
extend type Query {
Expand Down
18 changes: 16 additions & 2 deletions src/components/Blockies.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,22 @@ import styled from '@emotion/styled'

const BlockiesContainer = styled('span')``

const Blockies = ({ address, imageSize = 42, className }) => {
const Blockies = ({
address,
imageSize = 42,
color,
bgcolor,
spotcolor,
className
}) => {
console.log({ address, imageSize, color, bgcolor, spotcolor, className })
var imgURL = createIcon({
seed: address.toLowerCase(),
size: 8,
scale: 5
scale: 5,
color,
bgcolor,
spotcolor
}).toDataURL()
var style = {
backgroundImage: 'url(' + imgURL + ')',
Expand All @@ -25,6 +36,9 @@ const Blockies = ({ address, imageSize = 42, className }) => {
Blockies.propTypes = {
address: PropTypes.string.isRequired,
imageSize: PropTypes.number,
color: PropTypes.string,
bgcolor: PropTypes.string,
spotcolor: PropTypes.string,
className: PropTypes.string
}

Expand Down
2 changes: 1 addition & 1 deletion src/components/Icons/OrangeExclamation.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
16 changes: 16 additions & 0 deletions src/components/Icons/You.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import React from 'react'
import styled from '@emotion/styled'

const Button = styled('span')`
color: white;
background: #c7d3e3;
border-radius: 6px;
border: 1px solid #ededed;
padding: 0 2px;
`

const You = () => {
return <Button>You</Button>
}

export default You
Loading

0 comments on commit 6420ba7

Please sign in to comment.