diff --git a/app/components/modal-rollback-service/component.js b/app/components/modal-rollback-service/component.js index dd105ef94..9a502b088 100644 --- a/app/components/modal-rollback-service/component.js +++ b/app/components/modal-rollback-service/component.js @@ -38,9 +38,9 @@ export default Component.extend(ModalBase, { actions: { save(cb) { - const revision = get(this, 'choices').findIndex(r => r.value === get(this, 'revisionId')) + 1; + const id = get(this, 'selected.id'); get(this, 'model').doAction('rollback', { - revision, + replicaSetId: id, }).then(() => { this.send('cancel'); }).finally(() => { @@ -74,7 +74,6 @@ export default Component.extend(ModalBase, { }, choices: computed('revisions.[]', function () { - const currentId = get(this, 'current.id'); return (get(this, 'revisions') || []) .sortBy('createdTS') @@ -87,14 +86,14 @@ export default Component.extend(ModalBase, { value: id, ts: get(r, 'createdTS'), data: r, - disabled: id === currentId + disabled: r.workloadAnnotations[C.LABEL.DEPLOYMENT_REVISION] === get(this, 'model.workloadAnnotations')[C.LABEL.DEPLOYMENT_REVISION] }; }); }), current: computed('revisions.@each.workloadAnnotations', function () { - const currentRevision = get(this,`model.workloadAnnotations.${C.LABEL.DEPLOYMENT_REVISION}`); - return (get(this,'revisions')||[]).findBy(`workloadAnnotations.${C.LABEL.DEPLOYMENT_REVISION}`, currentRevision); + const currentRevision = get(this, 'model.workloadAnnotations')[C.LABEL.DEPLOYMENT_REVISION]; + return (get(this,'revisions')||[]).find((r) => get(r, 'workloadAnnotations')[C.LABEL.DEPLOYMENT_REVISION] === currentRevision); }), selected: computed('revisionId', 'revisions.[]', function () { diff --git a/ember-cli-build.js b/ember-cli-build.js index 55ea07dbd..fe1ed7762 100644 --- a/ember-cli-build.js +++ b/ember-cli-build.js @@ -86,8 +86,8 @@ module.exports = function(defaults) { app.import('node_modules/identicon.js/identicon.js'); app.import('node_modules/jgrowl/jquery.jgrowl.css'); app.import('node_modules/jgrowl/jquery.jgrowl.js'); - app.import('node_modules/jsondiffpatch/public/build/jsondiffpatch-formatters.js'); app.import('node_modules/jsondiffpatch/public/build/jsondiffpatch.js'); + app.import('node_modules/jsondiffpatch/public/build/jsondiffpatch-formatters.js'); app.import('node_modules/jszip/dist/jszip.js') app.import('node_modules/moment/moment.js'); app.import('node_modules/prismjs/prism.js');