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

Commit 892a831

Browse files
authored
Merge pull request #4283 from withspectrum/2.4.73
2.4.73
2 parents 7b340df + f8a8ff9 commit 892a831

File tree

115 files changed

+1006
-911
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

115 files changed

+1006
-911
lines changed

analytics/utils/transformations.js

Lines changed: 26 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ type AnalyticsThreadPermissions = {
4848
};
4949

5050
type AnalyticsUser = {
51-
createdAt: string,
51+
createdAt: ?string,
5252
twitterAuthed: boolean,
5353
fbAuthed: boolean,
5454
githubAuthed: boolean,
@@ -74,11 +74,12 @@ type AnalyticsMessage = {
7474
};
7575

7676
export const analyticsReaction = (reaction: ?DBReaction): AnalyticsReaction => {
77-
if (!reaction)
77+
if (!reaction) {
7878
return {
7979
id: null,
8080
type: null,
8181
};
82+
}
8283

8384
return {
8485
id: reaction.id,
@@ -89,11 +90,12 @@ export const analyticsReaction = (reaction: ?DBReaction): AnalyticsReaction => {
8990
export const analyticsThreadReaction = (
9091
reaction: ?DBThreadReaction
9192
): AnalyticsThreadReaction => {
92-
if (!reaction)
93+
if (!reaction) {
9394
return {
9495
id: null,
9596
type: null,
9697
};
98+
}
9799

98100
return {
99101
id: reaction.id,
@@ -102,12 +104,13 @@ export const analyticsThreadReaction = (
102104
};
103105

104106
export const analyticsMessage = (message: ?DBMessage): AnalyticsMessage => {
105-
if (!message)
107+
if (!message) {
106108
return {
107109
id: null,
108110
threadType: null,
109111
parentId: null,
110112
};
113+
}
111114

112115
return {
113116
id: message.id,
@@ -117,14 +120,15 @@ export const analyticsMessage = (message: ?DBMessage): AnalyticsMessage => {
117120
};
118121

119122
export const analyticsChannel = (channel: ?DBChannel): AnalyticsChannel => {
120-
if (!channel)
123+
if (!channel) {
121124
return {
122125
id: null,
123126
name: null,
124127
slug: null,
125128
isPrivate: null,
126129
isArchived: null,
127130
};
131+
}
128132

129133
return {
130134
id: channel.id,
@@ -151,13 +155,14 @@ export const analyticsChannelPermissions = (
151155
export const analyticsCommunity = (
152156
community: DBCommunity
153157
): AnalyticsCommunity => {
154-
if (!community)
158+
if (!community) {
155159
return {
156160
id: null,
157161
name: null,
158162
slug: null,
159163
isPrivate: false,
160164
};
165+
}
161166

162167
return {
163168
id: community.id,
@@ -170,11 +175,12 @@ export const analyticsCommunity = (
170175
export const analyticsCommunityPermissions = (
171176
communityPermissions: DBUsersCommunities
172177
): AnalyticsCommunityPermissions => {
173-
if (!communityPermissions)
178+
if (!communityPermissions) {
174179
return {
175180
roles: [],
176181
reputation: 0,
177182
};
183+
}
178184

179185
return {
180186
roles: getTruthyValuesFromObject(communityPermissions),
@@ -183,12 +189,13 @@ export const analyticsCommunityPermissions = (
183189
};
184190

185191
export const analyticsThread = (thread: ?DBThread): AnalyticsThread => {
186-
if (!thread)
192+
if (!thread) {
187193
return {
188194
id: null,
189195
isLocked: null,
190196
isWatercooler: null,
191197
};
198+
}
192199

193200
return {
194201
id: thread.id,
@@ -214,6 +221,17 @@ export const analyticsThreadPermissions = (
214221
};
215222

216223
export const analyticsUser = (user: DBUser): AnalyticsUser => {
224+
if (!user) {
225+
return {
226+
createdAt: null,
227+
twitterAuthed: false,
228+
fbAuthed: false,
229+
githubAuthed: false,
230+
googleAuthed: false,
231+
hasUsername: false,
232+
lastSeen: null,
233+
};
234+
}
217235
return {
218236
createdAt: user.createdAt,
219237
twitterAuthed: user.providerId ? true : false,

api/models/usersCommunities.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -478,6 +478,8 @@ export const approvePendingMemberInCommunity = async (
478478
context: { communityId },
479479
});
480480

481+
incrementMemberCount(communityId);
482+
481483
return result.changes[0].new_val;
482484
});
483485
};

api/package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,6 @@
8888
"prismjs": "^1.15.0",
8989
"query-string": "5.1.1",
9090
"raven": "^2.6.4",
91-
"raven-js": "^3.27.0",
9291
"react": "^15.4.1",
9392
"react-app-rewire-styled-components": "^3.0.2",
9493
"react-app-rewired": "^1.6.2",

api/yarn.lock

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7668,11 +7668,6 @@ range-parser@~1.2.0:
76687668
resolved "https://registry.yarnpkg.com/range-parser/-/range-parser-1.2.0.tgz#f49be6b487894ddc40dcc94a322f611092e00d5e"
76697669
integrity sha1-9JvmtIeJTdxA3MlKMi9hEJLgDV4=
76707670

7671-
raven-js@^3.27.0:
7672-
version "3.27.0"
7673-
resolved "https://registry.yarnpkg.com/raven-js/-/raven-js-3.27.0.tgz#9f47c03e17933ce756e189f3669d49c441c1ba6e"
7674-
integrity sha512-vChdOL+yzecfnGA+B5EhEZkJ3kY3KlMzxEhShKh6Vdtooyl0yZfYNFQfYzgMf2v4pyQa+OTZ5esTxxgOOZDHqw==
7675-
76767671
raven@^2.6.4:
76777672
version "2.6.4"
76787673
resolved "https://registry.yarnpkg.com/raven/-/raven-2.6.4.tgz#458d4a380c8fbb59e0150c655625aaf60c167ea3"

config-overrides.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,7 @@ module.exports = function override(config, env) {
151151
);
152152
if (process.env.NODE_ENV === 'production') {
153153
removeEslint(config);
154+
config.plugins.push(new webpack.optimize.ModuleConcatenationPlugin());
154155
config.plugins.push(
155156
new webpack.DefinePlugin({
156157
'process.env': {

cypress/integration/apps_page_spec.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
describe('Privacy View', () => {
1+
describe('Apps View', () => {
22
describe('Loads page', () => {
33
beforeEach(() => {
44
cy.visit('/apps');
55
});
66

7-
it('should render the privacy page', () => {
7+
it('should render the apps page', () => {
88
cy.get('[data-cy="apps-page"]').should('be.visible');
99
});
1010
});

cypress/integration/channel/settings/create_spec.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@ const { userId: ownerInChannelId } = data.usersChannels.find(
1212

1313
describe('create a channel', () => {
1414
beforeEach(() => {
15-
cy.auth(ownerInChannelId);
16-
// NOTE @brian: I can not get this to auth directly into /settings, having to work around for now
17-
cy.visit(`/${community.slug}/settings`);
15+
cy.auth(ownerInChannelId).then(() =>
16+
cy.visit(`/${community.slug}/settings`)
17+
);
1818
});
1919

2020
it('should go through create a channel flow', () => {

cypress/integration/channel/settings/delete_spec.js

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,10 @@ const { userId: ownerInPrivateChannelId } = data.usersChannels.find(
2020
);
2121

2222
describe('deleting general channel', () => {
23-
before(() => {
24-
cy.auth(ownerInChannelId);
25-
cy.visit(`/${community.slug}/${channel.slug}/settings`);
23+
beforeEach(() => {
24+
cy.auth(ownerInChannelId).then(() =>
25+
cy.visit(`/${community.slug}/${channel.slug}/settings`)
26+
);
2627
});
2728

2829
it('should not allow general channel to be deleted', () => {
@@ -33,16 +34,16 @@ describe('deleting general channel', () => {
3334
});
3435

3536
describe('deleting a channel', () => {
36-
before(() => {
37-
cy.auth(ownerInPrivateChannelId);
38-
cy.visit(`/${privateCommunity.slug}/${privateChannel.slug}/settings`);
37+
beforeEach(() => {
38+
cy.auth(ownerInPrivateChannelId).then(() =>
39+
cy.visit(`/${privateCommunity.slug}/${privateChannel.slug}/settings`)
40+
);
3941
});
4042

4143
it('should delete a channel', () => {
4244
cy.get('[data-cy="channel-overview"]').should('be.visible');
4345

44-
cy
45-
.get('[data-cy="delete-channel-button"]')
46+
cy.get('[data-cy="delete-channel-button"]')
4647
.should('be.visible')
4748
.click();
4849

cypress/integration/channel/settings/edit_spec.js

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,29 +15,27 @@ const NEW_DESCRIPTION = 'New description';
1515

1616
describe('edit a channel', () => {
1717
beforeEach(() => {
18-
cy.auth(ownerInChannelId);
19-
cy.visit(`/${community.slug}/${channel.slug}/settings`);
18+
cy.auth(ownerInChannelId).then(() =>
19+
cy.visit(`/${community.slug}/${channel.slug}/settings`)
20+
);
2021
});
2122

2223
it('should edit a channel', () => {
2324
cy.get('[data-cy="channel-overview"]').should('be.visible');
2425

25-
cy
26-
.get('[data-cy="channel-name-input"]')
26+
cy.get('[data-cy="channel-name-input"]')
2727
.should('be.visible')
2828
.click()
2929
.clear()
3030
.type(NEW_NAME);
3131

32-
cy
33-
.get('[data-cy="channel-description-input"]')
32+
cy.get('[data-cy="channel-description-input"]')
3433
.should('be.visible')
3534
.click()
3635
.clear()
3736
.type(NEW_DESCRIPTION);
3837

39-
cy
40-
.get('[data-cy="save-button"]')
38+
cy.get('[data-cy="save-button"]')
4139
.should('be.visible')
4240
.click();
4341

cypress/integration/channel/settings/private_invite_link_spec.js

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,7 @@ const enable = () => {
1313

1414
cy.get('[data-cy="login-with-token-settings"]').scrollIntoView();
1515

16-
cy
17-
.get('[data-cy="toggle-token-link-invites-unchecked"]')
16+
cy.get('[data-cy="toggle-token-link-invites-unchecked"]')
1817
.should('be.visible')
1918
.click();
2019

@@ -23,8 +22,9 @@ const enable = () => {
2322

2423
describe('private channel invite link settings', () => {
2524
beforeEach(() => {
26-
cy.auth(ownerInChannelId);
27-
cy.visit(`/${community.slug}/${channel.slug}/settings`);
25+
cy.auth(ownerInChannelId).then(() =>
26+
cy.visit(`/${community.slug}/${channel.slug}/settings`)
27+
);
2828
});
2929

3030
it('should handle enable, reset, and disable', () => {
@@ -33,8 +33,7 @@ describe('private channel invite link settings', () => {
3333

3434
// reset token
3535
cy.get('[data-cy="login-with-token-settings"]').scrollIntoView();
36-
cy
37-
.get('[data-cy="join-link-input"]')
36+
cy.get('[data-cy="join-link-input"]')
3837
.invoke('val')
3938
.then(val1 => {
4039
// do more work here
@@ -46,15 +45,13 @@ describe('private channel invite link settings', () => {
4645

4746
// grab the input again and compare its previous value
4847
// to the current value
49-
cy
50-
.get('[data-cy="join-link-input"]')
48+
cy.get('[data-cy="join-link-input"]')
5149
.invoke('val')
5250
.should('not.eq', val1);
5351
});
5452

5553
// disable
56-
cy
57-
.get('[data-cy="toggle-token-link-invites-checked"]')
54+
cy.get('[data-cy="toggle-token-link-invites-checked"]')
5855
.should('be.visible')
5956
.click();
6057

0 commit comments

Comments
 (0)