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

VACMS-14700: Adds banner to VBA Facility #16076

Merged
merged 18 commits into from
Nov 20, 2023
Merged

VACMS-14700: Adds banner to VBA Facility #16076

merged 18 commits into from
Nov 20, 2023

Conversation

omahane
Copy link
Contributor

@omahane omahane commented Nov 9, 2023

Description

Relates to #14700

Testing done

Manually

QA Steps

Node:edit when banner is not enabled

Screenshot 2023-11-15 at 8 07 32 AM
As [email protected], edit Cheyenne VA Regional Benefit Office.

  • Confirm that Display a banner alert on this facility is not checked
  • Confirm that the Display a banner alert on this facility is the only form element showing
  • Save the node

Node:view when banner is not enabled

  • Confirm that "Display a banner alert on this facility" is set to "Off"

Screenshot 2023-11-15 at 8 09 50 AM

Node:edit when banner is enabled

  • Edit Cheyenne VA Regional Benefit Office
  • Check "Display a banner alert on this facility"
  • Confirm that the following fields show as required
    • Banner type
    • Dismissible by user?
    • Banner title
    • Banner content
Screenshot 2023-11-15 at 8 17 08 AM

Set no fields

  • Save the node
  • Confirm that Banner title throws a validation error "Fill out this field" before saving

Screenshot 2023-11-15 at 8 21 37 AM

Set the Banner title only

  • Add "Test title" to Banner title
  • Save the node
  • Confirm that the following message appears on the top of the page: "1 error has been found: Display a banner alert on this facility"
  • Confirm that the following message appears under Display a banner alert on this facility: "Banner type, Dismissible by user?, Banner content must not be empty when 'Display a banner alert on this facility' is checked."

Screenshot 2023-11-15 at 8 27 57 AM
Screenshot 2023-11-15 at 8 28 17 AM

Set the Banner type

  • Select "Information" in the banner type
  • Save the node
  • Confirm that the following message appears on the top of the page: "1 error has been found: Display a banner alert on this facility"
  • Confirm that the following message appears under Display a banner alert on this facility: "Dismissible by user?, Banner content must not be empty when 'Display a banner alert on this facility' is checked."

Set Dismissible by user?

  • Select "Allow site visitors to dismiss banner" in set Dismissible by user?
  • Save the node
  • Confirm that the following message appears on the top of the page: " 1 error has been found: Banner content"
  • Confirm that the following message appears under Banner content: "Banner content must not be empty when 'Display a banner alert on this facility' is checked."

Set Banner content

  • Add "Test content" to Banner content
  • Save the node
  • Confirm that the node saves

Node:view when banner is enabled

Screenshot 2023-11-15 at 8 51 00 AM
  • Confirm that "Display a banner alert on this facility" is on
  • Confirm that all banner fields are displaying

Node:view when banner is turned off again

  • Edit the node
  • Uncheck Display a banner alert on this facility
  • Save the node
  • Confirm that confirm that "Display a banner alert on this facility" is set to "Off" in node:view
  • Confirm that no banner fields show

Node:edit after banner has been turned off

  • Edit the node
  • Confirm that Display a banner alert on this facility is unchecked
  • Check Display a banner alert on this facility
  • Confirm that the other banner fields are not set

Definition of Done

  • Documentation has been updated, if applicable.
  • Tests have been added if necessary.
  • Automated tests have passed.
  • Code Quality Tests have passed.
  • Acceptance Criteria in related issue are met.
  • Manual Code Review Approved.
  • If there are field changes, front end output has been thoroughly checked.

Select Team for PR review

  • CMS Team
  • Public websites
  • Facilities
  • User support
  • Accelerated Publishing

@omahane omahane requested a review from a team as a code owner November 9, 2023 14:15
@va-cms-bot va-cms-bot temporarily deployed to Tugboat November 9, 2023 14:15 Destroyed
@github-actions github-actions bot changed the title Vacms 14700 vba banner VACMS-14700: vba banner Nov 9, 2023
Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

@va-cms-bot va-cms-bot temporarily deployed to Tugboat November 9, 2023 16:34 Destroyed
@va-cms-bot va-cms-bot temporarily deployed to Tugboat November 9, 2023 16:56 Destroyed
@omahane omahane force-pushed the VACMS-14700-vba-banner branch from b724d4f to b3eae90 Compare November 9, 2023 18:06
@va-cms-bot va-cms-bot temporarily deployed to Tugboat November 9, 2023 18:07 Destroyed
@omahane
Copy link
Contributor Author

omahane commented Nov 9, 2023

@davidmpickett Could you take a look at this and see what I might want to change before really tightening down the code? I created a user [email protected] who should best imitate an editor.

