mirror of https://github.com/rancher/ui.git
Labels named type are bad, mmmkay
This commit is contained in:
parent
ec6b308749
commit
10c0753a06
|
|
@ -49,6 +49,16 @@ var Container = Cattle.TransitioningResource.extend({
|
||||||
|
|
||||||
Container.reopenClass({
|
Container.reopenClass({
|
||||||
alwaysInclude: ['hosts'],
|
alwaysInclude: ['hosts'],
|
||||||
|
|
||||||
|
mangleIn: function(data) {
|
||||||
|
if ( data.labels )
|
||||||
|
{
|
||||||
|
// Labels shouldn't be a model even if it has a key called 'type'
|
||||||
|
data.labels = JSON.parse(JSON.stringify(data.labels));
|
||||||
|
}
|
||||||
|
|
||||||
|
return data;
|
||||||
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
export default Container;
|
export default Container;
|
||||||
|
|
|
||||||
|
|
@ -29,6 +29,13 @@ Host.reopenClass({
|
||||||
mangleIn: function(data) {
|
mangleIn: function(data) {
|
||||||
data['hostState'] = data['state'];
|
data['hostState'] = data['state'];
|
||||||
delete data['state'];
|
delete data['state'];
|
||||||
|
|
||||||
|
if ( data.labels )
|
||||||
|
{
|
||||||
|
// Labels shouldn't be a model even if it has a key called 'type'
|
||||||
|
data.labels = JSON.parse(JSON.stringify(data.labels));
|
||||||
|
}
|
||||||
|
|
||||||
return data;
|
return data;
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -42,6 +42,12 @@ Machine.reopenClass({
|
||||||
data.hosts = [];
|
data.hosts = [];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ( data.labels )
|
||||||
|
{
|
||||||
|
// Labels shouldn't be a model even if it has a key called 'type'
|
||||||
|
data.labels = JSON.parse(JSON.stringify(data.labels));
|
||||||
|
}
|
||||||
|
|
||||||
return data;
|
return data;
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue