mirror of
https://github.com/documize/community.git
synced 2025-08-02 20:15:26 +02:00
upgraded Ember and integrated Bootstrap 4
Upgraded to Ember JS 2.16.x release. This upgrade uses the new JavaScript modules API syntax. Integrated Bootstrap 4 Beta 2 via package.json and associated popper.js library. Overridden Bootstrap styles using bootstrap.scss -- this file selectively imports the modules we need.
This commit is contained in:
parent
0f04be4ea1
commit
b31ab712c1
229 changed files with 1610 additions and 3181 deletions
|
@ -9,14 +9,12 @@
|
|||
//
|
||||
// https://documize.com
|
||||
|
||||
import Ember from 'ember';
|
||||
import { registerAsyncHelper } from '@ember/test';
|
||||
|
||||
import { merge } from '@ember/polyfills';
|
||||
import { authenticateSession } from 'documize/tests/helpers/ember-simple-auth';
|
||||
|
||||
const {
|
||||
merge
|
||||
} = Ember;
|
||||
|
||||
export default Ember.Test.registerAsyncHelper('authenticateUser', function (app, attrs = {}) {
|
||||
export default registerAsyncHelper('authenticateUser', function (app, attrs = {}) {
|
||||
authenticateSession(app, merge({
|
||||
token: "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJkb21haW4iOiIiLCJleHAiOjE0NjQwMjM2NjcsImlzcyI6IkRvY3VtaXplIiwib3JnIjoiVnpNdXlFd18zV3FpYWZjRCIsInN1YiI6IndlYmFwcCIsInVzZXIiOiJWek11eUV3XzNXcWlhZmNFIn0.NXZ6bo8mtvdZF_b9HavbidVUJqhmBA1zr0fSAPvbah0",
|
||||
user: {
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import Ember from 'ember';
|
||||
import { run } from '@ember/runloop';
|
||||
|
||||
export default function destroyApp(application) {
|
||||
Ember.run(application, 'destroy');
|
||||
run(application, 'destroy');
|
||||
}
|
||||
|
|
|
@ -1,10 +1,8 @@
|
|||
import { resolve } from 'rsvp';
|
||||
import { module } from 'qunit';
|
||||
import Ember from 'ember';
|
||||
import startApp from '../helpers/start-app';
|
||||
import destroyApp from '../helpers/destroy-app';
|
||||
|
||||
const { RSVP: { resolve } } = Ember;
|
||||
|
||||
export default function(name, options = {}) {
|
||||
module(name, {
|
||||
beforeEach() {
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
import Ember from 'ember';
|
||||
import { run } from '@ember/runloop';
|
||||
import { merge } from '@ember/polyfills';
|
||||
import Application from '../../app';
|
||||
import config from '../../config/environment';
|
||||
import './stub-audit';
|
||||
|
@ -11,10 +12,10 @@ import './authenticate-user';
|
|||
export default function startApp(attrs) {
|
||||
let application;
|
||||
|
||||
let attributes = Ember.merge({}, config.APP);
|
||||
attributes = Ember.merge(attributes, attrs); // use defaults, but you can override;
|
||||
let attributes = merge({}, config.APP);
|
||||
attributes = merge(attributes, attrs); // use defaults, but you can override;
|
||||
|
||||
Ember.run(() => {
|
||||
run(() => {
|
||||
application = Application.create(attributes);
|
||||
application.setupForTesting();
|
||||
application.injectTestHelpers();
|
||||
|
|
|
@ -9,11 +9,13 @@
|
|||
//
|
||||
// https://documize.com
|
||||
|
||||
import Ember from 'ember';
|
||||
import { registerAsyncHelper } from '@ember/test';
|
||||
|
||||
import Service, { inject as service } from '@ember/service';
|
||||
// import netUtil from 'documize/utils/net';
|
||||
|
||||
const Audit = Ember.Service.extend({
|
||||
sessionService: Ember.inject.service('session'),
|
||||
const Audit = Service.extend({
|
||||
sessionService: service('session'),
|
||||
ready: false,
|
||||
enabled: true,
|
||||
|
||||
|
@ -47,6 +49,6 @@ const Audit = Ember.Service.extend({
|
|||
},
|
||||
});
|
||||
|
||||
export default Ember.Test.registerAsyncHelper('stubAudit', function (app, test, attrs = {}) {
|
||||
export default registerAsyncHelper('stubAudit', function (app, test, attrs = {}) {
|
||||
test.register('service:audit', Audit.extend(attrs));
|
||||
});
|
|
@ -9,9 +9,11 @@
|
|||
//
|
||||
// https://documize.com
|
||||
|
||||
import Ember from 'ember';
|
||||
import { registerAsyncHelper } from '@ember/test';
|
||||
|
||||
const userNotification = Ember.Component.extend({
|
||||
import Component from '@ember/component';
|
||||
|
||||
const userNotification = Component.extend({
|
||||
notifications: [],
|
||||
|
||||
didInsertElement() {
|
||||
|
@ -27,6 +29,6 @@ const userNotification = Ember.Component.extend({
|
|||
}
|
||||
});
|
||||
|
||||
export default Ember.Test.registerAsyncHelper('stubUserNotification', function (app, test, attrs = {}) {
|
||||
export default registerAsyncHelper('stubUserNotification', function (app, test, attrs = {}) {
|
||||
test.register('component:userNotification', userNotification.extend(attrs));
|
||||
});
|
|
@ -9,9 +9,9 @@
|
|||
//
|
||||
// https://documize.com
|
||||
|
||||
import Ember from 'ember';
|
||||
import { registerAsyncHelper } from '@ember/test';
|
||||
|
||||
export default Ember.Test.registerAsyncHelper('userLogin', function () {
|
||||
export default registerAsyncHelper('userLogin', function () {
|
||||
visit('/auth/login');
|
||||
|
||||
fillIn('#authEmail', 'brizdigital@gmail.com');
|
||||
|
|
|
@ -9,7 +9,10 @@
|
|||
//
|
||||
// https://documize.com
|
||||
|
||||
import Ember from 'ember';
|
||||
import { Promise as EmberPromise } from 'rsvp';
|
||||
|
||||
import { registerAsyncHelper } from '@ember/test';
|
||||
import { later } from '@ember/runloop';
|
||||
|
||||
function isVisible(selector) {
|
||||
return $(selector).length > 0;
|
||||
|
@ -19,14 +22,14 @@ function checkVisibility(selector, interval, resolve, visibility) {
|
|||
if (isVisible(selector) === visibility) {
|
||||
resolve($(selector));
|
||||
} else {
|
||||
Ember.run.later(null, function () {
|
||||
later(null, function () {
|
||||
checkVisibility(selector, interval, resolve, visibility);
|
||||
}, interval);
|
||||
}
|
||||
}
|
||||
|
||||
export default Ember.Test.registerAsyncHelper('waitToAppear', function (app, selector, interval = 200) {
|
||||
return new Ember.RSVP.Promise(function (resolve) {
|
||||
export default registerAsyncHelper('waitToAppear', function (app, selector, interval = 200) {
|
||||
return new EmberPromise(function (resolve) {
|
||||
checkVisibility(selector, interval, resolve, true);
|
||||
});
|
||||
});
|
|
@ -9,7 +9,10 @@
|
|||
//
|
||||
// https://documize.com
|
||||
|
||||
import Ember from 'ember';
|
||||
import { Promise as EmberPromise } from 'rsvp';
|
||||
|
||||
import { registerAsyncHelper } from '@ember/test';
|
||||
import { later } from '@ember/runloop';
|
||||
|
||||
function isVisible(selector) {
|
||||
return $(selector).length > 0;
|
||||
|
@ -19,14 +22,14 @@ function checkVisibility(selector, interval, resolve, visibility) {
|
|||
if (isVisible(selector) === visibility) {
|
||||
resolve($(selector));
|
||||
} else {
|
||||
Ember.run.later(null, function () {
|
||||
later(null, function () {
|
||||
checkVisibility(selector, interval, resolve, visibility);
|
||||
}, interval);
|
||||
}
|
||||
}
|
||||
|
||||
export default Ember.Test.registerAsyncHelper('waitToDisappear', function (app, selector, interval = 200) {
|
||||
return new Ember.RSVP.Promise(function (resolve) {
|
||||
export default registerAsyncHelper('waitToDisappear', function (app, selector, interval = 200) {
|
||||
return new EmberPromise(function (resolve) {
|
||||
checkVisibility(selector, interval, resolve, false);
|
||||
});
|
||||
});
|
Loading…
Add table
Add a link
Reference in a new issue