Git Product home page Git Product logo

google-docs-add-on's Introduction

Getting started

The add-on lives in Google's Script Editor but, in keeping with best practices, this repo is the source of truth, and the script editor will be overwritten with local changes.

Configuring

This process needs to be performed once:

  1. npm install to install all dependencies
  2. Create a new apps script here: https://script.google.com
  3. Get the script ID from the URL (everything between the /d/ and /edit - script.google.com/a/google.com/d/SCRIPT_ID_HERE/edit)
  4. Install clasp
  5. ``
  6. Create a new WordPress.com App:
    1. Set the redirect URL to be https://script.google.com/macros/d/SCRIPT_ID/usercallback
    2. Make a note of the app client ID and client secret
  7. In the app script, go to File and Project Properties
    1. Select the Script properties tab
    2. Add OauthClientId and set the value to your app
    3. Add OauthClientSecret and set the value to your app

Everything is now setup.

Deploying

npm run deploy

This will use node-google-apps-script to upload the src directory to the add-on's script editor.

Testing

In the script editor choose "Publish" → "Test as add-on…" and then select a document to test with.

That will open a new window with your document. You will then see your project in the Add-ons menu.

google-docs-add-on's People

Contributors

georgeh avatar jasmussen avatar johngodley avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

google-docs-add-on's Issues

"Report an issue"

When opening Add-ons > WordPress.com for Google Docs > Help > Report an issue in the pop-up there, it links to support.wordpress.com.

http://cld.wthms.co/7fjb/2pPALMUV

They can't find the docs for the addon there as that is on https://apps.wordpress.com/google-docs/, but if the link is to report an issue, I'd suggest that they either get pointed to:

There are two other places that they end up on wordpress.com/help where I couldn't find a single doc about this:

  • The bottom right question mark in the docs window: http://cld.wthms.co/nXDS/496eY1D1
  • The add-ons page on the webstore: http://cld.wthms.co/8UaO/7r60F0KQ

Extended attributes

I'd like to add an accordion or drawer under each site with extra fields e.g. categories, tags, custom post type, post status, and the delete site button.

This would address the a11y issue with delete site in #31 and offer a UI for the custom post types in #27

@jasmussen can you take a stab at this based on the add/react branch?

400 error

I tried to add a draft and got the following error:

{"message":"Request failed for https://public-api.wordpress.com/rest/v1.1/sites/38783427/media/new returned code 400. Truncated server response: {"error":"unsupported_mime_type","message":"File type unknown"} (use muteHttpExceptions option to examine full response).","name":"Exception","fileName":"Code (WordPress.com for Google Docs)","lineNumber":3280,"stack":"\tat Code (WordPress.com for Google Docs):3280 (request)\n\tat Code (WordPress.com for Google Docs):3292 (post)\n\tat Code (WordPress.com for Google Docs):3344 (uploadImage)\n\tat Code (WordPress.com for Google Docs):248 (upload)\n\tat Code (WordPress.com for Google Docs):3951\n\tat Code (WordPress.com for Google Docs):3737 (renderInlineImage)\n\tat Code (WordPress.com for Google Docs):3491 (renderElement)\n\tat Code (WordPress.com for Google Docs):3476 (renderContainer)\n\tat Code (WordPress.com for Google Docs):3551 (renderParagraph)\n\tat Code (WordPress.com for Google Docs):3487 (renderElement)\n\tat Code (WordPress.com for Google Docs):3476 (renderContainer)\n\tat Code (WordPress.com for Google Docs):253 (postToWordPress)\n"}

I was using quite a few photos in a long post (13 pages in Docs including the pics).

It worked really nicely with one image so I went a bit mad!

Image Filename Issue

Steps to reproduce:

  1. Insert -> Image -> By URL (this preserves the filename)
  2. Put in a URL with an unsupported character
  3. Save draft

