If iI did not miss anything, the Web-UI is currently read-only.
To be ablle to create bugs, comments, edit, remove and so on in a way that works for any kind of (non-technical) users, is very important for any project that might has such users.
That's correct, the web UI is only read only for now, just because no one took care of that yet. It's an important task, not only for local rich editing (images, files ...), but also to eventually create a public portal which will accept external users.
Note that most of the GraphQL mutations already exist, so that's almost purely an JS/web job.
I am not a web dev, and .. generally have little to no idea about the technologies you used in the web UI.
Can you recommend an IDE, editor, tutorial or something to get started?
There is plenty of tutorial floating around if you search for react graphql apollo. I don't have anything specific to recommend. But I'm not gonna lie, that's a lot to ingest.
As @MichaelMure mentioned, I created an add-bug screen. It seems to work but I think there is something I need to do in order to "update the apollo cache". I have no idea what that means but I read it in one of the tutorials I was following. The result is that the bug-list is out of date when you go back it it. I just hit refresh for now. I filed a bug to fix it :wink:.
In any case, I'm just tinkering around so if someone else wants to dedicate some real time to this please don't think I've claimed it or anything. I doubt I'll have much time to dedicate to it but I'd love to dig in a little more if I can.
@hoijui I also am a complete n00b to react, graphql, and even JSX but I found it pretty easy to get started (I have some javascript experience though). The instructions at webui/Readme.md worked just fine and I just used a plain editor (vscode) to make my change. Feel free to take a look at my branch and diff it against the upstream to see how I implemented the feature.
hoijui (hoijui) commented (edited)
cool!
thank you @cheshirekow ! will do next time I get the courage for it.
@claudioantonio as you likely won't change the graphQL API, you can use your regular git-bug binary. No need for cygwin or anything, just the classic web dev tools like npm.
There is a dedicated Readme to explain the process (again, you don't even have to compile git-bug yourself here): https://github.com/MichaelMure/git-bug/blob/master/webui/Readme.md
Hi @MichaelMure !
I read about GraphQL and I did the Apollo tutorial. I had no previous experience with GraphQL before.
IÂŽm already able to create new bugs through the git-bug API using Insomnia (an app like Postman). See image below.
However, IÂŽm having problems to execute the same GraphQL mutation command by React/Apollo. The code should be simple. I will print what IÂŽm doing and I will be glad If You or any other collaborator can give me any hint, ok?
That looks like a HTTP error, maybe looking at the network debugger in your browser would help?
ClĂĄudio Silva (claudioantonio) commented
Problem solved @MichaelMure !
It was a little bit frustrating that a code generator make it work automagically adding just one file but...
c'est la vie.. đ Probably was something related to return object type conversion.
I will improve the Readme file with the lessons learned during this issue to give quick context for graphql begginerÂŽs, like me.
Can You edit this issue title to "WebUI - Allow to create bugs"?
I would like to create a new issue specifically for edition as "WebUI - Allow to change a bug title". Today It is already possible to add comments for existing issues. đ
@MichaelMure what considerations about permissions should I consider?
Who can create or edit a bug?
I found a component that checks if the user is logged in to decide if comments can be added or not. About what kind of login are We talking about? đ€
At the moment, anyone can create and edit any bugs (including comments they are not the author of). This should change in the future once the identity system become smarter. For now, maybe it's best to match whatever is possible in git-bug core?
Regarding the authentication, there is three different scenario:
the user might might not have an identity yet (that is, Repository.userIdentitycan be nil in GraphQL). In that case we want to have a read-only UI if we don't have a user yet.
in the future, the webUI might be used for a public portal (possibly with external auth like github OAuth where identities would be imported in git-bug at first login). Again, we want a read-only view when we don't have a user logged in yet.
the webUI can be started with --read-only to force a read-only view.