From 3e5fa30d9d17dfab4f526b370afe11ce85941974 Mon Sep 17 00:00:00 2001 From: larkin Date: Tue, 30 Jun 2015 16:18:37 -0700 Subject: [PATCH 01/30] [Style] Add stub for label link icon --- platform/commonUI/general/res/templates/label.html | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/platform/commonUI/general/res/templates/label.html b/platform/commonUI/general/res/templates/label.html index bfa7bd56ff..701e6ff24c 100644 --- a/platform/commonUI/general/res/templates/label.html +++ b/platform/commonUI/general/res/templates/label.html @@ -22,7 +22,14 @@ {{type.getGlyph()}} + - {{model.name}} + + + è + + + {{model.name}} + From d5d7ac90acc929c3bfec92702b34913d47f85319 Mon Sep 17 00:00:00 2001 From: Charles Hacskaylo Date: Tue, 30 Jun 2015 17:58:56 -0700 Subject: [PATCH 02/30] [Frontend] Markup and CSS for link icon indicators WTD-1423 Grid item version with link at bottom right of main icon; --- .../browse/res/templates/items/grid-item.html | 8 +- platform/commonUI/general/res/css/items.css | 73 +++++++++++-------- .../general/res/css/theme-espresso.css | 45 +++++++----- platform/commonUI/general/res/css/tree.css | 63 +++++++++------- .../commonUI/general/res/sass/_constants.scss | 3 +- .../commonUI/general/res/sass/_icons.scss | 3 + .../general/res/sass/items/_item.scss | 30 +++++++- .../commonUI/general/res/sass/tree/_tree.scss | 17 ++++- .../commonUI/general/res/templates/label.html | 9 +-- 9 files changed, 163 insertions(+), 88 deletions(-) diff --git a/platform/commonUI/browse/res/templates/items/grid-item.html b/platform/commonUI/browse/res/templates/items/grid-item.html index e64afd4a9f..67d744ca1d 100644 --- a/platform/commonUI/browse/res/templates/items/grid-item.html +++ b/platform/commonUI/browse/res/templates/items/grid-item.html @@ -32,7 +32,13 @@
-
{{type.getGlyph()}}
+
+ {{type.getGlyph()}} + + + ô + +
}
diff --git a/platform/commonUI/general/res/css/items.css b/platform/commonUI/general/res/css/items.css index c40b3f7bd9..ed1e1c6c4e 100644 --- a/platform/commonUI/general/res/css/items.css +++ b/platform/commonUI/general/res/css/items.css @@ -151,59 +151,70 @@ /* line 160, ../sass/_mixins.scss */ .items-holder .item.grid-item.btn-menu .invoke-menu { color: #828282; } - /* line 42, ../sass/items/_item.scss */ - .items-holder .item.grid-item .item-main .item-type { - -moz-transition-property: "color"; - -o-transition-property: "color"; - -webkit-transition-property: "color"; - transition-property: "color"; - -moz-transition-duration: 200ms; - -o-transition-duration: 200ms; - -webkit-transition-duration: 200ms; - transition-duration: 200ms; - -moz-transition-timing-function: ease-in-out; - -o-transition-timing-function: ease-in-out; - -webkit-transition-timing-function: ease-in-out; - transition-timing-function: ease-in-out; } /* line 46, ../sass/items/_item.scss */ .items-holder .item.grid-item:hover .item-main .item-type { color: #0099cc !important; } - /* line 49, ../sass/items/_item.scss */ + /* line 48, ../sass/items/_item.scss */ + .items-holder .item.grid-item:hover .item-main .item-type .l-link-icon { + color: #5bf5ef; } + /* line 52, ../sass/items/_item.scss */ .items-holder .item.grid-item:hover .item-main .item-open { opacity: 1; } - /* line 54, ../sass/items/_item.scss */ + /* line 57, ../sass/items/_item.scss */ .items-holder .item.grid-item .contents { top: 5px; right: 5px; bottom: 5px; left: 5px; } - /* line 58, ../sass/items/_item.scss */ + /* line 61, ../sass/items/_item.scss */ .items-holder .item.grid-item .bar.top-bar.abs { bottom: auto; height: 20px; line-height: 20px; z-index: 5; } - /* line 63, ../sass/items/_item.scss */ + /* line 66, ../sass/items/_item.scss */ .items-holder .item.grid-item .bar.top-bar.abs .left, .items-holder .item.grid-item .bar.top-bar.abs .right { width: auto; } - /* line 65, ../sass/items/_item.scss */ + /* line 68, ../sass/items/_item.scss */ .items-holder .item.grid-item .bar.top-bar.abs .left .icon, .items-holder .item.grid-item .bar.top-bar.abs .right .icon { margin-left: 5px; } - /* line 70, ../sass/items/_item.scss */ + /* line 73, ../sass/items/_item.scss */ .items-holder .item.grid-item .bar.bottom-bar.abs { top: auto; height: 30px; padding: 5px; } - /* line 76, ../sass/items/_item.scss */ + /* line 79, ../sass/items/_item.scss */ .items-holder .item.grid-item .item-main { line-height: 160px; z-index: 1; } - /* line 82, ../sass/items/_item.scss */ + /* line 85, ../sass/items/_item.scss */ .items-holder .item.grid-item .item-main .item-type { + overflow: false; + position: absolute; + top: 40px; + right: 40px; + bottom: 40px; + left: 40px; + width: auto; + height: auto; color: #737373; text-align: center; - font-size: 6em; } - /* line 88, ../sass/items/_item.scss */ + font-size: 96.9px; + line-height: 102px; + bottom: auto; + height: 102px; + top: 30px; } + /* line 97, ../sass/items/_item.scss */ + .items-holder .item.grid-item .item-main .item-type .l-link-icon { + color: #09948f; + height: 36px; + line-height: 36px; + position: absolute; + font-size: 32px; + right: -10px; + bottom: -10px; + z-index: 2; } + /* line 110, ../sass/items/_item.scss */ .items-holder .item.grid-item .item-main .item-open { -moz-transition-property: "opacity"; -o-transition-property: "opacity"; @@ -223,17 +234,17 @@ width: 50px; pointer-events: none; text-align: right; } - /* line 100, ../sass/items/_item.scss */ + /* line 122, ../sass/items/_item.scss */ .items-holder .item.grid-item .title { text-shadow: rgba(0, 0, 0, 0.1) 0 1px 2px; color: #cccccc; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; } - /* line 108, ../sass/items/_item.scss */ + /* line 130, ../sass/items/_item.scss */ .items-holder .item.grid-item .details { font-size: 0.8em; } - /* line 111, ../sass/items/_item.scss */ + /* line 133, ../sass/items/_item.scss */ .items-holder .item.grid-item.selected { background-image: url('data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4gPHN2ZyB2ZXJzaW9uPSIxLjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGRlZnM+PGxpbmVhckdyYWRpZW50IGlkPSJncmFkIiBncmFkaWVudFVuaXRzPSJvYmplY3RCb3VuZGluZ0JveCIgeDE9IjAuNSIgeTE9IjAuMCIgeDI9IjAuNSIgeTI9IjEuMCI+PHN0b3Agb2Zmc2V0PSIwJSIgc3RvcC1jb2xvcj0iIzBhYzJmZiIvPjxzdG9wIG9mZnNldD0iMTAwJSIgc3RvcC1jb2xvcj0iIzAwYjRmMCIvPjwvbGluZWFyR3JhZGllbnQ+PC9kZWZzPjxyZWN0IHg9IjAiIHk9IjAiIHdpZHRoPSIxMDAlIiBoZWlnaHQ9IjEwMCUiIGZpbGw9InVybCgjZ3JhZCkiIC8+PC9zdmc+IA=='); background-size: 100%; @@ -270,15 +281,15 @@ /* line 160, ../sass/_mixins.scss */ .items-holder .item.grid-item.selected.btn-menu .invoke-menu { color: #52d4ff; } - /* line 116, ../sass/items/_item.scss */ + /* line 138, ../sass/items/_item.scss */ .items-holder .item.grid-item.selected .item-type, .items-holder .item.grid-item.selected .top-bar .icon:not(.alert) { color: #80dfff; } - /* line 117, ../sass/items/_item.scss */ + /* line 139, ../sass/items/_item.scss */ .items-holder .item.grid-item.selected .item-main .item-open { color: #80dfff; } - /* line 118, ../sass/items/_item.scss */ + /* line 140, ../sass/items/_item.scss */ .items-holder .item.grid-item.selected .title { color: white; } - /* line 120, ../sass/items/_item.scss */ + /* line 142, ../sass/items/_item.scss */ .items-holder .item.grid-item.selected:hover .item-main .item-type { color: white !important; } diff --git a/platform/commonUI/general/res/css/theme-espresso.css b/platform/commonUI/general/res/css/theme-espresso.css index 49c5675a07..bc8e713630 100644 --- a/platform/commonUI/general/res/css/theme-espresso.css +++ b/platform/commonUI/general/res/css/theme-espresso.css @@ -92,7 +92,7 @@ * this source code distribution or the Licensing information page available * at runtime from the About dialog for additional information. *****************************************************************************/ -/* line 5, ../../../../../../../../../../Library/Ruby/Gems/2.0.0/gems/compass-core-1.0.3/stylesheets/compass/reset/_utilities.scss */ +/* line 5, ../../../../../../../../../Library/Ruby/Gems/2.0.0/gems/compass-core-1.0.3/stylesheets/compass/reset/_utilities.scss */ html, body, div, span, applet, object, iframe, h1, h2, h3, h4, h5, h6, p, blockquote, pre, a, abbr, acronym, address, big, cite, code, @@ -113,38 +113,38 @@ time, mark, audio, video { font-size: 100%; vertical-align: baseline; } -/* line 22, ../../../../../../../../../../Library/Ruby/Gems/2.0.0/gems/compass-core-1.0.3/stylesheets/compass/reset/_utilities.scss */ +/* line 22, ../../../../../../../../../Library/Ruby/Gems/2.0.0/gems/compass-core-1.0.3/stylesheets/compass/reset/_utilities.scss */ html { line-height: 1; } -/* line 24, ../../../../../../../../../../Library/Ruby/Gems/2.0.0/gems/compass-core-1.0.3/stylesheets/compass/reset/_utilities.scss */ +/* line 24, ../../../../../../../../../Library/Ruby/Gems/2.0.0/gems/compass-core-1.0.3/stylesheets/compass/reset/_utilities.scss */ ol, ul { list-style: none; } -/* line 26, ../../../../../../../../../../Library/Ruby/Gems/2.0.0/gems/compass-core-1.0.3/stylesheets/compass/reset/_utilities.scss */ +/* line 26, ../../../../../../../../../Library/Ruby/Gems/2.0.0/gems/compass-core-1.0.3/stylesheets/compass/reset/_utilities.scss */ table { border-collapse: collapse; border-spacing: 0; } -/* line 28, ../../../../../../../../../../Library/Ruby/Gems/2.0.0/gems/compass-core-1.0.3/stylesheets/compass/reset/_utilities.scss */ +/* line 28, ../../../../../../../../../Library/Ruby/Gems/2.0.0/gems/compass-core-1.0.3/stylesheets/compass/reset/_utilities.scss */ caption, th, td { text-align: left; font-weight: normal; vertical-align: middle; } -/* line 30, ../../../../../../../../../../Library/Ruby/Gems/2.0.0/gems/compass-core-1.0.3/stylesheets/compass/reset/_utilities.scss */ +/* line 30, ../../../../../../../../../Library/Ruby/Gems/2.0.0/gems/compass-core-1.0.3/stylesheets/compass/reset/_utilities.scss */ q, blockquote { quotes: none; } - /* line 103, ../../../../../../../../../../Library/Ruby/Gems/2.0.0/gems/compass-core-1.0.3/stylesheets/compass/reset/_utilities.scss */ + /* line 103, ../../../../../../../../../Library/Ruby/Gems/2.0.0/gems/compass-core-1.0.3/stylesheets/compass/reset/_utilities.scss */ q:before, q:after, blockquote:before, blockquote:after { content: ""; content: none; } -/* line 32, ../../../../../../../../../../Library/Ruby/Gems/2.0.0/gems/compass-core-1.0.3/stylesheets/compass/reset/_utilities.scss */ +/* line 32, ../../../../../../../../../Library/Ruby/Gems/2.0.0/gems/compass-core-1.0.3/stylesheets/compass/reset/_utilities.scss */ a img { border: none; } -/* line 116, ../../../../../../../../../../Library/Ruby/Gems/2.0.0/gems/compass-core-1.0.3/stylesheets/compass/reset/_utilities.scss */ +/* line 116, ../../../../../../../../../Library/Ruby/Gems/2.0.0/gems/compass-core-1.0.3/stylesheets/compass/reset/_utilities.scss */ article, aside, details, figcaption, figure, footer, header, hgroup, main, menu, nav, section, summary { display: block; } @@ -1256,26 +1256,37 @@ mct-container { .tabular tr td, .tabular tr .td, .tabular .tr td, .tabular .tr .td { border-top: 1px solid rgba(255, 255, 255, 0.1); min-width: 110px; + color: #fff; padding: 2px 5px; vertical-align: top; } - /* line 107, ../sass/lists/_tabular.scss */ + /* line 108, ../sass/lists/_tabular.scss */ .tabular tr td.numeric, .tabular tr .td.numeric, .tabular .tr td.numeric, .tabular .tr .td.numeric { text-align: right; } - /* line 113, ../sass/lists/_tabular.scss */ + /* line 111, ../sass/lists/_tabular.scss */ + .tabular tr td.s-cell-type-value, .tabular tr .td.s-cell-type-value, .tabular .tr td.s-cell-type-value, .tabular .tr .td.s-cell-type-value { + text-align: right; } + /* line 113, ../sass/lists/_tabular.scss */ + .tabular tr td.s-cell-type-value .l-cell-contents, .tabular tr .td.s-cell-type-value .l-cell-contents, .tabular .tr td.s-cell-type-value .l-cell-contents, .tabular .tr .td.s-cell-type-value .l-cell-contents { + -moz-border-radius: 2px; + -webkit-border-radius: 2px; + border-radius: 2px; + padding-left: 5px; + padding-right: 5px; } + /* line 122, ../sass/lists/_tabular.scss */ .tabular.filterable tbody, .tabular.filterable .tbody { top: 36px; } - /* line 118, ../sass/lists/_tabular.scss */ + /* line 127, ../sass/lists/_tabular.scss */ .tabular.fixed-header { height: 100%; } - /* line 120, ../sass/lists/_tabular.scss */ + /* line 129, ../sass/lists/_tabular.scss */ .tabular.fixed-header thead, .tabular.fixed-header .thead, .tabular.fixed-header tbody tr, .tabular.fixed-header .tbody .tr { display: table; table-layout: fixed; } - /* line 125, ../sass/lists/_tabular.scss */ + /* line 134, ../sass/lists/_tabular.scss */ .tabular.fixed-header thead, .tabular.fixed-header .thead { width: calc(100% - 10px); } - /* line 128, ../sass/lists/_tabular.scss */ + /* line 137, ../sass/lists/_tabular.scss */ .tabular.fixed-header tbody, .tabular.fixed-header .tbody { overflow: hidden; position: absolute; @@ -1288,7 +1299,7 @@ mct-container { top: 18px; display: block; overflow-y: scroll; } - /* line 136, ../sass/lists/_tabular.scss */ + /* line 145, ../sass/lists/_tabular.scss */ .tabular.t-event-messages td, .tabular.t-event-messages .td { min-width: 150px; } @@ -2495,7 +2506,7 @@ label.checkbox.custom { -webkit-box-sizing: border-box; box-sizing: border-box; border-top: 1px solid #737373; - line-height: 1.4rem; + line-height: 1.5rem; padding: 3px 10px 3px 30px; white-space: nowrap; } /* line 45, ../sass/controls/_menus.scss */ diff --git a/platform/commonUI/general/res/css/tree.css b/platform/commonUI/general/res/css/tree.css index 75b40aa115..614a74df81 100644 --- a/platform/commonUI/general/res/css/tree.css +++ b/platform/commonUI/general/res/css/tree.css @@ -122,9 +122,9 @@ ul.tree { -webkit-transition: background-color 0.25s; transition: background-color 0.25s; display: block; - font-size: 0.80em; - height: 1.4rem; - line-height: 1.4rem; + font-size: 0.8em; + height: 1.5rem; + line-height: 1.5rem; margin-bottom: 3px; position: relative; } /* line 38, ../sass/tree/_tree.scss */ @@ -150,17 +150,19 @@ ul.tree { left: 20px; } /* line 55, ../sass/tree/_tree.scss */ ul.tree li span.tree-item .label .type-icon { - overflow: hidden; + overflow: false; position: absolute; - top: 0px; - right: 0px; - bottom: 0px; - left: 0px; + top: 0; + right: 0; + bottom: 0; + left: 0; width: auto; height: auto; text-shadow: rgba(0, 0, 0, 0.6) 0 1px 2px; - color: #0099cc; } - /* line 59, ../sass/tree/_tree.scss */ + color: #0099cc; + right: auto; + width: 1em; } + /* line 60, ../sass/tree/_tree.scss */ ul.tree li span.tree-item .label .type-icon .alert { text-shadow: rgba(0, 0, 0, 0.3) 0 1px 2px; background: #333; @@ -175,7 +177,16 @@ ul.tree { width: auto; position: absolute; z-index: 2; } - /* line 75, ../sass/tree/_tree.scss */ + /* line 75, ../sass/tree/_tree.scss */ + ul.tree li span.tree-item .label .type-icon .icon.l-link-icon { + text-shadow: black 0 1px 2px; + color: #5bf5ef; + position: absolute; + font-size: 0.5em; + right: -5px; + bottom: -8px; + z-index: 2; } + /* line 86, ../sass/tree/_tree.scss */ ul.tree li span.tree-item .label .title-label { overflow: hidden; position: absolute; @@ -186,55 +197,55 @@ ul.tree { width: auto; height: auto; display: block; - left: 20px; + left: 25px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } - /* line 87, ../sass/tree/_tree.scss */ + /* line 98, ../sass/tree/_tree.scss */ ul.tree li span.tree-item.loading { pointer-events: none; } - /* line 89, ../sass/tree/_tree.scss */ + /* line 100, ../sass/tree/_tree.scss */ ul.tree li span.tree-item.loading .label { opacity: 0.5; } - /* line 91, ../sass/tree/_tree.scss */ + /* line 102, ../sass/tree/_tree.scss */ ul.tree li span.tree-item.loading .label .title-label { font-style: italic; } - /* line 95, ../sass/tree/_tree.scss */ + /* line 106, ../sass/tree/_tree.scss */ ul.tree li span.tree-item.loading .wait-spinner { margin-left: 14px; } - /* line 100, ../sass/tree/_tree.scss */ + /* line 111, ../sass/tree/_tree.scss */ ul.tree li span.tree-item.selected { background: #005177; color: #fff; } - /* line 104, ../sass/tree/_tree.scss */ + /* line 115, ../sass/tree/_tree.scss */ ul.tree li span.tree-item.selected .view-control { color: #0099cc; } - /* line 107, ../sass/tree/_tree.scss */ + /* line 118, ../sass/tree/_tree.scss */ ul.tree li span.tree-item.selected .label .type-icon { color: #fff; } - /* line 113, ../sass/tree/_tree.scss */ + /* line 124, ../sass/tree/_tree.scss */ ul.tree li span.tree-item:not(.selected):hover { background: #404040; color: #cccccc; } - /* line 116, ../sass/tree/_tree.scss */ + /* line 127, ../sass/tree/_tree.scss */ ul.tree li span.tree-item:not(.selected):hover .context-trigger { display: block; } - /* line 119, ../sass/tree/_tree.scss */ + /* line 130, ../sass/tree/_tree.scss */ ul.tree li span.tree-item:not(.selected):hover .icon { color: #33ccff; } - /* line 125, ../sass/tree/_tree.scss */ + /* line 136, ../sass/tree/_tree.scss */ ul.tree li span.tree-item:not(.loading) { cursor: pointer; } - /* line 129, ../sass/tree/_tree.scss */ + /* line 140, ../sass/tree/_tree.scss */ ul.tree li span.tree-item .context-trigger { top: -1px; position: absolute; right: 3px; } - /* line 135, ../sass/tree/_tree.scss */ + /* line 146, ../sass/tree/_tree.scss */ ul.tree li span.tree-item .context-trigger .invoke-menu { font-size: 0.75em; height: 0.9rem; line-height: 0.9rem; } - /* line 144, ../sass/tree/_tree.scss */ + /* line 155, ../sass/tree/_tree.scss */ ul.tree ul.tree { margin-left: 15px; } diff --git a/platform/commonUI/general/res/sass/_constants.scss b/platform/commonUI/general/res/sass/_constants.scss index 8a8fed19d1..1cb6b20fda 100644 --- a/platform/commonUI/general/res/sass/_constants.scss +++ b/platform/commonUI/general/res/sass/_constants.scss @@ -42,6 +42,7 @@ $colorKeySelectedBg: #005177; $colorKeyFg: #fff; $colorAlt1: #ffc700; $colorAlert: #ff3c00; +$colorIconLink: #5bf5ef; $colorPausedBg: #c56f01; $colorPausedFg: #fff; $colorCreateBtn: $colorKey; @@ -145,7 +146,7 @@ $controlDisabledOpacity: 0.3; $formLabelW: 20%; $formInputH: 22px; $formRowCtrlsH: 14px; -$menuLineH: 1.4rem; +$menuLineH: 1.5rem; $scrollbarTrackSize: 10px; $scrollbarTrackColorBg: rgba(#000, 0.4); $btnStdH: 25px; diff --git a/platform/commonUI/general/res/sass/_icons.scss b/platform/commonUI/general/res/sass/_icons.scss index 71be99d43a..c0f40a729a 100644 --- a/platform/commonUI/general/res/sass/_icons.scss +++ b/platform/commonUI/general/res/sass/_icons.scss @@ -85,3 +85,6 @@ //font-size: $menuLineH * 0.95 // Normalizing for new icomoon symbols font } +.l-link-icon { +} + diff --git a/platform/commonUI/general/res/sass/items/_item.scss b/platform/commonUI/general/res/sass/items/_item.scss index 5a5cdaf9a3..edfdc619a2 100644 --- a/platform/commonUI/general/res/sass/items/_item.scss +++ b/platform/commonUI/general/res/sass/items/_item.scss @@ -29,6 +29,9 @@ &.grid-item { //div { @include test() } $d: $ueBrowseGridItemLg; + //$iconD: 100px; + $iconMargin: 40px; + $iconD: ($d - ($iconMargin * 2)) * 0.85; $transTime: 200ms; @include btnSubtle($colorItemBase); box-sizing: border-box; @@ -39,12 +42,12 @@ margin-bottom: $interiorMarginSm; margin-right: $interiorMarginSm; position: relative; - .item-main .item-type { - @include trans-prop-nice("color", $transTime); - } &:hover .item-main { .item-type { color: $colorKey !important; + .l-link-icon { + color: $colorIconLink; + } } .item-open { //display: block; @@ -80,10 +83,29 @@ line-height: $lh; z-index: 1; .item-type { + //@include trans-prop-nice("color", $transTime); + @include absPosDefault($iconMargin, false); + //@include test(red); color: $colorItemFg; text-align: center; - font-size: 6em; + font-size: $iconD * 0.95; //6em; + line-height: $iconD; + bottom: auto; + height: $iconD; + top: $iconMargin - 10; //line-height: $lh; + .l-link-icon { + //@include test(blue); + //@include trans-prop-nice("color", $transTime); + color: darken($colorIconLink, 35%); + height: 36px; + line-height: 36px; + position: absolute; + font-size: 32px; + right: -10px; + bottom: -10px; + z-index: 2; + } } .item-open { //@include test(); diff --git a/platform/commonUI/general/res/sass/tree/_tree.scss b/platform/commonUI/general/res/sass/tree/_tree.scss index 356bb8a527..d92c9afebb 100644 --- a/platform/commonUI/general/res/sass/tree/_tree.scss +++ b/platform/commonUI/general/res/sass/tree/_tree.scss @@ -29,7 +29,7 @@ ul.tree { @include border-radius($basicCr); @include single-transition(background-color, 0.25s); display: block; - font-size: 0.80em; + font-size: 0.8em; height: $menuLineH; line-height: $menuLineH; margin-bottom: $interiorMarginSm; @@ -53,9 +53,10 @@ ul.tree { left: $runningItemW + $interiorMargin; .type-icon { - @include absPosDefault(); + @include absPosDefault(0, false); @include txtShdwSubtle(0.6); color: $colorItemTreeIcon; + right: auto; width: 1em; .alert { @include txtShdwSubtle(0.3); background: $colorBodyBg; @@ -71,11 +72,21 @@ ul.tree { position: absolute; z-index: 2; } + .icon.l-link-icon { + @include txtShdwSubtle(1); + $d: 20px; + color: $colorIconLink; + position: absolute; + font-size: 0.5em; + right: -5px; + bottom: -8px; + z-index: 2; + } } .title-label { @include absPosDefault(); display: block; - left: $runningItemW + ($interiorMargin); + left: $runningItemW + ($interiorMargin * 2); //right: $treeContextTriggerW + $interiorMargin; overflow: hidden; text-overflow: ellipsis; diff --git a/platform/commonUI/general/res/templates/label.html b/platform/commonUI/general/res/templates/label.html index 701e6ff24c..da63abd07a 100644 --- a/platform/commonUI/general/res/templates/label.html +++ b/platform/commonUI/general/res/templates/label.html @@ -22,13 +22,12 @@ {{type.getGlyph()}} - + + + ô + - - - è - {{model.name}} From e0727e848597fdfdcfe954297933f77ee71c5b9d Mon Sep 17 00:00:00 2001 From: Charles Hacskaylo Date: Tue, 30 Jun 2015 18:13:17 -0700 Subject: [PATCH 03/30] [Frontend] Markup and CSS for link icon indicators WTD-1423 Added small icon to upper right; IN PROGRESS; --- .../browse/res/templates/items/grid-item.html | 6 ++-- platform/commonUI/general/res/css/items.css | 35 ++++++++++--------- platform/commonUI/general/res/css/tree.css | 2 +- .../commonUI/general/res/sass/_constants.scss | 2 +- .../commonUI/general/res/sass/_icons.scss | 6 +--- .../general/res/sass/items/_item.scss | 12 ++++--- 6 files changed, 32 insertions(+), 31 deletions(-) diff --git a/platform/commonUI/browse/res/templates/items/grid-item.html b/platform/commonUI/browse/res/templates/items/grid-item.html index 67d744ca1d..6372b8c393 100644 --- a/platform/commonUI/browse/res/templates/items/grid-item.html +++ b/platform/commonUI/browse/res/templates/items/grid-item.html @@ -29,15 +29,15 @@
P
+ + ô
{{type.getGlyph()}} - - ô - + ô
}
diff --git a/platform/commonUI/general/res/css/items.css b/platform/commonUI/general/res/css/items.css index ed1e1c6c4e..4b3ac6f8b9 100644 --- a/platform/commonUI/general/res/css/items.css +++ b/platform/commonUI/general/res/css/items.css @@ -156,7 +156,7 @@ color: #0099cc !important; } /* line 48, ../sass/items/_item.scss */ .items-holder .item.grid-item:hover .item-main .item-type .l-link-icon { - color: #5bf5ef; } + color: #49dedb; } /* line 52, ../sass/items/_item.scss */ .items-holder .item.grid-item:hover .item-main .item-open { opacity: 1; } @@ -177,17 +177,20 @@ width: auto; } /* line 68, ../sass/items/_item.scss */ .items-holder .item.grid-item .bar.top-bar.abs .left .icon, .items-holder .item.grid-item .bar.top-bar.abs .right .icon { - margin-left: 5px; } - /* line 73, ../sass/items/_item.scss */ + margin-left: 3px; } + /* line 70, ../sass/items/_item.scss */ + .items-holder .item.grid-item .bar.top-bar.abs .left .icon.l-link-icon, .items-holder .item.grid-item .bar.top-bar.abs .right .icon.l-link-icon { + color: #49dedb; } + /* line 76, ../sass/items/_item.scss */ .items-holder .item.grid-item .bar.bottom-bar.abs { top: auto; height: 30px; padding: 5px; } - /* line 79, ../sass/items/_item.scss */ + /* line 82, ../sass/items/_item.scss */ .items-holder .item.grid-item .item-main { line-height: 160px; z-index: 1; } - /* line 85, ../sass/items/_item.scss */ + /* line 88, ../sass/items/_item.scss */ .items-holder .item.grid-item .item-main .item-type { overflow: false; position: absolute; @@ -204,17 +207,17 @@ bottom: auto; height: 102px; top: 30px; } - /* line 97, ../sass/items/_item.scss */ + /* line 100, ../sass/items/_item.scss */ .items-holder .item.grid-item .item-main .item-type .l-link-icon { - color: #09948f; + color: #1a8e8b; height: 36px; line-height: 36px; position: absolute; font-size: 32px; - right: -10px; + right: -13px; bottom: -10px; z-index: 2; } - /* line 110, ../sass/items/_item.scss */ + /* line 112, ../sass/items/_item.scss */ .items-holder .item.grid-item .item-main .item-open { -moz-transition-property: "opacity"; -o-transition-property: "opacity"; @@ -234,17 +237,17 @@ width: 50px; pointer-events: none; text-align: right; } - /* line 122, ../sass/items/_item.scss */ + /* line 124, ../sass/items/_item.scss */ .items-holder .item.grid-item .title { text-shadow: rgba(0, 0, 0, 0.1) 0 1px 2px; color: #cccccc; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; } - /* line 130, ../sass/items/_item.scss */ + /* line 132, ../sass/items/_item.scss */ .items-holder .item.grid-item .details { font-size: 0.8em; } - /* line 133, ../sass/items/_item.scss */ + /* line 135, ../sass/items/_item.scss */ .items-holder .item.grid-item.selected { background-image: url('data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4gPHN2ZyB2ZXJzaW9uPSIxLjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGRlZnM+PGxpbmVhckdyYWRpZW50IGlkPSJncmFkIiBncmFkaWVudFVuaXRzPSJvYmplY3RCb3VuZGluZ0JveCIgeDE9IjAuNSIgeTE9IjAuMCIgeDI9IjAuNSIgeTI9IjEuMCI+PHN0b3Agb2Zmc2V0PSIwJSIgc3RvcC1jb2xvcj0iIzBhYzJmZiIvPjxzdG9wIG9mZnNldD0iMTAwJSIgc3RvcC1jb2xvcj0iIzAwYjRmMCIvPjwvbGluZWFyR3JhZGllbnQ+PC9kZWZzPjxyZWN0IHg9IjAiIHk9IjAiIHdpZHRoPSIxMDAlIiBoZWlnaHQ9IjEwMCUiIGZpbGw9InVybCgjZ3JhZCkiIC8+PC9zdmc+IA=='); background-size: 100%; @@ -281,15 +284,15 @@ /* line 160, ../sass/_mixins.scss */ .items-holder .item.grid-item.selected.btn-menu .invoke-menu { color: #52d4ff; } - /* line 138, ../sass/items/_item.scss */ + /* line 140, ../sass/items/_item.scss */ .items-holder .item.grid-item.selected .item-type, .items-holder .item.grid-item.selected .top-bar .icon:not(.alert) { color: #80dfff; } - /* line 139, ../sass/items/_item.scss */ + /* line 141, ../sass/items/_item.scss */ .items-holder .item.grid-item.selected .item-main .item-open { color: #80dfff; } - /* line 140, ../sass/items/_item.scss */ + /* line 142, ../sass/items/_item.scss */ .items-holder .item.grid-item.selected .title { color: white; } - /* line 142, ../sass/items/_item.scss */ + /* line 144, ../sass/items/_item.scss */ .items-holder .item.grid-item.selected:hover .item-main .item-type { color: white !important; } diff --git a/platform/commonUI/general/res/css/tree.css b/platform/commonUI/general/res/css/tree.css index 614a74df81..ec69f0ebc3 100644 --- a/platform/commonUI/general/res/css/tree.css +++ b/platform/commonUI/general/res/css/tree.css @@ -180,7 +180,7 @@ ul.tree { /* line 75, ../sass/tree/_tree.scss */ ul.tree li span.tree-item .label .type-icon .icon.l-link-icon { text-shadow: black 0 1px 2px; - color: #5bf5ef; + color: #49dedb; position: absolute; font-size: 0.5em; right: -5px; diff --git a/platform/commonUI/general/res/sass/_constants.scss b/platform/commonUI/general/res/sass/_constants.scss index 1cb6b20fda..c9c3374f76 100644 --- a/platform/commonUI/general/res/sass/_constants.scss +++ b/platform/commonUI/general/res/sass/_constants.scss @@ -42,7 +42,7 @@ $colorKeySelectedBg: #005177; $colorKeyFg: #fff; $colorAlt1: #ffc700; $colorAlert: #ff3c00; -$colorIconLink: #5bf5ef; +$colorIconLink: #49dedb; $colorPausedBg: #c56f01; $colorPausedFg: #fff; $colorCreateBtn: $colorKey; diff --git a/platform/commonUI/general/res/sass/_icons.scss b/platform/commonUI/general/res/sass/_icons.scss index c0f40a729a..69fdf7c472 100644 --- a/platform/commonUI/general/res/sass/_icons.scss +++ b/platform/commonUI/general/res/sass/_icons.scss @@ -83,8 +83,4 @@ .super-menu.menu.dropdown .icon { //font-size: $menuLineH * 0.95 // Normalizing for new icomoon symbols font -} - -.l-link-icon { -} - +} \ No newline at end of file diff --git a/platform/commonUI/general/res/sass/items/_item.scss b/platform/commonUI/general/res/sass/items/_item.scss index edfdc619a2..650585b25d 100644 --- a/platform/commonUI/general/res/sass/items/_item.scss +++ b/platform/commonUI/general/res/sass/items/_item.scss @@ -66,7 +66,10 @@ .left, .right { width: auto; .icon { - margin-left: $interiorMargin; + margin-left: $interiorMarginSm; + &.l-link-icon { + color: $colorIconLink; + } } } } @@ -95,14 +98,13 @@ top: $iconMargin - 10; //line-height: $lh; .l-link-icon { - //@include test(blue); - //@include trans-prop-nice("color", $transTime); - color: darken($colorIconLink, 35%); + // When the link icon is in the item-type icon holder + color: darken($colorIconLink, 25%); height: 36px; line-height: 36px; position: absolute; font-size: 32px; - right: -10px; + right: -13px; bottom: -10px; z-index: 2; } From 2a032bf66d002379a5f75ccd01532ce1e1e2a94d Mon Sep 17 00:00:00 2001 From: Charles Hacskaylo Date: Wed, 1 Jul 2015 09:48:35 -0700 Subject: [PATCH 04/30] [Frontend] CSS and font updates ONLY from open1423 WTD-1423 Cherry-pick this into open1404 to get latest fonts and CSS into open-master; --- platform/commonUI/general/res/css/forms.css | 6 +- platform/commonUI/general/res/css/items.css | 22 ++-- .../general/res/css/theme-espresso.css | 110 +++++++++--------- platform/commonUI/general/res/css/tree.css | 62 +++++----- .../symbols/iconmoon.io-WTD-Symbols-v2.0.json | 72 ++++++++---- .../general/res/fonts/symbols/wtdsymbols.eot | Bin 9860 -> 10072 bytes .../general/res/fonts/symbols/wtdsymbols.svg | 3 +- .../general/res/fonts/symbols/wtdsymbols.ttf | Bin 9684 -> 9896 bytes .../general/res/fonts/symbols/wtdsymbols.woff | Bin 9760 -> 9972 bytes .../commonUI/general/res/sass/_icons.scss | 74 ++++++------ .../commonUI/general/res/sass/_mixins.scss | 10 ++ .../general/res/sass/items/_item.scss | 10 +- .../commonUI/general/res/sass/tree/_tree.scss | 54 ++++----- 13 files changed, 229 insertions(+), 194 deletions(-) diff --git a/platform/commonUI/general/res/css/forms.css b/platform/commonUI/general/res/css/forms.css index bc7cbac350..3bb97a0f77 100644 --- a/platform/commonUI/general/res/css/forms.css +++ b/platform/commonUI/general/res/css/forms.css @@ -391,7 +391,7 @@ input[type="text"] { margin: 0 0 2px 2px; overflow: hidden; position: relative; } - /* line 152, ../sass/_mixins.scss */ + /* line 162, ../sass/_mixins.scss */ .form-control.select:not(.disabled):hover { background-image: url('data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4gPHN2ZyB2ZXJzaW9uPSIxLjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGRlZnM+PGxpbmVhckdyYWRpZW50IGlkPSJncmFkIiBncmFkaWVudFVuaXRzPSJvYmplY3RCb3VuZGluZ0JveCIgeDE9IjAuNSIgeTE9IjAuMCIgeDI9IjAuNSIgeTI9IjEuMCI+PHN0b3Agb2Zmc2V0PSIwJSIgc3RvcC1jb2xvcj0iIzYzNjM2MyIvPjxzdG9wIG9mZnNldD0iMTAwJSIgc3RvcC1jb2xvcj0iIzU3NTc1NyIvPjwvbGluZWFyR3JhZGllbnQ+PC9kZWZzPjxyZWN0IHg9IjAiIHk9IjAiIHdpZHRoPSIxMDAlIiBoZWlnaHQ9IjEwMCUiIGZpbGw9InVybCgjZ3JhZCkiIC8+PC9zdmc+IA=='); background-size: 100%; @@ -400,10 +400,10 @@ input[type="text"] { background-image: -webkit-linear-gradient(#636363, #575757); background-image: linear-gradient(#636363, #575757); color: #bdbdbd; } - /* line 155, ../sass/_mixins.scss */ + /* line 165, ../sass/_mixins.scss */ .form-control.select:not(.disabled):hover.btn-menu .invoke-menu { color: #878787; } - /* line 160, ../sass/_mixins.scss */ + /* line 170, ../sass/_mixins.scss */ .form-control.select.btn-menu .invoke-menu { color: #757575; } /* line 29, ../sass/forms/_selects.scss */ diff --git a/platform/commonUI/general/res/css/items.css b/platform/commonUI/general/res/css/items.css index 4b3ac6f8b9..c0ba5edecf 100644 --- a/platform/commonUI/general/res/css/items.css +++ b/platform/commonUI/general/res/css/items.css @@ -136,7 +136,7 @@ margin-bottom: 3px; margin-right: 3px; position: relative; } - /* line 152, ../sass/_mixins.scss */ + /* line 162, ../sass/_mixins.scss */ .items-holder .item.grid-item:not(.disabled):hover { background-image: url('data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4gPHN2ZyB2ZXJzaW9uPSIxLjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGRlZnM+PGxpbmVhckdyYWRpZW50IGlkPSJncmFkIiBncmFkaWVudFVuaXRzPSJvYmplY3RCb3VuZGluZ0JveCIgeDE9IjAuNSIgeTE9IjAuMCIgeDI9IjAuNSIgeTI9IjEuMCI+PHN0b3Agb2Zmc2V0PSIwJSIgc3RvcC1jb2xvcj0iIzcwNzA3MCIvPjxzdG9wIG9mZnNldD0iMTAwJSIgc3RvcC1jb2xvcj0iIzYzNjM2MyIvPjwvbGluZWFyR3JhZGllbnQ+PC9kZWZzPjxyZWN0IHg9IjAiIHk9IjAiIHdpZHRoPSIxMDAlIiBoZWlnaHQ9IjEwMCUiIGZpbGw9InVybCgjZ3JhZCkiIC8+PC9zdmc+IA=='); background-size: 100%; @@ -145,17 +145,17 @@ background-image: -webkit-linear-gradient(#707070, #636363); background-image: linear-gradient(#707070, #636363); color: #bdbdbd; } - /* line 155, ../sass/_mixins.scss */ + /* line 165, ../sass/_mixins.scss */ .items-holder .item.grid-item:not(.disabled):hover.btn-menu .invoke-menu { color: #949494; } - /* line 160, ../sass/_mixins.scss */ + /* line 170, ../sass/_mixins.scss */ .items-holder .item.grid-item.btn-menu .invoke-menu { color: #828282; } /* line 46, ../sass/items/_item.scss */ .items-holder .item.grid-item:hover .item-main .item-type { color: #0099cc !important; } /* line 48, ../sass/items/_item.scss */ - .items-holder .item.grid-item:hover .item-main .item-type .l-link-icon { + .items-holder .item.grid-item:hover .item-main .item-type .l-icon-link { color: #49dedb; } /* line 52, ../sass/items/_item.scss */ .items-holder .item.grid-item:hover .item-main .item-open { @@ -179,7 +179,7 @@ .items-holder .item.grid-item .bar.top-bar.abs .left .icon, .items-holder .item.grid-item .bar.top-bar.abs .right .icon { margin-left: 3px; } /* line 70, ../sass/items/_item.scss */ - .items-holder .item.grid-item .bar.top-bar.abs .left .icon.l-link-icon, .items-holder .item.grid-item .bar.top-bar.abs .right .icon.l-link-icon { + .items-holder .item.grid-item .bar.top-bar.abs .left .icon.l-icon-link, .items-holder .item.grid-item .bar.top-bar.abs .right .icon.l-icon-link { color: #49dedb; } /* line 76, ../sass/items/_item.scss */ .items-holder .item.grid-item .bar.bottom-bar.abs { @@ -208,14 +208,14 @@ height: 102px; top: 30px; } /* line 100, ../sass/items/_item.scss */ - .items-holder .item.grid-item .item-main .item-type .l-link-icon { + .items-holder .item.grid-item .item-main .item-type .l-icon-link { color: #1a8e8b; height: 36px; line-height: 36px; position: absolute; font-size: 32px; - right: -13px; - bottom: -10px; + left: 0px; + bottom: 10px; z-index: 2; } /* line 112, ../sass/items/_item.scss */ .items-holder .item.grid-item .item-main .item-open { @@ -269,7 +269,7 @@ color: #999; display: inline-block; color: #80dfff; } - /* line 152, ../sass/_mixins.scss */ + /* line 162, ../sass/_mixins.scss */ .items-holder .item.grid-item.selected:not(.disabled):hover { background-image: url('data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4gPHN2ZyB2ZXJzaW9uPSIxLjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGRlZnM+PGxpbmVhckdyYWRpZW50IGlkPSJncmFkIiBncmFkaWVudFVuaXRzPSJvYmplY3RCb3VuZGluZ0JveCIgeDE9IjAuNSIgeTE9IjAuMCIgeDI9IjAuNSIgeTI9IjEuMCI+PHN0b3Agb2Zmc2V0PSIwJSIgc3RvcC1jb2xvcj0iIzJlY2JmZiIvPjxzdG9wIG9mZnNldD0iMTAwJSIgc3RvcC1jb2xvcj0iIzE0YzRmZiIvPjwvbGluZWFyR3JhZGllbnQ+PC9kZWZzPjxyZWN0IHg9IjAiIHk9IjAiIHdpZHRoPSIxMDAlIiBoZWlnaHQ9IjEwMCUiIGZpbGw9InVybCgjZ3JhZCkiIC8+PC9zdmc+IA=='); background-size: 100%; @@ -278,10 +278,10 @@ background-image: -webkit-linear-gradient(#2ecbff, #14c4ff); background-image: linear-gradient(#2ecbff, #14c4ff); color: #bdbdbd; } - /* line 155, ../sass/_mixins.scss */ + /* line 165, ../sass/_mixins.scss */ .items-holder .item.grid-item.selected:not(.disabled):hover.btn-menu .invoke-menu { color: #75ddff; } - /* line 160, ../sass/_mixins.scss */ + /* line 170, ../sass/_mixins.scss */ .items-holder .item.grid-item.selected.btn-menu .invoke-menu { color: #52d4ff; } /* line 140, ../sass/items/_item.scss */ diff --git a/platform/commonUI/general/res/css/theme-espresso.css b/platform/commonUI/general/res/css/theme-espresso.css index bc8e713630..acf68b7037 100644 --- a/platform/commonUI/general/res/css/theme-espresso.css +++ b/platform/commonUI/general/res/css/theme-espresso.css @@ -92,7 +92,7 @@ * this source code distribution or the Licensing information page available * at runtime from the About dialog for additional information. *****************************************************************************/ -/* line 5, ../../../../../../../../../Library/Ruby/Gems/2.0.0/gems/compass-core-1.0.3/stylesheets/compass/reset/_utilities.scss */ +/* line 5, ../../../../../../../../../../Library/Ruby/Gems/2.0.0/gems/compass-core-1.0.3/stylesheets/compass/reset/_utilities.scss */ html, body, div, span, applet, object, iframe, h1, h2, h3, h4, h5, h6, p, blockquote, pre, a, abbr, acronym, address, big, cite, code, @@ -113,38 +113,38 @@ time, mark, audio, video { font-size: 100%; vertical-align: baseline; } -/* line 22, ../../../../../../../../../Library/Ruby/Gems/2.0.0/gems/compass-core-1.0.3/stylesheets/compass/reset/_utilities.scss */ +/* line 22, ../../../../../../../../../../Library/Ruby/Gems/2.0.0/gems/compass-core-1.0.3/stylesheets/compass/reset/_utilities.scss */ html { line-height: 1; } -/* line 24, ../../../../../../../../../Library/Ruby/Gems/2.0.0/gems/compass-core-1.0.3/stylesheets/compass/reset/_utilities.scss */ +/* line 24, ../../../../../../../../../../Library/Ruby/Gems/2.0.0/gems/compass-core-1.0.3/stylesheets/compass/reset/_utilities.scss */ ol, ul { list-style: none; } -/* line 26, ../../../../../../../../../Library/Ruby/Gems/2.0.0/gems/compass-core-1.0.3/stylesheets/compass/reset/_utilities.scss */ +/* line 26, ../../../../../../../../../../Library/Ruby/Gems/2.0.0/gems/compass-core-1.0.3/stylesheets/compass/reset/_utilities.scss */ table { border-collapse: collapse; border-spacing: 0; } -/* line 28, ../../../../../../../../../Library/Ruby/Gems/2.0.0/gems/compass-core-1.0.3/stylesheets/compass/reset/_utilities.scss */ +/* line 28, ../../../../../../../../../../Library/Ruby/Gems/2.0.0/gems/compass-core-1.0.3/stylesheets/compass/reset/_utilities.scss */ caption, th, td { text-align: left; font-weight: normal; vertical-align: middle; } -/* line 30, ../../../../../../../../../Library/Ruby/Gems/2.0.0/gems/compass-core-1.0.3/stylesheets/compass/reset/_utilities.scss */ +/* line 30, ../../../../../../../../../../Library/Ruby/Gems/2.0.0/gems/compass-core-1.0.3/stylesheets/compass/reset/_utilities.scss */ q, blockquote { quotes: none; } - /* line 103, ../../../../../../../../../Library/Ruby/Gems/2.0.0/gems/compass-core-1.0.3/stylesheets/compass/reset/_utilities.scss */ + /* line 103, ../../../../../../../../../../Library/Ruby/Gems/2.0.0/gems/compass-core-1.0.3/stylesheets/compass/reset/_utilities.scss */ q:before, q:after, blockquote:before, blockquote:after { content: ""; content: none; } -/* line 32, ../../../../../../../../../Library/Ruby/Gems/2.0.0/gems/compass-core-1.0.3/stylesheets/compass/reset/_utilities.scss */ +/* line 32, ../../../../../../../../../../Library/Ruby/Gems/2.0.0/gems/compass-core-1.0.3/stylesheets/compass/reset/_utilities.scss */ a img { border: none; } -/* line 116, ../../../../../../../../../Library/Ruby/Gems/2.0.0/gems/compass-core-1.0.3/stylesheets/compass/reset/_utilities.scss */ +/* line 116, ../../../../../../../../../../Library/Ruby/Gems/2.0.0/gems/compass-core-1.0.3/stylesheets/compass/reset/_utilities.scss */ article, aside, details, figcaption, figure, footer, header, hgroup, main, menu, nav, section, summary { display: block; } @@ -1063,27 +1063,33 @@ mct-container { text-shadow: none; display: inline-block; } -/* line 60, ../sass/_icons.scss */ +/* line 57, ../sass/_icons.scss */ .btn-menu .invoke-menu, .icon.major .invoke-menu { margin-left: 3px; } -/* -.object-header .type-icon { - color: $colorKey; - margin-right: $interiorMarginSm; -} -*/ -/* line 72, ../sass/_icons.scss */ +/* line 62, ../sass/_icons.scss */ .menu .type-icon, .tree-item .type-icon, .super-menu.menu .type-icon { position: absolute; } -/* line 80, ../sass/_icons.scss */ +/* line 68, ../sass/_icons.scss */ .tree-item .type-icon { font-size: 16px; } +/* line 72, ../sass/_icons.scss */ +.l-icon-link:before { + content: "\f4"; } + +/* line 76, ../sass/_icons.scss */ +.l-icon-alert { + display: none !important; } + /* line 78, ../sass/_icons.scss */ + .l-icon-alert:before { + color: #ff3c00; + content: "!"; } + /*.s-limit-upr, .s-limit-lwr { $a: 0.5; @@ -1434,7 +1440,7 @@ mct-container { color: #999; display: inline-block; color: #ccf2ff; } - /* line 152, ../sass/_mixins.scss */ + /* line 162, ../sass/_mixins.scss */ .btn.major:not(.disabled):hover, .s-btn.major:not(.disabled):hover, .major.icon-btn:not(.disabled):hover, @@ -1446,13 +1452,13 @@ mct-container { background-image: -webkit-linear-gradient(#2ecbff, #14c4ff); background-image: linear-gradient(#2ecbff, #14c4ff); color: #bdbdbd; } - /* line 155, ../sass/_mixins.scss */ + /* line 165, ../sass/_mixins.scss */ .btn.major:not(.disabled):hover.btn-menu .invoke-menu, .s-btn.major:not(.disabled):hover.btn-menu .invoke-menu, .major.icon-btn:not(.disabled):hover.btn-menu .invoke-menu, .major.s-icon-btn:not(.disabled):hover.btn-menu .invoke-menu { color: #75ddff; } - /* line 160, ../sass/_mixins.scss */ + /* line 170, ../sass/_mixins.scss */ .btn.major.btn-menu .invoke-menu, .s-btn.major.btn-menu .invoke-menu, .major.btn-menu.icon-btn .invoke-menu, @@ -1482,7 +1488,7 @@ mct-container { border-top: 1px solid #2ecbff; color: #ccf2ff; display: inline-block; } - /* line 152, ../sass/_mixins.scss */ + /* line 162, ../sass/_mixins.scss */ .btn.major:hover:not(.disabled):hover, .s-btn.major:hover:not(.disabled):hover, .major.icon-btn:hover:not(.disabled):hover, @@ -1494,13 +1500,13 @@ mct-container { background-image: -webkit-linear-gradient(#47d1ff, #2ecbff); background-image: linear-gradient(#47d1ff, #2ecbff); color: white; } - /* line 155, ../sass/_mixins.scss */ + /* line 165, ../sass/_mixins.scss */ .btn.major:hover:not(.disabled):hover.btn-menu .invoke-menu, .s-btn.major:hover:not(.disabled):hover.btn-menu .invoke-menu, .major.icon-btn:hover:not(.disabled):hover.btn-menu .invoke-menu, .major.s-icon-btn:hover:not(.disabled):hover.btn-menu .invoke-menu { color: #8fe3ff; } - /* line 160, ../sass/_mixins.scss */ + /* line 170, ../sass/_mixins.scss */ .btn.major:hover.btn-menu .invoke-menu, .s-btn.major:hover.btn-menu .invoke-menu, .major.icon-btn:hover.btn-menu .invoke-menu, @@ -1536,7 +1542,7 @@ mct-container { border-top: 1px solid #8a8a8a; color: #cccccc; display: inline-block; } - /* line 152, ../sass/_mixins.scss */ + /* line 162, ../sass/_mixins.scss */ .btn.subtle:not(.disabled):hover, .s-btn.subtle:not(.disabled):hover, .subtle.icon-btn:not(.disabled):hover, @@ -1548,13 +1554,13 @@ mct-container { background-image: -webkit-linear-gradient(#969696, #8a8a8a); background-image: linear-gradient(#969696, #8a8a8a); color: #f0f0f0; } - /* line 155, ../sass/_mixins.scss */ + /* line 165, ../sass/_mixins.scss */ .btn.subtle:not(.disabled):hover.btn-menu .invoke-menu, .s-btn.subtle:not(.disabled):hover.btn-menu .invoke-menu, .subtle.icon-btn:not(.disabled):hover.btn-menu .invoke-menu, .subtle.s-icon-btn:not(.disabled):hover.btn-menu .invoke-menu { color: #bababa; } - /* line 160, ../sass/_mixins.scss */ + /* line 170, ../sass/_mixins.scss */ .btn.subtle.btn-menu .invoke-menu, .s-btn.subtle.btn-menu .invoke-menu, .subtle.btn-menu.icon-btn .invoke-menu, @@ -1587,7 +1593,7 @@ mct-container { border-top: 1px solid #575757; color: #999; display: inline-block; } - /* line 152, ../sass/_mixins.scss */ + /* line 162, ../sass/_mixins.scss */ .btn.very-subtle:not(.disabled):hover, .btn.s-very-subtle:not(.disabled):hover, .s-btn.very-subtle:not(.disabled):hover, .very-subtle.icon-btn:not(.disabled):hover, @@ -1602,7 +1608,7 @@ mct-container { background-image: -webkit-linear-gradient(#636363, #575757); background-image: linear-gradient(#636363, #575757); color: #bdbdbd; } - /* line 155, ../sass/_mixins.scss */ + /* line 165, ../sass/_mixins.scss */ .btn.very-subtle:not(.disabled):hover.btn-menu .invoke-menu, .btn.s-very-subtle:not(.disabled):hover.btn-menu .invoke-menu, .s-btn.very-subtle:not(.disabled):hover.btn-menu .invoke-menu, .very-subtle.icon-btn:not(.disabled):hover.btn-menu .invoke-menu, @@ -1611,7 +1617,7 @@ mct-container { .s-very-subtle.icon-btn:not(.disabled):hover.btn-menu .invoke-menu, .s-very-subtle.s-icon-btn:not(.disabled):hover.btn-menu .invoke-menu { color: #878787; } - /* line 160, ../sass/_mixins.scss */ + /* line 170, ../sass/_mixins.scss */ .btn.very-subtle.btn-menu .invoke-menu, .btn.s-very-subtle.btn-menu .invoke-menu, .s-btn.very-subtle.btn-menu .invoke-menu, .very-subtle.btn-menu.icon-btn .invoke-menu, @@ -1647,7 +1653,7 @@ mct-container { border-top: 1px solid #fe9510; color: #fff; display: inline-block; } - /* line 152, ../sass/_mixins.scss */ + /* line 162, ../sass/_mixins.scss */ .btn.very-subtle.paused:not(.disabled):hover, .btn.s-very-subtle.paused:not(.disabled):hover, .s-btn.very-subtle.paused:not(.disabled):hover, .very-subtle.paused.icon-btn:not(.disabled):hover, @@ -1662,7 +1668,7 @@ mct-container { background-image: -webkit-linear-gradient(#fea029, #fe9510); background-image: linear-gradient(#fea029, #fe9510); color: white; } - /* line 155, ../sass/_mixins.scss */ + /* line 165, ../sass/_mixins.scss */ .btn.very-subtle.paused:not(.disabled):hover.btn-menu .invoke-menu, .btn.s-very-subtle.paused:not(.disabled):hover.btn-menu .invoke-menu, .s-btn.very-subtle.paused:not(.disabled):hover.btn-menu .invoke-menu, .very-subtle.paused.icon-btn:not(.disabled):hover.btn-menu .invoke-menu, @@ -1671,7 +1677,7 @@ mct-container { .s-very-subtle.paused.icon-btn:not(.disabled):hover.btn-menu .invoke-menu, .s-very-subtle.paused.s-icon-btn:not(.disabled):hover.btn-menu .invoke-menu { color: #fec070; } - /* line 160, ../sass/_mixins.scss */ + /* line 170, ../sass/_mixins.scss */ .btn.very-subtle.paused.btn-menu .invoke-menu, .btn.s-very-subtle.paused.btn-menu .invoke-menu, .s-btn.very-subtle.paused.btn-menu .invoke-menu, .very-subtle.paused.btn-menu.icon-btn .invoke-menu, @@ -2133,7 +2139,7 @@ label.checkbox.custom { color: lighten($c, 10%); } }*/ } - /* line 152, ../sass/_mixins.scss */ + /* line 162, ../sass/_mixins.scss */ .btn-menu:not(.disabled):hover { background-image: url('data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4gPHN2ZyB2ZXJzaW9uPSIxLjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGRlZnM+PGxpbmVhckdyYWRpZW50IGlkPSJncmFkIiBncmFkaWVudFVuaXRzPSJvYmplY3RCb3VuZGluZ0JveCIgeDE9IjAuNSIgeTE9IjAuMCIgeDI9IjAuNSIgeTI9IjEuMCI+PHN0b3Agb2Zmc2V0PSIwJSIgc3RvcC1jb2xvcj0iIzYzNjM2MyIvPjxzdG9wIG9mZnNldD0iMTAwJSIgc3RvcC1jb2xvcj0iIzU3NTc1NyIvPjwvbGluZWFyR3JhZGllbnQ+PC9kZWZzPjxyZWN0IHg9IjAiIHk9IjAiIHdpZHRoPSIxMDAlIiBoZWlnaHQ9IjEwMCUiIGZpbGw9InVybCgjZ3JhZCkiIC8+PC9zdmc+IA=='); background-size: 100%; @@ -2142,10 +2148,10 @@ label.checkbox.custom { background-image: -webkit-linear-gradient(#636363, #575757); background-image: linear-gradient(#636363, #575757); color: #bdbdbd; } - /* line 155, ../sass/_mixins.scss */ + /* line 165, ../sass/_mixins.scss */ .btn-menu:not(.disabled):hover.btn-menu .invoke-menu { color: #878787; } - /* line 160, ../sass/_mixins.scss */ + /* line 170, ../sass/_mixins.scss */ .btn-menu.btn-menu .invoke-menu { color: #757575; } /* line 285, ../sass/controls/_controls.scss */ @@ -2277,7 +2283,7 @@ label.checkbox.custom { auto: 0; bottom: auto; left: auto; } - /* line 152, ../sass/_mixins.scss */ + /* line 162, ../sass/_mixins.scss */ .slider .knob:not(.disabled):hover { background-image: url('data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4gPHN2ZyB2ZXJzaW9uPSIxLjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGRlZnM+PGxpbmVhckdyYWRpZW50IGlkPSJncmFkIiBncmFkaWVudFVuaXRzPSJvYmplY3RCb3VuZGluZ0JveCIgeDE9IjAuNSIgeTE9IjAuMCIgeDI9IjAuNSIgeTI9IjEuMCI+PHN0b3Agb2Zmc2V0PSIwJSIgc3RvcC1jb2xvcj0iIzYzNjM2MyIvPjxzdG9wIG9mZnNldD0iMTAwJSIgc3RvcC1jb2xvcj0iIzU3NTc1NyIvPjwvbGluZWFyR3JhZGllbnQ+PC9kZWZzPjxyZWN0IHg9IjAiIHk9IjAiIHdpZHRoPSIxMDAlIiBoZWlnaHQ9IjEwMCUiIGZpbGw9InVybCgjZ3JhZCkiIC8+PC9zdmc+IA=='); background-size: 100%; @@ -2286,13 +2292,13 @@ label.checkbox.custom { background-image: -webkit-linear-gradient(#636363, #575757); background-image: linear-gradient(#636363, #575757); color: #bdbdbd; } - /* line 155, ../sass/_mixins.scss */ + /* line 165, ../sass/_mixins.scss */ .slider .knob:not(.disabled):hover.btn-menu .invoke-menu { color: #878787; } - /* line 160, ../sass/_mixins.scss */ + /* line 170, ../sass/_mixins.scss */ .slider .knob.btn-menu .invoke-menu { color: #757575; } - /* line 176, ../sass/_mixins.scss */ + /* line 186, ../sass/_mixins.scss */ .slider .knob:before { -moz-transition-property: "border-color"; -o-transition-property: "border-color"; @@ -2316,7 +2322,7 @@ label.checkbox.custom { left: 2px; bottom: 5px; top: 5px; } - /* line 198, ../sass/_mixins.scss */ + /* line 208, ../sass/_mixins.scss */ .slider .knob:not(.disabled):hover:before { -moz-transition-property: "border-color"; -o-transition-property: "border-color"; @@ -2488,14 +2494,14 @@ label.checkbox.custom { padding: 3px 0; position: absolute; z-index: 10; } - /* line 160, ../sass/_mixins.scss */ + /* line 170, ../sass/_mixins.scss */ .menu-element .menu.btn-menu .invoke-menu { color: #828282; } /* line 37, ../sass/controls/_menus.scss */ .menu-element .menu ul { margin: 0; padding: 0; } - /* line 266, ../sass/_mixins.scss */ + /* line 276, ../sass/_mixins.scss */ .menu-element .menu ul li { list-style-type: none; margin: 0; @@ -2551,7 +2557,7 @@ label.checkbox.custom { border-top: 1px solid #919191; color: #999; display: inline-block; } - /* line 160, ../sass/_mixins.scss */ + /* line 170, ../sass/_mixins.scss */ .menu-element .context-menu.btn-menu .invoke-menu, .menu-element .super-menu.btn-menu .invoke-menu { color: #b0b0b0; } @@ -3414,7 +3420,7 @@ input[type="text"] { margin: 0 0 2px 2px; overflow: hidden; position: relative; } - /* line 152, ../sass/_mixins.scss */ + /* line 162, ../sass/_mixins.scss */ .form-control.select:not(.disabled):hover { background-image: url('data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4gPHN2ZyB2ZXJzaW9uPSIxLjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGRlZnM+PGxpbmVhckdyYWRpZW50IGlkPSJncmFkIiBncmFkaWVudFVuaXRzPSJvYmplY3RCb3VuZGluZ0JveCIgeDE9IjAuNSIgeTE9IjAuMCIgeDI9IjAuNSIgeTI9IjEuMCI+PHN0b3Agb2Zmc2V0PSIwJSIgc3RvcC1jb2xvcj0iIzYzNjM2MyIvPjxzdG9wIG9mZnNldD0iMTAwJSIgc3RvcC1jb2xvcj0iIzU3NTc1NyIvPjwvbGluZWFyR3JhZGllbnQ+PC9kZWZzPjxyZWN0IHg9IjAiIHk9IjAiIHdpZHRoPSIxMDAlIiBoZWlnaHQ9IjEwMCUiIGZpbGw9InVybCgjZ3JhZCkiIC8+PC9zdmc+IA=='); background-size: 100%; @@ -3423,10 +3429,10 @@ input[type="text"] { background-image: -webkit-linear-gradient(#636363, #575757); background-image: linear-gradient(#636363, #575757); color: #bdbdbd; } - /* line 155, ../sass/_mixins.scss */ + /* line 165, ../sass/_mixins.scss */ .form-control.select:not(.disabled):hover.btn-menu .invoke-menu { color: #878787; } - /* line 160, ../sass/_mixins.scss */ + /* line 170, ../sass/_mixins.scss */ .form-control.select.btn-menu .invoke-menu { color: #757575; } /* line 29, ../sass/forms/_selects.scss */ @@ -4044,7 +4050,7 @@ input[type="text"] { bottom: 15%; left: 15%; z-index: 101; } - /* line 160, ../sass/_mixins.scss */ + /* line 170, ../sass/_mixins.scss */ .overlay > .holder.btn-menu .invoke-menu { color: #757575; } /* line 45, ../sass/overlay/_overlay.scss */ @@ -4552,7 +4558,7 @@ input[type="text"] { right: 0; width: auto; height: 5px; } - /* line 176, ../sass/_mixins.scss */ + /* line 186, ../sass/_mixins.scss */ .split-layout.horizontal > .splitter:before { -moz-transition-property: "border-color"; -o-transition-property: "border-color"; @@ -4576,7 +4582,7 @@ input[type="text"] { top: 2px; left: 5px; right: 5px; } - /* line 198, ../sass/_mixins.scss */ + /* line 208, ../sass/_mixins.scss */ .split-layout.horizontal > .splitter:not(.disabled):hover:before { -moz-transition-property: "border-color"; -o-transition-property: "border-color"; @@ -4606,7 +4612,7 @@ input[type="text"] { bottom: 0; cursor: col-resize; width: 5px; } - /* line 176, ../sass/_mixins.scss */ + /* line 186, ../sass/_mixins.scss */ .split-layout.vertical > .splitter:before { -moz-transition-property: "border-color"; -o-transition-property: "border-color"; @@ -4630,7 +4636,7 @@ input[type="text"] { left: 2px; bottom: 5px; top: 5px; } - /* line 198, ../sass/_mixins.scss */ + /* line 208, ../sass/_mixins.scss */ .split-layout.vertical > .splitter:not(.disabled):hover:before { -moz-transition-property: "border-color"; -o-transition-property: "border-color"; diff --git a/platform/commonUI/general/res/css/tree.css b/platform/commonUI/general/res/css/tree.css index ec69f0ebc3..b5b16680c8 100644 --- a/platform/commonUI/general/res/css/tree.css +++ b/platform/commonUI/general/res/css/tree.css @@ -99,20 +99,20 @@ * this source code distribution or the Licensing information page available * at runtime from the About dialog for additional information. *****************************************************************************/ -/* line 22, ../sass/tree/_tree.scss */ +/* line 23, ../sass/tree/_tree.scss */ ul.tree { margin: 0; padding: 0; } - /* line 266, ../sass/_mixins.scss */ + /* line 276, ../sass/_mixins.scss */ ul.tree li { list-style-type: none; margin: 0; padding: 0; } - /* line 24, ../sass/tree/_tree.scss */ + /* line 25, ../sass/tree/_tree.scss */ ul.tree li { display: block; position: relative; } - /* line 27, ../sass/tree/_tree.scss */ + /* line 28, ../sass/tree/_tree.scss */ ul.tree li span.tree-item { -moz-border-radius: 2px; -webkit-border-radius: 2px; @@ -127,16 +127,16 @@ ul.tree { line-height: 1.5rem; margin-bottom: 3px; position: relative; } - /* line 38, ../sass/tree/_tree.scss */ + /* line 39, ../sass/tree/_tree.scss */ ul.tree li span.tree-item .view-control { display: inline-block; margin-left: 5px; font-size: 0.75em; width: 10px; } - /* line 44, ../sass/tree/_tree.scss */ + /* line 45, ../sass/tree/_tree.scss */ ul.tree li span.tree-item .view-control:hover { color: #ffc700; } - /* line 49, ../sass/tree/_tree.scss */ + /* line 50, ../sass/tree/_tree.scss */ ul.tree li span.tree-item .label { display: block; overflow: hidden; @@ -147,8 +147,8 @@ ul.tree { left: 0px; width: auto; height: auto; - left: 20px; } - /* line 55, ../sass/tree/_tree.scss */ + left: 15px; } + /* line 57, ../sass/tree/_tree.scss */ ul.tree li span.tree-item .label .type-icon { overflow: false; position: absolute; @@ -160,32 +160,32 @@ ul.tree { height: auto; text-shadow: rgba(0, 0, 0, 0.6) 0 1px 2px; color: #0099cc; + left: 5px; right: auto; width: 1em; } - /* line 60, ../sass/tree/_tree.scss */ - ul.tree li span.tree-item .label .type-icon .alert { - text-shadow: rgba(0, 0, 0, 0.3) 0 1px 2px; - background: #333; - color: #ff3c00; - font-size: 0.7em; - margin-top: -3px; - top: 0; - right: auto; - bottom: auto; - left: 9px; - height: auto; - width: auto; - position: absolute; - z-index: 2; } - /* line 75, ../sass/tree/_tree.scss */ - ul.tree li span.tree-item .label .type-icon .icon.l-link-icon { + /* line 65, ../sass/tree/_tree.scss */ + ul.tree li span.tree-item .label .type-icon .icon.l-icon-link, ul.tree li span.tree-item .label .type-icon .icon.l-icon-alert { text-shadow: black 0 1px 2px; - color: #49dedb; position: absolute; - font-size: 0.5em; - right: -5px; - bottom: -8px; z-index: 2; } + /* line 71, ../sass/tree/_tree.scss */ + ul.tree li span.tree-item .label .type-icon .icon.l-icon-alert { + color: #ff3c00; + font-size: 8px; + line-height: 8px; + height: 8px; + width: 8px; + top: 1px; + right: -2px; } + /* line 77, ../sass/tree/_tree.scss */ + ul.tree li span.tree-item .label .type-icon .icon.l-icon-link { + color: #49dedb; + font-size: 8px; + line-height: 8px; + height: 8px; + width: 8px; + left: -3px; + bottom: 5px; } /* line 86, ../sass/tree/_tree.scss */ ul.tree li span.tree-item .label .title-label { overflow: hidden; @@ -197,7 +197,7 @@ ul.tree { width: auto; height: auto; display: block; - left: 25px; + left: 30px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } diff --git a/platform/commonUI/general/res/fonts/symbols/iconmoon.io-WTD-Symbols-v2.0.json b/platform/commonUI/general/res/fonts/symbols/iconmoon.io-WTD-Symbols-v2.0.json index 45b1da9c33..e2215bed12 100644 --- a/platform/commonUI/general/res/fonts/symbols/iconmoon.io-WTD-Symbols-v2.0.json +++ b/platform/commonUI/general/res/fonts/symbols/iconmoon.io-WTD-Symbols-v2.0.json @@ -1,8 +1,8 @@ { "metadata": { "name": "WTD Symbols v2.", - "lastOpened": 1435266597671, - "created": 1435266594435 + "lastOpened": 1435765696898, + "created": 1435764071891 }, "iconSets": [ { @@ -352,7 +352,7 @@ "tempChar": "" }, { - "order": 45, + "order": 75, "id": 30, "prevSize": 32, "code": 244, @@ -415,13 +415,21 @@ "name": "icon-object", "tempChar": "" }, + { + "order": 73, + "id": 77, + "prevSize": 32, + "code": 63, + "name": "icon-object-unknown", + "tempChar": "" + }, { "order": 53, "id": 22, "prevSize": 32, "code": 86, "name": "icon-packet", - "tempChar": "" + "tempChar": "" }, { "order": 54, @@ -429,7 +437,7 @@ "prevSize": 32, "code": 234, "name": "icon-page", - "tempChar": "" + "tempChar": "" }, { "order": 55, @@ -437,7 +445,7 @@ "prevSize": 32, "code": 241, "name": "icon-pause", - "tempChar": "" + "tempChar": "" }, { "order": 56, @@ -445,7 +453,7 @@ "prevSize": 32, "code": 112, "name": "icon-pencil", - "tempChar": "" + "tempChar": "" }, { "order": 65, @@ -453,7 +461,7 @@ "prevSize": 32, "code": 79, "name": "icon-people", - "tempChar": "" + "tempChar": "" }, { "order": 57, @@ -461,7 +469,7 @@ "prevSize": 32, "code": 239, "name": "icon-play", - "tempChar": "" + "tempChar": "" }, { "order": 58, @@ -469,7 +477,7 @@ "prevSize": 32, "code": 233, "name": "icon-plot-resource", - "tempChar": "" + "tempChar": "" }, { "order": 59, @@ -477,7 +485,7 @@ "prevSize": 32, "code": 43, "name": "icon-plus", - "tempChar": "" + "tempChar": "" }, { "order": 60, @@ -485,7 +493,7 @@ "prevSize": 32, "code": 45, "name": "icon-minus", - "tempChar": "" + "tempChar": "" }, { "order": 61, @@ -493,7 +501,7 @@ "prevSize": 32, "code": 54, "name": "icon-sine", - "tempChar": "" + "tempChar": "" }, { "order": 62, @@ -501,7 +509,7 @@ "prevSize": 32, "code": 228, "name": "icon-T", - "tempChar": "" + "tempChar": "" }, { "order": 63, @@ -509,7 +517,7 @@ "prevSize": 32, "code": 116, "name": "icon-telemetry-panel", - "tempChar": "" + "tempChar": "" }, { "order": 64, @@ -517,7 +525,7 @@ "prevSize": 32, "code": 84, "name": "icon-telemetry", - "tempChar": "" + "tempChar": "" }, { "order": 18, @@ -525,7 +533,7 @@ "prevSize": 32, "code": 246, "name": "icon-thumbs-strip", - "tempChar": "" + "tempChar": "" }, { "order": 67, @@ -533,7 +541,7 @@ "prevSize": 32, "code": 83, "name": "icon-timeline", - "tempChar": "" + "tempChar": "" }, { "order": 68, @@ -541,7 +549,7 @@ "prevSize": 32, "code": 245, "name": "icon-timer", - "tempChar": "" + "tempChar": "" }, { "order": 69, @@ -549,7 +557,7 @@ "prevSize": 32, "code": 90, "name": "icon-trash", - "tempChar": "" + "tempChar": "" }, { "order": 70, @@ -557,7 +565,7 @@ "prevSize": 32, "code": 229, "name": "icon-two-parts-both", - "tempChar": "" + "tempChar": "" }, { "order": 71, @@ -565,7 +573,7 @@ "prevSize": 32, "code": 231, "name": "icon-two-parts-one-only", - "tempChar": "" + "tempChar": "" }, { "order": 72, @@ -573,7 +581,7 @@ "prevSize": 32, "code": 120, "name": "icon-x-heavy", - "tempChar": "" + "tempChar": "" }, { "order": 66, @@ -581,7 +589,7 @@ "prevSize": 32, "code": 58946, "name": "icon-x", - "tempChar": "" + "tempChar": "" } ], "id": 2, @@ -1289,7 +1297,7 @@ { "id": 30, "paths": [ - "M832 0h-640c-105.6 0-192 86.4-192 192v640c0 105.6 86.4 192 192 192h640c105.6 0 192-86.4 192-192v-640c0-105.6-86.4-192-192-192zM832 640l-128-128-512 320 320-512-128-128h448v448z" + "M1024 512l-512-512v307.2l-512 204.8v256h512v256z" ], "attrs": [ {} @@ -1410,6 +1418,20 @@ "icon-object" ] }, + { + "id": 77, + "paths": [ + "M510-2l-512 320v384l512 320 512-320v-384l-512-320zM585.4 859.2c-21.2 20.8-46 30.8-76 30.8-31.2 0-56.2-9.8-76.2-29.6-20-20-29.6-44.8-29.6-76.2 0-30.4 10.2-55.2 31-76.2s45.2-31.2 74.8-31.2c29.6 0 54.2 10.4 75.6 32s31.8 46.4 31.8 76c-0.2 29-10.8 54-31.4 74.4zM638.2 546.6c-23.6 11.8-37.4 22-43.4 32.4-3.6 6.2-6 14.8-7.4 26.8v41h-161.4v-44.2c0-40.2 4.4-69.8 13-88 8-17.2 22.6-30.2 44.8-40l34.8-15.4c32-14.2 48.2-35.2 48.2-62.8 0-16-6-30.4-17.2-41.8-11.2-11.2-25.6-17.2-41.6-17.2-24 0-54.4 10-62.8 57.4l-2.2 12.2h-147l1.4-16.2c4-44.6 17-82.4 38.8-112.2 19.6-27 45.6-48.6 77-64.6s64.6-24 98.2-24c60.6 0 110.2 19.4 151.4 59.6 41.2 40 61.2 88 61.2 147.2 0 70.8-28.8 121.4-85.8 149.8z" + ], + "attrs": [ + {} + ], + "isMulticolor": false, + "grid": 0, + "tags": [ + "icon-object-unknown" + ] + }, { "id": 22, "paths": [ diff --git a/platform/commonUI/general/res/fonts/symbols/wtdsymbols.eot b/platform/commonUI/general/res/fonts/symbols/wtdsymbols.eot index a341f741c908067f4310726966890594b5ee507f..278460b5a892863f3aa8a67a1b5d1bce9938b561 100755 GIT binary patch delta 747 zcmYLGT}TvB6h3!mc7Aq#w{~Z@MR<84FD)-E|*gT_UIuqdy`Lsx^NW(p*r=p4JBg zF(|i*^1-ACBBDZA(5xON3p2|?kmx}|LVAb|dNC|wZg-LB-g7v7=R4=)+;az;KOJOG zQ~}&K3T%SOKN?LI(uMrm#}xonL40p#rZ)!w8US^gM831@Vn?CnY?|OKKxkXGJ=4Y( zikAVxBZN<6NrJN&h2S}YquK7heuJae2`&-6`mUZcnTE>LPeO$VKh~Y;&p``ZAow}K zp>vt;c3*Jm`$>{mCJhgAJ-vNE6AFwWGmCDaMw6wk#y{Zqcmcn~^Y{&(!>{ox{1U&w z7Ji1G;%WQ@PvJ>?3?Icu{0IE|{3*YaXdrWuN}DSbS9H-sOrFLzo}q1e23QEfVE_TS zh@s62iiC}-S`@EOG^9}7F5MeI9yiMof+OaMY!HnoMM}zrkua;G2&vt${~gG-fg;z2 zCe`qI4OLZCO^xZ^n5N}5O^ds9hGx(mj%9UM#OD)u!6R)lILbt{TT`pNzMWfYn}WeW zbu~R>TlRo$p)?vm=|6Whm7JKbtfUepL)T*}O7a@-kcI6v!5Ue1bDA^ckvzO0=ut@v zCv{IqlBCLDVE>MIlU}^ZUGo|U09y>u7Fj}h0S?zz7enSP&y6fH`N9GQT+9c5Q5DJ2 zNBL9g?llmZ@_)eM^wgz)(YzjRK+Wd6aEiq?p<`w`QfD?sKIbj!H=Ur*)02#k*~4@& zH<*$m?Z`Q9J4$Q^JIwyz4soO0J#LkE@~!*?|4ncTHA1WK*y(qUILDnOF)Fr-{o)nz zp*SzDNKF;e;@dpTWQ&ACZxon8Ma87R|t*cmODGmH`xCKfuBZ`GY@W$6L7bO~f#LrF76#@6 zKrf0<{vah{s?N!%t|-Xt@VCLgu+X0gOg8*uV036;JivUQ&>tcGx1r(R0Valqe+~?r z{S|&P$;4Nu7{>G4d}ZKf0XdlA;`WTUFnV%|vN@yAS8z>&q##j%Ft5vLyKEG_{q zIj$V8C0viVesJ?~>u`HZyWDC-fMgud?tJ) neAoC{_&xaJ_}2g(#K^$F!{EbE$^eWeAYcN9i}2=t)su_>>@B3z diff --git a/platform/commonUI/general/res/fonts/symbols/wtdsymbols.svg b/platform/commonUI/general/res/fonts/symbols/wtdsymbols.svg index 0eef723d78..9c9d712d2d 100755 --- a/platform/commonUI/general/res/fonts/symbols/wtdsymbols.svg +++ b/platform/commonUI/general/res/fonts/symbols/wtdsymbols.svg @@ -18,6 +18,7 @@ + @@ -72,7 +73,7 @@ - + diff --git a/platform/commonUI/general/res/fonts/symbols/wtdsymbols.ttf b/platform/commonUI/general/res/fonts/symbols/wtdsymbols.ttf index e56f67ce32b7029747b46962a71a4e634f6bc831..b113a531a4551bf778e4357d799af1542a883677 100755 GIT binary patch delta 730 zcmYLGTS!z<6g}tOJNNyXa_&rn&eORTnp8SEA2ALQR188d{1K`#9|LI)C}m&cM}ZjR z*oE-Jq6i|QLKyH-ecUX}43j|ml8BIkn4%xUBJODq5}mU*o3+>8i+%Q4P2X=Vg!3Ek zKO%%H!4LLi266}?9UqyT(V780DzsDKv% zS7-YMhfI#%1Y82W#@_z3ndYkGPoP4;PxfVoa;P0$1pEwe=zONH%NJbzb_x<}(C{GF zKQM@BppZE-K6?|lSZ#PLzCzxTW%7nBk=JCAydp2j3-X-U_U@=p2ZMpyT6*5GongnuDLjl*f9~oU zoS3hyq=AxY7%>eec%64C!mhetouX85x)}1v9$pZPYFUpY3{Oaw<*H!d@a}lpD1KqD zdrgcGu^B|$u!QmgT<)-&fqBbwV;d%4UM7eXR|3DN%EZK@{Aq3f29lWacc6E3Ggtma zYdzeITdm4Sk|hq%F{==1u*M=E@;3FGZlW*H(~OTfz;rV=n35~y%DHa4N^Cbf%KqSv zaueJ=Zk-qT4t|RNDu_az&>=h){bE79C6=UWsY4o)u1OE2C23vu$>SJgOv=%gU6p npsXsNlueaY18SQ(qE4!7T2kxPrnCjU0>SGj)LQ%={fz$t))B&7 delta 511 zcmZ4Cd&PT#V*T@LR~Q%=Wq{ZvJ+Ziefq_AQfq^LjNOPp;RHk)(I3Wz=XD~3xM`WZX zrm*#jMKdrc9stUlWdH@(53uk8`9FYsm5khy3MDq?UknUNAoC1z@{<$wwABL`7?gd0 z^0RUiD+(B*7|MbC7eKy3USe*lg#4AaaX`HsKn<%3@{3Ctn1NCZs#_-Rn9FE4IgGL2 z^xXfm|IhqC_5bAm6aSC@KlcCd|3m)|{NMk7*Z-aWcl_V}f7}19|AYSr{STD#kaCl< zmEr^%!8low$zieq6Z_^wrVf_PFWD!E^D;3o{6E0Lzk-!vZa!`uZZGZ> z?it)$xS#NF@$BGb;WglO;|<|W;;rCqBd@fUyJwOu%pv-h5x>BqIP6x1U@9 diff --git a/platform/commonUI/general/res/fonts/symbols/wtdsymbols.woff b/platform/commonUI/general/res/fonts/symbols/wtdsymbols.woff index 88de29cc857dc01ff94549f48566b35ca18298c0..5989698d985a8edf4a4779ef52ba8d97e4303da9 100755 GIT binary patch delta 778 zcmYLHOGs2v82-<_ckW~Eb86g%7uiq2#XdP6>?AKYSB6W$Itoy@BFWGh7Yea>ODv5 z>j42-krfcv^+TWv7bra+4d+%rF1Dw-vH;Wwaq)klwP!B15!(|0{|*cJrgO=3YpMkx zus}G~7TA38YMK}Uf=+S{S>OytNq2Pj5?dSqRauB|^v_J^S;7lt2xrJbO-bTMN2)g) z1qfS7{p)Cgp7W`WR$?Pb(IX4K`LCz5on76e`uY6YeN}As<9B!t&*B;U7Qex- z@hkiizrY55j-TO4{1i{%aeNY=z{kCZya&7quN`PWq~+Q|A0-w?seUF$V-ru&COri# z_~00TfE+~7W(5TUk+KRDtE#R^pvt|vyA-*cEJqw15m#`-QHK(QViAJ@Rz*R=-H`t` zkZA%%wh0Yt#O;o#s-kLYSa*jtEvIQ(%%L+hgYIxFt2=@okH8BqX;Xxw3W#=UYMI-! zXG=wc&sSPrPEVPJ*=HIkiTY4-?VhHR74}$>R1zto>tPked5yQp!p^8KD$7nzv-@3= zix&hvBx!-T?($2LRN^Z=xGUD67c04&?g;r7*kFJ*$Plan*c{s(45`?r>o-5G>3FzU2(+H(gC% zq{kT#v!7{WZZXTYq%CV3wk@-5>;U_nJIW1m54a`X&NuU8{1?G4M1^MIvE6IGVZUu( z7DHmQ*ehNWN5mO%N%BZlQj0Vo$K}iNm^>}d%b(<*3agYVr<8tWNLf%5YDOJXr!^;# N?kH$1?hAcJe*l63$5j9T delta 565 zcmez3yTC`R+~3WOfsp|S)D#%FLA2@>2Byh{OkxvtRO_E#yON$*T)@DmS~v-OHaX8;9(VlF_w3J9|wVByWkEvW#C zWiT)>8i2488}qN6{A8dyWwe{Th_T=F-2b!x&-_32|K$G@|BwGa_W$tzL;nx_-~WHt z|DFGL{NMh6+yAZqgZ~Hp50vtda+9)^;$&cEU<7*EW^w})_vW=s9W0woIVOmQF)=Xw zKfuDke1JiKK^$nEq7s{^poo~UqLG=YpoyBYpgJd`x}qSn!`}w~!a{#0Fxl{rfzhFX z@c{FILVtw#--d>N2bdTd{y8vgel7o#NhZEJ#W0@V<|_j?3(#{63>UX&yoJ$|l+77^ zCR-@mF)^r4-k@wedA;(z`YNVvOy8Kzm}f8_Vt&RV#*)KwfaL?L0&5QIGd3=^0=5h6 z66|X1DePVBk2nlCvN*ap)^I%H)Z?7RCBP-emBY1!>k-!vZa!`uZZGZ>?it)$xS#NF z@$BGb;WglO;|<|W;;rCq Date: Wed, 1 Jul 2015 09:50:53 -0700 Subject: [PATCH 05/30] [Frontend] Markup updates to label and grid-item WTD-1423 Depends on CSS and font updates in 2a032bf --- .../commonUI/browse/res/templates/items/grid-item.html | 9 +++++---- platform/commonUI/general/res/templates/label.html | 9 +++++---- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/platform/commonUI/browse/res/templates/items/grid-item.html b/platform/commonUI/browse/res/templates/items/grid-item.html index 6372b8c393..6d041b48b9 100644 --- a/platform/commonUI/browse/res/templates/items/grid-item.html +++ b/platform/commonUI/browse/res/templates/items/grid-item.html @@ -27,17 +27,18 @@
- +
P
- - ô
{{type.getGlyph()}} - ô +
}
diff --git a/platform/commonUI/general/res/templates/label.html b/platform/commonUI/general/res/templates/label.html index da63abd07a..61905cb7bf 100644 --- a/platform/commonUI/general/res/templates/label.html +++ b/platform/commonUI/general/res/templates/label.html @@ -23,10 +23,11 @@ {{type.getGlyph()}} - - ô - - + + {{model.name}} From 40e85b718dc64796964b93a9826e1bb77a75bf45 Mon Sep 17 00:00:00 2001 From: larkin Date: Tue, 30 Jun 2015 10:55:23 -0700 Subject: [PATCH 06/30] [Creation] Store location of new objects The creation service stores the location (the full path) to the domain object as "model.location" --- .../browse/src/creation/CreationService.js | 25 ++++++++++++++++++ .../test/creation/CreationServiceSpec.js | 26 ++++++++++++++++++- 2 files changed, 50 insertions(+), 1 deletion(-) diff --git a/platform/commonUI/browse/src/creation/CreationService.js b/platform/commonUI/browse/src/creation/CreationService.js index 015573c8bd..78c0cbebbd 100644 --- a/platform/commonUI/browse/src/creation/CreationService.js +++ b/platform/commonUI/browse/src/creation/CreationService.js @@ -112,12 +112,37 @@ define( return $q.when( uuid() ).then(function (id) { + model = addLocationToModel(id, model, parent); return doPersist(persistence.getSpace(), id, model); }).then(function (id) { return addToComposition(id, parent, persistence); }); } + // Store the location of an object relative to it's parent. + function addLocationToModel(modelId, model, parent) { + var context = parent.getCapability("context"), + pathObjects, + pathIds; + + if (!context) { + $log.warn('No parent context, location will not be set.'); + return model; + } + + pathObjects = context.getPath(); + if (!pathObjects || !pathObjects.length) { + pathObjects = []; + } + pathIds = pathObjects.map(function (object) { + return object.getId(); + }); + pathIds.push(modelId); + + model.location = pathIds.join('/'); + return model; + } + return { /** * Create a new domain object with the provided model, as diff --git a/platform/commonUI/browse/test/creation/CreationServiceSpec.js b/platform/commonUI/browse/test/creation/CreationServiceSpec.js index 277b195eaf..85868974b0 100644 --- a/platform/commonUI/browse/test/creation/CreationServiceSpec.js +++ b/platform/commonUI/browse/test/creation/CreationServiceSpec.js @@ -38,6 +38,7 @@ define( mockMutationCapability, mockPersistenceCapability, mockCompositionCapability, + mockContextCapability, mockCapabilities, creationService; @@ -87,16 +88,30 @@ define( "composition", ["invoke"] ); + mockContextCapability = jasmine.createSpyObj( + "context", + ["getPath"] + ); mockCapabilities = { mutation: mockMutationCapability, persistence: mockPersistenceCapability, - composition: mockCompositionCapability + composition: mockCompositionCapability, + context: mockContextCapability }; mockPersistenceService.createObject.andReturn( mockPromise(true) ); + mockContextCapability.getPath.andReturn([ + { + getId: function () { return 'root'; } + }, + { + getId: function () { return 'parent'; } + } + ]); + mockParentObject.getCapability.andCallFake(function (key) { return mockCapabilities[key]; }); @@ -194,6 +209,15 @@ define( expect(mockLog.error).toHaveBeenCalled(); }); + it("stores location on new domainObjects", function() { + var model = { name: "my model" }; + var objectPromise = creationService.createObject( + model, + mockParentObject + ); + expect(model.location).toBeDefined(); + expect(model.location.indexOf('root/parent')).toBe(0); + }); }); } From 9ea1d241216c7e68a4a9d663ad5b03a6ddff9220 Mon Sep 17 00:00:00 2001 From: larkin Date: Tue, 30 Jun 2015 11:41:15 -0700 Subject: [PATCH 07/30] [Entanglement] Add LocationCapability DomainObjects with a context capability also gain a LocationCapability. This capability allows you to determine the location of the current instance of a domain object, and also provides methods for determining if the current instance of a domain object is a link, or if it is an original. --- platform/entanglement/bundle.json | 6 ++ .../src/capabilities/LocationCapability.js | 66 +++++++++++++++ .../capabilities/LocationCapabilitySpec.js | 81 +++++++++++++++++++ platform/entanglement/test/suite.json | 3 +- 4 files changed, 155 insertions(+), 1 deletion(-) create mode 100644 platform/entanglement/src/capabilities/LocationCapability.js create mode 100644 platform/entanglement/test/capabilities/LocationCapabilitySpec.js diff --git a/platform/entanglement/bundle.json b/platform/entanglement/bundle.json index 7220669988..2bcf82a72b 100644 --- a/platform/entanglement/bundle.json +++ b/platform/entanglement/bundle.json @@ -37,6 +37,12 @@ "controllers": [ ], "capabilities": [ + { + "key": "location", + "name": "Location Capability", + "description": "Provides a capability for retrieving the location of an object based upon it's context.", + "implementation": "capabilities/LocationCapability" + } ], "services": [ { diff --git a/platform/entanglement/src/capabilities/LocationCapability.js b/platform/entanglement/src/capabilities/LocationCapability.js new file mode 100644 index 0000000000..67dc02a626 --- /dev/null +++ b/platform/entanglement/src/capabilities/LocationCapability.js @@ -0,0 +1,66 @@ +/*global define */ + +define( + + function () { + + function LocationCapability(domainObject) { + this.domainObject = domainObject; + } + + /** + * Return the current location of the current domain object. Only + * valid for domain objects that have a context capability. + */ + LocationCapability.prototype.getLocation = function () { + var context = this.domainObject.getCapability("context"), + pathObjects, + pathIds; + + if (!context) { + return this.domainObject.getId(); + } + + pathObjects = context.getPath(); + if (!pathObjects) { + pathObjects = []; + } + + pathIds = pathObjects.map(function (object) { + return object.getId(); + }); + + return pathIds.join('/'); + }; + + /** + * Returns true if the domainObject is a link, false if it's an + * original. + */ + LocationCapability.prototype.isLink = function () { + var model = this.domainObject.getModel(); + + return model.location !== this.getLocation(); + }; + + /** + * Returns true if the domainObject is an original, false if it's a + * link. + */ + LocationCapability.prototype.isOriginal = function () { + var model = this.domainObject.getModel(); + + return model.location === this.getLocation(); + }; + + /** + * Return true if the LocationCapability can apply to a given + * domainObject, otherwise return false. + */ + LocationCapability.appliesTo = function (domainObject) { + return domainObject.hasCapability('context'); + }; + + return LocationCapability; + } +); diff --git a/platform/entanglement/test/capabilities/LocationCapabilitySpec.js b/platform/entanglement/test/capabilities/LocationCapabilitySpec.js new file mode 100644 index 0000000000..61b3e767f2 --- /dev/null +++ b/platform/entanglement/test/capabilities/LocationCapabilitySpec.js @@ -0,0 +1,81 @@ +/*global define,describe,it,expect,beforeEach */ + +define( + [ + '../../src/capabilities/LocationCapability', + '../DomainObjectFactory' + ], + function (LocationCapability, domainObjectFactory) { + + describe("LocationCapability", function () { + + + it("applies to objects with a context capability", function () { + var domainObject = domainObjectFactory({ + capabilities: { + context: true + } + }); + expect(LocationCapability.appliesTo(domainObject)).toBe(true); + }); + + it("does not apply to objects without context capability", function () { + var domainObject = domainObjectFactory(); + expect(LocationCapability.appliesTo(domainObject)).toBe(false); + }); + + describe("instantiated with domain object", function () { + var locationCapability, + domainObject; + + beforeEach(function () { + domainObject = domainObjectFactory({ + capabilities: { + context: { + getPath: function() { + return [ + { + getId: function () { + return 'root'; + } + }, + { + getId: function () { + return 'parent'; + } + }, + { + getId: function () { + return 'me'; + } + } + ]; + } + } + } + }); + + locationCapability = new LocationCapability(domainObject); + }); + + it("returns location", function () { + expect(locationCapability.getLocation()) + .toBe('root/parent/me'); + }); + + it("knows when the object is an original", function () { + domainObject.model.location = 'root/parent/me'; + expect(locationCapability.isOriginal()).toBe(true); + expect(locationCapability.isLink()).toBe(false); + }); + + it("knows when the object is a link.", function () { + domainObject.model.location = 'root/another/location/me'; + expect(locationCapability.isLink()).toBe(true); + expect(locationCapability.isOriginal()).toBe(false); + }); + + }); + }); + } +); diff --git a/platform/entanglement/test/suite.json b/platform/entanglement/test/suite.json index 40c300e213..5c7f786174 100644 --- a/platform/entanglement/test/suite.json +++ b/platform/entanglement/test/suite.json @@ -5,5 +5,6 @@ "services/CopyService", "services/LinkService", "services/MoveService", - "services/LocationService" + "services/LocationService", + "capabilities/LocationCapability" ] From 449db4f3a9b028339c90b3a94043baf1705e1ab1 Mon Sep 17 00:00:00 2001 From: Pete Richards Date: Thu, 6 Aug 2015 14:52:42 -0700 Subject: [PATCH 08/30] [Templates] Add stubs for link indicator Update templates to use the location capability to show an indicator. --- platform/commonUI/general/bundle.json | 2 +- .../commonUI/general/res/templates/label.html | 7 +++- .../general/res/templates/tree-node.html | 32 +++++++++---------- 3 files changed, 23 insertions(+), 18 deletions(-) diff --git a/platform/commonUI/general/bundle.json b/platform/commonUI/general/bundle.json index 2b8f63c243..33242ccdcf 100644 --- a/platform/commonUI/general/bundle.json +++ b/platform/commonUI/general/bundle.json @@ -196,7 +196,7 @@ { "key": "label", "templateUrl": "templates/label.html", - "uses": [ "type" ], + "uses": [ "type", "location" ], "gestures": [ "drag", "menu", "info" ] }, { diff --git a/platform/commonUI/general/res/templates/label.html b/platform/commonUI/general/res/templates/label.html index bfa7bd56ff..a11ad42646 100644 --- a/platform/commonUI/general/res/templates/label.html +++ b/platform/commonUI/general/res/templates/label.html @@ -24,5 +24,10 @@ {{type.getGlyph()}} - {{model.name}} + + {{model.name}} + {{model.location}} + {{location.getLocation()}} + (link) + diff --git a/platform/commonUI/general/res/templates/tree-node.html b/platform/commonUI/general/res/templates/tree-node.html index f584befb1a..1228604b2e 100644 --- a/platform/commonUI/general/res/templates/tree-node.html +++ b/platform/commonUI/general/res/templates/tree-node.html @@ -22,29 +22,29 @@ + class="tree-item menus-to-left" + ng-class="{selected: treeNode.isSelected()}" + > + class='ui-symbol view-control' + ng-click="toggle.toggle(); treeNode.trackExpansion()" + ng-if="model.composition !== undefined" + > {{toggle.isActive() ? "v" : ">"}} + key="'label'" + mct-object="domainObject" + ng-model="ngModel" + ng-click="ngModel.selectedObject = domainObject" + > + class="tree-item-subtree" + ng-show="toggle.isActive()" + ng-if="model.composition !== undefined" + > Date: Thu, 6 Aug 2015 14:53:59 -0700 Subject: [PATCH 09/30] [Test] add a synchronous controlled promise for testing Add ControlledPromise, a synchronous promise that can be controlled, allowing for easier testing of promise resolution flow. --- .../entanglement/test/ControlledPromise.js | 78 +++++++++++++++++++ 1 file changed, 78 insertions(+) create mode 100644 platform/entanglement/test/ControlledPromise.js diff --git a/platform/entanglement/test/ControlledPromise.js b/platform/entanglement/test/ControlledPromise.js new file mode 100644 index 0000000000..428bb18d10 --- /dev/null +++ b/platform/entanglement/test/ControlledPromise.js @@ -0,0 +1,78 @@ +/*global define,spyOn */ + +define( + function () { + + /** + * An instrumented promise implementation for better control of promises + * during tests. + * + */ + function ControlledPromise() { + this.resolveHandlers = []; + this.rejectHandlers = []; + spyOn(this, 'then').andCallThrough(); + } + + + /** + * Resolve the promise, passing the supplied value to all resolve + * handlers. + */ + ControlledPromise.prototype.resolve = function(value) { + this.resolveHandlers.forEach(function(handler) { + handler(value); + }); + }; + + /** + * Reject the promise, passing the supplied value to all rejection + * handlers. + */ + ControlledPromise.prototype.reject = function(value) { + this.rejectHandlers.forEach(function(handler) { + handler(value); + }); + }; + + /** + * Standard promise.then, returns a promise that support chaining. + * TODO: Need to support resolve/reject handlers that return promises. + */ + ControlledPromise.prototype.then = function (onResolve, onReject) { + var returnPromise = new ControlledPromise(); + + if (onResolve) { + this.resolveHandlers.push(function(resolveWith) { + var chainResult = onResolve(resolveWith); + if (chainResult && chainResult.then) { + // chainResult is a promise, resolve when it resolves. + chainResult.then(function(pipedResult) { + return returnPromise.resolve(pipedResult); + }); + } else { + returnPromise.resolve(chainResult); + } + }); + } + + if (onReject) { + this.rejectHandlers.push(function(rejectWith) { + var chainResult = onReject(rejectWith); + if (chainResult && chainResult.then) { + chainResult.then(function(pipedResult) { + returnPromise.reject(pipedResult); + }); + } else { + returnPromise.reject(chainResult); + } + }); + } + + return returnPromise; + }; + + return ControlledPromise; + + } +); From 4a755e259f2ca12b8dd3d7c9ba4c479b6d8206fd Mon Sep 17 00:00:00 2001 From: Pete Richards Date: Thu, 6 Aug 2015 14:55:50 -0700 Subject: [PATCH 10/30] [Entanglement] Link service returns object in new context The link service return the object in the new context. --- .../entanglement/src/services/LinkService.js | 11 ++++++++ .../test/services/LinkServiceSpec.js | 8 +++++- .../test/services/MockLinkService.js | 27 ++++++------------- 3 files changed, 26 insertions(+), 20 deletions(-) diff --git a/platform/entanglement/src/services/LinkService.js b/platform/entanglement/src/services/LinkService.js index acecab3b8d..da9a2f92da 100644 --- a/platform/entanglement/src/services/LinkService.js +++ b/platform/entanglement/src/services/LinkService.js @@ -66,6 +66,17 @@ define( } }).then(function () { return parentObject.getCapability('persistence').persist(); + }).then(function getObjectWithNewContext() { + return parentObject + .useCapability('composition') + .then(function (children) { + var i; + for (i = 0; i < children.length; i += 1) { + if (children[i].getId() === object.getId()) { + return children[i]; + } + } + }); }); } }; diff --git a/platform/entanglement/test/services/LinkServiceSpec.js b/platform/entanglement/test/services/LinkServiceSpec.js index 0551256277..80094db519 100644 --- a/platform/entanglement/test/services/LinkServiceSpec.js +++ b/platform/entanglement/test/services/LinkServiceSpec.js @@ -25,7 +25,8 @@ define( [ '../../src/services/LinkService', - '../DomainObjectFactory' + '../DomainObjectFactory', + '../ControlledPromise' ], function (LinkService, domainObjectFactory) { "use strict"; @@ -177,6 +178,11 @@ define( expect(persistenceCapability.persist).toHaveBeenCalled(); }); + + it("returns object representing new link", function () { + linkService.perform(object, parentObject); + + }); }); }); } diff --git a/platform/entanglement/test/services/MockLinkService.js b/platform/entanglement/test/services/MockLinkService.js index 58a82333d3..d4b25b566f 100644 --- a/platform/entanglement/test/services/MockLinkService.js +++ b/platform/entanglement/test/services/MockLinkService.js @@ -23,7 +23,10 @@ /*global define,jasmine */ define( - function () { + [ + '../ControlledPromise' + ], + function (ControlledPromise) { "use strict"; /** @@ -67,26 +70,12 @@ define( callExtensions, spy; - performPromise = jasmine.createSpyObj( - 'performPromise', - ['then'] - ); + performPromise = new ControlledPromise(); - callExtensions = { - promise: performPromise, - resolve: function (resolveWith) { - performPromise.then.calls.forEach(function (call) { - call.args[0](resolveWith); - }); - } - }; + this.perform.mostRecentCall.promise = performPromise; + this.perform.calls[this.perform.calls.length - 1].promise = + performPromise; - spy = this.perform; - - Object.keys(callExtensions).forEach(function (key) { - spy.mostRecentCall[key] = callExtensions[key]; - spy.calls[spy.calls.length - 1][key] = callExtensions[key]; - }); return performPromise; }); From 3783ed69d7ac4f2c3e4d3dfc9f2b69d085239b35 Mon Sep 17 00:00:00 2001 From: Pete Richards Date: Thu, 6 Aug 2015 15:03:08 -0700 Subject: [PATCH 11/30] [Entanglement] Move updates location of originals When moving original objects, the location is updated to match the new location. --- .../src/capabilities/LocationCapability.js | 20 ++++++++++++++++--- .../entanglement/src/services/MoveService.js | 16 +++++++++++++++ .../test/services/MoveServiceSpec.js | 18 +++++++++++++---- 3 files changed, 47 insertions(+), 7 deletions(-) diff --git a/platform/entanglement/src/capabilities/LocationCapability.js b/platform/entanglement/src/capabilities/LocationCapability.js index 67dc02a626..99e8a63f59 100644 --- a/platform/entanglement/src/capabilities/LocationCapability.js +++ b/platform/entanglement/src/capabilities/LocationCapability.js @@ -6,6 +6,7 @@ define( function LocationCapability(domainObject) { this.domainObject = domainObject; + return this; } /** @@ -38,6 +39,9 @@ define( * original. */ LocationCapability.prototype.isLink = function () { + if (this.getId() === "mine") { + return false; + } var model = this.domainObject.getModel(); return model.location !== this.getLocation(); @@ -48,19 +52,29 @@ define( * link. */ LocationCapability.prototype.isOriginal = function () { + if (this.getId() === "mine") { + return true; + } var model = this.domainObject.getModel(); return model.location === this.getLocation(); }; + function createLocationCapability(domainObject) { + return new LocationCapability(domainObject); + } + /** * Return true if the LocationCapability can apply to a given * domainObject, otherwise return false. */ - LocationCapability.appliesTo = function (domainObject) { - return domainObject.hasCapability('context'); + createLocationCapability.appliesTo = function (domainObject) { + // if (!domainObject.hasCapability) { + // return false; + // } + // return domainObject.hasCapability('context'); }; - return LocationCapability; + return createLocationCapability; } ); diff --git a/platform/entanglement/src/services/MoveService.js b/platform/entanglement/src/services/MoveService.js index e91d381453..1099821aa9 100644 --- a/platform/entanglement/src/services/MoveService.js +++ b/platform/entanglement/src/services/MoveService.js @@ -69,6 +69,22 @@ define( perform: function (object, parentObject) { return linkService .perform(object, parentObject) + .then(function setOriginalLocation(objectInNewContext) { + var locationCapability = + object.getCapability('location'); + + if (!locationCapability.isOriginal()) { + return objectInNewContext; + } + + return objectInNewContext.useCapability( + 'mutation', + function (model) { + model.location = + locationCapability.getLocation(); + } + ); + }) .then(function () { return object .getCapability('action') diff --git a/platform/entanglement/test/services/MoveServiceSpec.js b/platform/entanglement/test/services/MoveServiceSpec.js index d1ffb52bc1..2cf82c48ac 100644 --- a/platform/entanglement/test/services/MoveServiceSpec.js +++ b/platform/entanglement/test/services/MoveServiceSpec.js @@ -25,7 +25,8 @@ define( [ '../../src/services/MoveService', '../services/MockLinkService', - '../DomainObjectFactory' + '../DomainObjectFactory', + '../ControlledPromise' ], function (MoveService, MockLinkService, domainObjectFactory) { "use strict"; @@ -141,7 +142,8 @@ define( var object, parentObject, - actionCapability; + actionCapability, + locationCapability; beforeEach(function () { actionCapability = jasmine.createSpyObj( @@ -149,10 +151,16 @@ define( ['perform'] ); + locationCapability = jasmine.createSpyObj( + 'locationCapability', + ['isOriginal'] + ); + object = domainObjectFactory({ name: 'object', capabilities: { - action: actionCapability + action: actionCapability, + location: locationCapability } }); @@ -175,8 +183,9 @@ define( .toHaveBeenCalledWith(jasmine.any(Function)); }); + it("removes object when link is completed", function () { - linkService.perform.mostRecentCall.resolve(); + linkService.perform.mostRecentCall.promise.resolve() expect(object.getCapability) .toHaveBeenCalledWith('action'); expect(actionCapability.perform) @@ -185,5 +194,6 @@ define( }); }); + } ); From 5ab26df4c9b4c662548548ffb40dd3ba6333f441 Mon Sep 17 00:00:00 2001 From: Pete Richards Date: Tue, 4 Aug 2015 11:56:53 -0700 Subject: [PATCH 12/30] [Scripts] Add script to run karma continuously Add a script (to be executed with `npm run-script watch`) that runs karma and watches for changes; rerunning tests whenever a file is changed. Useful for local development. --- package.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index 1216935f21..4370b80a30 100644 --- a/package.json +++ b/package.json @@ -22,7 +22,8 @@ "start": "node app.js", "test": "karma start --single-run", "jshint": "jshint platform example || exit 0", - "jsdoc": "jsdoc -c jsdoc.json -r -d docs" + "jsdoc": "jsdoc -c jsdoc.json -r -d docs", + "watch": "karma start" }, "repository": { "type": "git", From 1d162888dde291f8c31dfc6bab11670ac96e508f Mon Sep 17 00:00:00 2001 From: Pete Richards Date: Thu, 6 Aug 2015 15:05:00 -0700 Subject: [PATCH 13/30] [Tests] Fix location capability tests --- .../src/capabilities/LocationCapability.js | 4 +- .../capabilities/LocationCapabilitySpec.js | 44 +++++++------------ 2 files changed, 18 insertions(+), 30 deletions(-) diff --git a/platform/entanglement/src/capabilities/LocationCapability.js b/platform/entanglement/src/capabilities/LocationCapability.js index 99e8a63f59..be55509791 100644 --- a/platform/entanglement/src/capabilities/LocationCapability.js +++ b/platform/entanglement/src/capabilities/LocationCapability.js @@ -39,7 +39,7 @@ define( * original. */ LocationCapability.prototype.isLink = function () { - if (this.getId() === "mine") { + if (this.domainObject.getId() === "mine") { return false; } var model = this.domainObject.getModel(); @@ -52,7 +52,7 @@ define( * link. */ LocationCapability.prototype.isOriginal = function () { - if (this.getId() === "mine") { + if (this.domainObject.getId() === "mine") { return true; } var model = this.domainObject.getModel(); diff --git a/platform/entanglement/test/capabilities/LocationCapabilitySpec.js b/platform/entanglement/test/capabilities/LocationCapabilitySpec.js index 61b3e767f2..cec26520e5 100644 --- a/platform/entanglement/test/capabilities/LocationCapabilitySpec.js +++ b/platform/entanglement/test/capabilities/LocationCapabilitySpec.js @@ -10,19 +10,19 @@ define( describe("LocationCapability", function () { - it("applies to objects with a context capability", function () { - var domainObject = domainObjectFactory({ - capabilities: { - context: true - } - }); - expect(LocationCapability.appliesTo(domainObject)).toBe(true); - }); - - it("does not apply to objects without context capability", function () { - var domainObject = domainObjectFactory(); - expect(LocationCapability.appliesTo(domainObject)).toBe(false); - }); + // xit("applies to objects with a context capability", function () { + // var domainObject = domainObjectFactory({ + // capabilities: { + // context: true + // } + // }); + // expect(LocationCapability.appliesTo(domainObject)).toBe(true); + // }); + // + // xit("does not apply to objects without context capability", function () { + // var domainObject = domainObjectFactory(); + // expect(LocationCapability.appliesTo(domainObject)).toBe(false); + // }); describe("instantiated with domain object", function () { var locationCapability, @@ -34,21 +34,9 @@ define( context: { getPath: function() { return [ - { - getId: function () { - return 'root'; - } - }, - { - getId: function () { - return 'parent'; - } - }, - { - getId: function () { - return 'me'; - } - } + domainObjectFactory({id: 'root'}), + domainObjectFactory({id: 'parent'}), + domainObjectFactory({id: 'me'}) ]; } } From 197ec0eb2c841bac2ef473c56fb1eab161f957d1 Mon Sep 17 00:00:00 2001 From: Pete Richards Date: Thu, 6 Aug 2015 15:05:42 -0700 Subject: [PATCH 14/30] [Tests] Update Link Service Tests --- .../test/services/LinkServiceSpec.js | 41 ++++++++++++++----- 1 file changed, 30 insertions(+), 11 deletions(-) diff --git a/platform/entanglement/test/services/LinkServiceSpec.js b/platform/entanglement/test/services/LinkServiceSpec.js index 80094db519..1d4f6670c3 100644 --- a/platform/entanglement/test/services/LinkServiceSpec.js +++ b/platform/entanglement/test/services/LinkServiceSpec.js @@ -28,7 +28,7 @@ define( '../DomainObjectFactory', '../ControlledPromise' ], - function (LinkService, domainObjectFactory) { + function (LinkService, domainObjectFactory, ControlledPromise) { "use strict"; describe("LinkService", function () { @@ -51,7 +51,6 @@ define( validate; beforeEach(function () { - object = domainObjectFactory({ name: 'object' }); @@ -119,20 +118,29 @@ define( describe("perform", function () { var object, + linkedObject, parentModel, parentObject, mutationPromise, + compositionPromise, + persistencePromise, + compositionCapability, persistenceCapability; beforeEach(function () { - mutationPromise = jasmine.createSpyObj( - 'promise', - ['then'] - ); + mutationPromise = new ControlledPromise(); + compositionPromise = new ControlledPromise(); + persistencePromise = new ControlledPromise(); persistenceCapability = jasmine.createSpyObj( 'persistenceCapability', ['persist'] ); + persistenceCapability.persist.andReturn(persistencePromise); + compositionCapability = jasmine.createSpyObj( + 'compositionCapability', + ['invoke'] + ); + compositionCapability.invoke.andReturn(compositionPromise); parentModel = { composition: [] }; @@ -146,7 +154,8 @@ define( return mutationPromise; } }, - persistence: persistenceCapability + persistence: persistenceCapability, + composition: compositionCapability } }); @@ -155,7 +164,11 @@ define( id: 'xyz' }); - parentObject.getCapability.andReturn(persistenceCapability); + linkedObject = domainObjectFactory({ + name: 'object-link', + id: 'xyz' + }); + }); @@ -172,16 +185,22 @@ define( it("persists parent", function () { linkService.perform(object, parentObject); expect(mutationPromise.then).toHaveBeenCalled(); - mutationPromise.then.calls[0].args[0](); + mutationPromise.resolve(); expect(parentObject.getCapability) .toHaveBeenCalledWith('persistence'); - expect(persistenceCapability.persist).toHaveBeenCalled(); }); it("returns object representing new link", function () { - linkService.perform(object, parentObject); + var returnPromise, whenComplete; + returnPromise = linkService.perform(object, parentObject); + whenComplete = jasmine.createSpy('whenComplete'); + returnPromise.then(whenComplete); + mutationPromise.resolve(); + persistencePromise.resolve(); + compositionPromise.resolve([linkedObject]); + expect(whenComplete).toHaveBeenCalledWith(linkedObject) }); }); }); From 3fb4296d237084f57f5e7b2663bdb57d0bf76c7e Mon Sep 17 00:00:00 2001 From: Pete Richards Date: Tue, 4 Aug 2015 13:13:00 -0700 Subject: [PATCH 15/30] [Testing] MockLinkService returns linked object MockLinkService.perform returns a promise for the linked domainObject. When resolving the promise and not specifying an object to resolve it with, it will resolve it with the domainObject that was originally passed to it. --- .../test/services/MockLinkService.js | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/platform/entanglement/test/services/MockLinkService.js b/platform/entanglement/test/services/MockLinkService.js index d4b25b566f..cb4f346082 100644 --- a/platform/entanglement/test/services/MockLinkService.js +++ b/platform/entanglement/test/services/MockLinkService.js @@ -50,7 +50,7 @@ define( * var whenLinked = jasmine.createSpy('whenLinked'); * linkService.perform(object, parentObject).then(whenLinked); * expect(whenLinked).not.toHaveBeenCalled(); - * linkService.perform.mostRecentCall.resolve('someArg'); + * linkService.perform.mostRecentCall.promise.resolve('someArg'); * expect(whenLinked).toHaveBeenCalledWith('someArg'); * ``` */ @@ -65,19 +65,19 @@ define( ] ); - mockLinkService.perform.andCallFake(function () { - var performPromise, - callExtensions, - spy; - - performPromise = new ControlledPromise(); + mockLinkService.perform.andCallFake(function (object, newParent) { + var performPromise = new ControlledPromise(); this.perform.mostRecentCall.promise = performPromise; this.perform.calls[this.perform.calls.length - 1].promise = performPromise; - - return performPromise; + return performPromise.then(function (overrideObject) { + if (overrideObject) { + return overrideObject; + } + return object; + }); }); return mockLinkService; From 10ec30ba7621913754d34041764d5cdc72aa9614 Mon Sep 17 00:00:00 2001 From: Pete Richards Date: Tue, 4 Aug 2015 13:18:05 -0700 Subject: [PATCH 16/30] [Entanglement] MoveService updates the location of moved objects The move service updates the location of moved objects when those objects are originals. --- .../entanglement/src/services/MoveService.js | 13 +- .../test/services/MoveServiceSpec.js | 174 ++++++++++++++++-- 2 files changed, 170 insertions(+), 17 deletions(-) diff --git a/platform/entanglement/src/services/MoveService.js b/platform/entanglement/src/services/MoveService.js index 1099821aa9..e94d607c5b 100644 --- a/platform/entanglement/src/services/MoveService.js +++ b/platform/entanglement/src/services/MoveService.js @@ -77,13 +77,20 @@ define( return objectInNewContext; } + // TODO: recursively map new objects to old objects, use old object to determine if object was originally a link, and update new object if it was not. + return objectInNewContext.useCapability( 'mutation', function (model) { - model.location = - locationCapability.getLocation(); + model.location = objectInNewContext + .getCapability('location') + .getLocation(); } - ); + ).then(function() { + return objectInNewContext + .getCapability('persistence') + .persist(); + }); }) .then(function () { return object diff --git a/platform/entanglement/test/services/MoveServiceSpec.js b/platform/entanglement/test/services/MoveServiceSpec.js index 2cf82c48ac..bc3d7f08ad 100644 --- a/platform/entanglement/test/services/MoveServiceSpec.js +++ b/platform/entanglement/test/services/MoveServiceSpec.js @@ -28,7 +28,12 @@ define( '../DomainObjectFactory', '../ControlledPromise' ], - function (MoveService, MockLinkService, domainObjectFactory) { + function ( + MoveService, + MockLinkService, + domainObjectFactory, + ControlledPromise + ) { "use strict"; describe("MoveService", function () { @@ -141,9 +146,13 @@ define( describe("perform", function () { var object, - parentObject, + newParent, actionCapability, - locationCapability; + locationCapability, + persistenceCapability, + persistencePromise, + mutationPromise, + moveResult; beforeEach(function () { actionCapability = jasmine.createSpyObj( @@ -153,28 +162,47 @@ define( locationCapability = jasmine.createSpyObj( 'locationCapability', - ['isOriginal'] + [ + 'isOriginal', + 'getLocation' + ] ); + persistenceCapability = jasmine.createSpyObj( + 'persistenceCapability', + ['persist'] + ); + + persistencePromise = new ControlledPromise(); + persistenceCapability.persist.andReturn(persistencePromise); + + mutationPromise = new ControlledPromise(); + object = domainObjectFactory({ name: 'object', capabilities: { action: actionCapability, + mutation: { + invoke: function (mutator) { + mutator(object.model); + return mutationPromise; + } + }, + persistence: persistenceCapability, location: locationCapability + }, + model: { + location: 'otherThing' } }); - parentObject = domainObjectFactory({ - name: 'parentObject' - }); - - moveService.perform(object, parentObject); + moveResult = moveService.perform(object, newParent); }); - it("links object to parentObject", function () { + it("links object to newParent", function () { expect(linkService.perform).toHaveBeenCalledWith( object, - parentObject + newParent ); }); @@ -183,17 +211,135 @@ define( .toHaveBeenCalledWith(jasmine.any(Function)); }); - it("removes object when link is completed", function () { - linkService.perform.mostRecentCall.promise.resolve() + linkService.perform.mostRecentCall.promise.resolve(); expect(object.getCapability) .toHaveBeenCalledWith('action'); expect(actionCapability.perform) .toHaveBeenCalledWith('remove'); }); + describe("when moving an original", function() { + beforeEach(function () { + locationCapability.isOriginal.andReturn(true); + locationCapability.getLocation.andReturn('newParent'); + linkService.perform.mostRecentCall.promise.resolve(); + }); + + it("updates location", function() { + expect(object.model.location).toBe('newParent'); + }); + it("persists new model when mutation completes", function() { + mutationPromise.resolve(); + expect(persistenceCapability.persist) + .toHaveBeenCalled(); + }); + }); + + describe("when moving a link", function() { + beforeEach(function () { + locationCapability.isOriginal.andReturn(false); + locationCapability.getLocation.andReturn('newParent'); + linkService.perform.mostRecentCall.promise.resolve(); + }); + it("does not modify location", function() { + expect(object.model.location).toBe('otherThing'); + }); + it("does not call persistence", function() { + expect(persistenceCapability.persist) + .not + .toHaveBeenCalled(); + }); + }); + + describe("when moving an object with children", function() { + + var children; + + beforeEach(function () { + + var instantMutator = function (index) { + return { + invoke: function (mutator) { + mutator(children[index].model); + return { + then: function(callback) { + callback(); + } + }; + } + }; + }; + + children = [ + domainObjectFactory({ + id: 'childa', + capabilities: { + location: jasmine.createSpyObj( + 'childalocation', + ['isOriginal', 'getLocation'] + ), + mutation: instantMutator(0) + }, + model: { + location: 'childa-old-location' + } + }), + domainObjectFactory({ + id: 'childb', + capabilities: { + location: jasmine.createSpyObj( + 'childblocation', + ['isOriginal', 'getLocation'] + ), + mutation: instantMutator(1) + }, + model: { + location: 'childb-old-location' + } + }), + domainObjectFactory({ + id: 'childc', + capabilities: { + location: jasmine.createSpyObj( + 'childclocation', + ['isOriginal', 'getLocation'] + ), + mutation: instantMutator(2) + }, + model: { + location: 'childc-old-location' + } + }) + ]; + + children[0].capabilities.location.isOriginal.andReturn(true); + children[0].capabilities.location.getLocation.andReturn('childalocation'); + children[1].capabilities.location.isOriginal.andReturn(true); + children[1].capabilities.location.getLocation.andReturn('childblocation'); + children[2].capabilities.location.isOriginal.andReturn(false); + children[2].capabilities.location.getLocation.andReturn('childclocation'); + + object.capabilities.composition = { + invoke: function () { + return { + then: function (callback) { + callback(children); + } + }; + } + }; + linkService.perform.mostRecentCall.promise.resolve(); + }); + + + it("recursively updates the location of originals", function () { + expect(children[0].model.location).toBe('childalocation'); + expect(children[1].model.location).toBe('childblocation'); + expect(children[2].model.location).toBe('childc-old-location'); + }); + }); }); }); - } ); From f083d019a3a6b53eceab652faea8a03946b9b628 Mon Sep 17 00:00:00 2001 From: Pete Richards Date: Thu, 6 Aug 2015 11:54:14 -0700 Subject: [PATCH 17/30] [Entanglement] Move service recursively updates locations When moving an object that supports composition, child objects which are originals must have their location updated as well. Children which are links should not have their location updated, nor should any of their children be updated. --- platform/entanglement/bundle.json | 2 +- .../entanglement/src/services/MoveService.js | 175 +++++++++++++++--- 2 files changed, 151 insertions(+), 26 deletions(-) diff --git a/platform/entanglement/bundle.json b/platform/entanglement/bundle.json index 2bcf82a72b..c50ac31baf 100644 --- a/platform/entanglement/bundle.json +++ b/platform/entanglement/bundle.json @@ -50,7 +50,7 @@ "name": "Move Service", "description": "Provides a service for moving objects", "implementation": "services/MoveService.js", - "depends": ["policyService", "linkService"] + "depends": ["policyService", "linkService", "$q"] }, { "key": "linkService", diff --git a/platform/entanglement/src/services/MoveService.js b/platform/entanglement/src/services/MoveService.js index e94d607c5b..d35e6a3a4f 100644 --- a/platform/entanglement/src/services/MoveService.js +++ b/platform/entanglement/src/services/MoveService.js @@ -25,13 +25,160 @@ define( function () { "use strict"; - /** * MoveService provides an interface for moving objects from one * location to another. It also provides a method for determining if * an object can be copied to a specific location. */ - function MoveService(policyService, linkService) { + function MoveService(policyService, linkService, $q) { + + + /** + * Returns a promise for a childSelector for a given object which + * returns all original children in that given object. + */ + function getOriginalsInObject(object) { + var originalChildren = {}; + return getOriginalChildren(object) + .then(function recurseChildren(children) { + var promises = []; + children.children.forEach(function(child) { + promises.push(getOriginalsInObject(child)); + originalChildren[child.getId()] = {}; + }); + return $q.all(promises); + }).then(function prepareResponse(childResponses) { + childResponses.forEach(function(childResp) { + Object.keys(childResp).forEach(function(childId) { + originalChildren[childId] = childResp[childId]; + }); + }); + var childSelector = {}; + childSelector[object.getId()] = originalChildren; + return childSelector; + }); + } + + /** + * Get the original children in an object. Returns a promise for an object + * with a single key (the object's key), the value of which is an array + * of original children in that object. + */ + function getOriginalChildren(object) { + if (!object.hasCapability('composition')) { + return $q.when({ + objectId: object.getId(), + children: [] + }); + } + return object.useCapability('composition') + .then(function filterToOriginal(children) { + return children.filter(function(child) { + if (child.hasCapability('location')) { + return child.getCapability('location') + .isOriginal(); + } + return false; + }); + }) + .then(function returnAsObject(children) { + return { + objectId: object.getId(), + children: children + }; + }); + } + + /** + * Persist an instance of an object as the original location of + * that object. + */ + function saveAsOriginal(newOriginal) { + return newOriginal.useCapability( + 'mutation', + function (model) { + model.location = newOriginal + .getCapability('location') + .getLocation(); + } + ).then(function() { + return newOriginal + .getCapability('persistence') + .persist(); + }); + } + + /** + * childrenSelector is an object where keys are childIds and values + * are childSelector objects. Returns all children in the object + * which have a key in the childSelector, plus all children from + * recursive childSelection. + */ + function getMatchingChildrenFromObject(object, childrenSelector) { + var selected = []; + if (!object.hasCapability('composition')) { + return $q.when(selected); + } + return object.useCapability('composition') + .then(function selectChildren(children) { + var promises = []; + children.forEach(function (child) { + if (!childrenSelector[child.getId()]) { + return; + } + selected.push(child); + promises.push(getMatchingChildrenFromObject( + child, + childrenSelector[child.getId()] + )); + }); + + return $q.all(promises) + .then(function reduceResults (results) { + return results.reduce(function(memo, result) { + return memo.concat(result); + }, selected); + }); + }); + } + + + /** + * Uses the original object to determine which objects are originals, + * and then returns a function which, when given the same object in the + * new context, will update the location of all originals in the leaf + * to match the new context. + */ + function updateOriginalLocation(object) { + var oldLocationCapability = object.getCapability('location'); + if (!oldLocationCapability.isOriginal()) { + return function (objectInNewContext) { + return objectInNewContext; + }; + } + return function setOriginalLocation(objectInNewContext) { + return saveAsOriginal(objectInNewContext) + .then(function () { + if (!object.hasCapability('composition')) { + return objectInNewContext; + } + getOriginalsInObject(object) + .then(function(childSelector) { + return getMatchingChildrenFromObject( + objectInNewContext, + childSelector[object.getId()] + ); + }).then(function(originalChildren) { + return $q.all( + originalChildren.map(saveAsOriginal) + ); + }).then(function() { + return objectInNewContext; + }); + }); + }; + } + return { /** * Returns `true` if `object` can be moved into @@ -69,29 +216,7 @@ define( perform: function (object, parentObject) { return linkService .perform(object, parentObject) - .then(function setOriginalLocation(objectInNewContext) { - var locationCapability = - object.getCapability('location'); - - if (!locationCapability.isOriginal()) { - return objectInNewContext; - } - - // TODO: recursively map new objects to old objects, use old object to determine if object was originally a link, and update new object if it was not. - - return objectInNewContext.useCapability( - 'mutation', - function (model) { - model.location = objectInNewContext - .getCapability('location') - .getLocation(); - } - ).then(function() { - return objectInNewContext - .getCapability('persistence') - .persist(); - }); - }) + .then(updateOriginalLocation(object)) .then(function () { return object .getCapability('action') From f72f88adfaab5a1e2b59d79cb939a747a9924de7 Mon Sep 17 00:00:00 2001 From: Pete Richards Date: Thu, 6 Aug 2015 14:41:32 -0700 Subject: [PATCH 18/30] [Location] Use parent id as location Use the parent id as the location for a model. This greatly reduces the recursive work that must be done during move operations to keep the location accurate. Additionally, the locationService now implements a method `persistLocation` which can be used to persist the current object location as it's original location. --- .../browse/src/creation/CreationService.js | 19 +-- .../test/creation/CreationServiceSpec.js | 17 +- .../src/capabilities/LocationCapability.js | 41 +++-- .../entanglement/src/services/MoveService.js | 158 ++--------------- .../capabilities/LocationCapabilitySpec.js | 78 ++++++--- .../test/services/MoveServiceSpec.js | 159 +++--------------- 6 files changed, 112 insertions(+), 360 deletions(-) diff --git a/platform/commonUI/browse/src/creation/CreationService.js b/platform/commonUI/browse/src/creation/CreationService.js index 78c0cbebbd..f89ac0e909 100644 --- a/platform/commonUI/browse/src/creation/CreationService.js +++ b/platform/commonUI/browse/src/creation/CreationService.js @@ -121,25 +121,8 @@ define( // Store the location of an object relative to it's parent. function addLocationToModel(modelId, model, parent) { - var context = parent.getCapability("context"), - pathObjects, - pathIds; + model.location = parent.getId(); - if (!context) { - $log.warn('No parent context, location will not be set.'); - return model; - } - - pathObjects = context.getPath(); - if (!pathObjects || !pathObjects.length) { - pathObjects = []; - } - pathIds = pathObjects.map(function (object) { - return object.getId(); - }); - pathIds.push(modelId); - - model.location = pathIds.join('/'); return model; } diff --git a/platform/commonUI/browse/test/creation/CreationServiceSpec.js b/platform/commonUI/browse/test/creation/CreationServiceSpec.js index 85868974b0..bb26b1ccd9 100644 --- a/platform/commonUI/browse/test/creation/CreationServiceSpec.js +++ b/platform/commonUI/browse/test/creation/CreationServiceSpec.js @@ -103,21 +103,13 @@ define( mockPromise(true) ); - mockContextCapability.getPath.andReturn([ - { - getId: function () { return 'root'; } - }, - { - getId: function () { return 'parent'; } - } - ]); - mockParentObject.getCapability.andCallFake(function (key) { return mockCapabilities[key]; }); mockParentObject.useCapability.andCallFake(function (key, value) { return mockCapabilities[key].invoke(value); }); + mockParentObject.getId.andReturn('parentId'); mockPersistenceCapability.persist.andReturn( mockPromise(true) @@ -209,16 +201,15 @@ define( expect(mockLog.error).toHaveBeenCalled(); }); - it("stores location on new domainObjects", function() { + it("stores location on new domainObjects", function () { var model = { name: "my model" }; var objectPromise = creationService.createObject( model, mockParentObject ); - expect(model.location).toBeDefined(); - expect(model.location.indexOf('root/parent')).toBe(0); + expect(model.location).toBe('parentId'); }); }); } -); \ No newline at end of file +); diff --git a/platform/entanglement/src/capabilities/LocationCapability.js b/platform/entanglement/src/capabilities/LocationCapability.js index be55509791..66593c7130 100644 --- a/platform/entanglement/src/capabilities/LocationCapability.js +++ b/platform/entanglement/src/capabilities/LocationCapability.js @@ -9,6 +9,23 @@ define( return this; } + /** + * Persist the current location of the current domain object as it's + * primary location. Returns a promise. + */ + LocationCapability.prototype.persistLocation = function () { + return this.domainObject.useCapability( + 'mutation', + function (model) { + model.location = this.getLocation(); + }.bind(this) + ).then(function () { + return this.domainObject + .getCapability('persistence') + .persist(); + }.bind(this)); + }; + /** * Return the current location of the current domain object. Only * valid for domain objects that have a context capability. @@ -19,19 +36,10 @@ define( pathIds; if (!context) { - return this.domainObject.getId(); + return ''; } - pathObjects = context.getPath(); - if (!pathObjects) { - pathObjects = []; - } - - pathIds = pathObjects.map(function (object) { - return object.getId(); - }); - - return pathIds.join('/'); + return context.getParent().getId(); }; /** @@ -64,17 +72,6 @@ define( return new LocationCapability(domainObject); } - /** - * Return true if the LocationCapability can apply to a given - * domainObject, otherwise return false. - */ - createLocationCapability.appliesTo = function (domainObject) { - // if (!domainObject.hasCapability) { - // return false; - // } - // return domainObject.hasCapability('context'); - }; - return createLocationCapability; } ); diff --git a/platform/entanglement/src/services/MoveService.js b/platform/entanglement/src/services/MoveService.js index d35e6a3a4f..7ee5876e4a 100644 --- a/platform/entanglement/src/services/MoveService.js +++ b/platform/entanglement/src/services/MoveService.js @@ -32,153 +32,6 @@ define( */ function MoveService(policyService, linkService, $q) { - - /** - * Returns a promise for a childSelector for a given object which - * returns all original children in that given object. - */ - function getOriginalsInObject(object) { - var originalChildren = {}; - return getOriginalChildren(object) - .then(function recurseChildren(children) { - var promises = []; - children.children.forEach(function(child) { - promises.push(getOriginalsInObject(child)); - originalChildren[child.getId()] = {}; - }); - return $q.all(promises); - }).then(function prepareResponse(childResponses) { - childResponses.forEach(function(childResp) { - Object.keys(childResp).forEach(function(childId) { - originalChildren[childId] = childResp[childId]; - }); - }); - var childSelector = {}; - childSelector[object.getId()] = originalChildren; - return childSelector; - }); - } - - /** - * Get the original children in an object. Returns a promise for an object - * with a single key (the object's key), the value of which is an array - * of original children in that object. - */ - function getOriginalChildren(object) { - if (!object.hasCapability('composition')) { - return $q.when({ - objectId: object.getId(), - children: [] - }); - } - return object.useCapability('composition') - .then(function filterToOriginal(children) { - return children.filter(function(child) { - if (child.hasCapability('location')) { - return child.getCapability('location') - .isOriginal(); - } - return false; - }); - }) - .then(function returnAsObject(children) { - return { - objectId: object.getId(), - children: children - }; - }); - } - - /** - * Persist an instance of an object as the original location of - * that object. - */ - function saveAsOriginal(newOriginal) { - return newOriginal.useCapability( - 'mutation', - function (model) { - model.location = newOriginal - .getCapability('location') - .getLocation(); - } - ).then(function() { - return newOriginal - .getCapability('persistence') - .persist(); - }); - } - - /** - * childrenSelector is an object where keys are childIds and values - * are childSelector objects. Returns all children in the object - * which have a key in the childSelector, plus all children from - * recursive childSelection. - */ - function getMatchingChildrenFromObject(object, childrenSelector) { - var selected = []; - if (!object.hasCapability('composition')) { - return $q.when(selected); - } - return object.useCapability('composition') - .then(function selectChildren(children) { - var promises = []; - children.forEach(function (child) { - if (!childrenSelector[child.getId()]) { - return; - } - selected.push(child); - promises.push(getMatchingChildrenFromObject( - child, - childrenSelector[child.getId()] - )); - }); - - return $q.all(promises) - .then(function reduceResults (results) { - return results.reduce(function(memo, result) { - return memo.concat(result); - }, selected); - }); - }); - } - - - /** - * Uses the original object to determine which objects are originals, - * and then returns a function which, when given the same object in the - * new context, will update the location of all originals in the leaf - * to match the new context. - */ - function updateOriginalLocation(object) { - var oldLocationCapability = object.getCapability('location'); - if (!oldLocationCapability.isOriginal()) { - return function (objectInNewContext) { - return objectInNewContext; - }; - } - return function setOriginalLocation(objectInNewContext) { - return saveAsOriginal(objectInNewContext) - .then(function () { - if (!object.hasCapability('composition')) { - return objectInNewContext; - } - getOriginalsInObject(object) - .then(function(childSelector) { - return getMatchingChildrenFromObject( - objectInNewContext, - childSelector[object.getId()] - ); - }).then(function(originalChildren) { - return $q.all( - originalChildren.map(saveAsOriginal) - ); - }).then(function() { - return objectInNewContext; - }); - }); - }; - } - return { /** * Returns `true` if `object` can be moved into @@ -216,7 +69,16 @@ define( perform: function (object, parentObject) { return linkService .perform(object, parentObject) - .then(updateOriginalLocation(object)) + .then(function (objectInNewContext) { + if (!object.hasCapability('location')) { + return; + } + if (object.getCapability('location').isOriginal()) { + return objectInNewContext + .getCapability('location') + .persistLocation(); + } + }) .then(function () { return object .getCapability('action') diff --git a/platform/entanglement/test/capabilities/LocationCapabilitySpec.js b/platform/entanglement/test/capabilities/LocationCapabilitySpec.js index cec26520e5..e707a34590 100644 --- a/platform/entanglement/test/capabilities/LocationCapabilitySpec.js +++ b/platform/entanglement/test/capabilities/LocationCapabilitySpec.js @@ -3,66 +3,90 @@ define( [ '../../src/capabilities/LocationCapability', - '../DomainObjectFactory' + '../DomainObjectFactory', + '../ControlledPromise' ], - function (LocationCapability, domainObjectFactory) { + function (LocationCapability, domainObjectFactory, ControlledPromise) { describe("LocationCapability", function () { - - // xit("applies to objects with a context capability", function () { - // var domainObject = domainObjectFactory({ - // capabilities: { - // context: true - // } - // }); - // expect(LocationCapability.appliesTo(domainObject)).toBe(true); - // }); - // - // xit("does not apply to objects without context capability", function () { - // var domainObject = domainObjectFactory(); - // expect(LocationCapability.appliesTo(domainObject)).toBe(false); - // }); - describe("instantiated with domain object", function () { var locationCapability, + persistencePromise, + mutationPromise, domainObject; beforeEach(function () { domainObject = domainObjectFactory({ capabilities: { context: { - getPath: function() { - return [ - domainObjectFactory({id: 'root'}), - domainObjectFactory({id: 'parent'}), - domainObjectFactory({id: 'me'}) - ]; + getParent: function() { + return domainObjectFactory({id: 'root'}); } - } + }, + persistence: jasmine.createSpyObj( + 'persistenceCapability', + ['persist'] + ), + mutation: jasmine.createSpyObj( + 'mutationCapability', + ['invoke'] + ) } }); + persistencePromise = new ControlledPromise(); + domainObject.capabilities.persistence.persist.andReturn( + persistencePromise + ); + + mutationPromise = new ControlledPromise(); + domainObject.capabilities.mutation.invoke.andCallFake( + function (mutator) { + return mutationPromise.then(function () { + mutator(domainObject.model); + }); + } + ); + locationCapability = new LocationCapability(domainObject); }); it("returns location", function () { expect(locationCapability.getLocation()) - .toBe('root/parent/me'); + .toBe('root'); }); it("knows when the object is an original", function () { - domainObject.model.location = 'root/parent/me'; + domainObject.model.location = 'root'; expect(locationCapability.isOriginal()).toBe(true); expect(locationCapability.isLink()).toBe(false); }); it("knows when the object is a link.", function () { - domainObject.model.location = 'root/another/location/me'; + domainObject.model.location = 'different-root'; expect(locationCapability.isLink()).toBe(true); expect(locationCapability.isOriginal()).toBe(false); }); + it("can persist location", function () { + var persistResult = locationCapability.persistLocation(), + whenComplete = jasmine.createSpy('whenComplete'); + + persistResult.then(whenComplete); + + expect(domainObject.model.location).not.toBeDefined(); + mutationPromise.resolve(); + expect(domainObject.model.location).toBe('root'); + + expect(whenComplete).not.toHaveBeenCalled(); + expect(domainObject.capabilities.persistence.persist) + .toHaveBeenCalled(); + + persistencePromise.resolve(); + expect(whenComplete).toHaveBeenCalled(); + }); + }); }); } diff --git a/platform/entanglement/test/services/MoveServiceSpec.js b/platform/entanglement/test/services/MoveServiceSpec.js index bc3d7f08ad..b48dd4e66e 100644 --- a/platform/entanglement/test/services/MoveServiceSpec.js +++ b/platform/entanglement/test/services/MoveServiceSpec.js @@ -149,9 +149,7 @@ define( newParent, actionCapability, locationCapability, - persistenceCapability, - persistencePromise, - mutationPromise, + locationPromise, moveResult; beforeEach(function () { @@ -164,35 +162,18 @@ define( 'locationCapability', [ 'isOriginal', - 'getLocation' + 'persistLocation' ] ); - persistenceCapability = jasmine.createSpyObj( - 'persistenceCapability', - ['persist'] - ); - - persistencePromise = new ControlledPromise(); - persistenceCapability.persist.andReturn(persistencePromise); - - mutationPromise = new ControlledPromise(); + locationPromise = new ControlledPromise(); + locationCapability.persistLocation.andReturn(locationPromise); object = domainObjectFactory({ name: 'object', capabilities: { action: actionCapability, - mutation: { - invoke: function (mutator) { - mutator(object.model); - return mutationPromise; - } - }, - persistence: persistenceCapability, location: locationCapability - }, - model: { - location: 'otherThing' } }); @@ -211,134 +192,48 @@ define( .toHaveBeenCalledWith(jasmine.any(Function)); }); - it("removes object when link is completed", function () { - linkService.perform.mostRecentCall.promise.resolve(); - expect(object.getCapability) - .toHaveBeenCalledWith('action'); - expect(actionCapability.perform) - .toHaveBeenCalledWith('remove'); - }); - - describe("when moving an original", function() { + describe("when moving an original", function () { beforeEach(function () { locationCapability.isOriginal.andReturn(true); - locationCapability.getLocation.andReturn('newParent'); linkService.perform.mostRecentCall.promise.resolve(); }); - it("updates location", function() { - expect(object.model.location).toBe('newParent'); - }); - it("persists new model when mutation completes", function() { - mutationPromise.resolve(); - expect(persistenceCapability.persist) + it("updates location", function () { + expect(locationCapability.persistLocation) .toHaveBeenCalled(); }); + + describe("after location update", function () { + beforeEach(function () { + locationPromise.resolve(); + }); + + it("removes object from parent", function () { + expect(actionCapability.perform) + .toHaveBeenCalledWith('remove'); + }); + }); + }); - describe("when moving a link", function() { + describe("when moving a link", function () { beforeEach(function () { locationCapability.isOriginal.andReturn(false); - locationCapability.getLocation.andReturn('newParent'); linkService.perform.mostRecentCall.promise.resolve(); }); - it("does not modify location", function() { - expect(object.model.location).toBe('otherThing'); - }); - it("does not call persistence", function() { - expect(persistenceCapability.persist) + + it("does not update location", function () { + expect(locationCapability.persistLocation) .not .toHaveBeenCalled(); }); - }); - describe("when moving an object with children", function() { - - var children; - - beforeEach(function () { - - var instantMutator = function (index) { - return { - invoke: function (mutator) { - mutator(children[index].model); - return { - then: function(callback) { - callback(); - } - }; - } - }; - }; - - children = [ - domainObjectFactory({ - id: 'childa', - capabilities: { - location: jasmine.createSpyObj( - 'childalocation', - ['isOriginal', 'getLocation'] - ), - mutation: instantMutator(0) - }, - model: { - location: 'childa-old-location' - } - }), - domainObjectFactory({ - id: 'childb', - capabilities: { - location: jasmine.createSpyObj( - 'childblocation', - ['isOriginal', 'getLocation'] - ), - mutation: instantMutator(1) - }, - model: { - location: 'childb-old-location' - } - }), - domainObjectFactory({ - id: 'childc', - capabilities: { - location: jasmine.createSpyObj( - 'childclocation', - ['isOriginal', 'getLocation'] - ), - mutation: instantMutator(2) - }, - model: { - location: 'childc-old-location' - } - }) - ]; - - children[0].capabilities.location.isOriginal.andReturn(true); - children[0].capabilities.location.getLocation.andReturn('childalocation'); - children[1].capabilities.location.isOriginal.andReturn(true); - children[1].capabilities.location.getLocation.andReturn('childblocation'); - children[2].capabilities.location.isOriginal.andReturn(false); - children[2].capabilities.location.getLocation.andReturn('childclocation'); - - object.capabilities.composition = { - invoke: function () { - return { - then: function (callback) { - callback(children); - } - }; - } - }; - linkService.perform.mostRecentCall.promise.resolve(); - }); - - - it("recursively updates the location of originals", function () { - expect(children[0].model.location).toBe('childalocation'); - expect(children[1].model.location).toBe('childblocation'); - expect(children[2].model.location).toBe('childc-old-location'); + it("removes object from parent", function () { + expect(actionCapability.perform) + .toHaveBeenCalledWith('remove'); }); }); + }); }); } From ec62c27f360f4a9a3bff57449684c8d00cf428a4 Mon Sep 17 00:00:00 2001 From: Pete Richards Date: Thu, 6 Aug 2015 09:49:50 -0700 Subject: [PATCH 19/30] [Representations] grid-item and label display links grid-item and label representations now use the "location" capability to determine whether or not to show a link indicator. --- platform/commonUI/browse/bundle.json | 8 ++++---- .../commonUI/browse/res/templates/items/grid-item.html | 9 ++++----- platform/commonUI/general/res/templates/label.html | 7 +++---- 3 files changed, 11 insertions(+), 13 deletions(-) diff --git a/platform/commonUI/browse/bundle.json b/platform/commonUI/browse/bundle.json index 7355a6b69c..6e166edb02 100644 --- a/platform/commonUI/browse/bundle.json +++ b/platform/commonUI/browse/bundle.json @@ -69,8 +69,8 @@ { "key": "grid-item", "templateUrl": "templates/items/grid-item.html", - "uses": [ "type", "action" ], - "gestures": [ "info","menu" ] + "uses": [ "type", "action", "location" ], + "gestures": [ "info", "menu" ] }, { "key": "object-header", @@ -88,12 +88,12 @@ { "key": "navigationService", "implementation": "navigation/NavigationService.js" - }, + }, { "key": "creationService", "implementation": "creation/CreationService.js", "depends": [ "persistenceService", "$q", "$log" ] - } + } ], "actions": [ { diff --git a/platform/commonUI/browse/res/templates/items/grid-item.html b/platform/commonUI/browse/res/templates/items/grid-item.html index 6d041b48b9..64282a9ee1 100644 --- a/platform/commonUI/browse/res/templates/items/grid-item.html +++ b/platform/commonUI/browse/res/templates/items/grid-item.html @@ -34,11 +34,10 @@
{{type.getGlyph()}} - + class="ui-symbol icon l-icon-link" title="This object is a link" + ng-show="location.isLink()" + >
}
@@ -51,4 +50,4 @@ - \ No newline at end of file + diff --git a/platform/commonUI/general/res/templates/label.html b/platform/commonUI/general/res/templates/label.html index 61905cb7bf..7ca73bb026 100644 --- a/platform/commonUI/general/res/templates/label.html +++ b/platform/commonUI/general/res/templates/label.html @@ -22,11 +22,10 @@ {{type.getGlyph()}} - + class='ui-symbol icon l-icon-link' + ng-show="location.isLink()" + > From c80e9bfa26e1cdaa5a50d7740b86d27de5368481 Mon Sep 17 00:00:00 2001 From: Pete Richards Date: Thu, 6 Aug 2015 15:16:16 -0700 Subject: [PATCH 20/30] [Style] JSLint Compliance --- .../commonUI/browse/src/creation/CreationService.js | 13 ++++++------- .../browse/test/creation/CreationServiceSpec.js | 11 ++++++----- .../src/capabilities/LocationCapability.js | 2 +- .../test/capabilities/LocationCapabilitySpec.js | 2 +- .../entanglement/test/services/LinkServiceSpec.js | 2 +- 5 files changed, 15 insertions(+), 15 deletions(-) diff --git a/platform/commonUI/browse/src/creation/CreationService.js b/platform/commonUI/browse/src/creation/CreationService.js index f89ac0e909..17cc5ce6b3 100644 --- a/platform/commonUI/browse/src/creation/CreationService.js +++ b/platform/commonUI/browse/src/creation/CreationService.js @@ -93,6 +93,12 @@ define( }); } + // Store the location of an object relative to it's parent. + function addLocationToModel(modelId, model, parent) { + model.location = parent.getId(); + return model; + } + // Create a new domain object with the provided model as a // member of the specified parent's composition function createObject(model, parent) { @@ -119,13 +125,6 @@ define( }); } - // Store the location of an object relative to it's parent. - function addLocationToModel(modelId, model, parent) { - model.location = parent.getId(); - - return model; - } - return { /** * Create a new domain object with the provided model, as diff --git a/platform/commonUI/browse/test/creation/CreationServiceSpec.js b/platform/commonUI/browse/test/creation/CreationServiceSpec.js index bb26b1ccd9..7f15afe061 100644 --- a/platform/commonUI/browse/test/creation/CreationServiceSpec.js +++ b/platform/commonUI/browse/test/creation/CreationServiceSpec.js @@ -202,11 +202,12 @@ define( }); it("stores location on new domainObjects", function () { - var model = { name: "my model" }; - var objectPromise = creationService.createObject( - model, - mockParentObject - ); + var model = { name: "my model" }, + objectPromise = creationService.createObject( + model, + mockParentObject + ); + expect(model.location).toBe('parentId'); }); diff --git a/platform/entanglement/src/capabilities/LocationCapability.js b/platform/entanglement/src/capabilities/LocationCapability.js index 66593c7130..3b26c5d58e 100644 --- a/platform/entanglement/src/capabilities/LocationCapability.js +++ b/platform/entanglement/src/capabilities/LocationCapability.js @@ -1,8 +1,8 @@ /*global define */ define( - function () { + "use strict"; function LocationCapability(domainObject) { this.domainObject = domainObject; diff --git a/platform/entanglement/test/capabilities/LocationCapabilitySpec.js b/platform/entanglement/test/capabilities/LocationCapabilitySpec.js index e707a34590..83f166cbec 100644 --- a/platform/entanglement/test/capabilities/LocationCapabilitySpec.js +++ b/platform/entanglement/test/capabilities/LocationCapabilitySpec.js @@ -1,4 +1,4 @@ -/*global define,describe,it,expect,beforeEach */ +/*global define,describe,it,expect,beforeEach,jasmine */ define( [ diff --git a/platform/entanglement/test/services/LinkServiceSpec.js b/platform/entanglement/test/services/LinkServiceSpec.js index 1d4f6670c3..b9bbe62c58 100644 --- a/platform/entanglement/test/services/LinkServiceSpec.js +++ b/platform/entanglement/test/services/LinkServiceSpec.js @@ -200,7 +200,7 @@ define( mutationPromise.resolve(); persistencePromise.resolve(); compositionPromise.resolve([linkedObject]); - expect(whenComplete).toHaveBeenCalledWith(linkedObject) + expect(whenComplete).toHaveBeenCalledWith(linkedObject); }); }); }); From 62f335573a0792cd7d82ddd8f61c73866f547cbf Mon Sep 17 00:00:00 2001 From: Pete Richards Date: Thu, 6 Aug 2015 15:41:49 -0700 Subject: [PATCH 21/30] [Build] Bump PhantomJS Version Bump PhantomJS version to latest (for ES5 support) and upgrade dependencies as necessary. --- .../test/lib/run_jasmine_test.coffee | 53 ------------------- .../framework/test/lib/run_jasmine_test.js | 46 ++++++++++++++++ pom.xml | 6 +-- 3 files changed, 49 insertions(+), 56 deletions(-) delete mode 100644 platform/framework/test/lib/run_jasmine_test.coffee create mode 100644 platform/framework/test/lib/run_jasmine_test.js diff --git a/platform/framework/test/lib/run_jasmine_test.coffee b/platform/framework/test/lib/run_jasmine_test.coffee deleted file mode 100644 index 9d9148a0fd..0000000000 --- a/platform/framework/test/lib/run_jasmine_test.coffee +++ /dev/null @@ -1,53 +0,0 @@ -#!/usr/local/bin/phantomjs - -# Runs a Jasmine Suite from an html page -# @page is a PhantomJs page object -# @exit_func is the function to call in order to exit the script - -class PhantomJasmineRunner - constructor: (@page, @exit_func = phantom.exit) -> - @tries = 0 - @max_tries = 10 - - get_status: -> @page.evaluate(-> console_reporter.status) - - terminate: -> - switch @get_status() - when "success" then @exit_func 0 - when "fail" then @exit_func 1 - else @exit_func 2 - -# Script Begin -if phantom.args.length == 0 - console.log "Need a url as the argument" - phantom.exit 1 - -page = new WebPage() - -runner = new PhantomJasmineRunner(page) - -# Don't supress console output -page.onConsoleMessage = (msg) -> - console.log msg - - # Terminate when the reporter singals that testing is over. - # We cannot use a callback function for this (because page.evaluate is sandboxed), - # so we have to *observe* the website. - if msg == "ConsoleReporter finished" - if phantom.args.length > 1 - filename = phantom.args[1] - fs = require('fs'); - try - fs.write(filename, page.content) - catch e - console.log "Failed to write test page content." - runner.terminate() - -address = phantom.args[0] - -page.open address, (status) -> - if status != "success" - console.log "Can't load the address!" - phantom.exit 1 - - # Now we wait until onConsoleMessage reads the termination signal from the log. diff --git a/platform/framework/test/lib/run_jasmine_test.js b/platform/framework/test/lib/run_jasmine_test.js new file mode 100644 index 0000000000..c8645f5503 --- /dev/null +++ b/platform/framework/test/lib/run_jasmine_test.js @@ -0,0 +1,46 @@ +var htmlrunner, + resultdir, + page, + fs; + +var system = require('system'); + +if ( system.args.length !== 3 ) { + console.log("Usage: phantom_test_runner.js HTML_RUNNER RESULT_DIR"); + phantom.exit(); +} else { + htmlrunner = system.args[1]; + resultdir = system.args[2]; + page = require("webpage").create(); + fs = require("fs"); + + // Echo the output of the tests to the Standard Output, report status + // when console runner completes. + page.onConsoleMessage = function(msg, source, linenumber) { + console.log(msg); + if (msg === "ConsoleReporter finished") { + var status = page.evaluate(function () { + return console_reporter.status; + }); + if (status === "success") { + phantom.exit(0); + console.log("Test Success"); + } else if (status === "fail") { + phantom.exit(1); + console.log("Test Fail"); + } else { + phantom.exit(2); + console.log("Unexpected test result"); + } + } + }; + + page.open(htmlrunner, function(status) { + if (status === "success") { + console.log("phantomjs> Successfully loaded '" + htmlrunner + "'."); + } else { + console.log("phantomjs> Could not load '" + htmlrunner + "'."); + phantom.exit(1); + } + }); +} diff --git a/pom.xml b/pom.xml index 8ca3cd6edb..9d6508bc97 100644 --- a/pom.xml +++ b/pom.xml @@ -84,7 +84,7 @@ com.github.klieber phantomjs-maven-plugin - 0.2.1 + 0.7 @@ -93,7 +93,7 @@ - 1.9.2 + 2.0.0 @@ -115,7 +115,7 @@ . - platform/framework/test/lib/run_jasmine_test.coffee + platform/framework/test/lib/run_jasmine_test.js test.html ${project.build.directory}/platform-test-results.html From b0a23590d4d783207465bae5b04ebee9d3b0c71c Mon Sep 17 00:00:00 2001 From: Pete Richards Date: Thu, 6 Aug 2015 16:53:42 -0700 Subject: [PATCH 22/30] Revert "[Build] Bump PhantomJS Version" This reverts commit 62f335573a0792cd7d82ddd8f61c73866f547cbf. --- .../test/lib/run_jasmine_test.coffee | 53 +++++++++++++++++++ .../framework/test/lib/run_jasmine_test.js | 46 ---------------- pom.xml | 6 +-- 3 files changed, 56 insertions(+), 49 deletions(-) create mode 100644 platform/framework/test/lib/run_jasmine_test.coffee delete mode 100644 platform/framework/test/lib/run_jasmine_test.js diff --git a/platform/framework/test/lib/run_jasmine_test.coffee b/platform/framework/test/lib/run_jasmine_test.coffee new file mode 100644 index 0000000000..9d9148a0fd --- /dev/null +++ b/platform/framework/test/lib/run_jasmine_test.coffee @@ -0,0 +1,53 @@ +#!/usr/local/bin/phantomjs + +# Runs a Jasmine Suite from an html page +# @page is a PhantomJs page object +# @exit_func is the function to call in order to exit the script + +class PhantomJasmineRunner + constructor: (@page, @exit_func = phantom.exit) -> + @tries = 0 + @max_tries = 10 + + get_status: -> @page.evaluate(-> console_reporter.status) + + terminate: -> + switch @get_status() + when "success" then @exit_func 0 + when "fail" then @exit_func 1 + else @exit_func 2 + +# Script Begin +if phantom.args.length == 0 + console.log "Need a url as the argument" + phantom.exit 1 + +page = new WebPage() + +runner = new PhantomJasmineRunner(page) + +# Don't supress console output +page.onConsoleMessage = (msg) -> + console.log msg + + # Terminate when the reporter singals that testing is over. + # We cannot use a callback function for this (because page.evaluate is sandboxed), + # so we have to *observe* the website. + if msg == "ConsoleReporter finished" + if phantom.args.length > 1 + filename = phantom.args[1] + fs = require('fs'); + try + fs.write(filename, page.content) + catch e + console.log "Failed to write test page content." + runner.terminate() + +address = phantom.args[0] + +page.open address, (status) -> + if status != "success" + console.log "Can't load the address!" + phantom.exit 1 + + # Now we wait until onConsoleMessage reads the termination signal from the log. diff --git a/platform/framework/test/lib/run_jasmine_test.js b/platform/framework/test/lib/run_jasmine_test.js deleted file mode 100644 index c8645f5503..0000000000 --- a/platform/framework/test/lib/run_jasmine_test.js +++ /dev/null @@ -1,46 +0,0 @@ -var htmlrunner, - resultdir, - page, - fs; - -var system = require('system'); - -if ( system.args.length !== 3 ) { - console.log("Usage: phantom_test_runner.js HTML_RUNNER RESULT_DIR"); - phantom.exit(); -} else { - htmlrunner = system.args[1]; - resultdir = system.args[2]; - page = require("webpage").create(); - fs = require("fs"); - - // Echo the output of the tests to the Standard Output, report status - // when console runner completes. - page.onConsoleMessage = function(msg, source, linenumber) { - console.log(msg); - if (msg === "ConsoleReporter finished") { - var status = page.evaluate(function () { - return console_reporter.status; - }); - if (status === "success") { - phantom.exit(0); - console.log("Test Success"); - } else if (status === "fail") { - phantom.exit(1); - console.log("Test Fail"); - } else { - phantom.exit(2); - console.log("Unexpected test result"); - } - } - }; - - page.open(htmlrunner, function(status) { - if (status === "success") { - console.log("phantomjs> Successfully loaded '" + htmlrunner + "'."); - } else { - console.log("phantomjs> Could not load '" + htmlrunner + "'."); - phantom.exit(1); - } - }); -} diff --git a/pom.xml b/pom.xml index 9d6508bc97..8ca3cd6edb 100644 --- a/pom.xml +++ b/pom.xml @@ -84,7 +84,7 @@ com.github.klieber phantomjs-maven-plugin - 0.7 + 0.2.1 @@ -93,7 +93,7 @@ - 2.0.0 + 1.9.2 @@ -115,7 +115,7 @@ . - platform/framework/test/lib/run_jasmine_test.js + platform/framework/test/lib/run_jasmine_test.coffee test.html ${project.build.directory}/platform-test-results.html From 058a0d393def0b127bbb067a7ae5c694e9c43d60 Mon Sep 17 00:00:00 2001 From: Pete Richards Date: Thu, 6 Aug 2015 16:55:15 -0700 Subject: [PATCH 23/30] [Compatibility] Store reference instead of binding --- .../entanglement/src/capabilities/LocationCapability.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/platform/entanglement/src/capabilities/LocationCapability.js b/platform/entanglement/src/capabilities/LocationCapability.js index 3b26c5d58e..c40a3810c1 100644 --- a/platform/entanglement/src/capabilities/LocationCapability.js +++ b/platform/entanglement/src/capabilities/LocationCapability.js @@ -14,16 +14,17 @@ define( * primary location. Returns a promise. */ LocationCapability.prototype.persistLocation = function () { + var capability = this; return this.domainObject.useCapability( 'mutation', function (model) { - model.location = this.getLocation(); - }.bind(this) + model.location = capability.getLocation(); + } ).then(function () { - return this.domainObject + return capability.domainObject .getCapability('persistence') .persist(); - }.bind(this)); + }); }; /** From eb776e69c055b3b0fb567a460685b86640f4615f Mon Sep 17 00:00:00 2001 From: Pete Richards Date: Wed, 19 Aug 2015 11:13:24 -0700 Subject: [PATCH 24/30] [JSDoc] Document LocationCapability constructor --- .../entanglement/src/capabilities/LocationCapability.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/platform/entanglement/src/capabilities/LocationCapability.js b/platform/entanglement/src/capabilities/LocationCapability.js index c40a3810c1..7336d5f852 100644 --- a/platform/entanglement/src/capabilities/LocationCapability.js +++ b/platform/entanglement/src/capabilities/LocationCapability.js @@ -4,6 +4,14 @@ define( function () { "use strict"; + /** + * The location capability allows a domain object to know its current + * parent, and also know its original parent. When a domain object's + * current parent is its original parent, the object is considered an + * original, otherwise it's a link. + * + * @constructor + */ function LocationCapability(domainObject) { this.domainObject = domainObject; return this; From 9cf30f42134d483f491b6f1dd190c86a573352fd Mon Sep 17 00:00:00 2001 From: Pete Richards Date: Wed, 19 Aug 2015 11:15:09 -0700 Subject: [PATCH 25/30] [Location] setPrimaryLocation takes location. Rename "persistLocation" to be more clearly named, and make it take an argument to allow for greater control outside the capability. --- .../src/capabilities/LocationCapability.js | 12 ++++++++---- .../entanglement/src/services/MoveService.js | 18 +++++++++++++----- .../capabilities/LocationCapabilitySpec.js | 3 ++- .../test/services/MoveServiceSpec.js | 9 +++++---- 4 files changed, 28 insertions(+), 14 deletions(-) diff --git a/platform/entanglement/src/capabilities/LocationCapability.js b/platform/entanglement/src/capabilities/LocationCapability.js index 7336d5f852..c55d15787d 100644 --- a/platform/entanglement/src/capabilities/LocationCapability.js +++ b/platform/entanglement/src/capabilities/LocationCapability.js @@ -18,15 +18,19 @@ define( } /** - * Persist the current location of the current domain object as it's - * primary location. Returns a promise. + * Set the primary location (the parent id) of the current domain + * object. + * + * @param {String} location the primary location to persist. + * @returns {Promise} a promise that is resolved when the operation + * completes. */ - LocationCapability.prototype.persistLocation = function () { + LocationCapability.prototype.setPrimaryLocation = function (location) { var capability = this; return this.domainObject.useCapability( 'mutation', function (model) { - model.location = capability.getLocation(); + model.location = location; } ).then(function () { return capability.domainObject diff --git a/platform/entanglement/src/services/MoveService.js b/platform/entanglement/src/services/MoveService.js index 7ee5876e4a..c5406f93c6 100644 --- a/platform/entanglement/src/services/MoveService.js +++ b/platform/entanglement/src/services/MoveService.js @@ -70,13 +70,21 @@ define( return linkService .perform(object, parentObject) .then(function (objectInNewContext) { - if (!object.hasCapability('location')) { + var newLocationCapability = objectInNewContext + .getCapability('location'), + oldLocationCapability = object + .getCapability('location'); + if (!newLocationCapability || + oldLocationCapability) { + return; } - if (object.getCapability('location').isOriginal()) { - return objectInNewContext - .getCapability('location') - .persistLocation(); + + + if (oldLocationCapability.isOriginal()) { + return newLocationCapability.setPrimaryLocation( + newLocationCapability.getLocation() + ); } }) .then(function () { diff --git a/platform/entanglement/test/capabilities/LocationCapabilitySpec.js b/platform/entanglement/test/capabilities/LocationCapabilitySpec.js index 83f166cbec..8c96500a8a 100644 --- a/platform/entanglement/test/capabilities/LocationCapabilitySpec.js +++ b/platform/entanglement/test/capabilities/LocationCapabilitySpec.js @@ -70,7 +70,8 @@ define( }); it("can persist location", function () { - var persistResult = locationCapability.persistLocation(), + var persistResult = locationCapability + .setPrimaryLocation('root'), whenComplete = jasmine.createSpy('whenComplete'); persistResult.then(whenComplete); diff --git a/platform/entanglement/test/services/MoveServiceSpec.js b/platform/entanglement/test/services/MoveServiceSpec.js index b48dd4e66e..fed7878ac7 100644 --- a/platform/entanglement/test/services/MoveServiceSpec.js +++ b/platform/entanglement/test/services/MoveServiceSpec.js @@ -162,12 +162,13 @@ define( 'locationCapability', [ 'isOriginal', - 'persistLocation' + 'setPrimaryLocation' ] ); locationPromise = new ControlledPromise(); - locationCapability.persistLocation.andReturn(locationPromise); + locationCapability.setPrimaryLocation + .andReturn(locationPromise); object = domainObjectFactory({ name: 'object', @@ -199,7 +200,7 @@ define( }); it("updates location", function () { - expect(locationCapability.persistLocation) + expect(locationCapability.setPrimaryLocation) .toHaveBeenCalled(); }); @@ -223,7 +224,7 @@ define( }); it("does not update location", function () { - expect(locationCapability.persistLocation) + expect(locationCapability.setPrimaryLocation) .not .toHaveBeenCalled(); }); From 94854e5965f425a5aa8059d478f4074b38e5bb6c Mon Sep 17 00:00:00 2001 From: Pete Richards Date: Wed, 19 Aug 2015 11:28:58 -0700 Subject: [PATCH 26/30] [Location] can retrieve contextual location Clarify naming of method for retrieving contextual location of a domain object. Default behavior for objects that do not have a context is to return undefined. Note that default behavior is not specified and could change if needed. --- .../src/capabilities/LocationCapability.js | 17 +++++++++-------- .../entanglement/src/services/MoveService.js | 3 ++- .../test/capabilities/LocationCapabilitySpec.js | 4 ++-- 3 files changed, 13 insertions(+), 11 deletions(-) diff --git a/platform/entanglement/src/capabilities/LocationCapability.js b/platform/entanglement/src/capabilities/LocationCapability.js index c55d15787d..1bc2f8b931 100644 --- a/platform/entanglement/src/capabilities/LocationCapability.js +++ b/platform/entanglement/src/capabilities/LocationCapability.js @@ -40,16 +40,17 @@ define( }; /** - * Return the current location of the current domain object. Only + * Returns the contextual location of the current domain object. Only * valid for domain objects that have a context capability. + * + * @returns {String} the contextual location of the object; the id of + * its parent. */ - LocationCapability.prototype.getLocation = function () { - var context = this.domainObject.getCapability("context"), - pathObjects, - pathIds; + LocationCapability.prototype.getContextualLocation = function () { + var context = this.domainObject.getCapability("context"); if (!context) { - return ''; + return; } return context.getParent().getId(); @@ -65,7 +66,7 @@ define( } var model = this.domainObject.getModel(); - return model.location !== this.getLocation(); + return model.location !== this.getContextualLocation(); }; /** @@ -78,7 +79,7 @@ define( } var model = this.domainObject.getModel(); - return model.location === this.getLocation(); + return model.location === this.getContextualLocation(); }; function createLocationCapability(domainObject) { diff --git a/platform/entanglement/src/services/MoveService.js b/platform/entanglement/src/services/MoveService.js index c5406f93c6..9dc8b80169 100644 --- a/platform/entanglement/src/services/MoveService.js +++ b/platform/entanglement/src/services/MoveService.js @@ -83,7 +83,8 @@ define( if (oldLocationCapability.isOriginal()) { return newLocationCapability.setPrimaryLocation( - newLocationCapability.getLocation() + newLocationCapability + .getContextualLocation() ); } }) diff --git a/platform/entanglement/test/capabilities/LocationCapabilitySpec.js b/platform/entanglement/test/capabilities/LocationCapabilitySpec.js index 8c96500a8a..9cbfcc1bea 100644 --- a/platform/entanglement/test/capabilities/LocationCapabilitySpec.js +++ b/platform/entanglement/test/capabilities/LocationCapabilitySpec.js @@ -52,8 +52,8 @@ define( locationCapability = new LocationCapability(domainObject); }); - it("returns location", function () { - expect(locationCapability.getLocation()) + it("returns contextual location", function () { + expect(locationCapability.getContextualLocation()) .toBe('root'); }); From 5c74365f4bb0958007e6c726d852c6ac747f144f Mon Sep 17 00:00:00 2001 From: Pete Richards Date: Wed, 19 Aug 2015 11:49:03 -0700 Subject: [PATCH 27/30] [Root] Root model provider sets location Root model provider sets the location of roods so that the location capability does not need special handling for this. --- platform/core/src/models/RootModelProvider.js | 10 +++++++--- platform/core/test/models/RootModelProviderSpec.js | 8 +++++++- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/platform/core/src/models/RootModelProvider.js b/platform/core/src/models/RootModelProvider.js index 804537ccf2..d3f64c5e36 100644 --- a/platform/core/src/models/RootModelProvider.js +++ b/platform/core/src/models/RootModelProvider.js @@ -42,8 +42,12 @@ define( * @constructor */ function RootModelProvider(roots, $q, $log) { - // Pull out identifiers to used as ROOT's - var ids = roots.map(function (root) { return root.id; }), + // Pull out identifiers to used as ROOT's, while setting locations. + var ids = roots.map(function (root) { + if (!root.model) root.model = {}; + root.model.location = 'ROOT'; + return root.id; + }), baseProvider = new StaticModelProvider(roots, $q, $log); function addRoot(models) { @@ -77,4 +81,4 @@ define( return RootModelProvider; } -); \ No newline at end of file +); diff --git a/platform/core/test/models/RootModelProviderSpec.js b/platform/core/test/models/RootModelProviderSpec.js index 897b38656e..3de505a6cd 100644 --- a/platform/core/test/models/RootModelProviderSpec.js +++ b/platform/core/test/models/RootModelProviderSpec.js @@ -79,6 +79,12 @@ define( expect(captured.b.someProperty).toEqual("Some Value B"); }); + it("provides models with a location", function () { + provider.getModels(["a", "b"]).then(capture); + expect(captured.a.location).toBe('ROOT'); + expect(captured.b.location).toBe('ROOT'); + }); + it("does not provide models which are not in extension declarations", function () { provider.getModels(["c"]).then(capture); @@ -96,4 +102,4 @@ define( }); } -); \ No newline at end of file +); From 26892e7104063a8428e0dfa98fe8cfa551eec295 Mon Sep 17 00:00:00 2001 From: Pete Richards Date: Wed, 19 Aug 2015 11:49:45 -0700 Subject: [PATCH 28/30] [Location] isLink/isOriginal are antonyms Simplify implementation of isLink/isOriginal for better maintainability. --- .../src/capabilities/LocationCapability.js | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/platform/entanglement/src/capabilities/LocationCapability.js b/platform/entanglement/src/capabilities/LocationCapability.js index 1bc2f8b931..17d678f57e 100644 --- a/platform/entanglement/src/capabilities/LocationCapability.js +++ b/platform/entanglement/src/capabilities/LocationCapability.js @@ -59,11 +59,10 @@ define( /** * Returns true if the domainObject is a link, false if it's an * original. + * + * @returns {Boolean} */ LocationCapability.prototype.isLink = function () { - if (this.domainObject.getId() === "mine") { - return false; - } var model = this.domainObject.getModel(); return model.location !== this.getContextualLocation(); @@ -72,14 +71,11 @@ define( /** * Returns true if the domainObject is an original, false if it's a * link. + * + * @returns {Boolean} */ LocationCapability.prototype.isOriginal = function () { - if (this.domainObject.getId() === "mine") { - return true; - } - var model = this.domainObject.getModel(); - - return model.location === this.getContextualLocation(); + return !this.isLink(); }; function createLocationCapability(domainObject) { From a94763041efc0a464b142ab9b38b8bfc8c510fa8 Mon Sep 17 00:00:00 2001 From: Pete Richards Date: Wed, 19 Aug 2015 13:16:36 -0700 Subject: [PATCH 29/30] [Move] correct logic and specification --- platform/entanglement/src/services/MoveService.js | 2 +- platform/entanglement/test/services/MoveServiceSpec.js | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/platform/entanglement/src/services/MoveService.js b/platform/entanglement/src/services/MoveService.js index 9dc8b80169..e6e1238979 100644 --- a/platform/entanglement/src/services/MoveService.js +++ b/platform/entanglement/src/services/MoveService.js @@ -75,7 +75,7 @@ define( oldLocationCapability = object .getCapability('location'); if (!newLocationCapability || - oldLocationCapability) { + !oldLocationCapability) { return; } diff --git a/platform/entanglement/test/services/MoveServiceSpec.js b/platform/entanglement/test/services/MoveServiceSpec.js index fed7878ac7..02494a0afb 100644 --- a/platform/entanglement/test/services/MoveServiceSpec.js +++ b/platform/entanglement/test/services/MoveServiceSpec.js @@ -162,7 +162,8 @@ define( 'locationCapability', [ 'isOriginal', - 'setPrimaryLocation' + 'setPrimaryLocation', + 'getContextualLocation' ] ); @@ -195,13 +196,15 @@ define( describe("when moving an original", function () { beforeEach(function () { + locationCapability.getContextualLocation + .andReturn('new-location'); locationCapability.isOriginal.andReturn(true); linkService.perform.mostRecentCall.promise.resolve(); }); it("updates location", function () { expect(locationCapability.setPrimaryLocation) - .toHaveBeenCalled(); + .toHaveBeenCalledWith('new-location'); }); describe("after location update", function () { From c118234bbf1bb009f4ae4fbb476a994b9ed0b4f3 Mon Sep 17 00:00:00 2001 From: Pete Richards Date: Wed, 19 Aug 2015 13:55:02 -0700 Subject: [PATCH 30/30] [Style] Brace after if criteria --- platform/core/src/models/RootModelProvider.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platform/core/src/models/RootModelProvider.js b/platform/core/src/models/RootModelProvider.js index d3f64c5e36..f60d359af8 100644 --- a/platform/core/src/models/RootModelProvider.js +++ b/platform/core/src/models/RootModelProvider.js @@ -44,7 +44,7 @@ define( function RootModelProvider(roots, $q, $log) { // Pull out identifiers to used as ROOT's, while setting locations. var ids = roots.map(function (root) { - if (!root.model) root.model = {}; + if (!root.model) { root.model = {}; } root.model.location = 'ROOT'; return root.id; }),