Skip to content

Commit

Permalink
VACMS 19825 - Updated all operating status content-build templates (#…
Browse files Browse the repository at this point in the history
…2355)

* updated all operating status content-build templates
* operation_status_information.liquid was not used/imported
* slim alert if no fieldOperatingStatusMoreInfo
* margin and spacing
  • Loading branch information
eselkin authored Dec 4, 2024
1 parent bfb04af commit ab6655e
Show file tree
Hide file tree
Showing 8 changed files with 129 additions and 46 deletions.
24 changes: 22 additions & 2 deletions src/site/includes/operatingStatusFlagsLinks.drupal.liquid
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,35 @@
/>
</va-alert>
{% elsif fieldOperatingStatusFacility == 'limited' %}
<va-alert status="warning" slim visible>
<va-alert status="info" slim visible>
<va-link
class="vads-u-font-weight--bold operating-status-link"
href="{{ facilitySidebar.links.0.url.path }}/operating-status"
text="Limited services and hours"
/>
</va-alert>
{% elsif fieldOperatingStatusFacility == 'temporary_closure' %}
<va-alert status="warning" slim visible>
<va-link class="vads-u-font-weight--bold operating-status-link"
href="{{ facilitySidebar.links.0.url.path }}/operating-status" text="Temporary facility closure" />
</va-alert>
{% elsif fieldOperatingStatusFacility == 'temporary_location' %}
<va-alert status="warning" slim visible>
<va-link class="vads-u-font-weight--bold operating-status-link"
href="{{ facilitySidebar.links.0.url.path }}/operating-status" text="Temporary location" />
</va-alert>
{% elsif fieldOperatingStatusFacility == 'virtual_care' %}
<va-alert status="warning" slim visible>
<va-link class="vads-u-font-weight--bold operating-status-link"
href="{{ facilitySidebar.links.0.url.path }}/operating-status" text="Virtual care only" />
</va-alert>
{% elsif fieldOperatingStatusFacility == 'coming_soon' %}
<va-alert status="warning" slim visible>
<va-link class="vads-u-font-weight--bold operating-status-link"
href="{{ facilitySidebar.links.0.url.path }}/operating-status" text="Coming soon" />
</va-alert>
{% elsif fieldOperatingStatusFacility == 'closed' %}
<va-alert status="error" slim visible>
<va-alert status="warning" slim visible>
<va-link
class="vads-u-font-weight--bold operating-status-link"
href="{{ facilitySidebar.links.0.url.path }}/operating-status"
Expand Down
31 changes: 28 additions & 3 deletions src/site/includes/operating_status_expandable_alert.liquid
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,26 @@
{% endif %}
{% case fieldOperatingStatusFacility %}
{% when 'limited' %}
{% assign status = "warning" %}
{% assign status = "info" %}
{% assign trigger = "Limited services and hours" %}
{% when 'closed' %}
{% assign status = "error" %}
{% assign status = "warning" %}
{% assign trigger = "Facility Closed" %}
{% when 'notice' %}
{% assign status = "info" %}
{% assign trigger = "Facility notice" %}
{% when 'temporary_closure' %}
{% assign status = "warning" %}
{% assign trigger = "Temporary facility closure" %}
{% when 'temporary_location' %}
{% assign status = "warning" %}
{% assign trigger = "Temporary location" %}
{% when 'virtual_care' %}
{% assign status = "warning" %}
{% assign trigger = "Virtual care only" %}
{% when 'coming_soon' %}
{% assign status = "warning" %}
{% assign trigger = "Coming soon" %}
{% endcase %}
{% if status and fieldOperatingStatusMoreInfo and fieldOperatingStatusMoreInfo != blank %}
<div class="vads-u-margin-bottom--1">
Expand All @@ -25,8 +37,21 @@
class="vads-u-margin-y--0 vamc-facility-expandable-alert"
style="max-width: 303px;"
>
<p>{{ fieldOperatingStatusMoreInfo | drupalToVaPath | phoneLinks | newline_to_br }}</p>
<p>{{ fieldOperatingStatusMoreInfo | drupalToVaPath | phoneLinks | newline_to_br }}</p>
</va-alert-expandable>
</div>
{% elsif status %}
<div class="vads-u-margin-bottom--1">
<va-alert
id="operating-status-nonexp-{{ operatingStatusId }}"
data-testid="operating-status-nonexp-{{ operatingStatusId }}"
status="{{ status }}"
class="vads-u-margin-y--0"
slim
style="max-width: 303px;"
>
<p class="vads-u-margin-y--0 vads-u-padding-y--0 vads-u-font-weight--bold">{{ trigger }}</p>
</va-alert>
</div>
{% endif %}
{% endif %}
19 changes: 0 additions & 19 deletions src/site/includes/operation_status_information.liquid

