Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

File Picker - Cannot select file in designated SharePoint folder #78

Open
kpoimenidis opened this issue Jun 28, 2024 · 0 comments
Open

Comments

@kpoimenidis
Copy link

kpoimenidis commented Jun 28, 2024

Describe the bug
In the File Picker, providing a path in typesAndSources.locations.sharePoint.folder disables file selection.

To Reproduce
Steps to reproduce the behavior:
Use the following File Picker configuration for entry, selection and typesAndSources.

{
  sdk: "8.0",
  entry: {
    sharePoint: {
      byPath: {
        web: "/sites/<site_name>",
        list: "/sites/<site_name>/Shared Documents",
        folder: "/sites/<site_name>/Shared Documents/<folder_name>",
        fallbackToRoot: true,
      },
    },
  },
  selection: {
    mode: "single",
    maximumCount: 1,
    enablePersistence: false,
  },
  typesAndSources: {
    mode: "all",
    locations: {
      sharePoint: {
        byPath: {
          web: "/sites/<site_name>",
          list: "/sites/<site_name>/Shared Documents",
          folder: "/sites/<site_name>/Shared Documents/<folder_name>",
        },
      },
    },
  },
}

Expected behavior
I would expect:

  • the file picker to open at the designated location (it works)
  • the user cannot navigate higher, e.g. to Shared Documents (it works)
  • both files and folders can be selected in that location and deeper nested locations (it doesn't work, only folders can be selected despite mode="all"

Screenshots
Screenshot 2024-06-28 at 1 35 01 PM

Details
Please provide details around your solution, what you are trying to achieve with our shared controls, and where you believe the bug exists. The more details you can share the easier it is for us to investigate the issue. Thanks!
What I am trying to achieve is to allow a user to select a file from a Teams channel, which translates to /sites/Shared Documents/General for the sharepoint path.

Providing the sharePoint.byPath configuration from above, the file picker opens at the correct location and the user is restricted to that folder and deeper, but the files are all disabled.

Additional context
The full configuration.

{
  sdk: "8.0",
  entry: {
    sharePoint: {
      byPath: {
        web: "/sites/<site_name>",
        list: "/sites/<site_name>/Shared Documents",
        folder: "/sites/<site_name>/Shared Documents/<folder_name>",
        fallbackToRoot: true,
      },
    },
  },
  selection: {
    mode: "single",
    maximumCount: 1,
    enablePersistence: false,
  },
  typesAndSources: {
    mode: "all",
    locations: {
      sharePoint: {
        byPath: {
          web: "/sites/<site_name>",
          list: "/sites/<site_name>/Shared Documents",
          folder: "/sites/<site_name>/Shared Documents/<folder_name>",
        },
      },
    },
  },
  leftNav: {
    enabled: false,
  },
  messaging: {
    origin: location.origin,
    channelId: CHANNEL_ID,
  },
  list: {
    layout: {
      type: "compact-details",
    },
    scrolling: {
      enableStickyHeaders: true,
    },
  },
  commands: {
    upload: {
      enabled: false,
    },
    browseThisDevice: {
      enabled: false,
    },
    fromALink: {
      enabled: false,
    },
    switchAccount: {
      mode: "none",
    },
    manageAccounts: {
      mode: "none",
    },
    createFolder: {
      enabled: false,
    },
  },
}
@kpoimenidis kpoimenidis changed the title Cannot select file in designated SharePoint folder File Picker - Cannot select file in designated SharePoint folder Jun 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant