Skip to content

Commit 462aeec

Browse files
PROD-2399 #comment update readme to indicate this repo is obsolete; #time 15m
1 parent 0ea2903 commit 462aeec

7 files changed

+83
-67
lines changed

README.md

+10
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,15 @@
11
# Topcoder Self Service Micro Frontend App
22

3+
# THIS APP IS OBSOLETE!! YAY!!
4+
5+
>**NOTE:** As of PROD-2194, this repo will obsolete.
6+
7+
All requests to this app should be redirected to the new [platform ui](https://github.com/topcoder-platform/platform-ui).
8+
9+
If for some bizarre reason you need to run this repo, you can replace the root.component.jsx with the root.component.jsx.bak, and it will work normally.
10+
11+
# THIS APP IS OBSOLETE! PAY NO ATTN TO ANYTHING BELOW
12+
313
This is a [single-spa](https://single-spa.js.org/) React microapp that runs within the `mfe-core` frame application.
414

515
> **NOTE:** This application has been configured to be run as child app of a single-spa application. So while this app can be deployed and run independently, we would need some frame [single-spa](https://single-spa.js.org/) which would load it. While technically we can achieve running this app as standalone app it's strongly not recommended by the author of the `single-spa` approch, see this [GitHub Issue](https://github.com/single-spa/single-spa/issues/640) for details.

src-ts/config/environments/environment.default.config.ts

+1
Original file line numberDiff line numberDiff line change
@@ -18,5 +18,6 @@ export const EnvironmentConfigDefault: GlobalConfig = {
1818
TAG_MANAGER_ID: undefined,
1919
URL: {
2020
ACCOUNTS_APP_CONNECTOR: 'https://accounts-auth0.topcoder-dev.com',
21+
PLATFORM_UI: 'https://local.topcoder-dev.com:3000',
2122
},
2223
}
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
import { GlobalConfig } from '../../lib'
2-
import { ToolTitle } from '../constants'
32

43
import { AppHostEnvironment } from './app-host-environment.enum'
54
import { EnvironmentConfigDefault } from './environment.default.config'
65

76
export const EnvironmentConfigDev: GlobalConfig = {
87
...EnvironmentConfigDefault,
9-
DISABLED_TOOLS: [
10-
ToolTitle.designLib,
11-
],
8+
DISABLED_TOOLS: [ ],
129
ENV: AppHostEnvironment.dev,
1310
TAG_MANAGER_ID: 'GTM-W7B537Z',
11+
URL: {
12+
PLATFORM_UI: 'https://platform-ui.topcoder-dev.com',
13+
},
1414
}
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import { GlobalConfig } from '../../lib'
2-
import { ToolTitle } from '../constants'
32

43
import { AppHostEnvironment } from './app-host-environment.enum'
54
import { EnvironmentConfigDefault } from './environment.default.config'
@@ -11,12 +10,10 @@ export const EnvironmentConfigProd: GlobalConfig = {
1110
V3: 'https://api.topcoder.com/v3',
1211
V5: 'https://api.topcoder.com/v5',
1312
},
14-
DISABLED_TOOLS: [
15-
ToolTitle.designLib,
16-
],
1713
ENV: AppHostEnvironment.prod,
1814
TAG_MANAGER_ID: 'GTM-MXXQHG8',
1915
URL: {
2016
ACCOUNTS_APP_CONNECTOR: 'https://accounts-auth0.topcoder.com',
17+
PLATFORM_UI: 'https://platform-ui.topcoder.com',
2118
},
2219
}

src-ts/lib/global-config.model.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ export interface GlobalConfig {
1414
REAUTH_OFFSET: number
1515
TAG_MANAGER_ID?: string
1616
URL: {
17-
ACCOUNTS_APP_CONNECTOR: string
17+
ACCOUNTS_APP_CONNECTOR: string,
18+
PLATFORM_UI: string
1819
}
1920
}

src/root.component.jsx

+4-58
Original file line numberDiff line numberDiff line change
@@ -1,61 +1,7 @@
1-
import { createHistory, LocationProvider } from "@reach/router";
2-
import React, { StrictMode } from "react";
3-
import { Provider } from "react-redux";
4-
import { BrowserRouter } from "react-router-dom";
5-
import ReduxToastr from "react-redux-toastr";
6-
7-
import {
8-
AppNextGen,
9-
RouteProvider,
10-
routeRootLoggedIn,
11-
routeRootLoggedOut,
12-
ToolsRoutes,
13-
UtilsRoutes,
14-
PageFooter,
15-
ProfileProvider,
16-
} from "../src-ts";
17-
18-
import App from "./App";
19-
import store from "./store";
20-
21-
import "./styles/main.vendor.scss";
22-
23-
const history = createHistory(window);
1+
import { EnvironmentConfig } from "../src-ts"
242

253
export default function Root() {
26-
return (
27-
<Provider store={store}>
28-
<ProfileProvider>
29-
<BrowserRouter>
30-
<RouteProvider
31-
rootLoggedIn={routeRootLoggedIn}
32-
rootLoggedOut={routeRootLoggedOut}
33-
toolsRoutes={[...ToolsRoutes]}
34-
utilsRoutes={[...UtilsRoutes]}
35-
>
36-
<StrictMode>
37-
<AppNextGen />
38-
</StrictMode>
39-
</RouteProvider>
40-
</BrowserRouter>
41-
42-
<LocationProvider history={history}>
43-
<App />
44-
<ReduxToastr
45-
timeOut={3000}
46-
newestOnTop={false}
47-
preventDuplicates
48-
position="top-right"
49-
getState={(state) => state.toastr}
50-
transitionIn="fadeIn"
51-
transitionOut="fadeOut"
52-
progressBar
53-
closeOnToastrClick
54-
/>
55-
</LocationProvider>
56-
57-
<PageFooter />
58-
</ProfileProvider>
59-
</Provider>
60-
);
4+
const redirectUrl = `${EnvironmentConfig.URL.PLATFORM_UI}${window.location.pathname}`
5+
window.location.href = redirectUrl
6+
return <></>
617
}

src/root.component.jsx.bak

+61
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
import { createHistory, LocationProvider } from "@reach/router";
2+
import React, { StrictMode } from "react";
3+
import { Provider } from "react-redux";
4+
import { BrowserRouter } from "react-router-dom";
5+
import ReduxToastr from "react-redux-toastr";
6+
7+
import {
8+
AppNextGen,
9+
RouteProvider,
10+
routeRootLoggedIn,
11+
routeRootLoggedOut,
12+
ToolsRoutes,
13+
UtilsRoutes,
14+
PageFooter,
15+
ProfileProvider,
16+
} from "../src-ts";
17+
18+
import App from "./App";
19+
import store from "./store";
20+
21+
import "./styles/main.vendor.scss";
22+
23+
const history = createHistory(window);
24+
25+
export default function Root() {
26+
return (
27+
<Provider store={store}>
28+
<ProfileProvider>
29+
<BrowserRouter>
30+
<RouteProvider
31+
rootLoggedIn={routeRootLoggedIn}
32+
rootLoggedOut={routeRootLoggedOut}
33+
toolsRoutes={[...ToolsRoutes]}
34+
utilsRoutes={[...UtilsRoutes]}
35+
>
36+
<StrictMode>
37+
<AppNextGen />
38+
</StrictMode>
39+
</RouteProvider>
40+
</BrowserRouter>
41+
42+
<LocationProvider history={history}>
43+
<App />
44+
<ReduxToastr
45+
timeOut={3000}
46+
newestOnTop={false}
47+
preventDuplicates
48+
position="top-right"
49+
getState={(state) => state.toastr}
50+
transitionIn="fadeIn"
51+
transitionOut="fadeOut"
52+
progressBar
53+
closeOnToastrClick
54+
/>
55+
</LocationProvider>
56+
57+
<PageFooter />
58+
</ProfileProvider>
59+
</Provider>
60+
);
61+
}

0 commit comments

Comments
 (0)