Skip to content
This repository was archived by the owner on Oct 11, 2022. It is now read-only.

Commit bfab3e1

Browse files
authored
Merge pull request #3411 from withspectrum/2.4.16
2.4.16
2 parents 56e4245 + 2751712 commit bfab3e1

File tree

36 files changed

+924
-882
lines changed

36 files changed

+924
-882
lines changed

athena/queues/mention-notification.js

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,21 +50,29 @@ export default async ({ data }: Job<MentionNotificationJobData>) => {
5050
// dont send any notification about the mention
5151
if (!thread || thread.deletedAt) return;
5252

53-
const { isPrivate } = await getChannelById(thread.channelId);
53+
const { isPrivate: channelIsPrivate } = await getChannelById(
54+
thread.channelId
55+
);
56+
const { isPrivate: communityIsPrivate } = await getCommunityById(
57+
thread.communityId
58+
);
5459
const {
5560
isBlocked: isBlockedInCommunity,
61+
isMember: isMemberInCommunity,
5662
} = await getUserPermissionsInCommunity(thread.communityId, recipient.id);
5763
const {
5864
isMember: isMemberInChannel,
5965
isBlocked: isBlockedInChannel,
6066
} = await getUserPermissionsInChannel(recipient.id, thread.channelId);
61-
// don't notify people where they are blocked, or where the channel is private and they aren't a member
67+
6268
if (
6369
isBlockedInCommunity ||
6470
isBlockedInChannel ||
65-
(isPrivate && !isMemberInChannel)
66-
)
71+
(channelIsPrivate && !isMemberInChannel) ||
72+
(communityIsPrivate && !isMemberInCommunity)
73+
) {
6774
return;
75+
}
6876

6977
// see if a usersThreads record exists. If it does, and notifications are muted, we
7078
// should not send an email. If the record doesn't exist, it means the person being

cypress/integration/community/view/profile_spec.js

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,10 @@ describe('public community signed out', () => {
6868
thread => !thread.deletedAt && thread.communityId === publicCommunity.id
6969
)
7070
.forEach(thread =>
71-
cy.contains(thread.content.title).should('be.visible')
71+
cy
72+
.contains(thread.content.title)
73+
.scrollIntoView()
74+
.should('be.visible')
7275
);
7376
});
7477

