Merge pull request #8243 from overleaf/ii-autocomplete-symbol-images

[web] Show symbol images in autocomplete only to premium users

GitOrigin-RevId: 56f4d29ec6368d2904b26f7573aa04ef4535a84b
This commit is contained in:
Miguel Serrano
2022-06-06 16:43:25 +02:00
committed by Copybot
parent baaf4d4240
commit 022a8d4198
3 changed files with 20 additions and 5 deletions
@@ -1,10 +1,11 @@
import { mount } from '@cypress/react'
import sysendTestHelper from '../../helpers/sysend'
import PdfPreviewDetachedRoot from '../../../../frontend/js/features/pdf-preview/components/pdf-preview-detached-root'
import { User } from '../../../../types/user'
describe('<PdfPreviewDetachedRoot/>', function () {
beforeEach(function () {
window.user = { id: 'user1' }
window.user = { id: 'user1' } as User
window.metaAttributesCache = new Map<string, unknown>([
['ol-user', window.user],
+16 -1
View File
@@ -2,7 +2,22 @@ export type User = {
id: string
email: string
allowedFreeTrial?: boolean
features?: Record<string, boolean>
features?: {
collaborators?: number
compileGroup?: 'standard' | 'priority'
compileTimeout?: number
dropbox?: boolean
gitBridge?: boolean
github?: boolean
mendeley?: boolean
references?: boolean
referencesSearch?: boolean
symbolPalette?: boolean
templates?: boolean
trackChanges?: boolean
versioning?: boolean
zotero?: boolean
}
}
export type MongoUser = Pick<User, Exclude<keyof User, 'id'>> & { _id: string }
+2 -3
View File
@@ -1,14 +1,13 @@
import { ExposedSettings } from './exposed-settings'
import { OAuthProviders } from './oauth-providers'
import { User } from './user'
declare global {
// eslint-disable-next-line no-unused-vars
interface Window {
csrfToken: string
sl_debugging: boolean
user: {
id: string
}
user: User
oauthProviders: OAuthProviders
thirdPartyIds: Record<string, string>
metaAttributesCache: Map<string, any>