owid / owid-grapher

A platform for creating interactive data visualizations
https://ourworldindata.org
MIT License
1.37k stars 230 forks source link

Admin for managing Google Docs articles #1613

Closed larsyencken closed 1 year ago

larsyencken commented 2 years ago

(original description by @mlbrgl)

As part of the migration from Wordpress to google docs (#1597), we're replacing the Wordpress block editor with Google docs.

Beyond editing documents, Wordpress provides some non-editor features, such as publication workflows, media management, document management or category management.

Wordpress block editor  ≡  Google docs
Wordpress admin  ≡  ?

This issue aims at filling some of this gap, starting with document management. Other candidate CMS features of the current set-up can be found in the CMS glossary, which will serve as a basis for migration decisions around CMS features.

A possible approach has been developed in the https://github.com/owid/owid-show experiment and might be ported over to https://github.com/owid/owid-grapher. Some other approaches will be considered as well, in anticipation of the port of all remaining CMS features into this new foundation.

Cycle 2022.5 (Aug 29 -> Sep 16)

Wireframes, background work

Cycle 2022.6 (Sep 26 -> Oct 14)

Completed on branch, awaiting PR review

Merged and shipped

Additional scope

mlbrgl commented 2 years ago

Gsheet-based publication workflow

This is an exploration of using Gsheet as the replacement fro Wordpress admin features, starting with the publication workflow.

Screenshot 2022-08-29 at 15 46 56

An example spreadsheet for managing articles and their publication

sequenceDiagram
Author ->> Gdocs: write draft
Author ->> Gsheet: register article
Author ->> Gsheet: publish article
Gsheet ->> Gsheet: run appscript
Gsheet ->> Baker: send baking request w/ document ID
Baker ->> Gdocs: get document content
Gdocs -->> Baker: receive document content
Baker ->> Baker: process ArchieML
Baker ->> Grapher DB: save JSON
Baker ->> Baker: bake site

Authors write ArchieML documents in Gdocs, then list them with their metadata in the companion spreadsheet.

mlbrgl commented 2 years ago

Conclusion

Gsheet as an admin for managing articles is not convincing. Favour tighter integration in bespoke admin.

Rationale

With most of the article metadata pushed to the document frontmatter, there is little to no content left in this sheet. This makes the value of spreadsheet functions and scripting features equally limited. Versioning and commenting are probably among the most salient features spreadsheet offer (incidentally not specific to the format), but fail to outweigh the benefit of tighter relationships between charts and articles (including referential integrity), a visible and well-known limitation of the current system.

Pros and cons of Gsheet as an admin interface for articles

Roughly by order of importance

Pros

Cons

mlbrgl commented 2 years ago

Admin screen for managing google docs based articles (lo-fi wireframe)

👉 Interactive prototype

Screenshot 2022-09-02 at 15 51 33 Screenshot 2022-09-02 at 15 51 50

Done with Lo-Fi Wireframe Kit

mlbrgl commented 2 years ago

Wireframe update:

graph LR
    A{Is published} -->|Yes| D
    A -->|No| B[fa:fa-cloud-upload-alt Publish]
    D{Has updates} -->|Yes| C[fa:fa-redo-alt Update]
    D{Has updates} --> F[Unpublish]
Screenshot 2022-09-07 at 15 39 51
mlbrgl commented 2 years ago

Wireframe update:

mlbrgl commented 2 years ago

Wireframe update:

Screenshot 2022-09-09 at 13 37 49 Screenshot 2022-09-09 at 13 37 58
mlbrgl commented 2 years ago

An argument for the metadata source of truth to be the admin DB

In order to simplify the publishing workflow for authors, we want the slug to be automatically derived from the title upon publishing

Source of truth

With the slug edited in the admin, we can...

... in a more straightforward way than if the slug was typed in as text in the document frontmatter. It also promotes a tighter feedback loop for errors or suggestions.

With the slug edited in the admin, authors can carry out all publication workflow related tasks in the same place, instead of going back and forth between the document (for editing metadata) and the admin (for validation).

mlbrgl commented 2 years ago

Status update (Tues 13th)

With the biggest part of the UI / UX work done on Admin for managing Google Docs articles, I'm moving more confidently on the implementation of the basic publication flow this week, including:

I'm aiming to get the happy path handled by the end of the week, to run through a first feedback cycle during cooldown. The rest will most likely span over 2/3 of the next cycle, giving one (maybe two) additional opportunities for feedback. Some of the "source of truth" discussions haven't fully landed yet. This brings a layer of uncertainty which we should account for.

mlbrgl commented 2 years ago

Status update (Sep 14)

A demo a of the (now abandoned) early implementation of the wireframes above (commit from Sep 14)

https://user-images.githubusercontent.com/13406362/191674624-f9c8c201-a728-4690-baf5-ef98a13428f6.mp4

mlbrgl commented 2 years ago
Screenshot 2022-09-23 at 11 26 19

Feedback from individual sessions with @larsyencken (Sept 20) and @eoo-owid (Sept 22):

mlbrgl commented 1 year ago
mlbrgl commented 1 year ago

Status update Thu 29

Screenshot 2022-09-29 at 18 36 18

Content metadata vs publication metadata

After experimenting with editing the title in the admin, I'm bringing it back to the google doc. The split is roughly:

By keeping the content metadata in the google doc, authors get to save more complete drafts of published articles, including the content metadata. Otherwise, when the content metadata is saved in the admin, authors have to publish straightaway or discard their changes - as changes to published articles cannot be saved. Keeping content metadata in the google doc might also make it easier to leave comments related to these fields, although this has been deemed a minor concern thanks to the :skip section.

The slug will remain in the admin.

Another dimension for these source of truth considerations is the complexity of the data being entered. Titles are simple strings but authors or categories might benefit from a tighter integration in the admin, to provide a better editing UX as well as enforcing referential integrity between e.g. articles and their categories. As an example, this would prevent deleting a category used by an article and also allow for renaming categories across all articles.

Merging https://github.com/owid/doc-to-archieml with codebase

mlbrgl commented 1 year ago

Status update on current cycle scope - Oct 7 For @larsyencken, @mathisonian

larsyencken commented 1 year ago

Thanks for the update Matthieu, looks like it's coming together.

Can you please update the issue summary at the top, and perhaps reorganise the checklist into things that are completed on-branch vs things that have passed review and shipped?

For this project, it would probably look like this:

mlbrgl commented 1 year ago

Status update - Oct 13

Screenshot 2022-10-13 at 14 57 12

This was the last remaining item in scope. PR opened: https://github.com/owid/owid-grapher/pull/1703