Skip to content

Commit

Permalink
feat(@embark/core): Allow search to find contract by name
Browse files Browse the repository at this point in the history
In the cockpit, allow the search to find the contract by name. For example in the test_app, searching for “Token” (or “token”) in the cockpit, will take the user to the Token contract page.
  • Loading branch information
emizzle authored and iurimatias committed Dec 7, 2018
1 parent 13ed141 commit 1e2cb64
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion embark-ui/src/components/Layout.js
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ class Layout extends React.Component {
}

if (nextProps.searchResult.className) {
this.props.history.push(`/embark/contracts/${nextProps.searchResult.className}/overview`);
this.props.history.push(`/embark/explorer/contracts/${nextProps.searchResult.className}`);
return false;
}
if (nextProps.searchResult.address) {
Expand Down
2 changes: 1 addition & 1 deletion embark-ui/src/sagas/searchSaga.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ export function *searchExplorer(entity, payload) {
yield fetchContracts({});
const contracts = yield select(getContracts);
result = contracts.find(contract => {
return contract.address === searchValue;
return contract.address === searchValue || contract.className.toLowerCase() === searchValue.toLowerCase();
});

if (result) {
Expand Down

0 comments on commit 1e2cb64

Please sign in to comment.