From 31a7ebd4f19c5dde7dfa67b6796abe1521650186 Mon Sep 17 00:00:00 2001 From: Joel McKinnon Date: Fri, 6 Dec 2019 12:05:36 -0800 Subject: [PATCH 001/368] basic skeleton for conditions code --- app.js | 2 +- src/MCT.js | 1 + .../condition/ConditionViewProvider.js | 61 +++++++++++++++++++ .../condition/components/Condition.vue | 16 +++++ src/plugins/condition/plugin.js | 45 ++++++++++++++ src/plugins/plugins.js | 7 ++- 6 files changed, 129 insertions(+), 3 deletions(-) create mode 100644 src/plugins/condition/ConditionViewProvider.js create mode 100644 src/plugins/condition/components/Condition.vue create mode 100644 src/plugins/condition/plugin.js diff --git a/app.js b/app.js index 479cc7039c..476f2bd2c5 100644 --- a/app.js +++ b/app.js @@ -15,7 +15,7 @@ const fs = require('fs'); const request = require('request'); // Defaults -options.port = options.port || options.p || 8080; +options.port = options.port || options.p || 8070; options.host = options.host || options.h || 'localhost'; options.directory = options.directory || options.D || '.'; diff --git a/src/MCT.js b/src/MCT.js index 404153ab5a..4c9fdfe7dd 100644 --- a/src/MCT.js +++ b/src/MCT.js @@ -265,6 +265,7 @@ define([ this.install(this.plugins.GoToOriginalAction()); this.install(this.plugins.ImportExport()); this.install(this.plugins.WebPage()); + this.install(this.plugins.Condition()); } MCT.prototype = Object.create(EventEmitter.prototype); diff --git a/src/plugins/condition/ConditionViewProvider.js b/src/plugins/condition/ConditionViewProvider.js new file mode 100644 index 0000000000..629e6b0c69 --- /dev/null +++ b/src/plugins/condition/ConditionViewProvider.js @@ -0,0 +1,61 @@ +/***************************************************************************** + * Open MCT, Copyright (c) 2014-2019, United States Government + * as represented by the Administrator of the National Aeronautics and Space + * Administration. All rights reserved. + * + * Open MCT is licensed under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * http://www.apache.org/licenses/LICENSE-2.0. + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. + * + * Open MCT includes source code licensed under additional open source + * licenses. See the Open Source Licenses file (LICENSES.md) included with + * this source code distribution or the Licensing information page available + * at runtime from the About dialog for additional information. + *****************************************************************************/ + +import ConditionComponent from './components/Condition.vue'; +import Vue from 'vue'; + +export default function Condition(openmct) { + return { + key: 'condition', + name: 'Condition', + cssClass: 'icon-page', + canView: function (domainObject) { + return domainObject.type === 'condition'; + }, + view: function (domainObject) { + let component; + + return { + show: function (element) { + component = new Vue({ + el: element, + components: { + ConditionComponent: ConditionComponent + }, + provide: { + openmct, + domainObject + }, + template: '' + }); + }, + destroy: function (element) { + component.$destroy(); + component = undefined; + } + }; + }, + priority: function () { + return 1; + } + }; +} diff --git a/src/plugins/condition/components/Condition.vue b/src/plugins/condition/components/Condition.vue new file mode 100644 index 0000000000..19ec4a146b --- /dev/null +++ b/src/plugins/condition/components/Condition.vue @@ -0,0 +1,16 @@ + + + diff --git a/src/plugins/condition/plugin.js b/src/plugins/condition/plugin.js new file mode 100644 index 0000000000..ed55678ae2 --- /dev/null +++ b/src/plugins/condition/plugin.js @@ -0,0 +1,45 @@ +/***************************************************************************** + * Open MCT, Copyright (c) 2014-2018, United States Government + * as represented by the Administrator of the National Aeronautics and Space + * Administration. All rights reserved. + * + * Open MCT is licensed under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * http://www.apache.org/licenses/LICENSE-2.0. + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. + * + * Open MCT includes source code licensed under additional open source + * licenses. See the Open Source Licenses file (LICENSES.md) included with + * this source code distribution or the Licensing information page available + * at runtime from the About dialog for additional information. + *****************************************************************************/ + +import ConditionViewProvider from './ConditionViewProvider.js'; + +export default function plugin() { + return function install(openmct) { + openmct.objectViews.addProvider(new ConditionViewProvider(openmct)); + + openmct.types.addType('condition', { + name: "Condition", + creatable: true, + description: "A conditional rule based on user-specified criteria.", + cssClass: 'icon-page', + form: [ + { + "key": "url", + "name": "URL", + "control": "textfield", + "required": true, + "cssClass": "l-input-lg" + } + ] + }); + }; +} diff --git a/src/plugins/plugins.js b/src/plugins/plugins.js index cb64e4005b..dcfe24dbd9 100644 --- a/src/plugins/plugins.js +++ b/src/plugins/plugins.js @@ -45,7 +45,8 @@ define([ './objectMigration/plugin', './goToOriginalAction/plugin', './clearData/plugin', - './webPage/plugin' + './webPage/plugin', + './condition/plugin' ], function ( _, UTCTimeSystem, @@ -71,7 +72,8 @@ define([ ObjectMigration, GoToOriginalAction, ClearData, - WebPagePlugin + WebPagePlugin, + ConditionPlugin ) { var bundleMap = { LocalStorage: 'platform/persistence/local', @@ -173,6 +175,7 @@ define([ plugins.GoToOriginalAction = GoToOriginalAction.default; plugins.ClearData = ClearData; plugins.WebPage = WebPagePlugin.default; + plugins.Condition = ConditionPlugin.default; return plugins; }); From b06c234b5950b2339b74627d36a139805d484e58 Mon Sep 17 00:00:00 2001 From: Joel McKinnon Date: Fri, 6 Dec 2019 13:02:23 -0800 Subject: [PATCH 002/368] import path for vue component --- src/plugins/condition/ConditionViewProvider.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/condition/ConditionViewProvider.js b/src/plugins/condition/ConditionViewProvider.js index 629e6b0c69..0dae4ff16d 100644 --- a/src/plugins/condition/ConditionViewProvider.js +++ b/src/plugins/condition/ConditionViewProvider.js @@ -21,7 +21,7 @@ *****************************************************************************/ import ConditionComponent from './components/Condition.vue'; -import Vue from 'vue'; +import Vue from './node_modules/vue'; export default function Condition(openmct) { return { From f82ca91a61ed41648c4243a6f9a090bea4c252b3 Mon Sep 17 00:00:00 2001 From: Joel McKinnon Date: Fri, 6 Dec 2019 15:13:03 -0800 Subject: [PATCH 003/368] changed node mules path --- src/plugins/condition/ConditionViewProvider.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/condition/ConditionViewProvider.js b/src/plugins/condition/ConditionViewProvider.js index 0dae4ff16d..629e6b0c69 100644 --- a/src/plugins/condition/ConditionViewProvider.js +++ b/src/plugins/condition/ConditionViewProvider.js @@ -21,7 +21,7 @@ *****************************************************************************/ import ConditionComponent from './components/Condition.vue'; -import Vue from './node_modules/vue'; +import Vue from 'vue'; export default function Condition(openmct) { return { From 17838d8040641c22d45937e21064cfea76a6c1ae Mon Sep 17 00:00:00 2001 From: Joel McKinnon Date: Thu, 12 Dec 2019 14:36:24 -0800 Subject: [PATCH 004/368] WIP: setting up test framework for conditionals --- .../index.html | 80 +++++++++ .../prettify.js | 1 + .../sort-arrow-sprite.png | Bin 0 -> 209 bytes .../sorter.js | 158 ++++++++++++++++++ src/plugins/condition/plugin.js | 33 ++-- src/plugins/condition/pluginSpec.js | 18 ++ 6 files changed, 272 insertions(+), 18 deletions(-) create mode 100644 coverage/HeadlessChrome 0.0.0 (Mac OS X 10.14.6)/index.html create mode 100644 coverage/HeadlessChrome 0.0.0 (Mac OS X 10.14.6)/prettify.js create mode 100644 coverage/HeadlessChrome 0.0.0 (Mac OS X 10.14.6)/sort-arrow-sprite.png create mode 100644 coverage/HeadlessChrome 0.0.0 (Mac OS X 10.14.6)/sorter.js create mode 100644 src/plugins/condition/pluginSpec.js diff --git a/coverage/HeadlessChrome 0.0.0 (Mac OS X 10.14.6)/index.html b/coverage/HeadlessChrome 0.0.0 (Mac OS X 10.14.6)/index.html new file mode 100644 index 0000000000..aa744d6dd1 --- /dev/null +++ b/coverage/HeadlessChrome 0.0.0 (Mac OS X 10.14.6)/index.html @@ -0,0 +1,80 @@ + + + + Code coverage report for All files + + + + + + + +
+
+

