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

Commit 5ad49e9

Browse files
committed
lint-fix
1 parent 163bbfd commit 5ad49e9

File tree

9 files changed

+52
-50
lines changed

9 files changed

+52
-50
lines changed

jest.config.js

+1-1
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",

server.js

+5-5
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/components/Menu/index.jsx

+9-9
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,18 @@
33
*
44
* General component to show menu with submenu.
55
*/
6-
import React, { Fragment, useCallback, useState } from 'react';
7-
import { useLocation } from '@reach/router';
8-
import cn from 'classnames';
9-
import { includes, map } from 'lodash';
10-
import NavLink from '../NavLink';
11-
import './styles.css';
6+
import React, { Fragment, useCallback, useState } from "react";
7+
import { useLocation } from "@reach/router";
8+
import cn from "classnames";
9+
import { includes, map } from "lodash";
10+
import NavLink from "../NavLink";
11+
import "./styles.css";
1212

1313
const SubMenu = ({ option }) => {
1414
const location = useLocation();
1515

1616
const [isOpen, setIsOpen] = useState(
17-
includes(map(option.children, 'path'), location.pathname)
17+
includes(map(option.children, "path"), location.pathname)
1818
);
1919

2020
const toggleOpen = useCallback(() => {
@@ -24,8 +24,8 @@ const SubMenu = ({ option }) => {
2424
return (
2525
<>
2626
<span
27-
className={cn('menu-link menu-link-toggle', {
28-
'menu-link-toggle-up': isOpen,
27+
className={cn("menu-link menu-link-toggle", {
28+
"menu-link-toggle-up": isOpen,
2929
})}
3030
onClick={toggleOpen}
3131
role="button"

src/constants/apps.js

+19-19
Original file line numberDiff line numberDiff line change
@@ -1,52 +1,52 @@
11
/**
22
* Config for the All Apps menu.
33
*/
4-
import appDocumentationIcon from '../assets/images/learn.svg';
5-
import appTaasIcon from '../assets/images/integrations.svg';
6-
import appTaasAdminIcon from '../assets/images/taas-admin.png';
7-
import myteamsIcon from '../assets/images/my-teams.svg';
8-
import myteamsGreenIcon from '../assets/images/my-teams-green.svg';
9-
import createTeamIcon from '../assets/images/create-team.svg';
10-
import createTeamGreenIcon from '../assets/images/create-team-green.svg';
4+
import appDocumentationIcon from "../assets/images/learn.svg";
5+
import appTaasIcon from "../assets/images/integrations.svg";
6+
import appTaasAdminIcon from "../assets/images/taas-admin.png";
7+
import myteamsIcon from "../assets/images/my-teams.svg";
8+
import myteamsGreenIcon from "../assets/images/my-teams-green.svg";
9+
import createTeamIcon from "../assets/images/create-team.svg";
10+
import createTeamGreenIcon from "../assets/images/create-team-green.svg";
1111
import earnIcon from "../assets/images/earn.svg";
1212

1313
/**
1414
* Micro-app categories
1515
*/
1616
export const APP_CATEGORIES = [
1717
{
18-
category: 'Manage',
18+
category: "Manage",
1919
apps: [
2020
{
21-
title: 'TaaS',
21+
title: "TaaS",
2222
icon: appTaasIcon,
23-
path: '/taas',
23+
path: "/taas",
2424
menu: [
2525
{
26-
title: 'My Teams',
27-
path: '/taas/myteams',
26+
title: "My Teams",
27+
path: "/taas/myteams",
2828
icon: myteamsIcon,
2929
activeIcon: myteamsGreenIcon,
3030
isExact: false,
3131
},
3232
{
33-
title: 'Create New Team',
34-
path: '/taas/createnewteam',
33+
title: "Create New Team",
34+
path: "/taas/createnewteam",
3535
icon: createTeamIcon,
3636
activeIcon: createTeamGreenIcon,
3737
isExact: false,
3838
},
3939
],
4040
},
4141
{
42-
title: 'TaaS Admin',
42+
title: "TaaS Admin",
4343
icon: appTaasAdminIcon,
44-
path: '/taas-admin',
44+
path: "/taas-admin",
4545
menu: [],
46-
roles: ["bookingmanager","administrator"],
46+
roles: ["bookingmanager", "administrator"],
4747
},
4848
{
49-
title: 'Documentation',
49+
title: "Documentation",
5050
icon: appDocumentationIcon,
5151
path: "/model",
5252
menu: [],
@@ -57,7 +57,7 @@ export const APP_CATEGORIES = [
5757
path: "/community-admin",
5858
menu: [],
5959
roles: ["Community Admin"],
60-
}
60+
},
6161
],
6262
},
6363
{

src/constants/notifications.js

+9-7
Original file line numberDiff line numberDiff line change
@@ -141,9 +141,11 @@ export const EVENT_TYPE = {
141141
},
142142
BROADCAST: "admin.notification.broadcast",
143143
TAAS: {
144-
POST_INTERVIEW_ACTION_REQUIRED: 'taas.notification.post-interview-action-required',
145-
RESOURCE_BOOKING_EXPIRATION: 'taas.notification.resource-booking-expiration',
146-
RESOURCE_BOOKING_PLACED: 'taas.notification.resource-booking-placed',
144+
POST_INTERVIEW_ACTION_REQUIRED:
145+
"taas.notification.post-interview-action-required",
146+
RESOURCE_BOOKING_EXPIRATION:
147+
"taas.notification.resource-booking-expiration",
148+
RESOURCE_BOOKING_PLACED: "taas.notification.resource-booking-placed",
147149
},
148150
};
149151

@@ -175,7 +177,7 @@ export const GOTO = {
175177
TOPCODER_TEAM: `${config.URL.CONNECT_DOMAIN}/projects/{{projectId}}#manageTopcoderTeam`,
176178
CHALLENGE: `${config.URL.COMMUNITY_DOMAIN}/challenges/{{id}}`,
177179
TAAS_CANDIDATES_INTERVIEWS: `${config.URL.TAAS_APP}/{{projectId}}/positions/{{jobId}}/candidates/interviews`,
178-
TAAS_PROJECT: `${config.URL.TAAS_APP}/{{projectId}}`
180+
TAAS_PROJECT: `${config.URL.TAAS_APP}/{{projectId}}`,
179181
};
180182

181183
// each notification can be displayed differently depend on WHO see them
@@ -1279,7 +1281,7 @@ export const NOTIFICATIONS = [
12791281
text: "Candidate action required for <strong>{{userHandle}}</strong> in job <strong>{{jobTitle}}</strong> of the team <strong>{{teamName}}</strong>",
12801282
shouldBundle: false,
12811283
goTo: GOTO.TAAS_CANDIDATES_INTERVIEWS,
1282-
}
1284+
},
12831285
],
12841286
},
12851287

@@ -1292,7 +1294,7 @@ export const NOTIFICATIONS = [
12921294
text: "{{numOfExpiringResourceBookings}} resource booking{{s}} {{be}} expiring in the team <strong>{{teamName}}</strong>",
12931295
shouldBundle: false,
12941296
goTo: GOTO.TAAS_PROJECT,
1295-
}
1297+
},
12961298
],
12971299
},
12981300

@@ -1305,7 +1307,7 @@ export const NOTIFICATIONS = [
13051307
text: "Resource <strong>{{userHandle}}</strong> is placed for the job <strong>{{jobTitle}}</strong> of the team <strong>{{teamName}}</strong>",
13061308
shouldBundle: false,
13071309
goTo: GOTO.TAAS_PROJECT,
1308-
}
1310+
},
13091311
],
13101312
},
13111313
];

