Ui 2 expand method filters (#5974)

* Add account & vault APIs

* Additional status methods

* Move permission modals into Dapp

* Adjust display position

* Don't publish invalid events
This commit is contained in:
Jaco Greeff 2017-07-03 17:05:56 +02:00 committed by GitHub
parent 7f77e6004c
commit 15a9e56b09
21 changed files with 84 additions and 51 deletions

View File

@ -38,6 +38,7 @@ export default function Request ({ appId, className, approveRequest, denyRequest
method
} }
/>
<div>
<Button
label={
<FormattedMessage
@ -66,6 +67,7 @@ export default function Request ({ appId, className, approveRequest, denyRequest
onClick={ _onReject }
/>
</div>
</div>
);
}

View File

@ -18,13 +18,16 @@
.requests {
background: #f80;
color: white;
bottom: 0;
position: fixed;
left: 0;
right: 0;
top: 0;
z-index: 760; /* sits above requests */
.request {
align-items: center;
display: flex;
justify-content: flex-end;
padding: 0.5em;
> span {

View File

@ -17,5 +17,29 @@
export default {
'parity_accountsInfo': {},
'parity_allAccountsInfo': {},
'parity_hashContent': {}
'parity_changeVault': {},
'parity_changeVaultPassword': {},
'parity_consensusCapability': {},
'parity_checkRequest': {},
'parity_closeVault': {},
'parity_executeUpgrade': {},
'parity_generateSecretPhrase': {},
'parity_getVaultMeta': {},
'parity_hashContent': {},
'parity_importGethAccounts': {},
'parity_localTransactions': {},
'parity_listGethAccounts': {},
'parity_listVaults': {},
'parity_listOpenedVaults': {},
'parity_newAccountFromPhrase': {},
'parity_newAccountFromSecret': {},
'parity_newAccountFromWallet': {},
'parity_newVault': {},
'parity_openVault': {},
'parity_phraseToAddress': {},
'parity_setAccountMeta': {},
'parity_setAccountName': {},
'parity_setVaultMeta': {},
'parity_upgradeReady': {},
'parity_versionInfo': {}
};

View File

@ -17,7 +17,7 @@
import { action, computed, observable } from 'mobx';
import filteredRequests from './filteredRequests';
import MethodsStore from '../DappMethods/store';
import MethodsStore from '../Dapps/SelectMethods/store';
let nextQueueId = 0;
@ -116,9 +116,13 @@ export default class Store {
}
receiveMessage = ({ data, origin, source }) => {
if (!data) {
return;
}
const { from, method, token } = data;
if (from === 'shell' || from !== token) {
if (!from || from === 'shell' || from !== token) {
return;
}

View File

@ -14,4 +14,4 @@
// You should have received a copy of the GNU General Public License
// along with Parity. If not, see <http://www.gnu.org/licenses/>.
export default from './dappsVisible';
export default from './selectAccounts';

View File

@ -21,7 +21,7 @@ import { FormattedMessage } from 'react-intl';
import { AccountCard, Portal, SelectionList } from '@parity/ui';
@observer
export default class DappAccounts extends Component {
export default class SelectAccounts extends Component {
static propTypes = {
permissionStore: PropTypes.object.isRequired
};

View File

@ -29,7 +29,7 @@ function renderShallow (permissionStore = {}) {
return component;
}
describe('shell/DappAccounts', () => {
describe('shell/Dapps/SelectAccounts', () => {
describe('rendering', () => {
it('renders defaults', () => {
expect(renderShallow()).to.be.ok;

View File

@ -14,4 +14,4 @@
// You should have received a copy of the GNU General Public License
// along with Parity. If not, see <http://www.gnu.org/licenses/>.
export default from './dappMethods';
export default from './selectMethods';

View File

@ -21,10 +21,10 @@ import { FormattedMessage } from 'react-intl';
import { Portal } from '@parity/ui';
import MethodCheck from './MethodCheck';
import styles from './dappMethods.css';
import styles from './selectMethods.css';
@observer
export default class DappsMethods extends Component {
export default class SelectMethods extends Component {
static propTypes = {
methodsStore: PropTypes.object.isRequired,
visibleStore: PropTypes.object.isRequired

View File

@ -19,7 +19,7 @@ import store from 'store';
import { sha3 } from '@parity/api/util/sha3';
import filteredRequests from '../DappRequests/filteredRequests';
import filteredRequests from '../../DappRequests/filteredRequests';
const LS_PERMISSIONS = '_parity::dapps::methods';

View File

@ -14,4 +14,4 @@
// You should have received a copy of the GNU General Public License
// along with Parity. If not, see <http://www.gnu.org/licenses/>.
export default from './dappAccounts';
export default from './selectVisible';

View File

@ -20,10 +20,10 @@ import { FormattedMessage } from 'react-intl';
import { DappCard, Portal, SelectionList } from '@parity/ui';
import styles from './dappsVisible.css';
import styles from './selectVisible.css';
@observer
export default class DappsVisible extends Component {
export default class SelectVisible extends Component {
static propTypes = {
store: PropTypes.object.isRequired
};

View File

@ -25,7 +25,7 @@ function renderShallow (store = {}) {
);
}
describe('shell/DappsVisible', () => {
describe('shell/Dapps/SelectVisible', () => {
describe('rendering', () => {
it('renders defaults', () => {
expect(renderShallow()).to.be.ok;

View File

@ -23,11 +23,11 @@ import { connect } from 'react-redux';
import { Actionbar, Button, Checkbox, DappCard, Page, SectionList } from '@parity/ui';
import { LockedIcon, MethodsIcon, VisibleIcon } from '@parity/ui/Icons';
import DappAccounts from '../DappAccounts';
import PermissionStore from '../DappAccounts/store';
import DappMethods from '../DappMethods';
import MethodsStore from '../DappMethods/store';
import DappsVisible from '../DappsVisible';
import SelectAccounts from './SelectAccounts';
import PermissionStore from './SelectAccounts/store';
import DappSelectMethods from './SelectMethods';
import MethodsStore from './SelectMethods/store';
import SelectVisible from './SelectVisible';
import DappsStore from './dappsStore';
@ -83,12 +83,12 @@ class Dapps extends Component {
return (
<div>
<DappAccounts permissionStore={ this.permissionStore } />
<DappMethods
<SelectAccounts permissionStore={ this.permissionStore } />
<DappSelectMethods
methodsStore={ this.methodsStore }
visibleStore={ this.store }
/>
<DappsVisible store={ this.store } />
<SelectVisible store={ this.store } />
<Actionbar
className={ styles.toolbar }
title={

View File

@ -42,7 +42,7 @@ import SecureApi from '~/secureApi';
import Application from './Application';
import Dapp from './Dapp';
import { setupProviderFilters } from './DappRequests';
import DappMethodsStore from './DappMethods/store';
import DappMethodsStore from './Dapps/SelectMethods/store';
import Dapps from './Dapps';
injectTapEventPlugin();