Skip to content

Tag tree actions#4518

Merged
jburel merged 41 commits intoome:developfrom
will-moore:tag_tree_actions
Apr 20, 2016
Merged

Tag tree actions#4518
jburel merged 41 commits intoome:developfrom
will-moore:tag_tree_actions

Conversation

@will-moore
Copy link
Copy Markdown
Member

This PR updates the web with the same Tag & Tag set functionality as Insight.

screen shot 2016-03-08 at 16 33 26

To test:

  • Browse tags tree
  • Creation of tags / tag sets should appear as orphans in tree, unless tag is created with tag set selected (should be created as child of tag set).
    • Create Tag and Tag set from toolbar buttons
    • Create Tag and Tag set from right-click menu
  • Cut, Copy and Paste all data types, from toolbar and Right-click menu:
    • Tag / Tagset
    • Dataset / Project
    • Image / Dataset
    • Plate / Screen
  • Drag and Drop all data types that can be Cut as above
  • Tagged objects can also be Copied from below Tag (NOT Cut, as in Insight)
  • Delete Tag & Tag set

NB: @pwalczysko, @bramalingam and I had a discussion about whether you should be able to Cut OR Copy orphaned objects E.g.:

  • Dataset in P/D/I tree
  • Orphaned Image in P/D/I tree
  • Tag in Tag tree

Generally agreed that you should be able to Copy these (not current policy in Insight or Web & not changed in this PR).
Re: this PR, we allow to Copy:

  • Tagged Project/Dataset/Image etc in Tag tree (where you are not Cutting the parent link)
    This is conceptually similar to Copy of an Orphaned object (also not Cutting any parent link).

@will-moore will-moore closed this Mar 9, 2016
@will-moore will-moore reopened this Mar 9, 2016
@will-moore will-moore closed this Mar 10, 2016
@will-moore will-moore reopened this Mar 10, 2016
@will-moore will-moore closed this Mar 10, 2016
@will-moore will-moore reopened this Mar 10, 2016
@will-moore
Copy link
Copy Markdown
Member Author

@pwalczysko Could you check whether https://trac.openmicroscopy.org/ome/ticket/13020 is fixed in this PR? I think it is. Thanks.

@pwalczysko
Copy link
Copy Markdown
Member

@will-moore : Just checked, yes, the https://trac.openmicroscopy.org/ome/ticket/13020 works as expected for all private, ro, ra, rw groups and for any type of users.

@pwalczysko
Copy link
Copy Markdown
Member

Creation of new tags and Tagsets - works as expected for icons and right-click in Tags Tab.

@pwalczysko
Copy link
Copy Markdown
Member

Suggestion: Make the Tagset icon more distinctive from Tag icon (atm they look very similar, hard to see on first look which is which).
screen shot 2016-03-11 at 11 01 25

@pwalczysko
Copy link
Copy Markdown
Member

Possible RFE see https://trac.openmicroscopy.org/ome/ticket/13172#ticket (not for this PR).

@will-moore
Copy link
Copy Markdown
Member Author

@chris-allan Actually, just started looking at the tests and the api_links method is actually covered quite well by test_links.py and CSRF tests of manage_action_containers are actually testing that various actions work, so we're not in too bad a state. I'll review more and see what's missing...

@chris-allan
Copy link
Copy Markdown
Member

Yep, seeing that now that I peel back some of the layers. Just for my own sanity I might integration test the underlying methods themselves to avoid having to pipe every condition through the myriad of options and 100+ lines of code that are in api_links() but that's up to you.

I accept that manage_action_containers() is 300+ line absolute beast. Looking at the changes more closely it would probably suffice to constrain what we are testing for the moment to the tag vs. tagset differences for o_type and the addnewcontainer branch of the if action... conditional. Making a separate comment on the logic changes there.

Since create_link() is currently an inner function it might make sense to pull it out. It's probably self contained enough that it can even be unit tested instead.

There's no coverage at all for batch_annotate(), correct?

args=["edit", o_type, o_id]))
if o_type is not None and hasattr(manager, o_type) and o_id > 0:
# E.g. Parent o_type is 'project'...
if o_type == "project" and hasattr(manager, o_type) and o_id > 0:
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since the only object we could be creating in the tree at the moment that has the option of also having a parent is a Dataset that is the reason for constraining this, correct?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, since we don't allow creation of Plates in the tree, and creation of Tag under Tagset is handled below.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great. Makes sense.

@will-moore
Copy link
Copy Markdown
Member Author

@chris-allan I split relevant tests out of test_csrf.py, added a bunch of tests for tags, split create_link() out of api_links() and split api_links() into smaller functions.

The batch_annotate() is not covered by any integration tests (it just gets HTML for display in right panel) but it is tested by Robot framework.

This fixes a very strange bug when copy and pasting a tag with images and runs from one Tagset to another.
The bug occurred if the Run was not the last item (after images). As described in
ome#4518 (comment)
@will-moore
Copy link
Copy Markdown
Member Author

@pwalczysko That last commit should fix the copy/paste 404 bug #4518 (comment).

@will-moore will-moore closed this Mar 24, 2016
@will-moore will-moore reopened this Mar 24, 2016
@gusferguson
Copy link
Copy Markdown

@will-moore cc @pwalczysko

Tested using https://cowfish.openmicroscopy.org/merge/webclient/ user-4

Repeated workflow that gave Petr 404 error on Windows 8.1:

  • with IE 11, Firefox and Chrome - behaved as expected - no error.

Repeated on Mac 10.11.3:

  • Chrome and Firefox - behaved as expected - no error.
    Safari and received same 404 errors as Petr did before - see screenshots.
    Resolved with refresh as before.

webclient

webclient

@gusferguson
Copy link
Copy Markdown

@will-moore @pwalczysko

Interestingly - I went back to Safari to test the next PR and did a browser reload of the web client.
I could not then replicate the error in Safari - so I suspect this may have been some sort of caching issue.

So I would say this behaves as expected and is good to merge all else being ready.

@will-moore
Copy link
Copy Markdown
Member Author

Thanks @gusferguson.
If @chris-allan is happy with the test coverage, then would be good to merge so I can fix conflicts with #4534

@will-moore will-moore mentioned this pull request Mar 25, 2016
@will-moore will-moore mentioned this pull request Apr 4, 2016
@will-moore
Copy link
Copy Markdown
Member Author

I'd really like to get this merged so I can work on the Copy / Cut ticket in a new PR. cc @jburel

@chris-allan
Copy link
Copy Markdown
Member

Happy for now until we fully refactor api_links() to aid testability and and add coverage to as much of the result as possible.

@jburel
Copy link
Copy Markdown
Member

jburel commented Apr 20, 2016

Thanks all. Merging

@jburel jburel merged commit 20aa573 into ome:develop Apr 20, 2016
@jburel jburel added this to the 5.2.3 milestone May 4, 2016
@will-moore will-moore deleted the tag_tree_actions branch February 18, 2019 04:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants