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

Commit 0a9cda2

Browse files
committed
feat: "Request an Extension" action
ref issue #26
1 parent 22ce550 commit 0a9cda2

File tree

5 files changed

+35
-9
lines changed

5 files changed

+35
-9
lines changed

config/development.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,12 @@ module.exports = {
88
* Email to report issues to
99
*/
1010
EMAIL_REPORT_ISSUE: "[email protected]",
11+
12+
/**
13+
* Email to request extension
14+
*/
15+
EMAIL_REQUEST_EXTENSION: "[email protected]",
16+
1117
API: {
1218
V5: "https://api.topcoder-dev.com/v5",
1319
},

config/production.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,12 @@ module.exports = {
88
* Email to report issues to
99
*/
1010
EMAIL_REPORT_ISSUE: "[email protected]",
11+
12+
/**
13+
* Email to request extension
14+
*/
15+
EMAIL_REQUEST_EXTENSION: "[email protected]",
16+
1117
API: {
1218
V5: "https://api.topcoder.com/v5",
1319
},

src/routes/MyTeamsDetails/components/TeamMembers/index.jsx

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ import ActionsMenu from "components/ActionsMenu";
1616
import Button from "components/Button";
1717
import Pagination from "components/Pagination";
1818
import { DAY_FORMAT, TEAM_MEMBERS_PER_PAGE } from "constants";
19-
import { formatMoney, formatReportIssueUrl } from "utils/format";
19+
import { formatMoney, formatReportIssueUrl, formatRequestExtensionUrl } from "utils/format";
2020
import Input from "components/Input";
2121
import { skillShape } from "components/SkillsList";
2222

@@ -153,7 +153,16 @@ const TeamMembers = ({ team }) => {
153153
);
154154
},
155155
},
156-
{ label: "Request an Extension", action: () => {} },
156+
{
157+
label: "Request an Extension",
158+
action: () => {
159+
window.open(
160+
formatRequestExtensionUrl(
161+
`Request extension for ${member.handle} on ${team.name}`
162+
)
163+
);
164+
},
165+
},
157166
]}
158167
/>
159168
</div>

src/routes/MyTeamsList/components/TeamCard/index.jsx

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,6 @@ const TeamCard = ({ team }) => {
2727
<div styleName="three-dots-menu">
2828
<ThreeDotsMenu
2929
options={[
30-
{ label: "Team Feedback", action: () => {} },
31-
{ label: "Team Invoices", action: () => {} },
32-
{ label: "Team Reports", action: () => {} },
33-
{ separator: true },
34-
{ label: "Add Team Member", action: () => {} },
35-
{ separator: true },
3630
{
3731
label: "Report an Issue",
3832
action: () => {

src/utils/format.js

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
*/
44
import _ from "lodash";
55
import { RATE_TYPE } from "constants";
6-
import { EMAIL_REPORT_ISSUE } from "../../config";
6+
import { EMAIL_REPORT_ISSUE, EMAIL_REQUEST_EXTENSION } from "../../config";
77
import moment from "moment";
88

99
/**
@@ -120,3 +120,14 @@ export const formatFullName = (firstName, lastName) => {
120120
export const formatReportIssueUrl = (subject) => {
121121
return `mailto:${EMAIL_REPORT_ISSUE}?subject=${encodeURIComponent(subject)}`;
122122
};
123+
124+
/**
125+
* Format Request an Extension URL (mailto:)
126+
*
127+
* @param {string} subject email subject
128+
*
129+
* @returns {string} request an extension URL
130+
*/
131+
export const formatRequestExtensionUrl = (subject) => {
132+
return `mailto:${EMAIL_REQUEST_EXTENSION}?subject=${encodeURIComponent(subject)}`;
133+
};

0 commit comments

Comments
 (0)