Skip to content
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

Glossary, ACs, desynchronize and sync every tables #1

Open
wants to merge 9 commits into
base: issue-416
Choose a base branch
from
42 changes: 42 additions & 0 deletions issue-416/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,48 @@ Stating @CamilleLegeron
>
> Camille

## Glossary

<details>
<summary>Acronyms</summary>
<dl>
<dt>MH</dt><dd>Must Have</dd>
<dt>SH</dt><dd>Should Have<dd>
<dt>NTH</dt><dd>Nice To Have</dd>
</dl>
</details>

<details>
<summary>Vocabulary</summary>
<dl>
<dt>Synchronized table / Target table</dt><dd>The table which fetches its data from an external table, and gets its data and columns synchronized with this external table</dd>
<dt>External table / Source table</dt><dd>Table of another document of the synchronized table (source table should be preferred in the UI)</dd>
<dt>Regular table</dt><dd>A table which is not synchronized</dd>
</dl>
</details>

## Acceptance Criteria

- AC1 - MH: A user can create a fresh table synchronized with an external document
- AC2 - MH: The synchronization is made when the user requests it.
- AC2.1 - MH: The columns of the synchronized table are updated/created/deleted so it reflects what exist in the external table
- AC2.2 - MH: Idem for the records
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

NB: record can be here seen as synonym for row

- AC2.3 - MH: If the external table is not accessible anymore or is deleted, a relevant error is displayed to the user, but the synchronized table continue to exist unless the user decide to delete it
- AC2.4 - NTH: If the external table is modified, the user gets notified that changes can be fetched
- AC2.5 - NTH: The user sees what data have been changed through a diff
- AC2.6 - NTH: The user also sees what columns are removed or added
- AC3 - MH: A user can convert an existing table to a synchronized one
- AC3.1 - MH: If another regular table references a column of the table to synchronize, the reference is not broken if the external table has a column of the same id
- AC3.2 - SH: If the external table references a column of another external table, the two tables are synchronized and the reference continues to work in the synchronized document
- AC3.3 - SH: If the external table references a column of another regular table, the reference column is converted to a regular one (type: Ref:... ⇒ Any) in the synchronized table and the display value is stored directly
- AC3.4 - NTH: The user sees what data have been changed through a diff
- AC3.5 - NTH: The user also sees what columns are removed or added
- AC4 - SH: The user should be able to unlink a synchronized table which would become a simple table;
- AC5 - NTH: A "synchronize every tables" button is offered to the user in the "raw data tables" view;
- AC6 - SH: Edits to synchronized tables should be forbidden;
Copy link
Owner Author

@fflorent fflorent Aug 1, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To be seen after the POC. If the POC says that references can be synchronized, we can keep this AC.

If not, things get more complicated, because the user would want to manually copy/paste the result of a formula from the external table to the synchronized one.

Copy link
Owner Author

@fflorent fflorent Aug 9, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The references cannot yet be retrieved. The main problem here is that when using add-or-update on records, the IDs of the added or updated records are not returned (mapped to each submitted elements)

- AC7 - MH: Attachment columns are not retrieved from source tables;
- AC8 - MH: The hidden columns of the external table are synchronized too;

## Documents

- [design.md](./design.md)
Expand Down
47 changes: 34 additions & 13 deletions issue-416/design.md
Original file line number Diff line number Diff line change
@@ -1,29 +1,32 @@
# Import from scratch

The user clicks « Add new » → « Add page » and is offered this view:
The user clicks « Add new » → « Import table from document »:

![select a widget with external data source](https://github.com/gristlabs/grist-core/assets/371705/1835e49e-997a-49b5-8786-ad11c9d1c4da)
![Import table from document item](https://github.com/fflorent/grist-issues-proposals/assets/371705/6aa87e16-1f29-4a7b-ac47-71c7ff213aa8)

(at least with more cosmetic :sweat_smile:)
And then a popin appears with some fields to fill to retrieve the table to import:
![2023-07-26_14-58](https://github.com/fflorent/grist-issues-proposals/assets/371705/fcad24b8-251f-42a9-a586-645e81b94dfa)

They are offered to select a document from their own instance.
NB: the select box should propose a way to filter the options and the « link the table ...» field is checked by default.

About this idea of entering a table URL, that should lead to the same instance or to a public document, I am not sure how difficult it would be to implement that, I would suggest to implement it later if we want to.
They are offered to select a document from their own instance.

Once the user submits, the data are fetched from the external document and put in a new table and a new data source.
Once the user submits, the data are fetched from the external document and put in a new table and in a new page.

Then the user can see the table with synchronized data source:
Then the user can see the synchronized table:

![left menu with list of tables](https://github.com/gristlabs/grist-core/assets/371705/5d8f3193-4249-44c2-a8f6-45f9881fe0b3)

And the synchronized data source itself:
And also the synchronized raw table:

![synchronized data source](https://github.com/gristlabs/grist-core/assets/371705/e5efabf6-7de8-40ed-8923-41f2d32a46e6)
![synchronized raw data tables](https://github.com/gristlabs/grist-core/assets/371705/e5efabf6-7de8-40ed-8923-41f2d32a46e6)

Both data source list and table list would offer another context menu to synchronize the data source:
Both raw tables list and page list would offer another context menu to synchronize the table:

![synchronize action in context menu](https://github.com/gristlabs/grist-core/assets/371705/ca662ba2-5be4-4c4a-abf5-763c8c46c675)

In case one synchronized table is rendered in a page, the 🔁 icon would appear.

And I would suggest that also a click to the 🔁 icon would trigger that action.

When they trigger this action, the user is offered a popup to review the changes and validate if they want to:
Expand All @@ -32,8 +35,26 @@ When they trigger this action, the user is offered a popup to review the changes

# Import into an existing table

To be done
Use case: a user used to copy tables from a document to another, and wants to synchronize the data (NB: one-way synchronization).

![Contextual menu of raw table with *Initiate a synchronization*](https://github.com/fflorent/grist-issues-proposals/assets/371705/9f0e7dd1-97e2-4093-87c5-a89e9d4092f4)

Then the user is offered the same popup to validate the changes:

![2023-07-20_15-51](https://github.com/gristlabs/grist-core/assets/371705/b2ef24ba-5302-4cde-9613-69a05e2e3e9a)

The user also sees what columns are removed and what columns are added:

**TODO** (not implemented in snapshots comparisons)

# Desynchronize a document

The user would be offer a "Remove synchronization" item in the contextual menu of a synchronized raw data table

![contextual menu of a synchronized table](https://github.com/fflorent/grist-issues-proposals/assets/371705/4b5a14a8-13c7-48d5-9dfd-d2c718db7973)

# Synchronize every tables

# Forget / break the link
The user would be offer the "Synchronize every tables" in the raw data tables:

To be done
!["synchronize every tables" button at the bottom of the raw data tables list](https://github.com/fflorent/grist-issues-proposals/assets/371705/4f53abdb-db9a-419d-a663-4d60c665dd86)