Open jlaw9 opened 7 years ago
I would like to work on this issue.
@jlaw9 @adbharadwaj Can you help @bruce-wayne99 to get started on fixing this issue?
Thanks for the offer, @bruce-wayne99. We welcome new contributors!
@bruce-wayne99, Thanks for offering to work on this issue. Here is how I would do it I was a newbie in GraphSpace project.
You can find detailed documentation on how the graph information, tags, title, and legend is populated using the following link.
Graph Data Attributes Attributes Treated Specially by GraphSpace
Although the above-mentioned sub-section should be sufficient, I highly encourage you to understand go through entire section on CYJS format to get a more thorough understanding.
Go through our update/put /graphs/{id}
API works. Play around with it on your local setup. Try to update all of three fields mentioned above and understand the input and output data format.
Here are some useful links:
Since the API call for this feature will be from UI, we don't have to authenticate our calls using BasicAuth. Instead, we need to authenticate it using CSRF tokens.
The good thing is we already have a JS API to handle graph update in our JS library. All you need to worry about is sending in the right input data and hence, step 1 and 2 is really important.
Here is a sample call where we are updating the graph to make it public.
apis.graphs.update(graph_id, {
'is_public': 1
},
successCallback = function (response) {
// This method is called when group_to_graph relationship is successfully deleted.
// The entry from the table is deleted.
$(e).parent().find('.unshare-graph-btn').removeClass('hidden');
$(e).addClass('hidden');
},
errorCallback = function (xhr, status, errorThrown) {
// This method is called when error occurs while deleting group_to_graph relationship.
$.notify({
message: xhr.responseJSON.error_message
}, {
type: 'danger'
});
});
Write the code !!
@bruce-wayne99, I would be happy to discuss the user experience flow with you on this thread, if you need to. Some tips:
@adbharadwaj I actually thought of adding buttons like 'Edit name', 'Add Tag', 'Remove Tag', 'Edit description' in the graph table. As shown in the figure below. Correct me if there is a better way to provide UI to modify graph meta data.
@bruce-wayne99 In principle, this UI is good but a challenge is that as we expand the list of items we want to be editable the number of buttons increases.
Another option to consider is show an "Edit" icon (usually looks like a pen). Upon clicking this icon, either (i) a new page opens up that allows editing of all metadata associated with the graph or (ii) the appropriate columns in the table become editable in place.
I like option (i) more since it allows metadata that is not shown in the table to edited. But a minor drawback is that it requires opening a new page.
@adbharadwaj Comments?
@tmmurali So, Iam thinking of implementing an Edit icon for each graph and on clicking the Edit option a new modal opens up just like the way for Remove where for each meta data field an input tag can be specified where he can enter new values for the data and clicking the submit button triggers an AJAX request. Suggest me if this could be done in a better way.
I like what @tmmurali suggested in option (i).
Another option would be to create a new page for editing and that means you will have to add a new url-route. I would rather create a client-side util on the graph page.
So instead of editing from the graphs list page, users should be editing on the page for a given graph. Something like edit description feature in GitHub.
Let me know if you have more questions.
@adbharadwaj i have implemented editing name and title of the graph. The following is a gif of the implementation. Please have a look at it. Suggest me if any changes can be made!
@bruce-wayne99 Looks promising! Can you make it look like Github? You can refer to the GIF in my previous comment. Ideally we wouldn't wanna hide the graph while editing the name and description. For tags, you can refer to Github's tags edit functionality. Let me know if you have more questions.
@adbharadwaj sorry for the late response, I was having exams, since the graph visualization and graph information are on different panels, should i display the name, description, tags, title for the graph in the visualization tab and then provide edit/cancel options for the user in the visualization tab?
@bruce-wayne99 We need to split this into two parts.
@adbharadwaj I have implemented editing name,title,description functionality. gif of the implementation : I have gone through the tags implementation of github but there are using a new page for displaying all the tags and editing them as shown in the screen shot. Please suggest me regarding implementation of add/remove tags.
Thanks. This implementation looks nice.
Is the edit button seen only by the user of the graph?
On Mon, Feb 12, 2018 at 3:46 AM, Subramanyam Makam <notifications@github.com
wrote:
@adbharadwaj https://github.com/adbharadwaj I have implemented editing name,title,description functionality. gif of the implementation : [image: final] https://user-images.githubusercontent.com/25129274/36088891-1e900b70-0fff-11e8-873c-ef7137b244ec.gif I have gone through the tags implementation github but there are using a new page for displaying all the tags and editing them as shown in the screen shot. [image: screenshot from 2018-02-12 14-10-04] https://user-images.githubusercontent.com/25129274/36088898-259f2c5c-0fff-11e8-80ea-7c44dcfc60e9.png Please suggest me regarding implementation of add/remove tags.
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/Murali-group/GraphSpace/issues/317#issuecomment-364859494, or mute the thread https://github.com/notifications/unsubscribe-auth/AGkWUJ2FVaHVNNTNaS-p6iLkyb6lk9DGks5tT_pdgaJpZM4O6aC1 .
Sorry. I meant to say "owner of the graph".
On Mon, Feb 12, 2018 at 10:49 AM, T. M. Murali murali@cs.vt.edu wrote:
Thanks. This implementation looks nice.
Is the edit button seen only by the user of the graph?
On Mon, Feb 12, 2018 at 3:46 AM, Subramanyam Makam < notifications@github.com> wrote:
@adbharadwaj https://github.com/adbharadwaj I have implemented editing name,title,description functionality. gif of the implementation : [image: final] https://user-images.githubusercontent.com/25129274/36088891-1e900b70-0fff-11e8-873c-ef7137b244ec.gif I have gone through the tags implementation github but there are using a new page for displaying all the tags and editing them as shown in the screen shot. [image: screenshot from 2018-02-12 14-10-04] https://user-images.githubusercontent.com/25129274/36088898-259f2c5c-0fff-11e8-80ea-7c44dcfc60e9.png Please suggest me regarding implementation of add/remove tags.
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/Murali-group/GraphSpace/issues/317#issuecomment-364859494, or mute the thread https://github.com/notifications/unsubscribe-auth/AGkWUJ2FVaHVNNTNaS-p6iLkyb6lk9DGks5tT_pdgaJpZM4O6aC1 .
Yes, the edit button will only appear if user-id is same as the owner-id.
@bruce-wayne99 Looks great. Few more suggestions.
danger
class in bootstrapLet me know if you have any questions.
This is how add topics look like on GitHub.
@adbharadwaj Sir, @tmmurali Sir,
@bruce-wayne99 A few more suggestions,
Basically, use your discretion to come up with a neat UI.
@adbharadwaj Sir,
bootstrap hyperlink
to display Manage tags
.Save
and Cancel
buttons to the right and spread the input element
across the whole edit panel in case of both Add/Remove Tags and Edit Name/Description/Title.Edit
button properly with equal spaces between all the buttons.@bruce-wayne99 @adbharadwaj This implementation looks good. Two points:
Having both an "Edit" button and a "Manage tags" button is bound to be confusing. The user will wonder (before clicking "Edit") about what it does. Can we not unite them in one button?
Are we changing the database to record these edits? Will other users who can see the graph get a notification of the changes and what the changes are? Is the plan to add new issues to address these must-have functions? In that case, we should create a separate branch for edit functionality, should we not?
@adbharadwaj , @tmmurali Sir,
@tmmurali
@bruce-wayne99 Do not worry about the notification in this pull request. That will be taken care when we merge the notifications pull request. For now, just unite the edits under one button and let us know.
@adbharadwaj, @tmmurali Sir, I have made a pull request for this issue please look at it.
The main missing UI features to modify graph metadata are:
Users should be able to edit the title and tags in the "Graph Visualization" tab and the graph inforomation/legend in the "Graph Information" tab