Skip to content
This repository was archived by the owner on Mar 4, 2025. It is now read-only.

F2f skill picker by shubhendus #1242

Merged
merged 3 commits into from
Oct 26, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions app/skill-picker/skill-picker.controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ import _ from 'lodash'
vm.isPageDirty = isPageDirty
vm.isTracksDirty = isTracksDirty
vm.isCommunitySelected = isCommunitySelected
vm.isPageStateDirty = false
///////
activate()

Expand All @@ -42,20 +43,22 @@ import _ from 'lodash'
/**
* Verfies if the page state has been modified by the user in any way.
*/
function isPageDirty() {
function isPageDirty() {
return isTracksDirty() || isCommunitiesDirty()
}

/**
* Verfies if the tracks section state has been modified by the user in any way.
*/
function isTracksDirty() {
vm.isPageStateDirty = true
return vm.tracks.DESIGN || vm.tracks.DEVELOP || vm.tracks.DATA_SCIENCE
}
/**
* Verfies if the communities section state has been modified by the user in any way.
*/
function isCommunitySelected() {
vm.isPageStateDirty = true
var community = _.find(vm.communities, {status: true, display: true})
return !!community
}
Expand Down Expand Up @@ -131,9 +134,8 @@ import _ from 'lodash'
if (program) {
var community = _.find(vm.communities, {programId: program.eventId})
if (community) {
// set display false to avoid showing already enabled/registered program
// we expect display property to be modified after first load of the page
// community.status = true
// Show existing communites selected
community.status = true
if (community.unregister){
community.unregister()
_addWatchToCommunity(community)
Expand Down
2 changes: 1 addition & 1 deletion app/skill-picker/skill-picker.jade
Original file line number Diff line number Diff line change
Expand Up @@ -74,4 +74,4 @@
type="button",
tc-busy-button, tc-busy-when="vm.saving",
ng-click="vm.submitSkills()",
ng-disabled="vm.disableDoneButton || !vm.isPageDirty()") Done
ng-disabled="vm.disableDoneButton || vm.isPageStateDirty") Done