From 5a1ab89379a69da913b2861dda22cf7e83645c7d Mon Sep 17 00:00:00 2001 From: Renovate Bot Date: Mon, 20 Apr 2020 22:31:49 +0000 Subject: [PATCH] chore: remove tracking we quit subscriptions with our tracking-providers, so there's no need for tracking code anymore. this also makes the app load faster a bit :) closes D2IQ-67221 D2IQ-67220 D2IQ-67219 --- Jenkinsfile | 1 - package-lock.json | 67 ----- package.json | 1 - plugins/auth/components/LoginModal.tsx | 1 - plugins/index.ts | 2 - .../organization/submodules/users/hooks.tsx | 4 - plugins/tracking/SDK.ts | 10 - .../tracking/__tests__/TrackingPlugin-test.ts | 32 --- plugins/tracking/actions/Actions.ts | 252 ------------------ .../actions/__tests__/Actions-test.ts | 101 ------- plugins/tracking/hooks.tsx | 138 ---------- plugins/tracking/index.ts | 13 - schema/config/config.json | 124 ++++----- scripts/ci/finalize-release | 16 -- src/index.html | 14 - .../__snapshots__/tslint-test.ts.snap | 5 - .../__snapshots__/typecheck-test.ts.snap | 32 --- src/js/config/Config.ee.template.js | 3 - src/js/config/Config.template.ts | 3 - tests/_fixtures/config/tracking-disabled.json | 9 - tests/_fixtures/config/tracking-enabled.json | 9 - 21 files changed, 56 insertions(+), 781 deletions(-) delete mode 100644 plugins/tracking/SDK.ts delete mode 100644 plugins/tracking/__tests__/TrackingPlugin-test.ts delete mode 100644 plugins/tracking/actions/Actions.ts delete mode 100644 plugins/tracking/actions/__tests__/Actions-test.ts delete mode 100644 plugins/tracking/hooks.tsx delete mode 100644 plugins/tracking/index.ts delete mode 100644 tests/_fixtures/config/tracking-disabled.json delete mode 100644 tests/_fixtures/config/tracking-enabled.json diff --git a/Jenkinsfile b/Jenkinsfile index 2fe90860ae..6eb27ae187 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -175,7 +175,6 @@ pipeline { steps { withCredentials([ string(credentialsId: "d146870f-03b0-4f6a-ab70-1d09757a51fc", variable: "GH_TOKEN"), // semantic-release - string(credentialsId: "sentry_io_token", variable: "SENTRY_AUTH_TOKEN"), // upload-build usernamePassword(credentialsId: "a7ac7f84-64ea-4483-8e66-bb204484e58f", passwordVariable: "GIT_PASSWORD", usernameVariable: "GIT_USER"), // update-dcos-repo usernamePassword(credentialsId: "6c147571-7145-410a-bf9c-4eec462fbe02", passwordVariable: "JIRA_PASS", usernameVariable: "JIRA_USER") // semantic-release-jira ]) { diff --git a/package-lock.json b/package-lock.json index 0b6a29d29d..def0130bb7 100644 --- a/package-lock.json +++ b/package-lock.json @@ -4247,43 +4247,6 @@ } } }, - "@sentry/cli": { - "version": "1.52.1", - "resolved": "https://registry.npmjs.org/@sentry/cli/-/cli-1.52.1.tgz", - "integrity": "sha512-XocAy3opa7bxWEbYQ9R/whbIb4BAX2YHXvfMoCwZRzLRy9cf85FYGQCMi8JA7wQd5PBmcxUh31AxcX7jAfMPCQ==", - "dev": true, - "requires": { - "fs-copy-file-sync": "^1.1.1", - "https-proxy-agent": "^4.0.0", - "mkdirp": "^0.5.4", - "node-fetch": "^2.1.2", - "progress": "2.0.0", - "proxy-from-env": "^1.0.0" - }, - "dependencies": { - "minimist": { - "version": "1.2.5", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz", - "integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==", - "dev": true - }, - "mkdirp": { - "version": "0.5.4", - "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.4.tgz", - "integrity": "sha512-iG9AK/dJLtJ0XNgTuDbSyNS3zECqDlAhnQW4CsNxBG3LQJBbHmRX1egw39DmtOdCAqY+dKXV+sgPgilNWUKMVw==", - "dev": true, - "requires": { - "minimist": "^1.2.5" - } - }, - "node-fetch": { - "version": "2.6.0", - "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.0.tgz", - "integrity": "sha512-8dG4H5ujfvFiqDmVu9fQ5bOHUC15JMjMY/Zumv26oOvvVJjM67KF8koCWIabKQ1GJIa9r2mMZscBq/TbdOcmNA==", - "dev": true - } - } - }, "@sindresorhus/is": { "version": "0.7.0", "resolved": "https://registry.npmjs.org/@sindresorhus/is/-/is-0.7.0.tgz", @@ -13618,12 +13581,6 @@ "dev": true, "optional": true }, - "fs-copy-file-sync": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/fs-copy-file-sync/-/fs-copy-file-sync-1.1.1.tgz", - "integrity": "sha512-2QY5eeqVv4m2PfyMiEuy9adxNP+ajf+8AR05cEi+OAzPcOj90hvFImeZhTmKLBgSd9EvG33jsD7ZRxsx9dThkQ==", - "dev": true - }, "fs-extra": { "version": "8.1.0", "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-8.1.0.tgz", @@ -16136,24 +16093,6 @@ "integrity": "sha1-7AbBDgo0wPL68Zn3/X/Hj//QPHM=", "dev": true }, - "https-proxy-agent": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-4.0.0.tgz", - "integrity": "sha512-zoDhWrkR3of1l9QAL8/scJZyLu8j/gBkcwcaQOZh7Gyh/+uJQzGVETdgT30akuwkpL8HTRfssqI3BZuV18teDg==", - "dev": true, - "requires": { - "agent-base": "5", - "debug": "4" - }, - "dependencies": { - "agent-base": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-5.1.1.tgz", - "integrity": "sha512-TMeqbNl2fMW0nMjTEPOwe3J/PRFP4vqeoNuQMG0HlMrtm5QxKqdvAkZ1pRBQ/ulIyDD5Yq0nJ7YbdD8ey0TO3g==", - "dev": true - } - } - }, "human-signals": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/human-signals/-/human-signals-1.1.1.tgz", @@ -31268,12 +31207,6 @@ "ipaddr.js": "1.9.0" } }, - "proxy-from-env": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/proxy-from-env/-/proxy-from-env-1.1.0.tgz", - "integrity": "sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg==", - "dev": true - }, "prr": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/prr/-/prr-1.0.1.tgz", diff --git a/package.json b/package.json index f15723e437..6ff6fbad1f 100644 --- a/package.json +++ b/package.json @@ -88,7 +88,6 @@ "@lingui/cli": "2.9.1", "@lingui/macro": "2.9.1", "@semantic-release/exec": "5.0.0", - "@sentry/cli": "1.52.1", "@types/classnames": "2.2.10", "@types/events": "3.0.0", "@types/graphql": "14.2.3", diff --git a/plugins/auth/components/LoginModal.tsx b/plugins/auth/components/LoginModal.tsx index f3576a080a..e6d1d6143a 100644 --- a/plugins/auth/components/LoginModal.tsx +++ b/plugins/auth/components/LoginModal.tsx @@ -124,7 +124,6 @@ export default withI18n()( return (

