This repository has been archived by the owner on Nov 6, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Allow tagging of Accounts, Addresses and Contracts #2697
Closed
Closed
Changes from all commits
Commits
Show all changes
1371 commits
Select commit
Hold shift + click to select a range
82be42c
Merge pull request #2428 from ethcore/jg-abi-updates
jacogr bd42517
fixes for non-null returns
jacogr b4fa454
Merge pull request #2430 from ethcore/jg-dapp-fixes
jacogr 32acb02
adjust registry names
jacogr 7774b7f
signaturereg registered, remove hardcoding
jacogr c4372f5
Merge pull request #2431 from ethcore/jg-signaturereg-hardcode
jacogr 4fbeb15
Merge branch 'js' into jg-dapp-basiccoin
jacogr 1461c9c
expose address on instance
jacogr f0dafae
add postcss variables
jacogr 7bffe3a
deployment estimation in-place
jacogr 1203695
cleanups, still testing...
jacogr 92d21e0
update with new event definition
jacogr 08364ad
deployment in place
jacogr 0183708
Merged branch master into js
jacogr 860ffc2
Merged branch js into jg-dapp-basiccoin
jacogr 62e0383
basic event display (Created)
jacogr fe9c205
deployment events are working
jacogr 2b1fcd5
unused file
jacogr bdac126
small form styling updates
jacogr dbee9f9
update navigation styling
jacogr c923c8b
overview, start loading own tokens
jacogr f324b1f
overview list of tokens by owner
jacogr 99a8085
simplify services
jacogr 5b5c1e2
Merged branch master into js
jacogr 40fa442
Merge branch 'js' into jg-dapp-basiccoin
jacogr b79065e
use services for calls
jacogr b441be8
address selector for deploy (non-perfect)
jacogr d91b341
Merge pull request #2444 from ethcore/jg-dapp-basiccoin
jacogr d744d21
update styling, simplify
jacogr d995861
Merge branch 'js' into jg-dapp-basiccoin
jacogr 00806e4
address -> name mappings
jacogr d2a7461
expanding, loading all coin details
jacogr 4e87b00
Merged branch master into js
jacogr b0418e7
Merged branch js into jg-dapp-basiccoin
jacogr 483eafd
send use only actual BasicCoin tokens registered (any reg)
jacogr e55b069
sending token & accounts
jacogr 3faef8c
form styling updates
jacogr 6919baf
send form layout in place
jacogr ac717b4
coin send working as expected
jacogr b957793
Merge pull request #2456 from ethcore/jg-dapp-basiccoin
jacogr 3d362e1
api subscriptions on multiple addresses
jacogr dbe83ae
bring in events
jacogr 171ab80
Merge branch 'js' into jg-dapp-basiccoin
jacogr b01dc41
simplify
jacogr adf8493
basic events display in-place, functionally complete
jacogr d86e6e1
basic functionality in-place
jacogr cab677d
Merge pull request #2468 from ethcore/jg-dapp-basiccoin
jacogr 499c873
Merged branch master into js
jacogr 6754286
fix horrible event address issue
jacogr 0d8cfd9
rwork display of events slightly
jacogr 6103253
Merge branch 'js' into jg-dapp-basiccoin
jacogr 7b48f8c
Merge pull request #2469 from ethcore/jg-dapp-basiccoin
jacogr 227b19f
test TLA availability
jacogr 73684e5
Merge branch 'js' into jg-dapp-basiccoin
jacogr 0482c60
table for owner -> tokens
jacogr 5d7470d
fix signature lookup address
jacogr 1761eca
fix signature lookup address
jacogr 4d896ac
Merge pull request #2480 from ethcore/jg-hardcoded-signaturereg-address
jacogr d5e8137
Merge branch 'master' into js
jacogr 41c4d49
Merge branch 'js' into jg-dapp-basiccoin
jacogr 0464d7a
basic overview styling
jacogr 6393878
txhash links
jacogr 8f94760
page layout adjustments
jacogr aee0930
background import
jacogr 9d9943e
adjust colors
jacogr f54734b
no global registration, simplify color selection
jacogr 02836ec
updated styling
jacogr 3011b11
Merge pull request #2491 from ethcore/jg-dapp-basiccoin
jacogr 49cd110
Merged branch master into js
jacogr dbff799
connection dialog for "busy connecting"
jacogr 245811b
initial token connection - WIP
jacogr bc80103
Merged branch master into js
jacogr 6d6a77b
Merged branch js into jg-connection-prompts
jacogr 400c667
init token updates take place
jacogr d16242d
Merged branch master into js
jacogr ccecbe0
Merged branch js into jg-connection-prompts
jacogr 24ee185
basic test for manual token
jacogr b7be1b0
rework connection display
jacogr 1f1fc11
allow updates of the secure token
jacogr 408e08d
Merge commit '4655fd04a507d8c4e5b6cab28af54c64a0ba7186' into js
jacogr 01909ae
Merge branch 'js' into jg-connection-prompts
jacogr 06937c9
Merge pull request #2504 from ethcore/jg-connection-prompts
jacogr 39bfde4
first stab at making the build build
jacogr e61652e
update runner tags
jacogr 1541aad
fix linting issues
jacogr ffc2bf8
skip tests requiring network (should be e2e, TODO)
jacogr 633280e
re-enable javascript tag/runner
jacogr 58b486f
release push does the trick
jacogr 898262b
push to any branch, CI name
jacogr 9a1d088
javscript-test runner as well
jacogr ece9204
swap dependencies build requires test
jacogr acc33c7
revert stages swap
jacogr 6c6c97e
Merge commit '72ec9366ad45526d16f6c78b5dfb32d16ba5aa6c' into js
jacogr 4bf8e84
retrieve images associated with tokens
jacogr 67a3f32
remove js build deps order
jacogr 377f767
null image when hash = 0x0
jacogr 3a2c307
6x64 images (hashes for registries)
jacogr 26b587e
don't pass tokens as prop to IdentityIcon
jacogr ce7bc39
check images against content hash pictures
jacogr 9f85eb2
cleanup signer after connection changes
jacogr 2a074cb
fix naming typo
jacogr 47cd354
display unknownImages for balances (not available as content hash)
jacogr 217c3db
unknownImage for transfer dialog
jacogr 1630c5e
basic githubhint layout
jacogr 6ced51d
single input for commit/filename
jacogr 25debcf
ethcore_hashContent call
jacogr 87af473
lookup hash
jacogr 58b1fb7
registration in place
jacogr 0a7dad3
Merge pull request #2531 from ethcore/jg-dapp-githubhint
jacogr c8d1adc
Merge commit 'f200eb2cfe80f409603b14baf1341632ad18b1b2' into js
jacogr 2edeca2
Merge branch 'js' into jg-contract-images
jacogr 83b6a9c
Merge branch 'js' into jr-registry-manage-records
jacogr c21f115
fixes
jacogr 23d469b
events is using a proper table
jacogr 729e95f
pass value through as-is
jacogr 3eb8d09
stop wrongly using main app IdentityIcon
jacogr 0925439
NEVER export class instance functions
jacogr e764666
alignment back to normal
jacogr b10f164
Merge pull request #2323 from ethcore/jr-registry-manage-records
jacogr 52184d1
Merge commit 'd6cad29f49ffae75c5af09a45fca788945aad772' into js
jacogr d5b13aa
Merge branch 'js' into jg-gitlab-build
jacogr f3b45e0
typo in definition
jacogr 98bf283
Merge branch 'js' into jg-gitlab-build
jacogr ecccc01
Merge branch 'js' into jg-contract-images
jacogr 981eaaa
set & get images working (mostly)
jacogr 5181d24
show content retrieval info
jacogr 0614742
Merge branch 'master' into js
jacogr 0faca98
Merge branch 'js' into jg-gitlab-build
jacogr ad49ca4
set exitcode via ||
jacogr 3d79906
use javascript:latest images
jacogr 8a7f53d
disable npm progress bar
jacogr 39af38b
rename phase I
jacogr f0c2bc6
rename phase II
jacogr 62fb468
only send build output to GitHub on major branches
jacogr 7af3526
also run the build step as part of the test (until comprehensive)
jacogr 032e796
ci-specific build (no webpack progress)
jacogr 4aa45a4
Merge pull request #2522 from ethcore/jg-gitlab-build
jacogr 2a467cf
allow for account creation via recovery phrase
jacogr 088d7fd
Merge pull request #2545 from ethcore/jg-recovery-phrase
jacogr d1bcfdd
display account uuid (where available), closes #2546
jacogr 4c1fe0a
Merge pull request #2549 from ethcore/jg-account-uuid
jacogr 5029881
connection dialog now shows up in dapps as well, closes #2538
jacogr 1c04f43
Merge pull request #2550 from ethcore/jg-connection-dapps
jacogr 09a2834
Merge branch 'js' into jg-contract-images
jacogr 1a4d52d
Merge branch 'jg-tokenreg-fixes' into jg-contract-images
jacogr 455cb9a
token images show up as expected
jacogr 381be02
IdentityName component added and deployed
jacogr fa0458e
fix padding tests
jacogr a5d9b54
Merge branch 'js' into jg-tokenreg-fixes
jacogr 0526551
adjust tests to map to stricter 0x-prefixed hex
jacogr e81be8e
Merge branch 'jg-tokenreg-fixes' into jg-contract-images
jacogr a570ce0
Merge pull request #2540 from ethcore/jg-tokenreg-fixes
jacogr 8eb27af
Merge pull request #2526 from ethcore/jg-contract-images
jacogr 82a818e
Merge branch 'js' into jg-address-names
jacogr 2aa8182
render names via common component for the address -> name
jacogr b6cf9d4
Merge pull request #2557 from ethcore/jg-address-names
jacogr 2517e31
Merge master into js
jacogr 8f1f9e3
Merge branch 'js' of https://github.com/ethcore/parity into js
jacogr 4efc831
split lint into seperate script (early exit)
jacogr 16393d2
test phases changed to lint, test & pack
jacogr ea92124
pack part of test phase
jacogr aa910f5
remove files marked for deletion (cleanup)
jacogr b553d11
Signer cleanups, start moving in the direction of the rest
jacogr d3b492f
add personal signer methods
jacogr 7ce9b76
basic signer request subscription
jacogr de2a5c4
don't poll blockNumber when not connected
jacogr 2aa4066
missing return, creating massive ws queue backlogs
jacogr 5cbf5d9
Merge pull request #2565 from ethcore/jg-polling
jacogr 45d25e6
ΞTH -> ETH
jacogr 60317bb
Merge pull request #2566 from ethcore/jg-E-character
jacogr 297e3a4
fix failing tests
jacogr d0f6b1c
Merge pull request #2567 from ethcore/jg-fix-tests
jacogr 02501b8
registry uses setAddress to actually set addresses now
jacogr af262b3
Merge pull request #2568 from ethcore/jg-registry-update-fix
jacogr 0b0f28d
bytes mapping operates on lowerCase hex strings
jacogr 98137d9
sha3 ids for each application
jacogr 5271a79
add dappreg to list of contracts
jacogr 3cfbab2
adjust alignment of queries
jacogr f9700a8
Merge pull request #2573 from ethcore/jg-contract-styling
jacogr fb8af93
show gas estimation log
jacogr 74b363b
Merge commit '5e24a35272a99ad002c5d065a7335525eb2ce769' into js
jacogr 8db4bfb
Merge branch 'js' into jg-list-apps
jacogr 687246d
abi with payable for register function
jacogr ef33313
add key as required
jacogr 619a9cf
image retrieval from dappreg
jacogr 9c03b0c
use proper Image urls
jacogr d751b1b
embed and link apps from Parity, retrieved via /api/apps
jacogr 12c4887
Merge pull request #2581 from ethcore/jg-list-apps
jacogr 3ba611b
Merge branch 'master' into js
jacogr 13f25bc
filter apps that has been replaced
jacogr 44a047c
Merge pull request #2583 from ethcore/jg-list-apps
jacogr b1e9d91
proxy entry for parity-utils
jacogr f19a9f3
add basiccoin abi
jacogr 796bd4f
add support for fallback abi type
jacogr ea9031c
capture constructor paramaters
jacogr cafb647
Merge branch 'master' into js
jacogr cfcfa81
merge master into js
jacogr 35429a8
Merge pull request #2586 from ethcore/jg-contract-constructor-params
jacogr 98d059d
move images to assets/images/
jacogr 8ed6712
add font assets
jacogr 55be649
import fonts as part of build
jacogr 6caac6b
don't inline woff files
jacogr dd7cfaf
Merge pull request #2588 from ethcore/jg-webpack-bundle-fonts
jacogr 680e979
Revert "merge master into js"
jacogr 5afbc4b
remove unused npm packages
jacogr 08a7434
Merge pull request #2590 from ethcore/jg-package-updates
jacogr d9d3d05
information on gas estimates (like almost everywhere else)
jacogr 452f9ef
don't pass gas & gasPrice to estimation
jacogr a93604b
Merge pull request #2593 from ethcore/jg-send-estimategas-0
jacogr bee3fea
display account passwordhint when available
jacogr 27d78a7
Merge pull request #2596 from ethcore/jg-signer-passwordhint
jacogr c5e46f9
Merge branch 'master' into js
jacogr 66db9e9
signer subscriptions based on polling & function trapping
jacogr d32db27
pending requests retrieved via jsapi
jacogr a126c41
Merge branch 'master' into js
jacogr 6ae554b
Merge branch 'js' into jg-signer-jsapi
jacogr 82c78dc
update signer middleware
jacogr 2a02bdb
remove all web3 instances
jacogr d1ce0da
remove web3 package
jacogr 144bbde
last web3 dependencies removed
jacogr 30393b7
no need to toChecksumAddress - api takes care of it
jacogr ef4b6d7
expand description for personal_confirmRequest
jacogr 698d958
Signer conversion from web3 -> parity.js completed
jacogr a8f6245
Merge pull request #2604 from ethcore/jg-signer-jsapi
jacogr e7f3db1
explicit in no return
jacogr 35f9169
green circle background
jacogr b50bd8f
remove generated background
jacogr bdd82f5
remove dangling web3 files
jacogr 2fa3520
update manager test for signer
jacogr 8bcec2d
Merge pull request #2610 from ethcore/jg-styling
jacogr e0e73b1
Merge pull request #2611 from ethcore/jg-fix-tests
jacogr 8acf0b4
Merge branch 'master' into js
jacogr 3fb3614
cater for txhash returning null/empty object
jacogr 0ebb242
Merge pull request #2629 from ethcore/jg-transaction-update
jacogr 5284cea
adjust output directories
jacogr 0ecc4d5
Merge pull request #2630 from ethcore/jg-build-location
jacogr 1c2b9da
Release merge with origin with ours strategy
jacogr 296a04e
Merge pull request #2631 from ethcore/jg-release-update
jacogr ce50705
Merge branch 'master' into js
jacogr af07d67
Added tag to the editMeta Modal (#2643)
ngotchac f4163bf
Added Tags to ui and to contract/address/account Header (#2643)
ngotchac 8e41488
Added tags to summary (#2643)
ngotchac 80f1422
Added Search capabilities to contracts/address book/accounts from tokens
ngotchac f3df108
fixes eslint
ngotchac 65df179
Using Chips/Tokens for search (#2643)
ngotchac 19e326c
Add search tokens, clickable from List (#2643)
ngotchac 9b5ec02
Add sort capabilities to Accounts / Addresses / Contracts (#2643)
ngotchac c19cb8a
Fixes formatting issues + state updates after component unmount bug
ngotchac 6a3c34d
Remove unused import
ngotchac fd5c206
Merge branch 'master' into ng-accounts-tagging
ngotchac File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,6 +17,8 @@ | |
import React, { Component, PropTypes } from 'react'; | ||
import ContentClear from 'material-ui/svg-icons/content/clear'; | ||
import ContentSave from 'material-ui/svg-icons/content/save'; | ||
// import ChipInput from 'material-ui-chip-input'; | ||
import ChipInput from 'material-ui-chip-input/src/ChipInput'; | ||
|
||
import { Button, Form, Input, Modal } from '../../ui'; | ||
import { validateName } from '../../util/validation'; | ||
|
@@ -55,6 +57,7 @@ export default class EditMeta extends Component { | |
error={ nameError } | ||
onSubmit={ this.onNameChange } /> | ||
{ this.renderMetaFields() } | ||
{ this.renderTags() } | ||
</Form> | ||
</Modal> | ||
); | ||
|
@@ -96,6 +99,21 @@ export default class EditMeta extends Component { | |
}); | ||
} | ||
|
||
renderTags () { | ||
const { meta } = this.state; | ||
const { tags } = meta || []; | ||
const onChange = (chips) => this.onMetaChange('tags', chips); | ||
|
||
return (<ChipInput | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
defaultValue={ tags } | ||
onChange={ onChange } | ||
floatingLabelText='(optional) tags' | ||
hintText='press <Enter> to add a tag' | ||
floatingLabelFixed | ||
fullWidth | ||
/>); | ||
} | ||
|
||
onNameChange = (name) => { | ||
this.setState(validateName(name)); | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
// Copyright 2015, 2016 Ethcore (UK) Ltd. | ||
// This file is part of Parity. | ||
|
||
// Parity is free software: you can redistribute it and/or modify | ||
// it under the terms of the GNU General Public License as published by | ||
// the Free Software Foundation, either version 3 of the License, or | ||
// (at your option) any later version. | ||
|
||
// Parity is distributed in the hope that it will be useful, | ||
// but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
// GNU General Public License for more details. | ||
|
||
// 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 './search'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
/* Copyright 2015, 2016 Ethcore (UK) Ltd. | ||
/* This file is part of Parity. | ||
/* | ||
/* Parity is free software: you can redistribute it and/or modify | ||
/* it under the terms of the GNU General Public License as published by | ||
/* the Free Software Foundation, either version 3 of the License, or | ||
/* (at your option) any later version. | ||
/* | ||
/* Parity is distributed in the hope that it will be useful, | ||
/* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
/* GNU General Public License for more details. | ||
/* | ||
/* You should have received a copy of the GNU General Public License | ||
/* along with Parity. If not, see <http://www.gnu.org/licenses/>. | ||
*/ | ||
.searchcontainer { | ||
display: flex; | ||
overflow: hidden; | ||
} | ||
|
||
.searchButton { | ||
min-width: 50px !important; | ||
} | ||
|
||
.input { | ||
width: 500px !important; | ||
} | ||
|
||
.inputContainer { | ||
transition: width 450ms ease-in-out 0ms, height 0ms ease-in-out 0ms; | ||
white-space: nowrap; | ||
overflow: hidden; | ||
width: 500px; | ||
height: 100%; | ||
position: relative; | ||
} | ||
|
||
.inputContainerShown { | ||
transition: width 450ms ease-in-out 0ms, height 0ms ease-in-out 400ms; | ||
width: 0; | ||
height: 0; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,176 @@ | ||
// Copyright 2015, 2016 Ethcore (UK) Ltd. | ||
// This file is part of Parity. | ||
|
||
// Parity is free software: you can redistribute it and/or modify | ||
// it under the terms of the GNU General Public License as published by | ||
// the Free Software Foundation, either version 3 of the License, or | ||
// (at your option) any later version. | ||
|
||
// Parity is distributed in the hope that it will be useful, | ||
// but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
// GNU General Public License for more details. | ||
|
||
// You should have received a copy of the GNU General Public License | ||
// along with Parity. If not, see <http://www.gnu.org/licenses/>. | ||
|
||
import React, { Component, PropTypes } from 'react'; | ||
// import ChipInput from 'material-ui-chip-input'; | ||
import ChipInput from 'material-ui-chip-input/src/ChipInput'; | ||
import ActionSearch from 'material-ui/svg-icons/action/search'; | ||
import { uniq } from 'lodash'; | ||
|
||
import { Button } from '../../'; | ||
|
||
import styles from './search.css'; | ||
|
||
export default class ActionbarSearch extends Component { | ||
static propTypes = { | ||
onChange: PropTypes.func.isRequired, | ||
tokens: PropTypes.array | ||
}; | ||
|
||
state = { | ||
showSearch: false, | ||
stateChanging: false, | ||
inputValue: '', | ||
timeoutIds: [] | ||
} | ||
|
||
componentWillReceiveProps (nextProps) { | ||
const { tokens } = nextProps; | ||
|
||
if (tokens.length > 0 && this.props.tokens.length === 0) { | ||
this.handleOpenSearch(true, true); | ||
} | ||
} | ||
|
||
componentWillUnmount () { | ||
const { timeoutIds } = this.state; | ||
|
||
if (timeoutIds.length > 0) { | ||
timeoutIds.map(id => window.clearTimeout(id)); | ||
} | ||
} | ||
|
||
render () { | ||
const { showSearch } = this.state; | ||
const { tokens } = this.props; | ||
|
||
const inputContainerClasses = [ styles.inputContainer ]; | ||
|
||
if (!showSearch) { | ||
inputContainerClasses.push(styles.inputContainerShown); | ||
} | ||
|
||
return ( | ||
<div | ||
className={ styles.searchcontainer } | ||
key='searchAccount'> | ||
<div className={ inputContainerClasses.join(' ') }> | ||
<ChipInput | ||
clearOnBlur={ false } | ||
className={ styles.input } | ||
hintText='Enter search input...' | ||
hintStyle={ { | ||
transition: 'none' | ||
} } | ||
ref='searchInput' | ||
value={ tokens } | ||
onBlur={ this.handleSearchBlur } | ||
onRequestAdd={ this.handleTokenAdd } | ||
onRequestDelete={ this.handleTokenDelete } | ||
onUpdateInput={ this.handleInputChange } /> | ||
</div> | ||
|
||
<Button | ||
className={ styles.searchButton } | ||
icon={ <ActionSearch /> } | ||
label='' | ||
onClick={ this.handleSearchClick } /> | ||
</div> | ||
); | ||
} | ||
|
||
handleTokenAdd = (value) => { | ||
const { tokens } = this.props; | ||
|
||
const newSearchValues = uniq([].concat(tokens, value)); | ||
|
||
this.setState({ | ||
inputValue: '' | ||
}); | ||
|
||
this.handleSearchChange(newSearchValues); | ||
} | ||
|
||
handleTokenDelete = (value) => { | ||
const { tokens } = this.props; | ||
|
||
const newSearchValues = [] | ||
.concat(tokens) | ||
.filter(v => v !== value); | ||
|
||
this.setState({ | ||
inputValue: '' | ||
}); | ||
|
||
this.handleSearchChange(newSearchValues); | ||
this.refs.searchInput.focus(); | ||
} | ||
|
||
handleInputChange = (value) => { | ||
this.setState({ inputValue: value }); | ||
} | ||
|
||
handleSearchChange = (searchValues) => { | ||
const { onChange } = this.props; | ||
const newSearchValues = searchValues.filter(v => v.length > 0); | ||
|
||
onChange(newSearchValues); | ||
} | ||
|
||
handleSearchClick = () => { | ||
const { showSearch } = this.state; | ||
|
||
this.handleOpenSearch(!showSearch); | ||
} | ||
|
||
handleSearchBlur = () => { | ||
const timeoutId = window.setTimeout(() => { | ||
const { inputValue } = this.state; | ||
const { tokens } = this.props; | ||
|
||
if (tokens.length === 0 && inputValue.length === 0) { | ||
this.handleOpenSearch(false); | ||
} | ||
}, 250); | ||
|
||
this.setState({ | ||
timeoutIds: [].concat(this.state.timeoutIds, timeoutId) | ||
}); | ||
} | ||
|
||
handleOpenSearch = (showSearch, force) => { | ||
if (this.state.stateChanging && !force) return false; | ||
|
||
this.setState({ | ||
showSearch: showSearch, | ||
stateChanging: true | ||
}); | ||
|
||
if (showSearch) { | ||
this.refs.searchInput.focus(); | ||
} else { | ||
this.refs.searchInput.getInputNode().blur(); | ||
} | ||
|
||
const timeoutId = window.setTimeout(() => { | ||
this.setState({ stateChanging: false }); | ||
}, 450); | ||
|
||
this.setState({ | ||
timeoutIds: [].concat(this.state.timeoutIds, timeoutId) | ||
}); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
// Copyright 2015, 2016 Ethcore (UK) Ltd. | ||
// This file is part of Parity. | ||
|
||
// Parity is free software: you can redistribute it and/or modify | ||
// it under the terms of the GNU General Public License as published by | ||
// the Free Software Foundation, either version 3 of the License, or | ||
// (at your option) any later version. | ||
|
||
// Parity is distributed in the hope that it will be useful, | ||
// but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
// GNU General Public License for more details. | ||
|
||
// 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 './sort'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
/* Copyright 2015, 2016 Ethcore (UK) Ltd. | ||
/* This file is part of Parity. | ||
/* | ||
/* Parity is free software: you can redistribute it and/or modify | ||
/* it under the terms of the GNU General Public License as published by | ||
/* the Free Software Foundation, either version 3 of the License, or | ||
/* (at your option) any later version. | ||
/* | ||
/* Parity is distributed in the hope that it will be useful, | ||
/* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
/* GNU General Public License for more details. | ||
/* | ||
/* You should have received a copy of the GNU General Public License | ||
/* along with Parity. If not, see <http://www.gnu.org/licenses/>. | ||
*/ | ||
|
||
.sortButton { | ||
min-width: 50px !important; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
// Copyright 2015, 2016 Ethcore (UK) Ltd. | ||
// This file is part of Parity. | ||
|
||
// Parity is free software: you can redistribute it and/or modify | ||
// it under the terms of the GNU General Public License as published by | ||
// the Free Software Foundation, either version 3 of the License, or | ||
// (at your option) any later version. | ||
|
||
// Parity is distributed in the hope that it will be useful, | ||
// but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
// GNU General Public License for more details. | ||
|
||
// You should have received a copy of the GNU General Public License | ||
// along with Parity. If not, see <http://www.gnu.org/licenses/>. | ||
|
||
import React, { Component, PropTypes } from 'react'; | ||
import IconMenu from 'material-ui/IconMenu'; | ||
import MenuItem from 'material-ui/MenuItem'; | ||
|
||
import SortIcon from 'material-ui/svg-icons/content/sort'; | ||
|
||
import { Button } from '../../'; | ||
|
||
import styles from './sort.css'; | ||
|
||
export default class ActionbarSort extends Component { | ||
static propTypes = { | ||
onChange: PropTypes.func.isRequired, | ||
order: PropTypes.string | ||
}; | ||
|
||
state = { | ||
menuOpen: false | ||
} | ||
|
||
render () { | ||
return ( | ||
<IconMenu | ||
iconButtonElement={ | ||
<Button | ||
className={ styles.sortButton } | ||
label='' | ||
icon={ <SortIcon /> } | ||
onClick={ this.handleMenuOpen } | ||
/> | ||
} | ||
open={ this.state.menuOpen } | ||
onRequestChange={ this.handleMenuChange } | ||
onItemTouchTap={ this.handleSortChange } | ||
targetOrigin={ { horizontal: 'right', vertical: 'top' } } | ||
anchorOrigin={ { horizontal: 'right', vertical: 'top' } } | ||
> | ||
<MenuItem value='tags' primaryText='Sort by tags' /> | ||
<MenuItem value='name' primaryText='Sort by name' /> | ||
</IconMenu> | ||
); | ||
} | ||
|
||
handleSortChange = (event, child) => { | ||
const order = child.props.value; | ||
this.props.onChange(order); | ||
} | ||
|
||
handleMenuOpen = () => { | ||
this.setState({ menuOpen: true }); | ||
} | ||
|
||
handleMenuChange = (open) => { | ||
this.setState({ menuOpen: open }); | ||
} | ||
} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any reason for this? Just curious? (Would remove the original if not needed)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's because the published
material-ui-chip-input
package didn't have all the features needed. Thus I forked it and used my fork here. I made a PR here : TeamWertarbyte/material-ui-chip-input#29Now that it's merged, I have to try out using the published npm package again.