OneDrive / samples

Contains samples, scenarios, and guidance for integrating with OneDrive and SharePoint drives, drive items, and files.
MIT License
49 stars 48 forks source link

File Browser: Provide documentation on how to hide Version history and Compliance Details commands #67

Open ottD opened 4 months ago

ottD commented 4 months ago

Issue description The File Browser configuration schema in the documentation does not specify an option to hide the Version history and Compliance details commands. Please consider exposing how these commands can be hidden as they are enabled by default and the version history/ compliance details iframes fail to load when using the File Browser outside of SharePoint, e.g. in a Teams application:

Refused to frame 'https://mytenant.sharepoint.com/' because an ancestor
violates the following Content Security Policy directive: 
"frame-ancestors 'self' teams.microsoft.com *.teams.microsoft.com *.skype.com *.teams.microsoft.us local.teams.office.com 
*.office365.com *.powerapps.com *.yammer.com engage.cloud.microsoft *.officeapps.live.com *.office.com *.microsoft365.com
*.stream.azure-test.net *.microsoftstream.com *.dynamics.com
*.microsoft.com onedrive.live.com *.onedrive.live.com securebroker.sharepointonline.com".

To Reproduce Use the File Browser component in a Teams application and configure it according to the documented File Browser configuration schema Both Version history and Compliance details commands are enabled by default but unusable due to the issue described above.

Expected behavior Document how to hide the Version history and Compliance details commands such that 3rd party applications can use the FileBrowser without these failing commands.

Screenshots

Screenshot 2024-02-21 113752

image

Details Note, the File Browser used in the native Teams experience hides Version history and Compliance details so there must be a way to configure the File Browser accordingly. I understand that you don't want to expose all File Browser configuration options but given that these commands do not work properly there needs to be a way to hide them.

For completeness, below is the File Browser configuration that is currently used in my Teams application:

{
    "sdk": "8.0",
    "authentication": {},
    "messaging": {
        "origin": "https://localhost:53000",
        "channelId": "852adf29-a4d2-43a2-a2c3-7bf923c4465c"
    },
    "theme": "dark",
    "navigation": {
        "mode": "host"
    },
    "leftNav": {
        "enabled": false
    },
    "entry": {
        "sharePoint": {
            "byPath": {
                "web": "/sites/Dev/Testing",
                "list": "/sites/Dev/Testing/MattersTesting",
                "folder": "/sites/Dev/Testing/MattersTesting/TeamsTab/Long Folder path"
            }
        }
    },
    "breadcrumb": {
        "root": {
            "sharePoint": {
                "byPath": {
                    "folder": "/sites/Dev/Testing/MattersTesting/TeamsTab/Long Folder path"
                }
            }
        }
    },
    "commands": {
        "open": {
            "handlers": [
                {
                    "filters": [
                        "folder"
                    ],
                    "target": "host"
                }
            ]
        }
    }
}
ottD commented 3 months ago

@JCrew0 Any comment regarding additional configuration options for the FileBrowser component? Thanks