Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(widgets): hide widgets settings, needed to be activated for element call #1126

Merged
merged 1 commit into from
Oct 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import SettingsStore from "../../../settings/SettingsStore";
import { UIComponent, UIFeature } from "../../../settings/UIFeature";
import { shouldShowComponent } from "../../../customisations/helpers/UIComponents";
import { isVideoRoom as calcIsVideoRoom } from "../../../utils/video-rooms";
import TchapUIFeature from "../../../../../../src/tchap/util/TchapUIFeature";

function shouldShowTabsForPhase(phase?: RightPanelPhases): boolean {
const tabs = [
Expand Down Expand Up @@ -86,7 +87,9 @@ export const RightPanelTabs: React.FC<Props> = ({ phase, room }): JSX.Element |
>
{_t("common|threads")}
</NavItem>
{SettingsStore.getValue(UIFeature.Widgets) &&
{/* :TCHAP: hide-widgets-settings */}
{/* {SettingsStore.getValue(UIFeature.Widgets) && */}
{TchapUIFeature.showWidgetsSettings && SettingsStore.getValue(UIFeature.Widgets) &&
!isVideoRoom &&
shouldShowComponent(UIComponent.AddIntegrations) && (
<NavItem
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ import SettingsSubsection, { SettingsSubsectionText } from "../../shared/Setting
import { useOwnDevices } from "../../devices/useOwnDevices";
import DiscoverySettings from "../../discovery/DiscoverySettings";
import SetIntegrationManager from "../../SetIntegrationManager";
import TchapUIFeature from "../../../../../../../../src/tchap/util/TchapUIFeature";

interface IIgnoredUserProps {
userId: string;
Expand Down Expand Up @@ -377,7 +378,9 @@ export default class SecurityUserSettingsTab extends React.Component<IProps, ISt
{warning}
{ /* :TCHAP: change-sections-order-in-security-privacy-settings - move secureBackup and privacySection, and remove eventIndex */ }
{secureBackup}
<SetIntegrationManager />
{/* :TCHAP: hide-widgets-settings - <SetIntegrationManager />*/}
{ TchapUIFeature.showWidgetsSettings && <SetIntegrationManager />}
{/* end :TCHAP: */}
<SettingsSection heading={_t("settings|security|encryption_section")}>
{crossSigning}
<CryptographyPanel />
Expand Down
9 changes: 8 additions & 1 deletion patches/subtree-modifications.json
Original file line number Diff line number Diff line change
Expand Up @@ -82,10 +82,17 @@
"sso-agentconnect-flow": {
"issue": "https://github.com/tchapgouv/tchap-web-v4/issues/386",
"files": [
"src/components/structures/MatrixChat.tsx",
"src/components/structures/MatrixChat.tsx",
"src/components/structures/auth/Registration.tsx",
"src/components/structures/auth/Login.tsx",
"src/components/views/auth/Welcome.tsx"
]
},
"hide-widgets-settings": {
"issue": "https://github.com/tchapgouv/tchap-web-v4/issues/1117",
"files": [
"src/components/views/right_panel/RightPanelTabs.tsx",
"src/components/views/settings/tabs/user/SecurityUserSettingsTab.tsx"
]
}
}
5 changes: 5 additions & 0 deletions src/tchap/util/TchapUIFeature.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,11 @@ export default class TchapUIFeature {
*/
public static activateClearCacheAndReloadAtVersion4 = true;

/**
* Hide UI for widget and integration manager. We use a flag cause it may be useful for future usecase
*/
public static showWidgetsSettings = false;

/**
* Whether the given feature is active on the current user's homeserver.
* We get the list of homeservers where the feature should be activated from config.json
Expand Down
Loading