Problem/Motivation

In order for IWC to support hard and soft limit for image cropping we need to have some configuration in the crop type.

Proposed resolution

Add hard and soft limit to crop type.

Remaining tasks

User interface changes

API changes

Comments

Denchev created an issue. See original summary.

thenchev’s picture

Status: Active » Needs review
StatusFileSize
new4.38 KB
slashrsm’s picture

Status: Needs review » Needs work
  1. +++ b/src/Form/CropTypeForm.php
    @@ -65,6 +65,51 @@ class CropTypeForm extends EntityForm {
    +      '#description' => $this->t('Define the soft limit with and height. When
    +      the user is trying to make a smaller selection then defined here a warning
    +      is displayed.'),
    

    Don't break lines.

    I'd say something like "Define crop size soft limit. Warning will be displayed if crop smaller than that is selected."

  2. +++ b/src/Form/CropTypeForm.php
    @@ -65,6 +65,51 @@ class CropTypeForm extends EntityForm {
    +      '#type' => 'textfield',
    

    Use number instead of textfield. Applies to others too.

  3. +++ b/src/Form/CropTypeForm.php
    @@ -65,6 +65,51 @@ class CropTypeForm extends EntityForm {
    +      '#description' => $this->t('Define the hard limit with and height. User is
    +      not allowed to make a smaller selection the defined here.'),
    

    Similar to above.

thenchev’s picture

Status: Needs work » Needs review
StatusFileSize
new4.4 KB
new2.52 KB
slashrsm’s picture

Let's add #min => 0 to configuration form number elements.

thenchev’s picture

StatusFileSize
new1.13 KB
new4.48 KB

Added min.

slashrsm’s picture

Status: Needs review » Fixed

Committed.

  • slashrsm committed 5ec7b07 on 8.x-1.x authored by Denchev
    Issue #2657416 by Denchev, slashrsm: Add configuration for hard and soft...

Status: Fixed » Closed (fixed)

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