Encryption attachment pop-up in portal after paris upgrade

Nihanth Allada
Mega Guru

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);
});
}
}
}

 

 

find_real_file.png

 

Regards

Nihanth Allada

1 ACCEPTED SOLUTION

Knight Rider
Mega Guru

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!!

View solution in original post

2 REPLIES 2

Knight Rider
Mega Guru

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!!

Hi Knight Rider,

 

This commented code works for me.

 

Thanks 

Nihanth Allada