OfficeDev / office-js

A repo and NPM package for Office.js, corresponding to a copy of what gets published to the official "evergreen" Office.js CDN, at https://appsforoffice.microsoft.com/lib/1/hosted/office.js.
https://learn.microsoft.com/javascript/api/overview
Other
690 stars 95 forks source link

Unable to allow pinning Task Pane #3895

Closed normanzhao closed 11 months ago

normanzhao commented 12 months ago

Unable to allow pinning Task Pane

Your Environment

Expected behavior

I should be able to pin my task pane

Current behavior

There is no option to pin my task pane

Steps to reproduce

yo office
> Office Add-in Task Pane project using React framework
> Typescript
> taskpane
> Outlook

Add <SupportsPinning>true</SupportsPinning> to manifest Fresh install into Outlook

Link to live example(s)

image

Context

I am trying to pin my task pane so users do not need to open the task pane very time they switch to another email

Full manifest

<?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>836a7b25-1222-4edb-a644-d520cd3e5693</Id>
  <Version>1.0.0.0</Version>
  <ProviderName>Contoso</ProviderName>
  <DefaultLocale>en-US</DefaultLocale>
  <DisplayName DefaultValue="taskpane"/>
  <Description DefaultValue="A template to get started."/>
  <IconUrl DefaultValue="https://localhost:3000/assets/icon-64.png"/>
  <HighResolutionIconUrl DefaultValue="https://localhost:3000/assets/icon-128.png"/>
  <SupportUrl DefaultValue="https://www.contoso.com/help"/>
  <AppDomains>
    <AppDomain>https://www.contoso.com</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.html"/>
        <RequestedHeight>250</RequestedHeight>
      </DesktopSettings>
    </Form>
  </FormSettings>
  <Permissions>ReadWriteItem</Permissions>
  <Rule xsi:type="RuleCollection" Mode="Or">
    <Rule xsi:type="ItemIs" ItemType="Message" FormType="Read"/>
  </Rule>
  <VersionOverrides xmlns="http://schemas.microsoft.com/office/mailappversionoverrides" xsi:type="VersionOverridesV1_0">
    <Hosts>
      <Host xsi:type="MailHost"/>
    </Hosts>
    <VersionOverrides xmlns="http://schemas.microsoft.com/office/mailappversionoverrides/1.1" xsi:type="VersionOverridesV1_1">
      <Requirements>
        <bt:Sets DefaultMinVersion="1.3">
          <bt:Set Name="Mailbox"/>
        </bt:Sets>
      </Requirements>
      <Hosts>
        <Host xsi:type="MailHost">
          <DesktopFormFactor>
            <FunctionFile resid="Commands.Url"/>
            <ExtensionPoint xsi:type="MessageReadCommandSurface">
              <OfficeTab id="TabDefault">
                <Group id="msgComposeGroup">
                  <Label resid="GroupLabel"/>
                  <Control xsi:type="Button" id="msgComposeOpenPaneButton">
                    <Label resid="TaskpaneButton.Label"/>
                    <Supertip>
                      <Title resid="TaskpaneButton.Label"/>
                      <Description resid="TaskpaneButton.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"/>
                      <SupportsPinning>true</SupportsPinning>
                    </Action>
                  </Control>
                </Group>
              </OfficeTab>
            </ExtensionPoint>
          </DesktopFormFactor>
        </Host>
      </Hosts>
      <Resources>
        <bt:Images>
          <bt:Image id="Icon.16x16" DefaultValue="https://localhost:3000/assets/icon-16.png"/>
          <bt:Image id="Icon.32x32" DefaultValue="https://localhost:3000/assets/icon-32.png"/>
          <bt:Image id="Icon.80x80" DefaultValue="https://localhost:3000/assets/icon-80.png"/>
        </bt:Images>
        <bt:Urls>
          <bt:Url id="Commands.Url" DefaultValue="https://localhost:3000/commands.html"/>
          <bt:Url id="Taskpane.Url" DefaultValue="https://localhost:3000/taskpane.html"/>
        </bt:Urls>
        <bt:ShortStrings>
          <bt:String id="GroupLabel" DefaultValue="Contoso Add-in"/>
          <bt:String id="TaskpaneButton.Label" DefaultValue="Show Taskpane"/>
        </bt:ShortStrings>
        <bt:LongStrings>
          <bt:String id="TaskpaneButton.Tooltip" DefaultValue="Opens a task pane."/>
          <bt:String id="ActionButton.Tooltip" DefaultValue="Perform an action when clicked."/>
        </bt:LongStrings>
      </Resources>
    </VersionOverrides>
  </VersionOverrides>
</OfficeApp>

In addition, replacing SupportsPinning with SupportsNoItemContext leads to the task pane not rendering at all. The results are the same when testing in Outlook for the Web image

exextoc commented 11 months ago

Hi @normanzhao, this is not a repro for us. Using the manifest shared by, we can get the pinnable option on the taskpane.

image

Having said that, the pinable taskpane feature does have certain limitations. Please refer: https://learn.microsoft.com/en-us/office/dev/add-ins/outlook/pinnable-taskpane?tabs=xmlmanifest image

Could you please confirm if you are using an Outlook.com account to test? Thanks!

normanzhao commented 11 months ago

Yes, I created an Outlook.com account to test. I thought that Info pane meant that the feature would not be enabled on Outlook.com, not that it wouldn't be enabled for all Outlook.com accounts. I will try with another account. Thank you!

Tested on a new account and it works! I will close the ticket.

Vignesh-02 commented 10 months ago

which account can I use to test this feature? and if this is deployed will people with an Outlook.com account not be able to test it?

Vignesh-02 commented 10 months ago

Can you roll this feature of pinning the add-in for all accounts on on all the different versions? Please do this ASAP. Thanks

Vignesh-02 commented 10 months ago

Yes, I created an Outlook.com account to test. I thought that Info pane meant that the feature would not be enabled on Outlook.com, not that it wouldn't be enabled for all Outlook.com accounts. I will try with another account. Thank you!

Tested on a new account and it works! I will close the ticket.

Which account did you try it with? Were you able to pin the add-in on both the web and the new windows desktop App?

normanzhao commented 10 months ago

Hi Vignesh.

Pinning the task pane worked both on web and on the desktop app. It should work with any email that isn't hosted on the Outlook domain (@Outlook.com).

Vignesh-02 commented 10 months ago

Does that mail account need to have a microsoft 365 subscription? How would our other users who have accounts with @outlook.com be able to pin the taskpane for the add-in?

normanzhao commented 10 months ago

Any account that's not on the @outlook domain should work, including any accounts with a microsoft 365 subscription.

Vignesh-02 commented 10 months ago

Which mail account did you use? I tried it with my gmail account and I am not even getting an option to see the add-ins. You mean like yahoo or hotmail accounts or business accounts which have a different domain name

normanzhao commented 10 months ago

Business accounts which have a private domain name.

Vignesh-02 commented 10 months ago

so, business or Microsoft 365 organization accounts which are used for Outlook? I tried with an organization account with gmail and it didn't work.