From 15f9146ac952ba432ce5c172025a5bd23b0cf67b Mon Sep 17 00:00:00 2001 From: Steve Faulkner Date: Mon, 13 Jul 2020 09:41:41 -0500 Subject: [PATCH] Remove correlation iframe (#83) Co-authored-by: Steve Faulkner --- .eslintignore | 1 - src/Index.ts | 10 ---------- src/Shared/Ajax.ts | 43 ------------------------------------------- src/index.html | 2 -- 4 files changed, 56 deletions(-) delete mode 100644 src/Shared/Ajax.ts diff --git a/.eslintignore b/.eslintignore index 281a7cb83..96205255a 100644 --- a/.eslintignore +++ b/.eslintignore @@ -271,7 +271,6 @@ src/Shared/AddCollectionUtility.test.ts src/Shared/AddCollectionUtility.ts src/Shared/AddDatabaseUtility.test.ts src/Shared/AddDatabaseUtility.ts -src/Shared/Ajax.ts src/Shared/Constants.ts src/Shared/DefaultExperienceUtility.test.ts src/Shared/DefaultExperienceUtility.ts diff --git a/src/Index.ts b/src/Index.ts index 873288963..a86e0a63b 100644 --- a/src/Index.ts +++ b/src/Index.ts @@ -2,22 +2,12 @@ import "../less/index.less"; import "./Libs/jquery"; import * as ko from "knockout"; -import { CorrelationBackend } from "./Common/Constants"; -import Ajax from "./Shared/Ajax"; class Index { public navigationSelection: ko.Observable; - public correlationSrc: ko.Observable; constructor() { this.navigationSelection = ko.observable("quickstart"); - this.correlationSrc = ko.observable(""); - - Ajax.get("/_explorer/installation_id.txt").then(result => { - // TODO: Detect correct URL for each environment automatically. - const url: string = `${CorrelationBackend.Url}?emulator_id=${result}`; - this.correlationSrc(url); - }); } public quickstart_click() { diff --git a/src/Shared/Ajax.ts b/src/Shared/Ajax.ts deleted file mode 100644 index 4cc4a86f2..000000000 --- a/src/Shared/Ajax.ts +++ /dev/null @@ -1,43 +0,0 @@ -import Q from "q"; -import $ from "jquery"; - -export default class Ajax { - public static head(url: string): Q.Promise { - return Ajax._ajax(url, "HEAD"); - } - - public static post(url: string, data?: any): Q.Promise { - return Ajax._ajax(url, "POST", data); - } - - public static put(url: string, data?: any): Q.Promise { - return Ajax._ajax(url, "PUT", data); - } - - public static get(url: string, data?: any): Q.Promise { - return Ajax._ajax(url, "GET", data); - } - - public static Delete(url: string, data?: any): Q.Promise { - return Ajax._ajax(url, "DELETE", data); - } - - static _ajax(url: string, method: string, data?: any): Q.Promise { - return Q($.ajax(url, Ajax._getNetAjaxSettings(url, method, data))); - } - - static _getNetAjaxSettings(url: string, method: string, data?: any): JQueryAjaxSettings { - var newSettings: JQueryAjaxSettings = { - url: url, - type: method, - cache: false, - contentType: "application/json", - traditional: true - }; - - if (!!data) { - newSettings.data = typeof data === "string" ? data : JSON.stringify(data || {}); - } - return newSettings; - } -} diff --git a/src/index.html b/src/index.html index e2b35123d..14dd33a2e 100644 --- a/src/index.html +++ b/src/index.html @@ -56,7 +56,5 @@ data-bind="visible: navigationSelection() === 'explorer'" > - -