I have an outlook web-add which performs the action of moving mail to another folder using the GRAPH API. I want to do display a message when the action is done (when the server' response is received) either directly in the taskpanel or in an popup using Office.context.ui.displayDialogAsync().
However, when the email is moved by the graph API and the changed are "synced" on the Outlook client, the taskpanel and the dialog close as the email no longer exists (the email moved is considered as another item).
IS there a way to detach the dialog from the parent (the taskpane), or to keep the taskane open?
Here is the manifest used:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<OfficeApp xmlns="http://schemas.microsoft.com/office/appforoffice/1.1"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:bt="http://schemas.microsoft.com/office/officeappbasictypes/1.0"
xmlns:mailappor="http://schemas.microsoft.com/office/mailappversionoverrides/1.0" xsi:type="MailApp">
<Id>[REDACTED]</Id>
<Version>1.0.0.1</Version>
<ProviderName>[REDACTED]</ProviderName>
<DefaultLocale>en-US</DefaultLocale>
<DisplayName DefaultValue="[REDACTED]"/>
<Description DefaultValue="[REDACTED]"/>
<IconUrl DefaultValue="https://localhost:3000/assets/icon64.png"/>
<HighResolutionIconUrl DefaultValue="https://localhost:3000/assets/icon128.png"/>
<SupportUrl DefaultValue="[REDACTED]"/>
<AppDomains>
<AppDomain>https://localhost:3000</AppDomain>
</AppDomains>
<Hosts>
<Host Name="Mailbox"/>
</Hosts>
<Requirements>
<Sets>
<Set Name="Mailbox" MinVersion="1.1"/>
</Sets>
</Requirements>
<FormSettings>
<Form xsi:type="ItemRead">
<DesktopSettings>
<SourceLocation DefaultValue="https://localhost:3000/taskpane/taskpane.html"/>
<RequestedHeight>250</RequestedHeight>
</DesktopSettings>
</Form>
</FormSettings>
<Permissions>ReadWriteMailbox</Permissions>
<Rule xsi:type="RuleCollection" Mode="Or">
<Rule xsi:type="ItemIs" ItemType="Message" FormType="Read"/>
<Rule xsi:type="ItemIs" ItemType="Appointment" FormType="Read"/>
</Rule>
<DisableEntityHighlighting>false</DisableEntityHighlighting>
<VersionOverrides xmlns="http://schemas.microsoft.com/office/mailappversionoverrides" xsi:type="VersionOverridesV1_0">
<VersionOverrides xmlns="http://schemas.microsoft.com/office/mailappversionoverrides/1.1" xsi:type="VersionOverridesV1_1">
<Requirements>
<bt:Sets DefaultMinVersion="1.12">
<bt:Set Name="Mailbox"/>
</bt:Sets>
</Requirements>
<Hosts>
<Host xsi:type="MailHost">
<DesktopFormFactor>
<ExtensionPoint xsi:type="MessageReadCommandSurface">
<OfficeTab id="TabDefault">
<Group id="REDACTEDGroup">
<Label resid="REDACTEDGroupLabel"/>
<Control xsi:type="Button" id="REDACTEDReportButton">
<Label resid="REDACTEDReportButton.Label"/>
<Supertip>
<Title resid="REDACTEDReportButton.Label"/>
<Description resid="REDACTEDReportButton.Tooltip"/>
</Supertip>
<Icon>
<bt:Image size="16" resid="Icon.16x16"/>
<bt:Image size="32" resid="Icon.32x32"/>
<bt:Image size="80" resid="Icon.80x80"/>
</Icon>
<Action xsi:type="ShowTaskpane">
<SourceLocation resid="Taskpane.Url" />
<SupportsNoItemContext>true</SupportsNoItemContext>
</Action>
</Control>
</Group>
</OfficeTab>
</ExtensionPoint>
</DesktopFormFactor>
</Host>
</Hosts>
<Resources>
<bt:Images>
<bt:Image id="Icon.16x16" DefaultValue="https://localhost:3000/assets/icon16.png"/>
<bt:Image id="Icon.32x32" DefaultValue="https://localhost:3000/assets/icon32.png"/>
<bt:Image id="Icon.80x80" DefaultValue="https://localhost:3000/assets/icon80.png"/>
</bt:Images>
<bt:Urls>
<bt:Url id="Init.Url" DefaultValue="https://localhost:3000/init/init.html"/>
<bt:Url id="Taskpane.Url" DefaultValue="https://localhost:3000/taskpane/taskpane.html"/>
</bt:Urls>
<bt:ShortStrings>
<bt:String id="REDACTEDGroupLabel" DefaultValue="REDACTED" />
<bt:String id="REDACTEDReportButton.Label" DefaultValue="Report Phishing">
<bt:Override Locale="fr-fr" Value="Signaler un Phishing" />
<bt:Override Locale="fr-ch" Value="Signaler un Phishing" />
</bt:String>
</bt:ShortStrings>
<bt:LongStrings>
<bt:String id="ActionButton.Tooltip" DefaultValue="Perform an action when clicked."/>
<bt:String id="REDACTEDReportButton.Tooltip" DefaultValue="Report a phishing email"/>
</bt:LongStrings>
</Resources>
<!-- Specifies SSO scopes and resources for the web application that hosts this add-in. -->
<WebApplicationInfo>
<Id>[REDACTED]</Id>
<Resource>api://localhost:3000/[REDACTED]/Resource>
<Scopes>
<Scope>openid</Scope>
<Scope>user.read</Scope>
<Scope>profile</Scope>
</Scopes>
</WebApplicationInfo>
<ExtendedPermissions>
<ExtendedPermission>AppendOnSend</ExtendedPermission>
</ExtendedPermissions>
</VersionOverrides>
</VersionOverrides>
</OfficeApp>