
With an updated eslint version and the addition of eslint-config-openstack and eslint-plugin-angular, there are several more stylistic guidelines to follow. However, this is what other OpenStack angular projects follow such as Horizon. Some notable changes are: * Wrapped javascript content in anonymous functions. This is a safeguard to keep the code from conflicting with other variables with the same name in other scripts on the same page. * Explicitly inject dependencies and have controllers, factories, etc as explicitly declared functions. * Use angular "controller as" syntax instead of assigning variables to $scope. * Added eslint rule that requires JSDoc for every function declaration. Note these are mainly stylistic changes and all the functionality of RefStack should remain the same. Change-Id: I044b1f473d589681a2ae9d2704700dd85687cbb6
71 lines
3.6 KiB
HTML
71 lines
3.6 KiB
HTML
<!--
|
|
HTML for each accordion group that separates the status types on the results
|
|
report page.
|
|
-->
|
|
|
|
<accordion-group is-open="isOpen" is-disabled="ctrl.caps[status].caps.length == 0">
|
|
<accordion-heading>
|
|
{{status | capitalize}}
|
|
<small>
|
|
(<strong>Total:</strong> {{ctrl.caps[status].caps.length}} capabilities, {{ctrl.caps[status].count}} tests)
|
|
<span ng-if="ctrl.testStatus !== 'total'">
|
|
(<strong>{{ctrl.testStatus | capitalize}}:</strong> {{ctrl.getStatusTestCount(status)}} tests)
|
|
</span>
|
|
</small>
|
|
<i class="pull-right glyphicon"
|
|
ng-class="{'glyphicon-chevron-down': isOpen, 'glyphicon-chevron-right': !isOpen}">
|
|
</i>
|
|
</accordion-heading>
|
|
<ol class="capabilities">
|
|
<li ng-repeat="capability in ctrl.caps[status].caps | orderBy:'id'"
|
|
ng-if="ctrl.isCapabilityShown(capability)">
|
|
|
|
<a ng-click="ctrl.hideTests = !ctrl.hideTests"
|
|
title="{{ctrl.capabilityData.capabilities[capability.id].description}}">
|
|
{{capability.id}}
|
|
</a>
|
|
<span ng-class="{'text-success': ctrl.testStatus === 'passed',
|
|
'text-danger': ctrl.testStatus === 'not passed',
|
|
'text-warning': ctrl.testStatus === 'flagged'}"
|
|
ng-if="ctrl.testStatus !== 'total'">
|
|
[{{ctrl.getCapabilityTestCount(capability)}}]
|
|
</span>
|
|
<span ng-class="{'text-success': (capability.passedTests.length > 0 &&
|
|
capability.notPassedTests.length == 0),
|
|
'text-danger': (capability.passedTests.length == 0 &&
|
|
capability.notPassedTests.length > 0),
|
|
'text-warning': (capability.passedTests.length > 0 &&
|
|
capability.notPassedTests.length > 0)}"
|
|
ng-if="ctrl.testStatus === 'total'">
|
|
[{{capability.passedTests.length}}/{{capability.passedTests.length +
|
|
capability.notPassedTests.length}}]
|
|
</span>
|
|
|
|
<ul class="list-unstyled" collapse="ctrl.hideTests">
|
|
<li ng-repeat="test in capability.passedTests | orderBy:'toString()'"
|
|
ng-if="ctrl.isTestShown(test, capability)">
|
|
|
|
<span class="glyphicon glyphicon-ok text-success"
|
|
aria-hidden="true">
|
|
</span>
|
|
<span ng-class="{'glyphicon glyphicon-flag text-warning':
|
|
ctrl.isTestFlagged(test, ctrl.capabilityData.capabilities[capability.id])}"
|
|
title="{{ctrl.getFlaggedReason(test, ctrl.capabilityData.capabilities[capability.id])}}">
|
|
</span>
|
|
{{test}}
|
|
</li>
|
|
<li ng-repeat="test in capability.notPassedTests | orderBy:'toString()'"
|
|
ng-if="ctrl.isTestShown(test, capability)">
|
|
|
|
<span class="glyphicon glyphicon-remove text-danger" aria-hidden="true"></span>
|
|
<span ng-class="{'glyphicon glyphicon-flag text-warning':
|
|
ctrl.isTestFlagged(test, ctrl.capabilityData.capabilities[capability.id])}"
|
|
title="{{ctrl.getFlaggedReason(test, ctrl.capabilityData.capabilities[capability.id])}}">
|
|
</span>
|
|
{{test}}
|
|
</li>
|
|
</ul>
|
|
</li>
|
|
</ol>
|
|
</accordion-group>
|