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

Removed classic layout and ember-decorators #409

Merged
merged 5 commits into from
Dec 2, 2024
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
7 changes: 3 additions & 4 deletions addon/components/basic-dialog.js
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
import { tagName, layout as templateLayout } from '@ember-decorators/component';
import { computed, set } from '@ember/object';
import { inject as service } from '@ember/service';
import Component from '@ember/component';
import { isEmpty } from '@ember/utils';
import layout from '../templates/components/basic-dialog';
import { dasherize } from '@ember/string';

import { isIOS, clickHandlerDelay } from '../utils/config-utils';

@tagName('')
@templateLayout(layout)
export default class BasicDialog extends Component {
tagName = '';

containerClassNames = null;
overlayClassNames = null;
wrapperClassNames = null;
Expand Down
6 changes: 2 additions & 4 deletions addon/components/in-place-dialog.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
import { tagName, layout as templateLayout } from '@ember-decorators/component';
import Component from '@ember/component';
import layout from '../templates/components/in-place-dialog';

@tagName('')
@templateLayout(layout)
export default class InPlaceDialog extends Component {
tagName = '';

get containerClassNamesString() {
const addonClassNamesString = [
'ember-modal-dialog',
Expand Down
3 changes: 0 additions & 3 deletions addon/components/liquid-dialog.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
import { layout as templateLayout } from '@ember-decorators/component';
import BasicDialog from './basic-dialog';
import layout from '../templates/components/liquid-dialog';

@templateLayout(layout)
export default class LiquidDialog extends BasicDialog {
hasOverlay = true;
variantWrapperClass = 'emd-animatable';
Expand Down
4 changes: 1 addition & 3 deletions addon/components/liquid-tether-dialog.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
/* eslint-disable ember/no-computed-properties-in-native-classes */
import { layout as templateLayout } from '@ember-decorators/component';
import { computed, set } from '@ember/object';
import { dasherize } from '@ember/string';

import BasicDialog from './basic-dialog';
import layout from '../templates/components/liquid-tether-dialog';

@templateLayout(layout)
export default class LiquidTetherDialog extends BasicDialog {
@computed('targetAttachment')
get targetAttachmentClass() {
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import Component from '@glimmer/component';
import { isIOS } from '../../utils/config-utils';
import { htmlSafe } from '@ember/template';

import { isIOS } from '../utils/config-utils';

export default class OverlayComponent extends Component {
get cssClasses() {
return htmlSafe(`emd-debug ${isIOS ? 'pointer-cursor' : ''}`);
Expand Down
1 change: 1 addition & 0 deletions addon/components/positioned-container.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import Component from '@ember/component';
import { capitalize } from '@ember/string';
import { observer, computed } from '@ember/object';
import { on } from '@ember/object/evented';

const SUPPORTED_TARGET_ATTACHMENTS = [
'top',
'right',
Expand Down
4 changes: 1 addition & 3 deletions addon/components/tether-dialog.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
import { layout as templateLayout } from '@ember-decorators/component';
import { computed, set } from '@ember/object';
import { dasherize } from '@ember/string';

import BasicDialog from './basic-dialog';
import layout from '../templates/components/tether-dialog';

@templateLayout(layout)
export default class TetherDialog extends BasicDialog {
init() {
super.init(...arguments);
Expand Down
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@
"ember-cli-babel": "^8.2.0",
"ember-cli-htmlbars": "^6.3.0",
"ember-cli-version-checker": "^5.1.2",
"ember-decorators": "^6.1.1",
"ember-wormhole": "^0.6.0"
},
"devDependencies": {
Expand Down
3 changes: 0 additions & 3 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import { module, test } from 'qunit';
import { setupRenderingTest } from 'ember-qunit';
import { render } from '@ember/test-helpers';
import { hbs } from 'ember-cli-htmlbars';

module(
'Integration | Component | ember-modal-dialog-positioned-container',
function (hooks) {
setupRenderingTest(hooks);

test('it renders', async function (assert) {
await render(hbs`
<EmberModalDialogPositionedContainer>
Hello world!
</EmberModalDialogPositionedContainer>
`);

assert.dom().hasText('Hello world!');
});
},
);
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import { module, test } from 'qunit';
import { setupRenderingTest } from 'ember-qunit';
import { render } from '@ember/test-helpers';
import { hbs } from 'ember-cli-htmlbars';

module(
'Integration | Component | ember-modal-dialog/-basic-dialog',
function (hooks) {
setupRenderingTest(hooks);

test('it renders', async function (assert) {
await render(hbs`
<EmberModalDialog::-BasicDialog>
Hello world!
</EmberModalDialog::-BasicDialog>
`);

assert.dom().hasText('Hello world!');
});
},
);
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import { module, test } from 'qunit';
import { setupRenderingTest } from 'ember-qunit';
import { render } from '@ember/test-helpers';
import { hbs } from 'ember-cli-htmlbars';

module(
'Integration | Component | ember-modal-dialog/-in-place-dialog',
function (hooks) {
setupRenderingTest(hooks);

test('it renders', async function (assert) {
await render(hbs`
<EmberModalDialog::-InPlaceDialog>
Hello world!
</EmberModalDialog::-InPlaceDialog>
`);

assert.dom().hasText('Hello world!');
});
},
);
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import { module, test } from 'qunit';
import { setupRenderingTest } from 'ember-qunit';
import { render } from '@ember/test-helpers';
import { hbs } from 'ember-cli-htmlbars';

module(
'Integration | Component | ember-modal-dialog/-liquid-dialog',
function (hooks) {
setupRenderingTest(hooks);

test('it renders', async function (assert) {
await render(hbs`
<EmberModalDialog::-LiquidDialog>
Hello world!
</EmberModalDialog::-LiquidDialog>
`);

assert.dom().hasText('Hello world!');
});
},
);
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import { module, test } from 'qunit';
import { setupRenderingTest } from 'ember-qunit';
import { render } from '@ember/test-helpers';
import { hbs } from 'ember-cli-htmlbars';

module(
'Integration | Component | ember-modal-dialog/-liquid-tether-dialog',
function (hooks) {
setupRenderingTest(hooks);

test('it renders', async function (assert) {
await render(hbs`
<EmberModalDialog::-LiquidTetherDialog
@tetherTarget="body"
>
Hello world!
</EmberModalDialog::-LiquidTetherDialog>
`);

assert.dom().hasText('Hello world!');
});
},
);
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import { module, test } from 'qunit';
import { setupRenderingTest } from 'ember-qunit';
import { render } from '@ember/test-helpers';
import { hbs } from 'ember-cli-htmlbars';

module(
'Integration | Component | ember-modal-dialog/-tether-dialog',
function (hooks) {
setupRenderingTest(hooks);

test('it renders', async function (assert) {
await render(hbs`
<EmberModalDialog::-TetherDialog>
Hello world!
</EmberModalDialog::-TetherDialog>
`);

assert.dom().hasText('Hello world!');
});
},
);
19 changes: 19 additions & 0 deletions tests/integration/components/ember-modal-dialog/overlay-test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import { module, test } from 'qunit';
import { setupRenderingTest } from 'ember-qunit';
import { render } from '@ember/test-helpers';
import { hbs } from 'ember-cli-htmlbars';

module(
'Integration | Component | ember-modal-dialog/overlay',
function (hooks) {
setupRenderingTest(hooks);

test('it renders', async function (assert) {
await render(hbs`
<EmberModalDialog::Overlay />
`);

assert.ok(true);
});
},
);
16 changes: 16 additions & 0 deletions tests/integration/components/modal-dialog-test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import { module, test } from 'qunit';
import { setupRenderingTest } from 'ember-qunit';
import { render } from '@ember/test-helpers';
import { hbs } from 'ember-cli-htmlbars';

module('Integration | Component | modal-dialog', function (hooks) {
setupRenderingTest(hooks);

test('it renders', async function (assert) {
await render(hbs`
<ModalDialog />
`);

assert.ok(true);
});
});