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
686 stars 95 forks source link

Buttons are not getting disabled while adding a manifest in windows PowerPoint desktop even when the enabled property is set as false in the manifest. #4140

Closed nikhilatsap closed 7 months ago

nikhilatsap commented 9 months ago

When we add a manifest in PowerPoint desktop, we expect some of the ribbon buttons to be enabled and other to be disabled as mentioned in the manifest but instead all the buttons get enabled irrespective of what the enabled property is set in the manifest.

Your Environment

Expected behavior

Expected behavior is that when the enabled property for a button is set to true the button should be enabled and when the same is set to false the button in PowerPoint should be disabled.

Current behavior

Currently all the buttons are getting enabled irrespective of what the enabled property is set to in the manifest.

Steps to reproduce

  1. Create a manifest and add in the requirements set.
  2. Add some buttons with some actions and keep the enabled property as false.
  3. One of the ribbon button can be as below
  4. `
            <Label resid="Starlight.Tab1.DesignLabel" />
            <Icon>
              <bt:Image size="16" resid="Starlight.ButtonDesigner.Icon.16" />
              <bt:Image size="32" resid="Starlight.ButtonDesigner.Icon.32" />
              <bt:Image size="80" resid="Starlight.ButtonDesigner.Icon.80" />
            </Icon>
            <Control xsi:type="Button" id="Starlight.DesignerButton">
              <Label resid="Starlight.ButtonDesigner.Label" />
              <Supertip>
                <Title resid="Starlight.ButtonDesigner.Label" />
                <Description resid="Starlight.ButtonDesigner.Tooltip" />
              </Supertip>
              <Icon>
                <bt:Image size="16" resid="Starlight.ButtonDesigner.Icon.16" />
                <bt:Image size="32" resid="Starlight.ButtonDesigner.Icon.32" />
                <bt:Image size="80" resid="Starlight.ButtonDesigner.Icon.80" />
              </Icon>
              <Action xsi:type="ExecuteFunction">
                <FunctionName>executeButtonClick</FunctionName>
              </Action>
              <Enabled>false</Enabled>
            </Control>
          </Group>`
  5. Now add this manifest into PowerPoint windows desktop mode.

Context

Initially some of the buttons should be disabled while the others will be enabled. Then the user clicks on signin ribbon button after which the task pane comes up and then the user needs to sign in to a specific url, only after successful login, we enable all other ribbon buttons.

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.

EsterBergen commented 9 months ago

@nikhilatsap - Thanks for raising this issue- have you tried to clear the office cache after making the manifest changes?

https://learn.microsoft.com/en-us/office/dev/add-ins/testing/clear-cache

If you clear the cache, the settings should apply to the ribbon. Let us know if you've tried that.

nikhilatsap commented 9 months ago

Hi , I have tried clearing the cache and reuploading the manifest as well, It doesn't look like a cache issue since it is reproducible on all of my team's desktop computers using the desktop version of office, where as web office 365 works fine

EsterBergen commented 7 months ago

@nikhilatsap - would it be possible to share with us if you're using Office.js (https://appsforoffice.microsoft.com/lib/1/hosted/office.js") or Office.js Preview (https://appsforoffice.microsoft.com/lib/beta/hosted/office.js)? Which CDN path do you define in your HTML File?

nikhilatsap commented 7 months ago

Hi Ester, this is the office.js file we are using https://appsforoffice.microsoft.com/lib/1.1/hosted/office.js

shivAtSap commented 7 months ago

Hi Ester, Sorry for the confusion, this is the office.js file we are using https://appsforoffice.microsoft.com/lib/1/hosted/office.js

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

@Prannoy-KV - This should be available in production for Win32 Desktop. Can you please test and confirm? https://learn.microsoft.com/en-us/office/dev/add-ins/design/disable-add-in-commands

Thanks!