Create a way to allow Maximize Modal

Created on 7 December 2022, over 1 year ago
Updated 4 October 2023, 9 months ago

Problem/Motivation

Create an option inside of Modal to allow "Maximize" Modal.

This option can be optional but if the user Mark this option, when the Modal is displayed will appear a button like:

When the user click on it the Modal will appear in full screen and can appear a button to back the original size, like:

πŸ“Œ Task
Status

Needs review

Version

5.0

Component

Code

Created by

πŸ‡§πŸ‡·Brazil RenatoG Campinas

Live updates comments and jobs are added and updated live.
  • Needs manual testing

    The change/bugfix cannot be fully demonstrated by automated testing, and thus requires manual testing in a variety of environments.

Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • πŸ‡¦πŸ‡ΊAustralia jnlar Sydney, Australia

    Hi, thought i'd give this a try. Please see attached patch + screenshots

  • Status changed to Needs review 9 months ago
  • πŸ‡¦πŸ‡ΊAustralia jnlar Sydney, Australia
  • Status changed to Needs work 9 months ago
  • πŸ‡§πŸ‡·Brazil RenatoG Campinas

    Awesome job @jnlar, thank you so much

    I'm marking as "Needs Works" because if we merge that today, will appear this new button in all modals of 2k+ sites

    So before merging that we need 2 thinks:

    1. Create an option inside of Modal CMS for Enable Modal Maximization (Default "true")
    2. Create a hook_update_N(): Load all existent Modals and set Enable Modal Maximization as false

    With that it won't impact the existent sites, but if they want to use they'll be able to enable that on Modal entity via CMS. Is that makes sense?

    P.S. if prefer we can create a separated issues for this

  • πŸ‡¦πŸ‡ΊAustralia jnlar Sydney, Australia

    Thanks @renatog,

    I'm not too sure i'm following. The maximization feature is op-in and disabled by default, in ModalForm.php:

    +    $enableMaximizeButton = FALSE;
    +
    +    if (!empty($modal->getEnableMaximizeButton())) {
    +      $enableMaximizeButton = $modal->getEnableMaximizeButton();
    +    }
    

    Pre-existing/new modals will need to check 'Enable Maximize Button' and then save the edit modal form in order to have the button display in their modal.

    I think the enable_modal_header dependency is sensible as it follows the same pattern as other buttons (close button) placed in the header region.

  • πŸ‡§πŸ‡·Brazil RenatoG Campinas

    The maximization feature is op-in and disabled by default, in ModalForm.php
    Pre-existing/new modals will need to check 'Enable Maximize Button' and then save the edit modal form in order to have the button display in their modal.

    That's perfect!
    With that solution it won't impact the existent sites but the feature will be available and we'll let them know on release notes

    I think the enable_modal_header dependency is sensible as it follows the same pattern as other buttons (close button) placed in the header region.

    Agreed!
    Since this button is located on Modal Header I think makes sense to include there

  • @jnlar opened merge request.
  • πŸ‡¦πŸ‡ΊAustralia jnlar Sydney, Australia

    awesome :^) I've created an issue fork & MR, thanks @renatog

  • Status changed to Needs review 9 months ago
  • πŸ‡§πŸ‡·Brazil RenatoG Campinas

    Woow, thank you so much for this amazing contribution @jnlar

    On my first look in the MR, seems good

    I'm moving to "Needs Review" just to manual tests

Production build 0.69.0 2024