Skip to content

Commit

Permalink
Merge pull request #87 from sharetribe/update-v4.2.2-from-upstream
Browse files Browse the repository at this point in the history
Update v4.2.2 from upstream
  • Loading branch information
OtterleyW authored Apr 9, 2020
2 parents 87283bf + cb7dffd commit bf3319a
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 13 deletions.
24 changes: 20 additions & 4 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,18 +17,34 @@ https://github.com/sharetribe/flex-template-web/

## Upcoming version 2020-XX-XX

## [v6.4.1] 2020-04-09

### One change in this template

- [fix] Fix user display name references in example tx process email templates [#86](https://github.com/sharetribe/ftw-hourly/pull/86/)


### Updates from upstream

This is update from [upstream](https://github.com/sharetribe/ftw-daily): v4.4.2

- [fix] Handle deleted reviews in ActivityFeed [#1283](https://github.com/sharetribe/ftw-daily/pull/1283)

[v6.4.1]: https://github.com/sharetribe/ftw-hourly/compare/v6.4.0...v6.4.1

## [v6.4.0] 2020-04-01

This is update from from [upstream](https://github.com/sharetribe/ftw-daily): v4.4.1
This is update from [upstream](https://github.com/sharetribe/ftw-daily): v4.4.1

- [change] Improve the search page sorting and filters UI for different screen sizes [#1280](https://github.com/sharetribe/ftw-daily/pull/1280)
- [add] Search result sorting [#1277](https://github.com/sharetribe/ftw-daily/pull/1277)

[v6.4.0]: https://github.com/sharetribe/ftw-hourly/compare/v6.3.0...v6.4.0


## [v6.3.0] 2020-03-16

This is update from from [upstream](https://github.com/sharetribe/ftw-daily): v4.3.0
This is update from [upstream](https://github.com/sharetribe/ftw-daily): v4.3.0

- [change] Redirect user back to Stripe during Connect Onboarding Flow when user is returned to
failure URL provided that the Account Link generation is successful.
Expand All @@ -49,7 +65,7 @@ This is update from from [upstream](https://github.com/sharetribe/ftw-daily): v4

## [v6.2.0] 2020-02-18

This is update from from [upstream](https://github.com/sharetribe/ftw-daily): v4.2.0
This is update from [upstream](https://github.com/sharetribe/ftw-daily): v4.2.0

- [add] Show a banner when a user is logged in with limited access.
[#1259](https://github.com/sharetribe/ftw-daily/pull/1259)
Expand Down Expand Up @@ -79,7 +95,7 @@ Update from upstream (first 3 bullets) and a couple of pending changes.

## [v6.0.0] 2019-12-20

This is update from from [upstream](https://github.com/sharetribe/ftw-daily): v4.0.0
This is update from [upstream](https://github.com/sharetribe/ftw-daily): v4.0.0

- [change] Use Stripe's [Connect onboarding](https://stripe.com/docs/connect/connect-onboarding) for
adding and updating the identity information of the Stripe account.
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "app",
"version": "v6.4.0",
"version": "6.4.1",
"private": true,
"license": "Apache-2.0",
"dependencies": {
Expand Down
25 changes: 17 additions & 8 deletions src/components/ActivityFeed/ActivityFeed.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,11 +79,13 @@ const Review = props => {
return (
<div>
<p className={css.reviewContent}>{content}</p>
<ReviewRating
reviewStarClassName={css.reviewStar}
className={css.reviewStars}
rating={rating}
/>
{rating ? (
<ReviewRating
reviewStarClassName={css.reviewStar}
className={css.reviewStars}
rating={rating}
/>
) : null}
</div>
);
};
Expand Down Expand Up @@ -203,7 +205,9 @@ const resolveTransitionMessage = (
};

const reviewByAuthorId = (transaction, userId) => {
return transaction.reviews.filter(r => r.author.id.uuid === userId.uuid)[0];
return transaction.reviews.filter(
r => !r.attributes.deleted && r.author.id.uuid === userId.uuid
)[0];
};

const Transition = props => {
Expand Down Expand Up @@ -240,18 +244,23 @@ const Transition = props => {
);
const currentTransition = transition.transition;

const deletedReviewContent = intl.formatMessage({ id: 'ActivityFeed.deletedReviewContent' });
let reviewComponent = null;

if (transitionIsReviewed(lastTransition)) {
if (isCustomerReview(currentTransition)) {
const review = reviewByAuthorId(currentTransaction, customer.id);
reviewComponent = (
reviewComponent = review ? (
<Review content={review.attributes.content} rating={review.attributes.rating} />
) : (
<Review content={deletedReviewContent} />
);
} else if (isProviderReview(currentTransition)) {
const review = reviewByAuthorId(currentTransaction, provider.id);
reviewComponent = (
reviewComponent = review ? (
<Review content={review.attributes.content} rating={review.attributes.rating} />
) : (
<Review content={deletedReviewContent} />
);
}
}
Expand Down
1 change: 1 addition & 0 deletions src/translations/en.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"ActivityFeed.deletedListing": "deleted listing",
"ActivityFeed.deletedReviewContent": "This review is deleted.",
"ActivityFeed.leaveAReview": "Leave a review for { displayName }.",
"ActivityFeed.leaveAReviewSecond": "Leave a review for { displayName } to see their review.",
"ActivityFeed.ownTransitionAccept": "You accepted the booking request.",
Expand Down

0 comments on commit bf3319a

Please sign in to comment.