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

Deprecate use of components - SortableGroup, SortableItem and SortableHandle #444

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions addon/components/sortable-group.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import {
isRightArrowKey,
} from '../utils/keyboard';
import { ANNOUNCEMENT_ACTION_TYPES } from '../utils/constant';
import { deprecate } from '@ember/debug';

const a = A;
const NO_MODEL = {};
Expand Down Expand Up @@ -130,6 +131,20 @@ export default Component.extend({
init() {
this._super(...arguments);

deprecate(
'The <SortableGroup> component is deprecated. Please use the modifier version {{sortable-group}}.',
false,
{
id: 'ember-sortable:sortable-group-component-deprecated',
until: '3.0.0',
for: 'ember-sortable',
since: {
available: '2.2.6',
enabled: '2.2.6',
},
}
);

this._setGetterSetters();
this.set('moves', []);
},
Expand Down
19 changes: 19 additions & 0 deletions addon/components/sortable-handle.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import Component from '@ember/component';
import { deprecate } from '@ember/debug';

/**
* This component represents the handle of a `sortable-item`.
Expand All @@ -8,4 +9,22 @@ export default Component.extend({
role: 'button',
attributeBindings: ["dataSortableHandle:data-sortable-handle", "tabindex", "role"],
dataSortableHandle: true,

init() {
this._super(...arguments);

deprecate(
'The <SortableHandle> component is deprecated. Please use the modifier version {{sortable-handle}}.',
false,
{
id: 'ember-sortable:sortable-handle-component-deprecated',
until: '3.0.0',
for: 'ember-sortable',
since: {
available: '2.2.6',
enabled: '2.2.6',
},
}
);
},
});
16 changes: 16 additions & 0 deletions addon/components/sortable-item.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ import { DRAG_ACTIONS, ELEMENT_CLICK_ACTION, END_ACTIONS } from '../utils/consta
import { getX, getY } from '../utils/coordinate';
import { buildWaiter } from '@ember/test-waiters';
import config from 'ember-get-config';
import { deprecate } from '@ember/debug';

const { environment } = config;
const isTesting = environment === 'test';

Expand Down Expand Up @@ -158,6 +160,20 @@ export default Component.extend({

init() {
this._super(...arguments);

deprecate(
'The <SortableItem> component is deprecated. Please use the modifier version {{sortable-item}}.',
false,
{
id: 'ember-sortable:sortable-item-component-deprecated',
until: '3.0.0',
for: 'ember-sortable',
since: {
available: '2.2.6',
enabled: '2.2.6',
},
}
);
this._setGetterSetters();
},

Expand Down