Skip to content
This repository has been archived by the owner on Feb 26, 2020. It is now read-only.

Move Dapps files from @parity/shared ; display icons of builtin dapps from filesystem #114

Merged
merged 12 commits into from
May 23, 2018
310 changes: 200 additions & 110 deletions package-lock.json

Large diffs are not rendered by default.

11 changes: 6 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,8 @@
},
"devDependencies": {
"@parity/dapp-console": "parity-js/dapp-console#6a48e07ce930443c72f93032c45186db7753db33",
"@parity/dapp-dapp-methods": "js-dist-paritytech/dapp-dapp-methods",
"@parity/dapp-dapp-visible": "js-dist-paritytech/dapp-dapp-visible",
"@parity/dapp-dapp-methods": "js-dist-paritytech/dapp-dapp-methods#31626823b6cea962efdbec86ffa5b11dc9918af3",
"@parity/dapp-dapp-visible": "js-dist-paritytech/dapp-dapp-visible#593c64e1f8a3c99d76a0937178e0eb602adddf69",
"@parity/dapp-dappreg": "parity-js/dapp-dappreg#66f2e52dfa9a783cc0ca616505460e5e34ebdf54",
"@parity/dapp-develop": "js-dist-paritytech/dapp-develop#3bb84c11bd40687586de6ec758759d9019805d4e",
"@parity/dapp-githubhint": "parity-js/dapp-githubhint#b5cdef016e8bead7669ca077be526897ee42f83a",
Expand Down Expand Up @@ -161,8 +161,8 @@
"@parity/plugin-signer-default": "github:parity-js/plugin-signer-default#dcf8cf23bb050070b6a691413b974b5c2d7d1ce6",
"@parity/plugin-signer-hardware": "github:parity-js/plugin-signer-hardware#e8b8a4e67adc37870e370d22805632d08012b9ee",
"@parity/plugin-signer-qr": "github:parity-js/plugin-signer-qr#c275ba13524e9f6759079fabd10faf49cc00cfc0",
"@parity/shared": "2.2.27",
"@parity/ui": "3.1.4",
"@parity/shared": "2.2.28",
"@parity/ui": "3.1.7",
"axios": "0.18.0",
"command-exists": "1.2.2",
"commander": "2.15.1",
Expand Down Expand Up @@ -191,6 +191,7 @@
"redux": "3.7.2",
"semantic-ui-react": "0.77.0",
"solc": "ngotchac/solc-js",
"store": "1.3.20"
"store": "1.3.20",
"util.promisify": "1.0.0"
}
}
23 changes: 6 additions & 17 deletions src/Dapp/dapp.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,17 +20,15 @@ import isElectron from 'is-electron';
import { observer } from 'mobx-react';
import PropTypes from 'prop-types';
import path from 'path';
import { getBuildPath } from '../util/host';
import url from 'url';

import builtinDapps from '@parity/shared/lib/config/dappsBuiltin.json';
import viewsDapps from '@parity/shared/lib/config/dappsViews.json';
import DappsStore from '@parity/shared/lib/mobx/dappsStore';
import builtinDapps from '../Dapps/dappsBuiltin.json';
import DappsStore from '../Dapps/store';
import HistoryStore from '@parity/shared/lib/mobx/historyStore';

import RequestsStore from '../DappRequests/store';
import styles from './dapp.css';

const internalDapps = [].concat(viewsDapps, builtinDapps);
import styles from './dapp.css';

