juno icon indicating copy to clipboard operation
juno copied to clipboard

Edit datastore entry in the console

Open peterpeterparker opened this issue 1 year ago • 4 comments

Feature

In Juno's console, if collections are not set to "private," developers have the ability to list and browse objects persisted on the chain. Additionally, they can delete entries. However, they currently lack the capability to manually edit these entries.

The objective of this feature is to introduce an "Edit" function that allows developers to modify content.

UX

A document can contains lots of data (up to roughly 2mb), and the number of fields may vary significantly - that is, their length is not fixed. We might consider imposing a limit on this function; for instance, a document with a depth of X can be edited, but if the depth exceeds this limit, we could offer a "download/upload JSON" feature instead.

For the same reason, we might want to display the edit feature in a modal rather than within the same browser pane, let me know what you think.

Persisting data on the chain could present challenges, so our initial focus should be on the UI/UX aspect. Addressing the actual on-chain update will be a separate task.

Pre-work

It's important to note that the sole objective of this feature request is to implement an "Edit" feature. There was a prior attempt to introduce a "Create new document" feature, but it was not completed. The impediment was related to permissions. When a document is created in a satellite, it becomes associated with the user who created it. Consequently, an admin developer is unable to create documents in the administration for a user due to technical and security constraints.

Screenshots

Capture d’écran 2024-01-18 à 16 57 05 Capture d’écran 2024-01-18 à 16 57 08 Capture d’écran 2024-01-18 à 16 58 10

peterpeterparker avatar Jan 18 '24 15:01 peterpeterparker

I might pick this if no one is doing it. Just need some time to understand svelte and the code structure. :)

cylim avatar Feb 22 '24 05:02 cylim

To be honest with you, I should have maybe not labelled this one good first. I'll remove the flag now. The task requires many PRs and quite some work. You are still welcome to have a look at it but, just want to warn you that it's a really tasky feature.

peterpeterparker avatar Feb 22 '24 05:02 peterpeterparker

It might be tasky, and shouldn't be complicated, most underlying hard work had done by you and the other collaborators,

I guess can start with JSON download, JSON import, add document, then edit. Even if not finished all requirements, some can pushed as a feature too. JSON can look like

{
"key": "ID",
"data": [{
  "name": "string",
  "type": "acceptable type in string",
  "value": "based on type"
}]
# auto-field, might allow manually input in some fields, e.g. timestamp, owner, etc
}

In case of ownership, I guess they might need to add a field in data manually and using filter.

cylim avatar Feb 22 '24 09:02 cylim

I guess can start with JSON download, JSON import

Agree, that an interesting idea! I thought about this too but, the community is more looking for a UI editor, that's why I actually never developed this approach.

In case of ownership, I guess they might need to add a field in data manually and using filter.

This is not possible for security reasons. It would mean extending the smart contract's permission scheme and interfaces, which would lead to several questions about the ownership model of the data.

peterpeterparker avatar Feb 22 '24 11:02 peterpeterparker