From a846e2248df0df3a2b9957d2e7e4647a373a8bba Mon Sep 17 00:00:00 2001 From: David Hochbaum Date: Mon, 21 Oct 2024 15:37:18 -0400 Subject: [PATCH 1/6] Added info modal --- client/app/components/info-modal.js | 16 +++++++ client/app/styles/app.scss | 1 + client/app/styles/modules/_m-info-modal.scss | 42 +++++++++++++++++++ client/app/templates/application.hbs | 7 +++- .../app/templates/components/info-modal.hbs | 24 +++++++++++ 5 files changed, 89 insertions(+), 1 deletion(-) create mode 100644 client/app/components/info-modal.js create mode 100644 client/app/styles/modules/_m-info-modal.scss create mode 100644 client/app/templates/components/info-modal.hbs diff --git a/client/app/components/info-modal.js b/client/app/components/info-modal.js new file mode 100644 index 00000000..94a6c67f --- /dev/null +++ b/client/app/components/info-modal.js @@ -0,0 +1,16 @@ +import Component from '@ember/component'; +import { action } from '@ember/object'; + +export default class InfoModalComponent extends Component { + open = !window.localStorage.hideMessage; + + dontShowModalAgain = false; + + @action + closeModal() { + this.set('open', false); + if (this.dontShowModalAgain) { + window.localStorage.hideMessage = true; + } + } +} diff --git a/client/app/styles/app.scss b/client/app/styles/app.scss index 48395cbf..0ab8f05f 100644 --- a/client/app/styles/app.scss +++ b/client/app/styles/app.scss @@ -65,6 +65,7 @@ $completed-color: #a6cee3; @import 'modules/_m-noui'; @import 'modules/_m-project-filters'; @import 'modules/_m-reveal-modal'; +@import 'modules/_m-info-modal'; @import 'modules/_m-search'; @import 'modules/_m-site-header'; @import 'modules/_m-statuses'; diff --git a/client/app/styles/modules/_m-info-modal.scss b/client/app/styles/modules/_m-info-modal.scss new file mode 100644 index 00000000..2714cf18 --- /dev/null +++ b/client/app/styles/modules/_m-info-modal.scss @@ -0,0 +1,42 @@ +// -------------------------------------------------- +// Module: Info Modal +// -------------------------------------------------- + +#info-modal-container { + z-index: 3; +} + +.info-overlay { + padding: 1rem; + + @include breakpoint(medium) { + padding: 4rem 1rem; + position: absolute; + } +} + +.info-overlay-target { + position: absolute; + top: 0; + right: 0; + bottom: 0; + left: 0; +} + +.info-modal { + border: 3px solid $dcp-orange; + border-radius: 10px; + box-shadow: 0 0 0 rem-calc(4) rgba(0,0,0,0.1); + top: 30%; + background-color: $orange-white; + height: unset; + min-height: unset; + @include breakpoint(medium) { + height: unset; + padding: 4rem; + } + + &:focus { + outline: none; + } +} diff --git a/client/app/templates/application.hbs b/client/app/templates/application.hbs index 370909e9..dfaa08be 100644 --- a/client/app/templates/application.hbs +++ b/client/app/templates/application.hbs @@ -56,9 +56,14 @@ {{/if}} -
+
+{{#ember-wormhole to="info-modal-container"}} + {{info-modal}} +{{/ember-wormhole}} + + {{#if (string-includes currentRouteName "my-projects")}} {{else}} diff --git a/client/app/templates/components/info-modal.hbs b/client/app/templates/components/info-modal.hbs new file mode 100644 index 00000000..7b80dd40 --- /dev/null +++ b/client/app/templates/components/info-modal.hbs @@ -0,0 +1,24 @@ +{{#if open}} +
+
+ +
+{{/if}} From dee4a464bdc6accf85eeae5ef1ad7a823f367ace Mon Sep 17 00:00:00 2001 From: David Hochbaum Date: Tue, 22 Oct 2024 09:35:11 -0400 Subject: [PATCH 2/6] Fix for test failures --- client/app/templates/application.hbs | 4 +++- client/app/templates/components/info-modal.hbs | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/client/app/templates/application.hbs b/client/app/templates/application.hbs index dfaa08be..58d8cf52 100644 --- a/client/app/templates/application.hbs +++ b/client/app/templates/application.hbs @@ -56,9 +56,11 @@ {{/if}}
+
- +
+
{{#ember-wormhole to="info-modal-container"}} {{info-modal}} {{/ember-wormhole}} diff --git a/client/app/templates/components/info-modal.hbs b/client/app/templates/components/info-modal.hbs index 7b80dd40..b1dc9438 100644 --- a/client/app/templates/components/info-modal.hbs +++ b/client/app/templates/components/info-modal.hbs @@ -13,7 +13,7 @@ {{!-- Once the subscribe route exists, uncomment the row below and delete the row below that one --}} {{!--

Subscribe to ZAP Email notifications. Get updates about community district and citywide projects.

--}} -

Subscribe to ZAP Email notifications. Get updates about community district and citywide projects.

+

Subscribe to ZAP Email notifications. Get updates about community district and citywide projects.

{{input type="checkbox" checked=this.dontShowModalAgain}} Don't show this message again