mirror of
https://github.com/overleaf/overleaf.git
synced 2024-10-31 21:21:03 -04:00
3580ec6db3
[SettingsPage] Small Fixes 7 GitOrigin-RevId: 2716fe13af3f5f6b56d6bba47505fad75ba1adbf
75 lines
2.1 KiB
JavaScript
75 lines
2.1 KiB
JavaScript
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 {
|
|
setDefaultMeta as setDefaultLinkingMeta,
|
|
defaultSetupMocks as defaultSetupLinkingMocks,
|
|
} from './helpers/linking'
|
|
import { UserProvider } from '../../js/shared/context/user-context'
|
|
import { ScopeDecorator } from '../decorators/scope'
|
|
|
|
export const Overleaf = args => {
|
|
setDefaultLeaveMeta()
|
|
setDefaultAccountInfoMeta()
|
|
setDefaultPasswordMeta()
|
|
setDefaultEmailsMeta()
|
|
setDefaultLinkingMeta()
|
|
useFetchMock(fetchMock => {
|
|
defaultSetupLeaveMocks(fetchMock)
|
|
defaultSetupAccountInfoMocks(fetchMock)
|
|
defaultSetupPasswordMocks(fetchMock)
|
|
defaultSetupEmailsMocks(fetchMock)
|
|
defaultSetupLinkingMocks(fetchMock)
|
|
})
|
|
|
|
return (
|
|
<UserProvider>
|
|
<SettingsPageRoot {...args} />
|
|
</UserProvider>
|
|
)
|
|
}
|
|
|
|
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>
|
|
)
|
|
}
|
|
|
|
export default {
|
|
title: 'Account Settings / Full Page',
|
|
component: SettingsPageRoot,
|
|
decorators: [ScopeDecorator],
|
|
}
|