From 4597e7418238279781574a20484033c393fbc980 Mon Sep 17 00:00:00 2001 From: Luiz Ricardo Rodrigues Date: Sat, 24 Sep 2022 07:00:20 -0300 Subject: [PATCH 01/13] ci: deploy develop branch to Dev env --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 5b87843434..1ed1928599 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -349,7 +349,7 @@ workflows: filters: branches: only: - - free + - develop # This is alternate dev env for parallel testing - "build-test": context : org-global From a309c18ff53f9186edba3c612aaca79ad48441fe Mon Sep 17 00:00:00 2001 From: lunarkid <4476442+dedywahyudi@users.noreply.github.com> Date: Fri, 23 Sep 2022 20:27:27 +0700 Subject: [PATCH 02/13] fix: remove Email button --- .../Specification/SideBar/ShareSocial.jsx | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/src/shared/components/challenge-detail/Specification/SideBar/ShareSocial.jsx b/src/shared/components/challenge-detail/Specification/SideBar/ShareSocial.jsx index a48b1fdcfa..ca48fae0f9 100644 --- a/src/shared/components/challenge-detail/Specification/SideBar/ShareSocial.jsx +++ b/src/shared/components/challenge-detail/Specification/SideBar/ShareSocial.jsx @@ -6,7 +6,6 @@ import React from 'react'; import TwitterIcon from '../../../../../assets/images/social/icon_twitter.svg'; import FacebookIcon from '../../../../../assets/images/social/icon_facebook.svg'; -import EmailIcon from '../../../../../assets/images/social/icon_email.svg'; import MoreIcon from '../../../../../assets/images/social/icon_plus.svg'; import './social_media.scss'; @@ -48,15 +47,6 @@ export default class ShareSocial extends React.Component { > - - - Date: Tue, 27 Sep 2022 07:47:12 +0700 Subject: [PATCH 03/13] fix: remove email option for extra buttons --- .../challenge-detail/Specification/SideBar/ShareSocial.jsx | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/shared/components/challenge-detail/Specification/SideBar/ShareSocial.jsx b/src/shared/components/challenge-detail/Specification/SideBar/ShareSocial.jsx index ca48fae0f9..6a7b65584a 100644 --- a/src/shared/components/challenge-detail/Specification/SideBar/ShareSocial.jsx +++ b/src/shared/components/challenge-detail/Specification/SideBar/ShareSocial.jsx @@ -22,8 +22,15 @@ export default class ShareSocial extends React.Component { } } else { const scriptNode = document.createElement('script'); + const scriptNodeConfig = document.createElement('script'); + + scriptNode.type = 'text/javascript'; + scriptNodeConfig.type = 'text/javascript'; scriptNode.src = 'https://s7.addthis.com/js/300/addthis_widget.js#pubid=ra-52f22306211cecfc'; + scriptNodeConfig.text = "var addthis_config = { services_exclude: 'email' };"; + this.shareDiv.appendChild(scriptNode); + this.shareDiv.appendChild(scriptNodeConfig); } } From 6d3464cb5da3f4a8b81e4618f1d8c30d494d9563 Mon Sep 17 00:00:00 2001 From: lunarkid <4476442+dedywahyudi@users.noreply.github.com> Date: Tue, 13 Sep 2022 19:58:22 +0700 Subject: [PATCH 04/13] fix: no challenges found --- .../Listing/__snapshots__/Bucket.jsx.snap | 1 + .../challenge-listing/Listing/Bucket/index.jsx | 11 ++++++++++- .../Listing/ReviewOpportunityBucket/index.jsx | 6 +++++- .../components/challenge-listing/Listing/index.jsx | 4 ++++ src/shared/components/challenge-listing/index.jsx | 2 ++ .../containers/challenge-listing/Listing/index.jsx | 9 +++++++++ 6 files changed, 31 insertions(+), 2 deletions(-) diff --git a/__tests__/shared/components/challenge-listing/Listing/__snapshots__/Bucket.jsx.snap b/__tests__/shared/components/challenge-listing/Listing/__snapshots__/Bucket.jsx.snap index 425cddd325..fec74b8d5f 100644 --- a/__tests__/shared/components/challenge-listing/Listing/__snapshots__/Bucket.jsx.snap +++ b/__tests__/shared/components/challenge-listing/Listing/__snapshots__/Bucket.jsx.snap @@ -84,6 +84,7 @@ exports[`Matches shallow shapshot 1`] = ` expanding={false} loadMore={[MockFunction]} loading={false} + needLoad={false} newChallengeDetails={false} openChallengesInNewTabs={false} setFilterState={[MockFunction]} diff --git a/src/shared/components/challenge-listing/Listing/Bucket/index.jsx b/src/shared/components/challenge-listing/Listing/Bucket/index.jsx index e500d0af64..1874051d81 100644 --- a/src/shared/components/challenge-listing/Listing/Bucket/index.jsx +++ b/src/shared/components/challenge-listing/Listing/Bucket/index.jsx @@ -24,6 +24,7 @@ import './style.scss'; // const COLLAPSED_SIZE = 10; // const Filter = challengeUtils.filter; +const LOADING_MESSAGE = 'Loading Challenges'; export default function Bucket({ bucket, @@ -36,6 +37,7 @@ export default function Bucket({ expand, filterState, // keepPlaceholders, + needLoad, loading, loadMore, newChallengeDetails, @@ -137,7 +139,12 @@ export default function Bucket({ title={BUCKET_DATA[bucket].name} />

- {`${NO_LIVE_CHALLENGES_CONFIG[activeBucket]}`} + { + needLoad ? LOADING_MESSAGE + : ( + `${NO_LIVE_CHALLENGES_CONFIG[activeBucket]}` + ) + }

