This repository was archived by the owner on Jul 3, 2026. It is now read-only.
feat: redone Framework integration - #604
Merged
Merged
Conversation
chore: rename more fields
Contributor
Author
|
@federicocalvo @nilpatel42 please let me know if you're interested in alpha testing 😄 (DM @realsafwan). |
|
This should be a real game-changer in terms of encouraging the use of the drive |
…th (D1)
Notable decisions:
- Took ff-file's framework File doctype model throughout (file_name/is_folder/
file_url over Drive File's title/is_group)
- Adopted develop's structured frappe.local.response.errors pattern in
get_entity_with_permissions
- Adopted develop's delayedLoading watcher in DriveToolBar
- Adopted develop's Tooltip wrappers for share_count icons in ListView
- Kept ff-file's reactive storage-bar watch over develop's one-shot fetch
- Dropped DocEditor (deleted in develop) and the editor-style imports in
utils/files.js and utils/download.js
- Took yarn over pnpm and frappe-ui npm 0.1.269 over the github pinned commit
- Switched newExternal Presentation flow to develop's /slides/presentation/new
redirect; drive.api.files.create_presentation is now unreachable
- Restored develop's frappe_doc/markdown branch in getLink (was missing in HEAD)
D1: scripts.clear_deleted_files used today + timedelta(30); flipped to today -
timedelta(30) so the job preserves status=-1 records for 30 days before
hard-delete instead of nuking them on first run.
Resolving conflicts from develop's 33 commits since the last merge (aa48b74). Same overall policy: ff-file owns the framework File doctype model; develop wins on UI cleanups and removed/replaced features. Notable decisions: - Adopted develop's "track visit separately" pattern (6b3a972): dropped mark_as_viewed from get_entity_with_permissions, kept the standalone track_visit endpoint, and File.vue calls it on load. - Did NOT re-add develop's markdown rendering block in permissions.py — ff-file 90f3878 deliberately removed it. - Dropped develop's create_file / create_document_entity (Drive File doctype, unused) and create_presentation (newExternal routes directly to /slides/presentation/new, endpoint unreachable). - Took develop's editor-frontend removal through: dropped printDoc, getPdfFromDoc, globalStyle/lowlight imports. Drive no longer supports downloading docs from the list view — folder downloads skip them silently rather than crash on the removed getPdfFromDoc. - Switched presentation thumbnails to develop's get_presentation_thumbnail. - Took develop's Signup.vue route + Dummy redirect for /w/:entityName (LoginSignup.vue and Document.vue both deleted in develop). Updated ErrorPage redirect and router fallback to external /login via window.location.href. - Renamed Slides → Presentations everywhere (Sidebar label, router name). - Took develop's view-aware getThumbnailUrl (list shows icon, grid shows thumbnail) — GridItem already passes view="grid". - Kept ff-file's reactive storage-bar watch over develop's one-shot fetch. - Kept ff-file's Home/Shared toggle on Personal.vue (intentional UX consolidation); develop's with/by tabs on /shared not applicable here. Follow-ups not addressed: - DriveToolBar Type sort field auto-merged to mime_type (was file_type); verify expected behavior. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
- s3.fetch now serves through get_file_content (enforces Drive perms per request) instead of redirecting to it, and returns a uniform 404 for missing/forbidden so keys can't be enumerated - rename sanitize_url -> storage_key; it always returns a relative key so `Path(base) / key` can't reset to an absolute path - route every S3 Key/CopySource and site_folder join through storage_key, fixing move/move_to_trash passing the stored file_url as the S3 key - normalize both ends of FileManager.move so any caller (rename, restore, desk move) resolves to the real backend key - fix embed path typo entity.file_names -> file_name - replace print() with frappe.log_error and narrow except in get_file - add invariant test for storage_key/get_s3_url round-trip Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
- File.status Int (1/0/-1) -> Select (Active/Trashed/Removed), backed by STATUS_ACTIVE/TRASHED/REMOVED constants; replace all numeric comparisons (incl. the `if doc.status:` truthiness trap in the trash toggle) - rename details_doctype/details_docname -> content_doctype/content_docname (the record holding the file's actual content) in the fixture + all sites - fix integrate_with_framework patch to write the real field names (file_modified, content_doctype/_docname) and the Select status value (D2) - update ff-file-review.md: mark C1, C2, D2, D4, D7 resolved Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
fix: incorrect bulk rename of file_name to title (hail ai)
safwansamsudeen
marked this pull request as ready for review
June 8, 2026 07:27
This was referenced Jun 10, 2026
GursheenK
pushed a commit
to frappe/suite
that referenced
this pull request
Jun 17, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Drive’s entity model moves from a parallel
Drive Filedoctype onto Frappe’s frameworkFile, extended with Drive custom fields and a subclass override. One row type powers the SPA, desk attachments, Writer documents, presentations, and S3/disk storage.Why
Filerows.kindandcontent_doctypereplace overlappingmodifiable/is_attachmentflags.This is a breaking migration. Sites with existing Drive data must run
bench migratebefore using the new frontend.Architecture
flowchart LR subgraph before [Before] DF[Drive File] DD[Drive Document] DF --> DD end subgraph after [After] FF[framework File] WD[Writer Document] PR[Presentation] FF -->|content_doctype| WD FF -->|content_doctype| PR FF -->|content_doctype File| LIB[library File ref] end before -->|integrate_with_framework| afterFramework
Filecustom fieldsteamnull= site / framework file)statusActive/Trashed/Removed(tombstone before hard delete)file_modifiedmodifiedmime_typecontent_doctype/content_docnameFile(attachment ref)Listing
kind(replacesmodifiable/is_attachment)Every Drive listing row carries exactly one
kind:kindnativereadonlyvirtualreadonlysub-cases use existing fields — no extra kind values:!team→ site / framework file → “Open in Desk”content_doctype === "File"→ attachment ref → “Go to original”Frontend uses
isManaged/isReadonly/isVirtualfor gates, andisSiteFile/isAttachmentReffor the two readonly actions (GenericPage,Navbar,InfoPopup).This delineation will be removed in a follow up PR, and all files will be editable through Drive.
drive.overrides.file.FileTeam-scoped files use a
Filesubclass for Drive behavior:after_insert(activity log),after_delete(cascade folders, related rows, backing content doc),on_rollback(upload cleanup)move,rename,share,unshare,permanent_delete,toggle_favouriteis_privateenforced invalidate; desk rename blocked unless via Drive UI (flags.drive_disk_rename)_not_in_disk()(Link, emptyfile_url, or anycontent_doctype)has_permissionon"File"delegates to Drive ACLs; site files fall through to framework permissions.Migration
Patch:
drive.patches.integrate_with_framework(pre_model_sync)tabDrive File(if it still exists)Filerows (same IDs via_name)content_doctype/content_docnamefor Writer docs & presentationsfrappe.flags.mute_drive_activity_logso bulk insert doesn’t spam activity logsAfter migrate, legacy
Drive Filetables can be dropped when the doctype is removed from code.Upgrade path: deploy →
bench migrate→ verify listings → removeDrive Filedoctype in a follow-up.Fresh install: patch no-ops (no legacy table); custom fields sync via fixtures.
Desk integration
drive/public/js/ff_integration.bundle.js,FileUploader.vue)after_upload_file— when “use Drive for files” is on, framework uploads land in the user’s personal Drive home (with safe fallback when no personal team exists)Removed / deprecated doctypes
Drive FileFile(+ override) — doctype folder still present until B1 cleanup landsDrive DocumentWriter Document(Writer app)Drive Comment,Drive Doc Version,Drive Document VersionDrive Disk SettingsDrive Tag/Drive Entity Tag/ tags APIDrive Desktop ClientNotable fixes
storage_key()centralizes key derivation;s3.fetchserves throughget_file_contentwith uniform 404 (no guest enumeration)clear_deleted_filesdate math;statusSelect instead of magic intshas_permissionon"File"; stricter move/unshare checksshare_countpriority collision fixedfile_name);sync_from_diskfile_typefixFile+content_docname, notDrive FileFrontend & toolchain (bundled)
kind-based UI gates (native/readonly/virtual); field-based readonly actions/writer/w/(legacyDocument.vueremoved)Upgrade commands
If migration reports failures, check
integrate_with_frameworkoutput for file names that failed to insert.