Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Landing #7

Merged
merged 40 commits into from Sep 20, 2018
Merged

Landing #7

merged 40 commits into from Sep 20, 2018

Conversation

tynes
Copy link
Collaborator

@tynes tynes commented Sep 11, 2018

  • Basic Overview container component, without styling
  • This PR is to determine if the file structure is set up nicely
  • Renders side bar
  • Some basic clicky functionality with some buttons

Meant to be this view:
screen shot 2018-09-11 at 10 32 24 am

Where there is 1 container and 3 components that go with it, the TxList component will be the most reusable

@tynes tynes requested a review from bucko13 September 11, 2018 17:33
@bucko13
Copy link
Contributor

bucko13 commented Sep 11, 2018

What do you think of renaming Multisig Init? It doesn't feel super descriptive to me. Without the content of the table it took me a minute to think what it was going to be. @DarrenRM @pinheadmz any thoughts? Some ideas (a word in brackets is for an idea with or without that word):

  • Pending Multisig Wallets
  • [Pending] Multisig Invitations

Maybe also rename the init column to "Members" or "Joined" or something like that?

@pinheadmz
Copy link
Member

pinheadmz commented Sep 11, 2018

I like Pending Multisig or Pending Multisig Wallets -- does it need to be any more novice level than that? (multi-signature? multi-party? shared wallet?)

@tynes What happens when all participants join the wallet? Does it pop up to the Wallets List? Or is there still a separate Multisig section?


