mirror of
https://github.com/strapi/strapi.git
synced 2025-12-26 14:44:31 +00:00
Chore: Fix eslint errors
This commit is contained in:
parent
65a8d1965e
commit
e210edbb38
@ -62,7 +62,7 @@ const Register = ({ authType, fieldsToDisable, noSignin, onSubmit, schema }) =>
|
||||
const {
|
||||
data: { data },
|
||||
} = await axios.get(
|
||||
`${strapi.backendURL}/admin/registration-info?registrationToken=${registrationToken}`
|
||||
`${window.strapi.backendURL}/admin/registration-info?registrationToken=${registrationToken}`
|
||||
);
|
||||
|
||||
if (data) {
|
||||
|
||||
@ -87,7 +87,7 @@ const AuthPage = ({ hasAdmin, setHasAdmin }) => {
|
||||
try {
|
||||
await axios({
|
||||
method: 'POST',
|
||||
url: `${strapi.backendURL}${requestURL}`,
|
||||
url: `${window.strapi.backendURL}${requestURL}`,
|
||||
data: body,
|
||||
cancelToken: source.token,
|
||||
});
|
||||
@ -110,7 +110,7 @@ const AuthPage = ({ hasAdmin, setHasAdmin }) => {
|
||||
},
|
||||
} = await axios({
|
||||
method: 'POST',
|
||||
url: `${strapi.backendURL}${requestURL}`,
|
||||
url: `${window.strapi.backendURL}${requestURL}`,
|
||||
data: omit(body, fieldsToOmit),
|
||||
cancelToken: source.token,
|
||||
});
|
||||
@ -158,7 +158,7 @@ const AuthPage = ({ hasAdmin, setHasAdmin }) => {
|
||||
},
|
||||
} = await axios({
|
||||
method: 'POST',
|
||||
url: `${strapi.backendURL}${requestURL}`,
|
||||
url: `${window.strapi.backendURL}${requestURL}`,
|
||||
data: omit(body, fieldsToOmit),
|
||||
cancelToken: source.token,
|
||||
});
|
||||
@ -214,7 +214,7 @@ const AuthPage = ({ hasAdmin, setHasAdmin }) => {
|
||||
},
|
||||
} = await axios({
|
||||
method: 'POST',
|
||||
url: `${strapi.backendURL}${requestURL}`,
|
||||
url: `${window.strapi.backendURL}${requestURL}`,
|
||||
data: { ...body, resetPasswordToken: query.get('code') },
|
||||
cancelToken: source.token,
|
||||
});
|
||||
|
||||
@ -13,7 +13,7 @@ const DividerFull = styled(Divider)`
|
||||
`;
|
||||
|
||||
const Login = (loginProps) => {
|
||||
const ssoEnabled = strapi.features.isEnabled(strapi.features.SSO);
|
||||
const ssoEnabled = window.strapi.features.isEnabled(window.strapi.features.SSO);
|
||||
const { isLoading, data: providers } = useAuthProviders({ ssoEnabled });
|
||||
const { formatMessage } = useIntl();
|
||||
|
||||
|
||||
@ -35,7 +35,7 @@ const SSOProvidersWrapper = styled(Flex)`
|
||||
const SSOProviderButton = ({ provider }) => {
|
||||
return (
|
||||
<Tooltip label={provider.displayName}>
|
||||
<SSOButton href={`${strapi.backendURL}/admin/connect/${provider.uid}`}>
|
||||
<SSOButton href={`${window.strapi.backendURL}/admin/connect/${provider.uid}`}>
|
||||
{provider.icon ? (
|
||||
<img src={provider.icon} aria-hidden alt="" height="32px" />
|
||||
) : (
|
||||
|
||||
@ -17,7 +17,7 @@ const DividerFull = styled(Divider)`
|
||||
`;
|
||||
|
||||
const Providers = () => {
|
||||
const ssoEnabled = strapi.features.isEnabled(strapi.features.SSO);
|
||||
const ssoEnabled = window.strapi.features.isEnabled(window.strapi.features.SSO);
|
||||
|
||||
const { push } = useHistory();
|
||||
const { formatMessage } = useIntl();
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
import baseModel from '../../../../../../../../../admin/src/pages/SettingsPage/pages/Users/ListPage/ModalForm/utils/formDataModel';
|
||||
|
||||
const ssoInputsModel = strapi.features.isEnabled(strapi.features.SSO)
|
||||
const ssoInputsModel = window.strapi.features.isEnabled(window.strapi.features.SSO)
|
||||
? {
|
||||
useSSORegistration: true,
|
||||
}
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
const form = strapi.features.isEnabled(strapi.features.SSO)
|
||||
const form = window.strapi.features.isEnabled(window.strapi.features.SSO)
|
||||
? [
|
||||
[
|
||||
{
|
||||
|
||||
@ -10,7 +10,7 @@ const SERVER_HAS_BEEN_KILLED_MESSAGE = 'server is down';
|
||||
*/
|
||||
export default function serverRestartWatcher(response, didShutDownServer) {
|
||||
return new Promise((resolve) => {
|
||||
fetch(`${strapi.backendURL}/_health`, {
|
||||
fetch(`${window.strapi.backendURL}/_health`, {
|
||||
method: 'HEAD',
|
||||
mode: 'no-cors',
|
||||
headers: {
|
||||
|
||||
@ -1,14 +1,14 @@
|
||||
const openWithNewTab = (path) => {
|
||||
const url = (() => {
|
||||
if (path.startsWith('/')) {
|
||||
return `${strapi.backendURL}${path}`;
|
||||
return `${window.strapi.backendURL}${path}`;
|
||||
}
|
||||
|
||||
if (path.startsWith('http')) {
|
||||
return path;
|
||||
}
|
||||
|
||||
return `${strapi.backendURL}/${path}`;
|
||||
return `${window.strapi.backendURL}/${path}`;
|
||||
})();
|
||||
|
||||
window.open(url, '_blank');
|
||||
|
||||
@ -23,7 +23,9 @@ const Input = ({
|
||||
}) => {
|
||||
const { formatMessage } = useIntl();
|
||||
const inputValue =
|
||||
name === 'noName' ? `${strapi.backendURL}/api/connect/${providerToEditName}/callback` : value;
|
||||
name === 'noName'
|
||||
? `${window.strapi.backendURL}/api/connect/${providerToEditName}/callback`
|
||||
: value;
|
||||
|
||||
const label = formatMessage(
|
||||
{ id: intlLabel.id, defaultMessage: intlLabel.defaultMessage },
|
||||
|
||||
@ -184,7 +184,9 @@ describe('<Input />', () => {
|
||||
it('should set the value correctly when the input\'s name is "noName"', () => {
|
||||
const { getByLabelText } = render(makeApp('noName', 'text', 'test'));
|
||||
|
||||
expect(getByLabelText('noName').value).toBe(`${strapi.backendURL}/api/connect/email/callback`);
|
||||
expect(getByLabelText('noName').value).toBe(
|
||||
`${window.strapi.backendURL}/api/connect/email/callback`
|
||||
);
|
||||
});
|
||||
|
||||
it('should display the toggleCheckbox correctly', () => {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user