Prettier: switch to trailing coma: none

This commit is contained in:
garronej
2022-08-20 11:44:48 +07:00
parent 832434095e
commit a1a65c5529
260 changed files with 574 additions and 574 deletions

View File

@ -26,7 +26,7 @@ const KcApp = memo(({ kcContext, i18n: userProvidedI18n, ...props }: { kcContext
const i18n = useI18n({
kcContext,
"extraMessages": {},
"doSkip": userProvidedI18n !== undefined,
"doSkip": userProvidedI18n !== undefined
});
return userProvidedI18n ?? i18n;

View File

@ -37,7 +37,7 @@ export const defaultKcTemplateProps = {
"stylesCommon": [
"node_modules/patternfly/dist/css/patternfly.min.css",
"node_modules/patternfly/dist/css/patternfly-additions.min.css",
"lib/zocial/zocial.css",
"lib/zocial/zocial.css"
],
"styles": ["css/login.css"],
"scripts": [],
@ -60,7 +60,7 @@ export const defaultKcTemplateProps = {
"kcFormGroupClass": ["form-group"],
"kcLabelWrapperClass": ["col-xs-12", "col-sm-12", "col-md-12", "col-lg-12"],
"kcSignUpClass": ["login-pf-signup"],
"kcInfoAreaWrapperClass": [],
"kcInfoAreaWrapperClass": []
} as const;
assert<typeof defaultKcTemplateProps extends KcTemplateProps ? true : false>();
@ -192,7 +192,7 @@ export const defaultKcProps = {
"kcSelectOTPListItemClass": ["card-pf-body", "card-pf-top-element"],
"kcAuthenticatorOtpCircleClass": ["fa", "fa-mobile", "card-pf-icon-circle"],
"kcSelectOTPItemHeadingClass": ["card-pf-title", "text-center"],
"kcFormOptionsWrapperClass": [],
"kcFormOptionsWrapperClass": []
} as const;
assert<typeof defaultKcProps extends KcProps ? true : false>();

View File

@ -74,7 +74,7 @@ const Login = memo(({ kcContext, i18n, ...props }: { kcContext: KcContextBase.Lo
? { "disabled": true }
: {
"autoFocus": true,
"autoComplete": "off",
"autoComplete": "off"
})}
/>
</>
@ -106,7 +106,7 @@ const Login = memo(({ kcContext, i18n, ...props }: { kcContext: KcContextBase.Lo
type="checkbox"
{...(login.rememberMe
? {
"checked": true,
"checked": true
}
: {})}
/>
@ -132,7 +132,7 @@ const Login = memo(({ kcContext, i18n, ...props }: { kcContext: KcContextBase.Lo
name="credentialId"
{...(auth?.selectedCredential !== undefined
? {
"value": auth.selectedCredential,
"value": auth.selectedCredential
}
: {})}
/>
@ -142,7 +142,7 @@ const Login = memo(({ kcContext, i18n, ...props }: { kcContext: KcContextBase.Lo
props.kcButtonClass,
props.kcButtonPrimaryClass,
props.kcButtonBlockClass,
props.kcButtonLargeClass,
props.kcButtonLargeClass
)}
name="login"
id="kc-login"
@ -159,7 +159,7 @@ const Login = memo(({ kcContext, i18n, ...props }: { kcContext: KcContextBase.Lo
<ul
className={cx(
props.kcFormSocialAccountListClass,
social.providers.length > 4 && props.kcFormSocialAccountDoubleListClass,
social.providers.length > 4 && props.kcFormSocialAccountDoubleListClass
)}
>
{social.providers.map(p => (

View File

@ -15,7 +15,7 @@ const LoginConfigTotp = memo(({ kcContext, i18n, ...props }: { kcContext: KcCont
const algToKeyUriAlg: Record<KcContextBase.LoginConfigTotp["totp"]["policy"]["algorithm"], string> = {
HmacSHA1: "SHA1",
HmacSHA256: "SHA256",
HmacSHA512: "SHA512",
HmacSHA512: "SHA512"
};
return (
@ -159,7 +159,7 @@ const LoginConfigTotp = memo(({ kcContext, i18n, ...props }: { kcContext: KcCont
props.kcButtonClass,
props.kcButtonDefaultClass,
props.kcButtonLargeClass,
props.kcButtonLargeClass,
props.kcButtonLargeClass
)}
id="cancelTOTPBtn"
name="cancel-aia"

View File

@ -19,7 +19,7 @@ const LoginOtp = memo(({ kcContext, i18n, ...props }: { kcContext: KcContextBase
headInsert({
"type": "javascript",
"src": pathJoin(kcContext.url.resourcesCommonPath, "node_modules/jquery/dist/jquery.min.js"),
"src": pathJoin(kcContext.url.resourcesCommonPath, "node_modules/jquery/dist/jquery.min.js")
}).then(() => {
if (isCleanedUp) return;

View File

@ -102,7 +102,7 @@ const LoginUpdatePassword = memo(({ kcContext, i18n, ...props }: { kcContext: Kc
props.kcButtonClass,
props.kcButtonPrimaryClass,
props.kcButtonBlockClass,
props.kcButtonLargeClass,
props.kcButtonLargeClass
)}
type="submit"
defaultValue={msgStr("doSubmit")}

View File

@ -105,7 +105,7 @@ const LoginUpdateProfile = memo(({ kcContext, i18n, ...props }: { kcContext: KcC
props.kcButtonClass,
props.kcButtonPrimaryClass,
props.kcButtonBlockClass,
props.kcButtonLargeClass,
props.kcButtonLargeClass
)}
type="submit"
defaultValue={msgStr("doSubmit")}

View File

@ -35,7 +35,7 @@ const LogoutConfirm = memo(({ kcContext, i18n, ...props }: { kcContext: KcContex
props.kcButtonClass,
props.kcButtonPrimaryClass,
props.kcButtonBlockClass,
props.kcButtonLargeClass,
props.kcButtonLargeClass
)}
name="confirmLogout"
id="kc-logout"

View File

@ -111,7 +111,7 @@ const Register = memo(({ kcContext, i18n, ...props }: { kcContext: KcContextBase
<div
className={cx(
props.kcFormGroupClass,
messagesPerField.printIfExists("password-confirm", props.kcFormGroupErrorClass),
messagesPerField.printIfExists("password-confirm", props.kcFormGroupErrorClass)
)}
>
<div className={cx(props.kcLabelWrapperClass)}>

View File

@ -18,9 +18,9 @@ const RegisterUserProfile = memo(({ kcContext, i18n, ...props_ }: { kcContext: K
const props = useMemo(
() => ({
...props_,
"kcFormGroupClass": cx(props_.kcFormGroupClass, css({ "marginBottom": 20 })),
"kcFormGroupClass": cx(props_.kcFormGroupClass, css({ "marginBottom": 20 }))
}),
[cx, css],
[cx, css]
);
const [isFomSubmittable, setIsFomSubmittable] = useState(false);
@ -79,10 +79,10 @@ const UserProfileFormFields = memo(({ kcContext, onIsFormSubmittableValueChange,
const {
formValidationState: { fieldStateByAttributeName, isFormSubmittable },
formValidationReducer,
attributesWithPassword,
attributesWithPassword
} = useFormValidationSlice({
kcContext,
i18n,
i18n
});
useEffect(() => {
@ -94,22 +94,22 @@ const UserProfileFormFields = memo(({ kcContext, onIsFormSubmittableValueChange,
[name]: [string],
[
{
target: { value },
},
]: [React.ChangeEvent<HTMLInputElement | HTMLSelectElement>],
target: { value }
}
]: [React.ChangeEvent<HTMLInputElement | HTMLSelectElement>]
) =>
formValidationReducer({
"action": "update value",
name,
"newValue": value,
}),
"newValue": value
})
);
const onBlurFactory = useCallbackFactory(([name]: [string]) =>
formValidationReducer({
"action": "focus lost",
name,
}),
name
})
);
let currentGroup = "";
@ -200,8 +200,8 @@ const UserProfileFormFields = memo(({ kcContext, onIsFormSubmittableValueChange,
props.kcInputErrorMessageClass,
css({
"position": displayableErrors.length === 1 ? "absolute" : undefined,
"& > span": { "display": "block" },
}),
"& > span": { "display": "block" }
})
)}
aria-live="polite"
>

View File

@ -39,7 +39,7 @@ const Template = memo((props: TemplateProps) => {
infoNode = null,
kcContext,
i18n,
doFetchDefaultThemeResources,
doFetchDefaultThemeResources
} = props;
const { cx } = useCssAndCx();
@ -68,16 +68,16 @@ const Template = memo((props: TemplateProps) => {
Promise.all(
[
...toArr(props.stylesCommon).map(relativePath => pathJoin(url.resourcesCommonPath, relativePath)),
...toArr(props.styles).map(relativePath => pathJoin(url.resourcesPath, relativePath)),
...toArr(props.styles).map(relativePath => pathJoin(url.resourcesPath, relativePath))
]
.reverse()
.map(href =>
headInsert({
"type": "css",
href,
"position": "prepend",
}),
),
"position": "prepend"
})
)
).then(() => {
if (isUnmounted) {
return;
@ -89,8 +89,8 @@ const Template = memo((props: TemplateProps) => {
toArr(props.scripts).forEach(relativePath =>
headInsert({
"type": "javascript",
"src": pathJoin(url.resourcesPath, relativePath),
}),
"src": pathJoin(url.resourcesPath, relativePath)
})
);
if (props.kcHtmlClass !== undefined) {
@ -211,7 +211,7 @@ const Template = memo((props: TemplateProps) => {
<span
className="kc-feedback-text"
dangerouslySetInnerHTML={{
"__html": message.summary,
"__html": message.summary
}}
/>
</div>

View File

@ -36,7 +36,7 @@ export function useDownloadTerms(params: {
const downloadTermMarkdownConst = useConstCallback(downloadTermMarkdown);
const downloadTermMarkdownMemoized = useConst(() =>
memoize((currentLanguageTag: string) => downloadTermMarkdownConst({ currentLanguageTag }), { "promise": true }),
memoize((currentLanguageTag: string) => downloadTermMarkdownConst({ currentLanguageTag }), { "promise": true })
);
return { downloadTermMarkdownMemoized };
@ -48,7 +48,7 @@ export function useDownloadTerms(params: {
}
downloadTermMarkdownMemoized(kcContext.locale?.currentLanguageTag ?? fallbackLanguageTag).then(
thermMarkdown => (evtTermMarkdown.state = thermMarkdown),
thermMarkdown => (evtTermMarkdown.state = thermMarkdown)
);
}, []);
}
@ -82,7 +82,7 @@ const Terms = memo(({ kcContext, i18n, ...props }: { kcContext: KcContextBase.Te
props.kcButtonClass,
props.kcButtonClass,
props.kcButtonPrimaryClass,
props.kcButtonLargeClass,
props.kcButtonLargeClass
)}
name="accept"
id="kc-accept"