Explorar el Código

Disable editing of MX and SRV records

These have additional fields that I haven’t implemented a UI for
Thomas Dy hace 10 años
padre
commit
1d9febc331
Se han modificado 1 ficheros con 2 adiciones y 1 borrados
  1. 2 1
      lib/ui/RecordList.jsx

+ 2 - 1
lib/ui/RecordList.jsx

@@ -116,6 +116,7 @@ var Record = React.createClass({
   render: function() {
     var record = this.props.record;
     var className = this.state.saving ? 'saving' : '';
+    var editDisabled = ['MX', 'SRV'].indexOf(record.type.val()) >= 0;
     if(this.state.state === 'edit') {
       return (
         <tr className={className}>
@@ -154,7 +155,7 @@ var Record = React.createClass({
           <td className="value">{record.display_content.val()}</td>
           <td><CloudActive record={record} onClick={this.toggleProxy} /></td>
           <td className="actions">
-            <button className="btn btn-primary" onClick={this.setEditing}>Edit</button>
+            <button className="btn btn-primary" disabled={editDisabled} onClick={this.setEditing}>Edit</button>
             <span> </span>
             <button className="btn btn-danger" onClick={this.setDeleting}>Delete</button>
           </td>