Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(solution): sane default value for developer fields when tab is no… #1090

Merged
merged 1 commit into from
May 18, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@ import {
BOTS_TPL,
COMPOSE_EXTENSIONS_TPL,
TEAMS_APP_SHORT_NAME_MAX_LENGTH,
DEFAULT_DEVELOPER_WEBSITE_URL,
DEFAULT_DEVELOPER_TERM_OF_USE_URL,
DEFAULT_DEVELOPER_PRIVACY_URL,
} from "../constants";
import axios, { AxiosInstance } from "axios";

Expand Down Expand Up @@ -396,11 +399,11 @@ export namespace AppStudio {
if (botId) {
manifest = replaceConfigValue(manifest, "botId", botId);
}
manifest = replaceConfigValue(
manifest,
"baseUrl",
tabEndpoint ? tabEndpoint : "https://localhost:3000"
);

if (tabEndpoint) {
manifest = replaceConfigValue(manifest, "baseUrl", tabEndpoint);
}

manifest = replaceConfigValue(manifest, "appClientId", appId);
manifest = replaceConfigValue(manifest, "appid", appId);
manifest = replaceConfigValue(
Expand All @@ -415,6 +418,12 @@ export namespace AppStudio {
updatedManifest.validDomains?.push(domain);
}

if (!tabEndpoint && updatedManifest.developer) {
updatedManifest.developer.websiteUrl = DEFAULT_DEVELOPER_WEBSITE_URL;
updatedManifest.developer.termsOfUseUrl = DEFAULT_DEVELOPER_TERM_OF_USE_URL;
updatedManifest.developer.privacyUrl = DEFAULT_DEVELOPER_PRIVACY_URL;
}

const appDefinition = convertToAppDefinition(updatedManifest, ignoreIcon);
// For local debug teams app, the app name will have a suffix to differentiate from remote teams app
// if the resulting short name length doesn't exceeds limit.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -289,3 +289,8 @@ export const CancelError = new UserError("UserCancel", "UserCancel", "Solution")
// This is the max length specified in
// https://developer.microsoft.com/en-us/json-schemas/teams/v1.7/MicrosoftTeams.schema.json
export const TEAMS_APP_SHORT_NAME_MAX_LENGTH = 30;

// Default values for the developer fields in manifest.
export const DEFAULT_DEVELOPER_WEBSITE_URL = "https://www.example.com";
export const DEFAULT_DEVELOPER_TERM_OF_USE_URL = "https://www.example.com/termofuse";
export const DEFAULT_DEVELOPER_PRIVACY_URL = "https://www.example.com/privacy";