@@ -27,6 +27,7 @@ import _ from 'lodash'
27
27
vm . communities = { }
28
28
vm . isPageDirty = isPageDirty
29
29
vm . isTracksDirty = isTracksDirty
30
+ vm . isCommunitySelected = isCommunitySelected
30
31
///////
31
32
activate ( )
32
33
@@ -51,6 +52,13 @@ import _ from 'lodash'
51
52
function isTracksDirty ( ) {
52
53
return vm . tracks . DESIGN || vm . tracks . DEVELOP || vm . tracks . DATA_SCIENCE
53
54
}
55
+ /**
56
+ * Verfies if the communities section state has been modified by the user in any way.
57
+ */
58
+ function isCommunitySelected ( ) {
59
+ var community = _ . find ( vm . communities , { status : true , display : true } )
60
+ return ! ! community
61
+ }
54
62
55
63
/**
56
64
* Verfies if the communities section state has been modified by the user in any way.
@@ -64,6 +72,13 @@ import _ from 'lodash'
64
72
* Initializes the communities to show in the communities section.
65
73
*/
66
74
function initCommunities ( ) {
75
+ vm . communities [ 'ibm_cognitive' ] = {
76
+ displayName : 'Cognitive' ,
77
+ programId : vm . IBM_COGNITIVE_PROGRAM_ID ,
78
+ status : true ,
79
+ dirty : true ,
80
+ display : true
81
+ }
67
82
vm . communities [ 'ios' ] = {
68
83
displayName : 'iOS' ,
69
84
programId : vm . IOS_PROGRAM_ID ,
@@ -78,13 +93,6 @@ import _ from 'lodash'
78
93
dirty : false ,
79
94
display : true
80
95
}
81
- vm . communities [ 'ibm_cognitive' ] = {
82
- displayName : 'Cognitive' ,
83
- programId : vm . IBM_COGNITIVE_PROGRAM_ID ,
84
- status : true ,
85
- dirty : true ,
86
- display : true
87
- }
88
96
_addWatchToCommunity ( vm . communities [ 'ios' ] )
89
97
_addWatchToCommunity ( vm . communities [ 'predix' ] )
90
98
_addWatchToCommunity ( vm . communities [ 'ibm_cognitive' ] )
@@ -125,8 +133,7 @@ import _ from 'lodash'
125
133
if ( community ) {
126
134
// set display false to avoid showing already enabled/registered program
127
135
// we expect display property to be modified after first load of the page
128
- community . display = false
129
- community . status = true
136
+ // community.status = true
130
137
if ( community . unregister ) {
131
138
community . unregister ( )
132
139
_addWatchToCommunity ( community )
0 commit comments