What actually happens:

  • An alert is displayed with an error saying "File is empty. Please upload something more substantial"
  • The image is not uploaded
  • The draft has an empty image tag

Test document: https://docs.google.com/document/d/1ah1ClnNfy02mlXcnSPp3P7gm_PMta1q5tAsi-gu_OYM/edit

Clarify initial support prompt

When the add on is first installed you are shown this prompt:

untitled_document_-_google_docs

I wasn't sure where 'open' was (and missed the little arrow thing), and it was only after digging about the menus I found it in the Add On menu.

I think it's worth changing this prompt to clarify exactly what you need to do (preferably with a picture).

  • Click the 'Add on' menu
  • Go to WordPress.com for Google Docs
  • Click 'Open' from the submenu

Cannot Connect Some Jetpack Sites

When attempting to connect to Jetpack sites, some users are getting this error on connect:

"Someone may be trying to trick you into giving them access to your site. Or it could be you just encountered a bug :). Either way, please close this window."

Possibly related to Automattic/jetpack#5847

Accessibility: Authorization Screen and Google Docs Interface

Moving here from our internal blog.

Had a user contact us (who is blind) in 3098158-t who is having trouble authorizing their Jetpack site because it’s not apparent that there’s a drop down:

authorize_wordpress_com_for_google_docs

While we’re visually prompted that it is a drop down, to her it’s not apparent as the down arrow isn’t accessible via keyboard. Even walking her through the steps in great detail using only my keyboard, she’s not able to select her Jetpack site since it’s not the first site in her list.

Additionally, in the list of sites in Google docs – there’s no way to remove a site once it’s been added unless you use a mouse hover:

accessible

Testing for screen reader devices would be the first step in relieving these pain points for visually impaired users.

Improve message shown when auth is denied

If you try to add a site and then deny access you end up on this page:

problem_deny

I don't know if we can run any code on this page, but if we can then we should detect the specific problem and show something more appropriate. The error is contained in the URL:

error=access_denied&error_description=You+need+to+log+in+to+WordPress.com

Link to draft after save?

After saving a draft successfully from google docs, I wanted to see the draft, as I was testing. So I opened wp.com, etc.

I was wondering whether in future releases of overpass we could hint the draft URL to the user after confirmation. As an example of what I mean, it could be kind of the same micro-interaction that we have in dotcom after publishing a post (see view post link).

confirmation

Support REST content API

The new REST content API in 4.7 would allow non-Jetpack users to use this add-on.

The biggest challenges right now are authentication and UX. Oauth tokens are better than app-specific passwords are better than standard passwords. The nice thing about the Jetpack API is that we can send folks to a single URL that lists all of their connected sites.

To support all .org sites, we will have to have them enter the URL for the site and then do a check to see what kind of authentication is available.

Images don't sync when not inline

When putting in images, if they are set as "Wrap Text" or "Break Text" they don't correctly sync with Google Images.

To reproduce:

  1. Create new Google Doc and authenticate with a site.
  2. Insert an image.
  3. Publish as a draft.
  4. Observe image in WP.
  5. In Google Docs, set image to "Wrap Text" or "Break Text" and publish draft.
  6. Observe image in WP.

Expected result: Image is there and wrapped appropriately.

Current result: Image is not there.

reopen of unable to connect Google Docs

Hi,
I had tagged onto another persons issue. Bad me! Anyway, I can't connect my Google Docs to the site http://www.robertmeans.net. At first it was that I didn't have the API on. Now that the API is on I get the error message that the site does not seem to be accessible or no longer has jetpack installed. Both of which are not true. I went through the troubleshooting tips and my xmlrpc.php is correct. Any other ideas?
Thanks,
Bob

Show proper error and guide if JSON API is disabled

If you have the JSON API disabled in Jetpack and you try and save to draft you get this at the bottom of the add on window:

error

Instead we should show a proper error and maybe detect this specific case and explain how to fix it / link to a support page specifically for this.

Note: I disabled the JSON API after authorizing the connection

Investigate Jetpack authentication URL length

When connecting to a Jetpack site you end up with a very long URL that on some servers can overflow the maximum header size leading to a 502 server error.

See #65, and also happens on my own server. Seems to affect Nginx more, maybe due to smaller default settings.

Steps to reproduce:

  1. Add a Jetpack site
  2. Note the long length of the URL

Looking into this URL we have this:

Array
(
    [action] => jetpack_json_api_authorization
    [redirect_to] => <REDIRECT>
    [data] => <LONG STRING>
    [token] => <TOKEN>
    [timestamp] => 1490859498
    [nonce] => <NONCE>
    [body-hash] =>
    [signature] => <SIGNATURE>
)

So far so good. Breaking the redirect_to down further we have:

Array
(
    [0] => client_id=1234
    [1] => response_type=code
    [2] => redirect_uri=<URL TO GOOGLE DOCS ADD ON>
    [3] => state=<STATE>
    [4] => action=oauth2-login
    [5] => redirect_to=https://public-api.wordpress.com/oauth2/authorize/?client_id=1234
    [6] => response_type=code
    [7] => redirect_uri=<ENCODED URL TO GOOGLE DOCS ADD ON>
    [8] => state=<STATE>
    [9] => jetpack-code
    [10] => jetpack-user-id=0
    [11] => action=oauth2-login
    [12] => blog_id=<BLOGID>
    [13] => _wpnonce=<NONCE>
)

Note how redirect_uri, state, action, and response_type are specified twice (with the second redirect_uri being double encoded). Because of how PHP's parse_str works only the first value will be used.

The state variable in particular is very long and all told can add up to > 1700 bytes.

At the moment I'm not sure whether the problem is in the add-on, Jetpack, or even WordPress (.com or .org). I'll try and work through the flow. Any additional insights would be appreciated.

Analytics

Figure out what we want to track and how we want to track it.

Improve authorize page design

screen shot 2016-12-13 at 12 00 33 pm

Feedback from @kriskarkoski

I think making Authorize a button would make it more obvious and a refresh option would be nice if feasible. If not changing the language to instructions of closing and reopening from add ons would be better

tagging @jasmussen

I can't authorize outside wordpress.com

I have a blog on Wordpress.com and another one outside using Jetpack plugin fully working but I can't to Authorize. I can select from the combo box but after that I recive a message, is in Spanish in my case:

Alguien puede estar tratando de engañarlo para que le de acceso a su sitio. O simplemente puede haber encontrado un error :). De cualquier manera, por favor cierre esta ventana.
http://myblog-URL/wp-login.php?action=jetpack_json_api_authorization&redirect_to=...

502 Bad Gateway when connecting a blog to google docs

Hi, im trying to connect my google account to wordpress, after having installed the addon:

bilde

I select the blog with jetpack installed and click approve:

bilde

I get this 502 bad gateway error:

bilde

I'm logged in just fine into the blog with the wordpress.com user:

bilde

What can be wrong?

Improve JSON API error (while authorising)

If you try and authorise a Jetpack blog without the JSON API enabled you get this:

no_json

I think a lot of users will experience this particular error so we should make it as informative as possible.

  • Add a bit of style / imagery to the error page - a sad face, a sad robot etc
  • More descriptive error ('there was a problem' is a bit opaque)
  • Show an image of the JSON API setting
  • Link to our support page for this
  • Remove the exception and, if possible, just show the error and message

Google Form: "Changes May Not Be Saved" Dialogue Pop-Up

User in Livechat reported today that any time she clicks away from her main page (upon which is a Google form) she gets a dialogue box

Steps to reproduce:

  1. Create a Google form.
  2. Embed form in page or post.
  3. Load the page.
  4. Click any link away from the post or page where the form is embedded, or try to close the page.

Expected:
5. Leave the page or exit out of the page, no dialogue box.

Actual:
5. A dialogue box will appear, asking if you want to 'save your changes'.

