Skip to content

feat(drag-utils): add utility function for cloning array items from one array to another #13743

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

Merged
merged 5 commits into from
Oct 25, 2018

Conversation

nayfin
Copy link
Contributor

@nayfin nayfin commented Oct 22, 2018

creates a utility helper for cloning an array item into the array of the drop container
compliments moveItemInArray and transferArrayItem

partially closes #13100 a fix for the UI aspect of this issue will be submitted in the next day or two

…ne array to another

creates a utility helper for cloning an array item into the array of the drop container
compliments moveItemInArray and transferArrayItem

partially closes angular#13100
@googlebot googlebot added the cla: yes PR author has agreed to Google's Contributor License Agreement label Oct 22, 2018
Copy link
Member

@crisbeto crisbeto left a comment

Choose a reason for hiding this comment

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

The package-lock should be removed since we're using Yarn.

* @param currentIndex Index of the item in its current array.
* @param targetIndex Index at which to insert the item.
*
* PR NOTE: I followed the pattern of the other two functions here. It would be simpler and more
Copy link
Member

Choose a reason for hiding this comment

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

Remove this note.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done, what do you think about the change in implementation the note suggested, passing the array element (currentElement) instead of passing currentIndex and currentArray?

Copy link
Contributor Author

@nayfin nayfin left a comment

Choose a reason for hiding this comment

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

I made all recommended changes. The only open item is whether to change implementation to pass currentElement instead of currentIndex and currentArray to the function. I'll resubmit and change if requested.

…ne array to another

resolves issues surfaced from code review
…ne array to another

cuts extra space between parens
Copy link
Member

@crisbeto crisbeto left a comment

Choose a reason for hiding this comment

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

LGTM

@crisbeto crisbeto added pr: lgtm action: merge The PR is ready for merge by the caretaker target: patch This PR is targeted for the next patch release labels Oct 24, 2018
@mmalerba mmalerba merged commit d2d8a1f into angular:master Oct 25, 2018
mmalerba pushed a commit that referenced this pull request Oct 26, 2018
…ne array to another (#13743)

* feat(drag-utils): add utility function for cloning array items from one array to another

creates a utility helper for cloning an array item into the array of the drop container
compliments moveItemInArray and transferArrayItem

partially closes #13100

* feat(drag-utils): add utility function for cloning array items from one array to another

resolves issues surfaced from code review

* feat(drag-utils): add utility function for cloning array items from one array to another

cuts extra space between parens

* removes link in comments, and clarifies function definition as recommended in review

* resolves nits
@nayfin nayfin deleted the clone-item-to-list branch October 28, 2018 01:34
atscott pushed a commit to atscott/components that referenced this pull request Nov 5, 2018
…ne array to another (angular#13743)

* feat(drag-utils): add utility function for cloning array items from one array to another

creates a utility helper for cloning an array item into the array of the drop container
compliments moveItemInArray and transferArrayItem

partially closes angular#13100

* feat(drag-utils): add utility function for cloning array items from one array to another

resolves issues surfaced from code review

* feat(drag-utils): add utility function for cloning array items from one array to another

cuts extra space between parens

* removes link in comments, and clarifies function definition as recommended in review

* resolves nits
@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 10, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
action: merge The PR is ready for merge by the caretaker cla: yes PR author has agreed to Google's Contributor License Agreement target: patch This PR is targeted for the next patch release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

cdk-drop: allow drag-and-drop copy behavior
4 participants