From 5d1c018d1afe12757b8cc75a4a472c02ca84113f Mon Sep 17 00:00:00 2001 From: benjaminapetersen Date: Wed, 23 Aug 2017 14:16:17 -0400 Subject: [PATCH 1/2] Fix issue #1863, kve sort quirks, and bump ng-sortable - issue #1863 could not pull second-to-last env var below last env var in kve - issue #620 possibly helped (?) - bugzilla #1428991 reordering env vars down only works by twos - example: third moves to fifth, then seventh - bugzilla #1369315 possibly helped (?) I've mentioned 2 additional issues that may be helped by this fix as many quirky behaviors seem to resolve. That said, I will test more before closing them. --- app/styles/_kve.less | 24 +++++++++++-------- app/views/directives/key-value-editor.html | 28 +++++++++++----------- bower.json | 2 +- dist/scripts/scripts.js | 5 +++- dist/scripts/templates.js | 8 +++---- dist/scripts/vendor.js | 3 +-- dist/styles/main.css | 6 +++-- 7 files changed, 42 insertions(+), 34 deletions(-) diff --git a/app/styles/_kve.less b/app/styles/_kve.less index d91a1f8ace..cc923e8f50 100644 --- a/app/styles/_kve.less +++ b/app/styles/_kve.less @@ -118,13 +118,6 @@ width: 100%; } - .key-value-editor-input, - .key-value-editor-header { - float: left; - padding-right: 5px; - width: 50%; - } - .key-value-editor-input .ui-select { @media(min-width: @screen-md-min) { float: left; @@ -138,8 +131,19 @@ } } } +} - .key-value-editor-header { - margin-bottom: 5px; - } +.key-value-editor .key-value-editor-input, +.key-value-editor-header { + float: left; + padding-right: 5px; + width: 50%; +} + +.key-value-editor-entry-header { + padding-right: (@as-sortable-item-button-width * 2); +} + +.key-value-editor-header { + margin-bottom: 5px; } diff --git a/app/views/directives/key-value-editor.html b/app/views/directives/key-value-editor.html index 7a723e96d8..132321acbf 100644 --- a/app/views/directives/key-value-editor.html +++ b/app/views/directives/key-value-editor.html @@ -1,21 +1,21 @@ -
-
-
-
- {{keyPlaceholder}} -
+
+
+
+ {{keyPlaceholder}}
-
-
- {{valuePlaceholder}} -
+
+
+
+ {{valuePlaceholder}}
+
+
-
+
@@ -164,7 +164,7 @@
-
+
{{$select.selected}} diff --git a/bower.json b/bower.json index 0e1682dd49..c1a74612d8 100644 --- a/bower.json +++ b/bower.json @@ -38,7 +38,7 @@ "clipboard": "1.5.8", "ansi_up": "1.3.0", "angular-extension-registry": "1.2.6", - "ng-sortable": "1.3.4", + "ng-sortable": "1.3.8", "ui-select": "angular-ui-select#0.19.4", "matchHeight": "0.7.0", "angular-inview": "2.2.0", diff --git a/dist/scripts/scripts.js b/dist/scripts/scripts.js index c9f8f5acfa..8a5ee1f97b 100644 --- a/dist/scripts/scripts.js +++ b/dist/scripts/scripts.js @@ -13497,10 +13497,13 @@ uniqueForKey: r.uniqueForKey, uniqueForValue: r.uniqueForValue, dragControlListeners: { accept: function(e, t) { -return e.itemScope.sortableScope.$id === t.$id; +return console.log("accept?"), e.itemScope.sortableScope.$id === t.$id; }, orderChanged: function() { t.forms.keyValueEditor.$setDirty(); +}, +itemMoved: function(e) { +console.log("itemMoved"), console.log("event", e), console.log("source", e.source), console.log("dest", e.dest), e.source.itemScope.modelValue.status = e.dest.sortableScope.$parent.column.name, t.forms.keyValueEditor.$setDirty(); } }, deleteEntry: function(e, n) { diff --git a/dist/scripts/templates.js b/dist/scripts/templates.js index d18b82fb6d..013a4d27b8 100644 --- a/dist/scripts/templates.js +++ b/dist/scripts/templates.js @@ -7266,8 +7266,7 @@ angular.module('openshiftConsoleTemplates', []).run(['$templateCache', function( $templateCache.put('views/directives/key-value-editor.html', "\n" + - "
\n" + - "
\n" + + "
\n" + "
\n" + "
\n" + "{{keyPlaceholder}}\n" + @@ -7279,6 +7278,7 @@ angular.module('openshiftConsoleTemplates', []).run(['$templateCache', function( "
\n" + "
\n" + "
\n" + + "
\n" + "
\n" + "\n" + "
\n" + @@ -7341,7 +7341,7 @@ angular.module('openshiftConsoleTemplates', []).run(['$templateCache', function( "
\n" + "
\n" + "
\n" + - "
\n" + + "
\n" + "\n" + "\n" + "\n" + @@ -7354,7 +7354,7 @@ angular.module('openshiftConsoleTemplates', []).run(['$templateCache', function( "\n" + "\n" + "
\n" + - "
\n" + + "
\n" + "\n" + "\n" + "{{$select.selected}}\n" + diff --git a/dist/scripts/vendor.js b/dist/scripts/vendor.js index 0397d10b1c..55dc84bff3 100644 --- a/dist/scripts/vendor.js +++ b/dist/scripts/vendor.js @@ -69267,7 +69267,6 @@ angular.element(r[0].body).unbind("keydown", H); }), B = function(e) { return "function" == typeof a.sortableScope.options.placeholder ? angular.element(a.sortableScope.options.placeholder(e)) : "string" == typeof a.sortableScope.options.placeholder ? angular.element(a.sortableScope.options.placeholder) : angular.element(r[0].createElement(e.element.prop("tagName"))); }, x = function(e) { -e.preventDefault(); var t, i = function() { angular.element(r).unbind("mousemove", o), angular.element(r).unbind("touchmove", o), s.unbind("mouseup", i), s.unbind("touchend", i), s.unbind("touchcancel", i); }, o = function(r) { @@ -69294,7 +69293,7 @@ var s, l, c, f, m; if ((!M || !n.isTouchInvalid(o)) && N && p) { if (o.preventDefault(), s = n.eventObj(o), a.callbacks.dragMove !== angular.noop && a.sortableScope.$apply(function() { a.callbacks.dragMove(v, y, s); -}), l = s.pageX - r[0].documentElement.scrollLeft, c = s.pageY - (i.pageYOffset || r[0].documentElement.scrollTop), m = angular.element(r[0].elementFromPoint(l, c)), p.addClass(t.hiddenClass), p.removeClass(t.hiddenClass), n.movePosition(s, p, v, y, w, _), p.addClass(t.dragging), !(f = h(m)) || !f.type) return; +}), l = s.pageX - r[0].documentElement.scrollLeft, c = s.pageY - (i.pageYOffset || r[0].documentElement.scrollTop), p.addClass(t.hiddenClass), m = angular.element(r[0].elementFromPoint(l, c)), p.removeClass(t.hiddenClass), n.movePosition(s, p, v, y, w, _), p.addClass(t.dragging), !(f = h(m)) || !f.type) return; if ("handle" === f.type && (f = f.itemScope), "item" !== f.type && "sortable" !== f.type) return; if ("item" === f.type && f.accept(a, f.sortableScope, f)) { m = f.element; diff --git a/dist/styles/main.css b/dist/styles/main.css index b17608bc8a..e67d420ea2 100644 --- a/dist/styles/main.css +++ b/dist/styles/main.css @@ -5607,12 +5607,12 @@ a.subtle-link:active,a.subtle-link:focus,a.subtle-link:hover{color:#00659c;borde .mar-auto-sm{margin:0 auto} .pad-sm{padding:5px 7.5px} .mar-sm{margin:5px 7.5px} -.key-value-editor .key-value-editor-header,.mar-bottom-sm{margin-bottom:5px} .pad-top-sm{padding-top:5px} .mar-top-sm{margin-top:5px} .pad-right-sm{padding-right:5px} .mar-right-sm{margin-right:5px} .pad-bottom-sm{padding-bottom:5px} +.mar-bottom-sm{margin-bottom:5px} .pad-left-sm{padding-left:5px} .mar-left-sm{margin-left:5px} .mar-auto-md{margin:0 auto} @@ -5846,11 +5846,13 @@ kubernetes-container-terminal .terminal-actions .spinner{top:5px} .key-value-editor .faux-input-group{border-collapse:separate;display:table;position:relative} .key-value-editor .key-value-editor-buttons{position:absolute;right:0;top:0;width:52px} .key-value-editor .key-value-editor-entry{display:table;padding-right:52px;position:relative;table-layout:fixed;width:100%} -.key-value-editor .key-value-editor-header,.key-value-editor .key-value-editor-input{float:left;padding-right:5px;width:50%} .key-value-editor .key-value-editor-input .ui-select+.ui-select{padding-top:5px} @media (min-width:992px){.key-value-editor .key-value-editor-input .ui-select{float:left;width:50%} .key-value-editor .key-value-editor-input .ui-select+.ui-select{padding-top:0;padding-left:5px} } +.key-value-editor .key-value-editor-input,.key-value-editor-header{float:left;padding-right:5px;width:50%} +.key-value-editor-entry-header{padding-right:52px} +.key-value-editor-header{margin-bottom:5px} .membership h1 .learn-more-inline{white-space:nowrap;margin-right:10px;margin-left:0px;display:inline-block} .membership .content-pane .col-heading .col-add-role h3,.membership .content-pane .form-new-role .col-roles{display:none} .membership .content-pane{width:100%} From 1d03b58cd82dd5a209a102961316256cf62b4c9e Mon Sep 17 00:00:00 2001 From: benjaminapetersen Date: Wed, 23 Aug 2017 14:58:49 -0400 Subject: [PATCH 2/2] fixup! Fix issue #1863, kve sort quirks, and bump ng-sortable --- dist/scripts/scripts.js | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/dist/scripts/scripts.js b/dist/scripts/scripts.js index 8a5ee1f97b..c9f8f5acfa 100644 --- a/dist/scripts/scripts.js +++ b/dist/scripts/scripts.js @@ -13497,13 +13497,10 @@ uniqueForKey: r.uniqueForKey, uniqueForValue: r.uniqueForValue, dragControlListeners: { accept: function(e, t) { -return console.log("accept?"), e.itemScope.sortableScope.$id === t.$id; +return e.itemScope.sortableScope.$id === t.$id; }, orderChanged: function() { t.forms.keyValueEditor.$setDirty(); -}, -itemMoved: function(e) { -console.log("itemMoved"), console.log("event", e), console.log("source", e.source), console.log("dest", e.dest), e.source.itemScope.modelValue.status = e.dest.sortableScope.$parent.column.name, t.forms.keyValueEditor.$setDirty(); } }, deleteEntry: function(e, n) {