src/containers/NotificationsDropdownContainer/index.jsx

+4-5
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,9 @@ const NotificationsDropdownContainerView = (props) => {
157157
if (
158158
(!isLoading && !initialized && platform == PLATFORM.CONNECT) ||
159159
(!isLoading && !initialized && platform == PLATFORM.TAAS) ||
160-
(!isCommunityLoading && !communityInitialized && platform == PLATFORM.COMMUNITY)
160+
(!isCommunityLoading &&
161+
!communityInitialized &&
162+
platform == PLATFORM.COMMUNITY)
161163
) {
162164
notificationsEmpty = (
163165
<NotificationsEmpty message="Fail to load notifications">
@@ -545,10 +547,7 @@ class NotificationsDropdownContainer extends React.Component {
545547
}
546548

547549
componentWillReceiveProps(nextProps) {
548-
const {
549-
platform: oldPlatform,
550-
resetNotifications,
551-
} = this.props;
550+
const { platform: oldPlatform, resetNotifications } = this.props;
552551
const { platform } = nextProps;
553552

554553
if (platform !== oldPlatform) {

src/utils/index.js

+1-3
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,7 @@ export const getLoginUrl = () =>
2020
* Generate Business Login URL
2121
*/
2222
export const getBusinessLoginUrl = () =>
23-
`${
24-
config.URL.AUTH
25-
}?regSource=taasApp&mode=login&retUrl=${encodeURIComponent(
23+
`${config.URL.AUTH}?regSource=taasApp&mode=login&retUrl=${encodeURIComponent(
2624
window.location.href.match(/[^?]*/)[0]
2725
)}`;
2826

src/utils/notifications.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -609,7 +609,7 @@ export const prepareTaaSNotifications = (rawNotifications) => {
609609
});
610610

611611
return notifications;
612-
}
612+
};
613613

614614
// --- Community --- //
615615

webpack.config.js

+3
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@ module.exports = (webpackConfigEnv, options) => {
1414
disableHtmlGeneration: true,
1515
});
1616

17+
const unusedFilesWebpackPlugin = defaultConfig.plugins.find(p => p.constructor.name === "UnusedFilesWebpackPlugin");
18+
unusedFilesWebpackPlugin.globOptions.ignore.push("**/assets/icons/*.svg", "**/__mocks__/**");
19+
1720
let cssLocalIdent;
1821
if (options.mode === "production") {
1922
cssLocalIdent = "[hash:base64:6]";

0 commit comments

Comments
 (0)