This file was deleted.

50 changes: 39 additions & 11 deletions src/site/includes/vba_facilities/expandable_alert.liquid
Original file line number Diff line number Diff line change
Expand Up @@ -7,24 +7,52 @@
{% elsif fieldOperatingStatusFacility == 'limited' %}
{% assign showVBAExpandableAlert = true %}
{% assign VBAExpandableAlertTrigger = 'Limited services and hours' %}
{% assign VBAExpandableAlertStatus = 'warning' %}
{% assign VBAExpandableAlertStatus = 'info' %}
{% elsif fieldOperatingStatusFacility == 'closed' %}
{% assign showVBAExpandableAlert = true %}
{% assign VBAExpandableAlertTrigger = 'Facility Closed' %}
{% assign VBAExpandableAlertStatus = 'error' %}
{% assign VBAExpandableAlertStatus = 'warning' %}
{% elsif fieldOperatingStatusFacility == 'temporary_closure' %}
{% assign showVBAExpandableAlert = true %}
{% assign VBAExpandableAlertTrigger = 'Temporary facility closure' %}
{% assign VBAExpandableAlertStatus = 'warning' %}
{% elsif fieldOperatingStatusFacility == 'temporary_location' %}
{% assign showVBAExpandableAlert = true %}
{% assign VBAExpandableAlertTrigger = 'Temporary location' %}
{% assign VBAExpandableAlertStatus = 'warning' %}
{% elsif fieldOperatingStatusFacility == 'virtual_care' %}
{% assign showVBAExpandableAlert = true %}
{% assign VBAExpandableAlertTrigger = 'Virtual care only' %}
{% assign VBAExpandableAlertStatus = 'warning' %}
{% elsif fieldOperatingStatusFacility == 'coming_soon' %}
{% assign showVBAExpandableAlert = true %}
{% assign VBAExpandableAlertTrigger = 'Coming soon' %}
{% assign VBAExpandableAlertStatus = 'warning' %}
{% endif %}

