Skip to content
Snippets Groups Projects
Commit b06547f5 authored by utkarsh_33's avatar utkarsh_33 Committed by Ben Mullins
Browse files

Issue #3311978 by Utkarsh_33, narendraR, srishtiiee: Text area of composer...

Issue #3311978 by Utkarsh_33, narendraR, srishtiiee: Text area of composer command should be read only
parent 9b33bc51
No related branches found
No related tags found
No related merge requests found
File suppressed by a .gitattributes entry or the file's encoding is unsupported.
File suppressed by a .gitattributes entry or the file's encoding is unsupported.
...@@ -115,7 +115,7 @@ ...@@ -115,7 +115,7 @@
<p>${composerText}</p> <p>${composerText}</p>
<p>${composerExistsText}:</p> <p>${composerExistsText}:</p>
<div id="download-cmd"> <div id="download-cmd">
<input id="${project.project_machine_name}-download-command" value="composer require ${project.composer_namespace}"/> <input id="${project.project_machine_name}-download-command" value="composer require ${project.composer_namespace}" readonly/>
<button id="download-btn"><img src="${FULL_MODULE_PATH}/images/copy-icon.svg" alt={Drupal.t('Copy the install command')}/></button> <button id="download-btn"><img src="${FULL_MODULE_PATH}/images/copy-icon.svg" alt={Drupal.t('Copy the install command')}/></button>
<div id="${project.project_machine_name}-copied-download" class="copied-download">${copied}</div> <div id="${project.project_machine_name}-copied-download" class="copied-download">${copied}</div>
</div> </div>
...@@ -126,7 +126,7 @@ ...@@ -126,7 +126,7 @@
<p>${installText}.</p> <p>${installText}.</p>
<p>${drushText}:</p> <p>${drushText}:</p>
<div id="install-cmd"> <div id="install-cmd">
<input id="${project.project_machine_name}-install-command" value="drush pm:install ${project.project_machine_name}"/> <input id="${project.project_machine_name}-install-command" value="drush pm:install ${project.project_machine_name}" readonly/>
<button id="install-btn"><img src="${FULL_MODULE_PATH}/images/copy-icon.svg" alt={Drupal.t('Copy the install command')}/></button> <button id="install-btn"><img src="${FULL_MODULE_PATH}/images/copy-icon.svg" alt={Drupal.t('Copy the install command')}/></button>
<div id="${project.project_machine_name}-copied-install" class="copied-install">${copied}</div> <div id="${project.project_machine_name}-copied-install" class="copied-install">${copied}</div>
</div>`; </div>`;
......
...@@ -232,6 +232,23 @@ class ProjectBrowserUiTest extends WebDriverTestBase { ...@@ -232,6 +232,23 @@ class ProjectBrowserUiTest extends WebDriverTestBase {
} }
/**
* Tests read-only input fields for referred commands.
*/
public function testReadonlyFields(): void {
$page = $this->getSession()->getPage();
$assert_session = $this->assertSession();
$this->drupalGet('admin/modules/browse');
$this->svelteInitHelper('text', 'Helvetica');
$page->clickLink('Helvetica');
$this->assertTrue($assert_session->waitForText('By Hel Vetica'));
$this->clickWithWait('#project-browser .button--primary');
$allowed_html_field = $assert_session->fieldExists('helvetica-download-command');
$this->assertTrue($allowed_html_field->hasAttribute('readonly'));
$allowed_html_field = $assert_session->fieldExists('helvetica-install-command');
$this->assertTrue($allowed_html_field->hasAttribute('readonly'));
}
/** /**
* Tests paging through results. * Tests paging through results.
*/ */
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment