Skip to content

Commit

Permalink
Merge pull request #2201 from cdcabrera/issue-envfrom-link
Browse files Browse the repository at this point in the history
Automatic merge from submit-queue.

EnvFrom Config Map and Secret Link

EnvFrom Issue Updates for...

EnvFrom issue fixes for CSS, copy, and UX. Updates parts of #2182
- Config Map and Secret Link

Initial work is aimed at re-opening the discussion around behavior... this PR initially... 
- has the link display until the envFrom form aspect is edited, then it hides. 
- when the link is displayed it navigates directly to the secret or config map view

![oct-02-2017 14-32-04](https://user-images.githubusercontent.com/3761375/31093083-8a0a87ac-a77e-11e7-887d-f1cedd3d773d.gif)

@beanh66
  • Loading branch information
openshift-merge-robot authored Oct 19, 2017
2 parents c239f36 + 2e1dbef commit 768d51d
Show file tree
Hide file tree
Showing 6 changed files with 112 additions and 11 deletions.
10 changes: 9 additions & 1 deletion app/scripts/directives/editEnvironmentFrom.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,15 @@

ctrl.setFocusClass = 'edit-environment-from-set-focus-' + uniqueId;

ctrl.viewOverlayPanel = function(entry) {
ctrl.overlayPaneEntryDetails = entry;
ctrl.overlayPanelVisible = true;
};

ctrl.closeOverlayPanel = function() {
ctrl.overlayPanelVisible = false;
};

var addEntry = function(entries, entry) {
entries && entries.push(entry || {});
};
Expand Down Expand Up @@ -61,7 +70,6 @@
return humanizeKind(object.kind);
};

//ctrl.uniqueForValue = utils.uniqueForValue;
ctrl.dragControlListeners = {
accept: function (sourceItemHandleScope, destSortableScope) {
return sourceItemHandleScope.itemScope.sortableScope.$id === destSortableScope.$id;
Expand Down
12 changes: 11 additions & 1 deletion app/styles/_kve.less
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@
.key-value-editor-entry,
.environment-from-entry {
display: table;
margin-bottom: 15px;
padding-right: (@as-sortable-item-button-width * 2);
position: relative;
table-layout: fixed;
Expand All @@ -127,11 +128,12 @@
float: left;
padding-right: 5px;
position: relative;
width: 50%;
width: auto;
}
}
.environment-from-input {
float: left;
margin-bottom: 0;
padding-right: 5px;
width: 100%;
@media(min-width: @screen-md-min) {
Expand All @@ -144,6 +146,13 @@
}
}
}
.environment-from-entry {
.environment-from-view-details {
float: left;
line-height: 1;
padding: 6px 0 0;
}
}

.key-value-editor-input .ui-select {
@media(min-width: @screen-md-min) {
Expand All @@ -163,6 +172,7 @@
.key-value-editor .key-value-editor-input,
.key-value-editor-header {
float: left;
margin-bottom: 0;
padding-right: 5px;
width: 50%;
}
Expand Down
46 changes: 46 additions & 0 deletions app/views/directives/edit-environment-from.html
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,12 @@
aria-label="Delete row"
ng-click="$ctrl.deleteEntry($index, 1)"></a>
</div>
<div class="environment-from-view-details">
<a
ng-if="entry.selectedEnvFrom"
href=""
ng-click="$ctrl.viewOverlayPanel(entry.selectedEnvFrom)">View Details</a>
</div>
</div>

<div class="environment-from-entry form-group" ng-if="!$ctrl.cannotAdd">
Expand All @@ -78,4 +84,44 @@
ng-click="$ctrl.onAddRow()">{{ $ctrl.addRowLink }}</a>
</div>
</div>

<overlay-panel class="add-config-to-application" show-panel="$ctrl.overlayPanelVisible" show-close="true" handle-close="$ctrl.closeOverlayPanel">
<div class="dialog-title">
<h3>Value Details</h3>
</div>
<div class="modal-body">
<h4>{{$ctrl.overlayPaneEntryDetails.metadata.name}}
<small class="muted">&ndash; {{$ctrl.overlayPaneEntryDetails.kind | humanizeKind : true}}</small></h4>

<div ng-if="!($ctrl.overlayPaneEntryDetails.data | size)" class="empty-state-message text-center">
The {{$ctrl.overlayPaneEntryDetails.kind | humanizeKind}} has no properties.
</div>

<div ng-if="$ctrl.overlayPaneEntryDetails.data | size" class="table-responsive scroll-shadows-horizontal">
<table class="table table-bordered table-bordered-columns config-map-table key-value-table">
<tbody>
<tr ng-repeat="(prop, value) in $ctrl.overlayPaneEntryDetails.data">
<td class="key">{{prop}}</td>
<td class="value">
<truncate-long-text
ng-if="$ctrl.overlayPaneEntryDetails.kind === 'ConfigMap'"
content="value"
limit="50"
newline-limit="2"
expandable="true">
</truncate-long-text>

<span ng-if="$ctrl.overlayPaneEntryDetails.kind === 'Secret'">&#42;&#42;&#42;&#42;&#42;</span>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="modal-footer">
<button ng-click="$ctrl.closeOverlayPanel()"
type="button"
class="btn btn-primary pull-right">Close</button>
</div>
</overlay-panel>
</ng-form>
6 changes: 5 additions & 1 deletion dist/scripts/scripts.js
Original file line number Diff line number Diff line change
Expand Up @@ -9156,7 +9156,11 @@ n[e.key] = e.value;
angular.module("openshiftConsole").component("editEnvironmentFrom", {
controller: [ "$attrs", "$filter", "keyValueEditorUtils", function(e, t, n) {
var a = this, r = t("canI"), o = t("humanizeKind"), i = _.uniqueId();
a.setFocusClass = "edit-environment-from-set-focus-" + i;
a.setFocusClass = "edit-environment-from-set-focus-" + i, a.viewOverlayPanel = function(e) {
a.overlayPaneEntryDetails = e, a.overlayPanelVisible = !0;
}, a.closeOverlayPanel = function() {
a.overlayPanelVisible = !1;
};
var s = function(e, t) {
e && e.push(t || {});
};
Expand Down
32 changes: 32 additions & 0 deletions dist/scripts/templates.js
Original file line number Diff line number Diff line change
Expand Up @@ -6696,11 +6696,43 @@ angular.module('openshiftConsoleTemplates', []).run(['$templateCache', function(
"<span ng-if=\"!$ctrl.cannotSort && $ctrl.entries.length > 1\" class=\"fa fa-bars sort-row\" role=\"button\" aria-label=\"Move row\" aria-grabbed=\"false\" as-sortable-item-handle></span>\n" +
"<a ng-if=\"!$ctrl.cannotDeleteAny\" href=\"\" class=\"pficon pficon-close delete-row as-sortable-item-delete\" role=\"button\" aria-label=\"Delete row\" ng-click=\"$ctrl.deleteEntry($index, 1)\"></a>\n" +
"</div>\n" +
"<div class=\"environment-from-view-details\">\n" +
"<a ng-if=\"entry.selectedEnvFrom\" href=\"\" ng-click=\"$ctrl.viewOverlayPanel(entry.selectedEnvFrom)\">View Details</a>\n" +
"</div>\n" +
"</div>\n" +
"<div class=\"environment-from-entry form-group\" ng-if=\"!$ctrl.cannotAdd\">\n" +
"<a href=\"\" class=\"add-row-link\" role=\"button\" ng-click=\"$ctrl.onAddRow()\">{{ $ctrl.addRowLink }}</a>\n" +
"</div>\n" +
"</div>\n" +
"<overlay-panel class=\"add-config-to-application\" show-panel=\"$ctrl.overlayPanelVisible\" show-close=\"true\" handle-close=\"$ctrl.closeOverlayPanel\">\n" +
"<div class=\"dialog-title\">\n" +
"<h3>Value Details</h3>\n" +
"</div>\n" +
"<div class=\"modal-body\">\n" +
"<h4>{{$ctrl.overlayPaneEntryDetails.metadata.name}}\n" +
"<small class=\"muted\">&ndash; {{$ctrl.overlayPaneEntryDetails.kind | humanizeKind : true}}</small></h4>\n" +
"<div ng-if=\"!($ctrl.overlayPaneEntryDetails.data | size)\" class=\"empty-state-message text-center\">\n" +
"The {{$ctrl.overlayPaneEntryDetails.kind | humanizeKind}} has no properties.\n" +
"</div>\n" +
"<div ng-if=\"$ctrl.overlayPaneEntryDetails.data | size\" class=\"table-responsive scroll-shadows-horizontal\">\n" +
"<table class=\"table table-bordered table-bordered-columns config-map-table key-value-table\">\n" +
"<tbody>\n" +
"<tr ng-repeat=\"(prop, value) in $ctrl.overlayPaneEntryDetails.data\">\n" +
"<td class=\"key\">{{prop}}</td>\n" +
"<td class=\"value\">\n" +
"<truncate-long-text ng-if=\"$ctrl.overlayPaneEntryDetails.kind === 'ConfigMap'\" content=\"value\" limit=\"50\" newline-limit=\"2\" expandable=\"true\">\n" +
"</truncate-long-text>\n" +
"<span ng-if=\"$ctrl.overlayPaneEntryDetails.kind === 'Secret'\">&#42;&#42;&#42;&#42;&#42;</span>\n" +
"</td>\n" +
"</tr>\n" +
"</tbody>\n" +
"</table>\n" +
"</div>\n" +
"</div>\n" +
"<div class=\"modal-footer\">\n" +
"<button ng-click=\"$ctrl.closeOverlayPanel()\" type=\"button\" class=\"btn btn-primary pull-right\">Close</button>\n" +
"</div>\n" +
"</overlay-panel>\n" +
"</ng-form>"
);

Expand Down
17 changes: 9 additions & 8 deletions dist/styles/main.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 768d51d

Please sign in to comment.