Skip to content

Commit

Permalink
ui: updating references to status.redhat.com (PROJQUAY-6654) (quay#2645)
Browse files Browse the repository at this point in the history
Updates references from `status.quay.io` to `status.redhat.com`.
  • Loading branch information
bcaton85 authored Feb 7, 2024
1 parent 0981ce1 commit df73b6e
Show file tree
Hide file tree
Showing 13 changed files with 513 additions and 10 deletions.
2 changes: 1 addition & 1 deletion static/directives/quay-service-status.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
<span class="quay-service-status-indicator" ng-class="indicator"
ng-if="indicator != 'loading'"></span>
<span class="cor-loader-inline" ng-if="indicator == 'loading'"></span>
<a href="http://status.quay.io" class="quay-service-status-description">{{ description }}</a>
<a href="https://status.redhat.com" class="quay-service-status-description">{{ description }}</a>
<span ng-if="degraded && degraded.length == 1" style="vertical-align: middle;">: {{ degraded[0].name }}</span>
</span>
2 changes: 1 addition & 1 deletion static/js/services/notification-service.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ function($rootScope, $interval, UserService, ApiService, StringBuilderService, P
'level': 'warning',
'message': 'We will be down for schedule maintenance from {from_date} to {to_date} ' +
'for {reason}. We are sorry about any inconvenience.',
'page': 'http://status.quay.io/'
'page': 'https://status.redhat.com'
},
'repo_push': {
'level': 'info',
Expand Down
54 changes: 50 additions & 4 deletions static/js/services/status-service.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,27 @@ angular.module('quay').factory('StatusService', ['Features', function(Features)
};
}

var STATUSPAGE_PAGE_ID = '8szqd6w4s277';
var STATUSPAGE_SRC = 'https://statuspage-production.s3.amazonaws.com/se-v2.js';
var STATUSPAGE_PAGE_ID = 'dn6mqn7xvzz3';
var STATUSPAGE_QUAY_ID = 'cllr1k2dzsf7';
var STATUSPAGE_SRC = 'https://cdn.statuspage.io/se-v2.js';
var statusToIndicator = {
operational: {
indicator: 'none',
description: 'All Systems Operational'
},
degraded_performance: {
indicator: 'minor',
description: 'Degraded Performance'
},
partial_outage: {
indicator: 'major',
description: 'Partial System Outage'
},
major_outage: {
indicator: 'critical',
description: 'Major Service Outage'
},
}
var statusPageHandler = null;
var statusPageData = null;
var callbacks = [];
Expand All @@ -18,8 +37,35 @@ angular.module('quay').factory('StatusService', ['Features', function(Features)
if (!data) { return; }
statusPageData = data;

const quayData = {status:{}};
const quayComponent = data.components.find((component) => component.id === STATUSPAGE_QUAY_ID);
if(!quayComponent) {return;}
const subComponentIds = quayComponent.components || [];

// incidents
const incidents = data.incidents.filter((incident) => {
return incident.components.some((component) => subComponentIds.includes(component.id));
});
quayData.incidents = incidents;

// components
const subComponents = data.components.filter((component) => subComponentIds.includes(component.id));
quayData.components = subComponents;

// scheduled_maintenances
const scheduledMaintenances = data.scheduled_maintenances.filter((scheduledMaintenance) => {
return scheduledMaintenance.components.some((component) => subComponentIds.includes(component.id));
});
quayData.scheduled_maintenances = scheduledMaintenances;

// status.indicator
quayData.status.indicator = statusToIndicator[quayComponent.status].indicator;

// status.description
quayData.status.description = statusToIndicator[quayComponent.status].description;

for (var i = 0; i < callbacks.length; ++i) {
callbacks[i](data);
callbacks[i](quayData);
}

callbacks = [];
Expand All @@ -39,4 +85,4 @@ angular.module('quay').factory('StatusService', ['Features', function(Features)
};

return statusService;
}]);
}]);
4 changes: 2 additions & 2 deletions templates/500.html
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@ <h4>
<span id="status-elem">(Loading)</span>
</div>

