Coder Social home page Coder Social logo

gauravkeshre / microsoft-teams-test-tab Goto Github PK

View Code? Open in Web Editor NEW

This project forked from ydogandjiev/microsoft-teams-test-tab

0.0 1.0 0.0 12.62 MB

A test tab for Microsoft Teams used to exercise the platform and SDK

Home Page: https://teams-test-tab.azurewebsites.net

License: MIT License

JavaScript 79.65% TypeScript 9.85% CSS 2.90% HTML 7.60%

microsoft-teams-test-tab's Introduction

This documents outlines the steps required to add your changes to Microsoft Teams Test App and run the app in your local environment.

Code Setup and contribution

Github Link

microsoft-teams-test-tab on github

Fork

It is recommended to fork the repo into your github account. This will be handy when you are contributing back to the repo.

Click here to fork

Clone

Clone the repo from your fork

$ git clone [email protected]:<username>/microsoft-teams-test-tab.git

You can now create a branch in your forked version and start writing code for adding the missing SDK event.

Add your module

The only file you need to change is under src > app.js

Just add a code block identical to the one shown below

addModule({
      name: "navigateToTab",
      initializedRequired: true,
      hasOutput: true,
      inputs: [{
        type: "object",
        name: "tabInstance",
      }],
      action: (tabInstance: microsoftTeams.TabInstance, output) => {
        microsoftTeams.navigateToTab(tabInstance, (status: boolean, reason?: string) => {
          if (reason) {
            output(reason);
            return;
          }
          output(status);
      });
      } 
    });

Running in local

To be able to finally build, deploy and side load the app in Teams you need to

  1. Install dependencies
  2. Run the code in local
  3. Create a tunnel to the localhost using ngrok
  4. Update the manifest file to point to newly started ngrok server.
  5. Bundle the manifest with icons
  6. Sideload the bundle to Teams.

Pre requisites

  • Microsoft Teams is installed and you have an account

  • ngrok or equivalent tunnelling solution

ngrok setup

# Install homebrew
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

# Install ngrok
brew install ngrok/ngrok/ngrok

# Signup on ngrok website to get an auth token
# Then Setup ngrok in your machine
ngrok config add-authtoken <token>

Install nvm, node, npm, webpack

NOTE: Add -g in case you want these installation to happen across your system and not just in this project scope.

# Install nvm
$ curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.3/install.sh | bash

# Install Node
$ nvm install node

# Install npm
$ nvm install-latest-npm

#Install Express
$ npm install express

# Install webpack
$ npm install --save-dev webpack 

Install dependencies

$ cd microsoft-teams-test-tab 
$ yarn link

Run the code in local

# Start server
$ npm run start

Debugger attached.

> [email protected] start
> node server.js

Debugger attached.
Listening on http://localhost:3000

Create a tunnel to the localhost using ngrok

  1. Open a new terminal window and
  2. Start ngrok and preserve the url
$ ngrok http --host-header=rewrite 3000

                                                                                                                                     
Session Status                online                                                                                                 
Account                       •••••••••• (Plan: Free)                                                                              
Update                        update available (version 3.3.0, Ctrl-U to update)                                                     
Version                       3.1.0                                                                                                  
Region                        India (in)                                                                                             
Latency                       35ms                                                                                                   
Web Interface                 http://127.0.0.1:4040                                                                                  
Forwarding                    https://baab-2442-202-2002-ecce-4c65-1e1d-6539-de1f.ngrok-free.app -> http://localhost:3000            
                                                                                                                                     
Connections                   ttl     opn     rt1     rt5     p50     p90                                                            
                              0       0       0.00    0.00    0.00    0.00                                                           

Update the manifest file to point to newly started ngrok server.

Under Package. manifest.json Temporarily Replace url https://teams-test-tab.azurewebsites.net with ngrok url (https://{uuid}.ngrok-free.app )

Bundle the manifest with icons

  • Select manifest.json, color.png, outline.png
  • create a zip file

Sideload the bundle to Teams.

  • Sideload this zip file into Teams.
  • From App tray select "Teams Test Tab"

Contribute

You can now push the changes and eventually create a PR for main project.

  • Ensure that you remove the temporary changes made to manifest.json before pushing your module.
  • Ensure that only app.js is modified at the time of push

Sample PR: https://github.com/ydogandjiev/microsoft-teams-test-tab/pull/86/files


Old Readme

How to deploy test app for sdk changes that are not release as npm package

use yarn link to your microsoft-teams-library-js and do changes in app.ts run 'yarn build-' inorder to put outputfiles inside public/ folder check-in changes inside public/ only to master branch In test app use https://teams-test-tab.azurewebsites.net/ as content Url inorder to point to your changes

microsoft-teams-test-tab's People

Contributors

ydogandjiev avatar erinha avatar sachingupta avatar charpercyr avatar juliandeng avatar cloudtx avatar lnnl avatar noahdarveau-msft avatar v-singaja avatar gauravkeshre avatar jadahiya-msft avatar ht4963-ms avatar sagarpant74 avatar kpolnitz avatar sonaljhamicrosoft avatar dependabot[bot] avatar debajyoti251088 avatar vvekariyams avatar samyuktha-tamvada avatar parthiiita avatar shivangibeniwal avatar shrshindemsft avatar czack810150 avatar sonaljha avatar ronakbakshi avatar richardle798 avatar pankajmi2 avatar ln613 avatar marcinjuraszek avatar dimok87 avatar

Watchers

James Cloos 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.