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

Delete groups (legacy communities system) #8027

Merged
merged 52 commits into from
Mar 22, 2022
Merged
Show file tree
Hide file tree
Changes from 16 commits
Commits
Show all changes
52 commits
Select commit Hold shift + click to select a range
3e9c166
Remove deprecated feature_communities_v2_prototypes
t3chguy Jan 31, 2022
ab34071
Update _components
t3chguy Jan 31, 2022
74368ec
Merge branch 'develop' of github.com:matrix-org/matrix-react-sdk into…
t3chguy Feb 2, 2022
86201cf
i18n
t3chguy Feb 2, 2022
b7c832a
delint
t3chguy Feb 2, 2022
d279ef7
Merge branch 'develop' of github.com:matrix-org/matrix-react-sdk into…
t3chguy Feb 10, 2022
f44d05f
Merge branch 'develop' of github.com:matrix-org/matrix-react-sdk into…
t3chguy Feb 28, 2022
8aac666
Merge branch 'develop' into t3chguy/remove-communities-v2
turt2live Mar 10, 2022
da4f779
Cut out a bit more dead code
turt2live Mar 10, 2022
afcf1e7
Merge branch 't3chguy/remove-communities-v2' into travis/del-groups
turt2live Mar 10, 2022
f2237d9
Carve into legacy components
turt2live Mar 10, 2022
244184f
Carve into mostly the room list code
turt2live Mar 10, 2022
a9aeb91
Carve into instances of "groupId"
turt2live Mar 10, 2022
52b35b7
Carve out more of what comes up with "groups"
turt2live Mar 10, 2022
63f2be9
Carve out some settings
turt2live Mar 10, 2022
d461f37
ignore related groups state
turt2live Mar 10, 2022
a4a3b70
Remove instances of spacesEnabled
turt2live Mar 10, 2022
9855105
Fix some obvious issues
turt2live Mar 10, 2022
c0583ea
Remove now-unused css
turt2live Mar 10, 2022
3dbd7f5
Fix variable naming for legacy components
turt2live Mar 10, 2022
02a63b1
Update i18n
turt2live Mar 10, 2022
0d3520f
Misc cleanup from manual review
turt2live Mar 10, 2022
ed96634
Update snapshot for changed flag
turt2live Mar 10, 2022
3f90d66
Appease linters
turt2live Mar 10, 2022
5754fa1
rethemedex
turt2live Mar 10, 2022
e5c056f
Remove now-unused AddressPickerDialog
turt2live Mar 11, 2022
af28b70
Make ConfirmUserActionDialog's member a required prop
turt2live Mar 11, 2022
9828acf
Remove useless override from RightPanelStore
turt2live Mar 11, 2022
d801d0f
Remove extraneous CSS
turt2live Mar 11, 2022
36e0e09
Update i18n
turt2live Mar 11, 2022
28c53b9
Merge remote-tracking branch 'origin/develop' into travis/del-groups
turt2live Mar 11, 2022
ad96002
Demo: "Communities are now Spaces" landing page
turt2live Mar 15, 2022
afa79cb
Restore linkify for group IDs
turt2live Mar 15, 2022
b822aa0
Demo: Dialog on click for communities->spaces notice
turt2live Mar 15, 2022
41cdb40
i18n for demos
turt2live Mar 15, 2022
8081b5e
Merge branch 'develop' into travis/del-groups
turt2live Mar 15, 2022
a45073c
i18n post-merge
turt2live Mar 15, 2022
90c59fc
Update copy
turt2live Mar 15, 2022
a242d5f
Merge branch 'develop' into travis/del-groups
turt2live Mar 16, 2022
d3ffb63
Appease the linter
turt2live Mar 16, 2022
7eb17a9
Merge branch 'develop' into travis/del-groups
turt2live Mar 17, 2022
1257be7
Merge branch 'develop' into travis/del-groups
turt2live Mar 21, 2022
46022b9
Post-merge cleanup
turt2live Mar 21, 2022
8fa0189
Re-add spaces_learn_more_url to the new SdkConfig place
turt2live Mar 21, 2022
4172c4c
Merge branch 'develop' into travis/del-groups
turt2live Mar 22, 2022
16aec3d
Merge branch 'develop' into travis/del-groups
turt2live Mar 22, 2022
1d65b4a
Round 1 of post-merge fixes
turt2live Mar 22, 2022
9beb398
Merge remote-tracking branch 'origin/develop' into travis/del-groups
turt2live Mar 22, 2022
d33fb97
i18n
turt2live Mar 22, 2022
acde78a
Merge branch 'develop' into travis/del-groups
turt2live Mar 22, 2022
3d7f695
Fix lint on behalf of develop
turt2live Mar 22, 2022
ee271c5
Appease the linter again
turt2live Mar 22, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion res/css/_components.scss
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,6 @@
@import "./views/context_menus/_IconizedContextMenu.scss";
@import "./views/context_menus/_MessageContextMenu.scss";
@import "./views/dialogs/_AddExistingToSpaceDialog.scss";
@import "./views/dialogs/_AddressPickerDialog.scss";
@import "./views/dialogs/_Analytics.scss";
@import "./views/dialogs/_AnalyticsLearnMoreDialog.scss";
@import "./views/dialogs/_BugReportDialog.scss";
Expand Down
5 changes: 0 additions & 5 deletions res/css/structures/_LeftPanel.scss
Original file line number Diff line number Diff line change
Expand Up @@ -117,11 +117,6 @@ $roomListCollapsedWidth: 68px;
display: flex;
align-items: center;

