2022-04-22 09:49:26 -04:00
|
|
|
import useFetchMock from '../hooks/use-fetch-mock'
|
|
|
|
import SettingsPageRoot from '../../js/features/settings/components/root'
|
|
|
|
import {
|
|
|
|
setDefaultMeta as setDefaultLeaveMeta,
|
|
|
|
defaultSetupMocks as defaultSetupLeaveMocks,
|
|
|
|
} from './helpers/leave'
|
|
|
|
import {
|
|
|
|
setDefaultMeta as setDefaultAccountInfoMeta,
|
|
|
|
defaultSetupMocks as defaultSetupAccountInfoMocks,
|
|
|
|
} from './helpers/account-info'
|
|
|
|
import {
|
|
|
|
setDefaultMeta as setDefaultPasswordMeta,
|
|
|
|
defaultSetupMocks as defaultSetupPasswordMocks,
|
|
|
|
} from './helpers/password'
|
|
|
|
import {
|
|
|
|
setDefaultMeta as setDefaultEmailsMeta,
|
|
|
|
defaultSetupMocks as defaultSetupEmailsMocks,
|
|
|
|
} from './helpers/emails'
|
|
|
|
import {
|
2022-04-25 07:04:44 -04:00
|
|
|
setDefaultMeta as setDefaultLinkingMeta,
|
|
|
|
defaultSetupMocks as defaultSetupLinkingMocks,
|
|
|
|
} from './helpers/linking'
|
2022-04-22 09:49:26 -04:00
|
|
|
import { UserProvider } from '../../js/shared/context/user-context'
|
|
|
|
|
2022-04-27 12:13:42 -04:00
|
|
|
export const Overleaf = args => {
|
2022-04-22 09:49:26 -04:00
|
|
|
setDefaultLeaveMeta()
|
|
|
|
setDefaultAccountInfoMeta()
|
|
|
|
setDefaultPasswordMeta()
|
|
|
|
setDefaultEmailsMeta()
|
2022-04-25 07:04:44 -04:00
|
|
|
setDefaultLinkingMeta()
|
2022-04-25 07:05:15 -04:00
|
|
|
useFetchMock(fetchMock => {
|
|
|
|
defaultSetupLeaveMocks(fetchMock)
|
|
|
|
defaultSetupAccountInfoMocks(fetchMock)
|
|
|
|
defaultSetupPasswordMocks(fetchMock)
|
|
|
|
defaultSetupEmailsMocks(fetchMock)
|
|
|
|
defaultSetupLinkingMocks(fetchMock)
|
|
|
|
})
|
2022-04-22 09:49:26 -04:00
|
|
|
|
|
|
|
return (
|
|
|
|
<UserProvider>
|
|
|
|
<SettingsPageRoot {...args} />
|
|
|
|
</UserProvider>
|
|
|
|
)
|
|
|
|
}
|
|
|
|
|
2022-04-27 12:13:42 -04:00
|
|
|
export const ServerPro = args => {
|
|
|
|
setDefaultAccountInfoMeta()
|
|
|
|
setDefaultPasswordMeta()
|
|
|
|
useFetchMock(fetchMock => {
|
|
|
|
defaultSetupAccountInfoMocks(fetchMock)
|
|
|
|
defaultSetupPasswordMocks(fetchMock)
|
|
|
|
})
|
|
|
|
|
|
|
|
window.metaAttributesCache.set('ol-ExposedSettings', {
|
|
|
|
...window.metaAttributesCache.get('ol-ExposedSettings'),
|
|
|
|
hasAffiliationsFeature: false,
|
|
|
|
isOverleaf: false,
|
|
|
|
})
|
|
|
|
window.metaAttributesCache.set('integrationLinkingWidgets', [])
|
|
|
|
window.metaAttributesCache.set('referenceLinkingWidgets', [])
|
|
|
|
window.metaAttributesCache.delete('ol-oauthProviders')
|
|
|
|
|
|
|
|
return (
|
|
|
|
<UserProvider>
|
|
|
|
<SettingsPageRoot {...args} />
|
|
|
|
</UserProvider>
|
|
|
|
)
|
|
|
|
}
|
|
|
|
|
2022-04-22 09:49:26 -04:00
|
|
|
export default {
|
|
|
|
title: 'Account Settings / Full Page',
|
|
|
|
component: SettingsPageRoot,
|
|
|
|
}
|