Skip to content

feat(schematics): create drag-drop schematic #13368

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 1 commit into from
Oct 4, 2018

Conversation

devversion
Copy link
Member

  • Creates a CDK schematic that can be used to generate a component that uses the CDK Drag & Drop module. The code is based on the sorting example of the drag-drop (just a bit trimmed to keep the code simple)

@devversion devversion added pr: merge safe target: major This PR is targeted for the next major release labels Sep 30, 2018
@googlebot googlebot added the cla: yes PR author has agreed to Google's Contributor License Agreement label Sep 30, 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.

LGTM

0 3px 14px 2px rgba(0, 0, 0, 0.12);
}

/* Items that are being dropped should not show up twice. */
Copy link
Member

Choose a reason for hiding this comment

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

I think we can drop this comment. It's up to the consumer whether they want the placeholder to show up.

Copy link
Member Author

Choose a reason for hiding this comment

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

I agree, will change.


beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ <%= classify(name) %>Component ],
Copy link
Member

Choose a reason for hiding this comment

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

Isn't this going to end up with extra space inside the square brackets? E.g. [ MyComponent ].

Copy link
Member Author

Choose a reason for hiding this comment

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

expect(tree.files).toContain('/projects/material/src/app/foo/foo.component.scss');
});

it('should fallback to the @schematics/angular:component option value', () => {
Copy link
Member

Choose a reason for hiding this comment

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

fallback -> fall back. Same goes for some of the other tests.

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah, we basically have this in other test files as well. I will fix this one here, but have a follow-up for the other spec files.

<div class="container">
<h2>To do</h2>

<cdk-drop #todoList [data]="todo" [connectedTo]="[doneList]" class="list" (dropped)="drop($event)">
Copy link
Member

Choose a reason for hiding this comment

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

The connectedTo accepts a single reference as well: [connectedTo]="doneList".

Copy link
Member Author

@devversion devversion Sep 30, 2018

Choose a reason for hiding this comment

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

I've basically taken this from your example on material.angular.io. What's your preference?

Copy link
Member

Choose a reason for hiding this comment

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

I'd say passing in the single one since it's a bit cleaner.

@devversion devversion force-pushed the feat/schematics-drag-drop- branch from e048e8a to f93e523 Compare September 30, 2018 19:09
@devversion devversion added the action: merge The PR is ready for merge by the caretaker label Sep 30, 2018
@devversion devversion force-pushed the feat/schematics-drag-drop- branch from f93e523 to 12fcd39 Compare September 30, 2018 20:20
Copy link
Member

@jelbourn jelbourn left a comment

Choose a reason for hiding this comment

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

LGTM

@ngbot
Copy link

ngbot bot commented Oct 3, 2018

Hi @devversion! This PR has merge conflicts due to recent upstream merges.
Please help to unblock it by resolving these conflicts. Thanks!

* Creates a CDK schematic that can be used to generate a component that uses the CDK Drag & Drop module. The code is based on the `sorting` example of the drag-drop (just a bit trimmed to keep the code simple)
@devversion devversion force-pushed the feat/schematics-drag-drop- branch from 12fcd39 to 4206e6e Compare October 4, 2018 15:39
@vivian-hu-zz vivian-hu-zz merged commit 72ccd8b into angular:master Oct 4, 2018
@devversion devversion deleted the feat/schematics-drag-drop- branch October 4, 2018 18:55
roboshoes pushed a commit to roboshoes/material2 that referenced this pull request Oct 23, 2018
* Creates a CDK schematic that can be used to generate a component that uses the CDK Drag & Drop module. The code is based on the `sorting` example of the drag-drop (just a bit trimmed to keep the code simple)
@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 9, 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: major This PR is targeted for the next major release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants