Skip to content
This repository was archived by the owner on Mar 13, 2025. It is now read-only.

Fixed bugs and lint errors. #3

Merged
merged 14 commits into from
May 31, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 12 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ This is a [single-spa](https://single-spa.js.org/) example React microapp.

## Config

For available variables config which depend on the running environment (`APPENV=dev` or `APPENV=prod`), please refer to `config/development.js` and `config/production.js`.
For available variables config which depend on the running environment (`APPENV=dev` or `APPENV=prod`), please refer to `config/dev.js` and `config/prod.js`.

For application constants which don't depend on the running environment use `src/constants/index.js`.

Expand Down Expand Up @@ -59,14 +59,14 @@ Make sure you have [Heroku CLI](https://devcenter.heroku.com/articles/heroku-cli

## How to run Locally for Development

TaaS App is done using Single SPA micro-frontend architecture https://single-spa.js.org/. So to start it, we would also have to run Frame App and Navbar App. Here I would show the steps to run locally everything we need.
TaaS Admin App is done using Single SPA micro-frontend architecture https://single-spa.js.org/. So to start it, we would also have to run Frame App and Navbar App. Here I would show the steps to run locally everything we need.

### Local Authentication

First of all, to authenticate locally we have to run a local authentication service.

- Clone this repository into `taas-admin-app`.
- Inside the folder `taas-admin-app/local/auth-local` run `npm start`.
- Inside the folder `taas-admin-app/auth-local` run `npm start`.
- You would need npm 5+ for it. This would start a local sever on port 5000 which could be used for local Authentication.

### Local Domain
Expand Down Expand Up @@ -115,7 +115,7 @@ Some config files are using domain `local.topcoder-dev.com`. You can change it t
cd micro-frontends-navbar-app
```

Update in file `micro-frontends-navbar-app/blob/dev/config/dev.js` values for `ACCOUNTS_APP_CONNECTOR` and `AUTH` to `http://localhost:5000` so Navbar app which handles authentication uses our local Authentication service.
Update in file `micro-frontends-navbar-app/config/dev.js` values for `ACCOUNTS_APP_CONNECTOR` and `AUTH` to `http://localhost:5000` so Navbar app which handles authentication uses our local Authentication service.

```sh
# inside folder "micro-frontends-navbar-app" run:
Expand All @@ -128,31 +128,31 @@ Some config files are using domain `local.topcoder-dev.com`. You can change it t
# this host navbar app as http://localhost:3001/navbar/topcoder-micro-frontends-navbar-app.js
```

3. Run **TaaS** micro-app:
3. Run **TaaS Admin** micro-app:

```sh
# inside folder "taas-app" run:
# inside folder "taas-admin-app" run:

nvm use # or make sure to use Node 10
npm i # to install dependencies

npm run dev

# this host TaaS App as http://localhost:8501/taas-app/topcoder-micro-frontends-teams.js
# this hosts TaaS Admin App as http://localhost:8502/taas-admin-app/topcoder-micro-frontends-taas-admin-app.js
```

4. Now we have to update the `micro-frontends-frame` app to show our local version of TaaS App, instead of remote one. Update file `micro-frontends-frame/config/micro-frontends-config-local.json`:
4. Now we have to update the `micro-frontends-frame` app to show our local version of TaaS Admin App, instead of remote one. Update file `micro-frontends-frame/config/micro-frontends-config-local.json`:

```js
// replace line
"@topcoder/micro-frontends-teams": "https://platform.topcoder-dev.com/taas-app/topcoder-micro-frontends-teams.js",
"@topcoder/micro-frontends-taas-admin-app": "https://platform.topcoder-dev.com/taas-admin-app/topcoder-micro-frontends-taas-admin-app.js",

// with line:
"@topcoder/micro-frontends-teams": "http://localhost:8501/taas-app/topcoder-micro-frontends-teams.js",
"@topcoder/micro-frontends-taas-admin-app": "http://localhost:8502/taas-admin-app/topcoder-micro-frontends-taas-admin-app.js",
```

- Now open in the browser http://localhost:8080/taas/myteams.
- Now open in the browser http://localhost:8080/taas-admin.
- If you are not logged-in yet, you should be redirected to the login page.
- If you cannot see the application and redirect doesn't happen, make sure that file "http://local.topcoder-dev.com:8501/taas-app/topcoder-micro-frontends-teams.js" is loaded successfully in the Network tab.
- If you cannot see the application and redirect doesn't happen, make sure that file "http://local.topcoder-dev.com:8502/taas-admin-app/topcoder-micro-frontends-taas-admin-app.js" is loaded successfully in the Network tab.

Congratulations, you successfully run the project. If you had some issue, please, try to go through README of https://github.com/topcoder-platform/micro-frontends-frame and https://github.com/topcoder-platform/micro-frontends-navbar-app.
12 changes: 1 addition & 11 deletions config/dev.js
Original file line number Diff line number Diff line change
@@ -1,16 +1,6 @@
module.exports = {
/**
* URL of Topcoder Community Website
*/
TOPCODER_COMMUNITY_WEBSITE_URL: "https://topcoder-dev.com",

/**
* URL of Topcoder Connect Website
*/
CONNECT_WEBSITE_URL: "https://connect.topcoder-dev.com",

API: {
V5: "https://api.topcoder-dev.com/v5",
V3: "https://api.topcoder-dev.com/v3",
},
PLATFORM_WEBSITE_URL: "https://platform.topcoder-dev.com",
};
12 changes: 4 additions & 8 deletions config/index.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,10 @@
/* global process */

module.exports = (() => {
const env = process.env.APPENV || "dev";
const appEnv = process.env.APPENV === "prod" ? "prod" : "dev";

console.log(`APPENV: "${env}"`);
// eslint-disable-next-line no-console
console.log(`APPENV: "${appEnv}"`);

// for security reason don't let to require any arbitrary file defined in process.env
if (["prod", "dev"].indexOf(env) < 0) {
return require("./dev");
}

return require("./" + env);
return require(`./${appEnv}`);
})();
12 changes: 1 addition & 11 deletions config/prod.js
Original file line number Diff line number Diff line change
@@ -1,16 +1,6 @@
module.exports = {
/**
* URL of Topcoder Community Website
*/
TOPCODER_COMMUNITY_WEBSITE_URL: "https://topcoder.com",

/**
* URL of Topcoder Connect Website
*/
CONNECT_WEBSITE_URL: "https://connect.topcoder.com",

API: {
V5: "https://api.topcoder.com/v5",
V3: "https://api.topcoder.com/v3",
},
PLATFORM_WEBSITE_URL: "https://platform.topcoder.com",
};
22 changes: 17 additions & 5 deletions src/assets/images/icon-arrow-down-small.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
22 changes: 17 additions & 5 deletions src/assets/images/icon-arrow-down.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed src/assets/images/icon-arrow-left-green.png
Binary file not shown.
22 changes: 17 additions & 5 deletions src/assets/images/icon-arrow-left.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed src/assets/images/icon-arrow-right-green.png
Binary file not shown.
22 changes: 17 additions & 5 deletions src/assets/images/icon-arrow-right.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 1 addition & 2 deletions src/assets/images/icon-magnifier.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
54 changes: 40 additions & 14 deletions src/assets/images/icon-menu-item-feelancers.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
71 changes: 63 additions & 8 deletions src/assets/images/icon-menu-item-workperiods.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed src/assets/images/icon-tick-white-bg-green.png
Binary file not shown.
Loading