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

Allow tagging of Accounts, Addresses and Contracts #2697

Closed
wants to merge 1,371 commits into from
Closed
Show file tree
Hide file tree
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 Oct 1, 2016
bd42517
fixes for non-null returns
jacogr Oct 1, 2016
b4fa454
Merge pull request #2430 from ethcore/jg-dapp-fixes
jacogr Oct 1, 2016
32acb02
adjust registry names
jacogr Oct 1, 2016
7774b7f
signaturereg registered, remove hardcoding
jacogr Oct 1, 2016
c4372f5
Merge pull request #2431 from ethcore/jg-signaturereg-hardcode
jacogr Oct 1, 2016
4fbeb15
Merge branch 'js' into jg-dapp-basiccoin
jacogr Oct 1, 2016
1461c9c
expose address on instance
jacogr Oct 1, 2016
f0dafae
add postcss variables
jacogr Oct 2, 2016
7bffe3a
deployment estimation in-place
jacogr Oct 2, 2016
1203695
cleanups, still testing...
jacogr Oct 2, 2016
92d21e0
update with new event definition
jacogr Oct 2, 2016
08364ad
deployment in place
jacogr Oct 2, 2016
0183708
Merged branch master into js
jacogr Oct 2, 2016
860ffc2
Merged branch js into jg-dapp-basiccoin
jacogr Oct 2, 2016
62e0383
basic event display (Created)
jacogr Oct 2, 2016
fe9c205
deployment events are working
jacogr Oct 2, 2016
2b1fcd5
unused file
jacogr Oct 2, 2016
bdac126
small form styling updates
jacogr Oct 2, 2016
dbee9f9
update navigation styling
jacogr Oct 2, 2016
c923c8b
overview, start loading own tokens
jacogr Oct 2, 2016
f324b1f
overview list of tokens by owner
jacogr Oct 3, 2016
99a8085
simplify services
jacogr Oct 3, 2016
5b5c1e2
Merged branch master into js
jacogr Oct 3, 2016
40fa442
Merge branch 'js' into jg-dapp-basiccoin
jacogr Oct 3, 2016
b79065e
use services for calls
jacogr Oct 3, 2016
b441be8
address selector for deploy (non-perfect)
jacogr Oct 3, 2016
d91b341
Merge pull request #2444 from ethcore/jg-dapp-basiccoin
jacogr Oct 3, 2016
d744d21
update styling, simplify
jacogr Oct 3, 2016
d995861
Merge branch 'js' into jg-dapp-basiccoin
jacogr Oct 3, 2016
00806e4
address -> name mappings
jacogr Oct 3, 2016
d2a7461
expanding, loading all coin details
jacogr Oct 3, 2016
4e87b00
Merged branch master into js
jacogr Oct 4, 2016
b0418e7
Merged branch js into jg-dapp-basiccoin
jacogr Oct 4, 2016
483eafd
send use only actual BasicCoin tokens registered (any reg)
jacogr Oct 4, 2016
e55b069
sending token & accounts
jacogr Oct 4, 2016
3faef8c
form styling updates
jacogr Oct 4, 2016
6919baf
send form layout in place
jacogr Oct 4, 2016
ac717b4
coin send working as expected
jacogr Oct 4, 2016
b957793
Merge pull request #2456 from ethcore/jg-dapp-basiccoin
jacogr Oct 4, 2016
3d362e1
api subscriptions on multiple addresses
jacogr Oct 4, 2016
dbe83ae
bring in events
jacogr Oct 4, 2016
171ab80
Merge branch 'js' into jg-dapp-basiccoin
jacogr Oct 4, 2016
b01dc41
simplify
jacogr Oct 4, 2016
adf8493
basic events display in-place, functionally complete
jacogr Oct 5, 2016
d86e6e1
basic functionality in-place
jacogr Oct 5, 2016
cab677d
Merge pull request #2468 from ethcore/jg-dapp-basiccoin
jacogr Oct 5, 2016
499c873
Merged branch master into js
jacogr Oct 5, 2016
6754286
fix horrible event address issue
jacogr Oct 5, 2016
0d8cfd9
rwork display of events slightly
jacogr Oct 5, 2016
6103253
Merge branch 'js' into jg-dapp-basiccoin
jacogr Oct 5, 2016
7b48f8c
Merge pull request #2469 from ethcore/jg-dapp-basiccoin
jacogr Oct 5, 2016
227b19f
test TLA availability
jacogr Oct 5, 2016
73684e5
Merge branch 'js' into jg-dapp-basiccoin
jacogr Oct 5, 2016
0482c60
table for owner -> tokens
jacogr Oct 5, 2016
5d7470d
fix signature lookup address
jacogr Oct 5, 2016
1761eca
fix signature lookup address
jacogr Oct 5, 2016
4d896ac
Merge pull request #2480 from ethcore/jg-hardcoded-signaturereg-address
jacogr Oct 5, 2016
d5e8137
Merge branch 'master' into js
jacogr Oct 5, 2016
41c4d49
Merge branch 'js' into jg-dapp-basiccoin
jacogr Oct 5, 2016
0464d7a
basic overview styling
jacogr Oct 5, 2016
6393878
txhash links
jacogr Oct 5, 2016
8f94760
page layout adjustments
jacogr Oct 5, 2016
aee0930
background import
jacogr Oct 5, 2016
9d9943e
adjust colors
jacogr Oct 6, 2016
f54734b
no global registration, simplify color selection
jacogr Oct 6, 2016
02836ec
updated styling
jacogr Oct 6, 2016
3011b11
Merge pull request #2491 from ethcore/jg-dapp-basiccoin
jacogr Oct 6, 2016
49cd110
Merged branch master into js
jacogr Oct 6, 2016
dbff799
connection dialog for "busy connecting"
jacogr Oct 6, 2016
245811b
initial token connection - WIP
jacogr Oct 6, 2016
bc80103
Merged branch master into js
jacogr Oct 6, 2016
6d6a77b
Merged branch js into jg-connection-prompts
jacogr Oct 6, 2016
400c667
init token updates take place
jacogr Oct 6, 2016
d16242d
Merged branch master into js
jacogr Oct 7, 2016
ccecbe0
Merged branch js into jg-connection-prompts
jacogr Oct 7, 2016
24ee185
basic test for manual token
jacogr Oct 7, 2016
b7be1b0
rework connection display
jacogr Oct 7, 2016
1f1fc11
allow updates of the secure token
jacogr Oct 7, 2016
408e08d
Merge commit '4655fd04a507d8c4e5b6cab28af54c64a0ba7186' into js
jacogr Oct 7, 2016
01909ae
Merge branch 'js' into jg-connection-prompts
jacogr Oct 7, 2016
06937c9
Merge pull request #2504 from ethcore/jg-connection-prompts
jacogr Oct 7, 2016
39bfde4
first stab at making the build build
jacogr Oct 7, 2016
e61652e
update runner tags
jacogr Oct 7, 2016
1541aad
fix linting issues
jacogr Oct 7, 2016
ffc2bf8
skip tests requiring network (should be e2e, TODO)
jacogr Oct 7, 2016
633280e
re-enable javascript tag/runner
jacogr Oct 7, 2016
58b486f
release push does the trick
jacogr Oct 7, 2016
898262b
push to any branch, CI name
jacogr Oct 7, 2016
9a1d088
javscript-test runner as well
jacogr Oct 7, 2016
ece9204
swap dependencies build requires test
jacogr Oct 7, 2016
acc33c7
revert stages swap
jacogr Oct 7, 2016
6c6c97e
Merge commit '72ec9366ad45526d16f6c78b5dfb32d16ba5aa6c' into js
jacogr Oct 7, 2016
4bf8e84
retrieve images associated with tokens
jacogr Oct 7, 2016
67a3f32
remove js build deps order
jacogr Oct 7, 2016
377f767
null image when hash = 0x0
jacogr Oct 7, 2016
3a2c307
6x64 images (hashes for registries)
jacogr Oct 7, 2016
26b587e
don't pass tokens as prop to IdentityIcon
jacogr Oct 7, 2016
ce7bc39
check images against content hash pictures
jacogr Oct 7, 2016
9f85eb2
cleanup signer after connection changes
jacogr Oct 7, 2016
2a074cb
fix naming typo
jacogr Oct 7, 2016
47cd354
display unknownImages for balances (not available as content hash)
jacogr Oct 7, 2016
217c3db
unknownImage for transfer dialog
jacogr Oct 7, 2016
1630c5e
basic githubhint layout
jacogr Oct 7, 2016
6ced51d
single input for commit/filename
jacogr Oct 7, 2016
25debcf
ethcore_hashContent call
jacogr Oct 8, 2016
87af473
lookup hash
jacogr Oct 8, 2016
58b1fb7
registration in place
jacogr Oct 8, 2016
0a7dad3
Merge pull request #2531 from ethcore/jg-dapp-githubhint
jacogr Oct 8, 2016
c8d1adc
Merge commit 'f200eb2cfe80f409603b14baf1341632ad18b1b2' into js
jacogr Oct 8, 2016
2edeca2
Merge branch 'js' into jg-contract-images
jacogr Oct 8, 2016
83b6a9c
Merge branch 'js' into jr-registry-manage-records
jacogr Oct 8, 2016
c21f115
fixes
jacogr Oct 8, 2016
23d469b
events is using a proper table
jacogr Oct 8, 2016
729e95f
pass value through as-is
jacogr Oct 8, 2016
3eb8d09
stop wrongly using main app IdentityIcon
jacogr Oct 8, 2016
0925439
NEVER export class instance functions
jacogr Oct 8, 2016
e764666
alignment back to normal
jacogr Oct 8, 2016
b10f164
Merge pull request #2323 from ethcore/jr-registry-manage-records
jacogr Oct 8, 2016
52184d1
Merge commit 'd6cad29f49ffae75c5af09a45fca788945aad772' into js
jacogr Oct 8, 2016
d5b13aa
Merge branch 'js' into jg-gitlab-build
jacogr Oct 8, 2016
f3b45e0
typo in definition
jacogr Oct 8, 2016
98bf283
Merge branch 'js' into jg-gitlab-build
jacogr Oct 8, 2016
ecccc01
Merge branch 'js' into jg-contract-images
jacogr Oct 8, 2016
981eaaa
set & get images working (mostly)
jacogr Oct 8, 2016
5181d24
show content retrieval info
jacogr Oct 9, 2016
0614742
Merge branch 'master' into js
jacogr Oct 9, 2016
0faca98
Merge branch 'js' into jg-gitlab-build
jacogr Oct 9, 2016
ad49ca4
set exitcode via ||
jacogr Oct 9, 2016
3d79906
use javascript:latest images
jacogr Oct 9, 2016
8a7f53d
disable npm progress bar
jacogr Oct 9, 2016
39af38b
rename phase I
jacogr Oct 9, 2016
f0c2bc6
rename phase II
jacogr Oct 9, 2016
62fb468
only send build output to GitHub on major branches
jacogr Oct 9, 2016
7af3526
also run the build step as part of the test (until comprehensive)
jacogr Oct 9, 2016
032e796
ci-specific build (no webpack progress)
jacogr Oct 9, 2016
4aa45a4
Merge pull request #2522 from ethcore/jg-gitlab-build
jacogr Oct 9, 2016
2a467cf
allow for account creation via recovery phrase
jacogr Oct 9, 2016
088d7fd
Merge pull request #2545 from ethcore/jg-recovery-phrase
jacogr Oct 9, 2016
d1bcfdd
display account uuid (where available), closes #2546
jacogr Oct 9, 2016
4c1fe0a
Merge pull request #2549 from ethcore/jg-account-uuid
jacogr Oct 9, 2016
5029881
connection dialog now shows up in dapps as well, closes #2538
jacogr Oct 9, 2016
1c04f43
Merge pull request #2550 from ethcore/jg-connection-dapps
jacogr Oct 9, 2016
09a2834
Merge branch 'js' into jg-contract-images
jacogr Oct 10, 2016
1a4d52d
Merge branch 'jg-tokenreg-fixes' into jg-contract-images
jacogr Oct 10, 2016
455cb9a
token images show up as expected
jacogr Oct 10, 2016
381be02
IdentityName component added and deployed
jacogr Oct 10, 2016
fa0458e
fix padding tests
jacogr Oct 10, 2016
a5d9b54
Merge branch 'js' into jg-tokenreg-fixes
jacogr Oct 10, 2016
0526551
adjust tests to map to stricter 0x-prefixed hex
jacogr Oct 10, 2016
e81be8e
Merge branch 'jg-tokenreg-fixes' into jg-contract-images
jacogr Oct 10, 2016
a570ce0
Merge pull request #2540 from ethcore/jg-tokenreg-fixes
jacogr Oct 10, 2016
8eb27af
Merge pull request #2526 from ethcore/jg-contract-images
jacogr Oct 10, 2016
82a818e
Merge branch 'js' into jg-address-names
jacogr Oct 10, 2016
2aa8182
render names via common component for the address -> name
jacogr Oct 10, 2016
b6cf9d4
Merge pull request #2557 from ethcore/jg-address-names
jacogr Oct 10, 2016
2517e31
Merge master into js
jacogr Oct 10, 2016
8f1f9e3
Merge branch 'js' of https://github.com/ethcore/parity into js
jacogr Oct 10, 2016
4efc831
split lint into seperate script (early exit)
jacogr Oct 10, 2016
16393d2
test phases changed to lint, test & pack
jacogr Oct 10, 2016
ea92124
pack part of test phase
jacogr Oct 10, 2016
aa910f5
remove files marked for deletion (cleanup)
jacogr Oct 11, 2016
b553d11
Signer cleanups, start moving in the direction of the rest
jacogr Oct 11, 2016
d3b492f
add personal signer methods
jacogr Oct 11, 2016
7ce9b76
basic signer request subscription
jacogr Oct 11, 2016
de2a5c4
don't poll blockNumber when not connected
jacogr Oct 11, 2016
2aa4066
missing return, creating massive ws queue backlogs
jacogr Oct 11, 2016
5cbf5d9
Merge pull request #2565 from ethcore/jg-polling
jacogr Oct 11, 2016
45d25e6
ΞTH -> ETH
jacogr Oct 11, 2016
60317bb
Merge pull request #2566 from ethcore/jg-E-character
jacogr Oct 11, 2016
297e3a4
fix failing tests
jacogr Oct 11, 2016
d0f6b1c
Merge pull request #2567 from ethcore/jg-fix-tests
jacogr Oct 11, 2016
02501b8
registry uses setAddress to actually set addresses now
jacogr Oct 11, 2016
af262b3
Merge pull request #2568 from ethcore/jg-registry-update-fix
jacogr Oct 11, 2016
0b0f28d
bytes mapping operates on lowerCase hex strings
jacogr Oct 11, 2016
98137d9
sha3 ids for each application
jacogr Oct 11, 2016
5271a79
add dappreg to list of contracts
jacogr Oct 11, 2016
3cfbab2
adjust alignment of queries
jacogr Oct 11, 2016
f9700a8
Merge pull request #2573 from ethcore/jg-contract-styling
jacogr Oct 11, 2016
fb8af93
show gas estimation log
jacogr Oct 11, 2016
74b363b
Merge commit '5e24a35272a99ad002c5d065a7335525eb2ce769' into js
jacogr Oct 11, 2016
8db4bfb
Merge branch 'js' into jg-list-apps
jacogr Oct 11, 2016
687246d
abi with payable for register function
jacogr Oct 11, 2016
ef33313
add key as required
jacogr Oct 11, 2016
619a9cf
image retrieval from dappreg
jacogr Oct 11, 2016
9c03b0c
use proper Image urls
jacogr Oct 11, 2016
d751b1b
embed and link apps from Parity, retrieved via /api/apps
jacogr Oct 11, 2016
12c4887
Merge pull request #2581 from ethcore/jg-list-apps
jacogr Oct 11, 2016
3ba611b
Merge branch 'master' into js
jacogr Oct 12, 2016
13f25bc
filter apps that has been replaced
jacogr Oct 12, 2016
44a047c
Merge pull request #2583 from ethcore/jg-list-apps
jacogr Oct 12, 2016
b1e9d91
proxy entry for parity-utils
jacogr Oct 12, 2016
f19a9f3
add basiccoin abi
jacogr Oct 12, 2016
796bd4f
add support for fallback abi type
jacogr Oct 12, 2016
ea9031c
capture constructor paramaters
jacogr Oct 12, 2016
cafb647
Merge branch 'master' into js
jacogr Oct 12, 2016
cfcfa81
merge master into js
jacogr Oct 12, 2016
35429a8
Merge pull request #2586 from ethcore/jg-contract-constructor-params
jacogr Oct 12, 2016
98d059d
move images to assets/images/
jacogr Oct 12, 2016
8ed6712
add font assets
jacogr Oct 12, 2016
55be649
import fonts as part of build
jacogr Oct 12, 2016
6caac6b
don't inline woff files
jacogr Oct 12, 2016
dd7cfaf
Merge pull request #2588 from ethcore/jg-webpack-bundle-fonts
jacogr Oct 12, 2016
680e979
Revert "merge master into js"
jacogr Oct 12, 2016
5afbc4b
remove unused npm packages
jacogr Oct 12, 2016
08a7434
Merge pull request #2590 from ethcore/jg-package-updates
jacogr Oct 12, 2016
d9d3d05
information on gas estimates (like almost everywhere else)
jacogr Oct 12, 2016
452f9ef
don't pass gas & gasPrice to estimation
jacogr Oct 12, 2016
a93604b
Merge pull request #2593 from ethcore/jg-send-estimategas-0
jacogr Oct 12, 2016
bee3fea
display account passwordhint when available
jacogr Oct 12, 2016
27d78a7
Merge pull request #2596 from ethcore/jg-signer-passwordhint
jacogr Oct 12, 2016
c5e46f9
Merge branch 'master' into js
jacogr Oct 12, 2016
66db9e9
signer subscriptions based on polling & function trapping
jacogr Oct 12, 2016
d32db27
pending requests retrieved via jsapi
jacogr Oct 12, 2016
a126c41
Merge branch 'master' into js
jacogr Oct 12, 2016
6ae554b
Merge branch 'js' into jg-signer-jsapi
jacogr Oct 12, 2016
82c78dc
update signer middleware
jacogr Oct 12, 2016
2a02bdb
remove all web3 instances
jacogr Oct 13, 2016
d1ce0da
remove web3 package
jacogr Oct 13, 2016
144bbde
last web3 dependencies removed
jacogr Oct 13, 2016
30393b7
no need to toChecksumAddress - api takes care of it
jacogr Oct 13, 2016
ef4b6d7
expand description for personal_confirmRequest
jacogr Oct 13, 2016
698d958
Signer conversion from web3 -> parity.js completed
jacogr Oct 13, 2016
a8f6245
Merge pull request #2604 from ethcore/jg-signer-jsapi
jacogr Oct 13, 2016
e7f3db1
explicit in no return
jacogr Oct 13, 2016
35f9169
green circle background
jacogr Oct 13, 2016
b50bd8f
remove generated background
jacogr Oct 13, 2016
bdd82f5
remove dangling web3 files
jacogr Oct 13, 2016
2fa3520
update manager test for signer
jacogr Oct 13, 2016
8bcec2d
Merge pull request #2610 from ethcore/jg-styling
jacogr Oct 13, 2016
e0e73b1
Merge pull request #2611 from ethcore/jg-fix-tests
jacogr Oct 13, 2016
8acf0b4
Merge branch 'master' into js
jacogr Oct 14, 2016
3fb3614
cater for txhash returning null/empty object
jacogr Oct 14, 2016
0ebb242
Merge pull request #2629 from ethcore/jg-transaction-update
jacogr Oct 14, 2016
5284cea
adjust output directories
jacogr Oct 14, 2016
0ecc4d5
Merge pull request #2630 from ethcore/jg-build-location
jacogr Oct 14, 2016
1c2b9da
Release merge with origin with ours strategy
jacogr Oct 14, 2016
296a04e
Merge pull request #2631 from ethcore/jg-release-update
jacogr Oct 14, 2016
ce50705
Merge branch 'master' into js
jacogr Oct 16, 2016
af07d67
Added tag to the editMeta Modal (#2643)
ngotchac Oct 17, 2016
f4163bf
Added Tags to ui and to contract/address/account Header (#2643)
ngotchac Oct 17, 2016
8e41488
Added tags to summary (#2643)
ngotchac Oct 17, 2016
80f1422
Added Search capabilities to contracts/address book/accounts from tokens
ngotchac Oct 17, 2016
f3df108
fixes eslint
ngotchac Oct 17, 2016
65df179
Using Chips/Tokens for search (#2643)
ngotchac Oct 18, 2016
19e326c
Add search tokens, clickable from List (#2643)
ngotchac Oct 18, 2016
9b5ec02
Add sort capabilities to Accounts / Addresses / Contracts (#2643)
ngotchac Oct 18, 2016
c19cb8a
Fixes formatting issues + state updates after component unmount bug
ngotchac Oct 18, 2016
6a3c34d
Remove unused import
ngotchac Oct 18, 2016
fd5c206
Merge branch 'master' into ng-accounts-tagging
ngotchac Oct 18, 2016
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions js/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@
"lodash": "^4.11.1",
"marked": "^0.3.6",
"material-ui": "^0.15.4",
"material-ui-chip-input": "github:ngotchac/material-ui-chip-input",
"moment": "^2.14.1",
"react": "^15.2.1",
"react-addons-css-transition-group": "^15.2.1",
Expand Down
18 changes: 18 additions & 0 deletions js/src/modals/EditMeta/editMeta.js
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Copy link
Contributor

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)

Copy link
Contributor Author

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#29

Now that it's merged, I have to try out using the published npm package again.


import { Button, Form, Input, Modal } from '../../ui';
import { validateName } from '../../util/validation';
Expand Down Expand Up @@ -55,6 +57,7 @@ export default class EditMeta extends Component {
error={ nameError }
onSubmit={ this.onNameChange } />
{ this.renderMetaFields() }
{ this.renderTags() }
</Form>
</Modal>
);
Expand Down Expand Up @@ -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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

return (
  <ChipInput ... />
);

defaultValue={ tags }
onChange={ onChange }
floatingLabelText='(optional) tags'
hintText='press <Enter> to add a tag'
floatingLabelFixed
fullWidth
/>);
}

onNameChange = (name) => {
this.setState(validateName(name));
}
Expand Down
17 changes: 17 additions & 0 deletions js/src/ui/Actionbar/Search/index.js
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';
43 changes: 43 additions & 0 deletions js/src/ui/Actionbar/Search/search.css
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;
}
176 changes: 176 additions & 0 deletions js/src/ui/Actionbar/Search/search.js
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)
});
}
}
17 changes: 17 additions & 0 deletions js/src/ui/Actionbar/Sort/index.js
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';
20 changes: 20 additions & 0 deletions js/src/ui/Actionbar/Sort/sort.css
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;
}
72 changes: 72 additions & 0 deletions js/src/ui/Actionbar/Sort/sort.js
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 });
}
}
Loading