Closed (fixed)
Project:
Flag
Version:
8.x-4.x-dev
Component:
Flag core
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
16 Nov 2016 at 19:17 UTC
Updated:
15 Feb 2017 at 02:44 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
jhedstromComment #3
jhedstromThis works in manual testing. I started adding a test, but realized we should break out the trait conversion in the patch at #2826227: Test to verify flagging events with multiple flags into a separate issue so we can more readily write phpunit-based tests (specifically in this case, JavascriptTestBase tests).
Comment #4
jhedstromComment #7
jhedstromComment #8
joachim commentedThis should be a new link type plugin, not an extra setting.
Comment #9
jhedstromSince this would apply to both the confirm form and the field entry forms, there would be 2 new plugins?
Comment #10
joachim commentedHmm good point...
Comment #11
joachim commentedI'm reluctant to add 2 more plugins... there would be a lot of code duplication.
Glancing at your patch, it looks like maybe this could be added to both the confirm and field entry plugins as a trait? There would be a 'modal' setting, but it would be on the plugin rather than on the flag.
Do any of the other maintainers and regular contributors have any thoughts on this?
Comment #12
jhedstromThis moves the bulk of the logic to a trait.
The modal setting is part of the plugin config rather than the flag.
Comment #13
jhedstromComment #14
socketwench commentedI think a trait makes sense in this case.
So far, so good on this patch, but it needs tests.
Comment #15
jhedstromI was waiting on #2828255: Split out the flag create methods into a testing trait to add a test, now that is in, so here's the start of a javascript test.
It is failing locally with a really odd error:
so we'll see how the testbot likes it.
Comment #16
jhedstromOops, wrong interdiff and patch. Ignore #15, this interdiff is against #12.
Comment #17
jhedstromThis test completes properly. I chatted with some folks on IRC, and there may be an issue with modals displaying properly in the test theme, *or* there may be an issue with using
assertWaitOnAjaxRequest(if somehow 10 seconds isn't long enough to load the modal). Either way, this demonstrates the issue at hand here, and hopefully we can leave further modal layout testing to core :)Comment #20
dawehnerI wonder whether one should be able to specfify the dialog type: modal, dialog or outside in thingy
Comment #21
jhedstromI added #2831506: Minimal profile disallows modal AJAX tests under JavascriptTestBase for the weird behavior of the tests when using
press().Comment #22
jhedstrom@dawehner good idea!
This makes the modal type configurable, and also fixes the test failures.
Comment #23
jhedstromWe probably won't need the separate trait here if #2834881: Extract out common interface in FieldEntry and ConfirmForm action link plugins goes in, as these 2 plugins will then extend from a common base class.
Comment #24
joachim commentedSo should #2834881: Extract out common interface in FieldEntry and ConfirmForm action link plugins be committed first?
Comment #25
socketwench commentedPostponed until the above issue is in.
Comment #26
jhedstromHere's an updated patch now that #2834881: Extract out common interface in FieldEntry and ConfirmForm action link plugins has been committed. It removes the trait, which is no longer needed since there is now a common base class.
Comment #27
socketwench commentedThis looks good to me too.
Comment #28
joachim commentedSorry to punt this back at this point... I've not been following this for a while.
This makes it sound like it should be a boolean....
... but it's in fact a range of options.
Only *one* of which is called 'modal', so calling the overall thing modal is odd.
Also, what does 'None' mean here? Doesn't it mean the site goes to a separate page load?
Comment #29
jhedstromPerhaps we could use "Form behavior" for the option's label, with the choices of:
Comment #30
joachim commentedYup, that makes more sense. 'form_behaviour' as the property name seems reasonable too.
Comment #31
jhedstromI shortened the option labels a bit, but put the details in the element's
#descriptionsection.Comment #32
jhedstromThis is a reroll since #2834426: Allow field entry and confirm form submit button text to be customized was committed.
Comment #33
martin107 commentedBy way of review.
1) Manual testing/UX - forms contain all the relevant text/information and button, and it functions and gives a good UX, which fits is well with all the has gone before.
My only comment in parsing is that the modal looks a bit old school, but that is the nature of modals - you either love or hate and we are putting that decision in the hands of the site owner. So I am happy ( Perhaps it would look better if the boxes of the model were rounded...but that is very much ore issue. )
2) PHP code look clean, sticks to all the coding standards, no surprises.
3) Testing in comprehensive, seems to completely cover the new functionality cleanly
So +1 from me
What follow is minor nits, found while running the new test through phpcs
I think I saw somebody in irc last week arguing that there should be less translate function calls in testing because unless you are testing specific language functions the default language in testing will always be english.
Anyway if testbot comes back green I would be happy to see this RTBC'ed
Comment #34
jhedstromI realized that since this patch was started, and the link methods were split into 2 different methods (
getAsLinkandgetAsFlagLink), the modal option in this patch stopped working on views links. This gets it working there again too.Also, in regards to the modal styling mentioned in #33, that's just the core/jquery default, so can easily be customized in a theme.
Comment #35
socketwench commentedLooks good! Also works in views.
Comment #37
socketwench commentedThanks everyone! Really appreciate this patch, I hope a lot of people will find it useful.