Bundle Element Call with Element Web packages (#29309)
* Embed Element Call into Element Web packages Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> * Iterate Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> * Iterate Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> * Pass rageshakeSubmitUrl & posthogApiHost to EC widget Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> * Iterate Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> * Improve coverage Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> * Iterate Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> * Iterate Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> * Improve coverage Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> * Update snapshots Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> * Use @vector-im/element-call-embedded * Only pass posthog params to EC if Analytics is enabled Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> * Fix test mock Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> * Update EC params to match https://github.com/element-hq/element-call/pull/3089 Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> * Update to latest element-call package Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> * yarn.lock Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> * Iterate Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> * Update to element-call-embedded@ v0.9.0-rc.1 * Gate Sentry params behind analytics consent Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> * Update to element-call-embedded v0.9.0-rc.4 * Update Element Call embedded to 0.9.0 release Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> --------- Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> Co-authored-by: Hugh Nimmo-Smith <hughns@element.io>
This commit is contained in:
committed by
GitHub
parent
209ab59978
commit
8bb4d44532
@@ -25,6 +25,7 @@ import ServerInfo from "./devtools/ServerInfo";
|
||||
import CopyableText from "../elements/CopyableText";
|
||||
import RoomNotifications from "./devtools/RoomNotifications";
|
||||
import { Crypto } from "./devtools/Crypto";
|
||||
import SettingsField from "../elements/SettingsField.tsx";
|
||||
|
||||
enum Category {
|
||||
Room,
|
||||
@@ -101,6 +102,7 @@ const DevtoolsDialog: React.FC<IProps> = ({ roomId, threadRootId, onFinished })
|
||||
<SettingsFlag name="developerMode" level={SettingLevel.ACCOUNT} />
|
||||
<SettingsFlag name="showHiddenEventsInTimeline" level={SettingLevel.DEVICE} />
|
||||
<SettingsFlag name="enableWidgetScreenshots" level={SettingLevel.ACCOUNT} />
|
||||
<SettingsField settingKey="Developer.elementCallUrl" level={SettingLevel.DEVICE} />
|
||||
</div>
|
||||
</BaseTool>
|
||||
);
|
||||
|
||||
59
src/components/views/elements/SettingsField.tsx
Normal file
59
src/components/views/elements/SettingsField.tsx
Normal file
@@ -0,0 +1,59 @@
|
||||
/*
|
||||
Copyright 2025 New Vector Ltd.
|
||||
|
||||
SPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only OR LicenseRef-Element-Commercial
|
||||
Please see LICENSE files in the repository root for full details.
|
||||
*/
|
||||
|
||||
import React, { type ChangeEvent, type JSX, useCallback, useState } from "react";
|
||||
import { EditInPlace } from "@vector-im/compound-web";
|
||||
|
||||
import SettingsStore from "../../../settings/SettingsStore";
|
||||
import { _t } from "../../../languageHandler";
|
||||
import { type SettingLevel } from "../../../settings/SettingLevel";
|
||||
import { type StringSettingKey } from "../../../settings/Settings";
|
||||
|
||||
interface Props {
|
||||
settingKey: StringSettingKey;
|
||||
level: SettingLevel;
|
||||
roomId?: string; // for per-room settings
|
||||
label?: string;
|
||||
isExplicit?: boolean;
|
||||
onChange?(value: string): void;
|
||||
}
|
||||
|
||||
const SettingsField = ({ settingKey, level, roomId, isExplicit, label, onChange: _onSave }: Props): JSX.Element => {
|
||||
const settingsValue = SettingsStore.getValueAt(level, settingKey, roomId, isExplicit);
|
||||
const [value, setValue] = useState(settingsValue);
|
||||
const [busy, setBusy] = useState(false);
|
||||
|
||||
const onChange = useCallback((e: ChangeEvent<HTMLInputElement>) => {
|
||||
setValue(e.target.value);
|
||||
}, []);
|
||||
const onCancel = useCallback(() => {
|
||||
setValue(settingsValue);
|
||||
}, [settingsValue]);
|
||||
const onSave = useCallback(async () => {
|
||||
setBusy(true);
|
||||
await SettingsStore.setValue(settingKey, roomId ?? null, level, value);
|
||||
setBusy(false);
|
||||
_onSave?.(value);
|
||||
}, [level, roomId, settingKey, value, _onSave]);
|
||||
|
||||
return (
|
||||
<EditInPlace
|
||||
label={label ?? SettingsStore.getDisplayName(settingKey, level) ?? ""}
|
||||
value={value}
|
||||
saveButtonLabel={_t("common|save")}
|
||||
cancelButtonLabel={_t("common|cancel")}
|
||||
savedLabel={_t("common|saved")}
|
||||
savingLabel={_t("common|updating")}
|
||||
onChange={onChange}
|
||||
onCancel={onCancel}
|
||||
onSave={onSave}
|
||||
disabled={busy}
|
||||
/>
|
||||
);
|
||||
};
|
||||
|
||||
export default SettingsField;
|
||||
Reference in New Issue
Block a user