.mx_UserMenu {
// mini-mode for when Space Panel is disabled
margin-right: 12px;
}

& + .mx_RoomListHeader {
margin-top: 12px;
}
Expand Down
2 changes: 1 addition & 1 deletion res/css/structures/_MatrixChat.scss
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ limitations under the License.
}

/* not the left panel, and not the resize handle, so the roomview and friends */
.mx_MatrixChat > :not(.mx_LeftPanel):not(.mx_SpacePanel):not(.mx_ResizeHandle):not(.mx_LeftPanel_wrapper) {
.mx_MatrixChat > :not(.mx_LeftPanel):not(.mx_SpacePanel):not(.mx_ResizeHandle):not(.mx_LeftPanel_outerWrapper) {
background-color: $background;

flex: 1 1 0;
Expand Down
80 changes: 0 additions & 80 deletions res/css/views/dialogs/_AddressPickerDialog.scss

This file was deleted.

6 changes: 5 additions & 1 deletion res/css/views/dialogs/_InviteDialog.scss
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ limitations under the License.
min-width: max-content; // prevent manipulation by flexbox
}

// Mostly copied from AddressPickerDialog; overrides bunch of our default text input styles
// overrides bunch of our default text input styles
> input[type="text"] {
margin: 6px 0 !important;
height: 24px;
Expand Down Expand Up @@ -439,3 +439,7 @@ limitations under the License.
}
}
}

.mx_InviteDialog_identityServer {
margin-top: 1em;
}
1 change: 1 addition & 0 deletions src/PageTypes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ enum PageType {
HomePage = "home_page",
RoomView = "room_view",
UserView = "user_view",
LegacyGroupView = "legacy_group_view",
}

export default PageType;
1 change: 1 addition & 0 deletions src/PosthogTrackers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ const loggedInPageTypeMap: Record<PageType, ScreenName> = {
[PageType.HomePage]: "Home",
[PageType.RoomView]: "Room",
[PageType.UserView]: "User",
[PageType.LegacyGroupView]: "Group",
};

export default class PosthogTrackers {
Expand Down
4 changes: 4 additions & 0 deletions src/SdkConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@ export interface ConfigOptions {
sso_redirect_options?: ISsoRedirectOptions;

custom_translations_url?: string;

// XXX: Undocumented URL for the "Learn more about spaces" link in the "Communities don't exist" messaging.
spaces_learn_more_url?: string;
}
/* eslint-enable camelcase*/

Expand All @@ -53,6 +56,7 @@ export const DEFAULTS: ConfigOptions = {
logo: require("../res/img/element-desktop-logo.svg").default,
url: "https://element.io/get-started",
},
spaces_learn_more_url: "https://element.io/blog/spaces-blast-out-of-beta/",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm trepidatious about linking to the blog post. We can't guarantee the link will be active forever. I'd rather we add some content to element.io/help and link there instead. Does that work for you? If so I can make that happen and we can include in another PR.

I don't think making it configurable solves this, given we have no control over the configs of other deployments and the link could break there.

Copy link
Member Author

@turt2live turt2live Mar 21, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The config is mostly for branded clients, not the longevity of the link tbh.

};

