versionone / VersionOne.Client.VisualStudio

View and update VersionOne work items directly from Visual Studio
http://versionone.github.io/VersionOne.Client.VisualStudio
BSD 3-Clause "New" or "Revised" License
2 stars 10 forks source link

Right click over some nodes makes the plugin crash. #7

Closed lremedi closed 10 years ago

lremedi commented 11 years ago

Right click over some nodes of the tree, makes crash the plugin and VS. This issue was present before upgrading version of TreeViewNode.

davidhaimovich commented 10 years ago

When the popup is opened, the application checks if the story/defect owners belong to the logged in user (in the isMine() method). If not, it disables the popup item "-Signup".

    public bool IsMine() {
        var owners = (PropertyValues)GetProperty(OwnersProperty);
        return owners.ContainsOid(DataLayer.MemberOid);
    }

When tries to get the owners of the story/defect, it invokes this code:

        public virtual object GetProperty(string propertyName) {

        if (propertyName == EffortProperty) {
            return EntityContainer.GetEffort(this);
        }

        var attribute = Asset.Attributes[TypePrefix + '.' + propertyName];
        var allValues = GetPropertyValues(propertyName);

        if (attribute.Definition.IsMultiValue) {
            var currentValues = attribute.Values;
            return allValues == null ? currentValues : allValues.Subset(attribute.Values);
        }

        var value = attribute.Value;

        if (value is Oid) {
            return allValues == null ? value : allValues.Find((Oid)value);
        }

        return value;
        }

Because the owners of the story/defect (attribute) is not in the allValues list (all owners), an KeyNotFoundException is thrown.

The question is : why the owner is not present in allValues list? If is not present should we catch the exception, and return false in the isMine() method?

JogoShugh commented 10 years ago

Under debug we determined so far:

JogoShugh commented 10 years ago

@morrica01 says:

Question: Should user be able to edit an existing item and resave it when the owner is inactive?

Carlena Notes:

ibuchanan commented 10 years ago

There seem to be multiple scenarios packed into all of this:

Given a Member named "Ian Inactivated",
And a Story named "Story with Inactivated Member" with "Ian Inactivated" as the Owner,
And "Ian Inactivated" has been Inactivated,

When I look at "Story with Inactivated Member"
Then ...

When I open the Owner drop-down for "Story with Inactivated Member"
Then ...

When I try to save a change to "Story with Inactivated Member"
Then ...

When I try to sign up for "Story with Inactivated Member"
Then ...
ibuchanan commented 10 years ago

For release notes...

Fixed: Inactivated owner now shown with strike-through. Context menu now available for items with inactivated members.

davidhaimovich commented 10 years ago

Inactive user will be shown in the owners combo selector only when is already assigned to the asset. If not, no inactive users should be shown there.

notes:

davidhaimovich commented 10 years ago

We could show the inactive user in the node and, the active users in the combo. We could set as strikeout the inactive user in the node.

¿What happens if in the node we have one active and one inactive user? Now, it is setting both as strikeout:

Image as example: image

ibuchanan commented 10 years ago

Q: What happens when we have one active and one inactive Member? A: In the web application, only the inactivate Member has strike-through. The active user is shown normally.

davidhaimovich commented 10 years ago

One solution is to add "-" after and before the user name when is inactive: e.g. image

JogoShugh commented 10 years ago

Needs more amigos review :) Questions on user-value of the "-" approach. Explore more options.

davidhaimovich commented 10 years ago

Notes:

ibuchanan commented 10 years ago

Examples of Inactive Members in Owners List

ianb and joe are inactive Members. josh is an active Member.

One Inactive Member

(Inactive: ianb), josh

Multiple Inactive Members

(Inactive: ianb), josh, (Inactive: joe)

Showing Inactive Members in Dropdown

(Inactive: ianb) josh (Inactive: joe)

davidhaimovich commented 10 years ago

image

davidhaimovich commented 10 years ago

Test Steps: