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

Make the explorer listnavs more compact and drop the explorer_tree #1986

Merged
merged 1 commit into from
Aug 24, 2017

Conversation

skateman
Copy link
Member

@skateman skateman commented Aug 24, 2017

This is a necessary next step in angularizing explorer accordions and trees:

  • Minimalized the number of conditions and reduced the block nesting
  • Removed the explorer_tree partial as its being rendered only in this file
  • Moved the single-accordion test into the miqAccordSelect JS callback

Parent issue: #1871
Possible merge conflicts with: #1984

@miq-bot add_label trees, explorers, refactoring, fine/no
@miq-bot assign @himdel

var url = '/' + $('body').data('controller') + '/accordion_select?id=' + $(e.target).attr('id');
miqJqueryRequest(url, {beforeSend: true, complete: true});
// No need to load anything if only a single accordion is present
if ($('#accordion > .panel').length > 1) {
Copy link
Member Author

Choose a reason for hiding this comment

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

@himdel I have a feeling that you might not like this approach here, but as we're going in the direction of components, this will be eventually moved into a controller/component around accordions.

Copy link
Contributor

Choose a reason for hiding this comment

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

Fair enough :)

@skateman skateman force-pushed the compact-explorer-listnav branch from 08e7444 to 850363f Compare August 24, 2017 11:08
- if @accords
#accordion.panel-group
-# Set the first accordion as selected if there is no active_accord in the sandbox
- selected = @accords.find(-> { @accords.first }) { |accord| accord[:name].to_sym == @sb[:active_accord] }
Copy link
Member Author

@skateman skateman Aug 24, 2017

Choose a reason for hiding this comment

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

Ruby keeps surprising me with things like this find syntax. I have no idea why it needs a callable, but I still ❤️ it!

@skateman skateman force-pushed the compact-explorer-listnav branch from 850363f to f26af33 Compare August 24, 2017 12:39
@miq-bot
Copy link
Member

miq-bot commented Aug 24, 2017

Checked commit skateman@f26af33 with ruby 2.2.6, rubocop 0.47.1, and haml-lint 0.20.0
1 file checked, 0 offenses detected
Everything looks fine. ⭐

@himdel himdel added this to the Sprint 68 Ending Sep 4, 2017 milestone Aug 24, 2017
@himdel
Copy link
Contributor

himdel commented Aug 24, 2017

Tested in UI, LGTM 👍

@himdel himdel merged commit 06d8330 into ManageIQ:master Aug 24, 2017
@skateman skateman deleted the compact-explorer-listnav branch August 24, 2017 15:57
@himdel himdel mentioned this pull request Jan 28, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants