Problem/Motivation

The usual wording of the button to add something is "Add content type", "Add contact form" etc. but on the two Display mode pages these links are "Add new view mode" and "Add new form mode".

"New" is otherwise only used in connection with installing something new (module, theme).

Proposed resolution

1) Change the wording to "Add view mode" on the View modes page, and to "Add form mode" on the Form modes page.

2) On the View modes page, remove 'new' from each of the following:
"Add new Content view mode", "Add new Custom block view mode", "Add new Comment view mode", "Add new Taxonomy term view mode", "Add new User view mode".

Remaining tasks

Edit the wording in the field_ui.routing.yml and/or field_ui.links.action.yml, and update the hook_help text in field_ui.module if necessary

User interface changes

This is a UI text change and therefore the help text might need to be edited as well.

API changes

none

Data model changes

none

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

ifrik created an issue. See original summary.

ChandeepKhosa’s picture

Assigned: Unassigned » ChandeepKhosa

..

kamalrajsahu21’s picture

FileSize
675 bytes

Text changed in this patch and no need to change anything in help text.

ChandeepKhosa’s picture

Issue summary: View changes

I noticed that the 'new' text needed to be removed from additional places, but on the same page & context, so I expanded the scope of this issue.

Haza’s picture

Status: Active » Needs work
  1. +++ b/core/modules/field_ui/field_ui.links.action.yml
    @@ -1,13 +1,13 @@
    -  title: 'Add new view mode'
    

    I guess we should also change this in the tests.

    See in testEntityViewModeUI()

        $this->assertResponse(200);
        $this->assertText(t('Add new view mode'));
        $this->assertLinkByHref('admin/structure/display-modes/view/add');
    
  2. +++ b/core/modules/field_ui/field_ui.links.action.yml
    @@ -1,13 +1,13 @@
    +  title: 'Add form mode'
    

    Same here, see in testEntityFormModeUI().

ChandeepKhosa’s picture

Assigned: ChandeepKhosa » Unassigned
Issue summary: View changes
Status: Needs work » Needs review
FileSize
3.82 KB
120.69 KB
122.44 KB
301.85 KB
321.5 KB
204.46 KB
329.09 KB

This patch includes all relevant changes needed above.
Unlike the patch uploaded by Kamal, my patch also includes connected changes to tests & additional view modes lower on the page.

Thank you to Marc Van Gend (marcvangend), Daniel Smith (dmsmidt) & Gabor Hojtsy (gábor-hojtsy) for mentoring assistance here at Drupal Dev Days.

Screenshots showing changes made

View modes

Form modes

ChandeepKhosa’s picture

..

Gábor Hojtsy’s picture

Looks good assuming tests pass :)

Status: Needs review » Needs work

The last submitted patch, 6: removed-new-from-view-and-form-modes-2752709-5.patch, failed testing.

Gábor Hojtsy’s picture

Looks like still fails on Line 47 of core/modules/field/src/Tests/Update/FieldUpdateTest.php:.

pashupathi nath gajawada’s picture

Assigned: Unassigned » pashupathi nath gajawada
Status: Needs work » Needs review
FileSize
1.9 KB

Hi ,

Please find the attached patch which would fix this.

Thanks,

mcgovernm’s picture

Status: Needs review » Reviewed & tested by the community

Last patch looks good! Tested patch with simplytest.me.

ChandeepKhosa’s picture

Assigned: pashupathi nath gajawada » Unassigned

Thanks guys for all of your help. I am removing the assignee from pashupathi

ifrik’s picture

Thanks, this patch works as intended.

However, two comments about good practices in the issue queue:

Kamalrajsahu21: another user had already assigned himself to the issue and was working on it. Just jumping in and posting a patch without checking whether the other person had stopped working on it, means that the work was done double, potentially wasting time that rather could have been spend on two different issues.

And about naming patches: It's good practice to keep the name of the first patch and not just randomly rename them. A different name usually indicates a new patch done from scratch and not a continued work, so it's difficult for reviewers to see what's going on. For the same reason it's also good practice to provide interdiffs so that reviewers can see what has changed from one version of a patch to another instead of reviewing it all over again.

  • xjm committed d2cd3e6 on 8.2.x
    Issue #2752709 by ChandeepKhosa, kamalrajsahu21, pashupathi nath...

xjm credited dmsmidt.

xjm credited marcvangend.

xjm credited dmsmidt.

xjm credited marcvangend.

xjm’s picture

Status: Reviewed & tested by the community » Fixed

I confirmed that this fixes all instances of these two overlong strings:

[mandelbrot:maintainer | Thu 16:56:17] $ grep -ri "add new view mode" *
[mandelbrot:maintainer | Thu 16:56:20] $ grep -ri "add new form mode" *

Similarly to #2749261: "Add view" instead of "Add new view", this removes redundancy from the UI text, which is a good usability best practice.

Committed d2cd3e6 and pushed to 8.2.x. Thanks! I've also added issue credit for the mentors mentioned in the issue.

xjm’s picture

(Fixing the credit.)

Status: Fixed » Closed (fixed)

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

Gábor Hojtsy’s picture

Issue tags: -sprint

Thanks, removing from UX sprint now.