@@ -130,7 +133,10 @@ describe('public community signed in without permission', () => {
130133
thread => !thread.deletedAt && thread.communityId === publicCommunity.id
131134
)
132135
.forEach(thread =>
133-
cy.contains(thread.content.title).should('be.visible')
136+
cy
137+
.contains(thread.content.title)
138+
.scrollIntoView()
139+
.should('be.visible')
134140
);
135141
});
136142

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "Spectrum",
3-
"version": "2.4.15",
3+
"version": "2.4.16",
44
"license": "BSD-3-Clause",
55
"devDependencies": {
66
"babel-cli": "^6.24.1",

src/components/avatar/style.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
// @flow
12
import styled, { css } from 'styled-components';
23
import { zIndex } from '../globals';
34
import Link from 'src/components/link';
@@ -21,7 +22,7 @@ export const Status = styled.div`
2122
display: inline-block;
2223
width: ${props => (props.size ? `${props.size}px` : '32px')};
2324
height: ${props => (props.size ? `${props.size}px` : '32px')};
24-
border-radius: ${props => (props.community ? '25%' : '100%')};
25+
border-radius: ${props => (props.community ? `${props.size / 8}px` : '100%')};
2526
border: none;
2627
background-color: ${({ theme }) => theme.bg.default};
2728
@@ -86,7 +87,7 @@ export const Img = styled.img`
8687
display: inline-block;
8788
width: ${props => (props.size ? `${props.size}px` : '32px')};
8889
height: ${props => (props.size ? `${props.size}px` : '32px')};
89-
border-radius: ${props => (props.community ? '25%' : '100%')};
90+
border-radius: ${props => (props.community ? `${props.size / 8}px` : '100%')};
9091
object-fit: cover;
9192
9293
${props =>
@@ -104,7 +105,7 @@ export const ImgPlaceholder = styled.div`
104105
background-color: ${props => props.theme.bg.border};
105106
width: ${props => (props.size ? `${props.size}px` : '32px')};
106107
height: ${props => (props.size ? `${props.size}px` : '32px')};
107-
border-radius: ${props => (props.community ? '25%' : '100%')};
108+
border-radius: ${props => (props.community ? `${props.size / 8}px` : '100%')};
108109
object-fit: cover;
109110
110111
${props =>

src/components/icons/index.js

Lines changed: 9 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/components/message/style.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,7 @@ export const Time = styled.div`
243243

244244
export const Text = styled(Bubble)`
245245
padding: 8px 16px;
246-
font-size: 14px;
246+
font-size: 16px;
247247
line-height: 1.4;
248248
background-color: ${props =>
249249
props.me ? props.theme.brand.default : props.theme.generic.default};
@@ -332,7 +332,7 @@ export const Image = styled.img`
332332

333333
export const Code = styled(Bubble)`
334334
padding: 12px 16px;
335-
font-size: 13px;
335+
font-size: 15px;
336336
font-weight: 500;
337337
background-color: ${props => props.theme.bg.reverse};
338338
color: ${props => props.theme.text.reverse};

src/components/profile/style.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ export const Title = styled.h3`
7070

7171
export const FullTitle = styled(Title)`
7272
font-size: 24px;
73-
margin-top: 8px;
73+
margin-top: 16px;
7474
`;
7575

7676
export const FullProfile = styled.div`

src/components/threadComposer/style.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -88,8 +88,8 @@ export const Placeholder = styled.div`
8888

8989
export const PlaceholderLabel = styled.h3`
9090
font-size: 20px;
91-
font-weight: 800;
92-
margin-left: 8px;
91+
font-weight: 500;
92+
margin-left: 16px;
9393
`;
9494

9595
export const ContentContainer = styled.div`
@@ -169,7 +169,7 @@ export const ComposerUpsell = styled.div`
169169
170170
p {
171171
font-size: 14px;
172-
font-weight: 700;
172+
font-weight: 600;
173173
}
174174
`;
175175

@@ -245,7 +245,7 @@ export const ThreadTitle = {
245245
outline: 'none',
246246
border: '0',
247247
lineHeight: '1.4',
248-
fontWeight: '800',
248+
fontWeight: '600',
249249
boxShadow: 'none',
250250
width: '100%',
251251
color: '#171A21',

src/components/threadFeed/index.js

Lines changed: 7 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,12 @@ type Props = {
142142
hasThreads: Function,
143143
hasNoThreads: Function,
144144
currentUser: ?Object,
145-
viewContext: 'community' | 'channel',
145+
viewContext?:
146+
| ?'communityInbox'
147+
| 'communityProfile'
148+
| 'channelInbox'
149+
| 'channelProfile'
150+
| 'userProfile',
146151
slug: string,
147152
pinnedThreadId: ?string,
148153
isNewAndOwned: ?boolean,
@@ -286,9 +291,6 @@ class ThreadFeedPure extends React.Component<Props, State> {
286291
data={this.props.data.community.pinnedThread}
287292
viewContext={viewContext}
288293
pinnedThreadId={this.props.data.community.pinnedThread.id}
289-
hasActiveCommunity={
290-
viewContext === 'community' && this.props.data.community
291-
}
292294
/>
293295
</ErrorBoundary>
294296
)}
@@ -300,9 +302,6 @@ class ThreadFeedPure extends React.Component<Props, State> {
300302
<InboxThread
301303
data={this.props.data.community.watercooler}
302304
viewContext={viewContext}
303-
hasActiveCommunity={
304-
viewContext === 'community' && this.props.data.community
305-
}
306305
/>
307306
</ErrorBoundary>
308307
)}
@@ -322,16 +321,7 @@ class ThreadFeedPure extends React.Component<Props, State> {
322321
{uniqueThreads.map(thread => {
323322
return (
324323
<ErrorBoundary fallbackComponent={null} key={thread.id}>
325-
<InboxThread
326-
data={thread}
327-
viewContext={viewContext}
328-
hasActiveCommunity={
329-
viewContext === 'community' && this.props.data.community
330-
}
331-
hasActiveChannel={
332-
viewContext === 'channel' && this.props.data.channel
333-
}
334-
/>
324+
<InboxThread data={thread} viewContext={viewContext} />
335325
</ErrorBoundary>
336326
);
337327
})}

src/components/threadLikes/index.js

Lines changed: 15 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ type LikeButtonProps = {
1717
addThreadReaction: Function,
1818
removeThreadReaction: Function,
1919
currentUser: ?Object,
20+
tipLocation?: string,
2021
dispatch: Dispatch<Object>,
2122
};
2223

@@ -45,15 +46,15 @@ class LikeButtonPure extends React.Component<LikeButtonProps> {
4546
};
4647

4748
render() {
48-
const { thread } = this.props;
49+
const { thread, tipLocation = 'bottom-left' } = this.props;
4950
const { hasReacted, count } = thread.reactions;
5051

5152
return (
5253
<LikeButtonWrapper hasReacted={hasReacted}>
5354
<IconButton
54-
glyph={hasReacted ? 'thumbsup-fill' : 'thumbsup'}
55+
glyph={'thumbsup'}
5556
tipText={hasReacted ? 'Unlike thread' : 'Like thread'}
56-
tipLocation={'bottom-left'}
57+
tipLocation={tipLocation}
5758
onClick={this.handleClick}
5859
/>
5960
<CurrentCount>{count}</CurrentCount>
@@ -80,20 +81,15 @@ type LikeCountProps = {
8081
export const LikeCount = (props: LikeCountProps) => {
8182
const { active, thread } = props;
8283
const { count } = thread.reactions;
83-
84-
if (count > 0) {
85-
return (
86-
<LikeCountWrapper active={active}>
87-
<Icon
88-
glyph={'thumbsup-fill'}
89-
size={24}
90-
tipText={`${count} likes`}
91-
tipLocation={'top-right'}
92-
/>
93-
<CurrentCount>{count}</CurrentCount>
94-
</LikeCountWrapper>
95-
);
96-
} else {
97-
return null;
98-
}
84+
return (
85+
<LikeCountWrapper active={active}>
86+
<Icon
87+
glyph={'thumbsup'}
88+
size={24}
89+
tipText={`${count} likes`}
90+
tipLocation={'top-right'}
91+
/>
92+
<CurrentCount>{count || '0'}</CurrentCount>
93+
</LikeCountWrapper>
94+
);
9995
};

0 commit comments

Comments
 (0)