Skip to content

Commit

Permalink
chore(RHIF-224): Update /beta to /preview
Browse files Browse the repository at this point in the history
To test, you can run via /beta or /preview. We previously had issues with the local app being served. To ensure that it is properly being served, run the app via beta and make a change in the code or add a console log and ensure that you're getting local changes.
  • Loading branch information
Michael Johnson committed Apr 13, 2023
1 parent 74ef891 commit 4e0a05d
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 20 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ Note: You will need to set up the Insights environment if you want to develop wi
2. ```npm run start:beta```
- with CI beta env

3. visit ```https://prod.foo.redhat.com:1337/insights/malware/``` OR ```https://prod.foo.redhat.com:1337/beta/insights/malware/``` for beta env
3. visit ```https://prod.foo.redhat.com:1337/insights/malware/``` OR ```https://prod.foo.redhat.com:1337/preview/insights/malware/``` for beta env

### Testing

Expand Down
2 changes: 1 addition & 1 deletion config/dev.webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ const { config: webpackConfig, plugins } = config({
debug: true,
deployment: process.env.BETA ? 'beta/apps' : 'apps',
useProxy: true,
appUrl: process.env.BETA ? '/beta/insights/malware' : '/insights/malware',
appUrl: process.env.BETA ? ['/beta/insights/malware', '/preview/insights/malware'] : '/insights/malware',
env: process.env.BETA ? 'stage-beta' : 'stage-stable',
standalone: Boolean(process.env.STANDALONE)
});
Expand Down
4 changes: 2 additions & 2 deletions profiles/local-frontend-and-api.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ const FRONTEND_PORT = 8002;
const API_PORT = 3000;
const routes = {};

routes[`/beta/${SECTION}/${APP_ID}`] = { host: `https://localhost:${FRONTEND_PORT}` };
routes[`/preview/${SECTION}/${APP_ID}`] = { host: `https://localhost:${FRONTEND_PORT}` };
routes[`/${SECTION}/${APP_ID}`] = { host: `https://localhost:${FRONTEND_PORT}` };
routes[`/beta/apps/${APP_ID}`] = { host: `https://localhost:${FRONTEND_PORT}` };
routes[`/preview/apps/${APP_ID}`] = { host: `https://localhost:${FRONTEND_PORT}` };
routes[`/apps/${APP_ID}`] = { host: `https://localhost:${FRONTEND_PORT}` };

routes[`/api/${APP_ID}`] = { host: `http://localhost:${API_PORT}` };
Expand Down
3 changes: 1 addition & 2 deletions src/AppEntry.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import PropTypes from 'prop-types';
import { Provider } from 'react-redux';
import { BrowserRouter as Router } from 'react-router-dom';
import { cache } from './store/cache';
import { getBaseName } from '@redhat-cloud-services/frontend-components-utilities/helpers/helpers';
import { init, RegistryContext } from './store';
import { globalFilters } from './store/cache';
import logger from 'redux-logger';
Expand Down Expand Up @@ -68,7 +67,7 @@ const AppEntry = ({ useLogger, connectToDevTools }) => {
<ApolloProvider client={client}>
<RegistryContext.Provider value={{ getRegistry: () => registry }}>
<Provider store={registry.getStore()}>
<Router basename={getBaseName(window.location.pathname)}>
<Router>
<NotificationsPortal />
<App />
</Router>
Expand Down
2 changes: 1 addition & 1 deletion src/Components/Common.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ const gqlProps = {
error: propTypes.object
};

const isBeta = () => window.location.pathname.split('/')[1] === 'beta' ? '/beta' : '';
const isBeta = () => window.location.pathname.split('/')[1] === 'preview' ? '/preview' : '';

// Parse the match.metadata object and return a string of its 'key: value' items each on a separate line
const expandMatchMetadata = (md) => {
Expand Down
13 changes: 0 additions & 13 deletions src/entry.test.js

This file was deleted.

0 comments on commit 4e0a05d

Please sign in to comment.