GithubHelp home page GithubHelp logo

gevartrix / cai-chatbot-webpart Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 0.0 18.99 MB

A client-side SPO web part based on React for adding SAP Conversational AI chatbots.

License: MIT License

JavaScript 15.61% TypeScript 73.34% SCSS 11.05%
conversational-ai sharepoint-webpart javascript typescript react sharepoint-online sap-conversational-ai

cai-chatbot-webpart's Introduction

CAI Chatbot web part

spo spfx node ts gulp

A client-side web part for Microsoft SharePoint Online sites that integrates SAP Conversational AI chatbots on a SharePoint page.

Table of Contents

Click to expand

Summary

This web part enables admins of a SharePoint site to embed a SAP CAI chatbot on a page. It's able to connect via any of a SAP CAI chatbot's primary connection channels — Webchat or SAP CAI Web Client. The web part works by generating an appropriate script tag for the integrated chatbot based on the chosen connection channel, and by appending said tag at the end of the page's body tag.

WARNING. The integrated chatbot DOES NOT show up while testing this web part locally. The chatbot shows up only when configured on a SharePoint site page itself.

The web part is also currently localized in two languages — English and Russian. We also tried to thoroughly document the source-code with JSDoc-like comments, so feel free to browse and explore it.

Demo

Demo of CAI Chatbot web part

Project Structure

Click to expand
├── config
│   ├── config.json
│   ├── copy-assets.json
│   ├── deploy-azure-storage.json
│   ├── package-solution.json
│   ├── serve.json
│   └── write-manifests.json
├── src
│   ├── webparts
│   │   └── cai-chatbot
│   │       ├── components
│   │       │   ├── chatbot.module.scss
│   │       │   ├── chatbot.tsx
│   │       │   └── chatbotProps.ts
│   │       ├── loc
│   │       │   ├── en-us.ts
│   │       │   ├── mystrings.d.ts
│   │       │   └── ru-ru.ts
│   │       ├── chatbotPropertyPane.ts
│   │       ├── chatbotWebpart.manifest.json
│   │       ├── chatbotWebpart.ts
│   │       ├── chatbotWebpartProps.ts
│   │       └── const.ts
│   └── index.ts
├── .eslintignore
├── .eslintrc.js
├── .prettierignore
├── .prettierrc
├── .yo-rc.json
├── gulpfile.js
├── package.json
├── package-lock.json
├── tsconfig.json
└── tslint.json

Modules Used

Installation

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. There is also no guarantee or warranty that raised issues will be answered or addressed in future releases.

Prerequisites

Before proceeding, please ensure that all of the following conditions are met:

  • Your SAP Conversational AI chatbot is configured, and either the Webchat or the SAP CAI Web Client channel is created for the chatbot
  • An App Catalog has been added to your SharePoint site, and you've got the permission to upload a custom web part
  • Node.js LTS v141 is installed on your system.

Creating the .sppkg file

Note, that you can always download the latest precompiled package of this web part from this repository's Releases page.

In case you'd like to compile the .sppkg file manually, please follow these instructions.

First, clone this repository:

git clone https://github.com/gevartrix/cai-chatbot-webpart.git

Change directory to this project's root folder and install the required modules (it may take several minutes):

cd cai-chatbot-webpart\
npm install

Finally, run the following package script

npm run release

to generate the cai-chatbot.sppkg file inside the sharepoint\solution\ folder. That script executes several gulp commands, please check the package.json file for more details.

Once the .sppkg file has been compiled, you can upload it to your site's App Catalog, and the web part should appear in the "Edit" mode.

To run the web part locally, execute npm run serve.

Contributing

If you'd like to contribute to this little project, please follow these steps:

  1. Fork this repository.
  2. Create a branch: git checkout -b feature/foo.
  3. Make your changes and commit them: git commit -am 'Add foo feature'.
  4. Push your changes to the branch: git push origin feature/foo.
  5. Create a new pull request.

Pull requests are warmly welcome!

Style Guide

This application is configured with ESLint and Prettier, so you may want to check the configuration in the .eslintrc.js, .prettier.rc, tsconfig.json and tslint.json files. We also try our best adhering to the best practices listed in the Google TypeScript Style Guide.

Therefore it is recommended to lint the code before committing changes by running the following package script from the root folder:

npm run lint

License

MIT.

Footnotes

  1. Please refer to the SPFx requirements page to check the current latest supported version of Node.js. You may want to use a version management tool like nvm to install the required LTS version along with your current Node.js installation.

cai-chatbot-webpart's People

Contributors

gevartrix avatar

Stargazers

 avatar

Watchers

 avatar

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.