Skip to content

Commit 1d66c29

Browse files
committedAug 17, 2023
[RHIF-209] Move app from /settings to /insights
1 parent 4ab001e commit 1d66c29

7 files changed

+13
-27
lines changed
 

‎README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ There is a [comprehensive quick start guide in the Storybook Documentation](http
1515
## Running locally
1616
1. Install dependencies with `npm install`
1717
2. Run development server with `npm run start:proxy:beta`
18-
3. Local version of the app will be available at https://stage.foo.redhat.com:1337/preview/settings/connector/
18+
3. Local version of the app will be available at https://stage.foo.redhat.com:1337/preview/insights/connector/
1919

2020
### Testing
2121

‎config/dev.webpack.config.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ const webpackProxy = {
1212
// localChrome: '/Users/rkaluzik/rh/insights-chrome/build/',
1313
env: `stage-${process.env.BETA ? 'beta' : 'stable'}`,
1414
appUrl: process.env.BETA
15-
? ['/beta/settings/connector', '/preview/settings/connector']
16-
: ['/settings/connector'],
15+
? ['/beta/insights/connector', '/preview/insights/connector']
16+
: ['/insights/connector'],
1717
// routes: {
1818
// '/apps/inventory': { host: 'http://stage.foo.redhat.com:8002' },
1919
// '/preview/config': {

‎deploy/frontend.yml

+5-5
Original file line numberDiff line numberDiff line change
@@ -10,32 +10,32 @@ objects:
1010
spec:
1111
envName: ${ENV_NAME}
1212
title: "Manage configuration"
13-
routePrefix: settings
13+
routePrefix: insights
1414
deploymentRepo: https://github.com/RedHatInsights/sed-frontend
1515
API:
1616
versions:
1717
- v1
1818
frontend:
1919
paths:
20-
- /settings/connector
20+
- /insights/connector
2121
image: ${IMAGE}:${IMAGE_TAG}
2222
navItems:
2323
- title: Remote Host Configuration
2424
expandable: true
2525
routes:
2626
- appId: connector
2727
title: Manage configuration
28-
href: /settings/connector
28+
href: /insights/connector
2929
- appId: connector
3030
title: Activation Keys
31-
href: /settings/connector/activation-keys
31+
href: /insights/connector/activation-keys
3232
module:
3333
manifestLocation: /apps/connector/fed-mods.json
3434
modules:
3535
- id: connector
3636
module: ./RootApp
3737
routes:
38-
- pathname: /settings/connector
38+
- pathname: /insights/connector
3939
moduleID: connector
4040
parameters:
4141
- name: ENV_NAME

‎profiles/local-frontend-and-api.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*global module*/
22

3-
const SECTION = 'settings';
3+
const SECTION = 'insights';
44
const APP_ID = 'connector';
55
const FRONTEND_PORT = 8002;
66
const API_PORT = 8888;

‎profiles/local-frontend-and-config.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
const SECTION = 'settings';
1+
const SECTION = 'insights';
22
const APP_ID = 'connector';
33
const FRONTEND_PORT = 8002;
44
const routes = {};

‎profiles/local-frontend.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
const SECTION = 'settings';
1+
const SECTION = 'insights';
22
const APP_ID = 'connector';
33
const FRONTEND_PORT = 8002;
44
const routes = {};

‎src/App.js

+2-16
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import React, { useEffect, useContext, useMemo } from 'react';
1+
import React, { useEffect, useContext } from 'react';
22
import { Routes } from './Routes';
33
import { QueryClient, QueryClientProvider } from 'react-query';
44
import NotificationsPortal from '@redhat-cloud-services/frontend-components-notifications/NotificationPortal';
@@ -29,26 +29,12 @@ const App = () => {
2929
getRegistry().register({ notifications: notificationsReducer });
3030
}, [getRegistry]);
3131

32-
const appNavClick = useMemo(
33-
() => ({
34-
settings(redirect) {
35-
chrome.appNavClick({ id: 'settings', redirect });
36-
},
37-
activationKeys(redirect) {
38-
chrome.appNavClick({ id: 'activationKeys', redirect });
39-
},
40-
}),
41-
[]
42-
);
43-
4432
useEffect(() => {
4533
chrome.identifyApp('connector');
4634
const unregister = chrome.on('APP_NAVIGATION', (event) => {
4735
if (event.domEvent) {
4836
history.push(`/${event.navId}`);
49-
appNavClick[event.navId] !== undefined
50-
? appNavClick[event.navId](true)
51-
: appNavClick.settings(true);
37+
chrome.appNavClick({ id: event.navId, redirect: true });
5238
}
5339
});
5440
return () => unregister();

0 commit comments

Comments
 (0)