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
687 stars 94 forks source link

Ribbon buttons are not getting enabled/disabled once its enabled property is set in manifest while adding the manifest to PowerPoint desktop in Mac #4143

Closed shivAtSap closed 2 weeks ago

shivAtSap commented 9 months ago

When we add a manifest in PowerPoint desktop Mac, we expect some of the ribbon buttons to be enabled and others to be disabled as mentioned in the manifest which is happening but after we do some operations in the PowerPoint, we need to enable some of the disabled ribbon buttons, but this isn't happening, while the same happens as expected and working fine in PowerPoint web.

Your Environment

Expected behavior

Initially when we upload the manifest, the ribbon buttons should be enabled/disabled as mentioned in the enabled property in the manifest but after we perform certain operation in ppt like login/onclick of some ribbon button ,we want some of the ribbon buttons to be enabled and some other to be disabled. The same happens in PowerPoint web but doesn't happen in PowerPoint Mac desktop mode.

Current behavior

Currently the some of the buttons are enabled while the others are disabled depending on enabled property in the manifest. Now when we perform some action in the PowerPoint we try to set some disabled ribbon buttons as enabled and vice versa but this isn't happening, while in PowerPoint web the disabled buttons get enabled when we perform some action.

Steps to reproduce

  1. Create a manifest and add <Set Name="SharedRuntime" MinVersion="1.1"/> in the requirements set.
  2. Add some ribbon buttons that are enabled and some disabled and associate some function with it so that you can make it enable/disable onclick of it.
  3. `
              <Label resid="Starlight.ButtonLogout.Label" />
              <Supertip>
                <!--ToolTip title. resid must point to a ShortString resource -->
                <Title resid="Starlight.ButtonLogout.Label" />
                <!--ToolTip description. resid must point to a LongString resource -->
                <Description resid="Starlight.ButtonLogout.Tooltip" />
              </Supertip>
              <Icon>
                <bt:Image size="16" resid="Starlight.ButtonLogout.Icon.16" />
                <bt:Image size="32" resid="Starlight.ButtonLogout.Icon.32" />
                <bt:Image size="80" resid="Starlight.ButtonLogout.Icon.80" />
              </Icon>
              <Action xsi:type="ExecuteFunction">
                <FunctionName>executeButtonClick</FunctionName>
              </Action>
              <Enabled>false</Enabled>
            </Control>`
  4. Now onclick of this button you can try to enable the button incase it is disabled already or vice versa.

Context

Once we upload a manifest we need some of the buttons to be enabled while the others should be disabled, e.g.- Sign-in button should be enabled while Sign-out button should be disabled. Now, when the user signs in the sign in button should be disabled while the sign-out should b enabled so that the user can sign-out form the current application, but this isn't happening now in Mac desktop but its working fine in PowerPoint web.

Useful logs

Thank you for taking the time to report an issue. Our triage team will respond to you in less than 72 hours. Normally, response time is <10 hours Monday through Friday. We do not triage on weekends.

Prannoy-KV commented 7 months ago

Hi Ester,

We tried the beta version of Office.js ( https://appsforoffice.microsoft.com/lib/beta/hosted/office.js ) in a mock environment, both on Mac and Windows and found that the issue gets resolved. We would like to know if you have any update as when this feature would be part of GA.

EsterBergen commented 4 months ago

@shivAtSap - This should be available now in production/GA. Can you please test and confirm? image

https://learn.microsoft.com/en-us/office/dev/add-ins/design/disable-add-in-commands

Thanks!