Skip to content

allow group named "0" to be deleted #29310

Merged
individual-it merged 2 commits into
masterfrom
fix-grpname-0
Oct 20, 2017
Merged

allow group named "0" to be deleted #29310
individual-it merged 2 commits into
masterfrom
fix-grpname-0

Conversation

@individual-it

Copy link
Copy Markdown
Member

Description

allow a group that is called 0 to be deleted in the UI
additionally some basic UI tests to delete groups

Related Issue

#29051

Motivation and Context

see issue

How Has This Been Tested?

  • manual testing in FF & Chrome
  • made automatic UI tests
  • run new UI tests in FF and Chrome

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

@phil-davis phil-davis left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggestion for enhancing the test scenario.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

setUp or setup?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

s/theseGroupsShouldNotExists/theseGroupsShouldNotExist/

Comment thread tests/ui/features/other/users.feature Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The scenario could also add some groups that are not deleted, and check that they are still listed and still exist at the end. That will help confirm that the delete buttons on the UI do delete the expected group, and not some random group 1 above or below the button, for example.

@codecov

codecov Bot commented Oct 20, 2017

Copy link
Copy Markdown

Codecov Report

Merging #29310 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff            @@
##             master   #29310   +/-   ##
=========================================
  Coverage     59.59%   59.59%           
  Complexity    17170    17170           
=========================================
  Files          1029     1029           
  Lines         57239    57239           
=========================================
  Hits          34113    34113           
  Misses        23126    23126

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 009683c...9cf6f17. Read the comment docs.

@individual-it

Copy link
Copy Markdown
Member Author

fixed the typos and wrote some more tests

@PVince81 PVince81 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

👍 for the JS changes, not sure about the UI tests

var $li = $userGroupList.find('.isgroup:last-child').clone();
$li
.data('gid', gid)
.attr('data-gid', gid)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

not sure if needed. Setting the data isn't the problem, it's reading that would cause auto-parse-datatype when using .data.

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.

it gives funny visual problems without, as it only clones the last li and the attr stays the same as in the last li.
Without this change, if you select the group you just created it looks like that (just created "aaa"):
screenshot-2017-10-20 users - owncloud

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Yeah, I think the .data() will store the properties in a hidden place while .attr() makes it visible on the DOM.


getElementGID: function (element) {
return ($(element).closest('li').data('gid') || '').toString();
return ($(element).closest('li').attr('data-gid') || '').toString();

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

👍

@individual-it individual-it merged commit 2afc3e2 into master Oct 20, 2017
@individual-it individual-it deleted the fix-grpname-0 branch October 20, 2017 10:29
@individual-it

Copy link
Copy Markdown
Member Author

@PVince81 backport the fix or only the tests that would work in stable10?

@PVince81

Copy link
Copy Markdown
Contributor

@individual-it both please

@phil-davis

Copy link
Copy Markdown
Contributor

backport stable10 #29323

@lock

lock Bot commented Aug 2, 2019

Copy link
Copy Markdown

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock Bot locked as resolved and limited conversation to collaborators Aug 2, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants