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

Configurable Layout/UI Refactor #226

Merged
merged 34 commits into from
Dec 18, 2015
Merged

Configurable Layout/UI Refactor #226

merged 34 commits into from
Dec 18, 2015

Conversation

danlamanna
Copy link
Member

This PR addresses #182, #184, #185, and #186.

The biggest addition is defining a layout for Minerva that can be configured by 3rd party plugins, shown here.

Other changes include:

  • Removes gridster, also the map slider 👊
  • Allowing basemap_args to be stored in the session data, so someone can switch basemaps if they want
  • Created a generic Panel view
  • Cleans/removes a lot of jade/stylus that seemed extraneous
    • Added some basic mixins to organize how panels are rendered

Concerns that need to be addressed before merge:

  • I'm largely unfamiliar with how this is being used in BSVE, and for Epidemico's work
    Review from someone with their own projects would be greatly appreciated
    @mgrauer will make sure this works in the BSVE context before giving final approval
  • I removed the baselayer settings button, since I removed the title bar off the map. What is the stopgap to get this merged? noted in Refactor session model/save #225
  • I removed the add dataset button, this should be added back in the form of the + icon similar to sources
  • The map styling is broken, it goes off the page for some reason, and resizing the window breaks the entire map
  • I'm somewhat uneasy about how panels are added to panel groups but wasn't entirely sure what the proper Backbone way was
    Update: apparently this isn't as hacky as I thought

Future concerns:

  • Storing/Loading UI state is somewhat sloppy, there may be better tools to accomodate this type of problem
  • Cleaning up the header panel, removing the sessions listing page
  • Storing the layout on the session view is sloppy, it should probably be on the model - though it seems like that will be part of a larger refactor in Refactor session model/save #225

@mgrauer
Copy link
Contributor

mgrauer commented Dec 2, 2015

@danlamanna can you pastry in a screenshot?

@danlamanna
Copy link
Member Author

minerva-ui-refactor

@mgrauer
Copy link
Contributor

mgrauer commented Dec 2, 2015

tasty, thanks.

@jeffbaumes
Copy link
Member

C'mon, you couldn't get a donut logo up there @danlamanna? disappointed

@jbeezley
Copy link

jbeezley commented Dec 7, 2015

@danlamanna See my changes here: 6ede95f to fix the map size issues. I had to go up the div hierarchy to set all the element heights to 100%. The only other way to so solve this is to explicitly initialize the map with a given size (and manage any and all size changes that may occur).

Note: I also changed how the stylus files are built so that I can get the header height variable inside a different file. There are other ways to handle this, but importing (or requiring) files from a single place resembles what we should be doing with webpack.

@danlamanna
Copy link
Member Author

@jbeezley Thanks for figuring that out, that was more involved than I would have expected.

resembles what we should be doing with webpack.

🎤 💧

@danlamanna danlamanna changed the title [WIP] Configurable Layout/UI Refactor Configurable Layout/UI Refactor Dec 7, 2015
@jbeezley
Copy link

jbeezley commented Dec 7, 2015

Yeah, I've come to see it like this. Normally, unless otherwise stated, a parent element is only as large as the content it contains.. Trying to have an element expand to take up 100% of it's parent inverts the usual pattern, so you have to go all the way up the document tree to make it work. There are all kind of other implications in positioning you run into as well because it disrupts the whole document flow.

* Upon confirmation, physically removes the DOM element while
* storing the change in the session attributes. This also
* enables the save button.
**/

Choose a reason for hiding this comment

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

I take it there is no way to add the panel back after removing it?

Copy link
Member Author

Choose a reason for hiding this comment

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

Nope, unless you were to manually edit the session.json. It seems like having a dropdown with available panels is something @aashish24 wants at some point - so that could add that functionality.

this.layout = {
panelGroups: [
{
id: 'm-core-panel-group',
Copy link
Contributor

Choose a reason for hiding this comment

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

m-main-panel-group

},

collapsePanel: function (e) {
$(e.currentTarget).find('i.icon-up-open').attr('class', 'icon-down-open');
Copy link
Contributor

Choose a reason for hiding this comment

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

probably beating a 💀 🐴 here, similar to this comment, what would be nice is if the three methods

removePanel
expandPanel
collapsePanel

would trigger a change on the layout of the session model, and then the session view can be listening for changes on the session model which would re-render the panels and also enable the save button at the appropriate times.

All changes for #225.

@mgrauer mgrauer mentioned this pull request Dec 15, 2015
@danlamanna
Copy link
Member Author

@mgrauer See my comments on #235, aside from that I think we should consider having the panel views call initialize on their parent PanelView and we can take care of the extending of events there, that way if we want to do something else in the future things will "just work".

@mgrauer
Copy link
Contributor

mgrauer commented Dec 16, 2015

Forget what I said on that first PR I created. I've created a new one #236 to merge into here. If those are OK with you, you can merge it.

I like your idea of the panel views calling initialize on their parent PanelView. Can you do that after you've merged #236, and also update the docs? Then I think this would be ready to go.

@danlamanna
Copy link
Member Author

Alright @mgrauer - one last look.

@mgrauer
Copy link
Contributor

mgrauer commented Dec 18, 2015

LGTM.

Awesome work @danlamanna . Thanks for pushing this refactor through, I think it is a big improvement in the UI and in extensibility.

We should be on the lookout for small bugs to clean up in the near future.

danlamanna added a commit that referenced this pull request Dec 18, 2015
Configurable Layout/UI Refactor
@danlamanna danlamanna merged commit 6920d2f into master Dec 18, 2015
@danlamanna danlamanna deleted the ui-refactor branch December 18, 2015 15:30
@mgrauer
Copy link
Contributor

mgrauer commented Dec 18, 2015

🎊

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants