Skip to content
This repository was archived by the owner on Sep 5, 2024. It is now read-only.

feat(panel): Panel grouping #9538

Merged
merged 1 commit into from
Sep 26, 2016
Merged

Conversation

bradrich
Copy link
Contributor

@bradrich bradrich commented Sep 7, 2016

Panels are now capable of being grouped together by any designation the user sees fit. Grouping allows the user to specify logic for a collection of panels. For instance, all popups in the header can be considered one group with a maximum of one popup open at a time. Dialogs within dialogs are another example of groups. This implementation prevents the panel from storing a ridiculous amount of data in memory or polluting the DOM with several panels. This helps performance and gives the user more flexibility about how to use panels.

Fixes #8971

Ping @ErinCoughlan

@bradrich bradrich added this to the - Backlog milestone Sep 7, 2016
@ThomasBurleson ThomasBurleson added the needs: review This PR is waiting on review from the team label Sep 7, 2016
@ThomasBurleson ThomasBurleson modified the milestones: 1.1.2, - Backlog Sep 7, 2016
* open within a defined panel group.
*/
MdPanelService.prototype.newPanelGroup = function(groupName, config) {
if (!this._groups[groupName]) {
Copy link
Member

Choose a reason for hiding this comment

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

I think that it might be better to use hasOwnProperty here. This might cause undefined behaviour in the edge case if somebody names their group toString or something similar.

@crisbeto crisbeto added the in progress Mainly for in progress PRs, but may be used for issues that require multiple PRs label Sep 7, 2016
method.
</p>
<p>
Adding panels to groups prevents the panel API from storing a ridiculous
Copy link
Contributor

Choose a reason for hiding this comment

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

reword - "rediculous amount of data" sounds too vague as does the added flexibility. This is your sales pitch for groups.


var panel = $mdPanel.create(config);

panel.open();
Copy link
Contributor

Choose a reason for hiding this comment

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

Please use the test helper methods for these:

openPanel(config); and closePanel().

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@ErinCoughlan Unless I am mistaken, this change will disrupt the expect tests that I am running in this test. I used this method because I needed to create a panel variable to then check the open panels array for afterward. Please let me know if I didn't write this test correctly.

Copy link
Contributor

Choose a reason for hiding this comment

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

@bradrich Unless I'm really confused about something in that util, you get the panelRef back, so your tests still work. Well, you have to rename panel to panelRef...

openPanel(config);
expect(getPanels).toContain(panelRef);

@ErinCoughlan
Copy link
Contributor

A few minor comments left. Once resolved, LGTM.

@bradrich bradrich force-pushed the feat/panel-grouping branch 2 times, most recently from b3ffd49 to bb6c152 Compare September 13, 2016 13:31
@bradrich
Copy link
Contributor Author

@ErinCoughlan @crisbeto All changes and nits have been accounted for. Thanks for the solid review.

@bradrich bradrich added pr: merge ready This PR is ready for a caretaker to review and removed needs: review This PR is waiting on review from the team in progress Mainly for in progress PRs, but may be used for issues that require multiple PRs labels Sep 13, 2016
@ThomasBurleson ThomasBurleson added needs: presubmit and removed pr: merge ready This PR is ready for a caretaker to review labels Sep 15, 2016
@jelbourn jelbourn added needs: rebase This PR needs to be rebased on the latest commits from master and conflicts need to be resolved and removed needs: presubmit labels Sep 21, 2016
@jelbourn
Copy link
Member

Passed presubmit, but needs rebase.

@bradrich
Copy link
Contributor Author

@jelbourn Rebase complete, please continue.

@bradrich
Copy link
Contributor Author

@devversion Are the TravisCI checks failing due to something that I can fix? I have rebased and there is still a failure...

@devversion
Copy link
Member

devversion commented Sep 23, 2016

@bradrich Yeah that's not a CI issue. You have a syntax error in the spec file.

Uncaught SyntaxError: Unexpected token )
at src/components/panel/panel.spec.js:2694

@bradrich
Copy link
Contributor Author

@devversion Ah, found it. It was the callInterceptors function that didn't have its final } bracket. Not sure who wrote that function.

@bradrich
Copy link
Contributor Author

@jelbourn There was a missing bracket that I discovered in the test files and removed. Please continue.

Panels are now capable of being grouped together by any designation
the user sees fit. Grouping allows the user to specify logic for a
collection of panels. For instance, all popups in the header can be
considered one group with a maximum of one popup open at a time.
Dialogs within dialogs are another example of groups. This
implementation prevents the panel from storing a ridiculous amount
of data in memory or polluting the DOM with several panels. This
helps performance and gives the user more flexibility about how to
use panels.

Fixes angular#8971
@ThomasBurleson ThomasBurleson added needs: presubmit and removed needs: rebase This PR needs to be rebased on the latest commits from master and conflicts need to be resolved labels Sep 26, 2016
@hansl hansl merged commit 62df3c8 into angular:master Sep 26, 2016
Frank3K pushed a commit to Frank3K/material that referenced this pull request Oct 8, 2016
Panels are now capable of being grouped together by any designation
the user sees fit. Grouping allows the user to specify logic for a
collection of panels. For instance, all popups in the header can be
considered one group with a maximum of one popup open at a time.
Dialogs within dialogs are another example of groups. This
implementation prevents the panel from storing a ridiculous amount
of data in memory or polluting the DOM with several panels. This
helps performance and gives the user more flexibility about how to
use panels.

Fixes angular#8971
@angular angular locked as resolved and limited conversation to collaborators Mar 7, 2020
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.

mdPanel: Implement group logic.
7 participants