Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue #SB-840 fix:Rolling back the checkbox changes - which was causing error in create announcement flow #93

Merged
merged 3 commits into from
Nov 19, 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
2 changes: 1 addition & 1 deletion src/app/common/js/frmelmnts.js

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions src/app/private/scripts/components/geo.js
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ angular.module('playerApp').component('geo', {
*/
this.renderItems = function (items) {
this.items = items
this.initializeCheckBoxes();
//this.initializeCheckBoxes();
}

/**
Expand Down Expand Up @@ -145,12 +145,12 @@ angular.module('playerApp').component('geo', {
console.error('Unable to fetch the locations', error)
})
}
this.initializeCheckBoxes = function(){
/*this.initializeCheckBoxes = function(){
// Temp solution to initialize the checkboxes
setTimeout(function(){
$('.ui.checkbox').checkbox()
},0)
}
}*/
}],
templateUrl: 'views/components/geo.html'
})
Original file line number Diff line number Diff line change
Expand Up @@ -165,11 +165,14 @@ angular.module('playerApp').controller('createAnnouncementCtrl', ['$rootScope',
}
})
}
var selectRecipientBtn = angular.element( document.querySelector('#selectRecipientBtn'));
if (createAnn.data.title && createAnn.data.from && createAnn.data.type &&
(createAnn.uploadAttchement || createAnn.data.description || links.length)) {
createAnn.disableBtn = false
selectRecipientBtn.removeClass('disabled')
} else {
createAnn.disableBtn = true
selectRecipientBtn.addClass('disabled')
}
createAnn.isMetaModified = true
}
Expand Down Expand Up @@ -286,7 +289,6 @@ angular.module('playerApp').controller('createAnnouncementCtrl', ['$rootScope',
},
callbacks: {
onComplete: function (id, name, responseJSON, xhr) {
console.log('Upload response :', responseJSON)
if (responseJSON.responseCode === 'OK') {
createAnn.convertFileSize(this.getSize(id))
var attData = {
Expand All @@ -308,12 +310,22 @@ angular.module('playerApp').controller('createAnnouncementCtrl', ['$rootScope',
})
},
onCancel: function (id, name) {
if (createAnn.attachment.splice(id, 1)) {
console.log('attachement removed')
var deleteFlag = createAnn.attachment.splice(id, 1);
if(deleteFlag.length === 0){
angular.forEach(createAnn.attachment, function(value, key) {
var details = JSON.parse(value)
if(details.name === name){
createAnn.attachment.splice(key, 1);
}
});
}

if(createAnn.attachment.length === 0){
createAnn.uploadAttchement = false
}
document.getElementById('hide-section-with-button').style.display = 'block'
createAnn.uploadAttchement = false

createAnn.enableRecepientBtn()
document.getElementById('hide-section-with-button').style.display = 'block'
}
}
})
Expand Down
2 changes: 1 addition & 1 deletion src/app/private/scripts/filters/highLightFilter.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ angular.module('playerApp').filter('highlight', ['$sce', function ($sce) {
'<span id="highlighted" style = "color:#009fda">$1</span>')
}
// Temp solution to initialize the checkboxes
$('.ui.checkbox').checkbox()
//$('.ui.checkbox').checkbox()

return $sce.trustAsHtml(text)
}
Expand Down
4 changes: 2 additions & 2 deletions src/app/private/views/announcement/announcementDetails.html
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<div class="ui warning message tweleve wide column" ng-if="!announcementDetails.details.title">
<div class="header">
Oops announcement details not found!
{{$root.frmelmnts.instn.t0055}}<
</div>
Please try again..
{{$root.frmelmnts.instn.t0056}}<
</div>
<div ng-if="announcementDetails.details.title">
<div>
Expand Down
2 changes: 1 addition & 1 deletion src/app/private/views/announcement/createAnnouncement.html
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ <h6 class="createAnnMargin5 createAnnGrayShade">{{$root.frmelmnts.lbl.anncmntste
<div class="ui primary button" ng-if="createAnn.stepNumber == 3" ng-click="createAnn.previewAnn();createAnn.stepNumber = 4;">{{$root.frmelmnts.btn.anncmntpreview}}</div>
<div class="ui primary button" ng-if="createAnn.stepNumber == 4 && !createAnn.editAction" id="sendAnnouncement" ng-click="createAnn.saveAnnouncement(createAnn.data)">{{$root.frmelmnts.btn.anncmntsendanncmnt}}</div>
<div class="ui primary button" ng-if="createAnn.stepNumber == 4 && createAnn.editAction" id="resendAnnouncement" ng-click="createAnn.resendAnnouncement(createAnn.data)">{{$root.frmelmnts.btn.anncmntsendanncmnt}}</div>
<div ng-if="createAnn.stepNumber == 1" class="ui primary button" ng-class="{'disabled': createAnn.disableBtn === true || announcementForm.$invalid}" ng-click="createAnn.selectRecipients();createAnn.stepNumber = 2;">{{ createAnn.editAction ? $root.frmelmnts.btn.anncmnteditrecipients : $root.frmelmnts.btn.anncmntselectrecipients}}</div>
<div ng-if="createAnn.stepNumber == 1" id="selectRecipientBtn" class="ui primary button" ng-class="{'disabled': createAnn.disableBtn === true || announcementForm.$invalid}" ng-click="createAnn.selectRecipients();createAnn.stepNumber = 2;">{{ createAnn.editAction ? $root.frmelmnts.btn.anncmnteditrecipients : $root.frmelmnts.btn.anncmntselectrecipients}}</div>
</div>
</div>
<!-- Announcement created success modal -->
Expand Down
4 changes: 2 additions & 2 deletions src/app/private/views/components/geo.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
<input type='text' placeholder='Search for group' ng-model='search'> </div>
<div class='ui segment items-area padding-top-none padding-left-none'>
<div ng-repeat='item in $ctrl.items | filter : search'>
<div class='ui checkbox component_items'>
<label class='ui checkbox component_items'>
<input ng-model='item.selected' type='checkbox' name='example' class="checkBox-element">
<label ng-bind-html="item.location | highlight:search" >{{item.location}}</label>
</div>
</br>
</div>
</label>
<div ng-show="!($ctrl.items| filter:search).length">No Location Found</div>
</div>
</div>
2 changes: 2 additions & 0 deletions src/app/resourcebundles/data/formElements/en.properties
Original file line number Diff line number Diff line change
Expand Up @@ -375,6 +375,8 @@ t0051=Announcement type
t0052=Please enter description for this announcement (Max: 1200 chars)
t0053=Enter web url
t0054=Note: At least one of 'Description' or 'URL / weblink' or 'Attachment' must be provided.
t0055=Oops announcement details not found!
t0056=Please try again..

# Side Navigations
[snav]
Expand Down