Browse Source

Issue #2931731 by tjwelde: [UX] Field length indicator without setting a hard limit (#443)

tags/3.3.0-beta1
Timo Welde Daniel Bosen 2 years ago
parent
commit
fafc9ddb15
18 changed files with 59 additions and 4 deletions
  1. +1
    -1
      CONTRIBUTING.md
  2. +1
    -0
      composer.json
  3. +2
    -0
      drupal-org.make
  4. +7
    -1
      modules/thunder_article/config/optional/core.entity_form_display.node.article.default.yml
  5. +16
    -0
      modules/thunder_article/config/update/thunder_article_update_8102.yml
  6. +22
    -0
      modules/thunder_article/thunder_article.install
  7. +1
    -1
      modules/thunder_demo/content/node/0bd5c257-2231-450f-b4c2-ab156af7b78d.json
  8. +7
    -0
      modules/thunder_updater/updates.yml
  9. +1
    -1
      src/Tests/Installer/ThunderInstallerTest.php
  10. BIN
      tests/fixtures/screenshots/test_device_preview_ch1.png
  11. BIN
      tests/fixtures/screenshots/test_device_preview_ch2.png
  12. BIN
      tests/fixtures/screenshots/test_device_preview_ch3.png
  13. BIN
      tests/fixtures/screenshots/test_device_preview_ch4.png
  14. BIN
      tests/fixtures/screenshots/test_device_preview_ch5.png
  15. BIN
      tests/fixtures/screenshots/test_device_preview_ch6.png
  16. BIN
      tests/fixtures/screenshots/test_device_preview_ch7.png
  17. BIN
      tests/fixtures/screenshots/test_device_preview_ch8.png
  18. +1
    -0
      thunder.info.yml

+ 1
- 1
CONTRIBUTING.md View File

@@ -14,4 +14,4 @@ So, if you can track down an issue to a specific module, please open the ticket

If you want to open a PR for the Thunder distribution, please make sure you created an corresponding issue on d.o. before. All created pull requests should contain a d.o. issue number in it's title.

Please also note the pull request template to create better qualitity pull requests.
Please also note the pull request template to create better quality pull requests.

+ 1
- 0
composer.json View File

@@ -116,6 +116,7 @@
"drupal/google_analytics": "^2.0",
"drupal/inline_entity_form": "^1.0",
"drupal/ivw_integration": "^1.0",
"drupal/length_indicator": "^1.0",
"drupal/libraries": "dev-3.x",
"drupal/linkit": "^4.0",
"drupal/liveblog": "^1.0",


+ 2
- 0
drupal-org.make View File

@@ -57,6 +57,8 @@ projects[inline_entity_form][type] = module
projects[inline_entity_form][version] = 1
projects[ivw_integration][type] = module
projects[ivw_integration][version] = 1
projects[length_indicator][type] = module
projects[length_indicator][version] = 1
projects[libraries][type] = module
projects[libraries][download][url] = http://git.drupal.org/project/libraries.git
projects[libraries][download][branch] = 8.x-3.x


+ 7
- 1
modules/thunder_article/config/optional/core.entity_form_display.node.article.default.yml View File

@@ -104,7 +104,13 @@ content:
settings:
size: 65
placeholder: ''
third_party_settings: { }
third_party_settings:
length_indicator:
indicator: true
indicator_opt:
optimin: 15
optimax: 50
tolerance: 10
region: content
field_tags:
type: entity_reference_autocomplete_tags


+ 16
- 0
modules/thunder_article/config/update/thunder_article_update_8102.yml View File

@@ -0,0 +1,16 @@
core.entity_form_display.node.article.default:
expected_config:
content:
field_seo_title:
third_party_settings: { }
update_actions:
change:
content:
field_seo_title:
third_party_settings:
length_indicator:
indicator: true
indicator_opt:
optimax: 50
optimin: 15
tolerance: 10

+ 22
- 0
modules/thunder_article/thunder_article.install View File

@@ -102,3 +102,25 @@ function thunder_article_update_8101() {

return $updateLogger->output();
}

/**
* Enable length_indicator module.
*/
function thunder_article_update_8102() {
/** @var \Drupal\thunder_updater\Updater $thunderUpdater */
$thunderUpdater = \Drupal::service('thunder_updater');

// Execute configuration update definitions with logging of success.
if (
$thunderUpdater->installModules(['thunder_article_update_8102' => 'length_indicator']) &&
$thunderUpdater->executeUpdates([['thunder_article', 'thunder_article_update_8102']])
) {
$thunderUpdater->checklist()->markUpdatesSuccessful(['thunder_article_update_8102']);
}
else {
$thunderUpdater->checklist()->markUpdatesFailed(['thunder_article_update_8102']);
}

// Output logged messages to related channel of update execution.
return $thunderUpdater->logger()->output();
}

