-
Notifications
You must be signed in to change notification settings - Fork 5.5k
Google Docs Usability Audit / Improvements #13960
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 4 commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
b634854
versions, descriptions, summaries
michelle0927 6cbe684
update actions
michelle0927 7a320a6
new sources
michelle0927 63ebd5f
pnpm-lock.yaml
michelle0927 6433f0b
update filename
michelle0927 a2708f8
add doc links
michelle0927 0a8c90a
fix
michelle0927 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
30 changes: 0 additions & 30 deletions
30
components/google_docs/actions/create-document-from-text/create-document-from-text.mjs
This file was deleted.
Oops, something went wrong.
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
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
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
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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,83 @@ | ||
| import newFilesInstant from "../../../google_drive/sources/new-files-instant/new-files-instant.mjs"; | ||
| import googleDrive from "../../google_docs.app.mjs"; | ||
| import { MY_DRIVE_VALUE } from "../../../google_drive/common/constants.mjs"; | ||
|
|
||
| export default { | ||
| ...newFilesInstant, | ||
| props: { | ||
| googleDrive, | ||
| db: "$.service.db", | ||
| http: "$.interface.http", | ||
| timer: newFilesInstant.props.timer, | ||
| folders: { | ||
| propDefinition: [ | ||
| googleDrive, | ||
| "folderId", | ||
| ], | ||
| type: "string[]", | ||
| description: "(Optional) The folders you want to watch. Leave blank to watch for any new document.", | ||
| optional: true, | ||
| }, | ||
| }, | ||
| hooks: { | ||
| ...newFilesInstant.hooks, | ||
| async deploy() { | ||
| // Emit sample records on the first run | ||
| const docs = await this.getDocuments(5); | ||
| await this.emitFiles(docs); | ||
| }, | ||
| }, | ||
| methods: { | ||
| ...newFilesInstant.methods, | ||
| getDriveId() { | ||
| return googleDrive.methods.getDriveId(MY_DRIVE_VALUE); | ||
| }, | ||
| shouldProcess(file) { | ||
| return ( | ||
| file.mimeType.includes("document") && | ||
| newFilesInstant.methods.shouldProcess.bind(this)(file) | ||
| ); | ||
| }, | ||
| getDocumentsFromFolderOpts(folderId) { | ||
| const mimeQuery = "mimeType = 'application/vnd.google-apps.document'"; | ||
| let opts = { | ||
| q: `${mimeQuery} and parents in '${folderId}' and trashed = false`, | ||
| }; | ||
| return opts; | ||
| }, | ||
| async getDocumentsFromFiles(files, limit) { | ||
| return files.reduce(async (acc, file) => { | ||
| const docs = await acc; | ||
| const fileInfo = await this.googleDrive.getFile(file.id); | ||
| return docs.length >= limit | ||
| ? docs | ||
| : docs.concat(fileInfo); | ||
| }, []); | ||
| }, | ||
| async getDocuments(limit) { | ||
| const foldersIds = this.folders; | ||
|
|
||
| if (!foldersIds.length) { | ||
| const opts = this.getDocumentsFromFolderOpts("root"); | ||
| const { files } = await this.googleDrive.listFilesInPage(null, opts); | ||
| return this.getDocumentsFromFiles(files, limit); | ||
| } | ||
|
|
||
| return foldersIds.reduce(async (docs, folderId) => { | ||
| const opts = this.getDocumentsFromFolderOpts(folderId); | ||
| const { files } = await this.googleDrive.listFilesInPage(null, opts); | ||
| const nextDocuments = await this.getDocumentsFromFiles(files, limit); | ||
| return (await docs).concat(nextDocuments); | ||
| }, []); | ||
| }, | ||
| async emitFiles(files) { | ||
| for (const file of files) { | ||
| if (!this.shouldProcess(file)) { | ||
| continue; | ||
| } | ||
| const doc = await this.googleDrive.getDocument(file.id); | ||
| this.$emit(doc, this.generateMeta(doc)); | ||
| } | ||
| }, | ||
| }, | ||
| }; |
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.