<script type="text/javascript" src="//statuspage-production.s3.amazonaws.com/se.js"></script>
<script type="text/javascript" src="https://cdn.statuspage.io/se.js"></script>
<script type="text/javascript">
window.fetchStatusPage({
pageId: '8szqd6w4s277',
pageId: 'dn6mqn7xvzz3',
renderTo: '#status-elem'
});
</script>
Expand Down
2 changes: 1 addition & 1 deletion web/.eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ module.exports = {
},
},
plugins: ['import', 'react', '@typescript-eslint', 'prettier'],
ignorePatterns: ['*.md', '**/*.css', '**/*.scss', '*.svg', '*.png'],
ignorePatterns: ['*.md', '**/*.css', '**/*.scss', '*.svg', '*.png', '*.html'],
rules: {
'react/react-in-jsx-scope': 'off',
'prettier/prettier': ['error'],
Expand Down
59 changes: 59 additions & 0 deletions web/cypress/e2e/service-status.cy.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
/// <reference types="cypress" />
import {formatDate} from '../../src/libs/utils';

describe('Default permissions page', () => {
beforeEach(() => {
cy.exec('npm run quay:seed');
cy.intercept('GET', '/config', {fixture: 'config.json'}).as('getConfig');
cy.request('GET', `${Cypress.env('REACT_QUAY_APP_API_URL')}/csrf_token`)
.then((response) => response.body.csrf_token)
.then((token) => {
cy.loginByCSRF(token);
});
});

it('Displays incidents and maintanences', () => {
cy.intercept(
'GET',
'https://dn6mqn7xvzz3.statuspage.io/api/v2/summary.json',
{fixture: 'registry-status.json'},
);
cy.visit('/organization/testorg');
cy.contains('incident1').should(
'have.attr',
'href',
'https://stspg.io/incident1',
);
cy.contains('incident2').should(
'have.attr',
'href',
'https://stspg.io/incident2',
);
cy.contains(`Scheduled for ${formatDate('2024-02-09T10:00:00.000-05:00')}`);
cy.contains('maintenance1').should(
'have.attr',
'href',
'https://stspg.io/maintenance1',
);
cy.contains('In progress:');
cy.contains('maintenance2').should(
'have.attr',
'href',
'https://stspg.io/maintenance2',
);
});

it('Displays no incidents and maintanences', () => {
cy.fixture('registry-status.json').then((statusFixture) => {
statusFixture.incidents = [];
statusFixture.scheduled_maintenances = [];
cy.intercept(
'GET',
'https://dn6mqn7xvzz3.statuspage.io/api/v2/summary.json',
statusFixture,
);
});
cy.visit('/organization/testorg');
cy.get('#registry-status').should('not.exist');
});
});
168 changes: 168 additions & 0 deletions web/cypress/fixtures/registry-status.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,168 @@
{
"page": {
"id": "dn6mqn7xvzz3",
"name": "Red Hat",
"url": "https://status.redhat.com",
"time_zone": "America/New_York",
"updated_at": "2024-02-06T12:27:50.519-05:00"
},
"components": [
{
"id": "cllr1k2dzsf7",
"name": "Quay.io",
"status": "major_outage",
"created_at": "2024-01-16T15:36:01.802-05:00",
"updated_at": "2024-01-16T16:57:38.322-05:00",
"position": 16,
"description": null,
"showcase": false,
"start_date": null,
"group_id": null,
"page_id": "dn6mqn7xvzz3",
"group": true,
"only_show_if_degraded": false,
"components": [
"m65lxn2nf6l0",
"6fb8zflt4fbt",
"fvnvxz75h3m2",
"02hhmtl31chv",
"4y37q0jspj5n"
]
},
{
"id": "m65lxn2nf6l0",
"name": "API",
"status": "major_outage",
"created_at": "2024-01-16T15:36:01.876-05:00",
"updated_at": "2024-01-16T15:36:01.876-05:00",
"position": 1,
"description": null,
"showcase": false,
"start_date": "2024-01-16",
"group_id": "cllr1k2dzsf7",
"page_id": "dn6mqn7xvzz3",
"group": false,
"only_show_if_degraded": false
},
{
"id": "6fb8zflt4fbt",
"name": "Build System",
"status": "partial_outage",
"created_at": "2024-01-16T15:38:09.519-05:00",
"updated_at": "2024-01-16T15:38:09.519-05:00",
"position": 2,
"description": null,
"showcase": false,
"start_date": "2024-01-16",
"group_id": "cllr1k2dzsf7",
"page_id": "dn6mqn7xvzz3",
"group": false,
"only_show_if_degraded": false
},
{
"id": "fvnvxz75h3m2",
"name": "Registry",
"status": "operational",
"created_at": "2024-01-16T15:38:30.060-05:00",
"updated_at": "2024-01-16T15:38:30.060-05:00",
"position": 3,
"description": null,
"showcase": false,
"start_date": "2024-01-16",
"group_id": "cllr1k2dzsf7",
"page_id": "dn6mqn7xvzz3",
"group": false,
"only_show_if_degraded": false
},
{
"id": "02hhmtl31chv",
"name": "Frontend",
"status": "operational",
"created_at": "2024-01-16T15:38:44.726-05:00",
"updated_at": "2024-01-16T15:38:44.726-05:00",
"position": 4,
"description": null,
"showcase": false,
"start_date": "2024-01-16",
"group_id": "cllr1k2dzsf7",
"page_id": "dn6mqn7xvzz3",
"group": false,
"only_show_if_degraded": false
},
{
"id": "4y37q0jspj5n",
"name": "Security Scanning",
"status": "operational",
"created_at": "2024-01-16T15:38:59.314-05:00",
"updated_at": "2024-01-16T15:38:59.314-05:00",
"position": 5,
"description": null,
"showcase": false,
"start_date": "2024-01-16",
"group_id": "cllr1k2dzsf7",
"page_id": "dn6mqn7xvzz3",
"group": false,
"only_show_if_degraded": false
}
],
"incidents": [
{
"name": "incident1",
"shortlink": "https://stspg.io/incident1",
"components": [
{
"id": "m65lxn2nf6l0"
},
{
"id": "6fb8zflt4fbt"
}
]
},
{
"name": "incident2",
"shortlink": "https://stspg.io/incident2",
"components": [
{
"id": "m65lxn2nf6l0"
},
{
"id": "6fb8zflt4fbt"
}
]
}
],
"scheduled_maintenances": [
{
"status": "scheduled",
"name": "maintenance1",
"shortlink": "https://stspg.io/maintenance1",
"components": [
{
"id": "m65lxn2nf6l0"
},
{
"id": "6fb8zflt4fbt"
}
],
"scheduled_for": "2024-02-09T10:00:00.000-05:00"
},
{
"name": "maintenance2",
"status": "in_progress",
"shortlink": "https://stspg.io/maintenance2",
"components": [
{
"id": "m65lxn2nf6l0"
},
{
"id": "6fb8zflt4fbt"
}
],
"scheduled_for": "2024-02-09T10:00:00.000-05:00"
}
],
"status": {
"indicator": "none",
"description": "All Systems Operational"
}
}
3 changes: 2 additions & 1 deletion web/src/components/errors/SiteUnavailableError.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ export default function SiteUnavailableError() {
<EmptyStateBody>
Try refreshing the page. If the problem persists, contact your
organization administrator or visit our{' '}
<a href="https://status.quay.io/">status page</a> for known outages.
<a href="https://status.redhat.com">status page</a> for known
outages.
</EmptyStateBody>
<EmptyStateFooter>
<Button title="Home" onClick={() => window.location.reload()}>
Expand Down
Loading

0 comments on commit df73b6e

Please sign in to comment.