Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue #3415665 by joshua1234511: Utilize Focal Point module #1242

Merged
merged 4 commits into from
May 7, 2024

Conversation

joshua-salsadigital
Copy link
Collaborator

@joshua-salsadigital joshua-salsadigital commented Apr 16, 2024

https://www.drupal.org/project/civictheme/issues/3415665

Checklist before requesting a review

  • I have formatted the subject to include ticket number as [CS-123] Verb in past tense with dot at the end.
  • I have added a link to the issue tracker
  • I have provided information in Changed section about WHY something was done if this was not a normal implementation
  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • I have added tests that prove my fix is effective or that my feature works
  • I have run new and existing relevant tests locally with my changes, and they passed
  • I have provided screenshots, where applicable

Changed

  1. Updated image styles to use Focal Point module with the same dimensions as currently set.
  2. Removed the current image actions.
  3. Exported configs as theme configs.
  4. Added a dependency on focal_point module in civictheme.info.yml file.
  5. Updated code to use existing image styles.

Screenshots

@joshua-salsadigital joshua-salsadigital self-assigned this Apr 16, 2024
@joshua-salsadigital joshua-salsadigital changed the title [3415665] Issue #3415665 by joshua1234511: Utilize Focal Point module Apr 16, 2024
/**
* Defines the image style constants.
*/
const PROMO_IMAGE_STYLE = 'civictheme_promo_card';
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@AlexSkrypnyk We need to decide on which style to be used for each type of cards.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@joshua-salsadigital
yep. we need to have an image style per component.

  1. Please use exact component names in variables PROMO_IMAGE_STYLE -> PROMO_CARD_IMAGE_STYLE etc.
  2. There should be a dedicated image style per constant below. If it does not exist -please create one. civictheme_thumbnail should not be used anymore - please asses all areas where it is used and replace with a specific named image style. The style values would be copied from the civictheme_thumbnail at this stage + focal point adjustments.
  3. Remove civictheme_thumbnail YAML from the config and create an update hook to remove it.

@joshua-salsadigital joshua-salsadigital force-pushed the feature/3415665-focul-point branch from 9f976ec to fd1c470 Compare April 16, 2024 17:01
*
* @Then I( should) see the :selector element with the :attribute attribute like :pattern
*/
public function elementAssertAttributeLikePattern(string $selector, string $attribute, string $pattern): void {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This does not need to check for the wildcard - it checks if the attribute contains a string.

Please update to

@Then I( should) see the :selector element with a(n) :attribute attribute containing :value

The method then will become elementAssertAttributeContains

Copy link
Contributor

@AlexSkrypnyk AlexSkrypnyk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@joshua-salsadigital
the PR looks good!

Please see my inline comments re tests and naming of the image styles.

@joshua-salsadigital joshua-salsadigital added the State: Needs review Pull requests needs a review from assigned developers label Apr 19, 2024
@AlexSkrypnyk AlexSkrypnyk merged commit 5a28aa2 into develop May 7, 2024
12 checks passed
@AlexSkrypnyk AlexSkrypnyk deleted the feature/3415665-focul-point branch May 7, 2024 00:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
State: Needs review Pull requests needs a review from assigned developers
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants