diff --git a/modules/portal/app/views/batchChanges/batchChangeNew.scala.html b/modules/portal/app/views/batchChanges/batchChangeNew.scala.html index a17beb270..b5d8ec757 100644 --- a/modules/portal/app/views/batchChanges/batchChangeNew.scala.html +++ b/modules/portal/app/views/batchChanges/batchChangeNew.scala.html @@ -100,13 +100,14 @@ @@ -151,42 +152,42 @@ must be a valid IPv6 Address!

- - + +

Record data is required! must be a valid IPv4 Address!

- - + +

Record data is required! must be a valid IPv6 Address!

- - + +

Record data is required! CNAME data must be absolute!

- - + +

Record data is required!

- - + +

Record data is required!

- + - +

Preference is required! Must be between 0 and 65535! @@ -197,7 +198,7 @@
- +

Exchange data is required! Exchange data must be absolute! diff --git a/modules/portal/public/lib/batch-change/batch-change-new.controller.js b/modules/portal/public/lib/batch-change/batch-change-new.controller.js index d5b623c47..69e3aafdc 100644 --- a/modules/portal/public/lib/batch-change/batch-change-new.controller.js +++ b/modules/portal/public/lib/batch-change/batch-change-new.controller.js @@ -176,8 +176,10 @@ if (headers[j] == "changeType") { if (rowContent[j].match(/add/i)) { change[headers[j]] = "Add" - } else if (rowContent[j].match(/delete/i)) { + } else if (rowContent[j].match(/deleterecordset/i)) { change[headers[j]] = "DeleteRecordSet" + } else if (rowContent[j].match(/deleterecord/i)) { + change[headers[j]] = "DeleteRecord" } } else if (headers[j] == "type") { change[headers[j]] = rowContent[j].trim().toUpperCase() diff --git a/modules/portal/public/lib/batch-change/batch-change.spec.js b/modules/portal/public/lib/batch-change/batch-change.spec.js index 69a8d889f..dcd6da7c8 100644 --- a/modules/portal/public/lib/batch-change/batch-change.spec.js +++ b/modules/portal/public/lib/batch-change/batch-change.spec.js @@ -225,8 +225,8 @@ describe('BatchChange', function(){ }, 1000); }) - it('handles "delete" change type', function(done) { - var fileBlob = new Blob(["Change Type,Record Type,Input Name,TTL,Record Data\nDelete,A+PTR,test.example.,200,1.1.1.1"], { type: 'text/csv' }); + it('handles "deleterecordset" change type', function(done) { + var fileBlob = new Blob(["Change Type,Record Type,Input Name,TTL,Record Data\nDeleterecordset,A+PTR,test.example.,200,1.1.1.1"], { type: 'text/csv' }); var batchChange = this.scope.newBatch; this.scope.uploadCSV(fileBlob); @@ -237,8 +237,20 @@ describe('BatchChange', function(){ }, 1000); }) + it('handles "deleterecord" change type', function(done) { + var fileBlob = new Blob(["Change Type,Record Type,Input Name,TTL,Record Data\nDeleterecord,A+PTR,test.example.,200,1.1.1.1"], { type: 'text/csv' }); + var batchChange = this.scope.newBatch; + this.scope.uploadCSV(fileBlob); + + setTimeout(function() { + expect(batchChange.changes.length).toEqual(1) + expect(batchChange).toEqual({comments: "", changes: [{changeType: "DeleteRecord", type: "A+PTR", inputName: "test.example.", ttl: 200, record: {address: "1.1.1.1"}}], scheduledTime: tomorrow}); + done(); + }, 1000); + }) + it('handles whitespace', function(done) { - var fileBlob = new Blob(["Change Type,Record Type,Input Name,TTL,Record Data\nDelete, A+PTR ,test.example. ,200,1.1.1.1"], { type: 'text/csv' }); + var fileBlob = new Blob(["Change Type,Record Type,Input Name,TTL,Record Data\nDeleterecordset, A+PTR ,test.example. ,200,1.1.1.1"], { type: 'text/csv' }); var batchChange = this.scope.newBatch; this.scope.uploadCSV(fileBlob); @@ -263,7 +275,7 @@ describe('BatchChange', function(){ }) it('does not include empty lines', function(done) { - var fileBlob = new Blob(["Change Type,Record Type,Input Name,TTL,Record Data\n,,,,,\nDelete,A+PTR,test.example.,200,1.1.1.1"], { type: 'text/csv' }); + var fileBlob = new Blob(["Change Type,Record Type,Input Name,TTL,Record Data\n,,,,,\nDeleteRecordSet,A+PTR,test.example.,200,1.1.1.1"], { type: 'text/csv' }); var batchChange = this.scope.newBatch; this.scope.uploadCSV(fileBlob);