Problem description

When the user is in edit mode and clicks on a custom block contextual link there are two “quick edit” links in the list.

Proposed solution

Remove the second quick edit link since the first already opens the tray and triggers quick edit of the text.
Update the labels on 1 or both of the links to differentiate them to the user.

Remaining tasks

Pick the labels for each link.

User interface changes

1 or both links labels will be changed

API changes

None

Data model changes

None

Comments

tkoleary created an issue. See original summary.

tedbow’s picture

Given there shouldn't be 2 links that say "Quick Edit" but when click the first "Quick Edit" link it opens the offcanvas tray(Outside In) AND trigger the Quick Module functionality. This seems very confusing. I don't think just removing the link is going to solve the problem.

It seems we need the 2 links but need to solve the naming issue.

larowlan’s picture

I think this is a duplicate of #1956134: Provide helpful editing links on "admin/structure/block" for deriver blocks (menu, views, block content, etc.)

Is the 'adopting D7 usability to D6' tag correct?

There are two entities here - the block (config/placement) and block_content (content entity).

tkoleary’s picture

Issue tags: -adopting D7 usability to D6 +Usability
Bojhan’s picture

tkoleary’s picture

@bojhan

Let's keep this one open but keep the scope to just removing the duplicate link, which to the user is a bug.

The other issue can be where we handle the broader design pattern.

Bojhan’s picture

But @tedblow clearly points out it won't solve the problem? I am inclined to agree.

tkoleary’s picture

@bojhan

I think you're right.

Until we have a better solution (eg. when this is in core and we can unify the two) let's change the text to "Show Settings".

tedbow’s picture

Status: Active » Needs review
StatusFileSize
new718 bytes
new718 bytes

Until we have a better solution (eg. when this is in core and we can unify the two) let's change the text to "Show Settings".

I think the difference between "Show Settings" and "Configure Block" would be. Not obivous which one shows in the "setting tray"

Ok. Here is a try at the solution

For Content blocks the "Setting tray" link is changed to "Quick edit settings"

I don't think there are any great options here.

Another option would be
Change both links on Content Blocks to include :
Quick edit content
Quick edit settings

tedbow’s picture

Title: Remove extra quick edit link from custom blocks » Differentiate 2 "Quick edit" links for custom blocks
Issue summary: View changes

Changing the title because we can't remove a link.

Remove the second quick edit link since the first already opens the tray and triggers quick edit of the text.

This was a bug and has been fixed.

larowlan’s picture

Works for me, but needs a test right?

tedbow’s picture

StatusFileSize
new4.84 KB
new4.14 KB

@larowlan yep you are right.

Here is a test to make sure the correct link is changed to "Quick edit settings"

larowlan’s picture

