Giter VIP home page Giter VIP logo

spfx-staff-directory's Introduction

spfx-staff-directory

Summary

SharePoint Framework web part to search the company tenant via the Graph API. Has the ability to filter by Microsoft 365 groups and departments.

image

Used SharePoint Framework Version

version

Applies to

Get your own free development tenant by subscribing to Microsoft 365 developer program

Prerequisites

This solution uses Yarn as a package manager. Delete yarn.lock before using npm.

Requires Microsoft Graph API permissions for User.ReadBasic.All (to read the directory) and Chat.Create to initiate a chat via the user popup. Grant these permissions in the SharePoint Admin Center.

This solution uses Microsoft Graph Toolkit v3. You must install the sppkg package from Microsoft before installing this app.

Solution

Solution Author(s)
/sharepoint/solution/spfx-staff-directory.sppkg MRS Company Ltd

Version history

Version Date Comments
1.1 August 30, 2023 Updated API scopes
1.0 July 17, 2023 Initial release

Disclaimer

THIS CODE IS PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.


Minimal Path to Awesome

Clone and go to repository:

git clone https://github.com/MRSCompanyLtd/spfx-staff-directory
cd spfx-staff-directory

Add your development tenant URL to /config/serve.json.

Run development:

yarn dev # runs gulp serve

Package to deploy:

yarn package # runs build, bundle, and package-solution

Upload ./sharepoint/solution/*.sppkg to app catalog.

Features

This is a full-featured staff directory web part, including:

  • Search by text for name, job title, or department.
  • Filter by a Microsoft 365 group, such as "All Staff" group for active users.
  • Optional department filter.
  • Customizable paged results.

This web part uses:

  • Microsoft Graph API - fetching users and photos
  • Batching Graph API calls
  • Use of Microsoft Graph Toolkit

spfx-staff-directory's People

Contributors

dperk6 avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar

spfx-staff-directory's Issues

Error creating sppkg

Hello,

I hope you're doing well. I wanted to ask if there is a way to obtain the sppkg file. I have been trying for a week to package it, but I haven't had any success. The "yarn dev" process is taking hours, even after setting up all the versions. I also attempted to use "npm," but encountered numerous errors. Would it be possible for you to compile the sppkg version and make it available for download? I would greatly appreciate your assistance. Thank you!

When deploying on Sharepoint it gives an error

Thank you so much for this project.
I am having a little issues when building and deploying.
Locally everything works fine, but when deploying on sharepoint, the webpart failes with this error.

Something went wrong
If the problem persists, contact the site administrator and give them the information in Technical Details.
TECHNICAL DETAILS
ERROR:
Cannot read properties of undefined (reading 'id')

CALL STACK:
TypeError: Cannot read properties of undefined (reading 'id')
at https://res-1.cdn.office.net/files/sp-client/sp-pages-assembly_en-us_b579cd4edfb4a2fae3bb11eb75f7824c.js:197:10988
at new Promise ()
at e.loadComponent (https://res-1.cdn.office.net/files/sp-client/sp-pages-assembly_en-us_b579cd4edfb4a2fae3bb11eb75f7824c.js:197:10956)
at https://res-1.cdn.office.net/files/sp-client/sp-pages-assembly_en-us_b579cd4edfb4a2fae3bb11eb75f7824c.js:197:13164
at async Promise.all (index 0)

Do you have advise how to fix it ?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.