Flatten nested components (#854)

no issue
- the upcoming Module Unification re-organisation in Ember will no longer support nested components
- this PR pre-emptively moves our usage of nested components into a flat file structure
This commit is contained in:
Kevin Ansfield 2017-09-11 08:41:17 +01:00 committed by Aileen Nowak
parent 8362f0cdf0
commit 9ed5aad186
49 changed files with 48 additions and 48 deletions

View File

@ -15,7 +15,7 @@ const FullScreenModalComponent = Component.extend({
dropdown: injectService(),
modalPath: computed('modal', function () {
return `modals/${this.get('modal') || 'unknown'}`;
return `modal-${this.get('modal') || 'unknown'}`;
}),
modalClasses: computed('modifiers', function () {

View File

@ -1,4 +1,4 @@
import ModalComponent from 'ghost-admin/components/modals/base';
import ModalComponent from 'ghost-admin/components/modal-base';
import {alias} from '@ember/object/computed';
export default ModalComponent.extend({

View File

@ -1,4 +1,4 @@
import ModalComponent from 'ghost-admin/components/modals/base';
import ModalComponent from 'ghost-admin/components/modal-base';
import {inject as injectService} from '@ember/service';
import {task} from 'ember-concurrency';

View File

@ -1,4 +1,4 @@
import ModalComponent from 'ghost-admin/components/modals/base';
import ModalComponent from 'ghost-admin/components/modal-base';
import {alias} from '@ember/object/computed';
import {inject as injectService} from '@ember/service';
import {task} from 'ember-concurrency';

View File

@ -1,4 +1,4 @@
import ModalComponent from 'ghost-admin/components/modals/base';
import ModalComponent from 'ghost-admin/components/modal-base';
import {alias} from '@ember/object/computed';
import {invokeAction} from 'ember-invoke-action';
import {task} from 'ember-concurrency';

View File

@ -1,4 +1,4 @@
import ModalComponent from 'ghost-admin/components/modals/base';
import ModalComponent from 'ghost-admin/components/modal-base';
import {alias} from '@ember/object/computed';
import {computed} from '@ember/object';
import {invokeAction} from 'ember-invoke-action';

View File

@ -1,4 +1,4 @@
import ModalComponent from 'ghost-admin/components/modals/base';
import ModalComponent from 'ghost-admin/components/modal-base';
import {alias} from '@ember/object/computed';
import {invokeAction} from 'ember-invoke-action';
import {task} from 'ember-concurrency';

View File

@ -1,4 +1,4 @@
import ModalComponent from 'ghost-admin/components/modals/base';
import ModalComponent from 'ghost-admin/components/modal-base';
import {alias} from '@ember/object/computed';
import {invokeAction} from 'ember-invoke-action';
import {task} from 'ember-concurrency';

View File

@ -1,4 +1,4 @@
import ModalComponent from 'ghost-admin/components/modals/base';
import ModalComponent from 'ghost-admin/components/modal-base';
import ghostPaths from 'ghost-admin/utils/ghost-paths';
import {computed} from '@ember/object';
import {invokeAction} from 'ember-invoke-action';

View File

@ -1,4 +1,4 @@
import ModalComponent from 'ghost-admin/components/modals/base';
import ModalComponent from 'ghost-admin/components/modal-base';
import RSVP from 'rsvp';
import ValidationEngine from 'ghost-admin/mixins/validation-engine';
import {A as emberA} from '@ember/array';

View File

@ -1,4 +1,4 @@
import ModalComponent from 'ghost-admin/components/modals/base';
import ModalComponent from 'ghost-admin/components/modal-base';
import {invokeAction} from 'ember-invoke-action';
export default ModalComponent.extend({

View File

@ -0,0 +1,4 @@
import ModalComponent from 'ghost-admin/components/modal-base';
export default ModalComponent.extend({
});

View File

@ -1,4 +1,4 @@
import ModalComponent from 'ghost-admin/components/modals/base';
import ModalComponent from 'ghost-admin/components/modal-base';
import {A as emberA} from '@ember/array';
import {isInvalidError} from 'ember-ajax/errors';
import {task} from 'ember-concurrency';

View File

@ -1,5 +1,5 @@
import $ from 'jquery';
import ModalComponent from 'ghost-admin/components/modals/base';
import ModalComponent from 'ghost-admin/components/modal-base';
import ValidationEngine from 'ghost-admin/mixins/validation-engine';
import {computed} from '@ember/object';
import {htmlSafe} from '@ember/string';

View File

@ -1,4 +1,4 @@
import ModalComponent from 'ghost-admin/components/modals/base';
import ModalComponent from 'ghost-admin/components/modal-base';
import {alias} from '@ember/object/computed';
import {invokeAction} from 'ember-invoke-action';
import {task} from 'ember-concurrency';

View File

@ -1,4 +1,4 @@
import ModalComponent from 'ghost-admin/components/modals/base';
import ModalComponent from 'ghost-admin/components/modal-base';
import {reads} from '@ember/object/computed';
export default ModalComponent.extend({

View File

@ -1,4 +1,4 @@
import ModalComponent from 'ghost-admin/components/modals/base';
import ModalComponent from 'ghost-admin/components/modal-base';
import {invokeAction} from 'ember-invoke-action';
import {task} from 'ember-concurrency';

View File

@ -1,4 +1,4 @@
import ModalComponent from 'ghost-admin/components/modals/base';
import ModalComponent from 'ghost-admin/components/modal-base';
import {alias} from '@ember/object/computed';
import {invokeAction} from 'ember-invoke-action';
import {task} from 'ember-concurrency';

View File

@ -1,4 +1,4 @@
import ModalComponent from 'ghost-admin/components/modals/base';
import ModalComponent from 'ghost-admin/components/modal-base';
import cajaSanitizers from 'ghost-admin/utils/caja-sanitizers';
import {computed} from '@ember/object';
import {inject as injectService} from '@ember/service';

View File

@ -1,4 +1,4 @@
import ModalComponent from 'ghost-admin/components/modals/base';
import ModalComponent from 'ghost-admin/components/modal-base';
import ghostPaths from 'ghost-admin/utils/ghost-paths';
import {
UnsupportedMediaTypeError,
@ -126,7 +126,7 @@ export default ModalComponent.extend({
// to have a proper grouping of fatal errors and none fatal, we need to check
// our errors for the fatal property
if (errors.length > 0) {
if (errors && errors.length > 0) {
for (let i = 0; i < errors.length; i++) {
if (errors[i].fatal) {
fatalErrors.push(errors[i]);

View File

@ -1,4 +0,0 @@
import ModalComponent from 'ghost-admin/components/modals/base';
export default ModalComponent.extend({
});

View File

@ -5,7 +5,7 @@
onopen=(action "onFocus")
onclose=(action "onBlur")
searchEnabled=false
triggerComponent="gh-search-input/trigger"
triggerComponent="gh-search-input-trigger"
renderInPlace=true
loadingMessage="Loading"
as |name select|}}

View File

@ -4,8 +4,8 @@ import {describe, it} from 'mocha';
import {expect} from 'chai';
import {setupComponentTest} from 'ember-mocha';
describe('Integration: Component: modals/delete-subscriber', function() {
setupComponentTest('modals/delete-subscriber', {
describe('Integration: Component: modal-delete-subscriber', function() {
setupComponentTest('modal-delete-subscriber', {
integration: true
});
@ -14,12 +14,12 @@ describe('Integration: Component: modals/delete-subscriber', function() {
// Handle any actions with this.on('myAction', function(val) { ... });
// Template block usage:
// this.render(hbs`
// {{#modals/delete-subscriber}}
// {{#modal-delete-subscriber}}
// template content
// {{/modals/delete-subscriber}}
// {{/modal-delete-subscriber}}
// `);
this.render(hbs`{{modals/delete-subscriber}}`);
this.render(hbs`{{modal-delete-subscriber}}`);
expect(this.$()).to.have.length(1);
});
});

View File

@ -4,8 +4,8 @@ import {describe, it} from 'mocha';
import {expect} from 'chai';
import {setupComponentTest} from 'ember-mocha';
describe('Integration: Component: modals/import-subscribers', function() {
setupComponentTest('modals/import-subscribers', {
describe('Integration: Component: modal-import-subscribers', function() {
setupComponentTest('modal-import-subscribers', {
integration: true
});
@ -14,12 +14,12 @@ describe('Integration: Component: modals/import-subscribers', function() {
// Handle any actions with this.on('myAction', function(val) { ... });
// Template block usage:
// this.render(hbs`
// {{#modals/import-subscribers}}
// {{#modal-import-subscribers}}
// template content
// {{/modals/import-subscribers}}
// {{/modal-import-subscribers}}
// `);
this.render(hbs`{{modals/import-subscribers}}`);
this.render(hbs`{{modal-import-subscribers}}`);
expect(this.$()).to.have.length(1);
});
});

View File

@ -4,8 +4,8 @@ import {describe, it} from 'mocha';
import {expect} from 'chai';
import {setupComponentTest} from 'ember-mocha';
describe('Integration: Component: modals/new-subscriber', function() {
setupComponentTest('modals/new-subscriber', {
describe('Integration: Component: modal-new-subscriber', function() {
setupComponentTest('modal-new-subscriber', {
integration: true
});
@ -14,12 +14,12 @@ describe('Integration: Component: modals/new-subscriber', function() {
// Handle any actions with this.on('myAction', function(val) { ... });
// Template block usage:
// this.render(hbs`
// {{#modals/new-subscriber}}
// {{#modal-new-subscriber}}
// template content
// {{/modals/new-subscriber}}
// {{/modal-new-subscriber}}
// `);
this.render(hbs`{{modals/new-subscriber}}`);
this.render(hbs`{{modal-new-subscriber}}`);
expect(this.$()).to.have.length(1);
});
});

View File

@ -4,8 +4,8 @@ import {describe, it} from 'mocha';
import {expect} from 'chai';
import {setupComponentTest} from 'ember-mocha';
describe('Integration: Component: modals/upload-theme', function() {
setupComponentTest('modals/upload-theme', {
describe('Integration: Component: modal-upload-theme', function() {
setupComponentTest('modal-upload-theme', {
integration: true
});
@ -14,12 +14,12 @@ describe('Integration: Component: modals/upload-theme', function() {
// Handle any actions with this.on('myAction', function(val) { ... });
// Template block usage:
// this.render(hbs`
// {{#modals/upload-theme}}
// {{#modal-upload-theme}}
// template content
// {{/modals/upload-theme}}
// {{/modal-upload-theme}}
// `);
this.render(hbs`{{modals/upload-theme}}`);
this.render(hbs`{{modal-upload-theme}}`);
expect(this.$()).to.have.length(1);
});
});

View File

@ -7,7 +7,7 @@ import {expect} from 'chai';
import {run} from '@ember/runloop';
import {setupComponentTest} from 'ember-mocha';
describe('Integration: Component: modals/transfer-owner', function() {
describe('Integration: Component: modal-transfer-owner', function() {
setupComponentTest('transfer-owner', {
integration: true
});
@ -21,7 +21,7 @@ describe('Integration: Component: modals/transfer-owner', function() {
this.on('confirm', confirm);
this.on('closeModal', closeModal);
this.render(hbs`{{modals/transfer-owner confirm=(action 'confirm') closeModal=(action 'closeModal')}}`);
this.render(hbs`{{modal-transfer-owner confirm=(action 'confirm') closeModal=(action 'closeModal')}}`);
run(() => {
this.$('.gh-btn.gh-btn-red').click();