This repository was archived by the owner on Mar 13, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 7 files changed +54
-5
lines changed
MyTeamsList/components/TeamCard Expand file tree Collapse file tree 7 files changed +54
-5
lines changed Original file line number Diff line number Diff line change @@ -4,6 +4,11 @@ module.exports = {
44 */
55 TOPCODER_COMMUNITY_WEBSITE_URL : "https://topcoder-dev.com" ,
66
7+ /**
8+ * URL of Topcoder Connect Website
9+ */
10+ CONNECT_WEBSITE_URL : "https://connect.topcoder-dev.com" ,
11+
712 /**
813 * Email to report issues to
914 */
Original file line number Diff line number Diff line change @@ -4,6 +4,11 @@ module.exports = {
44 */
55 TOPCODER_COMMUNITY_WEBSITE_URL : "https://topcoder.com" ,
66
7+ /**
8+ * URL of Topcoder Connect Website
9+ */
10+ CONNECT_WEBSITE_URL : "https://connect.topcoder.com" ,
11+
712 /**
813 * Email to report issues to
914 */
Original file line number Diff line number Diff line change @@ -7,6 +7,7 @@ import React from "react";
77import PT from "prop-types" ;
88import DataItem from "components/DataItem" ;
99import {
10+ formatConnectProjectUrl ,
1011 formatMoney ,
1112 formatRemainingTimeForTeam ,
1213 formatReportIssueUrl ,
@@ -39,6 +40,14 @@ const TeamSummary = ({ team }) => {
3940 </ div >
4041
4142 < div styleName = "actions" >
43+ < Button
44+ href = { formatConnectProjectUrl ( team . id ) }
45+ target = "_blank"
46+ type = "secondary"
47+ size = "medium"
48+ >
49+ Open in Connect
50+ </ Button >
4251 < Button
4352 type = "warning"
4453 size = "medium"
Original file line number Diff line number Diff line change 1919}
2020
2121.actions {
22- margin-top : 20px ;
22+ display : flex ;
23+ flex-wrap : wrap ;
24+
25+ > * {
26+ margin-top : 20px ;
27+ }
28+
29+ > * :not (:last-child ) {
30+ margin-right : 10px ;
31+ }
2332}
Original file line number Diff line number Diff line change @@ -15,7 +15,6 @@ import TeamSummary from "./components/TeamSummary";
1515import TeamMembers from "./components/TeamMembers" ;
1616import TeamPositions from "./components/TeamPositions" ;
1717import withAuthentication from "../../hoc/withAuthentication" ;
18- import { useAsync } from "react-use" ;
1918
2019const MyTeamsDetails = ( { teamId } ) => {
2120 const [ team , loadingError ] = useData ( getTeamById , teamId ) ;
Original file line number Diff line number Diff line change @@ -7,8 +7,6 @@ import "./styles.module.scss";
77import _ from "lodash" ;
88import { Link } from "@reach/router" ;
99import DataItem from "components/DataItem" ;
10- import moment from "moment" ;
11- import { DAY_FORMAT } from "constants" ;
1210import IconCalendar from "../../../../assets/images/icon-calendar.svg" ;
1311import IconClock from "../../../../assets/images/icon-clock.svg" ;
1412import IconMoney from "../../../../assets/images/icon-money.svg" ;
@@ -18,6 +16,7 @@ import {
1816 formatMoney ,
1917 formatRemainingTimeForTeam ,
2018 formatReportIssueUrl ,
19+ formatConnectProjectUrl ,
2120} from "utils/format" ;
2221import AvatarGroup from "components/AvatarGroup" ;
2322import ThreeDotsMenu from "components/ThreeDotsMenu" ;
@@ -28,6 +27,15 @@ const TeamCard = ({ team }) => {
2827 < div styleName = "three-dots-menu" >
2928 < ThreeDotsMenu
3029 options = { [
30+ {
31+ label : "Open in Connect" ,
32+ action : ( ) => {
33+ window . open ( formatConnectProjectUrl ( team . id ) ) ;
34+ } ,
35+ } ,
36+ {
37+ separator : true ,
38+ } ,
3139 {
3240 label : "Report an Issue" ,
3341 action : ( ) => {
Original file line number Diff line number Diff line change 33 */
44import _ from "lodash" ;
55import { RATE_TYPE } from "constants" ;
6- import { EMAIL_REPORT_ISSUE , EMAIL_REQUEST_EXTENSION } from "../../config" ;
6+ import {
7+ EMAIL_REPORT_ISSUE ,
8+ EMAIL_REQUEST_EXTENSION ,
9+ CONNECT_WEBSITE_URL ,
10+ } from "../../config" ;
711import moment from "moment" ;
812import { DAY_FORMAT } from "constants/" ;
913
14+ /**
15+ * Format URL to the project (team) in Connect App.
16+ *
17+ * @param {string|number } teamId team (project) id
18+ *
19+ * @returns {string } URL to Connect project
20+ */
21+ export const formatConnectProjectUrl = ( teamId ) =>
22+ `${ CONNECT_WEBSITE_URL } /projects/${ teamId } ` ;
23+
1024/**
1125 * Formats number with base word in singular or plural form depend on the number.
1226 *
You can’t perform that action at this time.
0 commit comments