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

mdPanel: Implement group logic. #8971

Closed

Description

@ErinCoughlan

Tasks

Add this config option to the panel:

 * TODO(ErinCoughlan): Add the following config options.
 *   - `groupName` - `{string=}`: Name of panel groups. This group name is
 *     used for configuring the number of open panels and identifying specific
 *     behaviors for groups. For instance, all tooltips will be identified
 *     using the same groupName.

Keep track of what panels are opened for a particular group (in order).

Implement/Extend the following methods:

/**
 * @ngdoc method
 * @name $mdPanel#setGroupMaxOpen
 * @description
 * Sets the maximum number of panels in a group that can be opened at a given
 * time.
 *
 * @param groupName {string} The name of the group to configure.
 * @param maxOpen {number} The max number of panels that can be opened.
 */

setGroupMaxOpen is a global configuration for a specific group. When this max is reached, the panel should close the panel that was first opened, keeping only a specific number of panels open at a time.

An alternative to closing the first panel is to close the panel the user interacted with first. For example, assume there is a max of 2 panels open. The user interacts with panel 1, opens panel 2, goes back to panel 1, then opens panel 3. Panel 2 should close because it was interacted with the farthest back. I can see benefits to either implementation and I think either is understandable from a user's point of view. Perhaps make it configurable.

clickOutsideToClose and pressEscapeToClose should optionally close either all of the panels in a group or only the last panel. Add a config option for specifying which behavior is desired.

Rationale for this Feature

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 max of one popup open at the same time. Dialogs within dialogs are another example of groups. A "dialog group" may be able to have a max of 3 opened at a time, and then after this point, old dialogs close. This 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.

Activity

  1. added
    g3: reported
    on Jul 8, 2016
  2. added
    in progress
    on Aug 19, 2016
  3. ThomasBurleson commented on Sep 2, 2016

    @ThomasBurleson
    Contributor

    @bradrich - @crisbeto will be pairing with you on this. Please sync with him online.

  4. bradrich commented on Sep 2, 2016

    @bradrich
    Contributor

    @ThomasBurleson @crisbeto I have been working closely with @ErinCoughlan on this. So far, I have the grouping functionality built as well as setting the maximum number of open panels on a group. The only thing that I have left is the test writing for the methods that I have created.

    With that being said, I will be continuing the building of the grouping functionality to introduce the closeGroup, closeAll, destroyGroup, and destroyAll methods, however, Erin has asked that I only do a PR for the completed grouping and maxOpen methods. We will create another issue and PR set for the rest of the functionality. There really isn't anything left to pair on.

  5. ErinCoughlan commented on Sep 2, 2016

    @ErinCoughlan
    ContributorAuthor

    @bradrich Pairing on tests is not a bad idea as it would give @crisbeto the ability to "catch up" on the functionality you added and make suggestions for better tests or additional work. And after the initial grouping PR is done, you could actually split each of the remaining functionality across multiple people if you wanted to.

  6. added 2 commits that reference this issue on Sep 7, 2016
    c62bf88
    4e10a90
  7. added
    has: Pull Request
    and removed
    in progress
    on Sep 7, 2016
  8. added 2 commits that reference this issue on Sep 7, 2016
    abd3cb3
    7423263
  9. 9 remaining items

  10. added 7 commits that reference this issue on Sep 13, 2016
    b3ffd49
    bb6c152
    40771b2
    e6cf876
    ee7532c
    0835da8
    eb6d8b8
  11. added a commit that references this issue on Sep 26, 2016
    62df3c8
  12. added a commit that references this issue on Oct 8, 2016
    4bd064a
  13. removed this from the - Backlog milestone on Feb 23, 2019
  14. added this to the 1.1.2 milestone on Mar 7, 2020
  15. locked as resolved and limited conversation to collaborators on Mar 7, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

g3: reportedhas: Pull Requestresolution: fixed

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions