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

Commit f92f7be

Browse files
authored
Delete the remainder of groups (#9357)
* Delete the remainder of groups Fixes element-hq/element-web#22770 Continues #8027 * Don't need the strings either
1 parent bd270b0 commit f92f7be

15 files changed

+4
-202
lines changed

src/IConfigOptions.ts

-3
Original file line numberDiff line numberDiff line change
@@ -179,9 +179,6 @@ export interface IConfigOptions {
179179

180180
sync_timeline_limit?: number;
181181
dangerously_allow_unsafe_and_insecure_passwords?: boolean; // developer option
182-
183-
// XXX: Undocumented URL for the "Learn more about spaces" link in the "Communities don't exist" messaging.
184-
spaces_learn_more_url?: string;
185182
}
186183

187184
export interface ISsoRedirectOptions {

src/PageTypes.ts

-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ enum PageType {
2020
HomePage = "home_page",
2121
RoomView = "room_view",
2222
UserView = "user_view",
23-
LegacyGroupView = "legacy_group_view",
2423
}
2524

2625
export default PageType;

src/PosthogTrackers.ts

-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@ const loggedInPageTypeMap: Record<PageType, ScreenName> = {
4141
[PageType.HomePage]: "Home",
4242
[PageType.RoomView]: "Room",
4343
[PageType.UserView]: "User",
44-
[PageType.LegacyGroupView]: "Group",
4544
};
4645

4746
export default class PosthogTrackers {

src/SdkConfig.ts

-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,6 @@ export const DEFAULTS: IConfigOptions = {
4444
logo: require("../res/img/element-desktop-logo.svg").default,
4545
url: "https://element.io/get-started",
4646
},
47-
spaces_learn_more_url: "https://element.io/blog/spaces-blast-out-of-beta/",
4847
};
4948

5049
export default class SdkConfig {

src/components/structures/LegacyGroupView.tsx

-51
This file was deleted.

src/components/structures/LoggedInView.tsx

-7
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,6 @@ import RightPanelStore from '../../stores/right-panel/RightPanelStore';
6767
import { TimelineRenderingType } from "../../contexts/RoomContext";
6868
import { KeyBindingAction } from "../../accessibility/KeyboardShortcuts";
6969
import { SwitchSpacePayload } from "../../dispatcher/payloads/SwitchSpacePayload";
70-
import LegacyGroupView from "./LegacyGroupView";
7170
import { IConfigOptions } from "../../IConfigOptions";
7271
import LeftPanelLiveShareWarning from '../views/beacon/LeftPanelLiveShareWarning';
7372
import { UserOnboardingPage } from '../views/user-onboarding/UserOnboardingPage';
@@ -103,8 +102,6 @@ interface IProps {
103102
justRegistered?: boolean;
104103
roomJustCreatedOpts?: IOpts;
105104
forceTimeline?: boolean; // see props on MatrixChat
106-
107-
currentGroupId?: string;
108105
}
109106

110107
interface IState {
@@ -641,10 +638,6 @@ class LoggedInView extends React.Component<IProps, IState> {
641638
case PageTypes.UserView:
642639
pageElement = <UserView userId={this.props.currentUserId} resizeNotifier={this.props.resizeNotifier} />;
643640
break;
644-
645-
case PageTypes.LegacyGroupView:
646-
pageElement = <LegacyGroupView groupId={this.props.currentGroupId} />;
647-
break;
648641
}
649642

650643
const wrapperClasses = classNames({

src/components/structures/MatrixChat.tsx

-21
Original file line numberDiff line numberDiff line change
@@ -188,8 +188,6 @@ interface IState {
188188
currentRoomId?: string;
189189
// If we're trying to just view a user ID (i.e. /user URL), this is it
190190
currentUserId?: string;
191-
// Group ID for legacy "communities don't exist" page
192-
currentGroupId?: string;
193191
// this is persisted as mx_lhs_size, loaded in LoggedInView
194192
collapseLhs: boolean;
195193
// Parameters used in the registration dance with the IS
@@ -679,9 +677,6 @@ export default class MatrixChat extends React.PureComponent<IProps, IState> {
679677
}
680678
break;
681679
}
682-
case 'view_legacy_group':
683-
this.viewLegacyGroup(payload.groupId);
684-
break;
685680
case Action.ViewUserSettings: {
686681
const tabPayload = payload as OpenToTabPayload;
687682
Modal.createDialog(UserSettingsDialog,
@@ -1023,16 +1018,6 @@ export default class MatrixChat extends React.PureComponent<IProps, IState> {
10231018
});
10241019
}
10251020

1026-
private viewLegacyGroup(groupId: string) {
1027-
this.setStateForNewView({
1028-
view: Views.LOGGED_IN,
1029-
currentRoomId: null,
1030-
currentGroupId: groupId,
1031-
});
1032-
this.notifyNewScreen('group/' + groupId);
1033-
this.setPage(PageType.LegacyGroupView);
1034-
}
1035-
10361021
private async createRoom(defaultPublic = false, defaultName?: string, type?: RoomType) {
10371022
const modal = Modal.createDialog(CreateRoomDialog, {
10381023
type,
@@ -1803,12 +1788,6 @@ export default class MatrixChat extends React.PureComponent<IProps, IState> {
18031788
userId: userId,
18041789
subAction: params.action,
18051790
});
1806-
} else if (screen.indexOf('group/') === 0) {
1807-
const groupId = screen.substring(6);
1808-
dis.dispatch({
1809-
action: 'view_legacy_group',
1810-
groupId: groupId,
1811-
});
18121791
} else {
18131792
logger.info("Ignoring showScreen for '%s'", screen);
18141793
}

src/group_helpers.tsx

-45
This file was deleted.

src/i18n/strings/en_EN.json

-2
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,6 @@
5252
"%(value)sh": "%(value)sh",
5353
"%(value)sm": "%(value)sm",
5454
"%(value)ss": "%(value)ss",
55-
"That link is no longer supported": "That link is no longer supported",
56-
"You're trying to access a community link (%(groupId)s).<br/>Communities are no longer supported and have been replaced by spaces.<br2/><a>Learn more about spaces here.</a>": "You're trying to access a community link (%(groupId)s).<br/>Communities are no longer supported and have been replaced by spaces.<br2/><a>Learn more about spaces here.</a>",
5755
"Identity server has no terms of service": "Identity server has no terms of service",
5856
"This action requires accessing the default identity server <server /> to validate an email address or phone number, but the server does not have any terms of service.": "This action requires accessing the default identity server <server /> to validate an email address or phone number, but the server does not have any terms of service.",
5957
"Only continue if you trust the owner of the server.": "Only continue if you trust the owner of the server.",

src/linkify-matrix.ts

-28
Original file line numberDiff line numberDiff line change
@@ -30,13 +30,11 @@ import dis from './dispatcher/dispatcher';
3030
import { Action } from './dispatcher/actions';
3131
import { ViewUserPayload } from './dispatcher/payloads/ViewUserPayload';
3232
import { ViewRoomPayload } from "./dispatcher/payloads/ViewRoomPayload";
33-
import { showGroupReplacedWithSpacesDialog } from "./group_helpers";
3433

3534
export enum Type {
3635
URL = "url",
3736
UserId = "userid",
3837
RoomAlias = "roomalias",
39-
GroupId = "groupid",
4038
}
4139

4240
// Linkify stuff doesn't type scanner/parser/utils properly :/
@@ -115,11 +113,6 @@ function onUserClick(event: MouseEvent, userId: string) {
115113
});
116114
}
117115

118-
function onGroupClick(event: MouseEvent, groupId: string) {
119-
event.preventDefault();
120-
showGroupReplacedWithSpacesDialog(groupId);
121-
}
122-
123116
function onAliasClick(event: MouseEvent, roomAlias: string) {
124117
event.preventDefault();
125118
dis.dispatch<ViewRoomPayload>({
@@ -192,23 +185,13 @@ export const options = {
192185
onAliasClick(e, alias);
193186
},
194187
};
195-
196-
case Type.GroupId:
197-
return {
198-
// @ts-ignore see https://linkify.js.org/docs/options.html
199-
click: function(e: MouseEvent) {
200-
const groupId = parsePermalink(href).groupId;
201-
onGroupClick(e, groupId);
202-
},
203-
};
204188
}
205189
},
206190

207191
formatHref: function(href: string, type: Type | string): string {
208192
switch (type) {
209193
case Type.RoomAlias:
210194
case Type.UserId:
211-
case Type.GroupId:
212195
default: {
213196
return tryTransformEntityToPermalink(href);
214197
}
@@ -255,17 +238,6 @@ registerPlugin(Type.RoomAlias, ({ scanner, parser, utils }) => {
255238
});
256239
});
257240

258-
registerPlugin(Type.GroupId, ({ scanner, parser, utils }) => {
259-
const token = scanner.tokens.PLUS as '+';
260-
matrixOpaqueIdLinkifyParser({
261-
scanner,
262-
parser,
263-
utils,
264-
token,
265-
name: Type.GroupId,
266-
});
267-
});
268-
269241
registerPlugin(Type.UserId, ({ scanner, parser, utils }) => {
270242
const token = scanner.tokens.AT as '@';
271243
matrixOpaqueIdLinkifyParser({

src/utils/permalinks/ElementPermalinkConstructor.ts

-8
Original file line numberDiff line numberDiff line change
@@ -43,17 +43,11 @@ export default class ElementPermalinkConstructor extends PermalinkConstructor {
4343
return `${this.elementUrl}/#/user/${userId}`;
4444
}
4545

46-
forGroup(groupId: string): string {
47-
return `${this.elementUrl}/#/group/${groupId}`;
48-
}
49-
5046
forEntity(entityId: string): string {
5147
if (entityId[0] === '!' || entityId[0] === '#') {
5248
return this.forRoom(entityId);
5349
} else if (entityId[0] === '@') {
5450
return this.forUser(entityId);
55-
} else if (entityId[0] === '+') {
56-
return this.forGroup(entityId);
5751
} else throw new Error("Unrecognized entity");
5852
}
5953

@@ -107,8 +101,6 @@ export default class ElementPermalinkConstructor extends PermalinkConstructor {
107101
const eventId = parts.length > 2 ? parts.slice(2).join('/') : "";
108102
const via = query.split(/&?via=/).filter(p => !!p);
109103
return PermalinkParts.forEvent(entity, eventId, via);
110-
} else if (entityType === 'group') {
111-
return PermalinkParts.forGroup(entity);
112104
} else {
113105
throw new Error("Unknown entity type in permalink");
114106
}

src/utils/permalinks/MatrixSchemePermalinkConstructor.ts

-4
Original file line numberDiff line numberDiff line change
@@ -51,10 +51,6 @@ export default class MatrixSchemePermalinkConstructor extends PermalinkConstruct
5151
return `matrix:${this.encodeEntity(userId)}`;
5252
}
5353

54-
forGroup(groupId: string): string {
55-
throw new Error("Deliberately not implemented");
56-
}
57-
5854
forEntity(entityId: string): string {
5955
return `matrix:${this.encodeEntity(entityId)}`;
6056
}

src/utils/permalinks/MatrixToPermalinkConstructor.ts

-6
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,6 @@ export default class MatrixToPermalinkConstructor extends PermalinkConstructor {
3939
return `${baseUrl}/#/${userId}`;
4040
}
4141

42-
forGroup(groupId: string): string {
43-
return `${baseUrl}/#/${groupId}`;
44-
}
45-
4642
forEntity(entityId: string): string {
4743
return `${baseUrl}/#/${entityId}`;
4844
}
@@ -82,8 +78,6 @@ export default class MatrixToPermalinkConstructor extends PermalinkConstructor {
8278
const via = query.split(/&?via=/g).filter(p => !!p);
8379

8480
return PermalinkParts.forEvent(entity, eventId, via);
85-
} else if (entity[0] === '+') {
86-
return PermalinkParts.forGroup(entity);
8781
} else {
8882
throw new Error("Unknown entity type in permalink");
8983
}

src/utils/permalinks/PermalinkConstructor.ts

+4-14
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,6 @@ export default class PermalinkConstructor {
2727
throw new Error("Not implemented");
2828
}
2929

30-
forGroup(groupId: string): string {
31-
throw new Error("Not implemented");
32-
}
33-
3430
forUser(userId: string): string {
3531
throw new Error("Not implemented");
3632
}
@@ -55,30 +51,24 @@ export class PermalinkParts {
5551
eventId: string;
5652
userId: string;
5753
viaServers: string[];
58-
groupId: string;
5954

60-
constructor(roomIdOrAlias: string, eventId: string, userId: string, groupId: string, viaServers: string[]) {
55+
constructor(roomIdOrAlias: string, eventId: string, userId: string, viaServers: string[]) {
6156
this.roomIdOrAlias = roomIdOrAlias;
6257
this.eventId = eventId;
6358
this.userId = userId;
64-
this.groupId = groupId;
6559
this.viaServers = viaServers;
6660
}
6761

6862
static forUser(userId: string): PermalinkParts {
69-
return new PermalinkParts(null, null, userId, null, null);
70-
}
71-
72-
static forGroup(groupId: string): PermalinkParts {
73-
return new PermalinkParts(null, null, null, groupId, null);
63+
return new PermalinkParts(null, null, userId, null);
7464
}
7565

7666
static forRoom(roomIdOrAlias: string, viaServers: string[] = []): PermalinkParts {
77-
return new PermalinkParts(roomIdOrAlias, null, null, null, viaServers);
67+
return new PermalinkParts(roomIdOrAlias, null, null, viaServers);
7868
}
7969

8070
static forEvent(roomId: string, eventId: string, viaServers: string[] = []): PermalinkParts {
81-
return new PermalinkParts(roomId, eventId, null, null, viaServers);
71+
return new PermalinkParts(roomId, eventId, null, viaServers);
8272
}
8373

8474
get primaryEntityId(): string {

0 commit comments

Comments
 (0)