-
Notifications
You must be signed in to change notification settings - Fork 112
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #217 from pnp/preview
generator-teams@3.1.0
- Loading branch information
Showing
21 changed files
with
3,465 additions
and
14,678 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,4 +13,5 @@ temp-templates | |
webpack.config.js | ||
gulpfile.js | ||
tsconfig.json | ||
.travis.yml | ||
.travis.yml | ||
.editorconfig |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
74 changes: 74 additions & 0 deletions
74
...tor-teams/src/app/manifestGeneration/manifestGenerators/generator19/TabManifestUpdater.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
// Copyright (c) Wictor Wilén. All rights reserved. | ||
// Copyright (c) Microsoft Corporation. All rights reserved. | ||
// Licensed under the MIT license. | ||
|
||
import { IManifestUpdater } from "../../IManifestUpdater"; | ||
import { GeneratorTeamsAppOptions } from "../../../GeneratorTeamsAppOptions"; | ||
import { v4 as uuid } from 'uuid'; | ||
import { OFFICE_GUID } from "../../../../tab/TabGenerator"; | ||
import { parse } from "tldjs"; | ||
|
||
export class TabManifestUpdater implements IManifestUpdater { | ||
|
||
public updateManifest(manifest: any, options: GeneratorTeamsAppOptions): void { | ||
if (options.tabType == "static") { | ||
(<any[]>manifest.staticTabs).push({ | ||
entityId: uuid(), | ||
name: options.tabTitle, | ||
contentUrl: `https://{{HOSTNAME}}/${options.tabName}/?name={loginHint}&tenant={tid}&theme={theme}`, | ||
scopes: ["personal"] | ||
}); | ||
} | ||
else if (options.tabType == "configurable") { | ||
const tab: any = { | ||
configurationUrl: `https://{{HOSTNAME}}/${options.tabName}/config.html?name={loginHint}&tenant={tid}&group={groupId}&theme={theme}`, | ||
canUpdateConfiguration: true, | ||
scopes: options.tabScopes | ||
}; | ||
if (options.tabSharePoint) { | ||
tab.sharePointPreviewImage = `https://{{HOSTNAME}}/assets/${options.tabName}-preview.png`; | ||
tab.supportedSharePointHosts = options.tabSharePointHosts; | ||
} | ||
(<any[]>manifest.configurableTabs).push(tab); | ||
} else if (options.tabType == "viva") { | ||
const tab: any = { | ||
entityId: uuid(), | ||
name: `Portals-${options.tabReactComponentName}`, | ||
contentUrl: options.vivaUrl + "/_layouts/15/teamslogon.aspx?spfx=true&dest=" + options.vivaUrl + "?app=portals", | ||
websiteUrl: options.vivaUrl, | ||
searchUrl: options.vivaUrl + "/_layouts/15/search.aspx?q={searchQuery}", | ||
scopes: [ | ||
"personal" | ||
], | ||
supportedPlatform: [ | ||
"desktop" | ||
] | ||
}; | ||
(<any[]>manifest.staticTabs).push(tab); | ||
|
||
const domain = parse(options.vivaUrl as string); | ||
|
||
manifest.webApplicationInfo = { | ||
id: OFFICE_GUID, | ||
resource: `https://${domain.hostname as string}` | ||
}; | ||
|
||
manifest.validDomains.push( | ||
domain.hostname as string, | ||
"*.login.microsoftonline.com", | ||
"*.sharepoint.com", | ||
"*.sharepoint-df.com", | ||
"spoppe-a.akamaihd.net", | ||
"spoprod-a.akamaihd.net", | ||
"resourceseng.blob.core.windows.net", | ||
"msft.spoppe.com"); | ||
} | ||
if (options.tabSSO && manifest.webApplicationInfo === undefined) { | ||
// only add SSO the first time | ||
manifest.webApplicationInfo = { | ||
id: `{{${options.tabUpperName}_APP_ID}}`, | ||
resource: `{{${options.tabUpperName}_APP_URI}}` | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.