{Config.fullProductName}

- {Hooks.applyFilter("userLoginPolicy", null)}
); } diff --git a/plugins/index.ts b/plugins/index.ts index b51ca60c5b..901659f901 100644 --- a/plugins/index.ts +++ b/plugins/index.ts @@ -2,7 +2,6 @@ import authentication from "./auth"; import banner from "./banner/index"; import intercom from "./intercom/index"; import oauth from "./oauth/index"; -import tracking from "./tracking/index"; import uiUpdate from "./ui-update/index"; export default { @@ -25,5 +24,4 @@ export default { organization: require("./organization/index"), placement: require("./placement/index"), secrets: require("./secrets/index"), - tracking, }; diff --git a/plugins/organization/submodules/users/hooks.tsx b/plugins/organization/submodules/users/hooks.tsx index 71fb1c031e..23228f8e61 100644 --- a/plugins/organization/submodules/users/hooks.tsx +++ b/plugins/organization/submodules/users/hooks.tsx @@ -160,10 +160,6 @@ module.exports = { return null; }, - userLoginPolicy() { - return null; - }, - userModelObject(userObject) { const definition = this.userFormModalDefinition(null, null, {}); // Basically only return keys that this plugin cares about diff --git a/plugins/tracking/SDK.ts b/plugins/tracking/SDK.ts deleted file mode 100644 index 931a3ae842..0000000000 --- a/plugins/tracking/SDK.ts +++ /dev/null @@ -1,10 +0,0 @@ -let SDK; - -export default { - getSDK() { - return SDK; - }, - setSDK(pluginSDK) { - SDK = pluginSDK; - }, -}; diff --git a/plugins/tracking/__tests__/TrackingPlugin-test.ts b/plugins/tracking/__tests__/TrackingPlugin-test.ts deleted file mode 100644 index 5127c55538..0000000000 --- a/plugins/tracking/__tests__/TrackingPlugin-test.ts +++ /dev/null @@ -1,32 +0,0 @@ -import DOMUtils from "#SRC/js/utils/DOMUtils"; - -import PluginSDK from "PluginSDK"; - -jest.setMock("react-router", { - hashHistory: { - location: { pathname: "/foo" }, - listen() {}, - }, -}); - -const SDK = PluginSDK.__getSDK("tracking", { enabled: true }); -require("../SDK").default.setSDK(SDK); - -const TrackingHooks = require("../hooks").default; - -describe("TrackingHooks", () => { - describe("Listeners", () => { - beforeEach(() => { - DOMUtils.appendScript = jasmine.createSpy(); - }); - - describe("#pluginsConfigured", () => { - it("appends scripts to the document head if plugin enabled", () => { - window.analytics = { ready() {} }; - TrackingHooks.initialize(); - SDK.Hooks.doAction("pluginsConfigured"); - expect(DOMUtils.appendScript.calls.count()).toEqual(1); - }); - }); - }); -}); diff --git a/plugins/tracking/actions/Actions.ts b/plugins/tracking/actions/Actions.ts deleted file mode 100644 index 5a3843c85d..0000000000 --- a/plugins/tracking/actions/Actions.ts +++ /dev/null @@ -1,252 +0,0 @@ -import isEqual from "lodash.isequal"; -import md5 from "md5"; -import { hashHistory, match } from "react-router"; - -import RouterUtil from "#SRC/js/utils/RouterUtil"; -import Config from "#SRC/js/config/Config"; -import Util from "#SRC/js/utils/Util"; - -const SDK = require("../SDK").default.getSDK(); - -const Actions = { - previousFakePageLog: "", - - dcosMetadata: null, - - routes: null, - - logQueue: [], - - pageQueue: [], - - actions: ["log", "logFakePageView"], - - initialize() { - this.actions.forEach((action) => { - SDK.Hooks.addAction(action, this[action].bind(this)); - }); - - this.listenForDcosMetadata(); - this.start(); - }, - - metadataLoaded() { - const { metadata } = SDK.Store.getAppState(); - return metadata?.dcosMetadata && metadata?.metadata?.CLUSTER_ID; - }, - - listenForDcosMetadata() { - if (!this.metadataLoaded()) { - const unSubscribe = SDK.Store.subscribe(() => { - if (this.metadataLoaded()) { - unSubscribe(); - this.setDcosMetadata(this.mergeMetaData()); - } - }); - } else { - this.setDcosMetadata(this.mergeMetaData()); - } - }, - - mergeMetaData() { - return { - ...SDK.Store.getAppState().metadata.dcosMetadata, - clusterId: SDK.Store.getAppState().metadata.metadata.CLUSTER_ID, - }; - }, - - setDcosMetadata(metadata) { - this.dcosMetadata = metadata; - - if (this.canLog()) { - this.drainQueue(); - } - }, - - setRoutes(routes) { - this.routes = routes; - - if (this.canLog()) { - this.drainQueue(); - } - }, - - start() { - this.createdAt = Date.now(); - this.lastLogDate = this.createdAt; - this.stintID = md5(`session_${this.createdAt}`); - - hashHistory.listen( - Util.debounce((location) => { - Actions.setActivePage(location.pathname + location.search); - }, 200) - ); - - // Poll to deplete queue - const checkAnalyticsReady = () => { - setTimeout(() => { - if (!this.canLog()) { - checkAnalyticsReady(); - } else { - this.drainQueue(); - } - }, 200); - }; - checkAnalyticsReady(); - }, - - canLog() { - return ( - window.analytics && - window.analytics.initialized && - this.dcosMetadata != null && - this.routes != null - ); - }, - - drainQueue() { - this.logQueue.forEach((log) => { - this.log(log); - }); - this.logQueue = []; - - this.pageQueue.forEach((path) => { - this.logPage(path); - }); - this.pageQueue = []; - }, - - logFakePageView(fakePageLog) { - if (!this.canLog()) { - this.logQueue.push(fakePageLog); - - return; - } - - if (isEqual(this.previousFakePageLog, fakePageLog)) { - return; - } - - this.logPage(fakePageLog); - this.previousFakePageLog = fakePageLog; - }, - - setActivePage(path) { - if (path[path.length - 1] === "/") { - path = path.substring(0, path.length - 1); - } - - if (!this.canLog()) { - this.pageQueue.push(path); - - return; - } - - this.logPage(path); - }, - - getStintID() { - return this.stintID; - }, - - getLogData() { - return { - appVersion: Config.version, - version: "@@VERSION", - ...this.dcosMetadata, - }; - }, - - identify(uid) { - if (!this.canLog()) { - // Try again - setTimeout(() => { - this.identify(uid); - }, 500); - - return; - } - - if (!SDK.Hooks.applyFilter("shouldIdentifyLoggedInUser", true)) { - return; - } - - const traits = Object.assign(this.getLogData(), { email: uid }); - window.analytics.identify(uid, traits, this.getAnonymizingKeys()); - - this.log("dcos_login"); - }, - - logPage(path) { - if (!this.canLog()) { - this.pageQueue.push(path); - - return; - } - - if (typeof path === "string") { - match( - { history: hashHistory, routes: this.routes }, - (error, redirectLocation, nextState) => { - if (!error && nextState) { - let pathMatcher = RouterUtil.reconstructPathFromRoutes( - nextState.routes - ); - if (nextState.params) { - Object.keys(nextState.params).forEach((param) => { - pathMatcher = pathMatcher.replace(`:${param}?`, `[${param}]`); - pathMatcher = pathMatcher.replace(`:${param}`, `[${param}]`); - }); - } - - // Replaces '/?/' and '/?' with '/' - path = pathMatcher.replace(/\/\?\/?/g, "/"); - } else { - path = "/unknown"; - } - - this.submitToAnalytics(path); - } - ); - } - - this.submitToAnalytics(path); - }, - - submitToAnalytics(path) { - window.analytics.page( - Object.assign(this.getLogData(), this.getAnonymizingKeys().page, { path }) - ); - }, - - /** - * Logs arbitrary data - * @param {String} eventID - */ - log(eventID) { - if (!this.canLog()) { - this.logQueue.push(eventID); - - return; - } - - // Populates with basic data that all logs need - const log = this.getLogData(); - - window.analytics.track(eventID, log, this.getAnonymizingKeys()); - }, - - getAnonymizingKeys() { - return { - page: { - // Anonymize - referrer: "", - url: "", - path: "", - title: "", - }, - }; - }, -}; - -export default Actions; diff --git a/plugins/tracking/actions/__tests__/Actions-test.ts b/plugins/tracking/actions/__tests__/Actions-test.ts deleted file mode 100644 index 3be9c0bcde..0000000000 --- a/plugins/tracking/actions/__tests__/Actions-test.ts +++ /dev/null @@ -1,101 +0,0 @@ -import PluginSDK from "PluginSDK"; - -jest.setMock("react-router", { - hashHistory: { - location: "/foo", - listen() {}, - }, - match() {}, -}); - -const SDK = PluginSDK.__getSDK("tracking", { enabled: true }); -require("../../SDK").default.setSDK(SDK); -const Actions = require("../Actions").default; - -window.analytics = { - initialized: true, - page() {}, - track() {}, -}; - -const DCOS_METADATA = { - clusterId: "cluster", - "dcos-image-commit": "commit", - "bootstrap-id": "bootstrap", -}; - -const routes = [{ path: "/foo" }]; - -describe("Actions", () => { - Actions.initialize(); - - describe("#log", () => { - beforeEach(() => { - spyOn(window.analytics, "track"); - }); - - afterEach(() => { - window.analytics.track = () => {}; - }); - - it("calls analytics#track", () => { - Actions.setDcosMetadata(DCOS_METADATA); - Actions.setRoutes(routes); - Actions.log("foo"); - expect(window.analytics.track.calls.count()).toEqual(1); - }); - - it("calls analytics#track with correct eventID", () => { - Actions.setDcosMetadata(DCOS_METADATA); - Actions.setRoutes(routes); - Actions.log("baz"); - expect(window.analytics.track.calls.mostRecent().args[0]).toEqual("baz"); - }); - - it("calls analytics#track with correct log", () => { - Actions.setDcosMetadata(DCOS_METADATA); - Actions.setRoutes(routes); - Actions.log("foo"); - - const args = window.analytics.track.calls.mostRecent().args[1]; - expect(args.appVersion).toBeDefined(); - expect(args.version).toBeDefined(); - expect(args.clusterId).toBeDefined(); - expect(args["dcos-image-commit"]).toBeDefined(); - expect(args["bootstrap-id"]).toBeDefined(); - }); - }); - - describe("#setRoutes", () => { - beforeEach(() => { - Actions.dcosMetadata = null; - Actions.routes = null; - spyOn(window.analytics, "track"); - }); - - it("doesn't track any logs when there's no router", () => { - Actions.log("Test"); - expect(window.analytics.track).not.toHaveBeenCalled(); - }); - - it("sets the routes", () => { - Actions.setDcosMetadata(DCOS_METADATA); - Actions.setRoutes(routes); - expect(Actions.routes).toEqual([{ path: "/foo" }]); - }); - - it("runs queued logs when metadata is set", () => { - Actions.log("foo"); - Actions.log("bar"); - Actions.log("baz"); - spyOn(Actions, "log"); - Actions.setDcosMetadata(DCOS_METADATA); - Actions.setRoutes(routes); - expect(Actions.log.calls.count()).toEqual(3); - const calls = Actions.log.calls.all(); - ["foo", "bar", "baz"].forEach((log, i) => { - expect(calls[i].args[0]).toEqual(log); - }); - }); - }); -}); diff --git a/plugins/tracking/hooks.tsx b/plugins/tracking/hooks.tsx deleted file mode 100644 index 3b7f26fc74..0000000000 --- a/plugins/tracking/hooks.tsx +++ /dev/null @@ -1,138 +0,0 @@ -import * as React from "react"; - -import AuthStore from "#SRC/js/stores/AuthStore"; -import Config from "#SRC/js/config/Config"; -import DOMUtils from "#SRC/js/utils/DOMUtils"; -import Util from "#SRC/js/utils/Util"; -import { Hooks } from "PluginSDK"; -import Actions from "./actions/Actions"; -import dcosVersion$ from "#SRC/js/stores/dcos-version"; - -const ANALYTICS_LOAD_TIMEOUT = 2000; - -const segmentScript = `!function(){var analytics=window.analytics=window.analytics||[];if(!analytics.initialize)if(analytics.invoked)window.console&&console.error&&console.error('Segment snippet included twice.');else{analytics.invoked=!0;analytics.methods=['trackSubmit','trackClick','trackLink','trackForm','pageview','identify','group','track','ready','alias','page','once','off','on'];analytics.factory=function(t){return function(){var e=Array.prototype.slice.call(arguments);e.unshift(t);analytics.push(e);return analytics}};for(var t=0;t { - Hooks.addFilter(filter, this[filter].bind(this)); - }); - this.actions.forEach((action) => { - Hooks.addAction(action, this[action].bind(this)); - }); - - Actions.initialize(); - - if (AuthStore.getUser()) { - Actions.identify(AuthStore.getUser().uid); - } - - DOMUtils.appendScript(window.document.head, segmentScript); - }, - - pluginsLoadedCheck(promiseArray) { - const promise = new Promise((resolve) => { - window.analytics.ready(() => { - resolve(); - }); - - // Let's not block the application loading in case it takes a really - // long time to ready-up analytics or the integrations. - window.setTimeout(resolve, ANALYTICS_LOAD_TIMEOUT); - }); - - promiseArray.push(promise); - - return promiseArray; - }, - - pluginsConfigured() { - // Ensure analytics is actually ready, because in #pluginsLoadedCheck we - // may skip the check so that we don't completely block the applicaiton - const metadata = - Util.findNestedPropertyInObject(this, "configuration.metadata") || {}; - - dcosVersion$.subscribe(({ version, variant }) => { - window.analytics.ready(() => { - const setContext = () => { - if (!window.Raven) { - return; - } - - window.Raven.setTagsContext({ - ...metadata, - environment: process.env.NODE_ENV, - dcosVersion: version, - dcosVariant: variant, - }); - }; - - if (version) { - setContext(); - } - }); - }); - }, - - userLoginSuccess() { - Actions.identify(AuthStore.getUser().uid); - }, - - routes(routes) { - Actions.setRoutes(routes); - }, - - userLogoutSuccess() { - Actions.log("dcos_logout"); - }, - - userFormModalFooter() { - return null; - }, - - userLoginPolicy() { - return ( -

- By logging in to DC/OS you understand we will process personal - information in accordance with our{" "} - - Privacy Policy - - . -

- ); - }, - - userAddPolicy() { - return ( -

- By adding a user you understand we will process personal information in - accordance with our{" "} - - Privacy Policy - - . -

- ); - }, -}; diff --git a/plugins/tracking/index.ts b/plugins/tracking/index.ts deleted file mode 100644 index 3f5705f3a1..0000000000 --- a/plugins/tracking/index.ts +++ /dev/null @@ -1,13 +0,0 @@ -import SDK from "./SDK"; - -export default (PluginSDK) => { - SDK.setSDK(PluginSDK); - - const PluginHooks = require("./hooks").default; - const TrackingActions = require("./actions/Actions").default; - // Set plugin's hooks - PluginHooks.initialize(PluginSDK.config); - - // Register Actions - PluginSDK.registerActions(TrackingActions); -}; diff --git a/schema/config/config.json b/schema/config/config.json index 105cb29fa5..3e8838d470 100644 --- a/schema/config/config.json +++ b/schema/config/config.json @@ -1,72 +1,60 @@ { - "$schema": "http://json-schema.org/draft-04/schema", - "id": "http://schema.mesos/dcos/config", - "title": "DCOS Config API Endpoint", - "type": "object", - "properties" : { - "uiConfiguration": { - "type": "object", - "properties": { - "plugins": { - "type": "object", - "properties": { - "banner": { - "title": "A banner plugin", - "description": "Adds a custom header/footer banner to the UI", - "type": "object", - "properties": { - "backgroundColor": { - "title": "Background color for banners", - "description": "Color should be a valid CSS color (hex, color name)", - "type": "string" - }, - "foregroundColor": { - "title": "Text color for banners", - "description": "Color should be a valid CSS color (hex, color name)", - "type": "string" - }, - "headerTitle": { - "title": "Title for banner header", - "type": "string" - }, - "headerContent": { - "title": "Content to show in banner header", - "description": "This content is shown to the right of the banner", - "type": "string" - }, - "footerContent": { - "title": "Content to show in banner footer", - "type": "string" - }, - "imagePath": { - "title": "Optional. A path to an image", - "description": "Image size should be 32x32 pixels", - "type": "string" - }, - "dismissible": { - "title": "Dismiss banners", - "type": "boolean" - } - }, - "required": ["headerTitle", "headerContent", "footerContent"] - }, - "tracking": { - "title": "A Tracking plugin", - "description": "Adds tracking to the UI", - "type": "object", - "properties": { - "enabled": { - "title": "Enables/Disables the plugin", - "type": "boolean" - } - }, - "required": ["enabled"] - } - } + "$schema": "http://json-schema.org/draft-04/schema", + "id": "http://schema.mesos/dcos/config", + "title": "DCOS Config API Endpoint", + "type": "object", + "properties": { + "uiConfiguration": { + "type": "object", + "properties": { + "plugins": { + "type": "object", + "properties": { + "banner": { + "title": "A banner plugin", + "description": "Adds a custom header/footer banner to the UI", + "type": "object", + "properties": { + "backgroundColor": { + "title": "Background color for banners", + "description": "Color should be a valid CSS color (hex, color name)", + "type": "string" + }, + "foregroundColor": { + "title": "Text color for banners", + "description": "Color should be a valid CSS color (hex, color name)", + "type": "string" + }, + "headerTitle": { + "title": "Title for banner header", + "type": "string" + }, + "headerContent": { + "title": "Content to show in banner header", + "description": "This content is shown to the right of the banner", + "type": "string" + }, + "footerContent": { + "title": "Content to show in banner footer", + "type": "string" + }, + "imagePath": { + "title": "Optional. A path to an image", + "description": "Image size should be 32x32 pixels", + "type": "string" + }, + "dismissible": { + "title": "Dismiss banners", + "type": "boolean" } - }, - "required": ["plugins"] + }, + "required": ["headerTitle", "headerContent", "footerContent"] + } + } } - }, - "required": ["uiConfiguration"] + }, + "required": ["plugins"] + } + }, + "required": ["uiConfiguration"] } diff --git a/scripts/ci/finalize-release b/scripts/ci/finalize-release index 142010f2e0..97e16762ec 100755 --- a/scripts/ci/finalize-release +++ b/scripts/ci/finalize-release @@ -10,7 +10,6 @@ set -x # BRANCH_NAME: Branch Name to work on # GIT_USER: git user for curl command # GIT_PASSWORD: git password for curl command -# SENTRY_AUTH_TOKEN: auth token for sentry.io # aws login credentials # # run these commands from project root: @@ -59,18 +58,3 @@ cat < "${PROJECT_ROOT}/buildinfo.json" } } EOF - -# Upload source maps to sentry.io -SENTRY_AUTH_TOKEN="${SENTRY_AUTH_TOKEN}" -RELEASE_NAME="${PKG_VERSION}" -SENTRY_ORG="mesosphere" -SENTRY_PROJECT="dcos-ui" - -# Create release on Sentry -SENTRY_AUTH_TOKEN="${SENTRY_AUTH_TOKEN}" \ - npx sentry-cli releases -o "${SENTRY_ORG}" -p "${SENTRY_PROJECT}" \ - new "${PKG_VERSION}" -# Upload sourcemaps -SENTRY_AUTH_TOKEN="${SENTRY_AUTH_TOKEN}" \ - npx sentry-cli releases -o "${SENTRY_ORG}" -p "${SENTRY_PROJECT}" \ - files "${PKG_VERSION}" upload-sourcemaps ./dist diff --git a/src/index.html b/src/index.html index 75efa251de..7546a1c126 100644 --- a/src/index.html +++ b/src/index.html @@ -26,20 +26,6 @@ - diff --git a/src/js/__tests__/__snapshots__/tslint-test.ts.snap b/src/js/__tests__/__snapshots__/tslint-test.ts.snap index 8218760b07..b5704afbef 100644 --- a/src/js/__tests__/__snapshots__/tslint-test.ts.snap +++ b/src/js/__tests__/__snapshots__/tslint-test.ts.snap @@ -526,11 +526,6 @@ exports[`tslint snapshot should be up to date 1`] = ` /plugins/services/src/js/validators/MarathonAppValidators.ts - Shadowed name: 'isUnanchored' /plugins/services/src/js/validators/MarathonAppValidators.ts - Shadowed name: 'type' /plugins/services/src/js/validators/MarathonAppValidators.ts - Shadowed name: 'variables' -/plugins/tracking/__tests__/TrackingPlugin-test.ts - require statement not part of an import statement -/plugins/tracking/__tests__/TrackingPlugin-test.ts - require statement not part of an import statement -/plugins/tracking/actions/Actions.ts - require statement not part of an import statement -/plugins/tracking/actions/__tests__/Actions-test.ts - require statement not part of an import statement -/plugins/tracking/actions/__tests__/Actions-test.ts - require statement not part of an import statement /src/js/components/CollapsingString.tsx - Use a conditional expression instead of assigning to 'parent' in multiple places. /src/js/components/CosmosErrorMessage.tsx - Shadowed name: 'error' /src/js/components/ExpandingTable.tsx - Use a conditional expression instead of assigning to 'expandedRows[rowID]' in multiple places. diff --git a/src/js/__tests__/__snapshots__/typecheck-test.ts.snap b/src/js/__tests__/__snapshots__/typecheck-test.ts.snap index 1fdd764256..45de9692d5 100644 --- a/src/js/__tests__/__snapshots__/typecheck-test.ts.snap +++ b/src/js/__tests__/__snapshots__/typecheck-test.ts.snap @@ -4695,38 +4695,6 @@ plugins/services/src/js/validators/PlacementsValidators.ts: error TS2345: Argume plugins/services/src/js/validators/PlacementsValidators.ts: error TS2345: Argument of type 'string' is not assignable to parameter of type 'never'. plugins/services/src/js/validators/VipLabelsValidators.ts: error TS2769: No overload matches this call. plugins/services/src/js/validators/VipLabelsValidators.ts: error TS2769: No overload matches this call. -plugins/tracking/__tests__/TrackingPlugin-test.ts: error TS2339: Property 'analytics' does not exist on type *. -plugins/tracking/__tests__/TrackingPlugin-test.ts: error TS2339: Property 'calls' does not exist on type *. -plugins/tracking/actions/Actions.ts: error TS2339: Property 'analytics' does not exist on type *. -plugins/tracking/actions/Actions.ts: error TS2339: Property 'analytics' does not exist on type *. -plugins/tracking/actions/Actions.ts: error TS2345: Argument of type 'any' is not assignable to parameter of type 'never'. -plugins/tracking/actions/Actions.ts: error TS2345: Argument of type 'any' is not assignable to parameter of type 'never'. -plugins/tracking/actions/Actions.ts: error TS2339: Property 'stintID' does not exist on type *. -plugins/tracking/actions/Actions.ts: error TS2698: Spread types may only be created from object types. -plugins/tracking/actions/Actions.ts: error TS2339: Property 'analytics' does not exist on type *. -plugins/tracking/actions/Actions.ts: error TS2345: Argument of type 'any' is not assignable to parameter of type 'never'. -plugins/tracking/actions/Actions.ts: error TS6133: 'redirectLocation' is declared but its value is never read. -plugins/tracking/actions/Actions.ts: error TS2339: Property 'analytics' does not exist on type *. -plugins/tracking/actions/Actions.ts: error TS2345: Argument of type 'any' is not assignable to parameter of type 'never'. -plugins/tracking/actions/Actions.ts: error TS2339: Property 'analytics' does not exist on type *. -plugins/tracking/actions/Actions.ts: error TS2339: Property 'createdAt' does not exist on type *. -plugins/tracking/actions/Actions.ts: error TS2339: Property 'lastLogDate' does not exist on type *. -plugins/tracking/actions/Actions.ts: error TS2339: Property 'createdAt' does not exist on type *. -plugins/tracking/actions/Actions.ts: error TS2339: Property 'stintID' does not exist on type *. -plugins/tracking/actions/Actions.ts: error TS2339: Property 'createdAt' does not exist on type *. -plugins/tracking/actions/__tests__/Actions-test.ts: error TS2339: Property 'analytics' does not exist on type *. -plugins/tracking/actions/__tests__/Actions-test.ts: error TS2339: Property 'analytics' does not exist on type *. -plugins/tracking/actions/__tests__/Actions-test.ts: error TS2339: Property 'analytics' does not exist on type *. -plugins/tracking/actions/__tests__/Actions-test.ts: error TS2339: Property 'analytics' does not exist on type *. -plugins/tracking/actions/__tests__/Actions-test.ts: error TS2339: Property 'analytics' does not exist on type *. -plugins/tracking/actions/__tests__/Actions-test.ts: error TS2339: Property 'analytics' does not exist on type *. -plugins/tracking/actions/__tests__/Actions-test.ts: error TS2339: Property 'analytics' does not exist on type *. -plugins/tracking/actions/__tests__/Actions-test.ts: error TS2339: Property 'analytics' does not exist on type *. -plugins/tracking/hooks.tsx: error TS2339: Property 'configuration' does not exist on type *. -plugins/tracking/hooks.tsx: error TS2339: Property 'analytics' does not exist on type *. -plugins/tracking/hooks.tsx: error TS2339: Property 'analytics' does not exist on type *. -plugins/tracking/hooks.tsx: error TS2339: Property 'Raven' does not exist on type *. -plugins/tracking/hooks.tsx: error TS2339: Property 'Raven' does not exist on type *. plugins/ui-update-private/SDK.ts: error TS2451: Cannot redeclare block-scoped variable 'SDK'. plugins/ui-update-private/hooks.ts: error TS2571: Object is of type 'unknown'. plugins/ui-update-private/hooks.ts: error TS2571: Object is of type 'unknown'. diff --git a/src/js/config/Config.ee.template.js b/src/js/config/Config.ee.template.js index baef01695f..f0a081848d 100644 --- a/src/js/config/Config.ee.template.js +++ b/src/js/config/Config.ee.template.js @@ -52,9 +52,6 @@ const ConfigDev = { secrets: { enabled: enterprise, }, - tracking: { - enabled: true, - }, }, }, clusterConfiguration: { diff --git a/src/js/config/Config.template.ts b/src/js/config/Config.template.ts index ac7d62b004..3015e3d06a 100644 --- a/src/js/config/Config.template.ts +++ b/src/js/config/Config.template.ts @@ -27,9 +27,6 @@ export default { "overview-detail": { enabled: true, }, - tracking: { - enabled: false, - }, }, }, clusterConfiguration: { diff --git a/tests/_fixtures/config/tracking-disabled.json b/tests/_fixtures/config/tracking-disabled.json deleted file mode 100644 index 688b408cd8..0000000000 --- a/tests/_fixtures/config/tracking-disabled.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "uiConfiguration": { - "plugins": { - "tracking": { - "enabled": false - } - } - } -} diff --git a/tests/_fixtures/config/tracking-enabled.json b/tests/_fixtures/config/tracking-enabled.json deleted file mode 100644 index fc81216386..0000000000 --- a/tests/_fixtures/config/tracking-enabled.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "uiConfiguration": { - "plugins": { - "tracking": { - "enabled": true - } - } - } -}