Skip to content

Commit

Permalink
Merge pull request #1212 from tchapgouv/1120-pcbutton-login-page
Browse files Browse the repository at this point in the history
Add PC button on login page
  • Loading branch information
MarcWadai authored Jan 13, 2025
2 parents c79bddd + 2dc3550 commit ed8104c
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 5 deletions.
1 change: 1 addition & 0 deletions res/css/views/sso/TchapSSO.pcss
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
background-color: var(--accent);
color: white !important;
text-align: left;
font-weight: bold;
}

.tc_Button_iconPC {
Expand Down
6 changes: 6 additions & 0 deletions res/themes/tchap-common/css/_tchap_custom.pcss
Original file line number Diff line number Diff line change
Expand Up @@ -119,4 +119,10 @@
.lasuite-header__service-title {
color: black;
}
}

/* login with proconnect style */
.mx_Login_submit {
border-radius: 0px !important;
height: 46px !important;
}
17 changes: 14 additions & 3 deletions src/components/structures/auth/Login.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ import { Features } from "../../../settings/Settings";
import { startOidcLogin } from "../../../utils/oidc/authorize";
import TchapUtils from '~tchap-web/src/tchap/util/TchapUtils'; // :TCHAP: login
import Tchapi18nUtils from '~tchap-web/src/tchap/i18n/Tchapi18nUtils'; // :TCHAP: login
import TchapUIFeature from "~tchap-web/src/tchap/util/TchapUIFeature";
import ProconnectButton from "~tchap-web/src/tchap/components/views/sso/ProconnectButton";

interface IProps {
serverConfig: ValidatedServerConfig;
Expand Down Expand Up @@ -130,8 +132,7 @@ export default class LoginComponent extends React.PureComponent<IProps, IState>
// eslint-disable-next-line @typescript-eslint/naming-convention
"m.login.cas": () => this.renderSsoStep("cas"),
// eslint-disable-next-line @typescript-eslint/naming-convention
// :TCHAP: sso-agentconnect-flow
// "m.login.sso": () => this.renderSsoStep("sso"),
"m.login.sso": () => this.renderSsoStep("sso"),
"oidcNativeFlow": () => this.renderOidcNativeStep(),
};
}
Expand Down Expand Up @@ -499,8 +500,8 @@ export default class LoginComponent extends React.PureComponent<IProps, IState>
};

private renderSsoStep = (loginType: "cas" | "sso"): JSX.Element => {
/** :TCHAP:
const flow = this.state.flows?.find((flow) => flow.type === "m.login." + loginType) as SSOFlow;

return (
<SSOButtons
matrixClient={this.loginLogic.createTemporaryClient()}
Expand All @@ -512,6 +513,16 @@ export default class LoginComponent extends React.PureComponent<IProps, IState>
disabled={this.isBusy()}
/>
);
*/

if (TchapUIFeature.isSSOFlowActive()) {
return <div style={{marginBottom: "25px", position: "relative", top: "-15px"}}>
<p style={{textAlign: "center", fontWeight: "bold"}}>{_t("auth|proconnect|or")}</p>
<ProconnectButton />
</div>;
}
return <></>;
// end :TCHAP:
};

public render(): React.ReactNode {
Expand Down
4 changes: 2 additions & 2 deletions src/components/structures/auth/Registration.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -643,9 +643,9 @@ export default class Registration extends React.Component<IProps, IState> {
// );
if (!this.props.mobileRegister && this.state.ssoFlow && TchapUIFeature.isSSOFlowActive()) {
ssoSection = <>
<ProconnectButton/>
<ProconnectButton />
<p style={{textAlign: "center", fontWeight: "bold"}}>{_t("auth|proconnect|or")}</p>
</>
</>;
}
// }
// end :TCHAP:
Expand Down

0 comments on commit ed8104c

Please sign in to comment.