UI: Update to Ember 3.8 LTS (#5968)

This commit is contained in:
Buck Doyle
2019-10-08 13:44:19 -05:00
committed by GitHub
parent 418ec80e41
commit e6c66354d0
13 changed files with 1440 additions and 1078 deletions

2
.gitignore vendored
View File

@@ -86,6 +86,8 @@ rkt-*
/ui/libpeerconnection.log
/ui/npm-debug.log*
/ui/testem.log
/ui/.env*
/ui/.pnp*
.ignore
# ember-try

View File

@@ -33,6 +33,7 @@ module.exports = {
'testem.js',
'blueprints/*/index.js',
'config/**/*.js',
'server/**/*.js',
'lib/*/index.js',
],
parserOptions: {

View File

@@ -78,7 +78,7 @@ export default Watchable.extend({
},
plan(job) {
const jobId = job.get('id');
const jobId = job.get('id') || job.get('_idBeforeSaving');
const store = this.store;
const url = addToPath(this.urlForFindRecord(jobId, 'job'), '/plan');
@@ -105,7 +105,8 @@ export default Watchable.extend({
},
update(job) {
return this.ajax(this.urlForUpdateRecord(job.get('id'), 'job'), 'POST', {
const jobId = job.get('id') || job.get('_idBeforeSaving');
return this.ajax(this.urlForUpdateRecord(jobId, 'job'), 'POST', {
data: {
Job: job.get('_newDefinitionJSON'),
},

View File

@@ -11,7 +11,7 @@ export default Component.extend({
sortProperty: 'modifyIndex',
sortDescending: true,
sortedAllocations: computed('job.allocations.@each.modifyIndex', function() {
return new PromiseArray({
return PromiseArray.create({
promise: this.get('job.allocations').then(allocations =>
allocations
.sortBy('modifyIndex')

View File

@@ -82,14 +82,16 @@ export default Component.extend(WindowResizable, {
});
// Follow the log if the scroll position is near the bottom of the cli window
this.logger.on('tick', () => {
run.scheduleOnce('afterRender', () => this.synchronizeScrollPosition());
});
this.logger.on('tick', this, 'scheduleScrollSynchronization');
yield this.logger.startStreaming();
this.logger.off('tick');
this.logger.off('tick', this, 'scheduleScrollSynchronization');
}),
scheduleScrollSynchronization() {
run.scheduleOnce('afterRender', () => this.synchronizeScrollPosition());
},
willDestroy() {
this.logger.stop();
},

View File

@@ -144,9 +144,7 @@ export default Model.extend({
}),
hasBlockedEvaluation: computed('evaluations.@each.isBlocked', function() {
return this.evaluations
.toArray()
.some(evaluation => evaluation.get('isBlocked'));
return this.evaluations.toArray().some(evaluation => evaluation.get('isBlocked'));
}),
hasPlacementFailures: and('latestFailureEvaluation', 'hasBlockedEvaluation'),
@@ -246,7 +244,7 @@ export default Model.extend({
const id = payload.Name;
this.set('plainId', id);
this.set('id', JSON.stringify([id, namespace]));
this.set('_idBeforeSaving', JSON.stringify([id, namespace]));
const namespaceRecord = this.store.peekRecord('namespace', namespace);
if (namespaceRecord) {

View File

@@ -6,10 +6,10 @@ import flat from 'flat';
const { unflatten } = flat;
export default Fragment.extend({
attributes: attr(),
nodeAttributes: attr(),
attributesStructured: computed('attributes', function() {
const original = this.attributes;
attributesStructured: computed('nodeAttributes', function() {
const original = this.nodeAttributes;
if (!original) {
return;
@@ -30,6 +30,8 @@ export default Fragment.extend({
//
// ex: nodeAttrs.get('driver.docker')
// [ "1", { version: "17.05.0-ce", volumes: { enabled: "1" } } ]
return get(this.attributesStructured, key);
if (this.attributesStructured) {
return get(this.attributesStructured, key);
}
},
});

View File

@@ -26,7 +26,7 @@ export default Route.extend({
promises => {
if (!this.get('system.shouldShowRegions')) return promises;
const queryParam = transition.queryParams.region;
const queryParam = transition.to.queryParams.region;
const defaultRegion = this.get('system.defaultRegion.region');
const currentRegion = this.get('system.activeRegion') || defaultRegion;

View File

@@ -22,7 +22,7 @@ export default Route.extend(WithForbiddenState, {
beforeModel(transition) {
return this.get('system.namespaces').then(namespaces => {
const queryParam = transition.queryParams.namespace;
const queryParam = transition.to.queryParams.namespace;
this.set('system.activeNamespace', queryParam || 'default');
return namespaces;
@@ -30,9 +30,7 @@ export default Route.extend(WithForbiddenState, {
},
model() {
return this.store
.findAll('job', { reload: true })
.catch(notifyForbidden(this));
return this.store.findAll('job', { reload: true }).catch(notifyForbidden(this));
},
actions: {

View File

@@ -15,7 +15,7 @@ export default Route.extend({
},
model(params, transition) {
const namespace = transition.queryParams.namespace || this.get('system.activeNamespace.id');
const namespace = transition.to.queryParams.namespace || this.get('system.activeNamespace.id');
const name = params.job_name;
const fullId = JSON.stringify([name, namespace || 'default']);
return this.store

View File

@@ -2,6 +2,6 @@ import ApplicationSerializer from './application';
export default ApplicationSerializer.extend({
normalize(typeHash, hash) {
return this._super(typeHash, { Attributes: hash });
return this._super(typeHash, { NodeAttributes: hash });
},
});

View File

@@ -43,10 +43,10 @@
"d3-transition": "^1.1.0",
"ember-ajax": "^5.0.0",
"ember-auto-import": "^1.2.21",
"ember-cli": "~3.4.4",
"ember-cli": "~3.8.3",
"ember-cli-babel": "^7.1.2",
"ember-cli-clipboard": "^0.13.0",
"ember-cli-dependency-checker": "^3.0.0",
"ember-cli-dependency-checker": "^3.1.0",
"ember-cli-deprecation-workflow": "^1.0.1",
"ember-cli-eslint": "^5.1.0",
"ember-cli-funnel": "^0.6.1",
@@ -56,32 +56,32 @@
"ember-cli-mirage": "^1.1.2",
"ember-cli-moment-shim": "^3.5.0",
"ember-cli-page-object": "^1.15.1",
"ember-cli-qunit": "^4.3.2",
"ember-cli-sass": "^10.0.0",
"ember-cli-sri": "^2.1.1",
"ember-cli-string-helpers": "^1.5.0",
"ember-cli-template-lint": "^1.0.0-beta.1",
"ember-cli-uglify": "^2.1.0",
"ember-composable-helpers": "^2.0.3",
"ember-concurrency": "^0.9.0",
"ember-concurrency": "^1.0.0",
"ember-copy": "^1.0.0",
"ember-data": "~3.4.0",
"ember-data-model-fragments": "3.3.0",
"ember-data": "~3.8.0",
"ember-data-model-fragments": "4.0.0",
"ember-export-application-global": "^2.0.0",
"ember-fetch": "^6.5.0",
"ember-freestyle": "~0.10.0",
"ember-inflector": "^3.0.0",
"ember-inline-svg": "^0.2.1",
"ember-inline-svg": "^0.3.0",
"ember-load-initializers": "^1.1.0",
"ember-maybe-import-regenerator": "^0.1.6",
"ember-moment": "^7.8.1",
"ember-page-title": "^5.0.2",
"ember-power-select": "^2.2.3",
"ember-qunit": "^3.4.1",
"ember-qunit-nice-errors": "^1.2.0",
"ember-resolver": "^5.0.1",
"ember-responsive": "^3.0.0",
"ember-sinon": "^2.2.0",
"ember-source": "~3.4.0",
"ember-responsive": "^3.0.4",
"ember-sinon": "^4.0.0",
"ember-source": "~3.8.0",
"ember-test-selectors": "^2.1.0",
"ember-truth-helpers": "^2.0.0",
"eslint": "^5.16.0",

File diff suppressed because it is too large Load Diff