@va-cms-bot va-cms-bot temporarily deployed to Tugboat November 9, 2023 19:17 Destroyed
@va-cms-bot va-cms-bot temporarily deployed to Tugboat November 13, 2023 14:01 Destroyed
@omahane omahane force-pushed the VACMS-14700-vba-banner branch from 4d1e93d to 0273ee7 Compare November 13, 2023 21:15
@va-cms-bot va-cms-bot temporarily deployed to Tugboat November 13, 2023 21:15 Destroyed
@va-cms-bot va-cms-bot temporarily deployed to Tugboat November 13, 2023 21:46 Destroyed
@omahane omahane changed the title VACMS-14700: vba banner VACMS-14700: Adds banner to VBA Facility Nov 13, 2023
@va-cms-bot va-cms-bot temporarily deployed to Tugboat November 14, 2023 21:33 Destroyed
@va-cms-bot va-cms-bot temporarily deployed to Tugboat November 15, 2023 07:28 Destroyed
@github-actions github-actions bot added the Facilities Facilities products (VAMC, Vet Center, etc) label Nov 15, 2023
@va-cms-bot va-cms-bot temporarily deployed to Tugboat November 15, 2023 13:47 Destroyed
@omahane omahane force-pushed the VACMS-14700-vba-banner branch from e3cf721 to 5e56050 Compare November 15, 2023 13:51
@va-cms-bot va-cms-bot temporarily deployed to Tugboat November 15, 2023 13:51 Destroyed
@omahane omahane requested a review from swirtSJW November 15, 2023 14:57
Copy link
Contributor

@swirtSJW swirtSJW left a comment

Choose a reason for hiding this comment

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

This is looking quite good. I am still testing, but here are thoughts and questions from code review.

region: content
parent_name: ''
weight: 2
format_type: detailswithimage
Copy link
Contributor

Choose a reason for hiding this comment

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

Are we going to do an image?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I am not sure. We use this format_type in the CLP. I imagine that it would be useful. I wan't going to worry about putting one in now, though, but this way we can post-MVP.

Copy link
Contributor

Choose a reason for hiding this comment

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

Makes sense. Might want to spin up a ticket to reminder us.

$empty_fields[] = $entity->get('field_dismissible_option')->getFieldDefinition()->getLabel();
$field_error_path[] = 'field_dismissible_option';
}
if (empty(trim($entity->get('field_banner_title')->value))) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Nicely done adding the trim().


if (!empty($empty_fields)) {
if (count($field_error_path) > 1) {
// Multiple errors should go on the checkbox.
Copy link
Contributor

Choose a reason for hiding this comment

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

Nice!

@swirtSJW
Copy link
Contributor

swirtSJW commented Nov 15, 2023

When there is an error that points to the checkbox, because there are multiple, the jump link does not work
image
The link points to
#edit-field-vba-banner-panel
but the id on the field is
id="edit-field-vba-banner-panel-value"

Edit: this is not the issue Nate has tried to fix. This is an actual issue that might be possible to correct by setting the error path differently.

@swirtSJW
Copy link
Contributor

swirtSJW commented Nov 15, 2023

The jumplink when the error is in the CKeditor is broken. This one is definitely a known issue and I created an upstream issue for it. I will find it an link it here when I do
image

Edit: here is the upstream issue We are using patch 6 currently, but it seems to not be working.

@omahane omahane force-pushed the VACMS-14700-vba-banner branch from 5e56050 to 33c2d32 Compare November 16, 2023 21:14
@omahane omahane force-pushed the VACMS-14700-vba-banner branch from 7b8ac99 to a43b906 Compare November 17, 2023 16:18
@va-cms-bot va-cms-bot temporarily deployed to Tugboat November 17, 2023 16:19 Destroyed
@swirtSJW swirtSJW force-pushed the VACMS-14700-vba-banner branch from a43b906 to ca22eaf Compare November 19, 2023 22:04
@va-cms-bot va-cms-bot temporarily deployed to Tugboat November 19, 2023 22:04 Destroyed
@swirtSJW
Copy link
Contributor

I just resolved the conflicts

@swirtSJW
Copy link
Contributor

swirtSJW commented Nov 19, 2023

I just created a drupal core issue for the error message jump link to the checkbox not working.
https://www.drupal.org/project/drupal/issues/3402684 which is separate from the existing ckeditor jumplink issue.

@swirtSJW
Copy link
Contributor

PHP unit failure was unrelated. Tied to Post API endpoint not found. (an outtage of LH sandbox)
image

@swirtSJW
Copy link
Contributor

I ran them by hand
image

image

All good.

@swirtSJW swirtSJW merged commit 1c8f7f6 into main Nov 20, 2023
14 checks passed
@swirtSJW swirtSJW deleted the VACMS-14700-vba-banner branch November 20, 2023 00:11
tjheffner pushed a commit that referenced this pull request Dec 6, 2023
* VACMS-14700: Adds config for banner fields

* VACMS-14700: Adds config for persistence

* VACMS-14700: Adds hiding and a little resetting on presave

* VACMS-14700: Hides and reveals fields. Adds constraint. Clears fields.

* VACMS-14700: Expands banner fieldset when checkbox is checked.

* VACMS-14700: Hides banner fields on node:view when not checked

* VACMS-14700: Adds config changes.

* VACMS-14700: Changes config and select list option

* VACMS-14700: Code cleanup

* VACMS-14700: Fixes a couple typos.

* VACMS-14700: Updates language after review. Updates code to remove errors in UI and testing.

* VACMS-14700: Removes  isset() as it always exists and is not nullable, per PHPStan.

* VACMS-14700: Adds full content validation.

* VACMS-14700: Removes N/A from dismissible, makes it show as required.

* VACMS-14700: Orders methods

* VACMS-14700: Makes dismissible not required.

* VACMS-14700: Updates name, per PR review

* VACMS-14700: Updates UI per Figma
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Facilities Facilities products (VAMC, Vet Center, etc)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants