Skip to content

Commit

Permalink
fix(legacy): ensure ttl set for non address records (canonical#1857)
Browse files Browse the repository at this point in the history
  • Loading branch information
squidsoup authored Nov 10, 2020
1 parent a4bb445 commit d1192bd
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
6 changes: 6 additions & 0 deletions legacy/src/app/directives/maas_obj_form.js
Original file line number Diff line number Diff line change
Expand Up @@ -157,11 +157,17 @@ export function maasObjForm(JSONService) {

// Called by maas-obj-field to place field in edit mode.
MAASFormController.prototype.startEditingField = function (key) {
if (!this.fields || !this.fields[key]) {
return;
}
this.fields[key].editing = true;
};

// Called by maas-obj-field to end edit mode for the field.
MAASFormController.prototype.stopEditingField = function (key, value) {
if (!this.fields || !this.fields[key]) {
return;
}
var field = this.fields[key];

// Do nothing if not save on blur.
Expand Down
4 changes: 2 additions & 2 deletions legacy/src/app/partials/domain-details.html
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ <h1 class="page-header__title">{$ domain.name $}</h1>
<maas-obj-field
subtle="false"
type="text"
key="address_ttl"
key="{$ newObject.$maasForm.getValue('rrtype') === 'A' || newObject.$maasForm.getValue('rrtype') === 'AAAA' ? 'address_ttl' : 'ttl' $}"
label="TTL"
placeholder="TTL in seconds (optional)"
label-width="2"
Expand Down Expand Up @@ -507,7 +507,7 @@ <h2 class="col-12 p-heading--four">Resource records</h2>
<maas-obj-field
label="TTL"
type="text"
key="address_ttl"
key="{$ row.rrtype === 'A' || row.rrtype === 'AAAA' ? 'address_ttl' : 'ttl' $}"
placeholder="TTL (default: 30)"
value="{$ row.ttl $}"
></maas-obj-field>
Expand Down

0 comments on commit d1192bd

Please sign in to comment.