+ 1
- 1
modules/thunder_demo/content/node/0bd5c257-2231-450f-b4c2-ab156af7b78d.json View File

@@ -74,7 +74,7 @@
],
"title": [
{
"value": "Burda Launches Worldwide Coalition Of Industry Partners And Releases Open-Source Online CMS Platform"
"value": "Burda Launches Open-Source CMS Thunder"
}
],
"_embedded": {


+ 7
- 0
modules/thunder_updater/updates.yml View File

@@ -176,3 +176,10 @@ v2.11:
'#description_failed': '<p><strong>Slick could not be configured to use blazy for lazy loading of images in galleries.</strong> Enable the Slick UI module and configure your option sets to use blazy for lazy loading<p>'
extension_page: { '#text': 'Enable the Slick UI module', '#url': 'internal:/admin/modules' }
configure_page: { '#text': 'Configure your option sets', '#url': 'internal:/admin/config/media/slick' }
thunder_article_update_8102:
'#title': 'Enable "Length Indicator" module'
'#description': '<p>The "Length Indicator" module provides a visual feedback for editors, to decide if they have written too less, enough, or too much.</p>'
'#description_successful': '<p>It was activated for the field "SEO Title" in the article.</p>'
'#description_failed': '<p><strong>Installation failed</strong>, visit the extension page and try to enable the module manually.<p><p>Afterwards visit the form display configuration of the article to activate it, e.g. for the field "SEO Title".</p>'
extension_page: { '#text': 'Enable the Length Indicator module', '#url': 'internal:/admin/modules' }
configure_page: { '#text': 'Configure the form display of the article', '#url': 'internal:/admin/structure/types/manage/article/form-display' }

+ 1
- 1
src/Tests/Installer/ThunderInstallerTest.php View File

@@ -164,7 +164,7 @@ class ThunderInstallerTest extends InstallerTestBase {
$this->assertText($this->rootUser->getUsername());

// Ensure demo content is installed.
$this->assertText('Burda Launches Worldwide Coalition Of Industry Partners And Releases Open-Source Online CMS Platform');
$this->assertText('Burda Launches Open-Source CMS Thunder');
$this->assertText('Come to DrupalCon New Orleans');

/** @var \Drupal\Core\Database\Query\SelectInterface $query */


BIN
tests/fixtures/screenshots/test_device_preview_ch1.png View File

Before After
Width: 1280  |  Height: 845  |  Size: 177KB Width: 1280  |  Height: 845  |  Size: 166KB

BIN
tests/fixtures/screenshots/test_device_preview_ch2.png View File

Before After
Width: 1280  |  Height: 845  |  Size: 211KB Width: 1280  |  Height: 845  |  Size: 203KB

BIN
tests/fixtures/screenshots/test_device_preview_ch3.png View File

Before After
Width: 1280  |  Height: 845  |  Size: 148KB Width: 1280  |  Height: 845  |  Size: 147KB

BIN
tests/fixtures/screenshots/test_device_preview_ch4.png View File

Before After
Width: 1280  |  Height: 845  |  Size: 190KB Width: 1280  |  Height: 845  |  Size: 188KB

BIN
tests/fixtures/screenshots/test_device_preview_ch5.png View File

Before After
Width: 1280  |  Height: 1175  |  Size: 251KB Width: 1280  |  Height: 1175  |  Size: 261KB

BIN
tests/fixtures/screenshots/test_device_preview_ch6.png View File

Before After
Width: 1280  |  Height: 1175  |  Size: 284KB Width: 1280  |  Height: 1175  |  Size: 276KB

BIN
tests/fixtures/screenshots/test_device_preview_ch7.png View File

Before After
Width: 1280  |  Height: 1175  |  Size: 296KB Width: 1280  |  Height: 1175  |  Size: 286KB

BIN
tests/fixtures/screenshots/test_device_preview_ch8.png View File

Before After
Width: 1280  |  Height: 1175  |  Size: 282KB Width: 1280  |  Height: 1175  |  Size: 277KB

+ 1
- 0
thunder.info.yml View File

@@ -48,6 +48,7 @@ dependencies:
- entity_browser_entity_form
- field_group
- focal_point
- length_indicator
- libraries
- linkit
- media_entity_image


Loading…
Cancel
Save