Skip to content

Commit 530197b

Browse files
author
Kerry
authored
Move session manager out of beta (matrix-org#10968)
* remove old device manager * undo type fix for cypress crypto * update test case
1 parent e326526 commit 530197b

21 files changed

+450
-1673
lines changed

cypress/e2e/register/register.spec.ts

+5-5
Original file line numberDiff line numberDiff line change
@@ -89,11 +89,11 @@ describe("Registration", () => {
8989

9090
// check that the device considers itself verified
9191
cy.findByRole("button", { name: "User menu" }).click();
92-
cy.findByRole("menuitem", { name: "Security & Privacy" }).click();
93-
cy.get(".mx_DevicesPanel_myDevice .mx_DevicesPanel_deviceTrust .mx_E2EIcon").should(
94-
"have.class",
95-
"mx_E2EIcon_verified",
96-
);
92+
cy.findByRole("menuitem", { name: "All settings" }).click();
93+
cy.findByRole("tab", { name: "Sessions" }).click();
94+
cy.findByTestId("current-session-section").within(() => {
95+
cy.findByTestId("device-metadata-isVerified").should("have.text", "Verified");
96+
});
9797

9898
// check that cross-signing keys have been uploaded.
9999
checkDeviceIsCrossSigned();

cypress/e2e/settings/device-management.spec.ts

-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ describe("Device manager", () => {
2424
let user: UserCredentials | undefined;
2525

2626
beforeEach(() => {
27-
cy.enableLabsFeature("feature_new_device_manager");
2827
cy.startHomeserver("default").then((data) => {
2928
homeserver = data;
3029

res/css/_components.pcss

-1
Original file line numberDiff line numberDiff line change
@@ -316,7 +316,6 @@
316316
@import "./views/settings/_AvatarSetting.pcss";
317317
@import "./views/settings/_CrossSigningPanel.pcss";
318318
@import "./views/settings/_CryptographyPanel.pcss";
319-
@import "./views/settings/_DevicesPanel.pcss";
320319
@import "./views/settings/_FontScalingPanel.pcss";
321320
@import "./views/settings/_ImageSizePanel.pcss";
322321
@import "./views/settings/_IntegrationManager.pcss";

res/css/views/settings/_DevicesPanel.pcss

-102
This file was deleted.

src/actions/handlers/viewUserDeviceSettings.ts

+3-4
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,11 @@ import { Action } from "../../dispatcher/actions";
1919
import defaultDispatcher from "../../dispatcher/dispatcher";
2020

2121
/**
22-
* Redirect to the correct device manager section
23-
* Based on the labs setting
22+
* Open user device manager settings
2423
*/
25-
export const viewUserDeviceSettings = (isNewDeviceManagerEnabled: boolean): void => {
24+
export const viewUserDeviceSettings = (): void => {
2625
defaultDispatcher.dispatch({
2726
action: Action.ViewUserSettings,
28-
initialTabId: isNewDeviceManagerEnabled ? UserTab.SessionManager : UserTab.Security,
27+
initialTabId: UserTab.SessionManager,
2928
});
3029
};

src/components/structures/MatrixChat.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -700,7 +700,7 @@ export default class MatrixChat extends React.PureComponent<IProps, IState> {
700700
break;
701701
}
702702
case Action.ViewUserDeviceSettings: {
703-
viewUserDeviceSettings(SettingsStore.getValue("feature_new_device_manager"));
703+
viewUserDeviceSettings();
704704
break;
705705
}
706706
case Action.ViewUserSettings: {

src/components/views/dialogs/UserSettingsDialog.tsx

+11-23
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,6 @@ interface IProps {
4545

4646
interface IState {
4747
mjolnirEnabled: boolean;
48-
newSessionManagerEnabled: boolean;
4948
}
5049

5150
export default class UserSettingsDialog extends React.Component<IProps, IState> {
@@ -56,15 +55,11 @@ export default class UserSettingsDialog extends React.Component<IProps, IState>
5655

5756
this.state = {
5857
mjolnirEnabled: SettingsStore.getValue("feature_mjolnir"),
59-
newSessionManagerEnabled: SettingsStore.getValue("feature_new_device_manager"),
6058
};
6159
}
6260

6361
public componentDidMount(): void {
64-
this.settingsWatchers = [
65-
SettingsStore.watchSetting("feature_mjolnir", null, this.mjolnirChanged),
66-
SettingsStore.watchSetting("feature_new_device_manager", null, this.sessionManagerChanged),
67-
];
62+
this.settingsWatchers = [SettingsStore.watchSetting("feature_mjolnir", null, this.mjolnirChanged)];
6863
}
6964

7065
public componentWillUnmount(): void {
@@ -76,11 +71,6 @@ export default class UserSettingsDialog extends React.Component<IProps, IState>
7671
this.setState({ mjolnirEnabled: newValue });
7772
};
7873

79-
private sessionManagerChanged: CallbackFn = (settingName, roomId, atLevel, newValue) => {
80-
// We can cheat because we know what levels a feature is tracked at, and how it is tracked
81-
this.setState({ newSessionManagerEnabled: newValue });
82-
};
83-
8474
private getTabs(): NonEmptyArray<Tab<UserTab>> {
8575
const tabs: Tab<UserTab>[] = [];
8676

@@ -160,18 +150,16 @@ export default class UserSettingsDialog extends React.Component<IProps, IState>
160150
"UserSettingsSecurityPrivacy",
161151
),
162152
);
163-
if (this.state.newSessionManagerEnabled) {
164-
tabs.push(
165-
new Tab(
166-
UserTab.SessionManager,
167-
_td("Sessions"),
168-
"mx_UserSettingsDialog_sessionsIcon",
169-
<SessionManagerTab />,
170-
// don't track with posthog while under construction
171-
undefined,
172-
),
173-
);
174-
}
153+
tabs.push(
154+
new Tab(
155+
UserTab.SessionManager,
156+
_td("Sessions"),
157+
"mx_UserSettingsDialog_sessionsIcon",
158+
<SessionManagerTab />,
159+
// don't track with posthog while under construction
160+
undefined,
161+
),
162+
);
175163
// Show the Labs tab if enabled or if there are any active betas
176164
if (
177165
SdkConfig.get("show_labs_settings") ||

0 commit comments

Comments
 (0)