+ / +

+
+
+ 100% + Statements + 0/0 +
+
+ 100% + Branches + 0/0 +
+
+ 100% + Functions + 0/0 +
+
+ 100% + Lines + 0/0 +
+
+
+
+
+ + + + + + + + + + + + + + + + +
FileStatementsBranchesFunctionsLines
+
+
+ + + + + + + diff --git a/coverage/HeadlessChrome 0.0.0 (Mac OS X 10.14.6)/prettify.js b/coverage/HeadlessChrome 0.0.0 (Mac OS X 10.14.6)/prettify.js new file mode 100644 index 0000000000..ef51e03866 --- /dev/null +++ b/coverage/HeadlessChrome 0.0.0 (Mac OS X 10.14.6)/prettify.js @@ -0,0 +1 @@ +window.PR_SHOULD_USE_CONTINUATION=true;(function(){var h=["break,continue,do,else,for,if,return,while"];var u=[h,"auto,case,char,const,default,double,enum,extern,float,goto,int,long,register,short,signed,sizeof,static,struct,switch,typedef,union,unsigned,void,volatile"];var p=[u,"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"];var l=[p,"alignof,align_union,asm,axiom,bool,concept,concept_map,const_cast,constexpr,decltype,dynamic_cast,explicit,export,friend,inline,late_check,mutable,namespace,nullptr,reinterpret_cast,static_assert,static_cast,template,typeid,typename,using,virtual,where"];var x=[p,"abstract,boolean,byte,extends,final,finally,implements,import,instanceof,null,native,package,strictfp,super,synchronized,throws,transient"];var R=[x,"as,base,by,checked,decimal,delegate,descending,dynamic,event,fixed,foreach,from,group,implicit,in,interface,internal,into,is,lock,object,out,override,orderby,params,partial,readonly,ref,sbyte,sealed,stackalloc,string,select,uint,ulong,unchecked,unsafe,ushort,var"];var r="all,and,by,catch,class,else,extends,false,finally,for,if,in,is,isnt,loop,new,no,not,null,of,off,on,or,return,super,then,true,try,unless,until,when,while,yes";var w=[p,"debugger,eval,export,function,get,null,set,undefined,var,with,Infinity,NaN"];var s="caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END";var I=[h,"and,as,assert,class,def,del,elif,except,exec,finally,from,global,import,in,is,lambda,nonlocal,not,or,pass,print,raise,try,with,yield,False,True,None"];var f=[h,"alias,and,begin,case,class,def,defined,elsif,end,ensure,false,in,module,next,nil,not,or,redo,rescue,retry,self,super,then,true,undef,unless,until,when,yield,BEGIN,END"];var H=[h,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"];var A=[l,R,w,s+I,f,H];var e=/^(DIR|FILE|vector|(de|priority_)?queue|list|stack|(const_)?iterator|(multi)?(set|map)|bitset|u?(int|float)\d*)/;var C="str";var z="kwd";var j="com";var O="typ";var G="lit";var L="pun";var F="pln";var m="tag";var E="dec";var J="src";var P="atn";var n="atv";var N="nocode";var M="(?:^^\\.?|[+-]|\\!|\\!=|\\!==|\\#|\\%|\\%=|&|&&|&&=|&=|\\(|\\*|\\*=|\\+=|\\,|\\-=|\\->|\\/|\\/=|:|::|\\;|<|<<|<<=|<=|=|==|===|>|>=|>>|>>=|>>>|>>>=|\\?|\\@|\\[|\\^|\\^=|\\^\\^|\\^\\^=|\\{|\\||\\|=|\\|\\||\\|\\|=|\\~|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*";function k(Z){var ad=0;var S=false;var ac=false;for(var V=0,U=Z.length;V122)){if(!(al<65||ag>90)){af.push([Math.max(65,ag)|32,Math.min(al,90)|32])}if(!(al<97||ag>122)){af.push([Math.max(97,ag)&~32,Math.min(al,122)&~32])}}}}af.sort(function(av,au){return(av[0]-au[0])||(au[1]-av[1])});var ai=[];var ap=[NaN,NaN];for(var ar=0;arat[0]){if(at[1]+1>at[0]){an.push("-")}an.push(T(at[1]))}}an.push("]");return an.join("")}function W(al){var aj=al.source.match(new RegExp("(?:\\[(?:[^\\x5C\\x5D]|\\\\[\\s\\S])*\\]|\\\\u[A-Fa-f0-9]{4}|\\\\x[A-Fa-f0-9]{2}|\\\\[0-9]+|\\\\[^ux0-9]|\\(\\?[:!=]|[\\(\\)\\^]|[^\\x5B\\x5C\\(\\)\\^]+)","g"));var ah=aj.length;var an=[];for(var ak=0,am=0;ak=2&&ai==="["){aj[ak]=X(ag)}else{if(ai!=="\\"){aj[ak]=ag.replace(/[a-zA-Z]/g,function(ao){var ap=ao.charCodeAt(0);return"["+String.fromCharCode(ap&~32,ap|32)+"]"})}}}}return aj.join("")}var aa=[];for(var V=0,U=Z.length;V=0;){S[ac.charAt(ae)]=Y}}var af=Y[1];var aa=""+af;if(!ag.hasOwnProperty(aa)){ah.push(af);ag[aa]=null}}ah.push(/[\0-\uffff]/);V=k(ah)})();var X=T.length;var W=function(ah){var Z=ah.sourceCode,Y=ah.basePos;var ad=[Y,F];var af=0;var an=Z.match(V)||[];var aj={};for(var ae=0,aq=an.length;ae=5&&"lang-"===ap.substring(0,5);if(am&&!(ai&&typeof ai[1]==="string")){am=false;ap=J}if(!am){aj[ag]=ap}}var ab=af;af+=ag.length;if(!am){ad.push(Y+ab,ap)}else{var al=ai[1];var ak=ag.indexOf(al);var ac=ak+al.length;if(ai[2]){ac=ag.length-ai[2].length;ak=ac-al.length}var ar=ap.substring(5);B(Y+ab,ag.substring(0,ak),W,ad);B(Y+ab+ak,al,q(ar,al),ad);B(Y+ab+ac,ag.substring(ac),W,ad)}}ah.decorations=ad};return W}function i(T){var W=[],S=[];if(T.tripleQuotedStrings){W.push([C,/^(?:\'\'\'(?:[^\'\\]|\\[\s\S]|\'{1,2}(?=[^\']))*(?:\'\'\'|$)|\"\"\"(?:[^\"\\]|\\[\s\S]|\"{1,2}(?=[^\"]))*(?:\"\"\"|$)|\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$))/,null,"'\""])}else{if(T.multiLineStrings){W.push([C,/^(?:\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$)|\`(?:[^\\\`]|\\[\s\S])*(?:\`|$))/,null,"'\"`"])}else{W.push([C,/^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$)|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/,null,"\"'"])}}if(T.verbatimStrings){S.push([C,/^@\"(?:[^\"]|\"\")*(?:\"|$)/,null])}var Y=T.hashComments;if(Y){if(T.cStyleComments){if(Y>1){W.push([j,/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,null,"#"])}else{W.push([j,/^#(?:(?:define|elif|else|endif|error|ifdef|include|ifndef|line|pragma|undef|warning)\b|[^\r\n]*)/,null,"#"])}S.push([C,/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h|[a-z]\w*)>/,null])}else{W.push([j,/^#[^\r\n]*/,null,"#"])}}if(T.cStyleComments){S.push([j,/^\/\/[^\r\n]*/,null]);S.push([j,/^\/\*[\s\S]*?(?:\*\/|$)/,null])}if(T.regexLiterals){var X=("/(?=[^/*])(?:[^/\\x5B\\x5C]|\\x5C[\\s\\S]|\\x5B(?:[^\\x5C\\x5D]|\\x5C[\\s\\S])*(?:\\x5D|$))+/");S.push(["lang-regex",new RegExp("^"+M+"("+X+")")])}var V=T.types;if(V){S.push([O,V])}var U=(""+T.keywords).replace(/^ | $/g,"");if(U.length){S.push([z,new RegExp("^(?:"+U.replace(/[\s,]+/g,"|")+")\\b"),null])}W.push([F,/^\s+/,null," \r\n\t\xA0"]);S.push([G,/^@[a-z_$][a-z_$@0-9]*/i,null],[O,/^(?:[@_]?[A-Z]+[a-z][A-Za-z_$@0-9]*|\w+_t\b)/,null],[F,/^[a-z_$][a-z_$@0-9]*/i,null],[G,new RegExp("^(?:0x[a-f0-9]+|(?:\\d(?:_\\d+)*\\d*(?:\\.\\d*)?|\\.\\d\\+)(?:e[+\\-]?\\d+)?)[a-z]*","i"),null,"0123456789"],[F,/^\\[\s\S]?/,null],[L,/^.[^\s\w\.$@\'\"\`\/\#\\]*/,null]);return g(W,S)}var K=i({keywords:A,hashComments:true,cStyleComments:true,multiLineStrings:true,regexLiterals:true});function Q(V,ag){var U=/(?:^|\s)nocode(?:\s|$)/;var ab=/\r\n?|\n/;var ac=V.ownerDocument;var S;if(V.currentStyle){S=V.currentStyle.whiteSpace}else{if(window.getComputedStyle){S=ac.defaultView.getComputedStyle(V,null).getPropertyValue("white-space")}}var Z=S&&"pre"===S.substring(0,3);var af=ac.createElement("LI");while(V.firstChild){af.appendChild(V.firstChild)}var W=[af];function ae(al){switch(al.nodeType){case 1:if(U.test(al.className)){break}if("BR"===al.nodeName){ad(al);if(al.parentNode){al.parentNode.removeChild(al)}}else{for(var an=al.firstChild;an;an=an.nextSibling){ae(an)}}break;case 3:case 4:if(Z){var am=al.nodeValue;var aj=am.match(ab);if(aj){var ai=am.substring(0,aj.index);al.nodeValue=ai;var ah=am.substring(aj.index+aj[0].length);if(ah){var ak=al.parentNode;ak.insertBefore(ac.createTextNode(ah),al.nextSibling)}ad(al);if(!ai){al.parentNode.removeChild(al)}}}break}}function ad(ak){while(!ak.nextSibling){ak=ak.parentNode;if(!ak){return}}function ai(al,ar){var aq=ar?al.cloneNode(false):al;var ao=al.parentNode;if(ao){var ap=ai(ao,1);var an=al.nextSibling;ap.appendChild(aq);for(var am=an;am;am=an){an=am.nextSibling;ap.appendChild(am)}}return aq}var ah=ai(ak.nextSibling,0);for(var aj;(aj=ah.parentNode)&&aj.nodeType===1;){ah=aj}W.push(ah)}for(var Y=0;Y=S){ah+=2}if(V>=ap){Z+=2}}}var t={};function c(U,V){for(var S=V.length;--S>=0;){var T=V[S];if(!t.hasOwnProperty(T)){t[T]=U}else{if(window.console){console.warn("cannot override language handler %s",T)}}}}function q(T,S){if(!(T&&t.hasOwnProperty(T))){T=/^\s*]*(?:>|$)/],[j,/^<\!--[\s\S]*?(?:-\->|$)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],[L,/^(?:<[%?]|[%?]>)/],["lang-",/^]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-js",/^]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-css",/^]*>([\s\S]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i]]),["default-markup","htm","html","mxml","xhtml","xml","xsl"]);c(g([[F,/^[\s]+/,null," \t\r\n"],[n,/^(?:\"[^\"]*\"?|\'[^\']*\'?)/,null,"\"'"]],[[m,/^^<\/?[a-z](?:[\w.:-]*\w)?|\/?>$/i],[P,/^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],["lang-uq.val",/^=\s*([^>\'\"\s]*(?:[^>\'\"\s\/]|\/(?=\s)))/],[L,/^[=<>\/]+/],["lang-js",/^on\w+\s*=\s*\"([^\"]+)\"/i],["lang-js",/^on\w+\s*=\s*\'([^\']+)\'/i],["lang-js",/^on\w+\s*=\s*([^\"\'>\s]+)/i],["lang-css",/^style\s*=\s*\"([^\"]+)\"/i],["lang-css",/^style\s*=\s*\'([^\']+)\'/i],["lang-css",/^style\s*=\s*([^\"\'>\s]+)/i]]),["in.tag"]);c(g([],[[n,/^[\s\S]+/]]),["uq.val"]);c(i({keywords:l,hashComments:true,cStyleComments:true,types:e}),["c","cc","cpp","cxx","cyc","m"]);c(i({keywords:"null,true,false"}),["json"]);c(i({keywords:R,hashComments:true,cStyleComments:true,verbatimStrings:true,types:e}),["cs"]);c(i({keywords:x,cStyleComments:true}),["java"]);c(i({keywords:H,hashComments:true,multiLineStrings:true}),["bsh","csh","sh"]);c(i({keywords:I,hashComments:true,multiLineStrings:true,tripleQuotedStrings:true}),["cv","py"]);c(i({keywords:s,hashComments:true,multiLineStrings:true,regexLiterals:true}),["perl","pl","pm"]);c(i({keywords:f,hashComments:true,multiLineStrings:true,regexLiterals:true}),["rb"]);c(i({keywords:w,cStyleComments:true,regexLiterals:true}),["js"]);c(i({keywords:r,hashComments:3,cStyleComments:true,multilineStrings:true,tripleQuotedStrings:true,regexLiterals:true}),["coffee"]);c(g([],[[C,/^[\s\S]+/]]),["regex"]);function d(V){var U=V.langExtension;try{var S=a(V.sourceNode);var T=S.sourceCode;V.sourceCode=T;V.spans=S.spans;V.basePos=0;q(U,T)(V);D(V)}catch(W){if("console" in window){console.log(W&&W.stack?W.stack:W)}}}function y(W,V,U){var S=document.createElement("PRE");S.innerHTML=W;if(U){Q(S,U)}var T={langExtension:V,numberLines:U,sourceNode:S};d(T);return S.innerHTML}function b(ad){function Y(af){return document.getElementsByTagName(af)}var ac=[Y("pre"),Y("code"),Y("xmp")];var T=[];for(var aa=0;aa=0){var ah=ai.match(ab);var am;if(!ah&&(am=o(aj))&&"CODE"===am.tagName){ah=am.className.match(ab)}if(ah){ah=ah[1]}var al=false;for(var ak=aj.parentNode;ak;ak=ak.parentNode){if((ak.tagName==="pre"||ak.tagName==="code"||ak.tagName==="xmp")&&ak.className&&ak.className.indexOf("prettyprint")>=0){al=true;break}}if(!al){var af=aj.className.match(/\blinenums\b(?::(\d+))?/);af=af?af[1]&&af[1].length?+af[1]:true:false;if(af){Q(aj,af)}S={langExtension:ah,sourceNode:aj,numberLines:af};d(S)}}}if(X]*(?:>|$)/],[PR.PR_COMMENT,/^<\!--[\s\S]*?(?:-\->|$)/],[PR.PR_PUNCTUATION,/^(?:<[%?]|[%?]>)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],["lang-",/^]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-handlebars",/^]*type\s*=\s*['"]?text\/x-handlebars-template['"]?\b[^>]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-js",/^]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-css",/^]*>([\s\S]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i],[PR.PR_DECLARATION,/^{{[#^>/]?\s*[\w.][^}]*}}/],[PR.PR_DECLARATION,/^{{&?\s*[\w.][^}]*}}/],[PR.PR_DECLARATION,/^{{{>?\s*[\w.][^}]*}}}/],[PR.PR_COMMENT,/^{{![^}]*}}/]]),["handlebars","hbs"]);PR.registerLangHandler(PR.createSimpleLexer([[PR.PR_PLAIN,/^[ \t\r\n\f]+/,null," \t\r\n\f"]],[[PR.PR_STRING,/^\"(?:[^\n\r\f\\\"]|\\(?:\r\n?|\n|\f)|\\[\s\S])*\"/,null],[PR.PR_STRING,/^\'(?:[^\n\r\f\\\']|\\(?:\r\n?|\n|\f)|\\[\s\S])*\'/,null],["lang-css-str",/^url\(([^\)\"\']*)\)/i],[PR.PR_KEYWORD,/^(?:url|rgb|\!important|@import|@page|@media|@charset|inherit)(?=[^\-\w]|$)/i,null],["lang-css-kw",/^(-?(?:[_a-z]|(?:\\[0-9a-f]+ ?))(?:[_a-z0-9\-]|\\(?:\\[0-9a-f]+ ?))*)\s*:/i],[PR.PR_COMMENT,/^\/\*[^*]*\*+(?:[^\/*][^*]*\*+)*\//],[PR.PR_COMMENT,/^(?:)/],[PR.PR_LITERAL,/^(?:\d+|\d*\.\d+)(?:%|[a-z]+)?/i],[PR.PR_LITERAL,/^#(?:[0-9a-f]{3}){1,2}/i],[PR.PR_PLAIN,/^-?(?:[_a-z]|(?:\\[\da-f]+ ?))(?:[_a-z\d\-]|\\(?:\\[\da-f]+ ?))*/i],[PR.PR_PUNCTUATION,/^[^\s\w\'\"]+/]]),["css"]);PR.registerLangHandler(PR.createSimpleLexer([],[[PR.PR_KEYWORD,/^-?(?:[_a-z]|(?:\\[\da-f]+ ?))(?:[_a-z\d\-]|\\(?:\\[\da-f]+ ?))*/i]]),["css-kw"]);PR.registerLangHandler(PR.createSimpleLexer([],[[PR.PR_STRING,/^[^\)\"\']+/]]),["css-str"]); diff --git a/coverage/HeadlessChrome 0.0.0 (Mac OS X 10.14.6)/sort-arrow-sprite.png b/coverage/HeadlessChrome 0.0.0 (Mac OS X 10.14.6)/sort-arrow-sprite.png new file mode 100644 index 0000000000000000000000000000000000000000..03f704a609c6fd0dbfdac63466a7d7c958b5cbf3 GIT binary patch literal 209 zcmeAS@N?(olHy`uVBq!ia0vp^>_9Bd!3HEZxJ@+%Qj#UE5hcO-X(i=}MX3yqDfvmM z3ZA)%>8U}fi7AzZCsS>Jii$m5978H@?Fn+^JD|Y9yzj{W`447Gxa{7*dM7nnnD-Lb z6^}Hx2)'; + } + } + return cols; + } + // attaches a data attribute to every tr element with an object + // of data values keyed by column name + function loadRowData(tableRow) { + var tableCols = tableRow.querySelectorAll('td'), + colNode, + col, + data = {}, + i, + val; + for (i = 0; i < tableCols.length; i += 1) { + colNode = tableCols[i]; + col = cols[i]; + val = colNode.getAttribute('data-value'); + if (col.type === 'number') { + val = Number(val); + } + data[col.key] = val; + } + return data; + } + // loads all row data + function loadData() { + var rows = getTableBody().querySelectorAll('tr'), + i; + + for (i = 0; i < rows.length; i += 1) { + rows[i].data = loadRowData(rows[i]); + } + } + // sorts the table using the data for the ith column + function sortByIndex(index, desc) { + var key = cols[index].key, + sorter = function (a, b) { + a = a.data[key]; + b = b.data[key]; + return a < b ? -1 : a > b ? 1 : 0; + }, + finalSorter = sorter, + tableBody = document.querySelector('.coverage-summary tbody'), + rowNodes = tableBody.querySelectorAll('tr'), + rows = [], + i; + + if (desc) { + finalSorter = function (a, b) { + return -1 * sorter(a, b); + }; + } + + for (i = 0; i < rowNodes.length; i += 1) { + rows.push(rowNodes[i]); + tableBody.removeChild(rowNodes[i]); + } + + rows.sort(finalSorter); + + for (i = 0; i < rows.length; i += 1) { + tableBody.appendChild(rows[i]); + } + } + // removes sort indicators for current column being sorted + function removeSortIndicators() { + var col = getNthColumn(currentSort.index), + cls = col.className; + + cls = cls.replace(/ sorted$/, '').replace(/ sorted-desc$/, ''); + col.className = cls; + } + // adds sort indicators for current column being sorted + function addSortIndicators() { + getNthColumn(currentSort.index).className += currentSort.desc ? ' sorted-desc' : ' sorted'; + } + // adds event listeners for all sorter widgets + function enableUI() { + var i, + el, + ithSorter = function ithSorter(i) { + var col = cols[i]; + + return function () { + var desc = col.defaultDescSort; + + if (currentSort.index === i) { + desc = !currentSort.desc; + } + sortByIndex(i, desc); + removeSortIndicators(); + currentSort.index = i; + currentSort.desc = desc; + addSortIndicators(); + }; + }; + for (i =0 ; i < cols.length; i += 1) { + if (cols[i].sortable) { + // add the click event handler on the th so users + // dont have to click on those tiny arrows + el = getNthColumn(i).querySelector('.sorter').parentElement; + if (el.addEventListener) { + el.addEventListener('click', ithSorter(i)); + } else { + el.attachEvent('onclick', ithSorter(i)); + } + } + } + } + // adds sorting functionality to the UI + return function () { + if (!getTable()) { + return; + } + cols = loadColumns(); + loadData(cols); + addSortIndicators(); + enableUI(); + }; +})(); + +window.addEventListener('load', addSorting); diff --git a/src/plugins/condition/plugin.js b/src/plugins/condition/plugin.js index ed55678ae2..aaa2789ca2 100644 --- a/src/plugins/condition/plugin.js +++ b/src/plugins/condition/plugin.js @@ -20,26 +20,23 @@ * at runtime from the About dialog for additional information. *****************************************************************************/ -import ConditionViewProvider from './ConditionViewProvider.js'; +// import ConditionViewProvider from './ConditionViewProvider.js'; + +export default function ConditionPlugin() { + const conditionType = { + name: 'Condition', + description: 'A conditional rule based on user-specified criteria.', + creatable: true, + cssClass: 'icon-summary-widget', + initialize: function (domainObject) { + domainObject.composition = []; + domainObject.telemetry = {}; + } + }; -export default function plugin() { return function install(openmct) { - openmct.objectViews.addProvider(new ConditionViewProvider(openmct)); + // openmct.objectViews.addProvider(new ConditionViewProvider(openmct)); - openmct.types.addType('condition', { - name: "Condition", - creatable: true, - description: "A conditional rule based on user-specified criteria.", - cssClass: 'icon-page', - form: [ - { - "key": "url", - "name": "URL", - "control": "textfield", - "required": true, - "cssClass": "l-input-lg" - } - ] - }); + openmct.types.addType(conditionType); }; } diff --git a/src/plugins/condition/pluginSpec.js b/src/plugins/condition/pluginSpec.js new file mode 100644 index 0000000000..01f1370456 --- /dev/null +++ b/src/plugins/condition/pluginSpec.js @@ -0,0 +1,18 @@ +import ConditionPlugin from './plugin.js'; +import { + createOpenMct +} from 'testTools'; + +describe("The condition object plugin", function () { + let openmct; + + beforeEach(function () { + //openmct = createOpenMct(); + + }); + + fit('shows the object exists', () => { + expect(true).toEqual(true); + }); +}); + From 5df74aee68bb4163ebb6395aa4fdf13966175cf4 Mon Sep 17 00:00:00 2001 From: Joshi Date: Mon, 16 Dec 2019 11:06:19 -0800 Subject: [PATCH 005/368] [test-framework] Adds basic test for condition plugin --- src/plugins/condition/plugin.js | 6 +++--- src/plugins/condition/pluginSpec.js | 10 ++++++---- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/src/plugins/condition/plugin.js b/src/plugins/condition/plugin.js index aaa2789ca2..5eb4cf462a 100644 --- a/src/plugins/condition/plugin.js +++ b/src/plugins/condition/plugin.js @@ -20,7 +20,7 @@ * at runtime from the About dialog for additional information. *****************************************************************************/ -// import ConditionViewProvider from './ConditionViewProvider.js'; +import ConditionViewProvider from './ConditionViewProvider'; export default function ConditionPlugin() { const conditionType = { @@ -35,8 +35,8 @@ export default function ConditionPlugin() { }; return function install(openmct) { - // openmct.objectViews.addProvider(new ConditionViewProvider(openmct)); + openmct.objectViews.addProvider(new ConditionViewProvider(openmct)); - openmct.types.addType(conditionType); + openmct.types.addType('condition', conditionType); }; } diff --git a/src/plugins/condition/pluginSpec.js b/src/plugins/condition/pluginSpec.js index 01f1370456..4c54524eff 100644 --- a/src/plugins/condition/pluginSpec.js +++ b/src/plugins/condition/pluginSpec.js @@ -1,4 +1,4 @@ -import ConditionPlugin from './plugin.js'; +import ConditionPlugin from './plugin'; import { createOpenMct } from 'testTools'; @@ -7,12 +7,14 @@ describe("The condition object plugin", function () { let openmct; beforeEach(function () { - //openmct = createOpenMct(); - + openmct = createOpenMct(); }); fit('shows the object exists', () => { - expect(true).toEqual(true); + const install = new ConditionPlugin(); + install(openmct); + const conditionType = openmct.types.get('condition'); + expect(conditionType.definition.name).toEqual('Condition'); }); }); From 221e5b4f6c0abf9b35341958e0b1f065894c1960 Mon Sep 17 00:00:00 2001 From: Joel McKinnon Date: Mon, 16 Dec 2019 14:42:19 -0800 Subject: [PATCH 006/368] Added tests for ConditionPlugin --- src/plugins/condition/plugin.js | 4 -- src/plugins/condition/pluginSpec.js | 59 ++++++++++++++++++++++++----- 2 files changed, 50 insertions(+), 13 deletions(-) diff --git a/src/plugins/condition/plugin.js b/src/plugins/condition/plugin.js index 5eb4cf462a..4c3adb11dc 100644 --- a/src/plugins/condition/plugin.js +++ b/src/plugins/condition/plugin.js @@ -20,8 +20,6 @@ * at runtime from the About dialog for additional information. *****************************************************************************/ -import ConditionViewProvider from './ConditionViewProvider'; - export default function ConditionPlugin() { const conditionType = { name: 'Condition', @@ -35,8 +33,6 @@ export default function ConditionPlugin() { }; return function install(openmct) { - openmct.objectViews.addProvider(new ConditionViewProvider(openmct)); - openmct.types.addType('condition', conditionType); }; } diff --git a/src/plugins/condition/pluginSpec.js b/src/plugins/condition/pluginSpec.js index 4c54524eff..e800626d98 100644 --- a/src/plugins/condition/pluginSpec.js +++ b/src/plugins/condition/pluginSpec.js @@ -1,20 +1,61 @@ +/***************************************************************************** + * Open MCT, Copyright (c) 2014-2018, United States Government + * as represented by the Administrator of the National Aeronautics and Space + * Administration. All rights reserved. + * + * Open MCT is licensed under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * http://www.apache.org/licenses/LICENSE-2.0. + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. + * + * Open MCT includes source code licensed under additional open source + * licenses. See the Open Source Licenses file (LICENSES.md) included with + * this source code distribution or the Licensing information page available + * at runtime from the About dialog for additional information. + *****************************************************************************/ + import ConditionPlugin from './plugin'; -import { - createOpenMct -} from 'testTools'; +import { createOpenMct } from 'testTools'; -describe("The condition object plugin", function () { +fdescribe("The plugin", () => { let openmct; + let conditionType; + let mockDomainObject; + + beforeEach(() => { + mockDomainObject = {}; - beforeEach(function () { openmct = createOpenMct(); + openmct.install(new ConditionPlugin()); + conditionType = openmct.types.get('condition'); }); - fit('shows the object exists', () => { - const install = new ConditionPlugin(); - install(openmct); - const conditionType = openmct.types.get('condition'); + it('defines a condition object with the correct name', () => { expect(conditionType.definition.name).toEqual('Condition'); }); + + it('defines a condition object that is creatable', () => { + expect(conditionType.definition.creatable).toBeTrue(); + }); + + describe("shows the condition object is initialized with", () => { + beforeEach(() => { + conditionType.definition.initialize(mockDomainObject); + }); + + it('a composition array', () => { + expect(Array.isArray(mockDomainObject.composition)).toBeTrue(); + }); + + it('a telemetry object', () => { + expect(typeof mockDomainObject.telemetry === 'object').toBeTrue(); + }); + }); }); From c1d58bb25fd4c9ac4687a5309e5da65ae5962e34 Mon Sep 17 00:00:00 2001 From: Joel McKinnon Date: Mon, 16 Dec 2019 16:55:26 -0800 Subject: [PATCH 007/368] fixed another minor merge conflict --- src/plugins/plugins.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/plugins/plugins.js b/src/plugins/plugins.js index f6e7203d9d..a805684fea 100644 --- a/src/plugins/plugins.js +++ b/src/plugins/plugins.js @@ -47,7 +47,7 @@ define([ './goToOriginalAction/plugin', './clearData/plugin', './webPage/plugin', - './condition/plugin' + './condition/plugin', './themes/espresso', './themes/maelstrom', './themes/snow' @@ -78,7 +78,7 @@ define([ GoToOriginalAction, ClearData, WebPagePlugin, - ConditionPlugin + ConditionPlugin, Espresso, Maelstrom, Snow From ace77dce6577459554f35f041a5f284100202017 Mon Sep 17 00:00:00 2001 From: Joel McKinnon Date: Tue, 17 Dec 2019 08:10:35 -0800 Subject: [PATCH 008/368] WIP --- index.html | 2 +- .../condition/ConditionViewProvider.js | 23 +++++++++---------- 2 files changed, 12 insertions(+), 13 deletions(-) diff --git a/index.html b/index.html index 095e80b594..bb5ed70d51 100644 --- a/index.html +++ b/index.html @@ -43,7 +43,7 @@ openmct.legacyRegistry.enable.bind(openmct.legacyRegistry) ); - openmct.install(openmct.plugins.Espresso()); + openmct.install(openmct.plugins.Snow()); openmct.install(openmct.plugins.MyItems()); openmct.install(openmct.plugins.LocalStorage()); openmct.install(openmct.plugins.Generator()); diff --git a/src/plugins/condition/ConditionViewProvider.js b/src/plugins/condition/ConditionViewProvider.js index 629e6b0c69..e624550c7d 100644 --- a/src/plugins/condition/ConditionViewProvider.js +++ b/src/plugins/condition/ConditionViewProvider.js @@ -27,19 +27,19 @@ export default function Condition(openmct) { return { key: 'condition', name: 'Condition', - cssClass: 'icon-page', - canView: function (domainObject) { + cssClass: 'icon-summary-widget', + canView: (domainObject => { return domainObject.type === 'condition'; - }, - view: function (domainObject) { + }), + view: (domainObject => { let component; return { - show: function (element) { + show: (element => { component = new Vue({ el: element, components: { - ConditionComponent: ConditionComponent + ConditionComponent }, provide: { openmct, @@ -47,15 +47,14 @@ export default function Condition(openmct) { }, template: '' }); - }, - destroy: function (element) { + }), + destroy: (element => { component.$destroy(); component = undefined; - } + }) }; - }, - priority: function () { - return 1; + }), + priority: (() => { 1 }); } }; } From 0a95db1a51e252174bbc171b1dabc0ef4da0d78d Mon Sep 17 00:00:00 2001 From: Joel McKinnon Date: Tue, 17 Dec 2019 08:15:15 -0800 Subject: [PATCH 009/368] fixed missing commas --- src/plugins/plugins.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/plugins/plugins.js b/src/plugins/plugins.js index f6e7203d9d..a805684fea 100644 --- a/src/plugins/plugins.js +++ b/src/plugins/plugins.js @@ -47,7 +47,7 @@ define([ './goToOriginalAction/plugin', './clearData/plugin', './webPage/plugin', - './condition/plugin' + './condition/plugin', './themes/espresso', './themes/maelstrom', './themes/snow' @@ -78,7 +78,7 @@ define([ GoToOriginalAction, ClearData, WebPagePlugin, - ConditionPlugin + ConditionPlugin, Espresso, Maelstrom, Snow From 10c43404754167b992be23e464d79811fd49a61c Mon Sep 17 00:00:00 2001 From: Joel McKinnon Date: Tue, 17 Dec 2019 13:24:34 -0800 Subject: [PATCH 010/368] completed tests for condition collection object --- ....js => ConditionCollectionViewProvider.js} | 14 +++++----- ...{Condition.vue => ConditionCollection.vue} | 4 +-- src/plugins/condition/plugin.js | 9 +++--- src/plugins/condition/pluginSpec.js | 28 +++++++++++-------- 4 files changed, 29 insertions(+), 26 deletions(-) rename src/plugins/condition/{ConditionViewProvider.js => ConditionCollectionViewProvider.js} (82%) rename src/plugins/condition/components/{Condition.vue => ConditionCollection.vue} (70%) diff --git a/src/plugins/condition/ConditionViewProvider.js b/src/plugins/condition/ConditionCollectionViewProvider.js similarity index 82% rename from src/plugins/condition/ConditionViewProvider.js rename to src/plugins/condition/ConditionCollectionViewProvider.js index 629e6b0c69..30ecddb80a 100644 --- a/src/plugins/condition/ConditionViewProvider.js +++ b/src/plugins/condition/ConditionCollectionViewProvider.js @@ -20,16 +20,16 @@ * at runtime from the About dialog for additional information. *****************************************************************************/ -import ConditionComponent from './components/Condition.vue'; +import ConditionCollectionComponent from './components/ConditionCollection.vue'; import Vue from 'vue'; -export default function Condition(openmct) { +export default function ConditionCollection(openmct) { return { - key: 'condition', - name: 'Condition', + key: 'conditionCollection', + name: 'Condition Collection', cssClass: 'icon-page', canView: function (domainObject) { - return domainObject.type === 'condition'; + return domainObject.type === 'conditionCollection'; }, view: function (domainObject) { let component; @@ -39,13 +39,13 @@ export default function Condition(openmct) { component = new Vue({ el: element, components: { - ConditionComponent: ConditionComponent + ConditionCollectionComponent }, provide: { openmct, domainObject }, - template: '' + template: '' }); }, destroy: function (element) { diff --git a/src/plugins/condition/components/Condition.vue b/src/plugins/condition/components/ConditionCollection.vue similarity index 70% rename from src/plugins/condition/components/Condition.vue rename to src/plugins/condition/components/ConditionCollection.vue index 19ec4a146b..7d81e2349f 100644 --- a/src/plugins/condition/components/Condition.vue +++ b/src/plugins/condition/components/ConditionCollection.vue @@ -1,7 +1,5 @@ diff --git a/src/plugins/conditionSet/pluginSpec.js b/src/plugins/conditionSet/pluginSpec.js index dd9422f558..3e44fb223e 100644 --- a/src/plugins/conditionSet/pluginSpec.js +++ b/src/plugins/conditionSet/pluginSpec.js @@ -23,14 +23,28 @@ import { createOpenMct } from 'testTools'; import ConditionSetPlugin from './plugin'; -fdescribe('The plugin', () => { +describe('The plugin', () => { let openmct; let conditionSetDefinition; + let element; + let child; + + beforeEach((done) => { + const appHolder = document.createElement('div'); + appHolder.style.width = '640px'; + appHolder.style.height = '480px'; - beforeEach(() => { openmct = createOpenMct(); + + element = document.createElement('div'); + child = document.createElement('div'); + element.appendChild(child); + openmct.install(new ConditionSetPlugin()); conditionSetDefinition = openmct.types.get('conditionSet').definition; + + openmct.on('start', done); + openmct.start(appHolder); }); it('defines an object type with the correct key', () => { @@ -41,11 +55,22 @@ fdescribe('The plugin', () => { expect(conditionSetDefinition.creatable).toBeTrue(); }); - describe('The object', () => { - it('initializes with an empty composition list', () => { + fit('provides a view', () => { + const testViewObject = { + id:"test-object", + type: "conditionSet" + }; + + const applicableViews = openmct.objectViews.get(testViewObject); + let conditionSetView = applicableViews.find((viewProvider) => viewProvider.key === 'conditionSet.view'); + expect(conditionSetView).toBeDefined(); + }); + + describe('provides an object', () => { + it('which initializes with an empty composition list', () => { let mockDomainObject = { identifier: { - key: 'testConditionSetKey', + key: 'test-key', namespace: '' }, type: 'conditionSet' @@ -56,4 +81,5 @@ fdescribe('The plugin', () => { expect(mockDomainObject.composition.length).toEqual(0); }); }); + }); From 45e56798c59df4835a7a4016c1c93bd2084d9114 Mon Sep 17 00:00:00 2001 From: Joel McKinnon Date: Mon, 23 Dec 2019 11:24:25 -0800 Subject: [PATCH 025/368] removed fit --- src/plugins/conditionSet/pluginSpec.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/conditionSet/pluginSpec.js b/src/plugins/conditionSet/pluginSpec.js index 3e44fb223e..140ba59ac3 100644 --- a/src/plugins/conditionSet/pluginSpec.js +++ b/src/plugins/conditionSet/pluginSpec.js @@ -55,7 +55,7 @@ describe('The plugin', () => { expect(conditionSetDefinition.creatable).toBeTrue(); }); - fit('provides a view', () => { + it('provides a view', () => { const testViewObject = { id:"test-object", type: "conditionSet" From 2f2de3952d62417ec3ee7f447100431876e73613 Mon Sep 17 00:00:00 2001 From: Joel McKinnon Date: Mon, 23 Dec 2019 12:14:35 -0800 Subject: [PATCH 026/368] addressed review comments --- index.html | 2 +- src/plugins/conditionSet/ConditionSetViewProvider.js | 5 ++++- src/plugins/conditionSet/components/ConditionSet.vue | 3 +-- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/index.html b/index.html index bb5ed70d51..095e80b594 100644 --- a/index.html +++ b/index.html @@ -43,7 +43,7 @@ openmct.legacyRegistry.enable.bind(openmct.legacyRegistry) ); - openmct.install(openmct.plugins.Snow()); + openmct.install(openmct.plugins.Espresso()); openmct.install(openmct.plugins.MyItems()); openmct.install(openmct.plugins.LocalStorage()); openmct.install(openmct.plugins.Generator()); diff --git a/src/plugins/conditionSet/ConditionSetViewProvider.js b/src/plugins/conditionSet/ConditionSetViewProvider.js index 00de3bed79..8ef8986918 100644 --- a/src/plugins/conditionSet/ConditionSetViewProvider.js +++ b/src/plugins/conditionSet/ConditionSetViewProvider.js @@ -26,6 +26,8 @@ import Vue from 'vue'; export default function ConditionSetViewProvider(openmct) { return { key: 'conditionSet.view', + name: 'Condition Set', + cssClass: 'icon-summary-widget', canView: function (domainObject) { return domainObject.type === 'conditionSet'; }, @@ -50,11 +52,12 @@ export default function ConditionSetViewProvider(openmct) { domainObject }; }, - template: '' + template: '' }); }, destroy() { component.$destroy(); + component = undefined; } }; }, diff --git a/src/plugins/conditionSet/components/ConditionSet.vue b/src/plugins/conditionSet/components/ConditionSet.vue index 464b5c0f32..19898c6979 100644 --- a/src/plugins/conditionSet/components/ConditionSet.vue +++ b/src/plugins/conditionSet/components/ConditionSet.vue @@ -36,9 +36,8 @@ export default { } }, data() { - let domainObject = JSON.parse(JSON.stringify(this.domainObject)); return { - internalDomainObject: domainObject + internalDomainObject: this.domainObject }; }, inject: ['openmct'] From cd116667be22effacc4cdc9bdf91157e2fb30cad Mon Sep 17 00:00:00 2001 From: Joel McKinnon Date: Mon, 23 Dec 2019 14:32:57 -0800 Subject: [PATCH 027/368] change to inject domainObject --- src/plugins/conditionSet/ConditionSetViewProvider.js | 3 ++- src/plugins/conditionSet/components/ConditionSet.vue | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/plugins/conditionSet/ConditionSetViewProvider.js b/src/plugins/conditionSet/ConditionSetViewProvider.js index 8ef8986918..720e377c91 100644 --- a/src/plugins/conditionSet/ConditionSetViewProvider.js +++ b/src/plugins/conditionSet/ConditionSetViewProvider.js @@ -45,6 +45,7 @@ export default function ConditionSetViewProvider(openmct) { }, provide: { openmct, + domainObject, objectPath }, data() { @@ -52,7 +53,7 @@ export default function ConditionSetViewProvider(openmct) { domainObject }; }, - template: '' + template: '' }); }, destroy() { diff --git a/src/plugins/conditionSet/components/ConditionSet.vue b/src/plugins/conditionSet/components/ConditionSet.vue index 19898c6979..29e5b4d169 100644 --- a/src/plugins/conditionSet/components/ConditionSet.vue +++ b/src/plugins/conditionSet/components/ConditionSet.vue @@ -40,6 +40,6 @@ export default { internalDomainObject: this.domainObject }; }, - inject: ['openmct'] + inject: ['openmct', 'objectPath', 'domainObject'] } From f93d5a6fbf17b046efdb2606676173e392e8f733 Mon Sep 17 00:00:00 2001 From: Joel McKinnon Date: Thu, 26 Dec 2019 08:25:58 -0800 Subject: [PATCH 028/368] skeletal html mockup --- .../conditionSet/components/ConditionSet.vue | 77 +++++++++++++++++-- 1 file changed, 72 insertions(+), 5 deletions(-) diff --git a/src/plugins/conditionSet/components/ConditionSet.vue b/src/plugins/conditionSet/components/ConditionSet.vue index 29e5b4d169..321ee8a441 100644 --- a/src/plugins/conditionSet/components/ConditionSet.vue +++ b/src/plugins/conditionSet/components/ConditionSet.vue @@ -21,13 +21,80 @@ *****************************************************************************/ From 99c7bd4c1096b9c76da12d58a16c6e807b92d147 Mon Sep 17 00:00:00 2001 From: Joel McKinnon Date: Thu, 26 Dec 2019 12:25:30 -0800 Subject: [PATCH 029/368] added conditions and condition components --- .../condition/components/Condition.vue | 24 +++++ .../conditionSet/ConditionSetViewProvider.js | 90 ++++++++++--------- .../conditionSet/components/ConditionSet.vue | 47 +++------- .../conditionSet/components/Conditions.vue | 46 ++++++++++ src/plugins/conditionSet/pluginSpec.js | 2 +- 5 files changed, 132 insertions(+), 77 deletions(-) create mode 100644 src/plugins/condition/components/Condition.vue create mode 100644 src/plugins/conditionSet/components/Conditions.vue diff --git a/src/plugins/condition/components/Condition.vue b/src/plugins/condition/components/Condition.vue new file mode 100644 index 0000000000..cfa8aeb670 --- /dev/null +++ b/src/plugins/condition/components/Condition.vue @@ -0,0 +1,24 @@ + + + diff --git a/src/plugins/conditionSet/ConditionSetViewProvider.js b/src/plugins/conditionSet/ConditionSetViewProvider.js index 720e377c91..bef7d6c123 100644 --- a/src/plugins/conditionSet/ConditionSetViewProvider.js +++ b/src/plugins/conditionSet/ConditionSetViewProvider.js @@ -23,47 +23,51 @@ import ConditionSet from './components/ConditionSet.vue'; import Vue from 'vue'; -export default function ConditionSetViewProvider(openmct) { - return { - key: 'conditionSet.view', - name: 'Condition Set', - cssClass: 'icon-summary-widget', - canView: function (domainObject) { - return domainObject.type === 'conditionSet'; - }, - canEdit: function (domainObject) { - return domainObject.type === 'conditionSet'; - }, - view: function (domainObject, objectPath) { - let component; - return { - show(container) { - component = new Vue({ - el: container, - components: { - ConditionSet - }, - provide: { - openmct, - domainObject, - objectPath - }, - data() { - return { - domainObject - }; - }, - template: '' - }); - }, - destroy() { - component.$destroy(); - component = undefined; - } - }; - }, - priority() { - return 100; - } - }; +export default class ConditionSetViewProvider { + constructor(openmct) { + this.openmct = openmct; + this.key = 'conditionSet.view'; + this.cssClass = 'icon-summary-widget'; + } + + canView(domainObject) { + return domainObject.type === 'conditionSet'; + } + + canEdit(domainObject) { + return domainObject.type === 'conditionSet'; + } + + view(domainObject, objectPath) { + let component; + const openmct = this.openmct; + return { + show: (container, isEditing) => { + component = new Vue({ + el: container, + components: { + ConditionSet + }, + provide: { + openmct, + domainObject, + objectPath + }, + data() { + return { + isEditing: isEditing + } + }, + template: '' + }); + }, + onEditModeChange: function (isEditing) { + component.isEditing = isEditing; + }, + destroy: () => { + component.$destroy(); + component = undefined; + } + }; + } } diff --git a/src/plugins/conditionSet/components/ConditionSet.vue b/src/plugins/conditionSet/components/ConditionSet.vue index 321ee8a441..16f8151f9b 100644 --- a/src/plugins/conditionSet/components/ConditionSet.vue +++ b/src/plugins/conditionSet/components/ConditionSet.vue @@ -37,13 +37,13 @@ -
+
Test Data
-
-
@@ -60,6 +60,7 @@
-
- - Conditions -
-
-
- [data] -
-
- -
-
+ + diff --git a/src/plugins/conditionSet/components/Conditions.vue b/src/plugins/conditionSet/components/Conditions.vue new file mode 100644 index 0000000000..0ee65698ce --- /dev/null +++ b/src/plugins/conditionSet/components/Conditions.vue @@ -0,0 +1,46 @@ + + + diff --git a/src/plugins/conditionSet/pluginSpec.js b/src/plugins/conditionSet/pluginSpec.js index 140ba59ac3..e016f11dbe 100644 --- a/src/plugins/conditionSet/pluginSpec.js +++ b/src/plugins/conditionSet/pluginSpec.js @@ -23,7 +23,7 @@ import { createOpenMct } from 'testTools'; import ConditionSetPlugin from './plugin'; -describe('The plugin', () => { +fdescribe('The plugin', () => { let openmct; let conditionSetDefinition; let element; From c34c2df06113f72969c528cd021927b79c1b6691 Mon Sep 17 00:00:00 2001 From: Joel McKinnon Date: Thu, 26 Dec 2019 12:36:58 -0800 Subject: [PATCH 030/368] remove fdescribe --- src/plugins/conditionSet/pluginSpec.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/conditionSet/pluginSpec.js b/src/plugins/conditionSet/pluginSpec.js index e016f11dbe..140ba59ac3 100644 --- a/src/plugins/conditionSet/pluginSpec.js +++ b/src/plugins/conditionSet/pluginSpec.js @@ -23,7 +23,7 @@ import { createOpenMct } from 'testTools'; import ConditionSetPlugin from './plugin'; -fdescribe('The plugin', () => { +describe('The plugin', () => { let openmct; let conditionSetDefinition; let element; From 88219659fbc50baac00de80d8f1a6acd23406c2f Mon Sep 17 00:00:00 2001 From: Joel McKinnon Date: Thu, 26 Dec 2019 13:40:58 -0800 Subject: [PATCH 031/368] renamed Conditions component to ConditionSet --- ...Conditions.vue => ConditionCollection.vue} | 2 +- .../conditionSet/components/ConditionSet.vue | 37 ++++--------------- 2 files changed, 9 insertions(+), 30 deletions(-) rename src/plugins/conditionSet/components/{Conditions.vue => ConditionCollection.vue} (97%) diff --git a/src/plugins/conditionSet/components/Conditions.vue b/src/plugins/conditionSet/components/ConditionCollection.vue similarity index 97% rename from src/plugins/conditionSet/components/Conditions.vue rename to src/plugins/conditionSet/components/ConditionCollection.vue index 0ee65698ce..bb8dfbf095 100644 --- a/src/plugins/conditionSet/components/Conditions.vue +++ b/src/plugins/conditionSet/components/ConditionCollection.vue @@ -1,5 +1,5 @@ @@ -15,16 +19,15 @@ export default { inject: ['openmct'], props: { + currentOutput: String, isEditing: Boolean }, data() { return { - conditionData: { - currentOutput: 'DATA_PRESENT' - } + expanded: true, }; }, methods: { } } - + \ No newline at end of file diff --git a/src/plugins/conditionSet/components/TestData.vue b/src/plugins/conditionSet/components/TestData.vue index 01ae58c55d..afe9533960 100644 --- a/src/plugins/conditionSet/components/TestData.vue +++ b/src/plugins/conditionSet/components/TestData.vue @@ -41,10 +41,11 @@ export default { }, data() { return { - conditionData: {} + expanded: true, }; }, methods: { + } } diff --git a/src/plugins/conditionSet/components/current-output.scss b/src/plugins/conditionSet/components/current-output.scss new file mode 100644 index 0000000000..8a675d195d --- /dev/null +++ b/src/plugins/conditionSet/components/current-output.scss @@ -0,0 +1,50 @@ +.c-cs__ui__header { + background-color: #D0D1D3; + padding: .3em .5em; + text-transform: uppercase; + font-size: 0.8em; + font-weight: bold; + color: #7C7D80; +} + +.c-cs__ui_text { + padding: .5em .5em; + text-transform: uppercase; + font-size: 0.8em; + font-weight: bold; + color: #7C7D80; + +} + +.c-disclosure-triangle { + $d: 8px; + color: $colorDisclosureCtrl; + display: flex; + align-items: center; + justify-content: center; + flex: 0 0 auto; + width: $d; + position: relative; + + &.is-enabled { + cursor: pointer; + + &:hover { + color: $colorDisclosureCtrlHov; + } + + &:before { + $s: .5; + content: $glyph-icon-arrow-up; + display: block; + font-family: symbolsfont; + font-size: 1rem * $s; + } + } + + &--expanded { + &:before { + transform: rotate(180deg); + } + } +} diff --git a/src/styles/vue-styles.scss b/src/styles/vue-styles.scss index 4a9611bd32..be7c4abbd1 100644 --- a/src/styles/vue-styles.scss +++ b/src/styles/vue-styles.scss @@ -1,5 +1,6 @@ @import "../api/overlays/components/dialog-component.scss"; @import "../api/overlays/components/overlay-component.scss"; +@import "../plugins/conditionSet/components/current-output.scss"; @import "../plugins/displayLayout/components/box-view.scss"; @import "../plugins/displayLayout/components/display-layout.scss"; @import "../plugins/displayLayout/components/edit-marquee.scss"; From 1ecdc4c487df6b241a7b53983000ea600d0de66d Mon Sep 17 00:00:00 2001 From: Joel McKinnon Date: Fri, 27 Dec 2019 13:22:05 -0800 Subject: [PATCH 035/368] addressed review comment --- src/plugins/conditionSet/ConditionSetViewProvider.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/plugins/conditionSet/ConditionSetViewProvider.js b/src/plugins/conditionSet/ConditionSetViewProvider.js index 299d1966f9..70962af83e 100644 --- a/src/plugins/conditionSet/ConditionSetViewProvider.js +++ b/src/plugins/conditionSet/ConditionSetViewProvider.js @@ -50,12 +50,11 @@ export default class ConditionSetViewProvider { }, provide: { openmct, - domainObject, objectPath }, data() { return { - isEditing: isEditing + isEditing } }, template: '' From e52f6ce099377fdc68b230a926ebdea4f4eee47d Mon Sep 17 00:00:00 2001 From: Joel McKinnon Date: Fri, 27 Dec 2019 14:19:39 -0800 Subject: [PATCH 036/368] WIP: styling components --- src/plugins/conditionSet/ConditionSetViewProvider.js | 4 ++-- .../conditionSet/components/CurrentOutput.vue | 4 ++-- src/plugins/conditionSet/components/TestData.vue | 8 ++++---- .../{current-output.scss => condition-set.scss} | 12 +++++++++--- src/plugins/conditionSet/pluginSpec.js | 2 +- src/styles/vue-styles.scss | 2 +- 6 files changed, 19 insertions(+), 13 deletions(-) rename src/plugins/conditionSet/components/{current-output.scss => condition-set.scss} (81%) diff --git a/src/plugins/conditionSet/ConditionSetViewProvider.js b/src/plugins/conditionSet/ConditionSetViewProvider.js index a3810770b6..3d8fbfb90c 100644 --- a/src/plugins/conditionSet/ConditionSetViewProvider.js +++ b/src/plugins/conditionSet/ConditionSetViewProvider.js @@ -50,12 +50,12 @@ export default class ConditionSetViewProvider { }, provide: { openmct, - // domainObject, + domainObject, objectPath }, data() { return { - isEditing: isEditing + isEditing } }, template: '' diff --git a/src/plugins/conditionSet/components/CurrentOutput.vue b/src/plugins/conditionSet/components/CurrentOutput.vue index 3ebd6eec90..7f0d94bcd7 100644 --- a/src/plugins/conditionSet/components/CurrentOutput.vue +++ b/src/plugins/conditionSet/components/CurrentOutput.vue @@ -5,8 +5,8 @@
Current Output
diff --git a/src/plugins/conditionSet/components/TestData.vue b/src/plugins/conditionSet/components/TestData.vue index afe9533960..770651b35c 100644 --- a/src/plugins/conditionSet/components/TestData.vue +++ b/src/plugins/conditionSet/components/TestData.vue @@ -3,12 +3,12 @@ id="test-data" class="test-data" > -
+
+ Test Data - Test Data