Skip to content

Commit

Permalink
Address headers and ID bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
DingoEatingFuzz committed Mar 3, 2018
1 parent 5dd83fd commit 421f082
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
3 changes: 2 additions & 1 deletion ui/app/adapters/watchable.js
Original file line number Diff line number Diff line change
Expand Up @@ -104,10 +104,11 @@ export default ApplicationAdapter.extend({
},

handleResponse(status, headers, payload, requestData) {
const newIndex = headers['X-Nomad-Index'];
const newIndex = headers['x-nomad-index'];
if (newIndex) {
this.get('watchList').setIndexFor(requestData.url, newIndex);
}

return this._super(...arguments);
},

Expand Down
6 changes: 3 additions & 3 deletions ui/app/components/distribution-bar.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import Component from '@ember/component';
import { computed, observer } from '@ember/object';
import { run } from '@ember/runloop';
import { assign } from '@ember/polyfills';
import { guidFor } from '@ember/object/internals';
import { guidFor, copy } from '@ember/object/internals';
import d3 from 'npm:d3-selection';
import 'npm:d3-transition';
import WindowResizable from '../mixins/window-resizable';
Expand All @@ -22,8 +22,8 @@ export default Component.extend(WindowResizable, {
tooltipStyle: styleStringProperty('tooltipPosition'),
maskId: null,

_data: computed('data.@each.{value,label,className,layers}', function() {
const data = this.get('data');
_data: computed('data', function() {
const data = copy(this.get('data'), true);
const sum = data.mapBy('value').reduce(sumAggregate, 0);

return data.map(({ label, value, className, layers }, index) => ({
Expand Down
3 changes: 1 addition & 2 deletions ui/app/utils/properties/watch.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
import Ember from 'ember';
import { typeOf } from '@ember/utils';
import { get } from '@ember/object';
import RSVP from 'rsvp';
import { task } from 'ember-concurrency';
import wait from 'nomad-ui/utils/wait';

export function watchRecord(modelName) {
return task(function*(id, throttle = 2000) {
if (typeOf(id) === 'object') {
if (typeof id === 'object') {
id = get(id, 'id');
}
while (!Ember.testing) {
Expand Down
2 changes: 1 addition & 1 deletion ui/mirage/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ export default function() {
response.headers['X-Nomad-Index'] = index;
return response;
}
return new Response(200, { 'X-Nomad-Index': index }, response);
return new Response(200, { 'x-nomad-index': index }, response);
};
};

Expand Down

0 comments on commit 421f082

Please sign in to comment.