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

GH-83: Callout Plugin #324

Merged
merged 32 commits into from
Sep 30, 2021
Merged

GH-83: Callout Plugin #324

merged 32 commits into from
Sep 30, 2021

Conversation

wesleyboar
Copy link
Member

@wesleyboar wesleyboar commented Aug 23, 2021

To Do (Done)

Overview / Issues

Changes

  • Doc: Add relevant guides for plugin authors.
  • New: Create plugin for UI component.
  • New: Add module script to (optionally) resize plugin's image.

Screenshots

Form
Plugin Image
Callout GH-83 Form - Callout
> Image GH-83 Form - Image
> Link N/A, embedded within "Callout" form
Render
576px (i.e. <768px) 768px (i.e. <992px) 992px (i.e. <1200px)
GH-83 576px GH-83 768px GH-83 992px

TACC: Shared UI - Constants - Breakpoints

Structure

GH-83 Structure

The "Style" elements are a necessary evil until I create Section plugin (GH-91).

Testing

  1. If no environment, then prepare to test CMS changes.
  2. In CMS container, run python3 manage.py migrate.
  3. On CMS website, logged in as admin, add "TACC Site" > "Callout" plugin.
  4. Ensure the following:
    1. Title and Description are required.
    2. Title and Description appears.
    3. Image instructions are accurate.
    4. Styles match those of the callout at the bottom of the designs:
    5. Image shorter than text can be resized with "Advanced settings" field "Resize image to fit".
    6. Image taller than text can be resized with "Advanced settings" field "Resize image to fit".

Notes

Known Issues

There are many edge cases and better ways, but none seem to be a requirement.

  1. Callout Plugin - Fix Image Resize Caveat #327

  2. Callout Plugin - Require & Integrate Image #328

  3. (fixed with hack) Element Transform Fails on Child Plugin Markup w/out Hack #320

  4. Callout Plugin - Crop Images within Ratio #329

  5. There is not support for edits to text to change all instances (as #83 description directs).

    Direction
    Design wants changing the text of this to affect all instances[...]

    Reference
    This is currently used on [multiple] sections for Frontera, but Design said (in Jan 2021) it will likely be in just one location.

    — as of 2021-09-09

See https://github.com/TACC/Core-CMS/projects/8 for more (if I have not updated the list above).

Undecided UI

  1. Horizontal Alignment for Narrow Images

    Left (…figure { align-self: center }) Center (…figure { place-self: center })
    GH-83 Narrow Image Align Left GH-83 Narrow Image Align Center

    Images are vertically aligned center (because design did not complain when viewing samples).

Requires new `x-article-link-active` mixin.

The reason 0003 is added, not 0002, is cuz extending branch added 0002:
- site/frontera/task/GH-83-callout-element--GH-321-resize-callout-image
(there, the 0003 migration has 0002 as a dependency)
(here, the 0003 migration has 0001 as a dependency)

When a proper main-extending branch is made, this should still happen:
- task/GH-83-callout-element--GH-321-resize-callout-image
- task/GH-321-resize-callout-image
(there, the 0003 migration will have ??? as a dependency)

Good luck, Wes.
CAVEAT: The addition to 0001 migration was manual  and is untested.
- Add helper to get a model name.
- Simplify user instruction for fixing caveat.
- Do not allow normal user to check resize field.
- Hide field and caveat details in "Advanced settings".
- Default resize field to false.
The plugin may require a link and should require an image (GH-328)…

But the styles (and template) work fine without either.
- Update comments for clarity and accuracy and scope.
- Update equality that was not explicit enough.
Copy link
Member Author

@wesleyboar wesleyboar left a comment

Choose a reason for hiding this comment

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

Added notes for reviewers.

@wesleyboar wesleyboar marked this pull request as ready for review August 24, 2021 19:08
@wesleyboar wesleyboar changed the title GH-83: Callout Component GH-83: Callout Plugin Aug 24, 2021
@wesleyboar wesleyboar linked an issue Aug 24, 2021 that may be closed by this pull request
@wesleyboar wesleyboar requested a review from duckonomy August 25, 2021 16:48
@wesleyboar wesleyboar added priority ▲ High priority priority ▲▲ Very high priority and removed priority ▲ High priority labels Sep 1, 2021
Copy link
Contributor

@duckonomy duckonomy left a comment

Choose a reason for hiding this comment

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

I was able to add the plugin and overall it made sense!

However, I wasn't able to get the image to load properly and test the options yet. Was able to run after restarting everything

wesleyboar and others added 4 commits September 14, 2021 18:23
The comment may be obvious knowledge learned by new python dev (me).

The comment also references code that is removed with this commit.
@wesleyboar
Copy link
Member Author

@duckonomy Two changes:

Copy link
Contributor

@duckonomy duckonomy left a comment

Choose a reason for hiding this comment

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

LGTM!

@wesleyboar wesleyboar merged commit b028b59 into main Sep 30, 2021
@wesleyboar wesleyboar deleted the task/GH-83-callout-element branch September 30, 2021 17:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
priority ▲▲ Very high priority
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Callout Plugin - Resize Image Height to Parent Height Callout Plugin
2 participants