Any page this is embedded on, be it published or embedded in an editor (I tried this in wp-admin), it creates this dialogue:

Also seen here on published page:

If a user submits the Google form and tries to leave, there is no longer a dialogue box that appears when someone tries to leave the page.

Only an issue in Chrome and Opera. Does not create this dialogue box in Safari or Firefox.

Reported in #3108947-t

"Open" menu item missing when opening new documents

Steps to reproduce:

  • Install staging add-on
  • Confirm that "Overpass" menu includes "Open"
  • Close document and open another

What happens: Overpass menu is missing "Open" item

What should happen: Overpass remains installed for all docs

Animated GIFs are not animated

An animated GIF in a document will not show up as animated. Instead, it will only display the first frame of the animation.

Re-prompt for authorization if Oauth token is invalid

I was unable to test the "Authorize", as I was already authorized. When I disconnected the Overpass oauth application in my security settings, when I tested the next time I got this error message:

screen shot 2016-12-14 at 10 07 39

This stopped me from being able to test further — I'd been hoping it would ask me to re-auth.

Add Site does not work in MS Edge

Steps to reproduce:

  1. Open the add-on in MS Edge (tested Edge 14.14393)
  2. Click the "Add WordPress Site" button at the bottom

What I expected: The WordPress.com site chooser to open in a new tab.

What happened: Nothing.

Likely due to pop-up blocking.

Multiple images being uploaded

Every time a draft is saved, the image is uploaded, creating duplicates. If there's no change to the image, the existing image in the media library should be used.

Warn if overwriting an updated post

If updating an existing post, warn that we will overwrite any changes made via WordPress.com or other editors. Possibly check the timestamp and see if someone has edited since last upload before triggering the message

"Title" text formatting not supported

I'm not actually sure how it should be represented within WP (h1?) but if you format text as "Title" in Google Docs, it comes across just as a normal paragraph.

Is the reload button needed?

With no sites you are shown this message:

blank

In my testing the reload button is not needed - the site always appears automatically anyway. If it's not needed we should remove it.

Image Cropping

Steps to reproduce:

  1. Add an image to a document
  2. Right click on the image, choose "Crop Image", and adjust size
  3. Save draft to site

What I expect to happen:

The image in WordPress is cropped to match the document.

What actually happens:

The original, uncropped image is uploaded.

Improve support site

When you first go to the support page you see this:

wordpress_com_apps_-_support

The Google Docs title is half hidden, and you see 'WP for iOS', which is confusing.

I think we need to split the apps.wordpress.com support pages out into separate pages, and include screenshots and a video.

Add support for drawings

When attempting to add a drawing:

image

It fails to get exported to WordPress, and instead shows some INLINE_DRAWING: InlineDrawing placeholder content. Google Docs on left, WordPress draft on right:

image

It would be ideal if they could be exported as SVGs.

Only One Site is Showing

Hello,

I have a number of wordpress.com sites on this account, plus personally hosted wordpress sites using the Jetpack plugin. I am excited about this add-on and want to use it for most of my sites.

However, I just installed the google-docs-add-on, but only seed2sow.wordpress.com shows up on the side panel of the Google docs page. Can you help?

Thanks.

Jeanette Burton

Add support for Google Docs footnotes

It's a great add-on and I personally love being able to decouple from the editor and write from a more natural one, but It appears that footnotes are not currently supported. That would be a wonderful feature for those of us who use footnotes.

Revisit updating published posts

Right now, if you publish a post and then update it from the add-on, you will be warned that you are overwriting what is on the server. If you say OK to the modal, you will update and un-publish. A couple folks have mentioned that's not what they would expect.

Two ideas to explore:

  1. Creating the update as a Revision post type
    • How would this work with the preview link?
    • How would this interact with Custom Post Types in the future? ( #27 )
  2. Updating the post but leaving the status set as Published

We should still keep the warning modal either way.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.