From dd4fba2bf131f6e33645ecf6a24ade66597c23ba Mon Sep 17 00:00:00 2001 From: Jamie V Date: Thu, 16 Nov 2023 11:37:29 -0800 Subject: [PATCH 1/4] remove unproblematic use of innerHTMl and simplify --- src/identity/LoginService.js | 8 ++++++-- src/identity/login.html | 1 - 2 files changed, 6 insertions(+), 3 deletions(-) delete mode 100644 src/identity/login.html diff --git a/src/identity/LoginService.js b/src/identity/LoginService.js index 7e27653..8e8619b 100644 --- a/src/identity/LoginService.js +++ b/src/identity/LoginService.js @@ -48,9 +48,13 @@ define( LoginService.prototype.show = function () { this.overlay = document.createElement('div'); this.overlay.classList.add('u-contents'); - this.overlay.innerHTML = loginTemplate; + + const iframe = document.createElement('iframe'); + iframe.classList.add('c-login-overlay'); + iframe.src = this.getLoginUrl(); + + this.overlay.appendChild(iframe); document.body.appendChild(this.overlay); - this.overlay.querySelector('iframe').src = this.getLoginUrl(); }; /** diff --git a/src/identity/login.html b/src/identity/login.html deleted file mode 100644 index 9799db4..0000000 --- a/src/identity/login.html +++ /dev/null @@ -1 +0,0 @@ - From 4684560051112e1ee2a534a63eeedef896b562c3 Mon Sep 17 00:00:00 2001 From: Jamie V Date: Thu, 16 Nov 2023 11:49:04 -0800 Subject: [PATCH 2/4] add sanitize library use sanatize library, clean up link plugin --- package.json | 1 + src/link/plugin.js | 12 +++++++++--- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index 4d78dd1..3b369d1 100644 --- a/package.json +++ b/package.json @@ -3,6 +3,7 @@ "version": "5.2.0-rc1", "description": "Open MCT for MCWS", "devDependencies": { + "@braintree/sanitize-url": "6.0.2", "axios": "^0.21.2", "babel-loader": "8.2.3", "babel-plugin-istanbul": "6.1.1", diff --git a/src/link/plugin.js b/src/link/plugin.js index 1b2a53a..fb17b3e 100644 --- a/src/link/plugin.js +++ b/src/link/plugin.js @@ -1,7 +1,7 @@ define([ - + '@braintree/sanitize-url' ], function ( - + urlSanitizeLib ) { function LinkPlugin() { @@ -32,7 +32,13 @@ define([ view: function (domainObject) { return { show: function (container) { - container.innerHTML = '' + domainObject.name + '' + container.textContent = ''; + + const anchor = document.createElement('a'); + anchor.href = urlSanitizeLib.sanitizeUrl(domainObject.url); + anchor.textContent = domainObject.name; + + container.appendChild(anchor); }, destroy: function () {} }; From 8c5dd06cc779b34e66a6184dc7d7652491345b8b Mon Sep 17 00:00:00 2001 From: Jamie V Date: Thu, 16 Nov 2023 13:23:28 -0800 Subject: [PATCH 3/4] removing unused import --- src/identity/LoginService.js | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/identity/LoginService.js b/src/identity/LoginService.js index 8e8619b..0fae4a9 100644 --- a/src/identity/LoginService.js +++ b/src/identity/LoginService.js @@ -1,9 +1,7 @@ /*global define*/ define( - [ - './login.html' - ], - function (loginTemplate) { + [], + function () { /** From c38ec053193feddc25ac073a51d42cd6d695378d Mon Sep 17 00:00:00 2001 From: Jamie V Date: Thu, 16 Nov 2023 16:27:56 -0800 Subject: [PATCH 4/4] version boost --- package.json | 4 ++-- pom.xml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index 3b369d1..6424e41 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "openmct-mcws", - "version": "5.2.0-rc1", + "version": "5.2.0-rc2", "description": "Open MCT for MCWS", "devDependencies": { "@braintree/sanitize-url": "6.0.2", @@ -32,7 +32,7 @@ "mini-css-extract-plugin": "2.6.0", "moment": "2.29.4", "node-bourbon": "^4.2.3", - "openmct": "nasa/openmct#omm-r5.2.0-rc1", + "openmct": "nasa/openmct#omm-r5.2.0-rc2", "openmct-legacy-support": "akhenry/openmct-legacy-support#omm-r5.1.0-rc1", "printj": "^1.2.1", "raw-loader": "^0.5.1", diff --git a/pom.xml b/pom.xml index 3fd33df..7582a5f 100644 --- a/pom.xml +++ b/pom.xml @@ -6,7 +6,7 @@ gov.nasa.arc.wtd openmct-client Open MCT for MCWS Client - 5.2.0-rc1 + 5.2.0-rc2 war