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

Some refactoring ahead of implementing the new designs. #3455

Merged
merged 2 commits into from
Jun 30, 2021

Conversation

merivale
Copy link
Contributor

This PR does some refactoring without making any functional or visual changes, before I start on implementing the new designs. I thought it would be clearer (and easier to review) if I kept this stuff separate from the design implementation itself.

Specifically, I have:

  • Moved Play and ContractHome into a combined Dashboard module. I like how this combination turned out - it simplified some things and made me feel that these two things do belong together. I think it will be nicer still when the new design is implemented, and we no longer have contacts and contract setup stuff in separate screens, while contracts do go in separate screens instead of on cards. I'm expecting the Dashboard.View code to look nicer when that's done.
  • Moved some of the view code for the dashboard's contract "boxes" into the Contract.View. (I'm calling them "boxes". I had to call them something, and "card" was taken. 🤷‍♂️) This is to make it easier to call Contract.Actions from inside these boxes, directly from the dashboard - which is something we'll need to do for the new design.

@merivale merivale requested a review from hrajchert June 29, 2021 15:57
@merivale merivale force-pushed the merivale/dashboard-refactoring branch from 021397b to 3e3e846 Compare June 29, 2021 16:17
Copy link
Contributor

@hrajchert hrajchert left a comment

Choose a reason for hiding this comment

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

LGTM

Comment on lines +44 to +47
-- I'm moving this view here so that we can easily call Contract.Actions from inside it. I'm not
-- actually calling any Contract.Actions from here yet, but that's a TODO for the next PR...
contractInnerBox :: forall p. Slot -> State -> HTML p Action
contractInnerBox currentSlot state =
Copy link
Contributor

Choose a reason for hiding this comment

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

This is the same that previous ContractHome.View (contractCard) ?

If so, it looks a lot smaller, it's missing the contractType, Acronym and contractInstanceId 🤔 .

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This isn't the whole box (hence "inner"). I left the parent div and the header in the dashboard view, because that needs to have a clickable element that opens the screen for that contract - which is a dashboard action. But then the rest goes here in the contract view, because it will have contract actions.

@@ -1,10 +1,11 @@
module Contract.View
( contractDetailsCard
( contractInnerBox
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 more keen into renaming the current cards into modal or dialog and keeping card for this widget. Or even keeping just card for modals and this being a contractCard.

Copy link
Contributor

Choose a reason for hiding this comment

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

InnerBox is particulary noisy, as a Box is a 3d element, and an inner box I'm thinking about a box inside a box.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fair point. I'll leave it for now and rename things in the next PR - when I expect these things will become clearer. I'm not opposed to either of your suggestions.

@@ -28,12 +29,14 @@ type State
, menuOpen :: Boolean
, screen :: Screen
, cards :: Array Card
, status :: ContractStatus
Copy link
Contributor

Choose a reason for hiding this comment

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

I think just status made more sense when the ContractHome and Play were separated (and maybe not even then... my bad). But I think this could be renamed to filterBy, or contractFilter or similar.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Agreed. I'll leave it for now, but try out a different name in the next PR.

@merivale merivale merged commit 0596b79 into master Jun 30, 2021
@merivale merivale deleted the merivale/dashboard-refactoring branch June 30, 2021 08:04
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.

2 participants