Skip to content

Commit

Permalink
feat(widgets): hide widgets settings, needed to be activated for elem…
Browse files Browse the repository at this point in the history
…ent call
  • Loading branch information
marc.sirisak committed Oct 9, 2024
1 parent 81450c7 commit d5ae93c
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 3 deletions.
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

0 comments on commit d5ae93c

Please sign in to comment.