Fixing handling of adding custom OIDs in UI (#653)
* is_critical wasn't in the schema, so was getting dropped. * isCritical in the Javascript wasn't getting assigned if it was unchecked. Now, it will be assumed false if missing. * The display of critical or not in the list of added custom OIDs was unclear when it was just true/false with no heading. Now it will be displayed as critical or nothing instead. * The namespace for the checkbox for isCritical was wrong, and didn't get processed with the oid/type/value variables.
This commit is contained in:
parent
9f6ad08c50
commit
1b6f88f6fd
|
@ -229,6 +229,7 @@ class CustomOIDSchema(BaseExtensionSchema):
|
||||||
oid = fields.String()
|
oid = fields.String()
|
||||||
encoding = fields.String(validate=validators.encoding)
|
encoding = fields.String(validate=validators.encoding)
|
||||||
value = fields.String()
|
value = fields.String()
|
||||||
|
is_critical = fields.Boolean()
|
||||||
|
|
||||||
|
|
||||||
class ExtensionSchema(BaseExtensionSchema):
|
class ExtensionSchema(BaseExtensionSchema):
|
||||||
|
|
|
@ -196,7 +196,7 @@
|
||||||
<div class="col-sm-2">
|
<div class="col-sm-2">
|
||||||
<div class="checkbox">
|
<div class="checkbox">
|
||||||
<label>
|
<label>
|
||||||
<input type="checkbox" ng-model="authority.extensions.custom.isCritical">Critical
|
<input type="checkbox" ng-model="authority.customIsCritical">Critical
|
||||||
</label>
|
</label>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -208,7 +208,7 @@
|
||||||
<td>{{ custom.oid }}</td>
|
<td>{{ custom.oid }}</td>
|
||||||
<td>{{ custom.encoding }}</td>
|
<td>{{ custom.encoding }}</td>
|
||||||
<td>{{ custom.value }}</td>
|
<td>{{ custom.value }}</td>
|
||||||
<td>{{ custom.isCritical}}</td>
|
<td>{{ custom.isCritical ? "critical" : "" }}</td>
|
||||||
<td>
|
<td>
|
||||||
<button type="button" ng-click="authority.removeCustom($index)" class="btn btn-danger btn-sm pull-right">Remove</button>
|
<button type="button" ng-click="authority.removeCustom($index)" class="btn btn-danger btn-sm pull-right">Remove</button>
|
||||||
</td>
|
</td>
|
||||||
|
|
|
@ -41,7 +41,7 @@ angular.module('lemur')
|
||||||
this.extensions.custom.push(
|
this.extensions.custom.push(
|
||||||
{
|
{
|
||||||
'oid': this.customOid,
|
'oid': this.customOid,
|
||||||
'isCritical': this.customIsCritical,
|
'isCritical': this.customIsCritical || false,
|
||||||
'encoding': this.customEncoding,
|
'encoding': this.customEncoding,
|
||||||
'value': this.customValue
|
'value': this.customValue
|
||||||
}
|
}
|
||||||
|
|
|
@ -257,7 +257,7 @@
|
||||||
<div class="col-sm-2">
|
<div class="col-sm-2">
|
||||||
<div class="checkbox">
|
<div class="checkbox">
|
||||||
<label>
|
<label>
|
||||||
<input type="checkbox" ng-model="certificate.extensions.custom.isCritical">Critical
|
<input type="checkbox" ng-model="certificate.customIsCritical">Critical
|
||||||
</label>
|
</label>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -270,7 +270,7 @@
|
||||||
<td>{{ custom.oid }}</td>
|
<td>{{ custom.oid }}</td>
|
||||||
<td>{{ custom.encoding }}</td>
|
<td>{{ custom.encoding }}</td>
|
||||||
<td>{{ custom.value }}</td>
|
<td>{{ custom.value }}</td>
|
||||||
<td>{{ custom.isCritical }}</td>
|
<td>{{ custom.isCritical ? "critical" : "" }}</td>
|
||||||
<td>
|
<td>
|
||||||
<button type="button" ng-click="certificate.removeCustom($index)"
|
<button type="button" ng-click="certificate.removeCustom($index)"
|
||||||
class="btn btn-danger btn-sm pull-right">Remove
|
class="btn btn-danger btn-sm pull-right">Remove
|
||||||
|
|
|
@ -56,7 +56,7 @@ angular.module('lemur')
|
||||||
this.extensions.custom.push(
|
this.extensions.custom.push(
|
||||||
{
|
{
|
||||||
'oid': this.customOid,
|
'oid': this.customOid,
|
||||||
'isCritical': this.customIsCritical,
|
'isCritical': this.customIsCritical || false,
|
||||||
'encoding': this.customEncoding,
|
'encoding': this.customEncoding,
|
||||||
'value': this.customValue
|
'value': this.customValue
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue