- Issue created by @cosmicdreams
- last update
over 1 year ago 29,400 pass - @cosmicdreams opened merge request.
- last update
over 1 year ago 29,400 pass - Status changed to Needs review
over 1 year ago 11:55am 2 June 2023 - 🇺🇸United States cosmicdreams Minneapolis/St. Paul
@lauriii let's talk this through.
The proposed test is :
if (empty($this->dialogOptions['resizable'])) {
And you suggest that it should be:
if (!array_key_exists('resizable', $this->dialogOptions)) {
What cases would the suggested change cover differently?
1. using empty assumes that dialogOptions has a key named 'resizable' already.
2. using !array_key_exists only makes an impact if dialogOptions hasn't already included a 'resizble' key.So I guess this depends on whether the
parent::__construct('#drupal-off-canvas', $title, $content, $dialog_options, $settings);
includes the 'resizable' key. The parent's code ispublic function __construct($selector, $title, $content, array $dialog_options = [], $settings = NULL) { $title = PlainTextOutput::renderFromHtml($title); $dialog_options += ['title' => $title]; $this->selector = $selector; $this->content = $content; $this->dialogOptions = $dialog_options; $this->settings = $settings; }
So the answer is, yes, the parent defines a 'resizable' key if it is included a 'data-dialog-options' as my code sample does.
This sounds like a good change then.
- last update
over 1 year ago 29,406 pass, 1 fail - last update
over 1 year ago 29,406 pass, 1 fail - 🇺🇸United States cosmicdreams Minneapolis/St. Paul
Ah sorry, it appears you made a change too. I reorganized the code a bit to make a clear separation between unconditional and conditional defaults.
- last update
over 1 year ago 29,405 pass, 3 fail - last update
over 1 year ago 29,406 pass, 1 fail - Status changed to Needs work
over 1 year ago 4:23pm 2 June 2023 - 🇺🇸United States smustgrave
Some open threads in the MR
also as a bug can we get a test case please
- last update
over 1 year ago 29,406 pass, 1 fail - 🇺🇸United States cosmicdreams Minneapolis/St. Paul
I'll get working on that test.
- 🇺🇸United States cosmicdreams Minneapolis/St. Paul
Looks like the bit that is still needed is for a test to be written. I might have time for that tomorrow.
- First commit to issue fork.
- Status changed to Needs review
3 months ago 8:33am 12 June 2024 - 🇺🇸United States smustgrave
smustgrave → changed the visibility of the branch 3364302-allow-offcanvas-dialog to hidden.
- Status changed to RTBC
about 2 months ago 5:37pm 23 July 2024 - 🇺🇸United States smustgrave
1) Drupal\Tests\system\FunctionalJavascript\OffCanvasTest::testOffCanvasNotResizable Failed asserting that a NULL is not empty. /builds/issue/drupal-3364302/core/modules/system/tests/src/FunctionalJavascript/OffCanvasTest.php:196 FAILURES!
Know there is that thread about the test but coverage is there.
I reverted the change
OffCanvasDialogTest
but then see a test failure so that's my mistake.Self applied a nitpicky :void return.
Believe this could be ready.
- Status changed to Needs work
25 days ago 9:38am 14 August 2024 - 🇫🇷France nod_ Lille
Few problems with the code, the whole thing might make more sense to have in the opendialog command, not just offcanvas.