Looking good, couple of things

  1. +++ b/core/modules/outside_in/tests/src/FunctionalJavascript/OutsideInBlockFormTest.php
    @@ -116,6 +125,20 @@ public function testBlocks() {
    +    self::assertEquals('', $href);
    ...
    +    self::assertEquals('/admin/structure/block/manage/custom/offcanvas?destination=user/2', $href);
    

    Why self:: and not $this->?

  2. +++ b/core/modules/outside_in/tests/src/FunctionalJavascript/OutsideInBlockFormTest.php
    @@ -155,4 +178,60 @@ protected function openBlockForm($block_selector) {
    +  protected function createBlockContent($title = FALSE, $bundle = 'basic', $save = TRUE) {
    ...
    +  protected function createBlockContentType($label, $create_body = FALSE) {
    

    There may already be a trait for this. If not, we should make one.

tedbow’s picture

1. Using "self::" because it is static function.
2. It might be a good idea to make a trait but in this experimental module so we can keep making changes to 8.2.x branch. But we can't make changes out site of the module in 8.2.x

Status: Needs review » Needs work

The last submitted patch, 12: 2786193-12.patch, failed testing.

tedbow’s picture

Status: Needs work » Needs review
StatusFileSize
new4.86 KB
new823 bytes

--- Expected
+++ Actual
@@ @@
-'/admin/structure/block/manage/custom/offcanvas?destination=user/2'
+'/checkout/admin/structure/block/manage/custom/offcanvas?destination=user/2'

Not sure why DrupalCI link starts with "/checkout/".

Changed to use strstr to look inside $href string, not for equality.

tim.plunkett’s picture

  1. +++ b/core/modules/outside_in/outside_in.module
    @@ -39,6 +39,10 @@ function outside_in_contextual_links_view_alter(&$element, $items) {
    +      $element['#links']['outside-inblock-configure']['title'] .= ' settings';
    

    I don't think appending this string is safe for translations. It should redeclare the string within $this->t().

  2. +++ b/core/modules/outside_in/tests/src/FunctionalJavascript/OutsideInBlockFormTest.php
    @@ -116,6 +125,20 @@ public function testBlocks() {
    +    self::assertEquals('', $href);
    

    Yes, it is static in PHPUnit. But we still call it with $this-> because a) you can b) it is more consistent

Testbot installs into a subdirectory to catch bugs and assumptions around similar things.

tedbow’s picture

StatusFileSize
new4.87 KB
new1.63 KB

@tim.plunkett thanks for feedback

1. Yep don't know what I was thinking :(. Fixed!
2. changed to use $this->

tim.plunkett’s picture

Status: Needs review » Reviewed & tested by the community
+++ b/core/modules/outside_in/tests/src/FunctionalJavascript/OutsideInBlockFormTest.php
@@ -155,4 +178,60 @@ protected function openBlockForm($block_selector) {
+  protected function createBlockContent($title = FALSE, $bundle = 'basic', $save = TRUE) {
...
+  protected function createBlockContentType($label, $create_body = FALSE) {

A follow-up to make these a trait would be nice, I think we redo this about 9 other places already

Looks good to me!

Status: Reviewed & tested by the community » Needs work

The last submitted patch, 18: 2786193-18.patch, failed testing.

tedbow’s picture

Version: 8.2.x-dev » 8.3.x-dev
Status: Needs work » Needs review
StatusFileSize
new4.84 KB

Ughh just a re-roll

tim.plunkett’s picture

Status: Needs review » Reviewed & tested by the community

+1

20th’s picture

Status: Reviewed & tested by the community » Postponed
Related issues: +#2830485: \Drupal\Tests\outside_in\FunctionalJavascript\OutsideInBlockFormTest fails randomly

This patch is not tested yet. It does not pass its tests because right now OutsideInBlockFormTest::testBlocks tests are disabled in #2830485: \Drupal\Tests\outside_in\FunctionalJavascript\OutsideInBlockFormTest fails randomly:

  /**
   * Tests opening Offcanvas tray by click blocks and elements in the blocks.
   */
  public function testBlocks() {
    // @todo: re-enable once https://www.drupal.org/node/2830485 is resolved.
    $this->markTestSkipped('Test skipped due to random failures in DrupalCI, see https://www.drupal.org/node/2830485');

    $web_assert = $this->assertSession();

Status here should be changed to Postponed until blocker issue is fixed and tests can be executed again.

tedbow’s picture

Status: Postponed » Needs review
StatusFileSize
new5.27 KB
new1.3 KB

@20th thanks for pointing that out.

I have the testing of this functionality into it's own test method. It is easier to read anyways if it is in it's own test method. The only reason I put it in the other is to save test time by not having to install drupal again. I am not sure about the balance between simpler methods and short test suite runs.

I added a todo about removing assertWaitOnAjaxRequest() call if this is not need after #2830485: \Drupal\Tests\outside_in\FunctionalJavascript\OutsideInBlockFormTest fails randomly

We could have a todo about moving the code back into testBlocks() but maybe it is better on it's own.

Bojhan’s picture

Looks great, the word settings clearly annotates its meaning.

Version: 8.3.x-dev » 8.4.x-dev

Drupal 8.3.0-alpha1 will be released the week of January 30, 2017, which means new developments and disruptive changes should now be targeted against the 8.4.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

fabian.marz’s picture

StatusFileSize
new867 bytes
new5.16 KB

What about this earlier consideration? Why did you chose changing the link in patch 24 just for the offcanvas and not for the content?

Another option would be
Change both links on Content Blocks to include :
Quick edit content
Quick edit settings

I rerolled patch 24. Regarding to #2830485: \Drupal\Tests\outside_in\FunctionalJavascript\OutsideInBlockFormTest fails randomly I removed the obsolete Ajax request function call.

tedbow’s picture

Status: Needs review » Reviewed & tested by the community

@fabian.marz thanks for re-rolling.

I think wording as it is not simpler and we got UX sign off from @Bohjan in #25.

Status: Reviewed & tested by the community » Needs work

The last submitted patch, 27: 2786193-27.patch, failed testing.

tedbow’s picture

Status: Needs work » Needs review
StatusFileSize
new4.95 KB

Re-roll

wim leers’s picture

Status: Needs review » Reviewed & tested by the community

Back to RTBC. Manually confirmed that #30 is functionally equivalent with #21, which @tim.plunkett RTBC'd.

lauriii’s picture

Status: Reviewed & tested by the community » Needs review
+++ b/core/modules/outside_in/tests/src/FunctionalJavascript/OutsideInBlockFormTest.php
@@ -364,4 +372,80 @@ protected function pressToolbarEditButton() {
+  protected function createBlockContent($title = FALSE, $bundle = 'basic', $save = TRUE) {

Was there a particular reason to use FALSE to state no value? Wouldn't null make sense?

tedbow’s picture

@lauriii FALSE what is other testing functions in creating blocks:

\Drupal\block_content\Tests\BlockContentTestBase::createBlockContent
\Drupal\block_content\Tests\BlockContentTranslationUITest::createBlockContent
\Drupal\Tests\block_content\Functional\BlockContentTestBase::createBlockContent

They share the signature
protected function createBlockContent($title = FALSE, $bundle = 'basic', $save = TRUE) {
well least the first 2 arguments are the same in all 3

alexpott’s picture

Status: Needs review » Needs work
+++ b/core/modules/outside_in/tests/src/FunctionalJavascript/OutsideInBlockFormTest.php
@@ -364,4 +372,80 @@ protected function pressToolbarEditButton() {
+    $title = $title ?: $this->randomMachineName();

This really ought to be randomName() not randomMachineName().

Re #32 I agree it's odd but the way it is currently coded NULL, FALSE and empty string will all result in a random name. So I wouldn't hold up the patch on this method's signature.

gaurav.kapoor’s picture

Status: Needs work » Needs review
StatusFileSize
new4.95 KB
new694 bytes
tedbow’s picture

Status: Needs review » Reviewed & tested by the community

@gaurav.kapoor thanks for fixing #34

I think back to RTBC because @alexpott said he was going hold up the patch for #32

@alexpott & @larowlan thanks for addressing the issue!

lauriii’s picture

Version: 8.4.x-dev » 8.3.x-dev
Status: Reviewed & tested by the community » Patch (to be ported)

Thank you @alexpott and @tedbow for addressing #32. Other than that this looks good for me. Also, the wording has been accepted by @Bojhan on #25.

Committed b49d243 and pushed to 8.4.x. Thanks!

  • lauriii committed b49d243 on 8.4.x
    Issue #2786193 by tedbow, gaurav.kapoor, fabian.marz, tkoleary, Bojhan,...
tim.plunkett’s picture

Version: 8.4.x-dev » 8.3.x-dev
Status: Reviewed & tested by the community » Patch (to be ported)

Looks like d.o ate the metadata change

star-szr’s picture

Status: Patch (to be ported) » Reviewed & tested by the community

Yup, let's commit to 8.3.x as well since it's an experimental module :)

Status: Reviewed & tested by the community » Needs work

The last submitted patch, 35: 2786193-35.patch, failed testing.

tedbow’s picture

Status: Needs work » Reviewed & tested by the community

Ok. DrupalCI keeps trying to run #35 against 8.4.x when set to RTBC. Not sure how to solve this.

  • lauriii committed ed69c34 on 8.3.x
    Issue #2786193 by tedbow, gaurav.kapoor, fabian.marz, tkoleary, Bojhan,...
lauriii’s picture

Status: Reviewed & tested by the community » Fixed

Cherry picked ed69c34 and pushed to 8.3.x.

gaurav.kapoor’s picture

LOL

Status: Fixed » Closed (fixed)

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

tedbow’s picture

Component: outside_in.module » settings_tray.module

Changing to new settings_tray.module component. @drpal thanks for script help! :)