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

Commit b0fd526

Browse files
authored
Merge pull request #3134 from withspectrum/2.3.0
2.3.0
2 parents b08ae0a + 8657ae1 commit b0fd526

File tree

194 files changed

+7499
-1590
lines changed

Some content is hidden

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

194 files changed

+7499
-1590
lines changed

admin/src/components/globals/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -437,7 +437,7 @@ export const Tooltip = props => css`
437437
&:hover:after,
438438
&:hover:before {
439439
opacity: 1;
440-
transition: all 0.1s ease-in 0.1s;
440+
transition: opacity 0.1s ease-in 0.1s;
441441
}
442442
`;
443443

@@ -487,7 +487,7 @@ export const Onboarding = props => css`
487487
&:after,
488488
&:before {
489489
opacity: 1;
490-
transition: all 0.1s ease-in 0.1s;
490+
transition: opacity 0.1s ease-in 0.1s;
491491
}
492492
`;
493493

analytics/utils/transformations.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ type AnalyticsCommunity = {
2424
id: ?string,
2525
name: ?string,
2626
slug: ?string,
27+
isPrivate: boolean,
2728
};
2829

2930
type AnalyticsChannelPermissions = {
@@ -134,12 +135,14 @@ export const analyticsCommunity = (
134135
id: null,
135136
name: null,
136137
slug: null,
138+
isPrivate: false,
137139
};
138140

139141
return {
140142
id: community.id,
141143
name: community.name,
142144
slug: community.slug,
145+
isPrivate: community.isPrivate,
143146
};
144147
};
145148

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
exports.up = async (r, conn) => {
2+
return r
3+
.table('communities')
4+
.update({
5+
isPrivate: false,
6+
})
7+
.run(conn);
8+
};
9+
10+
exports.down = function(r, conn) {
11+
return r
12+
.table('communities')
13+
.update({
14+
isPrivate: r.literal(),
15+
})
16+
.run(conn);
17+
};
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
exports.up = async (r, conn) => {
2+
return r
3+
.table('usersCommunities')
4+
.update({
5+
isPending: false,
6+
})
7+
.run(conn);
8+
};
9+
10+
exports.down = function(r, conn) {
11+
return r
12+
.table('usersCommunities')
13+
.update({
14+
isPending: r.literal(),
15+
})
16+
.run(conn);
17+
};
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
exports.up = async (r, conn) => {
2+
return r
3+
.table('communitySettings')
4+
.update({
5+
joinSettings: {
6+
tokenJoinEnabled: false,
7+
token: null,
8+
},
9+
})
10+
.run(conn);
11+
};
12+
13+
exports.down = function(r, conn) {
14+
return r
15+
.table('communitySettings')
16+
.update({
17+
joinSettings: r.literal(),
18+
})
19+
.run(conn);
20+
};