export default class MainContainer extends PureComponent {
constructor(props) {
super(props);
}

render() {
const { match } = this.props;

// TODO: figure out how to get subitems on sidebar to work
Copy link
Contributor

Choose a reason for hiding this comment

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

Hopefully the docs help with this: https://bpanel.org/docs/ui-utilities.html#createnestedviews
If there's anything that's not clear, overlooked, or could be clarified, let me know! (or submit as PR to bpanel-docs 😁). There's also a sample implementation in the @bpanel/bui plugin.

Copy link
Contributor

Choose a reason for hiding this comment

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

It looks like you're basically there though!

@tynes
Copy link
Collaborator Author

tynes commented Sep 11, 2018

@pinheadmz To my understanding, the Multisig Init table was for pending multisig wallets that have yet to be fully joined, so a redeem script hasn't been generated yet for them

If that is what the table is supposed to be, then i'd imagine that when a wallet is fully joined, it would no longer exist in that list. The one problem that we have right now is that we do not have websockets set up for wallet join

@tynes
Copy link
Collaborator Author

tynes commented Sep 11, 2018

I like Pending Multisig Wallets

@bucko13
Copy link
Contributor

bucko13 commented Sep 11, 2018

That's a great point about making it even more accessible, in which case Multi-party feels more like something my parents (for example) would be able to understand and still conveys the original meaning (and would even cover the situation with 1 individual, multiple devices). Not sure if it's a pre-emptive over-optimization, since we'll be a long way off from getting novices in at that level, but then again, maybe you can never start with ease-of-use too early.

@DarrenRM
Copy link

Pending Multi-party Wallets or Pending Multisig Wallets is definitely way better. As for which, I think I lean slightly towards Multi-party since it's really simple to understand but you probably get it if you understand what multisig is.

@tynes
Copy link
Collaborator Author

tynes commented Sep 12, 2018

Linting is failing, will return to this once we have our meeting on the design

const REDUCE_INTERFACE_NAMESPACE = '@bpanel/bwallet/interface';
const REDUCE_NODE_NAMESPACE = '@bpanel/bwallet/node';
const REDUCE_CHAIN_NAMESPACE = '@bpanel/bwallet/chain';
const REDUCE_WALLETS_NAMESPACE = '@bpanel/bwallet/wallets';
Copy link
Contributor

Choose a reason for hiding this comment

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

Should the plugin namespace just be used as a constant with template literals here?

Also wondering about the decision to have each of these top level rather than basically as child stores under the namespace? I could see this ending up making the plugins store much more cluttered

screen shot 2018-09-12 at 11 35 05 am

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

How do I join multiple reducers into 1 namespace?

Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Contributor

Choose a reason for hiding this comment

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

It's a little obfuscated but this is how we actually manage the plugin reducers in bpanel to enable for the namespaced reducers nested in the plugins reducer: https://github.com/bpanel-org/bpanel/blob/development/webapp/plugins/plugins.js#L263

Maybe this would be helpful to add to the reducers documentation... 🤔

import { connect } from 'react-redux';
import { Header, Table } from '@bpanel/bpanel-ui';

class PendingMultisig extends PureComponent {
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm not sure which way is best myself, I could see the argument for either, but do you think it makes to switch this component to be called PendingMultiparty as well to match what the UI displays?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

We will probably have to change it again if we always change every name based on the UI. I think its close enough

Copy link
Contributor

Choose a reason for hiding this comment

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

What do you mean? Ideally the UI doesn't change if at all once we've stabilized. Just thinking about the situation where someone wants to make a change to the PendingMultiparty component and can't find it immediately. It's not hard to deduce of course, but it's the convention we use with virtually every other component right?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Updating to PendingMultiparty, I meant that until after we have our design meetings, the names could be unstable

@tynes
Copy link
Collaborator Author

tynes commented Sep 17, 2018

@bucko13 - ready for a lookthrough

this.COL_HEADERS = ['Name', 'Date', 'M of N', 'Init'];
}

componentDidMount() {
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

delete

this.COL_HEADERS = ['Date'];
}

componentDidMount() {
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

delete

@@ -0,0 +1,19 @@
import WalletsList from './WalletsList';
Copy link
Contributor

Choose a reason for hiding this comment

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

Small styling nit, more of a personal style so feel free to ignore, but you could simplify this file with: export { default as WalletsList } from './WalletsList'; This only works for default exports though

@@ -10,27 +10,47 @@
* in the redux store in case
* of collisions with other plugins
*/
Copy link
Contributor

Choose a reason for hiding this comment

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

If we're going to keep all constants in a single file, does it need to be in a directory? Could it just be a single constants.js file?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

There are multiple files in the constants directory. Do you think it should be modularized more? There are some defined in index, but also others defined in the other files

Copy link
Contributor

Choose a reason for hiding this comment

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

Yeah, I think so. I feel like indexes should either be fully an "entrypoint" or fully code logic. Feels easier to reason about.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

👍

return (
<div>
<Header type="h5">Select Wallet</Header>
<Dropdown options={[]} placeholder={'Select Wallet'} />
Copy link
Contributor

Choose a reason for hiding this comment

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

when a prop is just a string, I believe you can just pass it without the curly braces: placeholder="Select Wallet" same as we do for classNames.

} from './selectors';

// TODO: append proper network symbol to balance based on chain
function buildWalletsList(wallets, multisigWallets) {
Copy link
Contributor

Choose a reason for hiding this comment

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

So this is basically the ideal use case of reselect and selectors since you're going through the stores and re-shaping the data based on a specific use case. I think what will likely happen in this implementation is that every time walletsList is retrieved through the mapStateToProps below is that this function will be called, which will go through the for loops. If you use reselect (which is available as a peerDependency too for plugins), then the walletsList will be memoized and returned, only recalculated if the state gets updated.

function mapDispatchToProps(dispatch) {
return {
selectAccount: async (walletId, accountId) =>
dispatch(selectAccount(walletId, accountId)),
Copy link
Contributor

Choose a reason for hiding this comment

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

You shouldn't need the async here since there's not an await inside this function (there is in selectAccount itself, but that already has the async in the containing function declaration). when selectAccount is called later on, the containing function will have an async and then you would have something like const acct = await selectAccount.

};
}

// TODO: be certain we need selectAccount and selectWallet
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

looks like we don't

Copy link
Contributor

Choose a reason for hiding this comment

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

should this comment be cleaned up then?


render() {
const { wallets, accounts, selectedWallet, selectedAccount } = this.props;
const tabs = [
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Move tabs into own function

@tynes
Copy link
Collaborator Author

tynes commented Sep 19, 2018

This should fix the infinite loop bug and is ready to be looked at again @bucko13

@tynes tynes merged commit 44f999e into master Sep 20, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants