Skip to content

Commit

Permalink
remove rhel and smart management when needed (#732)
Browse files Browse the repository at this point in the history
  • Loading branch information
ryelo authored Apr 8, 2020
1 parent 2055330 commit 8a21f40
Show file tree
Hide file tree
Showing 10 changed files with 2 additions and 31 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,6 @@ exports[`ConnectedInsightsAbout should render correctly with just username 1`] =
"routes": Array [],
"title": "Red Hat Openshift Cluster Manager",
},
"rhel": Object {
"id": "rhel",
"routes": Array [],
"title": "Cloud Management Services",
},
"staging": Object {
"id": "staging",
"routes": Array [],
Expand Down
10 changes: 0 additions & 10 deletions src/js/App/Sidenav/__snapshots__/Navigation.test.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,6 @@ exports[`ConnectedNavigation mapDispatchToProps function fires 1`] = `
"routes": Array [],
"title": "Red Hat Openshift Cluster Manager",
},
"rhel": Object {
"id": "rhel",
"routes": Array [],
"title": "Cloud Management Services",
},
"staging": Object {
"id": "staging",
"routes": Array [],
Expand Down Expand Up @@ -205,11 +200,6 @@ exports[`ConnectedNavigation should render correctly with initial state 1`] = `
"routes": Array [],
"title": "Red Hat Openshift Cluster Manager",
},
"rhel": Object {
"id": "rhel",
"routes": Array [],
"title": "Cloud Management Services",
},
"staging": Object {
"id": "staging",
"routes": Array [],
Expand Down
1 change: 0 additions & 1 deletion src/js/App/Sidenav/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import { HomeIcon } from '@patternfly/react-icons';
import { connect } from 'react-redux';

const documentationLink = {
rhel: 'https://access.redhat.com/documentation/en-us/cloud_management_services_for_red_hat_enterprise_linux/1.0/',
insights: 'https://access.redhat.com/documentation/en-us/red_hat_insights/',
openshift: 'https://docs.openshift.com/container-platform/latest/',
subscriptions: 'https://access.redhat.com/products/subscription-central',
Expand Down
2 changes: 1 addition & 1 deletion src/js/auth.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ function mockWindow(pathname) {

describe('Auth', () => {
describe('allowUnauthed', () => {
['/insights', '/insights/foo', '/rhel/dashboard',
['/insights', '/insights/foo', '/insights/dashboard',
'/cost-management', '/openshift/clusters', '/openshift'].map(t => {
test(`should not allow ${t}`, () => {
mockWindow(t);
Expand Down
2 changes: 0 additions & 2 deletions src/js/entry.js
Original file line number Diff line number Diff line change
Expand Up @@ -216,8 +216,6 @@ export function noAccess() {
const { store } = spinUpStore();
window.insights.chrome.auth.getUser().then(({ entitlements }) => {
if (!consts.allowedUnauthedPaths.includes(location.pathname)) {
// rhel has different entitlements key and URL partial
entitlements.rhel = entitlements.smart_management;
const path = location.pathname.split('/');
const apps = Object.keys(entitlements);

Expand Down
3 changes: 1 addition & 2 deletions src/js/jwt/insights/user.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ const utils = require('../../utils');
const log = require('../logger')('insights/user.js');
const servicesApi = require('./entitlements');
const pathMapper = {
rhel: 'smart_management',
'cost-management': 'cost_management',
insights: 'insights',
openshift: 'openshift',
Expand Down Expand Up @@ -46,7 +45,7 @@ function buildUser(token) {
function tryBounceIfUnentitled(data, section) {
// only test this on the apps that are in valid sections
// we need to keep /apps and other things functional
if (section !== 'insights' && section !== 'rhel' &&
if (section !== 'insights' &&
section !== 'openshift' && section !== 'cost-management' &&
section !== 'migrations' && section !== 'ansible' &&
section !== 'subscriptions' && section !== 'settings') {
Expand Down
1 change: 0 additions & 1 deletion src/js/jwt/insights/user.unit.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ describe('User', () => {
const tryBounceIfUnentitled = user.__get__('tryBounceIfUnentitled');
const ents = {
insights: { is_entitled: false },
smart_management: { is_entitled: false },
openshift: { is_entitled: false },
cost_management: { is_entitled: false }
};
Expand Down
3 changes: 0 additions & 3 deletions src/js/sentry.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,6 @@ function initSentry() {
case 'insights':
API_KEY = 'https://[email protected]/1484024';
break;
case 'rhel':
API_KEY = 'https://[email protected]/1484046';
break;
case 'landing':
API_KEY = 'https://[email protected]/1484026';
break;
Expand Down
1 change: 0 additions & 1 deletion src/js/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ export function pageAllowsUnentitled() {
export function pageRequiresAuthentication() {
const section = getSection();
if (section === 'insights' ||
section === 'rhel' ||
section === 'cost-management' ||
section === 'apps' ||
section === 'ansible' ||
Expand Down
5 changes: 0 additions & 5 deletions testdata/globalNav.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,6 @@
"routes": [],
"title": "Red Hat Openshift Cluster Manager"
},
"rhel": {
"id": "rhel",
"routes": [],
"title": "Cloud Management Services"
},
"staging": {
"id": "staging",
"routes": [],
Expand Down

0 comments on commit 8a21f40

Please sign in to comment.