Problem/Motivation

The UserRestrictionAddForm class uses the following code.

  /**
   * {@inheritdoc}
   */
  public function submitForm(array &$form, FormStateInterface $form_state): void {
    parent::submitForm($form, $form_state);
    $this->messenger()
      ->addStatus($this->t('User restriction was created for %label.', ['%label' => $this->entity->label()]));
    // Redirect to the user restriction collection page.
    $form_state->setRedirect('entity.user_restriction.collection');
  }

  /**
   * {@inheritdoc}
   */
  public function actions(array $form, FormStateInterface $form_state): array {
    $actions = parent::actions($form, $form_state);
    $actions['submit']['#value'] = $this->t('Create new user restriction');

    return $actions;
  }

Both the UI strings can be improved.

Proposed resolution

Use User restriction %label has been created. instead of the first string and Add user restriction instead of the second string. The latter string should also be used for the button shown in the list of user restriction entities, which now uses Add rule.

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

avpaderno created an issue. See original summary.

avpaderno’s picture

Title: Improved the UI strings used by UserRestrictionAddForm » Improve the UI strings used by UserRestrictionAddForm

avpaderno’s picture

Status: Active » Needs review

  • avpaderno committed 882fae79 on 3.0.x
    Issue #3553644: Improve the UI strings used by UserRestrictionAddForm
    
avpaderno’s picture

Version: 3.0.x-dev » 2.1.x-dev

  • avpaderno committed 3366e333 on 2.1.x
    Issue #3553644: Improve the UI strings used by UserRestrictionAddForm
    
avpaderno’s picture

Status: Needs review » Fixed

Now that this issue is closed, please review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, please credit people who helped resolve this issue.

avpaderno’s picture

Priority: Normal » Minor
avpaderno’s picture

Issue summary: View changes

Status: Fixed » Closed (fixed)

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