Skip to content

Commit a7df440

Browse files
committed
Updating annotations directive to always display Show/Hide Annotations link
and adding message “There are no annotations on this resource.” if there are no annotations. Resolves openshift/origin#7643
1 parent 29241d5 commit a7df440

File tree

2 files changed

+37
-23
lines changed

2 files changed

+37
-23
lines changed

app/views/directives/annotations.html

+26-19
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,28 @@
1-
<div ng-if="annotations" class="gutter-top-bottom">
2-
<a href="" ng-click="toggleAnnotations()" ng-if="annotations && !expandAnnotations">Show annotations</a>
3-
<a href="" ng-click="toggleAnnotations()" ng-if="annotations && expandAnnotations">Hide annotations</a>
4-
<div ng-if="expandAnnotations" class="table-responsive" style="margin-top: 5px;">
5-
<table class="table table-bordered table-bordered-columns key-value-table">
6-
<tbody>
7-
<tr ng-repeat="(annotationKey, annotationValue) in annotations">
8-
<td class="key">{{annotationKey}}</td>
9-
<td class="value">
10-
<truncate-long-text
11-
content="annotationValue | prettifyJSON"
12-
limit="500"
13-
newlineLimit="20"
14-
expandable="true">
15-
</truncate-long-text>
16-
</td>
17-
</tr>
18-
</tbody>
19-
</table>
1+
<div class="gutter-top-bottom">
2+
<p>
3+
<a href="" ng-click="toggleAnnotations()" ng-if="!expandAnnotations">Show annotations</a>
4+
<a href="" ng-click="toggleAnnotations()" ng-if="expandAnnotations">Hide annotations</a>
5+
</p>
6+
<div ng-if="expandAnnotations">
7+
<div ng-if="annotations" class="table-responsive">
8+
<table class="table table-bordered table-bordered-columns key-value-table">
9+
<tbody>
10+
<tr ng-repeat="(annotationKey, annotationValue) in annotations">
11+
<td class="key">{{annotationKey}}</td>
12+
<td class="value">
13+
<truncate-long-text
14+
content="annotationValue | prettifyJSON"
15+
limit="500"
16+
newlineLimit="20"
17+
expandable="true">
18+
</truncate-long-text>
19+
</td>
20+
</tr>
21+
</tbody>
22+
</table>
23+
</div>
24+
<p ng-if="!annotations">
25+
There are no annotations on this resource.
26+
</p>
2027
</div>
2128
</div>

dist/scripts/templates.js

+11-4
Original file line numberDiff line numberDiff line change
@@ -5321,10 +5321,13 @@ angular.module('openshiftConsoleTemplates', []).run(['$templateCache', function(
53215321

53225322

53235323
$templateCache.put('views/directives/annotations.html',
5324-
"<div ng-if=\"annotations\" class=\"gutter-top-bottom\">\n" +
5325-
"<a href=\"\" ng-click=\"toggleAnnotations()\" ng-if=\"annotations && !expandAnnotations\">Show annotations</a>\n" +
5326-
"<a href=\"\" ng-click=\"toggleAnnotations()\" ng-if=\"annotations && expandAnnotations\">Hide annotations</a>\n" +
5327-
"<div ng-if=\"expandAnnotations\" class=\"table-responsive\" style=\"margin-top: 5px\">\n" +
5324+
"<div class=\"gutter-top-bottom\">\n" +
5325+
"<p>\n" +
5326+
"<a href=\"\" ng-click=\"toggleAnnotations()\" ng-if=\"!expandAnnotations\">Show annotations</a>\n" +
5327+
"<a href=\"\" ng-click=\"toggleAnnotations()\" ng-if=\"expandAnnotations\">Hide annotations</a>\n" +
5328+
"</p>\n" +
5329+
"<div ng-if=\"expandAnnotations\">\n" +
5330+
"<div ng-if=\"annotations\" class=\"table-responsive\">\n" +
53285331
"<table class=\"table table-bordered table-bordered-columns key-value-table\">\n" +
53295332
"<tbody>\n" +
53305333
"<tr ng-repeat=\"(annotationKey, annotationValue) in annotations\">\n" +
@@ -5337,6 +5340,10 @@ angular.module('openshiftConsoleTemplates', []).run(['$templateCache', function(
53375340
"</tbody>\n" +
53385341
"</table>\n" +
53395342
"</div>\n" +
5343+
"<p ng-if=\"!annotations\">\n" +
5344+
"There are no annotations on this resource.\n" +
5345+
"</p>\n" +
5346+
"</div>\n" +
53405347
"</div>"
53415348
);
53425349

0 commit comments

Comments
 (0)