Create a way to allow Maximize Modal

Created on 7 December 2022, over 2 years ago
Updated 15 July 2024, 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

Fixed

Version

5.0

Component

Code

Created by

🇧🇷Brazil renatog Campinas

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

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 over 1 year ago
  • 🇦🇺Australia jnlar Sydney, Australia
  • Status changed to Needs work over 1 year 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

  • 🇦🇺Australia jnlar Sydney, Australia

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

  • Status changed to Needs review over 1 year 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

  • 🇧🇷Brazil renatog Campinas

    Tested and worked fine for me

    Thank you so much

  • Status changed to Fixed 9 months ago
  • 🇧🇷Brazil renatog Campinas

    Moved to the dev branch

  • Automatically closed - issue fixed for 2 weeks with no activity.

Production build 0.71.5 2024