api/migrations/seed/default/channels.js

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ const {
55
SPECTRUM_COMMUNITY_ID,
66
PAYMENTS_COMMUNITY_ID,
77
DELETED_COMMUNITY_ID,
8+
PRIVATE_COMMUNITY_ID,
89
SPECTRUM_GENERAL_CHANNEL_ID,
910
SPECTRUM_PRIVATE_CHANNEL_ID,
1011
PAYMENTS_GENERAL_CHANNEL_ID,
@@ -13,6 +14,7 @@ const {
1314
SPECTRUM_DELETED_CHANNEL_ID,
1415
DELETED_COMMUNITY_DELETED_CHANNEL_ID,
1516
MODERATOR_CREATED_CHANNEL_ID,
17+
PRIVATE_GENERAL_CHANNEL_ID,
1618
} = constants;
1719

1820
module.exports = [
@@ -106,4 +108,15 @@ module.exports = [
106108
isPrivate: false,
107109
isDefault: false,
108110
},
111+
112+
{
113+
id: PRIVATE_GENERAL_CHANNEL_ID,
114+
communityId: PRIVATE_COMMUNITY_ID,
115+
createdAt: new Date(DATE),
116+
name: 'General',
117+
description: 'General',
118+
slug: 'private-general',
119+
isPrivate: false,
120+
isDefault: false,
121+
},
109122
];

api/migrations/seed/default/communities.js

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,14 @@ const {
55
SPECTRUM_COMMUNITY_ID,
66
PAYMENTS_COMMUNITY_ID,
77
DELETED_COMMUNITY_ID,
8+
PRIVATE_COMMUNITY_ID,
89
} = constants;
910

1011
module.exports = [
1112
{
1213
id: SPECTRUM_COMMUNITY_ID,
1314
createdAt: new Date(DATE),
15+
isPrivate: false,
1416
name: 'Spectrum',
1517
description: 'The future of communities',
1618
website: 'https://spectrum.chat',
@@ -23,6 +25,7 @@ module.exports = [
2325
{
2426
id: PAYMENTS_COMMUNITY_ID,
2527
createdAt: new Date(DATE),
28+
isPrivate: false,
2629
name: 'Payments',
2730
description: 'Where payments are tested',
2831
website: 'https://spectrum.chat',
@@ -36,6 +39,7 @@ module.exports = [
3639
id: DELETED_COMMUNITY_ID,
3740
createdAt: new Date(DATE),
3841
deletedAt: new Date(DATE),
42+
isPrivate: false,
3943
name: 'Deleted',
4044
description: 'Things didnt work out',
4145
website: 'https://spectrum.chat',
@@ -45,4 +49,17 @@ module.exports = [
4549
'https://spectrum.imgix.net/communities/-Kh6RfPYjmSaIWbkck8i/Twitter Header.png.0.3303118636071434',
4650
slug: 'deleted',
4751
},
52+
{
53+
id: PRIVATE_COMMUNITY_ID,
54+
createdAt: new Date(DATE),
55+
isPrivate: true,
56+
name: 'Private community',
57+
description: 'Private community',
58+
website: 'https://spectrum.chat',
59+
profilePhoto:
60+
'https://spectrum.imgix.net/communities/-Kh6RfPYjmSaIWbkck8i/Twitter Profile.png.0.6225566835336693',
61+
coverPhoto:
62+
'https://spectrum.imgix.net/communities/-Kh6RfPYjmSaIWbkck8i/Twitter Header.png.0.3303118636071434',
63+
slug: 'private',
64+
},
4865
];

api/migrations/seed/default/constants.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ const COMMUNITY_MODERATOR_USER_ID = '9';
2222
const SPECTRUM_COMMUNITY_ID = '1';
2323
const PAYMENTS_COMMUNITY_ID = '2';
2424
const DELETED_COMMUNITY_ID = '3';
25+
const PRIVATE_COMMUNITY_ID = '4';
2526

2627
// channels
2728
const SPECTRUM_GENERAL_CHANNEL_ID = '1';
@@ -32,6 +33,7 @@ const SPECTRUM_ARCHIVED_CHANNEL_ID = '5';
3233
const SPECTRUM_DELETED_CHANNEL_ID = '6';
3334
const DELETED_COMMUNITY_DELETED_CHANNEL_ID = '7';
3435
const MODERATOR_CREATED_CHANNEL_ID = '8';
36+
const PRIVATE_GENERAL_CHANNEL_ID = '9';
3537

3638
module.exports = {
3739
DATE,
@@ -47,6 +49,7 @@ module.exports = {
4749
SPECTRUM_COMMUNITY_ID,
4850
PAYMENTS_COMMUNITY_ID,
4951
DELETED_COMMUNITY_ID,
52+
PRIVATE_COMMUNITY_ID,
5053
SPECTRUM_GENERAL_CHANNEL_ID,
5154
SPECTRUM_PRIVATE_CHANNEL_ID,
5255
PAYMENTS_GENERAL_CHANNEL_ID,
@@ -55,4 +58,5 @@ module.exports = {
5558
SPECTRUM_DELETED_CHANNEL_ID,
5659
DELETED_COMMUNITY_DELETED_CHANNEL_ID,
5760
MODERATOR_CREATED_CHANNEL_ID,
61+
PRIVATE_GENERAL_CHANNEL_ID,
5862
};

api/migrations/seed/default/threads.js

Lines changed: 33 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,14 @@ const {
66
BRIAN_ID,
77
MAX_ID,
88
BRYN_ID,
9-
CHANNEL_MODERATOR_USER_ID,
109
SPECTRUM_GENERAL_CHANNEL_ID,
10+
PRIVATE_GENERAL_CHANNEL_ID,
1111
SPECTRUM_PRIVATE_CHANNEL_ID,
12-
PAYMENTS_GENERAL_CHANNEL_ID,
13-
PAYMENTS_PRIVATE_CHANNEL_ID,
14-
SPECTRUM_DELETED_CHANNEL_ID,
1512
DELETED_COMMUNITY_DELETED_CHANNEL_ID,
1613
MODERATOR_CREATED_CHANNEL_ID,
1714
DELETED_COMMUNITY_ID,
1815
SPECTRUM_COMMUNITY_ID,
19-
PAYMENTS_COMMUNITY_ID,
16+
PRIVATE_COMMUNITY_ID,
2017
SPECTRUM_ARCHIVED_CHANNEL_ID,
2118
} = constants;
2219

@@ -385,4 +382,35 @@ module.exports = [
385382
lastActive: new Date(DATE + 2),
386383
// deletedAt is missing intentionally
387384
},
385+
386+
{
387+
id: 'thread-13',
388+
createdAt: new Date(DATE + 2),
389+
creatorId: MAX_ID,
390+
channelId: PRIVATE_GENERAL_CHANNEL_ID,
391+
communityId: PRIVATE_COMMUNITY_ID,
392+
isPublished: true,
393+
isLocked: false,
394+
type: 'DRAFTJS',
395+
content: {
396+
title: 'Yet another thread',
397+
body: JSON.stringify(
398+
toJSON(fromPlainText('This is just another thread'))
399+
),
400+
},
401+
attachments: [],
402+
edits: [
403+
{
404+
timestamp: new Date(DATE + 2),
405+
content: {
406+
title: 'Yet another thread',
407+
body: JSON.stringify(
408+
toJSON(fromPlainText('This is just another thread'))
409+
),
410+
},
411+
},
412+
],
413+
modifiedAt: new Date(DATE + 2),
414+
lastActive: new Date(DATE + 2),
415+
},
388416
];

api/migrations/seed/default/usersChannels.js

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,11 @@ const {
66
MAX_ID,
77
BRYN_ID,
88
BLOCKED_USER_ID,
9-
PENDING_USER_ID,
109
PREVIOUS_MEMBER_USER_ID,
1110
CHANNEL_MODERATOR_USER_ID,
1211
COMMUNITY_MODERATOR_USER_ID,
1312
SPECTRUM_GENERAL_CHANNEL_ID,
13+
PRIVATE_GENERAL_CHANNEL_ID,
1414
SPECTRUM_ARCHIVED_CHANNEL_ID,
1515
SPECTRUM_PRIVATE_CHANNEL_ID,
1616
DELETED_COMMUNITY_DELETED_CHANNEL_ID,
@@ -384,4 +384,16 @@ module.exports = [
384384
isPending: false,
385385
receiveNotifications: false,
386386
},
387+
{
388+
id: '31',
389+
createdAt: new Date(DATE),
390+
userId: MAX_ID,
391+
channelId: PRIVATE_GENERAL_CHANNEL_ID,
392+
isOwner: true,
393+
isModerator: false,
394+
isMember: true,
395+
isBlocked: false,
396+
isPending: false,
397+
receiveNotifications: false,
398+
},
387399
];

0 commit comments

Comments
 (0)