-
Notifications
You must be signed in to change notification settings - Fork 139
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merged in ATL-10-bugfixes (pull request #24)
ATL-10 bugfixes
- Loading branch information
Showing
13 changed files
with
139 additions
and
72 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 11 additions & 0 deletions
11
...ions/components/characterizations/characterization-view-edit/explore-temporal-cohort.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<div class="explore-temporal-cohort"> | ||
<div class="upper-tabs" data-bind="foreach: tabs"> | ||
<div data-bind="css: { active: $component.selectedTabKey() === key }, | ||
click: $component.selectedTabKey.bind($component, key)"> | ||
<span data-bind="text: title"></span> | ||
</div> | ||
</div> | ||
<div data-bind="with: $component.tabs.find(t => t.key === $component.selectedTabKey())"> | ||
<div data-bind="component: { name: 'explore-temporal', params: componentParams }"></div> | ||
</div> | ||
</div> |
28 changes: 28 additions & 0 deletions
28
...ations/components/characterizations/characterization-view-edit/explore-temporal-cohort.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
define([ | ||
"knockout", | ||
"utils/CommonUtils", | ||
"components/Component", | ||
"utils/AutoBind", | ||
"text!./explore-temporal-cohort.html", | ||
"less!./explore-temporal-cohort.less", | ||
'components/tabs', | ||
'./explore-temporal', | ||
], function (ko, commonUtils, Component, AutoBind, view, tabs) { | ||
|
||
class ExploreTemporalCohort extends AutoBind(Component) { | ||
constructor(params) { | ||
super(params); | ||
const temporal = params.temporal || {}; | ||
this.temporalDataByCohort = temporal.temporalDataByCohort || {}; | ||
|
||
this.tabs = this.temporalDataByCohort.map(cohort => ({ | ||
title: cohort.cohortName, | ||
key: cohort.cohortName, | ||
componentParams: { data: cohort.temporalInfo }, | ||
})); | ||
this.selectedTabKey = ko.observable(this.tabs.length > 0 ? this.tabs[0].key : null); | ||
} | ||
} | ||
|
||
commonUtils.build('explore-temporal-cohort', ExploreTemporalCohort, view); | ||
}); |
17 changes: 17 additions & 0 deletions
17
...ions/components/characterizations/characterization-view-edit/explore-temporal-cohort.less
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
.explore-temporal-cohort { | ||
.upper-tabs { | ||
display: flex; | ||
justify-content: space-between; | ||
|
||
div { | ||
flex: 1; | ||
border: 1px solid grey; | ||
padding: 5px; | ||
cursor: pointer; | ||
|
||
&.active { | ||
background-color: lightgrey; | ||
} | ||
} | ||
} | ||
} |
12 changes: 6 additions & 6 deletions
12
...terizations/components/characterizations/characterization-view-edit/explore-temporal.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
<div data-bind="css: classes()"> | ||
<tabs params=" | ||
selectedTabKey: $component.selectedTabKey, | ||
tabs: $component.tabs | ||
"> | ||
</tabs> | ||
<div class="explore-temporal"> | ||
<div data-bind="foreach: tabs"> | ||
<div data-bind="css: { active: $component.selectedTabKey() === key }"> | ||
<div data-bind="component: { name: componentName, params: componentParams }"></div> | ||
</div> | ||
</div> | ||
</div> |
86 changes: 41 additions & 45 deletions
86
...acterizations/components/characterizations/characterization-view-edit/explore-temporal.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,50 +1,46 @@ | ||
define([ | ||
"knockout", | ||
"text!./explore-temporal.html", | ||
'components/Component', | ||
'utils/CommonUtils', | ||
'utils/AutoBind', | ||
'components/tabs', | ||
'./temporal/annual', | ||
'./temporal/temporal', | ||
"less!./explore-temporal.less", | ||
], | ||
function ( | ||
ko, | ||
view, | ||
Component, | ||
commonUtils, | ||
AutoBind, | ||
tabs, | ||
) { | ||
|
||
class ExploreTemporal extends AutoBind(Component) { | ||
constructor(params) { | ||
super(params); | ||
this.selectedTabKey = ko.observable('annual'); | ||
const temporal = params.temporal || {}; | ||
this.temporalAnnual = temporal.temporalAnnual || []; | ||
this.temporalDaily = temporal.temporal || []; | ||
this.tabs = [ | ||
{ | ||
title: 'Annual', | ||
key: 'annual', | ||
componentName: 'explore-temporal-annual', | ||
componentParams: {data: this.temporalAnnual}, | ||
visible: () => this.temporalAnnual && this.temporalAnnual.length > 0, | ||
}, | ||
{ | ||
title: 'Daily', | ||
key: 'daily', | ||
componentName: 'explore-temporal-daily', | ||
componentParams: {data: this.temporalDaily}, | ||
visible: () => this.temporalDaily && this.temporalDaily.length > 0, | ||
}, | ||
].filter(v => v.visible()); | ||
} | ||
"knockout", | ||
"text!./explore-temporal.html", | ||
'components/Component', | ||
'utils/CommonUtils', | ||
'utils/AutoBind', | ||
'components/tabs', | ||
'./temporal/annual', | ||
'./temporal/temporal', | ||
"less!./explore-temporal.less", | ||
], | ||
function ( | ||
ko, | ||
view, | ||
Component, | ||
commonUtils, | ||
AutoBind, | ||
tabs, | ||
) { | ||
|
||
class ExploreTemporal extends AutoBind(Component) { | ||
constructor(params) { | ||
super(params); | ||
this.tabs = [ | ||
{ | ||
title: 'Annual', | ||
key: 'annual', | ||
componentName: 'explore-temporal-annual', | ||
componentParams: { data: params.data.temporalAnnual }, | ||
visible: () => params.data.temporalAnnual && params.data.temporalAnnual.length > 0 | ||
},{ | ||
title: 'Daily', | ||
key: 'daily', | ||
componentName: 'explore-temporal-daily', | ||
componentParams: { data: params.data.temporalDaily }, | ||
visible: () => params.data.temporalDaily && params.data.temporalDaily.length > 0 | ||
}, | ||
].filter(v => v.visible()); | ||
console.log(this.tabs); | ||
this.selectedTabKey = ko.observable(this.tabs.length > 0 ? this.tabs[0].key : null); | ||
} | ||
|
||
commonUtils.build('explore-temporal', ExploreTemporal, view); | ||
} | ||
|
||
commonUtils.build('explore-temporal', ExploreTemporal, view); | ||
} | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
...erizations/components/characterizations/characterization-view-edit/temporal/temporal.less
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters