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

Commit 2d5860f

Browse files
authored
Merge pull request #32 from topcoder-platform/dev
[PROD] Next Release
2 parents 2266ed3 + 761146b commit 2d5860f

File tree

19 files changed

+283
-255
lines changed

19 files changed

+283
-255
lines changed

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ Make sure you have [Heroky CLI](https://devcenter.heroku.com/articles/heroku-cli
6161
This app exports functions to be imported by other microapps.
6262

6363
- `login` - redirects to login page
64+
- `businessLogin` - redirects to business (i.e. customer) login page
6465
- `logout` - clears session storage and redirects to logout page
6566
- `setAppMenu` - sets sidebar menu for the app by app's `path`
6667
- `getAuthUserTokens` - returns a promise which resolves to object with user tokens `{ tokenV3, tokenV2 }`
@@ -95,6 +96,7 @@ For example see https://github.com/topcoder-platform/micro-frontends-react-app
9596
```js
9697
module.exports = {
9798
login: () => {},
99+
businessLogin: () => {},
98100
logout: () => {},
99101
setAppMenu: () => {},
100102
getAuthUserTokens: () => new Promise(() => {}),
@@ -121,6 +123,7 @@ For example see https://github.com/topcoder-platform/micro-frontends-angular-app
121123
```js
122124
declare module '@topcoder/micro-frontends-navbar-app' {
123125
export const login: any;
126+
export const businessLogin: any;
124127
export const logout: any;
125128
export const setAppMenu: any;
126129
export const getAuthUserTokens: any;

config/dev.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ module.exports = {
55
TC_NOTIFICATION_URL: "https://api.topcoder-dev.com/v5/notifications",
66
CONNECT_DOMAIN: "https://connect.topcoder-dev.com",
77
COMMUNITY_DOMAIN: "https://www.topcoder-dev.com",
8+
TAAS_APP: "https://platform.topcoder-dev.com/taas/myteams",
89
},
910
API: {
1011
V3: "https://api.topcoder-dev.com/v3",

config/prod.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ module.exports = {
55
TC_NOTIFICATION_URL: "https://api.topcoder.com/v5/notifications",
66
CONNECT_DOMAIN: "https://connect.topcoder.com",
77
COMMUNITY_DOMAIN: "https://www.topcoder.com",
8+
TAAS_APP: "https://platform.topcoder.com/taas/myteams",
89
},
910
API: {
1011
V3: "https://api.topcoder.com/v3",

jest.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ module.exports = {
66
transformIgnorePatterns: ["node_modules/?!(tc-auth-lib)"],
77
moduleNameMapper: {
88
"\\.(css|scss)$": "identity-obj-proxy",
9-
"\\.svg$": "<rootDir>/__mocks__/fileMock.js",
9+
"\\.(png|eot|otf|ttf|woff|woff2|svg)$": "<rootDir>/__mocks__/fileMock.js",
1010
},
1111
setupFilesAfterEnv: [
1212
"../node_modules/@testing-library/jest-dom/dist/index.js",

package-lock.json

Lines changed: 61 additions & 87 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

server.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
/* global process */
2-
const express = require('express');
2+
const express = require("express");
33

44
const app = express();
55

66
app.use(
77
"/navbar",
88
express.static("./dist", {
99
setHeaders: function setHeaders(res) {
10-
res.header('Access-Control-Allow-Origin', '*');
11-
res.header('Access-Control-Allow-Methods', 'GET');
10+
res.header("Access-Control-Allow-Origin", "*");
11+
res.header("Access-Control-Allow-Methods", "GET");
1212
res.header(
13-
'Access-Control-Allow-Headers',
14-
'Origin, X-Requested-With, Content-Type, Accept'
13+
"Access-Control-Allow-Headers",
14+
"Origin, X-Requested-With, Content-Type, Accept"
1515
);
1616
},
1717
})

src/actions/notifications.js

Lines changed: 19 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ import {
1919
NOTIFICATIONS_PENDING,
2020
SET_NOTIFICATION_PLATFORM,
2121
RESET_NOTIFICATIONS,
22-
RESET_COMMUNITY_NOTIFICATIONS,
2322
} from "../constants/notifications";
2423
import notificationsService from "../services/notifications";
2524
import {
@@ -83,6 +82,25 @@ export const getNotifications = () => (dispatch) => {
8382
});
8483
};
8584

85+
export const getTaaSNotifications = () => (dispatch) => {
86+
dispatch({ type: GET_NOTIFICATIONS_PENDING });
87+
notificationsService
88+
.getTaaSNotifications()
89+
.then((notifications) => {
90+
dispatch({
91+
type: GET_NOTIFICATIONS_SUCCESS,
92+
payload: notifications,
93+
});
94+
})
95+
.catch((err) => {
96+
dispatch({
97+
type: GET_NOTIFICATIONS_FAILURE,
98+
payload: err,
99+
});
100+
console.error(`Failed to load notifications. ${err.message}`);
101+
});
102+
};
103+
86104
export const getCommunityNotifications = () => (dispatch) => {
87105
dispatch({ type: GET_COMMUNITY_NOTIFICATIONS_PENDING });
88106
notificationsService
@@ -243,10 +261,6 @@ export const resetNotifications = () => (dispatch) => {
243261
dispatch({ type: RESET_NOTIFICATIONS });
244262
};
245263

246-
export const resetCommunityNotifications = () => (dispatch) => {
247-
dispatch({ type: RESET_COMMUNITY_NOTIFICATIONS });
248-
};
249-
250264
export default {
251265
getNotifications,
252266
getCommunityNotifications,
@@ -262,5 +276,4 @@ export default {
262276
markNotificationsRead,
263277
setNotificationPlatform,
264278
resetNotifications,
265-
resetCommunityNotifications,
266279
};

0 commit comments

Comments
 (0)