@@ -262,6 +269,7 @@ Bucket.defaultProps = { expand: _.noop, challengeTypes: [], // keepPlaceholders: false, + needLoad: false, loading: false, loadMore: null, newChallengeDetails: false, @@ -286,6 +294,7 @@ Bucket.propTypes = { challengesUrl: PT.string.isRequired, filterState: PT.shape().isRequired, // keepPlaceholders: PT.bool, + needLoad: PT.bool, loading: PT.bool, loadMore: PT.func, newChallengeDetails: PT.bool, diff --git a/src/shared/components/challenge-listing/Listing/ReviewOpportunityBucket/index.jsx b/src/shared/components/challenge-listing/Listing/ReviewOpportunityBucket/index.jsx index bd59cf7b11..07cc41627d 100644 --- a/src/shared/components/challenge-listing/Listing/ReviewOpportunityBucket/index.jsx +++ b/src/shared/components/challenge-listing/Listing/ReviewOpportunityBucket/index.jsx @@ -17,6 +17,7 @@ import './style.scss'; const Filter = challengeUtils.filter; const NO_RESULTS_MESSAGE = 'No challenges found'; +const LOADING_MESSAGE = 'Loading Challenges'; // Functional implementation of ReviewOpportunityBucket component export default function ReviewOpportunityBucket({ @@ -26,6 +27,7 @@ export default function ReviewOpportunityBucket({ expandTag, filterState, keepPlaceholders, + needLoad, loading, loadMore, opportunities, @@ -133,7 +135,7 @@ export default function ReviewOpportunityBucket({ onSelect={setSort} />

- {NO_RESULTS_MESSAGE} + {needLoad ? LOADING_MESSAGE : NO_RESULTS_MESSAGE}

@@ -154,6 +156,7 @@ ReviewOpportunityBucket.defaultProps = { expandedTags: [], expandTag: null, keepPlaceholders: false, + needLoad: false, loading: false, loadMore: null, sort: null, @@ -169,6 +172,7 @@ ReviewOpportunityBucket.propTypes = { filterState: PT.shape().isRequired, opportunities: PT.arrayOf(PT.shape()).isRequired, keepPlaceholders: PT.bool, + needLoad: PT.bool, loading: PT.bool, loadMore: PT.func, setFilterState: PT.func.isRequired, diff --git a/src/shared/components/challenge-listing/Listing/index.jsx b/src/shared/components/challenge-listing/Listing/index.jsx index 1c2c1d47b9..3b91331059 100644 --- a/src/shared/components/challenge-listing/Listing/index.jsx +++ b/src/shared/components/challenge-listing/Listing/index.jsx @@ -40,6 +40,7 @@ function Listing({ // extraBucket, filterState, keepPastPlaceholders, + needLoad, loadingPastChallenges, loadingReviewOpportunities, loadingMyChallenges, @@ -152,6 +153,7 @@ function Listing({ expandTag={expandTag} filterState={filterState} keepPlaceholders={keepPastPlaceholders} + needLoad={needLoad} loading={loadingReviewOpportunities} loadMore={loadMoreReviewOpportunities} opportunities={reviewOpportunities} @@ -182,6 +184,7 @@ function Listing({ expandTag={expandTag} filterState={filterState} // keepPlaceholders={keepPlaceholders} + needLoad={needLoad} loading={loading} loadMore={loadMore} newChallengeDetails={newChallengeDetails} @@ -322,6 +325,7 @@ Listing.propTypes = { // extraBucket: PT.string, filterState: PT.shape().isRequired, keepPastPlaceholders: PT.bool.isRequired, + needLoad: PT.bool.isRequired, loadingPastChallenges: PT.bool.isRequired, loadingMyChallenges: PT.bool.isRequired, loadingMyPastChallenges: PT.bool.isRequired, diff --git a/src/shared/components/challenge-listing/index.jsx b/src/shared/components/challenge-listing/index.jsx index 9200762e64..00b5c564e7 100644 --- a/src/shared/components/challenge-listing/index.jsx +++ b/src/shared/components/challenge-listing/index.jsx @@ -118,6 +118,7 @@ export default function ChallengeListing(props) { // extraBucket={extraBucket} filterState={props.filterState} keepPastPlaceholders={keepPastPlaceholders} + needLoad={props.needLoad} loadingPastChallenges={props.loadingPastChallenges} loadingMyChallenges={props.loadingMyChallenges} loadingMyPastChallenges={props.loadingMyPastChallenges} @@ -241,6 +242,7 @@ ChallengeListing.propTypes = { keepPastPlaceholders: PT.bool.isRequired, // lastUpdateOfActiveChallenges: PT.number.isRequired, // loadingChallenges: PT.bool.isRequired, + needLoad: PT.bool.isRequired, loadingMyChallenges: PT.bool.isRequired, loadingMyPastChallenges: PT.bool.isRequired, loadingAllChallenges: PT.bool.isRequired, diff --git a/src/shared/containers/challenge-listing/Listing/index.jsx b/src/shared/containers/challenge-listing/Listing/index.jsx index d7f8bc97b6..446c485cf5 100644 --- a/src/shared/containers/challenge-listing/Listing/index.jsx +++ b/src/shared/containers/challenge-listing/Listing/index.jsx @@ -44,6 +44,7 @@ export class ListingContainer extends React.Component { super(props); this.state = { + needLoad: true, previousBucketOfActiveTab: null, previousBucketOfPastChallengesTab: null, }; @@ -65,6 +66,8 @@ export class ListingContainer extends React.Component { filter, } = this.props; + const { needLoad } = this.state; + markHeaderMenu(); if (queryBucket !== activeBucket && _.includes(BUCKETS, queryBucket)) { @@ -104,6 +107,10 @@ export class ListingContainer extends React.Component { }); } // } + + if (needLoad) { + this.setState({ needLoad: false }); + } } componentDidUpdate(prevProps) { @@ -495,6 +502,7 @@ export class ListingContainer extends React.Component { } = this.props; const { + needLoad, previousBucketOfActiveTab, previousBucketOfPastChallengesTab, } = this.state; @@ -630,6 +638,7 @@ export class ListingContainer extends React.Component { keepPastPlaceholders={keepPastPlaceholders} // lastUpdateOfActiveChallenges={lastUpdateOfActiveChallenges} // eslint-disable-next-line max-len + needLoad={needLoad} loadingMyChallenges={Boolean(loadingMyChallengesUUID)} loadingMyPastChallenges={Boolean(loadingMyPastChallengesUUID)} loadingAllChallenges={Boolean(loadingAllChallengesUUID)} From 847a6fe67487fde870ed1c275e28e39fe7507039 Mon Sep 17 00:00:00 2001 From: lunarkid <4476442+dedywahyudi@users.noreply.github.com> Date: Thu, 15 Sep 2022 18:27:38 +0700 Subject: [PATCH 05/13] fix: no challenges found --- .../components/challenge-listing/Listing/index.jsx | 10 +++++++++- .../containers/challenge-listing/Listing/index.jsx | 11 +++++------ 2 files changed, 14 insertions(+), 7 deletions(-) diff --git a/src/shared/components/challenge-listing/Listing/index.jsx b/src/shared/components/challenge-listing/Listing/index.jsx index 3b91331059..dc4b67d2d3 100644 --- a/src/shared/components/challenge-listing/Listing/index.jsx +++ b/src/shared/components/challenge-listing/Listing/index.jsx @@ -17,6 +17,7 @@ import CardPlaceholder from '../placeholders/ChallengeCard'; import './style.scss'; // const Filter = challengeUtils.filter; +const LOADING_MESSAGE = 'Loading Challenges'; function Listing({ activeBucket, @@ -258,7 +259,14 @@ function Listing({ loading ? placeholders : (!filterState.recommended || activeBucket !== 'openForRegistration') && ( -
{ `${NO_LIVE_CHALLENGES_CONFIG[activeBucket]}` }
+
+ { + needLoad ? LOADING_MESSAGE + : ( + `${NO_LIVE_CHALLENGES_CONFIG[activeBucket]}` + ) + } +
) } diff --git a/src/shared/containers/challenge-listing/Listing/index.jsx b/src/shared/containers/challenge-listing/Listing/index.jsx index 446c485cf5..84e6e13e03 100644 --- a/src/shared/containers/challenge-listing/Listing/index.jsx +++ b/src/shared/containers/challenge-listing/Listing/index.jsx @@ -66,8 +66,6 @@ export class ListingContainer extends React.Component { filter, } = this.props; - const { needLoad } = this.state; - markHeaderMenu(); if (queryBucket !== activeBucket && _.includes(BUCKETS, queryBucket)) { @@ -107,10 +105,6 @@ export class ListingContainer extends React.Component { }); } // } - - if (needLoad) { - this.setState({ needLoad: false }); - } } componentDidUpdate(prevProps) { @@ -140,6 +134,7 @@ export class ListingContainer extends React.Component { getPastChallenges, filterState, } = this.props; + const { needLoad } = this.state; const oldUserId = _.get(prevProps, 'auth.user.userId'); const userId = _.get(this.props, 'auth.user.userId'); const handle = _.get(auth, 'user.handle'); @@ -264,6 +259,10 @@ export class ListingContainer extends React.Component { } if (filterChanged(filter, prevProps.filter)) { this.reloadChallenges(); + if (needLoad) { + // eslint-disable-next-line react/no-did-update-set-state + this.setState({ needLoad: false }); + } } setTimeout(() => { selectBucketDone(); From 8ac0de242fa35dd02fe3a2a7da8fc84f7531cfe1 Mon Sep 17 00:00:00 2001 From: lunarkid <4476442+dedywahyudi@users.noreply.github.com> Date: Tue, 20 Sep 2022 20:08:22 +0700 Subject: [PATCH 06/13] fix: no challenges found for logged in --- .../components/challenge-listing/Listing/style.scss | 1 + .../containers/challenge-listing/Listing/index.jsx | 10 ++++++++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/src/shared/components/challenge-listing/Listing/style.scss b/src/shared/components/challenge-listing/Listing/style.scss index 01cf13123b..3f9dca87c5 100644 --- a/src/shared/components/challenge-listing/Listing/style.scss +++ b/src/shared/components/challenge-listing/Listing/style.scss @@ -3,6 +3,7 @@ .challengeCardContainer { border-radius: $corner-radius; width: 76.5%; + margin-left: auto; @include xs-to-md { width: 100%; diff --git a/src/shared/containers/challenge-listing/Listing/index.jsx b/src/shared/containers/challenge-listing/Listing/index.jsx index 84e6e13e03..e0c1610e0a 100644 --- a/src/shared/containers/challenge-listing/Listing/index.jsx +++ b/src/shared/containers/challenge-listing/Listing/index.jsx @@ -133,8 +133,8 @@ export class ListingContainer extends React.Component { dropPastChallenges, getPastChallenges, filterState, + loading, } = this.props; - const { needLoad } = this.state; const oldUserId = _.get(prevProps, 'auth.user.userId'); const userId = _.get(this.props, 'auth.user.userId'); const handle = _.get(auth, 'user.handle'); @@ -259,7 +259,7 @@ export class ListingContainer extends React.Component { } if (filterChanged(filter, prevProps.filter)) { this.reloadChallenges(); - if (needLoad) { + if (!loading) { // eslint-disable-next-line react/no-did-update-set-state this.setState({ needLoad: false }); } @@ -714,6 +714,7 @@ ListingContainer.defaultProps = { queryBucket: BUCKETS.OPEN_FOR_REGISTRATION, meta: {}, expanding: false, + loading: false, // isBucketSwitching: false, // userChallenges: [], }; @@ -813,6 +814,7 @@ ListingContainer.propTypes = { // getUserChallenges: PT.func.isRequired, setSearchText: PT.func.isRequired, filterState: PT.shape().isRequired, + loading: PT.bool, }; const mapStateToProps = (state, ownProps) => { @@ -873,6 +875,10 @@ const mapStateToProps = (state, ownProps) => { meta: cl.meta, // userChallenges: cl.userChallenges, filterState: cl.filter, + loading: Boolean(cl.loadingActiveChallengesUUID) + || Boolean(cl.loadingOpenForRegistrationChallengesUUID) + || Boolean(cl.loadingMyChallengesUUID) || Boolean(cl.loadingAllChallengesUUID) + || Boolean(cl.loadingPastChallengesUUID) || cl.loadingReviewOpportunitiesUUID, }; }; From 7b3a22ce3da3dc772a28a8da8097d015fb762353 Mon Sep 17 00:00:00 2001 From: lunarkid <4476442+dedywahyudi@users.noreply.github.com> Date: Tue, 13 Sep 2022 19:58:22 +0700 Subject: [PATCH 07/13] fix: no challenges found --- .../Listing/__snapshots__/Bucket.jsx.snap | 1 + .../challenge-listing/Listing/Bucket/index.jsx | 11 ++++++++++- .../Listing/ReviewOpportunityBucket/index.jsx | 6 +++++- .../components/challenge-listing/Listing/index.jsx | 4 ++++ src/shared/components/challenge-listing/index.jsx | 2 ++ .../containers/challenge-listing/Listing/index.jsx | 9 +++++++++ 6 files changed, 31 insertions(+), 2 deletions(-) diff --git a/__tests__/shared/components/challenge-listing/Listing/__snapshots__/Bucket.jsx.snap b/__tests__/shared/components/challenge-listing/Listing/__snapshots__/Bucket.jsx.snap index 425cddd325..fec74b8d5f 100644 --- a/__tests__/shared/components/challenge-listing/Listing/__snapshots__/Bucket.jsx.snap +++ b/__tests__/shared/components/challenge-listing/Listing/__snapshots__/Bucket.jsx.snap @@ -84,6 +84,7 @@ exports[`Matches shallow shapshot 1`] = ` expanding={false} loadMore={[MockFunction]} loading={false} + needLoad={false} newChallengeDetails={false} openChallengesInNewTabs={false} setFilterState={[MockFunction]} diff --git a/src/shared/components/challenge-listing/Listing/Bucket/index.jsx b/src/shared/components/challenge-listing/Listing/Bucket/index.jsx index e500d0af64..1874051d81 100644 --- a/src/shared/components/challenge-listing/Listing/Bucket/index.jsx +++ b/src/shared/components/challenge-listing/Listing/Bucket/index.jsx @@ -24,6 +24,7 @@ import './style.scss'; // const COLLAPSED_SIZE = 10; // const Filter = challengeUtils.filter; +const LOADING_MESSAGE = 'Loading Challenges'; export default function Bucket({ bucket, @@ -36,6 +37,7 @@ export default function Bucket({ expand, filterState, // keepPlaceholders, + needLoad, loading, loadMore, newChallengeDetails, @@ -137,7 +139,12 @@ export default function Bucket({ title={BUCKET_DATA[bucket].name} />

- {`${NO_LIVE_CHALLENGES_CONFIG[activeBucket]}`} + { + needLoad ? LOADING_MESSAGE + : ( + `${NO_LIVE_CHALLENGES_CONFIG[activeBucket]}` + ) + }

@@ -262,6 +269,7 @@ Bucket.defaultProps = { expand: _.noop, challengeTypes: [], // keepPlaceholders: false, + needLoad: false, loading: false, loadMore: null, newChallengeDetails: false, @@ -286,6 +294,7 @@ Bucket.propTypes = { challengesUrl: PT.string.isRequired, filterState: PT.shape().isRequired, // keepPlaceholders: PT.bool, + needLoad: PT.bool, loading: PT.bool, loadMore: PT.func, newChallengeDetails: PT.bool, diff --git a/src/shared/components/challenge-listing/Listing/ReviewOpportunityBucket/index.jsx b/src/shared/components/challenge-listing/Listing/ReviewOpportunityBucket/index.jsx index bd59cf7b11..07cc41627d 100644 --- a/src/shared/components/challenge-listing/Listing/ReviewOpportunityBucket/index.jsx +++ b/src/shared/components/challenge-listing/Listing/ReviewOpportunityBucket/index.jsx @@ -17,6 +17,7 @@ import './style.scss'; const Filter = challengeUtils.filter; const NO_RESULTS_MESSAGE = 'No challenges found'; +const LOADING_MESSAGE = 'Loading Challenges'; // Functional implementation of ReviewOpportunityBucket component export default function ReviewOpportunityBucket({ @@ -26,6 +27,7 @@ export default function ReviewOpportunityBucket({ expandTag, filterState, keepPlaceholders, + needLoad, loading, loadMore, opportunities, @@ -133,7 +135,7 @@ export default function ReviewOpportunityBucket({ onSelect={setSort} />

- {NO_RESULTS_MESSAGE} + {needLoad ? LOADING_MESSAGE : NO_RESULTS_MESSAGE}

@@ -154,6 +156,7 @@ ReviewOpportunityBucket.defaultProps = { expandedTags: [], expandTag: null, keepPlaceholders: false, + needLoad: false, loading: false, loadMore: null, sort: null, @@ -169,6 +172,7 @@ ReviewOpportunityBucket.propTypes = { filterState: PT.shape().isRequired, opportunities: PT.arrayOf(PT.shape()).isRequired, keepPlaceholders: PT.bool, + needLoad: PT.bool, loading: PT.bool, loadMore: PT.func, setFilterState: PT.func.isRequired, diff --git a/src/shared/components/challenge-listing/Listing/index.jsx b/src/shared/components/challenge-listing/Listing/index.jsx index 1c2c1d47b9..3b91331059 100644 --- a/src/shared/components/challenge-listing/Listing/index.jsx +++ b/src/shared/components/challenge-listing/Listing/index.jsx @@ -40,6 +40,7 @@ function Listing({ // extraBucket, filterState, keepPastPlaceholders, + needLoad, loadingPastChallenges, loadingReviewOpportunities, loadingMyChallenges, @@ -152,6 +153,7 @@ function Listing({ expandTag={expandTag} filterState={filterState} keepPlaceholders={keepPastPlaceholders} + needLoad={needLoad} loading={loadingReviewOpportunities} loadMore={loadMoreReviewOpportunities} opportunities={reviewOpportunities} @@ -182,6 +184,7 @@ function Listing({ expandTag={expandTag} filterState={filterState} // keepPlaceholders={keepPlaceholders} + needLoad={needLoad} loading={loading} loadMore={loadMore} newChallengeDetails={newChallengeDetails} @@ -322,6 +325,7 @@ Listing.propTypes = { // extraBucket: PT.string, filterState: PT.shape().isRequired, keepPastPlaceholders: PT.bool.isRequired, + needLoad: PT.bool.isRequired, loadingPastChallenges: PT.bool.isRequired, loadingMyChallenges: PT.bool.isRequired, loadingMyPastChallenges: PT.bool.isRequired, diff --git a/src/shared/components/challenge-listing/index.jsx b/src/shared/components/challenge-listing/index.jsx index 9200762e64..00b5c564e7 100644 --- a/src/shared/components/challenge-listing/index.jsx +++ b/src/shared/components/challenge-listing/index.jsx @@ -118,6 +118,7 @@ export default function ChallengeListing(props) { // extraBucket={extraBucket} filterState={props.filterState} keepPastPlaceholders={keepPastPlaceholders} + needLoad={props.needLoad} loadingPastChallenges={props.loadingPastChallenges} loadingMyChallenges={props.loadingMyChallenges} loadingMyPastChallenges={props.loadingMyPastChallenges} @@ -241,6 +242,7 @@ ChallengeListing.propTypes = { keepPastPlaceholders: PT.bool.isRequired, // lastUpdateOfActiveChallenges: PT.number.isRequired, // loadingChallenges: PT.bool.isRequired, + needLoad: PT.bool.isRequired, loadingMyChallenges: PT.bool.isRequired, loadingMyPastChallenges: PT.bool.isRequired, loadingAllChallenges: PT.bool.isRequired, diff --git a/src/shared/containers/challenge-listing/Listing/index.jsx b/src/shared/containers/challenge-listing/Listing/index.jsx index d7f8bc97b6..446c485cf5 100644 --- a/src/shared/containers/challenge-listing/Listing/index.jsx +++ b/src/shared/containers/challenge-listing/Listing/index.jsx @@ -44,6 +44,7 @@ export class ListingContainer extends React.Component { super(props); this.state = { + needLoad: true, previousBucketOfActiveTab: null, previousBucketOfPastChallengesTab: null, }; @@ -65,6 +66,8 @@ export class ListingContainer extends React.Component { filter, } = this.props; + const { needLoad } = this.state; + markHeaderMenu(); if (queryBucket !== activeBucket && _.includes(BUCKETS, queryBucket)) { @@ -104,6 +107,10 @@ export class ListingContainer extends React.Component { }); } // } + + if (needLoad) { + this.setState({ needLoad: false }); + } } componentDidUpdate(prevProps) { @@ -495,6 +502,7 @@ export class ListingContainer extends React.Component { } = this.props; const { + needLoad, previousBucketOfActiveTab, previousBucketOfPastChallengesTab, } = this.state; @@ -630,6 +638,7 @@ export class ListingContainer extends React.Component { keepPastPlaceholders={keepPastPlaceholders} // lastUpdateOfActiveChallenges={lastUpdateOfActiveChallenges} // eslint-disable-next-line max-len + needLoad={needLoad} loadingMyChallenges={Boolean(loadingMyChallengesUUID)} loadingMyPastChallenges={Boolean(loadingMyPastChallengesUUID)} loadingAllChallenges={Boolean(loadingAllChallengesUUID)} From 1ad9e06eab0ffb3eb7c74c80e218108007d3d961 Mon Sep 17 00:00:00 2001 From: lunarkid <4476442+dedywahyudi@users.noreply.github.com> Date: Thu, 15 Sep 2022 18:27:38 +0700 Subject: [PATCH 08/13] fix: no challenges found --- .../components/challenge-listing/Listing/index.jsx | 10 +++++++++- .../containers/challenge-listing/Listing/index.jsx | 11 +++++------ 2 files changed, 14 insertions(+), 7 deletions(-) diff --git a/src/shared/components/challenge-listing/Listing/index.jsx b/src/shared/components/challenge-listing/Listing/index.jsx index 3b91331059..dc4b67d2d3 100644 --- a/src/shared/components/challenge-listing/Listing/index.jsx +++ b/src/shared/components/challenge-listing/Listing/index.jsx @@ -17,6 +17,7 @@ import CardPlaceholder from '../placeholders/ChallengeCard'; import './style.scss'; // const Filter = challengeUtils.filter; +const LOADING_MESSAGE = 'Loading Challenges'; function Listing({ activeBucket, @@ -258,7 +259,14 @@ function Listing({ loading ? placeholders : (!filterState.recommended || activeBucket !== 'openForRegistration') && ( -
{ `${NO_LIVE_CHALLENGES_CONFIG[activeBucket]}` }
+
+ { + needLoad ? LOADING_MESSAGE + : ( + `${NO_LIVE_CHALLENGES_CONFIG[activeBucket]}` + ) + } +
) } diff --git a/src/shared/containers/challenge-listing/Listing/index.jsx b/src/shared/containers/challenge-listing/Listing/index.jsx index 446c485cf5..84e6e13e03 100644 --- a/src/shared/containers/challenge-listing/Listing/index.jsx +++ b/src/shared/containers/challenge-listing/Listing/index.jsx @@ -66,8 +66,6 @@ export class ListingContainer extends React.Component { filter, } = this.props; - const { needLoad } = this.state; - markHeaderMenu(); if (queryBucket !== activeBucket && _.includes(BUCKETS, queryBucket)) { @@ -107,10 +105,6 @@ export class ListingContainer extends React.Component { }); } // } - - if (needLoad) { - this.setState({ needLoad: false }); - } } componentDidUpdate(prevProps) { @@ -140,6 +134,7 @@ export class ListingContainer extends React.Component { getPastChallenges, filterState, } = this.props; + const { needLoad } = this.state; const oldUserId = _.get(prevProps, 'auth.user.userId'); const userId = _.get(this.props, 'auth.user.userId'); const handle = _.get(auth, 'user.handle'); @@ -264,6 +259,10 @@ export class ListingContainer extends React.Component { } if (filterChanged(filter, prevProps.filter)) { this.reloadChallenges(); + if (needLoad) { + // eslint-disable-next-line react/no-did-update-set-state + this.setState({ needLoad: false }); + } } setTimeout(() => { selectBucketDone(); From 2bd260f2c1242d9e7bd0cf9cd981ae33c1d26216 Mon Sep 17 00:00:00 2001 From: lunarkid <4476442+dedywahyudi@users.noreply.github.com> Date: Tue, 20 Sep 2022 20:08:22 +0700 Subject: [PATCH 09/13] fix: no challenges found for logged in --- .../components/challenge-listing/Listing/style.scss | 1 + .../containers/challenge-listing/Listing/index.jsx | 10 ++++++++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/src/shared/components/challenge-listing/Listing/style.scss b/src/shared/components/challenge-listing/Listing/style.scss index 01cf13123b..3f9dca87c5 100644 --- a/src/shared/components/challenge-listing/Listing/style.scss +++ b/src/shared/components/challenge-listing/Listing/style.scss @@ -3,6 +3,7 @@ .challengeCardContainer { border-radius: $corner-radius; width: 76.5%; + margin-left: auto; @include xs-to-md { width: 100%; diff --git a/src/shared/containers/challenge-listing/Listing/index.jsx b/src/shared/containers/challenge-listing/Listing/index.jsx index 84e6e13e03..e0c1610e0a 100644 --- a/src/shared/containers/challenge-listing/Listing/index.jsx +++ b/src/shared/containers/challenge-listing/Listing/index.jsx @@ -133,8 +133,8 @@ export class ListingContainer extends React.Component { dropPastChallenges, getPastChallenges, filterState, + loading, } = this.props; - const { needLoad } = this.state; const oldUserId = _.get(prevProps, 'auth.user.userId'); const userId = _.get(this.props, 'auth.user.userId'); const handle = _.get(auth, 'user.handle'); @@ -259,7 +259,7 @@ export class ListingContainer extends React.Component { } if (filterChanged(filter, prevProps.filter)) { this.reloadChallenges(); - if (needLoad) { + if (!loading) { // eslint-disable-next-line react/no-did-update-set-state this.setState({ needLoad: false }); } @@ -714,6 +714,7 @@ ListingContainer.defaultProps = { queryBucket: BUCKETS.OPEN_FOR_REGISTRATION, meta: {}, expanding: false, + loading: false, // isBucketSwitching: false, // userChallenges: [], }; @@ -813,6 +814,7 @@ ListingContainer.propTypes = { // getUserChallenges: PT.func.isRequired, setSearchText: PT.func.isRequired, filterState: PT.shape().isRequired, + loading: PT.bool, }; const mapStateToProps = (state, ownProps) => { @@ -873,6 +875,10 @@ const mapStateToProps = (state, ownProps) => { meta: cl.meta, // userChallenges: cl.userChallenges, filterState: cl.filter, + loading: Boolean(cl.loadingActiveChallengesUUID) + || Boolean(cl.loadingOpenForRegistrationChallengesUUID) + || Boolean(cl.loadingMyChallengesUUID) || Boolean(cl.loadingAllChallengesUUID) + || Boolean(cl.loadingPastChallengesUUID) || cl.loadingReviewOpportunitiesUUID, }; }; From db7596bfe015d1c09c66965f70e508f8162694f5 Mon Sep 17 00:00:00 2001 From: lunarkid <4476442+dedywahyudi@users.noreply.github.com> Date: Sun, 2 Oct 2022 20:16:30 +0700 Subject: [PATCH 10/13] Revert "fix: no challenges found for logged in" This reverts commit 8ac0de242fa35dd02fe3a2a7da8fc84f7531cfe1. --- .../components/challenge-listing/Listing/style.scss | 1 - .../containers/challenge-listing/Listing/index.jsx | 10 ++-------- 2 files changed, 2 insertions(+), 9 deletions(-) diff --git a/src/shared/components/challenge-listing/Listing/style.scss b/src/shared/components/challenge-listing/Listing/style.scss index 3f9dca87c5..01cf13123b 100644 --- a/src/shared/components/challenge-listing/Listing/style.scss +++ b/src/shared/components/challenge-listing/Listing/style.scss @@ -3,7 +3,6 @@ .challengeCardContainer { border-radius: $corner-radius; width: 76.5%; - margin-left: auto; @include xs-to-md { width: 100%; diff --git a/src/shared/containers/challenge-listing/Listing/index.jsx b/src/shared/containers/challenge-listing/Listing/index.jsx index e0c1610e0a..84e6e13e03 100644 --- a/src/shared/containers/challenge-listing/Listing/index.jsx +++ b/src/shared/containers/challenge-listing/Listing/index.jsx @@ -133,8 +133,8 @@ export class ListingContainer extends React.Component { dropPastChallenges, getPastChallenges, filterState, - loading, } = this.props; + const { needLoad } = this.state; const oldUserId = _.get(prevProps, 'auth.user.userId'); const userId = _.get(this.props, 'auth.user.userId'); const handle = _.get(auth, 'user.handle'); @@ -259,7 +259,7 @@ export class ListingContainer extends React.Component { } if (filterChanged(filter, prevProps.filter)) { this.reloadChallenges(); - if (!loading) { + if (needLoad) { // eslint-disable-next-line react/no-did-update-set-state this.setState({ needLoad: false }); } @@ -714,7 +714,6 @@ ListingContainer.defaultProps = { queryBucket: BUCKETS.OPEN_FOR_REGISTRATION, meta: {}, expanding: false, - loading: false, // isBucketSwitching: false, // userChallenges: [], }; @@ -814,7 +813,6 @@ ListingContainer.propTypes = { // getUserChallenges: PT.func.isRequired, setSearchText: PT.func.isRequired, filterState: PT.shape().isRequired, - loading: PT.bool, }; const mapStateToProps = (state, ownProps) => { @@ -875,10 +873,6 @@ const mapStateToProps = (state, ownProps) => { meta: cl.meta, // userChallenges: cl.userChallenges, filterState: cl.filter, - loading: Boolean(cl.loadingActiveChallengesUUID) - || Boolean(cl.loadingOpenForRegistrationChallengesUUID) - || Boolean(cl.loadingMyChallengesUUID) || Boolean(cl.loadingAllChallengesUUID) - || Boolean(cl.loadingPastChallengesUUID) || cl.loadingReviewOpportunitiesUUID, }; }; From d00194c244711bb2706cac76e27512ad4d76caa7 Mon Sep 17 00:00:00 2001 From: lunarkid <4476442+dedywahyudi@users.noreply.github.com> Date: Sun, 2 Oct 2022 20:16:34 +0700 Subject: [PATCH 11/13] Revert "fix: no challenges found" This reverts commit 847a6fe67487fde870ed1c275e28e39fe7507039. --- .../components/challenge-listing/Listing/index.jsx | 10 +--------- .../containers/challenge-listing/Listing/index.jsx | 11 ++++++----- 2 files changed, 7 insertions(+), 14 deletions(-) diff --git a/src/shared/components/challenge-listing/Listing/index.jsx b/src/shared/components/challenge-listing/Listing/index.jsx index dc4b67d2d3..3b91331059 100644 --- a/src/shared/components/challenge-listing/Listing/index.jsx +++ b/src/shared/components/challenge-listing/Listing/index.jsx @@ -17,7 +17,6 @@ import CardPlaceholder from '../placeholders/ChallengeCard'; import './style.scss'; // const Filter = challengeUtils.filter; -const LOADING_MESSAGE = 'Loading Challenges'; function Listing({ activeBucket, @@ -259,14 +258,7 @@ function Listing({ loading ? placeholders : (!filterState.recommended || activeBucket !== 'openForRegistration') && ( -
- { - needLoad ? LOADING_MESSAGE - : ( - `${NO_LIVE_CHALLENGES_CONFIG[activeBucket]}` - ) - } -
+
{ `${NO_LIVE_CHALLENGES_CONFIG[activeBucket]}` }
) } diff --git a/src/shared/containers/challenge-listing/Listing/index.jsx b/src/shared/containers/challenge-listing/Listing/index.jsx index 84e6e13e03..446c485cf5 100644 --- a/src/shared/containers/challenge-listing/Listing/index.jsx +++ b/src/shared/containers/challenge-listing/Listing/index.jsx @@ -66,6 +66,8 @@ export class ListingContainer extends React.Component { filter, } = this.props; + const { needLoad } = this.state; + markHeaderMenu(); if (queryBucket !== activeBucket && _.includes(BUCKETS, queryBucket)) { @@ -105,6 +107,10 @@ export class ListingContainer extends React.Component { }); } // } + + if (needLoad) { + this.setState({ needLoad: false }); + } } componentDidUpdate(prevProps) { @@ -134,7 +140,6 @@ export class ListingContainer extends React.Component { getPastChallenges, filterState, } = this.props; - const { needLoad } = this.state; const oldUserId = _.get(prevProps, 'auth.user.userId'); const userId = _.get(this.props, 'auth.user.userId'); const handle = _.get(auth, 'user.handle'); @@ -259,10 +264,6 @@ export class ListingContainer extends React.Component { } if (filterChanged(filter, prevProps.filter)) { this.reloadChallenges(); - if (needLoad) { - // eslint-disable-next-line react/no-did-update-set-state - this.setState({ needLoad: false }); - } } setTimeout(() => { selectBucketDone(); From 4373f6c6bab36952d404527d2a12efef5de2dec7 Mon Sep 17 00:00:00 2001 From: lunarkid <4476442+dedywahyudi@users.noreply.github.com> Date: Sun, 2 Oct 2022 20:16:38 +0700 Subject: [PATCH 12/13] Revert "fix: no challenges found" This reverts commit 6d3464cb5da3f4a8b81e4618f1d8c30d494d9563. --- .../Listing/__snapshots__/Bucket.jsx.snap | 1 - .../challenge-listing/Listing/Bucket/index.jsx | 11 +---------- .../Listing/ReviewOpportunityBucket/index.jsx | 6 +----- .../components/challenge-listing/Listing/index.jsx | 4 ---- src/shared/components/challenge-listing/index.jsx | 2 -- .../containers/challenge-listing/Listing/index.jsx | 9 --------- 6 files changed, 2 insertions(+), 31 deletions(-) diff --git a/__tests__/shared/components/challenge-listing/Listing/__snapshots__/Bucket.jsx.snap b/__tests__/shared/components/challenge-listing/Listing/__snapshots__/Bucket.jsx.snap index fec74b8d5f..425cddd325 100644 --- a/__tests__/shared/components/challenge-listing/Listing/__snapshots__/Bucket.jsx.snap +++ b/__tests__/shared/components/challenge-listing/Listing/__snapshots__/Bucket.jsx.snap @@ -84,7 +84,6 @@ exports[`Matches shallow shapshot 1`] = ` expanding={false} loadMore={[MockFunction]} loading={false} - needLoad={false} newChallengeDetails={false} openChallengesInNewTabs={false} setFilterState={[MockFunction]} diff --git a/src/shared/components/challenge-listing/Listing/Bucket/index.jsx b/src/shared/components/challenge-listing/Listing/Bucket/index.jsx index 1874051d81..e500d0af64 100644 --- a/src/shared/components/challenge-listing/Listing/Bucket/index.jsx +++ b/src/shared/components/challenge-listing/Listing/Bucket/index.jsx @@ -24,7 +24,6 @@ import './style.scss'; // const COLLAPSED_SIZE = 10; // const Filter = challengeUtils.filter; -const LOADING_MESSAGE = 'Loading Challenges'; export default function Bucket({ bucket, @@ -37,7 +36,6 @@ export default function Bucket({ expand, filterState, // keepPlaceholders, - needLoad, loading, loadMore, newChallengeDetails, @@ -139,12 +137,7 @@ export default function Bucket({ title={BUCKET_DATA[bucket].name} />

- { - needLoad ? LOADING_MESSAGE - : ( - `${NO_LIVE_CHALLENGES_CONFIG[activeBucket]}` - ) - } + {`${NO_LIVE_CHALLENGES_CONFIG[activeBucket]}`}

@@ -269,7 +262,6 @@ Bucket.defaultProps = { expand: _.noop, challengeTypes: [], // keepPlaceholders: false, - needLoad: false, loading: false, loadMore: null, newChallengeDetails: false, @@ -294,7 +286,6 @@ Bucket.propTypes = { challengesUrl: PT.string.isRequired, filterState: PT.shape().isRequired, // keepPlaceholders: PT.bool, - needLoad: PT.bool, loading: PT.bool, loadMore: PT.func, newChallengeDetails: PT.bool, diff --git a/src/shared/components/challenge-listing/Listing/ReviewOpportunityBucket/index.jsx b/src/shared/components/challenge-listing/Listing/ReviewOpportunityBucket/index.jsx index 07cc41627d..bd59cf7b11 100644 --- a/src/shared/components/challenge-listing/Listing/ReviewOpportunityBucket/index.jsx +++ b/src/shared/components/challenge-listing/Listing/ReviewOpportunityBucket/index.jsx @@ -17,7 +17,6 @@ import './style.scss'; const Filter = challengeUtils.filter; const NO_RESULTS_MESSAGE = 'No challenges found'; -const LOADING_MESSAGE = 'Loading Challenges'; // Functional implementation of ReviewOpportunityBucket component export default function ReviewOpportunityBucket({ @@ -27,7 +26,6 @@ export default function ReviewOpportunityBucket({ expandTag, filterState, keepPlaceholders, - needLoad, loading, loadMore, opportunities, @@ -135,7 +133,7 @@ export default function ReviewOpportunityBucket({ onSelect={setSort} />

- {needLoad ? LOADING_MESSAGE : NO_RESULTS_MESSAGE} + {NO_RESULTS_MESSAGE}

@@ -156,7 +154,6 @@ ReviewOpportunityBucket.defaultProps = { expandedTags: [], expandTag: null, keepPlaceholders: false, - needLoad: false, loading: false, loadMore: null, sort: null, @@ -172,7 +169,6 @@ ReviewOpportunityBucket.propTypes = { filterState: PT.shape().isRequired, opportunities: PT.arrayOf(PT.shape()).isRequired, keepPlaceholders: PT.bool, - needLoad: PT.bool, loading: PT.bool, loadMore: PT.func, setFilterState: PT.func.isRequired, diff --git a/src/shared/components/challenge-listing/Listing/index.jsx b/src/shared/components/challenge-listing/Listing/index.jsx index 3b91331059..1c2c1d47b9 100644 --- a/src/shared/components/challenge-listing/Listing/index.jsx +++ b/src/shared/components/challenge-listing/Listing/index.jsx @@ -40,7 +40,6 @@ function Listing({ // extraBucket, filterState, keepPastPlaceholders, - needLoad, loadingPastChallenges, loadingReviewOpportunities, loadingMyChallenges, @@ -153,7 +152,6 @@ function Listing({ expandTag={expandTag} filterState={filterState} keepPlaceholders={keepPastPlaceholders} - needLoad={needLoad} loading={loadingReviewOpportunities} loadMore={loadMoreReviewOpportunities} opportunities={reviewOpportunities} @@ -184,7 +182,6 @@ function Listing({ expandTag={expandTag} filterState={filterState} // keepPlaceholders={keepPlaceholders} - needLoad={needLoad} loading={loading} loadMore={loadMore} newChallengeDetails={newChallengeDetails} @@ -325,7 +322,6 @@ Listing.propTypes = { // extraBucket: PT.string, filterState: PT.shape().isRequired, keepPastPlaceholders: PT.bool.isRequired, - needLoad: PT.bool.isRequired, loadingPastChallenges: PT.bool.isRequired, loadingMyChallenges: PT.bool.isRequired, loadingMyPastChallenges: PT.bool.isRequired, diff --git a/src/shared/components/challenge-listing/index.jsx b/src/shared/components/challenge-listing/index.jsx index 00b5c564e7..9200762e64 100644 --- a/src/shared/components/challenge-listing/index.jsx +++ b/src/shared/components/challenge-listing/index.jsx @@ -118,7 +118,6 @@ export default function ChallengeListing(props) { // extraBucket={extraBucket} filterState={props.filterState} keepPastPlaceholders={keepPastPlaceholders} - needLoad={props.needLoad} loadingPastChallenges={props.loadingPastChallenges} loadingMyChallenges={props.loadingMyChallenges} loadingMyPastChallenges={props.loadingMyPastChallenges} @@ -242,7 +241,6 @@ ChallengeListing.propTypes = { keepPastPlaceholders: PT.bool.isRequired, // lastUpdateOfActiveChallenges: PT.number.isRequired, // loadingChallenges: PT.bool.isRequired, - needLoad: PT.bool.isRequired, loadingMyChallenges: PT.bool.isRequired, loadingMyPastChallenges: PT.bool.isRequired, loadingAllChallenges: PT.bool.isRequired, diff --git a/src/shared/containers/challenge-listing/Listing/index.jsx b/src/shared/containers/challenge-listing/Listing/index.jsx index 446c485cf5..d7f8bc97b6 100644 --- a/src/shared/containers/challenge-listing/Listing/index.jsx +++ b/src/shared/containers/challenge-listing/Listing/index.jsx @@ -44,7 +44,6 @@ export class ListingContainer extends React.Component { super(props); this.state = { - needLoad: true, previousBucketOfActiveTab: null, previousBucketOfPastChallengesTab: null, }; @@ -66,8 +65,6 @@ export class ListingContainer extends React.Component { filter, } = this.props; - const { needLoad } = this.state; - markHeaderMenu(); if (queryBucket !== activeBucket && _.includes(BUCKETS, queryBucket)) { @@ -107,10 +104,6 @@ export class ListingContainer extends React.Component { }); } // } - - if (needLoad) { - this.setState({ needLoad: false }); - } } componentDidUpdate(prevProps) { @@ -502,7 +495,6 @@ export class ListingContainer extends React.Component { } = this.props; const { - needLoad, previousBucketOfActiveTab, previousBucketOfPastChallengesTab, } = this.state; @@ -638,7 +630,6 @@ export class ListingContainer extends React.Component { keepPastPlaceholders={keepPastPlaceholders} // lastUpdateOfActiveChallenges={lastUpdateOfActiveChallenges} // eslint-disable-next-line max-len - needLoad={needLoad} loadingMyChallenges={Boolean(loadingMyChallengesUUID)} loadingMyPastChallenges={Boolean(loadingMyPastChallengesUUID)} loadingAllChallenges={Boolean(loadingAllChallengesUUID)} From c1fecb7433a65928069f11bd2cfb8d24b6b2ab2c Mon Sep 17 00:00:00 2001 From: Luiz Ricardo Rodrigues Date: Tue, 4 Oct 2022 03:58:39 -0300 Subject: [PATCH 13/13] ci: remove develop branch from Dev env --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 1ed1928599..5b87843434 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -349,7 +349,7 @@ workflows: filters: branches: only: - - develop + - free # This is alternate dev env for parallel testing - "build-test": context : org-global