@observer
export default class Dapp extends Component {
Expand All @@ -54,7 +52,7 @@ export default class Dapp extends Component {
componentWillMount () {
const { id } = this.props.params;

if (!internalDapps[id] || !internalDapps[id].skipHistory) {
if (!builtinDapps[id] || !builtinDapps[id].skipHistory) {
this.historyStore.add(id);
}

Expand Down Expand Up @@ -136,17 +134,8 @@ export default class Dapp extends Component {
)

renderWebview = (src, hash) => {
const remote = window.require('electron').remote;
// Replace all backslashes by front-slashes (happens in Windows)
// Note: `dirName` contains backslashes in Windows. One would assume that
// path.join in Windows would handle everything for us, but after some time
// I realized that even in Windows path.join here bahaves like POSIX (maybe
// it's electron, maybe browser env?). Switching to '/'. -Amaury 12.03.2018
const posixDirName = remote.getGlobal('dirName').replace(/\\/g, '/');
const preload = `file://${path.join(
posixDirName,
'..',
'.build',
getBuildPath(),
'inject.js'
)}`;

Expand Down
2 changes: 1 addition & 1 deletion src/DappRequests/RequestGroups/RequestGroups.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import React, { Component } from 'react';
import PropTypes from 'prop-types';
import { FormattedMessage } from 'react-intl';

import DappsStore from '@parity/shared/lib/mobx/dappsStore';
import DappsStore from '../../Dapps/store';

import RequestGroupSubItem from './RequestGroupSubItem';
import styles from './RequestGroups.css';
Expand Down
2 changes: 1 addition & 1 deletion src/Dapps/dapps.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import PropTypes from 'prop-types';
import Checkbox from '@parity/ui/lib/Form/Checkbox';
import Page from '@parity/ui/lib/Page';

import DappsStore from '@parity/shared/lib/mobx/dappsStore';
import DappsStore from './store';

import DappCard from './DappCard';

Expand Down
138 changes: 138 additions & 0 deletions src/Dapps/dappsBuiltin.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,138 @@
[
{
"id": "0x889d3403834b4ef359448575dcd6d77334330edaecc66a77051483f3a498ab6e",
"url": "dappMethods",
"src": "DappMethods",
"name": "Dapp Method Permissions",
"package": "@parity/dapp-dapp-methods",
"description": "Allow setting of dapp permissions on a per method level",
"author": "Parity Team <[email protected]>",
"version": "2.0.0",
"visible": true
},
{
"id": "0xa48bd8fd56c90c899135281967a6cf90865c221b46f27f9fbe2a236d74a64ea2",
"url": "dappVisible",
"src": "DappVisible",
"name": "Browse Dapps",
"package": "@parity/dapp-dapp-visible",
"description": "Allow setting of visible dapps",
"author": "Parity Team <[email protected]>",
"version": "2.0.0",
"visible": true
},
{
"id": "0xcd423760c9650eb549b1615f6cf96d420e32aadcea2ff5fe11c26457244adcc1",
"url": "status",
"src": "Status",
"name": "Node Status",
"package": "@parity/dapp-status",
"description": "Check the status of your Parity node",
"author": "Parity Team <[email protected]>",
"version": "2.0.1",
"visible": true
},
{
"id": "0x89682fd2c0ffa4ff53a8dc2c5f6a65c6e31de8f659fa2935a07a678e711a58a3",
"url": "develop",
"src": "Develop",
"name": "Develop Contracts",
"package": "@parity/dapp-develop",
"description": "Watch and develop contracts",
"author": "Parity Team <[email protected]>",
"version": "1.0.2",
"visible": true
},
{
"url": "chaindeploy",
"name": "Chain Deployment",
"package": "@parity/dapp-chaindeploy",
"description": "Deploy all basic contracts, names & applications to the network",
"author": "Parity Team <[email protected]>",
"version": "1.0.0",
"visible": false,
"noselect": false
},
{
"id": "0xa635a9326814bded464190eddf0bdb90ce92d40ea2359cf553ea80e3c5a4076c",
"url": "console",
"name": "Parity/Web3 console",
"package": "@parity/dapp-console",
"description": "A Javascript development console complete with web3 and parity objects",
"version": "0.3",
"author": "Gav Wood <[email protected]>",
"position": "top-right",
"visible": true
},
{
"id": "0xf9f2d620c2e08f83e45555247146c62185e4ab7cf82a4b9002a265a0d020348f",
"url": "tokendeploy",
"name": "Token Deployment",
"package": "@parity/dapp-tokendeploy",
"description": "Deploy new basic tokens that you are able to send around",
"author": "Parity Team <[email protected]>",
"version": "1.0.0",
"visible": true
},
{
"id": "0xd1adaede68d344519025e2ff574650cd99d3830fe6d274c7a7843cdc00e17938",
"url": "registry",
"name": "Registry",
"package": "@parity/dapp-registry",
"description": "A global registry of addresses on the network",
"author": "Parity Team <[email protected]>",
"version": "1.0.0",
"visible": true
},
{
"id": "0x0a8048117e51e964628d0f2d26342b3cd915248b59bcce2721e1d05f5cfa2208",
"url": "tokenreg",
"name": "Token Registry",
"package": "@parity/dapp-tokenreg",
"description": "A registry of transactable tokens on the network",
"author": "Parity Team <[email protected]>",
"version": "1.0.0",
"visible": true
},
{
"id": "0xf49089046f53f5d2e5f3513c1c32f5ff57d986e46309a42d2b249070e4e72c46",
"url": "signaturereg",
"name": "Method Registry",
"package": "@parity/dapp-signaturereg",
"description": "A registry of method signatures for lookups on transactions",
"author": "Parity Team <[email protected]>",
"version": "1.0.0",
"visible": true
},
{
"id": "0x058740ee9a5a3fb9f1cfa10752baec87e09cc45cd7027fd54708271aca300c75",
"url": "githubhint",
"name": "GitHub Hint",
"package": "@parity/dapp-githubhint",
"description": "A mapping of GitHub URLs to hashes for use in contracts as references",
"author": "Parity Team <[email protected]>",
"version": "1.0.0",
"visible": true,
"onlyPersonal": true
},
{
"id": "0xae74ad174b95cdbd01c88ac5b73a296d33e9088fc2a200e76bcedf3a94a7815d",
"url": "localtx",
"name": "TxQueue Viewer",
"package": "@parity/dapp-localtx",
"description": "Have a peek at the internals of your node's transaction queue",
"author": "Parity Team <[email protected]>",
"version": "1.0.0",
"visible": true
},
{
"id": "0x7bbc4f1a27628781b96213e781a1b8eec6982c1db8fac739af6e4c5a55862c03",
"url": "dappreg",
"name": "Dapp Registration",
"package": "@parity/dapp-dappreg",
"description": "Enables the registration and content management of dapps on the network",
"author": "Parity Team <[email protected]>",
"version": "1.0.0",
"visible": true
}
]
Loading