Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

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

License

NotificationsYou must be signed in to change notification settings

ydogandjiev/microsoft-teams-test-tab

Repository files navigation

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

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 git@github.com:<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 undersrc > 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);});}});

Development Notes

  • Respect the TeamsJS functions' arguments' types and interfaces.
    • For example,externalAppCardActionsForDA.processActionOpenUrlDialog, the function definition looks like below in TeamsJS:
    exportdeclarefunctionprocessActionOpenUrlDialog(appId:AppId,actionOpenUrlDialogInfo:IActionOpenUrlDialogInfo,traceId:UUID):Promise<void>;
    • Then your test module calling the function above must have the expected types and interfaces for the arguments.
    microsoftTeams.externalAppCardActionsForDA.processActionOpenUrlDialog(newmicrosoftTeams.AppId(appId),encapActionOpenUrlDialogInfo(actionOpenUrlDialogInfo),newmicrosoftTeams.UUID(traceId))
  • Printing TeamsJS errors
    • You can print the error sent by TeamsJS when you call the TeamsJS function like below.
    microsoftTeams.externalAppCardActionsForDA.processActionOpenUrlDialog(newmicrosoftTeams.AppId(appId),encapActionOpenUrlDialogInfo(actionOpenUrlDialogInfo),newmicrosoftTeams.UUID(traceId)).then((result)=>{output(result);}).catch((error)=>{console.log('microsoft-teams-test-tab:externalAppCardActionsForDA.processActionOpenUrlDialog:',error)output(error);});
    • This way you can see the error message printed in dev tools of Teams client

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 ngrokbrew install ngrok/ngrok/ngrok# Signup on ngrok website to get an auth token# Then Setup ngrok in your machinengrok config add-authtoken<token>

Installnvm,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 startDebugger attached.> microsoft-teams-test-tab@1.0.0 start> node server.jsDebugger 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.jsonTemporarily Replace urlhttps://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 tomanifest.json before pushing your module.
  • Ensure that onlyapp.ts is modified at the time of push. You will need to add the html files and the *.js and *.js.map files that are rteferenced from the html files

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 usehttps://teams-test-tab.azurewebsites.net/ as content Url inorder to point to your changes

About

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

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

[8]ページ先頭

©2009-2025 Movatter.jp