{% if showVBAExpandableAlert %}
<va-alert-expandable
data-template="components/vba_facilities/expandable-alert.drupal.liquid"
class="vads-u-margin-top--0 vads-u-margin-bottom--0 vamc-facility-expandable-alert"
status="{{ VBAExpandableAlertStatus }}"
trigger="{{ VBAExpandableAlertTrigger }}"
>
<div>
<div class="vads-u-display--inline-block vads-u-margin-bottom--2">
{% if fieldOperatingStatusMoreInfo and fieldOperatingStatusMoreInfo != blank %}
<va-alert-expandable
trigger="{{ VBAExpandableAlertTrigger }}"
data-template="components/vba_facilities/expandable-alert.drupal.liquid"
class="vads-u-margin-top--0 vads-u-margin-bottom--0 vamc-facility-expandable-alert"
status="{{ VBAExpandableAlertStatus }}"
style="max-width: 303px;"
>
<p>
{{ fieldOperatingStatusMoreInfo | newline_to_br | phoneLinks }}
</p>
</div>
</va-alert-expandable>
</va-alert-expandable>
{% else %}
<va-alert
slim
status="{{ VBAExpandableAlertStatus }}"
class="vads-u-margin-y--0"
style="max-width: 303px;"
>
<p class="vads-u-margin-y--0 vads-u-padding-y--0 vads-u-font-weight--bold">{{ VBAExpandableAlertTrigger }}</p>
</va-alert>
{% endif %}
</div>
{% endif %}
24 changes: 22 additions & 2 deletions src/site/layouts/health_care_facility_status.drupal.liquid
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,33 @@
{% if office.fieldOperatingStatusFacility == 'normal' %}
Normal services and hours
{% elsif office.fieldOperatingStatusFacility == 'limited' %}
<va-alert slim="true" status="warning">
<va-alert slim="true" status="info">
Limited services and hours
</va-alert>
{% elsif office.fieldOperatingStatusFacility == 'closed' %}
<va-alert slim="true" status="error">
<va-alert slim="true" status="warning">
Facility closed
</va-alert>
{% elsif office.fieldOperatingStatusFacility == 'notice' %}
<va-alert slim="true" status="info">
Facility notice
</va-alert>
{% elsif office.fieldOperatingStatusFacility == 'temporary_closure' %}
<va-alert slim="true" status="warning">
Temporary facility closure
</va-alert>
{% elsif office.fieldOperatingStatusFacility == 'temporary_location' %}
<va-alert slim="true" status="warning">
Temporary location
</va-alert>
{% elsif office.fieldOperatingStatusFacility == 'virtual_care' %}
<va-alert slim="true" status="warning">
Virtual care only
</va-alert>
{% elsif office.fieldOperatingStatusFacility == 'coming_soon' %}
<va-alert slim="true" status="warning">
Coming soon
</va-alert>
{% endif %}
{% endfor %}
</section>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,9 @@ describe('Vet Center Locations Operating Status', () => {
);
const operatingStatus = queryAllByTestId(
rendered,
'operating-status-vc_5141OS',
'operating-status-nonexp-vc_5141OS',
);
expect(operatingStatus).to.be.empty;
expect(operatingStatus).to.have.lengthOf(1);
});

it('should render a limited operating status when has status and more info', async () => {
Expand Down
17 changes: 15 additions & 2 deletions src/site/layouts/vamc_operating_status_and_alerts.drupal.liquid
Original file line number Diff line number Diff line change
Expand Up @@ -68,12 +68,25 @@
</span>

{% elsif status.entity.fieldOperatingStatusFacility == 'limited' %}
<va-alert slim status="warning" visible>Limited services and hours</va-alert>
<va-alert slim status="info" visible>Limited services and hours</va-alert>

{% elsif status.entity.fieldOperatingStatusFacility == 'closed' %}
<va-alert slim status="error" visible>Facility Closed</va-alert>
<va-alert slim status="warning" visible>Facility Closed</va-alert>

{% elsif status.entity.fieldOperatingStatusFacility == 'temporary_closure' %}
<va-alert slim status="warning" visible>Temporary facility closure</va-alert>

{% elsif status.entity.fieldOperatingStatusFacility == 'temporary_location' %}
<va-alert slim status="warning" visible>Temporary location</va-alert>

{% elsif status.entity.fieldOperatingStatusFacility == 'virtual_care' %}
<va-alert slim status="warning" visible>Virtual care only</va-alert>

{% elsif status.entity.fieldOperatingStatusFacility == 'coming_soon' %}
<va-alert slim status="warning" visible>Coming soon</va-alert>
{% endif %}


{% if status.entity.fieldOperatingStatusMoreInfo and status.entity.fieldOperatingStatusFacility != 'normal' %}
<div class="vads-u-margin-top--1p5">
{{ status.entity.fieldOperatingStatusMoreInfo }}
Expand Down
6 changes: 1 addition & 5 deletions src/site/layouts/vba_facility.drupal.liquid
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,7 @@
<div>
<div>

{% if fieldOperatingStatusMoreInfo and fieldOperatingStatusFacility and fieldOperatingStatusFacility != 'normal' %}
<div class="vads-u-display--inline-block vads-u-margin-bottom--1">
{% include "src/site/includes/vba_facilities/expandable_alert.liquid" %}
</div>
{% endif %}
{% include "src/site/includes/vba_facilities/expandable_alert.liquid" %}

<section>
<script type="application/ld+json">
Expand Down

0 comments on commit ab6655e

Please sign in to comment.