Verified Commit 7df65709 authored by Lauri Timmanee's avatar Lauri Timmanee
Browse files

Issue #3386762 by omkar.podey, kunal.sachdev, benjifisher, lauriii, hooroomoo,...

Issue #3386762 by omkar.podey, kunal.sachdev, benjifisher, lauriii, hooroomoo, tim.plunkett, narendrar, srishtiiee, nod_, simohell, rkoller, gábor hojtsy, catch, ckrina: Use modals in field creation and field edit flow
parent d81484de
Loading
Loading
Loading
Loading
Loading
+154 −142

File changed.

Preview size limit exceeded, changes collapsed.

+1 −2
Original line number Diff line number Diff line
@@ -15,8 +15,7 @@
    attach() {
      once(
        'keyboardNavigation',
        'input[type="text"], input[type="number"]',
        document.querySelector('[data-field-list-table]'),
        '[data-field-list-table] :is(input[type="text"], input[type="number"])',
      ).forEach((element) =>
        element.addEventListener('keypress', (event) => {
          if (event.key !== 'Enter') {
+3 −6
Original line number Diff line number Diff line
@@ -151,15 +151,12 @@ public function testCommentFieldCreate(): void {
    $this->drupalLogin($user);

    // Create comment field in account settings.
    $edit = [
      'new_storage_type' => 'comment',
    ];
    $this->drupalGet('admin/config/people/accounts/fields/add-field');
    $this->submitForm($edit, 'Continue');
    $edit = [
      'label' => 'User comment',
      'field_name' => 'user_comment',
    ];
    $this->drupalGet('admin/config/people/accounts/fields/add-field');
    $this->clickLink('Comments');
    $this->submitForm($edit, 'Continue');

    // Try to save the comment field without selecting a comment type.
@@ -192,7 +189,7 @@ public function testCommentFieldCreate(): void {
      'settings[per_page]' => 0,
    ];
    $this->drupalGet('admin/config/people/accounts/add-field/user/field_user_comment');
    $this->submitForm($edit, 'Save settings');
    $this->submitForm($edit, 'Save');
    $this->assertSession()->statusMessageContains('Saved User comment configuration.', 'status');
  }

+4 −4
Original line number Diff line number Diff line
@@ -505,9 +505,9 @@ public function testsNonIntegerIdEntities(): void {
    // Visit the Field UI field add page.
    $this->drupalGet('entity_test_string_id/structure/entity_test/fields/add-field');
    // Ensure field isn't shown for string IDs.
    $this->assertSession()->elementNotExists('css', "[name='new_storage_type'][value='comment']");
    $this->assertSession()->elementNotExists('xpath', "//a//span[text()='Comments']");
    // Ensure a core field type shown.
    $this->assertSession()->elementExists('css', "[name='new_storage_type'][value='boolean']");
    $this->assertSession()->elementExists('xpath', "//a//span[text()='Boolean']");

    // Attempt to add a comment-type referencing this entity-type.
    $this->drupalGet('admin/structure/comment/types/add');
@@ -522,9 +522,9 @@ public function testsNonIntegerIdEntities(): void {
    // Visit the Field UI field add page.
    $this->drupalGet('entity_test_no_id/structure/entity_test/fields/add-field');
    // Ensure field isn't shown for empty IDs.
    $this->assertSession()->elementNotExists('css', "[name='new_storage_type'][value='comment']");
    $this->assertSession()->elementNotExists('xpath', "//a//span[text()='Comments']");
    // Ensure a core field type shown.
    $this->assertSession()->elementExists('css', "[name='new_storage_type'][value='boolean']");
    $this->assertSession()->elementExists('xpath', "//a//span[text()='Boolean']");
  }

  /**
+1 −1
Original line number Diff line number Diff line
@@ -133,7 +133,7 @@ public function testFieldAdminHandler(): void {
      'required' => FALSE,
      'settings[handler_settings][view][view_and_display]' => 'node_test_view:entity_reference_1',
    ];
    $this->submitForm($edit, 'Save settings');
    $this->submitForm($edit, 'Save');
    $this->assertSession()->statusMessageContains("Saved Test Entity Reference Field configuration.", MessengerInterface::TYPE_STATUS);
    $this->assertFieldExistsOnOverview('Test Entity Reference Field');

Loading