-
Notifications
You must be signed in to change notification settings - Fork 41
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
Added functionality for modifing graph metadata using UI #364
Conversation
@bruce-wayne99 Can you add documentation for the feature as well. You can find the markdown documentation here. |
@adbharadwaj it might help to provide @bruce-wayne99 more information on what you expect from these docs and where he should add them in the docs. |
@adbharadwaj , @tmmurali Sir, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Need to resolve few things before I can merge this in.
@@ -290,6 +290,9 @@ def add_tag(db_session, name): | |||
db_session.add(tag) | |||
return tag | |||
|
|||
@with_session | |||
def remove_tags_by_graph_id(db_session, graph_id): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@bruce-wayne99 Why was this method introduced?
@@ -229,6 +229,11 @@ def update_graph(request, graph_id, name=None, is_public=None, graph_json=None, | |||
if name is not None: | |||
G.set_name(name) | |||
|
|||
db.remove_tags_by_graph_id(request.db_session, graph_id=graph_id) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@bruce-wayne99 Why was this method introduced?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Editing tags involves adding new tags and removing old tags simultaneously,
For example:
Let a user removed a tag named x from the graph G and added a tag y to the graph. So, there is a need to delete a row from GraphToTag
containing the graph_id
equal to the graph id of G and tag_id
equal to tag id of tag x and also addition of a row with graph_id
equal to the graph id of G and tag_id
equal to tag id of tag y.
Now both these operations can be carried out at once if we remove all the entries of graph G in GraphToTag
table and after that adding the final list of tags the user wants to the graph.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@adbharadwaj I have provided an explanation for the usage of db.remove_tags_by_graph_id
. Please review.
@@ -430,6 +430,7 @@ var uploadGraphPage = { | |||
var graphPage = { | |||
cyGraph: undefined, | |||
timeout: null, | |||
tagsBar: null, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rename it to tagsEditor
$('#new_description').val(description); | ||
|
||
//fetching all the tags and populating them in the tag bar. | ||
console.log(title, name, description); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove logs from final pull request.
@adbharadwaj I have provided explanation for a adding the function |
Thanks for your contributions! I made a new Pull request #456 with a few minor changes to merge with master. It's easier this way to see the merges with updated code since the branch for this PR was deleted. |
Fixes #317
Implemented UI for modifying user meta-data which includes the following
Gif of the implementation