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

Edit datastore entry in the console #394

Open
peterpeterparker opened this issue Jan 18, 2024 · 4 comments
Open

Edit datastore entry in the console #394

peterpeterparker opened this issue Jan 18, 2024 · 4 comments
Labels
enhancement New feature or request

Comments

@peterpeterparker
Copy link
Contributor

peterpeterparker commented Jan 18, 2024

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
@cylim
Copy link
Contributor

cylim commented Feb 22, 2024

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

@peterpeterparker
Copy link
Contributor Author

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 peterpeterparker removed the good first issue Good for newcomers label Feb 22, 2024
@cylim
Copy link
Contributor

cylim commented Feb 22, 2024

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.

@peterpeterparker
Copy link
Contributor Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants