- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā03-16-2021 12:18 PM
Hi,
We are using the custom SC Catalog Item widget in our service portal and after the Paris upgrade when we upload the attachment from portal it is giving a pop-up as in the below screen shot. I tried to add angular provider "spAttachmentUpload" and tweak the code to disable the pop-up completely and add the attachment from portal with out pop-up if i do so it is completely de-activating the attachment option .Does some one faced any similar issue after the upgrade.Below is the code from spAttachmentUpload angular provider. Please, let me know if any one has faced similar issue.
spAttachmentUpload:
function(spModal, $q, i18n) {
'use strict';
return {
uploadAttachments: function(attachmentHandler, files) {
if (!files || !files.length)
return;
if (!g_has_encryption_context) {
attachmentHandler.onFileSelect(files);
alert('hello');
return;
}
var context = "";
var title = files.length > 1 ? i18n.getMessage("Encrypt attachments?") : i18n.getMessage("Encrypt attachment?");
spModal.open({
title: title,
shared: {files: files},
backdrop: 'static',
keyboard: false,
widget: 'encryption-context-picker',
buttons: [
{label: i18n.getMessage('Upload Without Encrypting'), value: "no"},
{label: i18n.getMessage('Upload and Encrypt'), primary: true, value: "yes"}
],
onSubmit: function() {
context = this.shared.context.value;
return $q(function(resolve, reject) {
resolve({status: "ok"});
});
}
}).then(function(clickedButton) {
if (clickedButton.value == "yes")
attachmentHandler.setEncryptionContext(context);
attachmentHandler.onFileSelect(files);
});
}
}
}
Regards
Nihanth Allada
Solved! Go to Solution.
- Labels:
-
Service Portal

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā03-17-2021 01:48 PM
Hi Nihanth,
Could you please try below code
function(spModal, $q, i18n) {
'use strict';
return {
uploadAttachments: function(attachmentHandler, files) {
if (!files || !files.length)
return;
//if (!g_has_encryption_context) {
attachmentHandler.onFileSelect(files);
// alert('hello');
return;
// }
var context = "";
var title = files.length > 1 ? i18n.getMessage("Encrypt attachments?") : i18n.getMessage("Encrypt attachment?");
spModal.open({
title: title,
shared: {files: files},
backdrop: 'static',
keyboard: false,
widget: 'encryption-context-picker',
buttons: [
{label: i18n.getMessage('Upload Without Encrypting'), value: "no"},
{label: i18n.getMessage('Upload and Encrypt '), primary: true, value: "yes"}
],
onSubmit: function() {
context = this.shared.context.value;
return $q(function(resolve, reject) {
resolve({status: "ok"});
});
}
}).then(function(clickedButton) {
if (clickedButton.value == "yes")
attachmentHandler.setEncryptionContext(context);
attachmentHandler.onFileSelect(files);
});
}
}
}
Happy learning!!
Knight!!

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā03-17-2021 01:48 PM
Hi Nihanth,
Could you please try below code
function(spModal, $q, i18n) {
'use strict';
return {
uploadAttachments: function(attachmentHandler, files) {
if (!files || !files.length)
return;
//if (!g_has_encryption_context) {
attachmentHandler.onFileSelect(files);
// alert('hello');
return;
// }
var context = "";
var title = files.length > 1 ? i18n.getMessage("Encrypt attachments?") : i18n.getMessage("Encrypt attachment?");
spModal.open({
title: title,
shared: {files: files},
backdrop: 'static',
keyboard: false,
widget: 'encryption-context-picker',
buttons: [
{label: i18n.getMessage('Upload Without Encrypting'), value: "no"},
{label: i18n.getMessage('Upload and Encrypt '), primary: true, value: "yes"}
],
onSubmit: function() {
context = this.shared.context.value;
return $q(function(resolve, reject) {
resolve({status: "ok"});
});
}
}).then(function(clickedButton) {
if (clickedButton.value == "yes")
attachmentHandler.setEncryptionContext(context);
attachmentHandler.onFileSelect(files);
});
}
}
}
Happy learning!!
Knight!!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā03-18-2021 07:17 AM
Hi Knight Rider,
This commented code works for me.
Thanks
Nihanth Allada