export default class SdkConfig {
Expand Down
51 changes: 51 additions & 0 deletions src/components/structures/LegacyGroupView.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
/*
Copyright 2020 The Matrix.org Foundation C.I.C.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/

import * as React from "react";

import AutoHideScrollbar from './AutoHideScrollbar';
import { _t } from "../../languageHandler";
import SdkConfig, { DEFAULTS } from "../../SdkConfig";

interface IProps {
groupId: string;
}

const LegacyGroupView: React.FC<IProps> = ({ groupId }) => {
// XXX: Stealing classes from the HomePage component for CSS simplicity.
// XXX: Inline CSS because this is all temporary
const learnMoreUrl = SdkConfig.get().spaces_learn_more_url ?? DEFAULTS.spaces_learn_more_url;
return <AutoHideScrollbar className="mx_HomePage mx_HomePage_default">
<div className="mx_HomePage_default_wrapper">
<h1 style={{ fontSize: '24px' }}>{ _t("That link is no longer supported") }</h1>
<p>
{ _t(
"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>",
{ groupId },
{
br: () => <br />,
br2: () => <br />,
a: (sub) => <a href={learnMoreUrl} rel="noreferrer noopener" target="_blank">{ sub }</a>,
},
) }
</p>
</div>
</AutoHideScrollbar>;
};

export default LegacyGroupView;
37 changes: 23 additions & 14 deletions src/components/structures/LoggedInView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ import RightPanelStore from '../../stores/right-panel/RightPanelStore';
import { TimelineRenderingType } from "../../contexts/RoomContext";
import { KeyBindingAction } from "../../accessibility/KeyboardShortcuts";
import { SwitchSpacePayload } from "../../dispatcher/payloads/SwitchSpacePayload";
import LegacyGroupView from "./LegacyGroupView";
import LeftPanelLiveShareWarning from '../views/beacon/LeftPanelLiveShareWarning';

// We need to fetch each pinned message individually (if we don't already have it)
Expand Down Expand Up @@ -107,6 +108,8 @@ interface IProps {
justRegistered?: boolean;
roomJustCreatedOpts?: IOpts;
forceTimeline?: boolean; // see props on MatrixChat

currentGroupId?: string;
}

interface IState {
Expand Down Expand Up @@ -644,6 +647,10 @@ class LoggedInView extends React.Component<IProps, IState> {
case PageTypes.UserView:
pageElement = <UserView userId={this.props.currentUserId} resizeNotifier={this.props.resizeNotifier} />;
break;

case PageTypes.LegacyGroupView:
pageElement = <LegacyGroupView groupId={this.props.currentGroupId} />;
break;
}

const wrapperClasses = classNames({
Expand Down Expand Up @@ -671,25 +678,27 @@ class LoggedInView extends React.Component<IProps, IState> {
>
<ToastContainer />
<div className={bodyClasses}>
<div className='mx_LeftPanel_wrapper'>
<>
<div className='mx_LeftPanel_outerWrapper'>
<LeftPanelLiveShareWarning isMinimized={this.props.collapseLhs || false} />
<div className='mx_LeftPanel_wrapper'>
<BackdropPanel
blurMultiplier={0.5}
backgroundImage={this.state.backgroundImage}
/>
<SpacePanel />
</>
<BackdropPanel
backgroundImage={this.state.backgroundImage}
/>
<div
className="mx_LeftPanel_wrapper--user"
ref={this._resizeContainer}
data-collapsed={this.props.collapseLhs ? true : undefined}
>
<LeftPanel
isMinimized={this.props.collapseLhs || false}
resizeNotifier={this.props.resizeNotifier}
<BackdropPanel
backgroundImage={this.state.backgroundImage}
/>
<div
className="mx_LeftPanel_wrapper--user"
ref={this._resizeContainer}
data-collapsed={this.props.collapseLhs ? true : undefined}
>
<LeftPanel
isMinimized={this.props.collapseLhs || false}
resizeNotifier={this.props.resizeNotifier}
/>
</div>
</div>
</div>
<ResizeHandle passRef={this.resizeHandler} id="lp-resizer" />
Expand Down
21 changes: 21 additions & 0 deletions src/components/structures/MatrixChat.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,8 @@ interface IState {
currentRoomId?: string;
// If we're trying to just view a user ID (i.e. /user URL), this is it
currentUserId?: string;
// Group ID for legacy "communities don't exist" page
currentGroupId?: string;
// this is persisted as mx_lhs_size, loaded in LoggedInView
collapseLhs: boolean;
// Parameters used in the registration dance with the IS
Expand Down Expand Up @@ -664,6 +666,9 @@ export default class MatrixChat extends React.PureComponent<IProps, IState> {
}
break;
}
case 'view_legacy_group':
this.viewLegacyGroup(payload.groupId);
break;
case Action.ViewUserSettings: {
const tabPayload = payload as OpenToTabPayload;
Modal.createTrackedDialog('User settings', '', UserSettingsDialog,
Expand Down Expand Up @@ -982,6 +987,16 @@ export default class MatrixChat extends React.PureComponent<IProps, IState> {
});
}

private viewLegacyGroup(groupId: string) {
this.setStateForNewView({
view: Views.LOGGED_IN,
currentRoomId: null,
currentGroupId: groupId,
});
this.notifyNewScreen('group/' + groupId);
this.setPage(PageType.LegacyGroupView);
}

private async createRoom(defaultPublic = false, defaultName?: string) {
const modal = Modal.createTrackedDialog('Create Room', '', CreateRoomDialog, {
defaultPublic,
Expand Down Expand Up @@ -1788,6 +1803,12 @@ export default class MatrixChat extends React.PureComponent<IProps, IState> {
userId: userId,
subAction: params.action,
});
} else if (screen.indexOf('group/') === 0) {
const groupId = screen.substring(6);
dis.dispatch({
action: 'view_legacy_group',
groupId: groupId,
});
} else {
logger.info("Ignoring showScreen for '%s'", screen);
}
Expand Down
2 changes: 1 addition & 1 deletion src/components/structures/RoomView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -1238,7 +1238,7 @@ export class RoomView extends React.Component<IRoomProps, IRoomState> {
};

private onInviteButtonClick = () => {
// call AddressPickerDialog
// open the room inviter
dis.dispatch({
action: 'view_invite',
roomId: this.state.room.roomId,
Expand Down
Loading