Skip to content

Commit

Permalink
8699 enabled maintenance banners
Browse files Browse the repository at this point in the history
  • Loading branch information
horatiorosa committed May 31, 2022
1 parent 56dee22 commit 8cabb7b
Show file tree
Hide file tree
Showing 5 changed files with 38 additions and 7 deletions.
5 changes: 3 additions & 2 deletions client/app/components/auth/login-dialog.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import Component from '@ember/component';
import { computed } from '@ember/object';
import ENV from 'labs-zap-search/config/environment';

/* eslint-disable no-unused-vars */
const MAINTENANCE_RANGE = ENV.maintenanceTimes;

export default Component.extend({
Expand All @@ -14,9 +15,9 @@ export default Component.extend({
}),

hasUpcomingMaintenance: computed(function() {
const [, end] = MAINTENANCE_RANGE.map(string => new Date(string));
const [start, end] = MAINTENANCE_RANGE.map(string => new Date(string));
const now = new Date();

return now < end;
return now < start;
}),
});
9 changes: 9 additions & 0 deletions client/app/styles/modules/_m-modal-controls.scss
Original file line number Diff line number Diff line change
Expand Up @@ -96,3 +96,12 @@
padding-left: 8px;
}
}

// maintenance notice
.maintenance-wrapper {
background-color: #E5E5E5;

p {
padding: 3px 5px 0 5px;
}
}
15 changes: 14 additions & 1 deletion client/app/templates/components/auth/login-dialog.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,20 @@
<p>Once you're signed in, you'll be redirected back here, where you'll see your list of assigned projects.</p>

{{#if this.hasUpcomingMaintenance}}
<h1>Please note: This portal will be down for 24 hours of system maintenance starting Monday, June 28 at 7PM.</h1>
<div class="maintenance-wrapper">
<p>
Please be advised that there will be scheduled maintenance on ZAP Search and the Applicant Portal from June 2, 2022, 3:00 pm to June 2, 2022, 4:00 pm. During that time, you will not be able to sign in to your account. Thank you for your understanding. For help, please email <a href="mailto:[email protected]">[email protected]</a>
</p>
</div>

{{/if}}

{{#if this.isMaintenancePeriod}}
<div class="maintenance-wrapper">
<p>
Please be advised that we are currently performing scheduled maintenance from June 2, 2022, 3:00 pm to June 2, 2022, 4:00 pm. During this time, you will not be able to sign in to your account. Thank you for your understanding. For help, please email <a href="mailto:[email protected]">[email protected]</a>
</p>
</div>
{{/if}}

<a
Expand Down
4 changes: 2 additions & 2 deletions client/config/environment.js
Original file line number Diff line number Diff line change
Expand Up @@ -157,8 +157,8 @@ function getHost(environment) {

function getMaintenanceTimes() {
const {
MAINTENANCE_START = '01/01/01 00:00',
MAINTENANCE_END = '01/01/01 00:00',
MAINTENANCE_START = '06/02/22 11:30',
MAINTENANCE_END = '06/02/22 13:45',
} = process.env;

return [MAINTENANCE_START, MAINTENANCE_END];
Expand Down
12 changes: 10 additions & 2 deletions netlify.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,15 @@
command = "yarn build --environment=production"

[context.develop]
environment = { HOST ="https://zap-api-staging.herokuapp.com", NYCID_CLIENT_ID="lup-portal-staging", NYC_ID_HOST="https://accounts-nonprd.nyc.gov/account" }
environment = { HOST="https://zap-api-staging.herokuapp.com", NYCID_CLIENT_ID="lup-portal-staging", NYC_ID_HOST="https://accounts-nonprd.nyc.gov/account", MAINTENANCE_START='06/02/22 15:00', MAINTENANCE_END='06/02/22 16:00' }

[context.master]
environment = { HOST ="https://zap-api-production.herokuapp.com", NYCID_CLIENT_ID="lup-portal-production", NYC_ID_HOST="https://www1.nyc.gov/account" }
environment = { HOST="https://zap-api-production.herokuapp.com", NYCID_CLIENT_ID="lup-portal-production", NYC_ID_HOST="https://www1.nyc.gov/account", MAINTENANCE_START='06/02/22 15:00', MAINTENANCE_END='06/02/22 16:00' }

# qa team
[context.qa]
environment = { HOST="https://zap-api-staging.herokuapp.com", NYCID_CLIENT_ID="lup-portal-staging", NYC_ID_HOST="https://accounts-nonprd.nyc.gov/account", MAINTENANCE_START='06/02/22 15:00', MAINTENANCE_END='06/02/22 16:00' }

# deploy-preview
[context.deploy-preview]
environment = { HOST="https://zap-api-staging.herokuapp.com", NYCID_CLIENT_ID="lup-portal-staging", NYC_ID_HOST="https://accounts-nonprd.nyc.gov/account", MAINTENANCE_START='06/02/22 15:00', MAINTENANCE_END='06/02/22 16:00' }

0 comments on commit 8cabb7b

Please sign in to comment.