Skip to content

Modal com_categories: improve Select & Edit Category#10441

Merged
rdeutz merged 6 commits intojoomla:stagingfrom
cyrez:modal-com_categories-improve-select-category
May 16, 2016
Merged

Modal com_categories: improve Select & Edit Category#10441
rdeutz merged 6 commits intojoomla:stagingfrom
cyrez:modal-com_categories-improve-select-category

Conversation

@cyrez
Copy link
Copy Markdown
Contributor

@cyrez cyrez commented May 12, 2016

Improve modals to select and to edit a category.
Note: to be testing on staging.

Summary of Changes

  • When Bootstrap modal loads an iframe, BS tooltips with placement top are truncated at the top border of the iframe. (no auto placement in BS2). This PR sets the tooltip placement to bottom to fix this issue.
  • Remove inline CSS
  • Content is embedded in a container div (using already existing container-popup class for modal.php)
  • Add empty lines to improve the readability
  • Add viewport dimensions (new 3.6.0-dev)
  • Category edit modal is simplify (loading edit layout, so no dupplicated code)
  • Fix Edit button when current associated category in data is not the category selected
  • Control if modal, in edit layout
  • Add Save, Save & Close and Close button to the footer of the modal
  • Fix Edit modal not opening as a modal (missing bootstrap.renderModal for Edit modal)
  • Fix Uncaught SyntaxError: Unexpected token ) in select category modal

Testing Instructions (Staging + Multilanguages enabled!)

  • Go to Contents > Categories > open a categorie, and go to Associations tab to select associated category to open the modal.
  • Verify tooltip placement is bottom, and not truncated
  • Verify the modal size now is proportionnal to viewport (width 80/100th viewport width, and modal-body is 70/100th viewport height)
  • Select an associated category and save the category to show edit button
  • Open Edit modal and play with it ;-)

Select Category Before Patch
capture d ecran 2016-05-12 a 16 43 11

Select Category After Patch
capture d ecran 2016-05-12 a 16 42 16

Edit Category Before Patch
Open in a new window...
capture d ecran 2016-05-13 a 18 57 41

Edit Category After Patch
Open in a modal
capture d ecran 2016-05-13 a 18 58 39

@cyrez cyrez changed the title Modal com categories improve select category Modal com_categories: improve select category May 12, 2016
@andrepereiradasilva
Copy link
Copy Markdown
Contributor

in the modal, got a JS error Uncaught SyntaxError: Unexpected token ) on selecting a category.

BTW did you notice the lack of modal in the "Edit" button (the button appears after saving the category with the association)?

@andrepereiradasilva
Copy link
Copy Markdown
Contributor

ups, the js error is already there without your PR ..., so tested with success

@andrepereiradasilva
Copy link
Copy Markdown
Contributor

I have tested this item ✅ successfully on d738268

as said js error was already there so this PR does what is proposed to do.


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/10441.

@cyrez
Copy link
Copy Markdown
Contributor Author

cyrez commented May 12, 2016

@andrepereiradasilva yes error was there before, but prepare yourself for a new test, as i will fix it (this PR is a good occasion to fix issue!) ;-)

@joomla-cms-bot
Copy link
Copy Markdown

This PR has received new commits.

CC: @andrepereiradasilva


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/10441.

@joomla-cms-bot
Copy link
Copy Markdown

This PR has received new commits.

CC: @andrepereiradasilva


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/10441.

@joomla-cms-bot
Copy link
Copy Markdown

This PR has received new commits.

CC: @andrepereiradasilva


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/10441.

@cyrez
Copy link
Copy Markdown
Contributor Author

cyrez commented May 12, 2016

@andrepereiradasilva JS error is now fixed here : 96e2bb0

But, i will put this PR in stand-by until tomorrow, as i will see to add directly in this PR, the modal to edit category and do a 2-in-1 PR for modals select and edit category ;-)

@andrepereiradasilva
Copy link
Copy Markdown
Contributor

ok will wait then.

@joomla-cms-bot
Copy link
Copy Markdown

This PR has received new commits.

CC: @andrepereiradasilva


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/10441.

@cyrez
Copy link
Copy Markdown
Contributor Author

cyrez commented May 13, 2016

@andrepereiradasilva That's ok!

  • Issue Fixed
  • And PR for both Select and Edit category modals ;-)

Ready for testing! (and to be then the base for other ones, if all is ok!) 👍

}

$urlSelect = $linkCategories . '&' . JSession::getFormToken() . '=1';
$urlEdit = $linkCategory . '&id=' . $value . '&' . JSession::getFormToken() . '=1';
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

shouldn't all internal URL be passed trough JRoute::_()?

Copy link
Copy Markdown
Contributor Author

@cyrez cyrez May 13, 2016

Choose a reason for hiding this comment

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

The urls there are the source url (remote) for the iframe inside the modal (set here : https://github.com/joomla/joomla-cms/blob/staging/layouts/joomla/modal/iframe.php#L46).
So, as inside the modal-body iframe of the modal, should not be needed, and not sure in fact that is should be used... (none of all bootstrap modals iframe use JRoute ;-) )

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

humm ... ok then i guess is not needed here

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Indeed, this is a good question... and wonder who can answer ? :-|

@cyrez cyrez changed the title Modal com_categories: improve select category Modal com_categories: improve Select & Edit Category buttons May 13, 2016
@cyrez cyrez changed the title Modal com_categories: improve Select & Edit Category buttons Modal com_categories: improve Select & Edit Category May 13, 2016
@andrepereiradasilva
Copy link
Copy Markdown
Contributor

I have tested this item ✅ successfully on 443897d

Tested with success.

Solves a lot of issues with the "Edit" modal, js errors and the "Clear" button.

Also now the "Edit" is a modal with "Close", "Save" and "Save & Close" buttons! 👍


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/10441.

@andrepereiradasilva
Copy link
Copy Markdown
Contributor

@JoomliC really nice work!

The modals are getting much more user friendly.
Also you're solving a lot of bugs!

I hope all modals get reviewed for 3.6.0.

@cyrez
Copy link
Copy Markdown
Contributor Author

cyrez commented May 13, 2016

Thank you @andrepereiradasilva !
Yes, if this one for category is ok, i will update article and module (with save button) and will do the ones for contact and newsfeed.
I think i can do this for 3.6.0 ;-)

@BurtNL
Copy link
Copy Markdown

BurtNL commented May 13, 2016

I have tested this item ✅ successfully on 443897d

Everything works as described. Great!


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/10441.

@brianteeman
Copy link
Copy Markdown
Contributor

RTC


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/10441.

@joomla-cms-bot joomla-cms-bot added the RTC This Pull Request is Ready To Commit label May 13, 2016
@brianteeman brianteeman added this to the Joomla 3.6.0 milestone May 13, 2016
@cyrez
Copy link
Copy Markdown
Contributor Author

cyrez commented May 14, 2016

@andrepereiradasilva @BurtNL Thanks for testing!
A new one just added for com_contacts #10457 ;-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants