Some checks failed
Build & Deploy / 🔍 Prepare (push) Successful in 20s
Build & Deploy / 🧪 QA (push) Failing after 34s
Build & Deploy / 🏗️ Build (push) Has started running
Build & Deploy / 🚀 Deploy (push) Has been cancelled
Build & Deploy / 🧪 Smoke Test (push) Has been cancelled
Build & Deploy / ⚡ Lighthouse (push) Has been cancelled
Build & Deploy / 🔔 Notify (push) Has been cancelled
1 line
23 KiB
Plaintext
1 line
23 KiB
Plaintext
{"version":3,"file":"index.js","names":["formatAdminURL","qs","React","createContext","use","useCallback","useEffect","useMemo","useRef","useState","useControllableState","useAuth","requests","formatDocTitle","useConfig","DocumentTitleProvider","useLocale","useLocaleLoading","usePreferences","useTranslation","UploadEditsProvider","useUploadEdits","useGetDocPermissions","Context","useDocumentInfo","DocumentInfo","children","props","id","collectionSlug","currentEditor","currentEditorFromProps","docPermissions","docPermissionsFromProps","globalSlug","hasPublishedDoc","hasPublishedDocFromProps","hasPublishPermission","hasPublishPermissionFromProps","hasSavePermission","hasSavePermissionFromProps","initialData","initialState","isLocked","isLockedFromProps","lastUpdateTime","lastUpdateTimeFromProps","mostRecentVersionIsAutosaved","mostRecentVersionIsAutosavedFromProps","unpublishedVersionCount","unpublishedVersionCountFromProps","versionCount","versionCountFromProps","setDocPermissions","setHasSavePermission","setHasPublishPermission","permissions","config","admin","dateFormat","collections","routes","api","getEntityConfig","collectionConfig","globalConfig","hasLockedDocumentsCollection","some","collection","slug","abortControllerRef","AbortController","docConfig","i18n","uploadEdits","title","setDocumentTitle","data","fallback","toString","setMostRecentVersionIsAutosaved","setVersionCount","setHasPublishedDoc","setUnpublishedVersionCount","documentIsLocked","setDocumentIsLocked","setCurrentEditor","setLastUpdateTime","setData","uploadStatus","setUploadStatus","documentLockState","hasShownLockedModal","user","updateUploadStatus","status","getPreference","setPreference","code","locale","localeIsLoading","isInitializing","undefined","baseAPIPath","apiRoute","path","pluralType","preferencesKey","unlockDocument","docID","isGlobal","request","get","credentials","params","docs","json","length","lockID","delete","headers","error","console","updateDocumentEditor","userData","relationTo","value","patch","body","JSON","stringify","getDocPermissions","getDocPreferences","setDocFieldPreferences","fieldPreferences","allPreferences","fields","e","incrementVersionCount","newCount","versions","maxPerDoc","Math","min","max","re1","current","abort","_err","action","docPath","depth","addQueryPrefix","savedDocumentData","updateSavedDocumentData","_jsx","DocumentInfoProvider"],"sources":["../../../src/providers/DocumentInfo/index.tsx"],"sourcesContent":["'use client'\nimport type { ClientUser, DocumentPreferences } from 'payload'\n\nimport { formatAdminURL } from 'payload/shared'\nimport * as qs from 'qs-esm'\nimport React, { createContext, use, useCallback, useEffect, useMemo, useRef, useState } from 'react'\n\nimport type { DocumentInfoContext, DocumentInfoProps } from './types.js'\n\nimport { useControllableState } from '../../hooks/useControllableState.js'\nimport { useAuth } from '../../providers/Auth/index.js'\nimport { requests } from '../../utilities/api.js'\nimport { formatDocTitle } from '../../utilities/formatDocTitle/index.js'\nimport { useConfig } from '../Config/index.js'\nimport { DocumentTitleProvider } from '../DocumentTitle/index.js'\nimport { useLocale, useLocaleLoading } from '../Locale/index.js'\nimport { usePreferences } from '../Preferences/index.js'\nimport { useTranslation } from '../Translation/index.js'\nimport { UploadEditsProvider, useUploadEdits } from '../UploadEdits/index.js'\nimport { useGetDocPermissions } from './useGetDocPermissions.js'\n\nconst Context = createContext({} as DocumentInfoContext)\n\nexport type * from './types.js'\n\nexport const useDocumentInfo = (): DocumentInfoContext => use(Context)\n\nconst DocumentInfo: React.FC<\n {\n readonly children: React.ReactNode\n } & DocumentInfoProps\n> = ({ children, ...props }) => {\n const {\n id,\n collectionSlug,\n currentEditor: currentEditorFromProps,\n docPermissions: docPermissionsFromProps,\n globalSlug,\n hasPublishedDoc: hasPublishedDocFromProps,\n hasPublishPermission: hasPublishPermissionFromProps,\n hasSavePermission: hasSavePermissionFromProps,\n initialData,\n initialState,\n isLocked: isLockedFromProps,\n lastUpdateTime: lastUpdateTimeFromProps,\n mostRecentVersionIsAutosaved: mostRecentVersionIsAutosavedFromProps,\n unpublishedVersionCount: unpublishedVersionCountFromProps,\n versionCount: versionCountFromProps,\n } = props\n\n const [docPermissions, setDocPermissions] = useControllableState(docPermissionsFromProps)\n\n const [hasSavePermission, setHasSavePermission] = useControllableState(hasSavePermissionFromProps)\n\n const [hasPublishPermission, setHasPublishPermission] = useControllableState(\n hasPublishPermissionFromProps,\n )\n\n const { permissions } = useAuth()\n\n const {\n config: {\n admin: { dateFormat },\n collections,\n routes: { api },\n },\n getEntityConfig,\n } = useConfig()\n\n const collectionConfig = getEntityConfig({ collectionSlug })\n const globalConfig = getEntityConfig({ globalSlug })\n\n // Check if the locked-documents collection exists in the config\n const hasLockedDocumentsCollection = collections.some(\n (collection) => collection.slug === 'payload-locked-documents',\n )\n\n const abortControllerRef = useRef(new AbortController())\n const docConfig = collectionConfig || globalConfig\n\n const { i18n } = useTranslation()\n\n const { uploadEdits } = useUploadEdits()\n\n /**\n * @deprecated This state will be removed in v4.\n * This is for performance reasons. Use the `DocumentTitleContext` instead.\n */\n const [title, setDocumentTitle] = useState(() =>\n formatDocTitle({\n collectionConfig,\n data: { ...(initialData || {}), id },\n dateFormat,\n fallback: id?.toString(),\n globalConfig,\n i18n,\n }),\n )\n\n const [mostRecentVersionIsAutosaved, setMostRecentVersionIsAutosaved] = useState(\n mostRecentVersionIsAutosavedFromProps,\n )\n\n const [versionCount, setVersionCount] = useState(versionCountFromProps)\n\n const [hasPublishedDoc, setHasPublishedDoc] = useState(hasPublishedDocFromProps)\n\n const [unpublishedVersionCount, setUnpublishedVersionCount] = useState(\n unpublishedVersionCountFromProps,\n )\n\n const [documentIsLocked, setDocumentIsLocked] = useControllableState<boolean | undefined>(\n isLockedFromProps,\n )\n\n const [currentEditor, setCurrentEditor] = useControllableState<ClientUser | null>(\n currentEditorFromProps,\n )\n const [lastUpdateTime, setLastUpdateTime] = useControllableState<number>(lastUpdateTimeFromProps)\n\n const [data, setData] = useControllableState(initialData)\n\n const [uploadStatus, setUploadStatus] = useControllableState<'failed' | 'idle' | 'uploading'>(\n 'idle',\n )\n\n const documentLockState = useRef<{\n hasShownLockedModal: boolean\n isLocked: boolean\n user: ClientUser | number | string\n } | null>({\n hasShownLockedModal: false,\n isLocked: false,\n user: null,\n })\n\n const updateUploadStatus = useCallback(\n (status: 'failed' | 'idle' | 'uploading') => {\n setUploadStatus(status)\n },\n [setUploadStatus],\n )\n\n const { getPreference, setPreference } = usePreferences()\n const { code: locale } = useLocale()\n const { localeIsLoading } = useLocaleLoading()\n\n const isInitializing = useMemo(\n () => initialState === undefined || initialData === undefined || localeIsLoading,\n [initialData, initialState, localeIsLoading],\n )\n\n const baseAPIPath = formatAdminURL({\n apiRoute: api,\n path: '',\n })\n\n let slug: string\n let pluralType: 'collections' | 'globals'\n let preferencesKey: string\n\n if (globalSlug) {\n slug = globalSlug\n pluralType = 'globals'\n preferencesKey = `global-${slug}`\n }\n\n if (collectionSlug) {\n slug = collectionSlug\n pluralType = 'collections'\n\n if (id) {\n preferencesKey = `collection-${slug}-${id}`\n }\n }\n\n const unlockDocument = useCallback(\n async (docID: number | string, slug: string) => {\n // Check if the locked-documents collection exists before making API calls\n if (!hasLockedDocumentsCollection) {\n return\n }\n\n try {\n const isGlobal = slug === globalSlug\n\n const request = await requests.get(`${baseAPIPath}/payload-locked-documents`, {\n credentials: 'include',\n params: isGlobal\n ? {\n 'where[globalSlug][equals]': slug,\n }\n : {\n 'where[document.relationTo][equals]': slug,\n 'where[document.value][equals]': docID,\n },\n })\n\n const { docs } = await request.json()\n\n if (docs?.length > 0) {\n const lockID = docs[0].id\n await requests.delete(`${baseAPIPath}/payload-locked-documents/${lockID}`, {\n credentials: 'include',\n headers: {\n 'Content-Type': 'application/json',\n },\n })\n setDocumentIsLocked(false)\n }\n } catch (error) {\n // eslint-disable-next-line no-console\n console.error('Failed to unlock the document', error)\n }\n },\n [baseAPIPath, globalSlug, setDocumentIsLocked, hasLockedDocumentsCollection],\n )\n\n const updateDocumentEditor = useCallback(\n async (docID: number | string, slug: string, user: ClientUser | number | string) => {\n // Check if the locked-documents collection exists before making API calls\n if (!hasLockedDocumentsCollection) {\n return\n }\n\n try {\n const isGlobal = slug === globalSlug\n\n // Check if the document is already locked\n const request = await requests.get(`${baseAPIPath}/payload-locked-documents`, {\n credentials: 'include',\n params: isGlobal\n ? {\n 'where[globalSlug][equals]': slug,\n }\n : {\n 'where[document.relationTo][equals]': slug,\n 'where[document.value][equals]': docID,\n },\n })\n\n const { docs } = await request.json()\n\n if (docs?.length > 0) {\n const lockID = docs[0].id\n\n const userData =\n typeof user === 'object'\n ? { relationTo: user.collection, value: user.id }\n : { relationTo: 'users', value: user }\n\n // Send a patch request to update the _lastEdited info\n await requests.patch(`${baseAPIPath}/payload-locked-documents/${lockID}`, {\n body: JSON.stringify({\n user: userData,\n }),\n credentials: 'include',\n headers: {\n 'Content-Type': 'application/json',\n },\n })\n }\n } catch (error) {\n // eslint-disable-next-line no-console\n console.error('Failed to update the document editor', error)\n }\n },\n [baseAPIPath, globalSlug, hasLockedDocumentsCollection],\n )\n\n const getDocPermissions = useGetDocPermissions({\n id: id as string,\n api,\n collectionSlug,\n globalSlug,\n i18n,\n locale,\n permissions,\n setDocPermissions,\n setHasPublishPermission,\n setHasSavePermission,\n })\n\n const getDocPreferences = useCallback(() => {\n return getPreference<DocumentPreferences>(preferencesKey)\n }, [getPreference, preferencesKey])\n\n const setDocFieldPreferences = useCallback<DocumentInfoContext['setDocFieldPreferences']>(\n async (path, fieldPreferences) => {\n const allPreferences = await getDocPreferences()\n\n if (preferencesKey) {\n try {\n await setPreference(preferencesKey, {\n ...allPreferences,\n fields: {\n ...(allPreferences?.fields || {}),\n [path]: {\n ...allPreferences?.fields?.[path],\n ...fieldPreferences,\n },\n },\n })\n } catch (e) {\n console.error(e) // eslint-disable-line no-console\n }\n }\n },\n [setPreference, preferencesKey, getDocPreferences],\n )\n\n const incrementVersionCount = useCallback(() => {\n const newCount = versionCount + 1\n if (collectionConfig && collectionConfig.versions) {\n if (collectionConfig.versions.maxPerDoc > 0) {\n setVersionCount(Math.min(newCount, collectionConfig.versions.maxPerDoc))\n } else {\n setVersionCount(newCount)\n }\n } else if (globalConfig && globalConfig.versions) {\n if (globalConfig.versions.max > 0) {\n setVersionCount(Math.min(newCount, globalConfig.versions.max))\n } else {\n setVersionCount(newCount)\n }\n }\n }, [collectionConfig, globalConfig, versionCount])\n\n /**\n * @todo: Remove this in v4\n * Users should use the `DocumentTitleContext` instead.\n */\n useEffect(() => {\n setDocumentTitle(\n formatDocTitle({\n collectionConfig,\n data: { ...data, id },\n dateFormat,\n fallback: id?.toString(),\n globalConfig,\n i18n,\n }),\n )\n }, [collectionConfig, globalConfig, data, dateFormat, i18n, id])\n\n // clean on unmount\n useEffect(() => {\n const re1 = abortControllerRef.current\n\n return () => {\n if (re1) {\n try {\n re1.abort()\n } catch (_err) {\n // swallow error\n }\n }\n }\n }, [])\n\n const action: string = React.useMemo(() => {\n const docPath = `${pluralType === 'globals' ? `/globals` : ''}/${slug}${id ? `/${id}` : ''}`\n\n return `${baseAPIPath}${docPath}${qs.stringify(\n {\n depth: 0,\n 'fallback-locale': 'null',\n locale,\n uploadEdits: uploadEdits || undefined,\n },\n {\n addQueryPrefix: true,\n },\n )}`\n }, [baseAPIPath, locale, pluralType, id, slug, uploadEdits])\n\n const value: DocumentInfoContext = {\n ...props,\n action,\n currentEditor,\n data,\n docConfig,\n docPermissions,\n documentIsLocked,\n documentLockState,\n getDocPermissions,\n getDocPreferences,\n hasPublishedDoc,\n hasPublishPermission,\n hasSavePermission,\n incrementVersionCount,\n initialData,\n initialState,\n isInitializing,\n lastUpdateTime,\n mostRecentVersionIsAutosaved,\n preferencesKey,\n savedDocumentData: data,\n setCurrentEditor,\n setData,\n setDocFieldPreferences,\n setDocumentIsLocked,\n setDocumentTitle,\n setHasPublishedDoc,\n setLastUpdateTime,\n setMostRecentVersionIsAutosaved,\n setUnpublishedVersionCount,\n setUploadStatus: updateUploadStatus,\n title,\n unlockDocument,\n unpublishedVersionCount,\n updateDocumentEditor,\n updateSavedDocumentData: setData,\n uploadStatus,\n versionCount,\n }\n\n return (\n <Context value={value}>\n <DocumentTitleProvider>{children}</DocumentTitleProvider>\n </Context>\n )\n}\n\nexport const DocumentInfoProvider: React.FC<\n {\n readonly children: React.ReactNode\n } & DocumentInfoProps\n> = (props) => {\n return (\n <UploadEditsProvider>\n <DocumentInfo {...props} />\n </UploadEditsProvider>\n )\n}\n"],"mappings":"AAAA;;;AAGA,SAASA,cAAc,QAAQ;AAC/B,YAAYC,EAAA,MAAQ;AACpB,OAAOC,KAAA,IAASC,aAAa,EAAEC,GAAG,EAAEC,WAAW,EAAEC,SAAS,EAAEC,OAAO,EAAEC,MAAM,EAAEC,QAAQ,QAAQ;AAI7F,SAASC,oBAAoB,QAAQ;AACrC,SAASC,OAAO,QAAQ;AACxB,SAASC,QAAQ,QAAQ;AACzB,SAASC,cAAc,QAAQ;AAC/B,SAASC,SAAS,QAAQ;AAC1B,SAASC,qBAAqB,QAAQ;AACtC,SAASC,SAAS,EAAEC,gBAAgB,QAAQ;AAC5C,SAASC,cAAc,QAAQ;AAC/B,SAASC,cAAc,QAAQ;AAC/B,SAASC,mBAAmB,EAAEC,cAAc,QAAQ;AACpD,SAASC,oBAAoB,QAAQ;AAErC,MAAMC,OAAA,gBAAUpB,aAAA,CAAc,CAAC;AAI/B,OAAO,MAAMqB,eAAA,GAAkBA,CAAA,KAA2BpB,GAAA,CAAImB,OAAA;AAE9D,MAAME,YAAA,GAIFA,CAAC;EAAEC,QAAQ;EAAE,GAAGC;AAAA,CAAO;EACzB,MAAM;IACJC,EAAE;IACFC,cAAc;IACdC,aAAA,EAAeC,sBAAsB;IACrCC,cAAA,EAAgBC,uBAAuB;IACvCC,UAAU;IACVC,eAAA,EAAiBC,wBAAwB;IACzCC,oBAAA,EAAsBC,6BAA6B;IACnDC,iBAAA,EAAmBC,0BAA0B;IAC7CC,WAAW;IACXC,YAAY;IACZC,QAAA,EAAUC,iBAAiB;IAC3BC,cAAA,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