Skip to content
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

feat: (draghandle) drag handle implementation #79

Merged
merged 3 commits into from
Oct 13, 2021

Conversation

Alessy
Copy link

@Alessy Alessy commented Oct 12, 2021

Drag handle implementation (like cdkDragHandle).
I and a few people wanted this feature, so here it is :)
The only problem is that I don't know how to write test scenarios in ngsg-item.directive.spec.ts

);
});

it('hould create an instance', () => {
Copy link
Owner

Choose a reason for hiding this comment

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

Typo

Copy link
Owner

Choose a reason for hiding this comment

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

should be "should" and not "hould"

this.handleElement = this.handle?.el?.nativeElement || this.el.nativeElement;

fromEvent<DragEvent>(this.handleElement, 'mousedown').pipe(
takeUntil(this.destroy$)
Copy link
Owner

Choose a reason for hiding this comment

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

Very nice 👍 This takeUntil is important!

@nivekcode
Copy link
Owner

Hi @Alessy. Wow. Thx a lot. The changes look good. I left one small comment because of a typo. Would be great if you could fix this typo and then we can merge. Great work 👍

@codecov-commenter
Copy link

Codecov Report

Merging #79 (116f3f5) into master (c570433) will decrease coverage by 0.53%.
The diff coverage is 80.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #79      +/-   ##
==========================================
- Coverage   93.93%   93.40%   -0.54%     
==========================================
  Files           9       10       +1     
  Lines         264      273       +9     
  Branches       25       26       +1     
==========================================
+ Hits          248      255       +7     
- Misses         16       18       +2     
Impacted Files Coverage Δ
...rojects/ng-sortgrid/src/lib/ngsg-item.directive.ts 84.33% <71.42%> (-1.38%) ⬇️
.../ng-sortgrid/src/lib/ngsg-drag-handle.directive.ts 100.00% <100.00%> (ø)

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 c570433...116f3f5. Read the comment docs.

@nivekcode nivekcode merged commit 1b2aff1 into nivekcode:master Oct 13, 2021
@nivekcode
Copy link
Owner

🎉 This PR is included in version 5.2.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

@Alessy Alessy deleted the drag-handle branch October 13, 2021 12:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants