Skip to content

Commit

Permalink
narrative for filter by phase redone
Browse files Browse the repository at this point in the history
  • Loading branch information
travula committed Mar 21, 2018
1 parent 97935ca commit 88b2658
Showing 1 changed file with 10 additions and 9 deletions.
19 changes: 10 additions & 9 deletions src/runtime/controller.org
Original file line number Diff line number Diff line change
Expand Up @@ -662,7 +662,7 @@ var buildInstituteDisplayList = function(institutes) {
#+BEGIN_SRC js
var displayLabsOfDiscipline = function(discId) {
getLabsByDiscipline(discId)
.then(filterByPhaseLabs)
.then(filterLabsByPhase)
.then(buildLabsDisplayList)
.then(setContentInContentDiv)
.catch(function(err) {
Expand Down Expand Up @@ -787,7 +787,7 @@ var getTheRightUrl = function(hostingInfos) {
#+BEGIN_SRC js
var displayLabsOfInstitute = function(instId) {
getLabsByInstitute(instId)
.then(filterByPhaseLabs)
.then(filterLabsByPhase)
.then(buildLabsDisplayList)
.then(setContentInContentDiv)
.catch(function(err) {
Expand All @@ -805,7 +805,7 @@ var displayLabsOfInstitute = function(instId) {
#+BEGIN_SRC js
var displayAllLabs = function() {
getLabs()
.then(filterByPhaseLabs)
.then(filterLabsByPhase)
.then(buildLabsDisplayList)
.then(setContentInContentDiv)
.catch(function(err) {
Expand All @@ -815,14 +815,15 @@ var displayAllLabs = function() {

#+END_SRC
* Filter Labs based on Phase
Based on the configuration, the labs are filtered based on
to which phase they belong to. If the configuration
defined by =phaseId= says phase 2, then labs belonging to
phase 2 are filtered out.
The configuration provides the phase information. Based on
this configuration, the labs are filtered by the phase
they belong to. If the configuration defined by =phaseId=
says phase 2, then labs belonging to phase 2 are filtered
out.

#+name: filter-labs-by-phase
#+BEGIN_SRC js
var filterByPhaseLabs = function(labs) {
var filterLabsByPhase = function(labs) {
return labs.filter(function(labs) {
if (phaseLength == 0) {
return true;
Expand Down Expand Up @@ -855,7 +856,7 @@ var displayLabsByKeyWord = function() {
.then(function(labs) {
return filterLabsByKeyWord(labs, keyword);
})
.then(filterByPhaseLabs)
.then(filterLabsByPhase)
.then(buildLabsDisplayList)
.then(setContentInContentDiv)
.catch(function(err) {
Expand Down

0 comments on commit 88b2658

Please sign in to comment.