Issue facing while using lightning overlay:
1) when I override the Quick Action with Lightning overlay Component there are two overlay showing one is quick action overlay and other is the standard quick action modal.Is there is any way to avoid standard modal of quick action.Right now I used the close quick action event during doInit of the overlay component.
2)When I click on "OK" Button I am redirecting to the account record.When I redirect to account record Page I am getting "Page does not exists" error popup.
Overlay component:
<aura:component implements="force:appHostable,flexipage:availableForAllPageTypes,flexipage:availableForRecordHome,force:hasRecordId,forceCommunity:availableForAllPageTypes,force:lightningQuickAction" access="global" >
<aura:handler name="init" value="{! this }" action="{! c.doInit }"/>
<aura:dependency resource="markup://force:navigateToSObject" type="EVENT"/>
<lightning:overlayLibrary aura:id="overlayLib"/>
</aura:component>
({
doInit : function(component, event, helper) {
window.setTimeout(function(){
$A.get("e.force:closeQuickAction").fire();
}, 100);
var modalBody;
var modalFooter;
$A.createComponents([
["c:modalContent",{}],
["c:modalFooter",{"recordId":component.get("v.recordId")}]
],
function(components, status){
if (status === "SUCCESS") {
modalBody = components[0];
modalFooter = components[1];
component.find('overlayLib').showCustomModal({
header: "Application Confirmation",
body: modalBody,
footer: modalFooter,
showCloseButton: true,
closeCallback: function() {
//alert('You closed the alert!');
var sObjectEvent = $A.get("e.force:navigateToSObject");
sObjectEvent.setParams({
"recordId": component.get("v.recordId"),
"slideDevName": 'detail'
})
sObjectEvent.fire();
}
})
}
}
);
}
})
Modal Content:
<aura:component >
<lightning:icon size="medium" iconName="action:approval" alternativeText="Approved" />
Your application has been approved.
</aura:component>
Modal footer:
<aura:component implements="force:appHostable,flexipage:availableForAllPageTypes,flexipage:availableForRecordHome,force:hasRecordId,forceCommunity:availableForAllPageTypes,force:lightningQuickAction" access="global" >
<aura:dependency resource="markup://force:navigateToSObject" type="EVENT"/>
<aura:attribute name="recordId" type="String"/>
<lightning:button name="cancel" label="Cancel" onclick=""/>
<lightning:button name="ok" label="OK" variant="brand" onclick="{!c.handleOK}"/>
</aura:component>
({
handleOK : function(component, event, helper) {
console.log('recordId----'+component.get("v.recordId"));
var sObjectEvent = $A.get("e.force:navigateToSObject");
sObjectEvent.setParams({
"recordId": component.get("v.recordId"),
"slideDevName": 'detail'
})
sObjectEvent.fire();
}
})