Client:PortalSettings:OAuth2: fix translation

This commit is contained in:
Timofey Boyko 2023-12-05 17:00:46 +03:00
parent 71c42ce188
commit 20073c7158
7 changed files with 51 additions and 22 deletions

View File

@ -4,11 +4,14 @@
"AppIcon": "App icon", "AppIcon": "App icon",
"AllowedOrigins": "Allowed origins", "AllowedOrigins": "Allowed origins",
"AllowedOriginsHelpButton": "URLs added here are used to improve the OAuth redirect security.", "AllowedOriginsHelpButton": "URLs added here are used to improve the OAuth redirect security.",
"AllowPKCE": "Allow public client (PKCE)",
"AllowPKCEHelpButton": "PKCE is not a form of client authentication, and PKCE is not a replacement for a client secret or another client authentication type. PKCE is recommended even if a client is using a client secret or another form of client authentication like private_key_jwt.<br/> <strong>Note</strong>: Since PKCE is not a replacement for client authentication, it does not allow treating a public client as confidential one.",
"AppName": "App name", "AppName": "App name",
"Apps": "Applications", "Apps": "Applications",
"AuthButton": "Auth button", "AuthButton": "Auth button",
"AuthorizedApps": "Authorized apps", "AuthorizedApps": "Authorized apps",
"AuthorizeLink": "Authorize link", "AuthorizeLink": "Authorize link",
"AuthenticationMethod": "Authentication method",
"Client": "Client", "Client": "Client",
"Creator": "Creator", "Creator": "Creator",
"ClientHelpButton": "Credentials for using OAth 2.0 as your Authentication type.<br/> <strong>Note</strong>: Any enterprise admin who knows the app's client ID will be able to retrieve information about the app including app name, authentication type, app scopes and redirect URI.", "ClientHelpButton": "Credentials for using OAth 2.0 as your Authentication type.<br/> <strong>Note</strong>: Any enterprise admin who knows the app's client ID will be able to retrieve information about the app including app name, authentication type, app scopes and redirect URI.",
@ -24,7 +27,7 @@
"NewApp": "New application", "NewApp": "New application",
"NoAuthorizedApps": "No authorized apps", "NoAuthorizedApps": "No authorized apps",
"NoOAuthAppHeader": "No OAuth applications", "NoOAuthAppHeader": "No OAuth applications",
"OAuth": "OAuth", "OAuth": "OAuth 2.0",
"OAuthAppDescription": "OAuth applications are used to access the ONLYOFFICE DocSpace API for authorization and further actions such as accessing files, etc.", "OAuthAppDescription": "OAuth applications are used to access the ONLYOFFICE DocSpace API for authorization and further actions such as accessing files, etc.",
"OAuthHeaderBlock": "OAuth urls", "OAuthHeaderBlock": "OAuth urls",
"ProfileDescription": "Here you can check the apps info to which you have granted the auth access, and revoke consent if needed.", "ProfileDescription": "Here you can check the apps info to which you have granted the auth access, and revoke consent if needed.",
@ -33,7 +36,7 @@
"PrivacyPolicyURLHelpButton": "Provide a URL link to your Privacy Policy that must comply with applicable laws and regulations and that make clear how you collect, use, share, retain and otherwise process personal information.", "PrivacyPolicyURLHelpButton": "Provide a URL link to your Privacy Policy that must comply with applicable laws and regulations and that make clear how you collect, use, share, retain and otherwise process personal information.",
"Read": "Read", "Read": "Read",
"RedirectsURLS": "Redirects URLS", "RedirectsURLS": "Redirects URLS",
"RedirectsURLSHelpButton": "Redirect uris help button", "RedirectsURLSHelpButton": "After a user successfully authorizes an application, the authorization server will redirect the user back to the application with sensitive information.",
"RegisterNewApp": "Register a new application", "RegisterNewApp": "Register a new application",
"Reset": "Reset", "Reset": "Reset",
"Revoke": "Revoke", "Revoke": "Revoke",
@ -51,7 +54,7 @@
"SupportAndLegalInfo": "Support & Legal info", "SupportAndLegalInfo": "Support & Legal info",
"TermsOfService": "Terms of Service", "TermsOfService": "Terms of Service",
"TermsOfServiceURL": "Terms of Service URL", "TermsOfServiceURL": "Terms of Service URL",
"TermsOfServiceURLHelpButton": "Terms of service help", "TermsOfServiceURLHelpButton": "Terms and conditions that users must comply with when using this application.",
"WebsiteUrl": "Website URL", "WebsiteUrl": "Website URL",
"Write": "Write" "Write": "Write"
} }

View File

