Skip to content

Commit

Permalink
Signal tech debt
Browse files Browse the repository at this point in the history
  • Loading branch information
Pierluigi Cau committed Mar 7, 2016
1 parent 5df5f73 commit eda1c87
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/js/stores/AppsStore.js
Expand Up @@ -153,7 +153,9 @@ function processEmptyGroup(group) {
});
}

function processAppsAndGroups(group, apps = []) {
// TODO: refactor to adhere to /groups endpoint structures.
// https://github.com/mesosphere/marathon/issues/3383
function processAppsAndEmptyGroups(group, apps = []) {
if (group.apps != null && group.apps.length > 0) {
group.apps.forEach(app => {
apps.push(processApp(app));
Expand All @@ -163,7 +165,7 @@ function processAppsAndGroups(group, apps = []) {
}

if (group.groups != null && group.groups.length > 0) {
group.groups.forEach(group => processAppsAndGroups(group, apps));
group.groups.forEach(group => processAppsAndEmptyGroups(group, apps));
}

return apps;
Expand Down Expand Up @@ -246,7 +248,7 @@ QueueStore.on(QueueEvents.CHANGE, function () {
AppDispatcher.register(function (action) {
switch (action.actionType) {
case AppsEvents.REQUEST_APPS:
storeData.apps = processAppsAndGroups(action.data.body);
storeData.apps = processAppsAndEmptyGroups(action.data.body);
applyAppDelayStatusOnAllApps(storeData.apps, QueueStore.queue);
AppsStore.emit(AppsEvents.CHANGE);
break;
Expand Down

0 comments on commit eda1c87

Please sign in to comment.