Fix UI for real license handling
Following this change, the user gets detailed errors and entitlement information
This commit is contained in:
parent
e450b109a2
commit
213cc856e4
9 changed files with 172 additions and 136 deletions
|
@ -3,19 +3,54 @@
|
|||
config if the license is invalid (since this box will be empty and therefore "required") -->
|
||||
<input type="text" name="licenseRequiredBox" ng-model="requiredBox" style="visibility: hidden; height: 1px; position: absolute;" required>
|
||||
|
||||
<div class="cor-loader-inline" ng-show="state == 'loading-license'"></div>
|
||||
<div class="cor-loader-inline" ng-show="state == LicenseStates.validating"></div>
|
||||
|
||||
<div class="license-valid license-status" ng-show="state == 'license-valid'">
|
||||
<div class="license-valid license-status" ng-show="state == LicenseStates.valid">
|
||||
<h4><i class="fa fa-check-circle"></i>License Valid</h4>
|
||||
<table class="co-table">
|
||||
<tr><td>Product:</td><td>{{ licenseDecoded.publicProductName || licenseDecoded.productName }}</td></tr>
|
||||
<tr><td>Plan:</td><td>{{ licenseDecoded.publicPlanName || licenseDecoded.planName }}</td></tr>
|
||||
<thead>
|
||||
<td>Requirement</td>
|
||||
<td>Required Count</td>
|
||||
<td>Subscription</td>
|
||||
<td>Subscription Count</td>
|
||||
<td>Expiration Date</td>
|
||||
</thead>
|
||||
<tr ng-repeat="status in licenseStatus">
|
||||
<td>{{ requirementTitles[status.requirement.name] }}</td>
|
||||
<td>{{ status.requirement.count }}</td>
|
||||
<td>{{ status.entitlement.product_name }}</td>
|
||||
<td>{{ status.entitlement.count }}</td>
|
||||
<td><span am-time-ago="status.entitlement.expiration.expiration_date" data-title="{{ status.entitlement.expiration.expiration_date }}" bs-tooltip></span></td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<div class="license-invalid license-status" ng-show="state == 'license-error'">
|
||||
<div class="license-invalid license-status" ng-show="state == LicenseStates.invalid">
|
||||
<h4><i class="fa fa-times-circle"></i> Validation Failed</h4>
|
||||
<h5>{{ licenseError }}</h5>
|
||||
<h5 ng-if="licenseError">{{ licenseError }}</h5>
|
||||
<h5 ng-if="!licenseError && licenseStatus">
|
||||
<p>The following errors were found:</p>
|
||||
<ul>
|
||||
<li ng-repeat="status in licenseStatus" ng-if="status.status != 'EntitlementStatus.met'">
|
||||
<div ng-switch on="status.status">
|
||||
<!-- insufficient_count -->
|
||||
<div ng-switch-when="EntitlementStatus.insufficient_count">
|
||||
<strong>{{ requirementTitles[status.requirement.name] }}</strong>: <code class="required">{{ status.requirement.count }}</code> <span ng-if="status.requirement.count != 1">are</span><span ng-if="status.requirement.count == 1">is</span> required: License provides <code>{{ status.entitlement.count }}</code>
|
||||
</div>
|
||||
|
||||
<!-- no_matching -->
|
||||
<div ng-switch-when="EntitlementStatus.no_matching">
|
||||
<strong>{{ requirementTitles[status.requirement.name] }}</strong>: License is missing requirement
|
||||
</div>
|
||||
|
||||
<!-- expired -->
|
||||
<div ng-switch-when="EntitlementStatus.expired">
|
||||
<strong>{{ requirementTitles[status.requirement.name] }}</strong>: Requirement expired on <code>{{ status.entitlement.expiration.expiration_date }}</code>
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
</h5>
|
||||
</div>
|
||||
|
||||
<button class="btn btn-default" ng-show="!showingEditor" ng-click="showEditor($event)"><i class="fa fa-pencil"></i> Update License</button>
|
||||
|
@ -28,12 +63,12 @@
|
|||
|
||||
<textarea id="enterLicenseBox" ng-model="licenseContents" class="form-control"
|
||||
placeholder="Paste your raw license here, which should already be in base64 format: GtqMjMwNDgyM3Vq..."
|
||||
ng-readonly="state == 'validating-license'"></textarea>
|
||||
ng-readonly="state == LicenseStates.validating"></textarea>
|
||||
|
||||
<button class="btn btn-primary" ng-show="state != 'validating-license'"
|
||||
<button class="btn btn-primary" ng-show="state != LicenseStates.validating"
|
||||
ng-click="validateAndUpdate($event)" ng-disabled="!licenseContents">Update License</button>
|
||||
|
||||
<div class="license-validating" ng-show="state == 'validating-license'">
|
||||
<div class="license-validating" ng-show="state == LicenseStates.validating">
|
||||
<span class="cor-loader-inline"></span> Validating License
|
||||
</div>
|
||||
</div>
|
||||
|
|
Reference in a new issue