Skip to content

Commit

Permalink
Remove the Preview build-type (#9112)
Browse files Browse the repository at this point in the history
* Remove references to preview

* Remove preview from environments

* Additional cleanup of Vets.gov envs

* Revert now

* Revert "Revert now"

This reverts commit 8428a43.
  • Loading branch information
ncksllvn committed Nov 14, 2018
1 parent 238ca23 commit 6423d32
Show file tree
Hide file tree
Showing 13 changed files with 8 additions and 99 deletions.
1 change: 0 additions & 1 deletion Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ VETSGOV_BUILDTYPES = [
]

VAGOV_BUILDTYPES = [
'preview',
'vagovdev',
'vagovstaging',
'vagovprod'
Expand Down
14 changes: 0 additions & 14 deletions assets/js/foresee/preview.js

This file was deleted.

14 changes: 0 additions & 14 deletions assets/js/foresee/production.js

This file was deleted.

14 changes: 0 additions & 14 deletions assets/js/foresee/staging.js

This file was deleted.

21 changes: 3 additions & 18 deletions config/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ const configGenerator = (options, apps) => {
{
loader: 'css-loader',
options: {
minimize: ['production', 'staging', 'preview'].includes(
minimize: ['vagovprod', 'vagovstaging'].includes(
options.buildtype,
),
},
Expand Down Expand Up @@ -200,33 +200,18 @@ const configGenerator = (options, apps) => {
],
};

if (
['production', 'staging', 'preview', 'vagovstaging', 'vagovprod'].includes(
options.buildtype,
)
) {
if (['vagovstaging', 'vagovprod'].includes(options.buildtype)) {
let sourceMap = null;

switch (options.buildtype) {
case 'production':
sourceMap = 'https://s3-us-gov-west-1.amazonaws.com/www.vets.gov';
break;

case 'staging':
sourceMap = 'https://s3-us-gov-west-1.amazonaws.com/staging.vets.gov';
break;

case 'vagovstaging':
sourceMap = 'https://s3-us-gov-west-1.amazonaws.com/staging.va.gov';
break;

case 'vagovprod':
default:
sourceMap = 'https://s3-us-gov-west-1.amazonaws.com/www.va.gov';
break;

case 'preview':
default:
sourceMap = 'https://s3-us-gov-west-1.amazonaws.com/preview.va.gov';
}

baseConfig.plugins.push(
Expand Down
1 change: 0 additions & 1 deletion script/constants/environments.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,4 @@ module.exports = {
VAGOVDEV: 'vagovdev',
VAGOVSTAGING: 'vagovstaging',
VAGOVPROD: 'vagovprod',
PREVIEW: 'preview',
};
2 changes: 1 addition & 1 deletion src/platform/monitoring/frontend-metrics/feature-flag.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* @module platform/monitoring/frontend-metrics/feature-flag
*/
export default function isMetricsEnabled() {
const environments = ['vagovdev', 'vagovstaging', 'vagovprod', 'preview'];
const environments = ['vagovdev', 'vagovstaging', 'vagovprod'];

return !!environments.includes(__BUILDTYPE__);
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,10 @@ export default class VAPlusVetsModal extends React.Component {
static isEnabled() {
if (!brandConsolidation.isEnabled()) return false;

if (__BUILDTYPE__ === 'preview') return false;

let wasRedirectedFromVets = /^https:\/\/((dev|staging|www)\.)?vets\.gov/.test(
const wasRedirectedFromVets = /^https:\/\/((dev|staging|www)\.)?vets\.gov/.test(
document.referrer,
);

// Allow an override on the URL to force the Onboarding Modal to appear for testing purposes.
if (__BUILDTYPE__ !== 'preview' && !wasRedirectedFromVets) {
wasRedirectedFromVets = window.location.search.includes(
'onboarding-modal',
);
}

return wasRedirectedFromVets;
}

Expand Down
6 changes: 0 additions & 6 deletions src/platform/utilities/environment/isProduction.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,4 @@
const prodEnvironments = [
// www.vets.gov
'production',

// preview.va.gov
'preview',

// www.va.gov
'vagovprod',
];
Expand Down
4 changes: 0 additions & 4 deletions src/platform/utilities/environment/stagingDomains.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,6 @@ if (__BUILDTYPE__.includes('staging')) {
currentEnv = 'staging';
}

if (__BUILDTYPE__ === 'preview') {
currentEnv = 'preview';
}

if (__BUILDTYPE__ === 'production' || __BUILDTYPE__ === 'vagovprod') {
currentEnv = 'www';
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,10 @@ import { expect } from 'chai';
import { replaceDomainsInData } from '../../environment/stagingDomains';

let currentEnv = '';
if (
global.__BUILDTYPE__.includes('staging') ||
global.__BUILDTYPE__ === 'preview'
) {
if (global.__BUILDTYPE__.includes('staging')) {
currentEnv = 'https://staging.va.gov';
}
if (['production', 'vagovprod'].includes(global.__BUILDTYPE__)) {
if (['vagovprod'].includes(global.__BUILDTYPE__)) {
currentEnv = 'https://www.va.gov';
}

Expand Down
10 changes: 0 additions & 10 deletions va-gov/includes/header.html
Original file line number Diff line number Diff line change
Expand Up @@ -100,16 +100,6 @@
<body class="{{ body_class }} merger">
<a class="show-on-focus" href="#content">Skip to Content</a>

{% if buildtype == 'preview' %}
<div aria-live="polite" class="usa-alert usa-alert-info" style="margin: 0;">
<div class="usa-alert-body">
<h3 class="usa-alert-heading">You're viewing a preview of the new VA.gov</h3>
<p>We're building a new online experience to make it easier for Veterans to find, access, and manage the benefits they've earned. And we're building it with input from Veterans at every step. <b>Please note:</b> We work iteratively using agile development
practices, so you'll see new content, features, and functionality added to the site every day.</p>
</div>
</div>
{% endif %}

{% if !noHeader %}
{% include "va-gov/includes/top-nav.html" %}
{% endif %}
Expand Down
2 changes: 1 addition & 1 deletion va-gov/includes/survey-tools.html
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{% if buildtype == 'vagovprod' or buildtype == 'vagovstaging' or buildtype == 'preview' %}
{% if buildtype == 'vagovprod' or buildtype == 'vagovstaging' %}
<script type="text/javascript" src="/js/foresee/{{ buildtype }}.js"></script>
{% endif %}

0 comments on commit 6423d32

Please sign in to comment.