Skip to content

Commit a11dfe3

Browse files
Merge pull request #5589 from topcoder-platform/develop
Release v1.9.9
2 parents c09d7df + 717a07d commit a11dfe3

File tree

16 files changed

+283
-79
lines changed

16 files changed

+283
-79
lines changed

__tests__/shared/components/GUIKit/Datepicker/__snapshots__/index.jsx.snap

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,8 @@ exports[`Default render 1`] = `
3838
isRTL={false}
3939
keepFocusOnInput={false}
4040
keepOpenOnDateSelect={false}
41+
maxDate={null}
42+
minDate={null}
4143
monthFormat="MMMM YYYY"
4244
navNext={
4345
<IconNext

automated-smoke-test/conf.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,8 @@ exports.config = {
4141
// '../temp/test-suites/tc-header.spec.js',
4242
// '../temp/test-suites/tc-footer.spec.js',
4343
// '../temp/test-suites/tc-preferences.spec.js',
44-
'../temp/test-suites/tc-challenge-listing.spec.js',
45-
// '../temp/test-suites/tc-challenge-detail.spec.js',
44+
'../temp/test-suites/tc-challenge-listing.spec.js',
45+
'../temp/test-suites/tc-challenge-detail.spec.js',
4646
// '../temp/test-suites/tc-my-dashboard.spec.js',
4747
// '../temp/test-suites/tc-member-profile.spec.js',
4848
],
Lines changed: 107 additions & 0 deletions
Loading
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
{
2+
"challengeFilter": {
3+
"events": ["tco22"]
4+
},
5+
"communityId": "tco22",
6+
"communityName": "TCO22",
7+
"groupIds": [],
8+
"hideSearch": true,
9+
"logos": [{
10+
"img": "/community-app-assets/themes/tco/TCO22.svg",
11+
"url": "https://tco22.topcoder.com"
12+
}],
13+
"menuItems": [{
14+
"navigationMenu": "5zZw57ZcKXWfOwwWbk5VnL"
15+
}],
16+
"newsFeed": "http://www.topcoder.com/feed",
17+
"subdomains": ["tco22"],
18+
"description": "2022 Topcoder Open. The Ultimate Programming & Design Tournament",
19+
"image": "tco22.jpg"
20+
}

src/shared/components/Contentful/ArticleCard/ArticleCard.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,7 @@ class ArticleCard extends React.Component {
250250
{
251251
showArticleInfo() && (
252252
<p className={theme.readTimeInfo}>
253-
{themeName === 'Article large' ? <span>&nbsp;.&nbsp;</span> : null}
253+
{themeName === 'Article large' && contentAuthor && contentAuthor.length > 0 ? <span>&nbsp;.&nbsp;</span> : null}
254254
{
255255
contentAuthor && contentAuthor.length > 0 ? (
256256
<Link

src/shared/components/Contentful/SearchPageFilter/FilterDate/index.jsx

Lines changed: 23 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,8 @@ import moment from 'moment';
55
import PT from 'prop-types';
66
import React from 'react';
77
import { themr } from 'react-css-super-themr';
8-
import DatePicker from 'components/challenge-listing/Filters/DatePicker';
8+
import Datepicker from 'components/GUIKit/Datepicker';
99
import CalendarWeek from 'react-dates/lib/components/CalendarWeek';
10-
import IconCalendar from 'assets/images/tc-edu/icon-calendar.svg';
1110
import defaultTheme from './themes/default.scss';
1211

1312
// eslint-disable-next-line no-unused-expressions, react/forbid-foreign-prop-types
@@ -25,22 +24,29 @@ export function FilterDateInner(props) {
2524

2625
return (
2726
<div className={`${theme.container} ${className}`}>
28-
<span className={theme.title}>From</span>
29-
<IconCalendar />
30-
<DatePicker
31-
displayFormat="MMM D, YYYY"
32-
date={startDate}
33-
numberOfMonths={1}
34-
id="date-picker-start-date"
35-
onDateChange={(date) => { onSelectStartDate(date); }}
27+
<Datepicker
28+
label="Date Start"
29+
value={startDate}
30+
onChange={(date) => {
31+
if (date instanceof Date) onSelectStartDate(moment(date));
32+
}}
33+
size="xs"
34+
isOutsideRange={day => moment().isBefore(day)}
35+
displayFormat="M/DD/YYYY"
36+
hideCustomInputIcon
37+
errorMsg={startDate > endDate ? 'From should be before end' : null}
3638
/>
37-
<span className={theme.separator}>-</span>
38-
<DatePicker
39-
displayFormat="MMM D, YYYY"
40-
date={endDate}
41-
numberOfMonths={1}
42-
id="date-picker-end-date"
43-
onDateChange={(date) => { onSelectEndDate(date); }}
39+
<div className={theme.separator} />
40+
<Datepicker
41+
label="Date End"
42+
value={endDate}
43+
onChange={(date) => {
44+
if (date instanceof Date) onSelectEndDate(moment(date));
45+
}}
46+
size="xs"
47+
isOutsideRange={day => moment().isSameOrBefore(day)}
48+
displayFormat="M/DD/YYYY"
49+
hideCustomInputIcon
4450
/>
4551
</div>
4652
);

src/shared/components/Contentful/SearchPageFilter/FilterDate/themes/default.scss

Lines changed: 5 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -2,58 +2,20 @@
22

33
$text-black: #2a2a2a;
44

5-
@mixin ellipsis {
6-
white-space: nowrap;
7-
overflow: hidden;
8-
text-overflow: ellipsis;
9-
min-width: 0;
10-
}
11-
125
.container {
136
@include roboto-regular;
147

158
display: flex;
169
flex-direction: row;
1710
color: $text-black;
18-
background-color: $tc-white;
19-
border-radius: 6px;
20-
border: 1px solid #aaa;
2111
position: relative;
22-
width: 100%;
23-
align-items: center;
24-
padding-left: 10px;
2512
font-size: 14px;
26-
height: 38px;
27-
max-width: 235px;
28-
29-
:global {
30-
.SingleDatePicker {
31-
width: 90px;
32-
margin-left: 6px;
33-
}
34-
35-
input {
36-
height: 21px !important;
37-
margin: 0 !important;
38-
padding: 0 !important;
39-
font-size: 14px !important;
40-
border: none !important;
41-
box-shadow: none !important;
42-
}
43-
}
44-
}
45-
46-
.title {
47-
position: absolute;
48-
color: #aaa;
49-
font-size: 12px;
50-
background: $tc-white;
51-
padding: 0 7px;
52-
left: 8px;
53-
top: -7px;
5413
}
5514

5615
.separator {
57-
margin-left: 3px;
58-
margin-right: 3px;
16+
margin: 0 6px;
17+
width: 6px;
18+
height: 1px;
19+
background-color: $text-black;
20+
margin-top: 20px;
5921
}

src/shared/components/Contentful/SearchPageFilter/SearchPageFilter.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ SearchPageFilterInner.defaultProps = {
201201
onApply: () => { },
202202
selectedAuthor: DEF_SELECTED_AUTHOR,
203203
authorList: [DEF_SELECTED_AUTHOR],
204-
startDate: moment('2001-01-02'),
204+
startDate: moment('2001-01-01'),
205205
endDate: moment(),
206206
tags: [],
207207
selectedCategory: '',

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ $green-color: #137d60;
3030
}
3131

3232
.track-date-container {
33-
margin-top: 27px;
33+
margin-top: 43px;
3434
}
3535

3636
.author-container {

src/shared/components/Contentful/TracksFilter/TracksDate/index.jsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,15 +24,15 @@ export function TracksDateInner(props) {
2424
<Datepicker
2525
label="Date Start"
2626
value={startDate}
27-
onChange={(date) => { onSelectStartDate(date); }}
27+
onChange={(date) => { if (date instanceof Date) onSelectStartDate(date); }}
2828
size="xs"
2929
isOutsideRange={day => moment().isSameOrBefore(day)}
3030
/>
3131
<div className={theme.separator} />
3232
<Datepicker
3333
label="Date End"
3434
value={endDate}
35-
onChange={(date) => { onSelectEndDate(date); }}
35+
onChange={(date) => { if (date instanceof Date) onSelectEndDate(date); }}
3636
size="xs"
3737
isOutsideRange={day => moment().isSameOrBefore(day)}
3838
/>

src/shared/components/GUIKit/Datepicker/index.jsx

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,11 @@ function Datepicker({
2727
required,
2828
size,
2929
isOutsideRange,
30+
hideCustomInputIcon,
31+
isDayBlocked,
32+
displayFormat,
33+
minDate,
34+
maxDate,
3035
}) {
3136
const sizeStyle = size === 'lg' ? 'lgSize' : 'xsSize';
3237
const [date, setDate] = useState(value ? moment(value) : null);
@@ -43,7 +48,7 @@ function Datepicker({
4348
>
4449
<SingleDatePicker
4550
hideKeyboardShortcutsPanel
46-
customInputIcon={<IconCalendar />}
51+
customInputIcon={hideCustomInputIcon ? null : <IconCalendar />}
4752
date={date}
4853
onDateChange={(changedDate) => {
4954
setDate(changedDate);
@@ -58,13 +63,16 @@ function Datepicker({
5863
numberOfMonths={1}
5964
navPrev={<IconPrev />}
6065
navNext={<IconNext />}
61-
displayFormat="MMM DD, YYYY"
66+
displayFormat={displayFormat}
6267
daySize={width > 600 ? 47 : 35}
6368
renderDayContents={d => (<div>{d.date ? d.date() : ''}</div>)}
6469
enableOutsideDays
6570
firstDayOfWeek={1}
6671
weekDayFormat="ddd"
6772
isOutsideRange={isOutsideRange}
73+
isDayBlocked={isDayBlocked}
74+
minDate={minDate}
75+
maxDate={maxDate}
6876
/>
6977
{label ? (
7078
<span styleName="label">
@@ -86,6 +94,11 @@ Datepicker.defaultProps = {
8694
required: false,
8795
size: 'lg',
8896
isOutsideRange: day => moment().isSameOrAfter(day),
97+
hideCustomInputIcon: false,
98+
isDayBlocked: () => false,
99+
displayFormat: 'MMM DD, YYYY',
100+
minDate: null,
101+
maxDate: null,
89102
};
90103

91104
Datepicker.propTypes = {
@@ -97,6 +110,11 @@ Datepicker.propTypes = {
97110
required: PT.bool,
98111
size: PT.oneOf(['xs', 'lg']),
99112
isOutsideRange: PT.func,
113+
hideCustomInputIcon: PT.bool,
114+
isDayBlocked: PT.func,
115+
displayFormat: PT.string,
116+
minDate: PT.instanceOf(moment),
117+
maxDate: PT.instanceOf(moment),
100118
};
101119

102120
export default Datepicker;

0 commit comments

Comments
 (0)