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

Adding styleOptions to support file type restriction and single file upload #5048

Merged
merged 8 commits into from
Mar 21, 2024

Conversation

ms-jb
Copy link
Contributor

@ms-jb ms-jb commented Mar 8, 2024

Adds support for restricting the file types that can be uploaded and only allowing a single file.

Fixes #5081

Changelog Entry

Added

  • Resolves #5081. Added uploadAccept and uploadMultiple style options, by @ms-jb

Description

image

webchat-images

Design

Sample implementation:

<script>
  window.WebChat.renderWebChat(
    {
      styleOptions: {
        uploadAccept: 'image/*',
        uploadMultiple: false
      }
    },
    document.getElementById('webchat')
  );
</script>

Specific Changes

  • Added uploadAccept style option to allow restricted file types
  • Added uploadMultiple style option to allow single file uploading
  • I have added tests and executed them locally
  • I have updated CHANGELOG.md
  • I have updated documentation

Review Checklist

This section is for contributors to review your work.

  • Accessibility reviewed (tab order, content readability, alt text, color contrast)
  • Browser and platform compatibilities reviewed
  • CSS styles reviewed (minimal rules, no z-index)
  • Documents reviewed (docs, samples, live demo)
  • Internationalization reviewed (strings, unit formatting)
  • package.json and package-lock.json reviewed
  • Security reviewed (no data URIs, check for nonce leak)
  • Tests reviewed (coverage, legitimacy)

@compulim compulim enabled auto-merge (squash) March 21, 2024 18:42
@compulim compulim marked this pull request as draft March 21, 2024 18:45
auto-merge was automatically disabled March 21, 2024 18:45

Pull request was converted to draft

@compulim compulim marked this pull request as ready for review March 21, 2024 18:45
@compulim compulim merged commit 1c16476 into microsoft:main Mar 21, 2024
24 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add ability to restrict file types for attachment uploading
2 participants