mirror of
https://github.com/ansible/awx.git
synced 2026-01-14 19:30:39 -03:30
Add more functionality to Toggle Tag Component
- Remove existing `switch` logic in favor of Toggle Tag Component, now with comments! - Slight adjustment to icons to center vertically; account for non-standard credential `kind` attributes so icons display as they should. - Style the `View More/Less` button accordingly - Update Toggle Tag directive template to include icons
This commit is contained in:
parent
de6167a52c
commit
63f3a38ceb
@ -42,21 +42,11 @@
|
||||
template-type="smartStatus.type" ng-if="smartStatus">
|
||||
</aw-smart-status>
|
||||
<div class="at-RowItem-tagContainer" ng-if="tagValues && tagValues.length">
|
||||
<!-- <div ng-repeat="tag in tagValues" class="at-RowItem-tag at-RowItem-tag--primary">
|
||||
<span ng-switch="tag.kind" class="at-RowItem-tagIcon"
|
||||
ng-if="tagsAreCreds">
|
||||
<span class="fa fa-cloud" ng-switch-when="cloud"></span>
|
||||
<span class="fa fa-info" ng-switch-when="insights"></span>
|
||||
<span class="fa fa-sitemap" ng-switch-when="net"></span>
|
||||
<span class="fa fa-code-fork" ng-switch-when="scm"></span>
|
||||
<span class="fa fa-key" ng-switch-when="ssh"></span>
|
||||
<span class="fa fa-archive" ng-switch-when="vault"></span>
|
||||
</span>
|
||||
{{ tag.name }}
|
||||
</div> -->
|
||||
<div ng-if="tagValues.length <= 5">
|
||||
<at-tag tag="tagValues"></at-tag>
|
||||
<!-- If there are 5 or less credential tags, show them all with Tag Component -->
|
||||
<div ng-if="tagValues.length <= 5" ng-repeat="tag in tagValues">
|
||||
<at-tag tag="tag.name" icon="{{ tag.kind }}"></at-tag>
|
||||
</div>
|
||||
<!-- If there are 5 or MORE credential tags, handle them accordingly with Toggle Tag Component -->
|
||||
<at-toggle-tag tags="tagValues" ng-if="tagValues.length > 5"></at-toggle-tag>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@ -27,10 +27,15 @@
|
||||
}
|
||||
|
||||
.TagComponent-icon {
|
||||
.at-mixin-VerticallyCenter();
|
||||
line-height: 20px;
|
||||
margin-left: @at-space-2x;
|
||||
|
||||
&--cloud:before {
|
||||
&--cloud:before,
|
||||
&--aws:before,
|
||||
&--tower:before,
|
||||
&--azure_rm:before,
|
||||
{
|
||||
content: '\f0c2';
|
||||
}
|
||||
|
||||
|
||||
@ -1,4 +1,11 @@
|
||||
.ToggleComponent-container {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
|
||||
.ToggleComponent-button {
|
||||
border: none;
|
||||
background: transparent;
|
||||
color: @at-blue;
|
||||
font-size: @at-font-size;
|
||||
}
|
||||
@ -1,14 +1,14 @@
|
||||
<div class="ToggleComponent-wrapper">
|
||||
<div ng-show="vm.truncated" class="ToggleComponent-container">
|
||||
<div ng-repeat="tag in tags | limitTo: vm.truncatedLength">
|
||||
<at-tag tag="tag.name"></at-tag>
|
||||
<at-tag tag="tag.name" icon="{{ tag.kind }}"></at-tag>
|
||||
</div>
|
||||
<button ng-click="vm.toggle()">VIEW MORE</button>
|
||||
<button class="ToggleComponent-button" ng-click="vm.toggle()">VIEW MORE</button>
|
||||
</div>
|
||||
<div ng-show="!vm.truncated" class="ToggleComponent-container">
|
||||
<div ng-repeat="tag in tags">
|
||||
<at-tag tag="tag.name"></at-tag>
|
||||
<at-tag tag="tag.name" icon="{{ tag.kind }}"></at-tag>
|
||||
</div>
|
||||
<button ng-click="vm.toggle()">VIEW LESS</button>
|
||||
<button class="ToggleComponent-button" ng-click="vm.toggle()">VIEW LESS</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user