Skip to content

Commit a1aac2e

Browse files
Merge branch 'develop' into ca-profile-bug-bash
2 parents ce0eb0f + d9affe6 commit a1aac2e

File tree

5 files changed

+87
-54
lines changed

5 files changed

+87
-54
lines changed

src/shared/components/Contentful/Article/Article.jsx

+17-1
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,17 @@ class Article extends React.Component {
148148
},
149149
).substring(0, CONTENT_PREVIEW_LENGTH);
150150
const catsGrouped = _.groupBy(fields.contentCategory, cat => cat.fields.trackParent);
151+
// captures clicks on article
152+
// for opening external links in new tab
153+
const articleClickHandler = (e) => {
154+
if (e.target.href && fields.openExternalLinksInNewTab !== false) {
155+
const target = new URL(e.target.href);
156+
if (!target.host.includes('topcoder')) {
157+
window.open(e.target.href, '_blank');
158+
e.preventDefault();
159+
}
160+
}
161+
};
151162

152163
return (
153164
<React.Fragment>
@@ -291,7 +302,12 @@ class Article extends React.Component {
291302
</div>
292303
</div>
293304
{/* Content */}
294-
<div className={theme.articleContent}>
305+
<div
306+
className={theme.articleContent}
307+
role="presentation"
308+
onClick={articleClickHandler}
309+
onKeyPress={articleClickHandler}
310+
>
295311
<MarkdownRenderer markdown={fields.content} {...contentfulConfig} />
296312
{
297313
fields.type === 'Video' && fields.contentUrl ? (

src/shared/components/Contentful/Article/themes/default.scss

+5-1
Original file line numberDiff line numberDiff line change
@@ -324,7 +324,7 @@
324324
ol {
325325
@include tc-body-md;
326326

327-
padding-left: 20px;
327+
padding-left: 30px;
328328
margin-bottom: 20px;
329329

330330
@include roboto-regular;
@@ -485,6 +485,10 @@
485485
margin-bottom: 108px;
486486
}
487487

488+
@media screen and (min-width: 1440px) and (max-width: 1900px) {
489+
margin-bottom: 70px;
490+
}
491+
488492
@media screen and (max-width: 768px) {
489493
margin-bottom: 300px;
490494
}

src/shared/components/Contentful/ArticleCard/themes/article_large.scss

+20
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,10 @@
1212
@include xs-to-sm {
1313
margin: 5px;
1414
}
15+
16+
@media screen and (max-width: 425px) {
17+
max-height: none;
18+
}
1519
}
1620

1721
.contentWrapper {
@@ -23,6 +27,10 @@
2327
display: flex;
2428
flex-direction: row;
2529
align-items: stretch;
30+
31+
@media screen and (max-width: 425px) {
32+
flex-direction: column;
33+
}
2634
}
2735

2836
.main {
@@ -225,6 +233,11 @@
225233
min-width: 150px;
226234
}
227235

236+
@media screen and (max-width: 425px) {
237+
width: 100%;
238+
min-height: 130px;
239+
}
240+
228241
&::before {
229242
content: '';
230243
width: 35px;
@@ -234,5 +247,12 @@
234247
background-size: cover;
235248
background-position: right -2px;
236249
position: absolute;
250+
251+
@media screen and (max-width: 425px) {
252+
background-image: url("data:image/svg+xml,%3C%3Fxml version='1.0' encoding='utf-8'%3F%3E%3Csvg version='1.1' id='Layer_1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' x='0px' y='0px' viewBox='0 0 290 31.73' style='enable-background:new 0 0 290 31.73;' xml:space='preserve'%3E%3Cstyle type='text/css'%3E .st0%7Bfill-rule:evenodd;clip-rule:evenodd;fill:%23F4F4F4;%7D%0A%3C/style%3E%3Cg id='Thrive'%3E%3Cg id='Artboard' transform='translate(-22.000000, -20.000000)'%3E%3Cg id='Combined-Shape'%3E%3Cpath class='st0' d='M22,20h290l0,24.11c-60.39,13.64-90.73-0.4-142.15-10.48C118.1,23.5,97,79,22.08,33.64l0,0l0,1.34'/%3E%3C/g%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
253+
width: 100%;
254+
height: 33px;
255+
background-position: 0 -10px;
256+
}
237257
}
238258
}

src/shared/components/Contentful/SearchBar/SearchBar.jsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ export class SearchBarInner extends Component {
7474

7575
onKeyDown(e) {
7676
const { inputlVal, selectedFilter } = this.state;
77-
if (inputlVal && e.which === 13) {
77+
if (_.trim(inputlVal) && e.which === 13) {
7878
const searchQuery = {};
7979
if (this.searchFieldRef && this.searchFieldRef.value) {
8080
if (selectedFilter.name === 'Tags') {
@@ -90,7 +90,7 @@ export class SearchBarInner extends Component {
9090
if (selectedFilter.name !== 'Author') {
9191
window.location.href = `${config.TC_EDU_BASE_PATH}${config.TC_EDU_SEARCH_PATH}?${qs.stringify(searchQuery)}`;
9292
} else {
93-
window.location.href = `${config.TC_EDU_BASE_PATH}${config.TC_EDU_SEARCH_PATH}?author=${inputlVal}`;
93+
window.location.href = `${config.TC_EDU_BASE_PATH}${config.TC_EDU_SEARCH_PATH}?author=${_.trim(inputlVal)}`;
9494
}
9595
}
9696
}

src/shared/containers/Gigs/RecruitCRMJobDetails.jsx

+43-50
Original file line numberDiff line numberDiff line change
@@ -68,21 +68,6 @@ ${config.URL.BASE}${config.GIGS_PAGES_PATH}/${props.id}`,
6868
// exit no email sending
6969
return;
7070
}
71-
// process sent log
72-
let { emailInvitesLog, emailInvitesStatus } = growSurf.data.metadata;
73-
if (!emailInvitesLog) emailInvitesLog = '';
74-
// check if email is in sent log alredy?
75-
const foundInLog = emailInvitesLog.indexOf(email);
76-
if (foundInLog !== -1) {
77-
this.setState({
78-
isReferrError: {
79-
message: `${email} was already invited.`,
80-
userError: true,
81-
},
82-
});
83-
// exit no email sending
84-
return;
85-
}
8671
// check if email is already referred?
8772
const growCheck = await fetch(`${PROXY_ENDPOINT}/growsurf/participant/${email}`);
8873
if (growCheck.status === 200) {
@@ -125,43 +110,51 @@ ${config.URL.BASE}${config.GIGS_PAGES_PATH}/${props.id}`,
125110
// exit no email tracking due to the error
126111
return;
127112
}
128-
// parse the log to array of emails
129-
if (emailInvitesLog.length) {
130-
emailInvitesLog = emailInvitesLog.split(',');
131-
} else emailInvitesLog = [];
132-
// prepare growSurf update payload
133-
// we keep only 10 emails in the log to justify program rules
134-
if (emailInvitesLog.length < 10) {
135-
emailInvitesLog.push(email);
136-
}
137-
// Auto change status when 10 emails sent
138-
if (emailInvitesLog.length === 10 && emailInvitesStatus !== 'Paid' && emailInvitesStatus !== 'Payment Pending') {
139-
emailInvitesStatus = 'Payment Pending';
140-
}
141-
// put the tracking update in growsurf
142-
const updateRed = await fetch(`${PROXY_ENDPOINT}/growsurf/participant/${growSurf.data.id}`, {
143-
method: 'PATCH',
144-
headers: {
145-
'Content-Type': 'application/json',
146-
Authorization: `Bearer ${tokenV3}`,
147-
},
148-
body: JSON.stringify({
149-
...growSurf.data,
150-
metadata: {
151-
...growSurf.data.metadata,
152-
emailInvitesSent: Number(growSurf.data.metadata.emailInvitesSent || 0) + 1,
153-
emailInvitesLog: emailInvitesLog.join(),
154-
emailInvitesStatus,
113+
// process sent log
114+
let { emailInvitesLog, emailInvitesStatus } = growSurf.data.metadata;
115+
if (!emailInvitesLog) emailInvitesLog = '';
116+
// check if email is in sent log alredy?
117+
const foundInLog = emailInvitesLog.indexOf(email);
118+
// only when email is new - put it in log, update counters and etc.
119+
if (foundInLog === -1) {
120+
// parse the log to array of emails
121+
if (emailInvitesLog.length) {
122+
emailInvitesLog = emailInvitesLog.split(',');
123+
} else emailInvitesLog = [];
124+
// prepare growSurf update payload
125+
// we keep only 10 emails in the log to justify program rules
126+
if (emailInvitesLog.length < 10) {
127+
emailInvitesLog.push(email);
128+
}
129+
// Auto change status when 10 emails sent
130+
if (emailInvitesLog.length === 10 && emailInvitesStatus !== 'Paid' && emailInvitesStatus !== 'Payment Pending') {
131+
emailInvitesStatus = 'Payment Pending';
132+
}
133+
// put the tracking update in growsurf
134+
const updateRed = await fetch(`${PROXY_ENDPOINT}/growsurf/participant/${growSurf.data.id}`, {
135+
method: 'PATCH',
136+
headers: {
137+
'Content-Type': 'application/json',
138+
Authorization: `Bearer ${tokenV3}`,
155139
},
156-
}),
157-
});
158-
if (updateRed.status >= 300) {
159-
this.setState({
160-
isReferrError: await updateRed.json(),
140+
body: JSON.stringify({
141+
...growSurf.data,
142+
metadata: {
143+
...growSurf.data.metadata,
144+
emailInvitesSent: Number(growSurf.data.metadata.emailInvitesSent || 0) + 1,
145+
emailInvitesLog: emailInvitesLog.join(),
146+
emailInvitesStatus,
147+
},
148+
}),
161149
});
162-
// exit no email tracking due to the error
163-
// just notify the user about it
164-
return;
150+
if (updateRed.status >= 300) {
151+
this.setState({
152+
isReferrError: await updateRed.json(),
153+
});
154+
// exit no email tracking due to the error
155+
// just notify the user about it
156+
return;
157+
}
165158
}
166159
// finally do:
167160
this.setState({

0 commit comments

Comments
 (0)