From 57cb229bc0c384bd12ce7f1b90a256bca45eb3c8 Mon Sep 17 00:00:00 2001 From: Shakeh Brys Date: Thu, 28 Mar 2019 12:56:46 -0700 Subject: [PATCH 1/8] component to run xlr given a template id and task name. --- Gruntfile.js | 6 +++ app/js/mms/directives/runXlr.js | 92 +++++++++++++++++++++++++++++++++ src/lib/ckeditor/config.js | 3 +- 3 files changed, 100 insertions(+), 1 deletion(-) create mode 100644 app/js/mms/directives/runXlr.js diff --git a/Gruntfile.js b/Gruntfile.js index 513ac1a34..69e4b3c51 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -67,6 +67,12 @@ module.exports = function(grunt) { host: 'mms-ts-uat.jpl.nasa.gov',//'localhost',//'100.64.243.161', port: 8080 }, + { + context: '/xlrapi', + https: serverHttps, + host: servers[key], + port: serverPort + }, { context: '/alfresco', // '/api' host: servers[key], diff --git a/app/js/mms/directives/runXlr.js b/app/js/mms/directives/runXlr.js new file mode 100644 index 000000000..567a5f9a4 --- /dev/null +++ b/app/js/mms/directives/runXlr.js @@ -0,0 +1,92 @@ +'use strict'; + +angular.module('mms.directives') + .directive('runXlr', ['$http', '$uibModal', '$window', 'growl', 'ApplicationService', runXlr]); + +function runXlr($http, $uibModal, $window, growl, ApplicationService) { + return { + template: '', + scope: { + templateId: '@', + xlrTaskName: '@' + }, + controller: ['$scope', runXlrCtrl], + link: runXlrLink + }; + function runXlrLink(scope, element, attrs, ctrls) {} + + function runXlrCtrl($scope) { + var modalOpen = false; + $scope.xlrTaskName = $scope.xlrTaskName ? $scope.xlrTaskName : 'Sync FN to JPL Network'; + $scope.runXLR = runXLR; + function runXLR() { + + modalOpen = true; + $uibModal.open({ + template: '', + scope: $scope, + backdrop: 'static', + controller: ['$scope', '$uibModalInstance', function ($scope, $uibModalInstance) { + $scope.credentials = { + username: '', + password: '' + }; + $scope.spin = false; + + function make_base_auth(user, password) { + var tok = user + ':' + password; + var hash = $window.btoa(tok); + return "Basic " + hash; + } + $scope.login = function (credentials) { + $scope.spin = true; + var baseAuth = make_base_auth(credentials.username, credentials.password); + var email = credentials.username + '@jpl.nasa.gov'; + var postBody = { + "releaseTitle": "CAE Portal Sync", + "releaseVariables": { + "contentEditor": credentials.username, + "editorEmail": email + }, + "autoStart": true + }; + + var link = "/xlrapi/v1/templates/Applications/" + $scope.templateId + "/create"; + var config = { + method: 'POST', + url: link, + headers: { + 'Authorization': baseAuth, + "Content-Type": "application/json", + "cache-control": "no-cache", + }, + "data": postBody, + "withCredentials": true, + "async": true, + "crossDomain": true, + "processData": false + }; + $http(config).then(function() { + growl.success($scope.xlrTaskName + ' is running. You will receive a completion email'); + }, function(error){ + growl.error($scope.xlrTaskName + ' has failed.'); + }).finally(function() { + $scope.spin = false; + modalOpen = false; + $uibModalInstance.dismiss(); + }); + }; + }], + size: 'md' + }).result.finally(function(){ + modalOpen = false; + }); + + } + + } +} diff --git a/src/lib/ckeditor/config.js b/src/lib/ckeditor/config.js index 7fa77d6ba..1dd6ff2dd 100644 --- a/src/lib/ckeditor/config.js +++ b/src/lib/ckeditor/config.js @@ -22,7 +22,8 @@ CKEDITOR.editorConfig = function( config ) { config.autoGrow_onStartup = true; config.startupFocus = 'end'; config.mathJaxLib = 'https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.1/MathJax.js?config=TeX-AMS-MML_HTMLorMML'; - config.allowedContent = true; + config.allowedContent = true; + config.extraAllowedContent = 'mms-run-xlr'; config.specialChars = ['€', '‘', '’', '“', '”', '–', '—', '¡', '¢', '£', '¤', '¥', '¦', '§', '¨', '©', 'ª', '«', '¬', '®', '¯', '°', '²', '³', '´', 'µ', '¶', '·', '¸', '¹', 'º', '»', '¼', '½', '¾', '¿', 'À', 'Á', 'Â', 'Ã', 'Ä', 'Å', 'Æ', 'Ç', 'È', 'É', 'Ê', 'Ë', 'Ì', 'Í', 'Î', 'Ï', 'Ð', 'Ñ', 'Ò', 'Ó', 'Ô', 'Õ', 'Ö', '×', 'Ø', 'Ù', 'Ú', 'Û', 'Ü', 'Ý', 'Þ', 'ß', 'à', 'á', 'â', 'ã', 'ä', 'å', 'æ', 'ç', 'è', 'é', 'ê', 'ë', 'ì', 'í', 'î', 'ï', 'ð', 'ñ', 'ò', 'ó', 'ô', 'õ', 'ö', '÷', 'ø', 'ù', 'ú', 'û', 'ü', 'ý', 'þ', 'ÿ', 'Œ', 'œ', 'Ŵ', 'Ŷ', 'ŵ', 'ŷ', '‚', '‛', '„', '…', '™', '►', '•', '→', '⇒', '⇔', '♦', '≈','α','β','γ','δ','ε','ζ','η','θ','ι','κ','λ','μ','ν','ξ','ο','π','ρ','σ','τ','υ','φ','χ','ψ','ω','Α','Β','Γ','Δ','Ε','Ζ','Η','Θ','Ι','Κ','Λ','Μ','Ν','Ξ','Ο','Π','Ρ','Σ','Τ','Υ','Φ','Χ','Ψ','Ω']; //config.protectedSource.push( /]*><\/i>/g ); From 7655ec747fa76840151c47ace1d505f4f7cbc662 Mon Sep 17 00:00:00 2001 From: "Lam, Doris T (319E)" Date: Tue, 2 Apr 2019 16:29:16 -0700 Subject: [PATCH 2/8] fix icons in search results --- src/directives/mmsSearch.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/directives/mmsSearch.js b/src/directives/mmsSearch.js index e4f3c1282..0426047d0 100644 --- a/src/directives/mmsSearch.js +++ b/src/directives/mmsSearch.js @@ -113,7 +113,7 @@ function mmsSearch($window, $anchorScroll, CacheService, ElementService, Project scope.getTypeClass = function (element) { // Get Type - scope.elementTypeClass = UtilsService.getElementTypeClass(element, ViewService.getElementType(element)); + return UtilsService.getElementTypeClass(element, ViewService.getElementType(element)); }; // Set search options From 57584fef88e01f31c3a75d2da7acb2f525679a3d Mon Sep 17 00:00:00 2001 From: Shakeh Brys Date: Tue, 2 Apr 2019 22:32:08 -0700 Subject: [PATCH 3/8] cleanup --- app/js/mms/directives/runXlr.js | 2 +- src/lib/ckeditor/config.js | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/app/js/mms/directives/runXlr.js b/app/js/mms/directives/runXlr.js index 567a5f9a4..4e4eb94a1 100644 --- a/app/js/mms/directives/runXlr.js +++ b/app/js/mms/directives/runXlr.js @@ -1,6 +1,6 @@ 'use strict'; -angular.module('mms.directives') +angular.module('mmsApp') .directive('runXlr', ['$http', '$uibModal', '$window', 'growl', 'ApplicationService', runXlr]); function runXlr($http, $uibModal, $window, growl, ApplicationService) { diff --git a/src/lib/ckeditor/config.js b/src/lib/ckeditor/config.js index 1dd6ff2dd..9b8c8d934 100644 --- a/src/lib/ckeditor/config.js +++ b/src/lib/ckeditor/config.js @@ -23,7 +23,6 @@ CKEDITOR.editorConfig = function( config ) { config.startupFocus = 'end'; config.mathJaxLib = 'https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.1/MathJax.js?config=TeX-AMS-MML_HTMLorMML'; config.allowedContent = true; - config.extraAllowedContent = 'mms-run-xlr'; config.specialChars = ['€', '‘', '’', '“', '”', '–', '—', '¡', '¢', '£', '¤', '¥', '¦', '§', '¨', '©', 'ª', '«', '¬', '®', '¯', '°', '²', '³', '´', 'µ', '¶', '·', '¸', '¹', 'º', '»', '¼', '½', '¾', '¿', 'À', 'Á', 'Â', 'Ã', 'Ä', 'Å', 'Æ', 'Ç', 'È', 'É', 'Ê', 'Ë', 'Ì', 'Í', 'Î', 'Ï', 'Ð', 'Ñ', 'Ò', 'Ó', 'Ô', 'Õ', 'Ö', '×', 'Ø', 'Ù', 'Ú', 'Û', 'Ü', 'Ý', 'Þ', 'ß', 'à', 'á', 'â', 'ã', 'ä', 'å', 'æ', 'ç', 'è', 'é', 'ê', 'ë', 'ì', 'í', 'î', 'ï', 'ð', 'ñ', 'ò', 'ó', 'ô', 'õ', 'ö', '÷', 'ø', 'ù', 'ú', 'û', 'ü', 'ý', 'þ', 'ÿ', 'Œ', 'œ', 'Ŵ', 'Ŷ', 'ŵ', 'ŷ', '‚', '‛', '„', '…', '™', '►', '•', '→', '⇒', '⇔', '♦', '≈','α','β','γ','δ','ε','ζ','η','θ','ι','κ','λ','μ','ν','ξ','ο','π','ρ','σ','τ','υ','φ','χ','ψ','ω','Α','Β','Γ','Δ','Ε','Ζ','Η','Θ','Ι','Κ','Λ','Μ','Ν','Ξ','Ο','Π','Ρ','Σ','Τ','Υ','Φ','Χ','Ψ','Ω']; //config.protectedSource.push( /]*><\/i>/g ); From aecbce9dc26156ec252adae00da55f3756230ce9 Mon Sep 17 00:00:00 2001 From: Ellen Date: Thu, 4 Apr 2019 11:04:35 -0700 Subject: [PATCH 4/8] Add instructions for inserting cross reference --- app/partials/mms/add-pe.html | 1 + app/partials/mms/new-view.html | 1 + 2 files changed, 2 insertions(+) diff --git a/app/partials/mms/add-pe.html b/app/partials/mms/add-pe.html index 36f246e39..0f50db19f 100644 --- a/app/partials/mms/add-pe.html +++ b/app/partials/mms/add-pe.html @@ -25,6 +25,7 @@

Add {{presentationElemType | lowerc
+

Begin by searching for the {{presentationElemType | lowercase}}, then click its name or documentation to add to document.

diff --git a/app/partials/mms/new-view.html b/app/partials/mms/new-view.html index 561807b9e..e5bf433a3 100644 --- a/app/partials/mms/new-view.html +++ b/app/partials/mms/new-view.html @@ -22,6 +22,7 @@

Add view

+

Begin by searching for the view, then click its name or documentation to add to document.


From d19456616c54864fd880456e56fdc77882d6be5c Mon Sep 17 00:00:00 2001 From: "Lam, Doris T (319E)" Date: Thu, 4 Apr 2019 11:25:11 -0700 Subject: [PATCH 5/8] hide filter on add existing view --- app/js/mms/controllers/tree.controller.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/js/mms/controllers/tree.controller.js b/app/js/mms/controllers/tree.controller.js index c0e479961..be2810263 100644 --- a/app/js/mms/controllers/tree.controller.js +++ b/app/js/mms/controllers/tree.controller.js @@ -691,7 +691,8 @@ function($anchorScroll, $q, $filter, $location, $uibModal, $scope, $rootScope, $ $scope.searchOptions = { callback: addExistingView, itemsPerPage: 200, - filterQueryList: [queryFilter] + filterQueryList: [queryFilter], + hideFilterOptions: true }; $scope.ok = function() { From d7cd92bd408aa3df1be398915b8341ad26e75ba9 Mon Sep 17 00:00:00 2001 From: Ellen Date: Thu, 4 Apr 2019 11:38:45 -0700 Subject: [PATCH 6/8] Updated copy --- app/partials/mms/add-pe.html | 2 +- app/partials/mms/new-view.html | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/partials/mms/add-pe.html b/app/partials/mms/add-pe.html index 0f50db19f..960bbe36d 100644 --- a/app/partials/mms/add-pe.html +++ b/app/partials/mms/add-pe.html @@ -25,7 +25,7 @@

Add {{presentationElemType | lowerc

-

Begin by searching for the {{presentationElemType | lowercase}}, then click its name or documentation to add to document.

+

Begin by searching for the {{presentationElemType | lowercase}}, then click its name or documentation to add the {{presentationElemType | lowercase}}.

diff --git a/app/partials/mms/new-view.html b/app/partials/mms/new-view.html index e5bf433a3..c96166425 100644 --- a/app/partials/mms/new-view.html +++ b/app/partials/mms/new-view.html @@ -22,7 +22,7 @@

Add view

-

Begin by searching for the view, then click its name or documentation to add to document.

+

Begin by searching for the view, then click its name or documentation to add the view.


From b4e861b42f25f72430dd46b9dc2907dd13ba1921 Mon Sep 17 00:00:00 2001 From: Shakeh Brys Date: Fri, 5 Apr 2019 10:40:35 -0700 Subject: [PATCH 7/8] up version --- Gruntfile.js | 2 +- app/js/mms/directives/veNav.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Gruntfile.js b/Gruntfile.js index 69e4b3c51..d8ef9fc21 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -364,7 +364,7 @@ module.exports = function(grunt) { options: { publish: [{ id: groupId + ':ve:zip', - version: '3.5.1-SNAPSHOT', + version: '3.5.2-SNAPSHOT', path: 'deploy/' }] } diff --git a/app/js/mms/directives/veNav.js b/app/js/mms/directives/veNav.js index effd2e5b4..79b0954dd 100644 --- a/app/js/mms/directives/veNav.js +++ b/app/js/mms/directives/veNav.js @@ -87,7 +87,7 @@ function veNav($templateCache, $rootScope, $state, hotkeys, growl, $location, $u hotkeys.toggleCheatSheet(); }; scope.toggleAbout = function() { - scope.veV = '3.5.1'; + scope.veV = '3.5.2'; scope.mmsV = 'Loading...'; ApplicationService.getMmsVersion().then(function(data) { scope.mmsV = data; From 9d321f03045608383712487f7bf0622ea5c3e6ca Mon Sep 17 00:00:00 2001 From: Shakeh Brys Date: Sun, 7 Apr 2019 21:07:36 -0700 Subject: [PATCH 8/8] make 3.5.2 release --- Gruntfile.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Gruntfile.js b/Gruntfile.js index d8ef9fc21..546f1d624 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -353,7 +353,7 @@ module.exports = function(grunt) { artifactory: { options: { url: artifactoryUrl, - repository: snapshotRepo, //releaseRepo, + repository: releaseRepo, username: artifactoryUser, password: artifactoryPassword }, @@ -364,7 +364,7 @@ module.exports = function(grunt) { options: { publish: [{ id: groupId + ':ve:zip', - version: '3.5.2-SNAPSHOT', + version: '3.5.2', path: 'deploy/' }] }