@ -77,6 +77,14 @@ const StyledInputGroup = styled.div`
cursor: pointer; cursor: pointer;
} }
.pkce {
margin-top: 4px;
display: flex;
align-items: center;
gap: 0px;
}
.select { .select {
display: flex; display: flex;
flex-direction: row; flex-direction: row;

View File

@ -1,7 +1,8 @@
import React from "react"; import React from "react";
import { Trans } from "react-i18next";
import ComboBox from "@docspace/components/combobox"; //@ts-ignore
import { AuthenticationMethod } from "@docspace/common/utils/oauth/enums"; import HelpButton from "@docspace/components/help-button";
import { StyledBlock, StyledInputBlock } from "../ClientForm.styled"; import { StyledBlock, StyledInputBlock } from "../ClientForm.styled";
@ -9,6 +10,7 @@ import BlockHeader from "./BlockHeader";
import InputGroup from "./InputGroup"; import InputGroup from "./InputGroup";
import TextAreaGroup from "./TextAreaGroup"; import TextAreaGroup from "./TextAreaGroup";
import SelectGroup from "./SelectGroup"; import SelectGroup from "./SelectGroup";
import Checkbox from "@docspace/components/checkbox"; import Checkbox from "@docspace/components/checkbox";
interface BasicBlockProps { interface BasicBlockProps {
@ -125,6 +127,10 @@ const BasicBlock = ({
} }
}; };
const pkceHelpButtonText = (
<Trans t={t} i18nKey="AllowPKCEHelpButton" ns="OAuth" />
);
return ( return (
<StyledBlock> <StyledBlock>
<BlockHeader header={"Basic info"} /> <BlockHeader header={"Basic info"} />
@ -164,13 +170,25 @@ const BasicBlock = ({
value={descriptionValue} value={descriptionValue}
onChange={onChange} onChange={onChange}
/> />
<Checkbox <InputGroup
label={"Allow pkce"} label={t("AuthenticationMethod")}
isChecked={allowPkce} name={"website_url"}
onChange={() => { placeholder={t("EnterURL")}
changeValue("allow_pkce", !allowPkce); value={websiteUrlValue}
}} error=""
/> onChange={() => {}}
>
<div className={"pkce"}>
<Checkbox
label={t("AllowPKCE")}
isChecked={allowPkce}
onChange={() => {
changeValue("allow_pkce", !allowPkce);
}}
/>
<HelpButton tooltipContent={pkceHelpButtonText} />
</div>
</InputGroup>
</StyledInputBlock> </StyledInputBlock>
</StyledBlock> </StyledBlock>
); );

View File

@ -151,9 +151,9 @@ const ScopesBlock = ({
fontWeight={600} fontWeight={600}
lineHeight={"16px"} lineHeight={"16px"}
> >
{scope.write.name} {scope.write?.name}
</Text>{" "} </Text>{" "}
{t(`Common:${scope.write.tKey}`)} {t(`Common:${scope.write?.tKey}`)}
</Text> </Text>
</StyledScopesName> </StyledScopesName>
<StyledScopesCheckbox> <StyledScopesCheckbox>
@ -171,15 +171,15 @@ const ScopesBlock = ({
/> />
</StyledScopesCheckbox> </StyledScopesCheckbox>
<StyledScopesCheckbox> <StyledScopesCheckbox>
{scope.read?.name && ( {scope.write?.name && (
<Checkbox <Checkbox
isChecked={isReadDisabled} isChecked={isReadDisabled}
isDisabled={isEdit || !scope.read?.name} isDisabled={isEdit || !scope.write?.name}
onChange={() => onChange={() =>
onAddCheckedScope( onAddCheckedScope(
key as ScopeGroup, key as ScopeGroup,
ScopeType.write, ScopeType.write,
scope.write.name scope.write?.name
) )
} }
/> />

View File

@ -56,7 +56,7 @@ const SelectGroup = ({
color={""} color={""}
textAlign={""} textAlign={""}
> >
{label} {label} *
</Text> </Text>
</div> </div>
<div className="select"> <div className="select">

View File

@ -134,8 +134,8 @@ export const filterScopeByGroup = (
filteredScopes[scope.group] = { filteredScopes[scope.group] = {
isChecked, isChecked,
checkedType: isChecked ? scope.type : undefined, checkedType: isChecked ? scope.type : undefined,
read: undefined, read: write,
write, write: undefined,
}; };
return; return;

View File

@ -11,8 +11,8 @@ export interface IFilteredScopes {
[key: string]: { [key: string]: {
isChecked: boolean; isChecked: boolean;
checkedType?: ScopeType; checkedType?: ScopeType;
read?: IScope; read: IScope;
write: IScope; write?: IScope;
}; };
} }