From 3cae9e3fcc67b87756120f6f1d1187463ef3160d Mon Sep 17 00:00:00 2001 From: Aravindh-Raju Date: Wed, 10 Jan 2024 13:22:46 +0530 Subject: [PATCH 1/7] add functionality --- .../api/domain/batch/BatchChangeService.scala | 6 +- .../batch/BatchChangeServiceAlgebra.scala | 2 + .../api/route/BatchChangeRouting.scala | 4 + .../domain/batch/BatchChangeServiceSpec.scala | 44 +++++++ .../notifier/email/EmailNotifierSpec.scala | 1 + .../api/notifier/sns/SnsNotifierSpec.scala | 8 +- .../InMemoryBatchChangeRepository.scala | 8 ++ .../route/BatchChangeJsonProtocolSpec.scala | 2 + .../api/route/BatchChangeRoutingSpec.scala | 3 + .../core/domain/batch/BatchChange.scala | 7 ++ .../domain/batch/BatchChangeRepository.scala | 2 + .../domain/batch/BatchChangeSummary.scala | 1 + .../domain/batch/BatchChangeSummarySpec.scala | 1 + ...BatchChangeRepositoryIntegrationSpec.scala | 6 +- .../db/migration/V3.31__BatchStatus.sql | 5 + .../MySqlBatchChangeRepository.scala | 111 +++++++++++++++--- .../views/dnsChanges/dnsChanges.scala.html | 37 ++++-- modules/portal/public/css/vinyldns.css | 28 +++++ .../lib/dns-change/dns-change.service.js | 3 +- .../lib/dns-change/dns-changes.controller.js | 9 +- 20 files changed, 252 insertions(+), 36 deletions(-) create mode 100644 modules/mysql/src/main/resources/db/migration/V3.31__BatchStatus.sql diff --git a/modules/api/src/main/scala/vinyldns/api/domain/batch/BatchChangeService.scala b/modules/api/src/main/scala/vinyldns/api/domain/batch/BatchChangeService.scala index fa5d29804..9a3ced705 100644 --- a/modules/api/src/main/scala/vinyldns/api/domain/batch/BatchChangeService.scala +++ b/modules/api/src/main/scala/vinyldns/api/domain/batch/BatchChangeService.scala @@ -34,6 +34,7 @@ import vinyldns.core.domain.auth.AuthPrincipal import vinyldns.core.domain.batch.BatchChangeApprovalStatus.BatchChangeApprovalStatus import vinyldns.core.domain.batch._ import vinyldns.core.domain.batch.BatchChangeApprovalStatus._ +import vinyldns.core.domain.batch.BatchChangeStatus.BatchChangeStatus import vinyldns.core.domain.{CnameAtZoneApexError, SingleChangeError, UserIsNotAuthorizedError, ZoneDiscoveryError} import vinyldns.core.domain.membership.{Group, GroupRepository, ListUsersResults, User, UserRepository} import vinyldns.core.domain.record.RecordType._ @@ -442,6 +443,7 @@ class BatchChangeService( changes, batchChangeInput.ownerGroupId, BatchChangeApprovalStatus.PendingReview, + BatchChangeStatus.PendingReview, scheduledTime = batchChangeInput.scheduledTime ).asRight } @@ -457,6 +459,7 @@ class BatchChangeService( changes, batchChangeInput.ownerGroupId, BatchChangeApprovalStatus.AutoApproved, + BatchChangeStatus.PendingProcessing, scheduledTime = batchChangeInput.scheduledTime ).asRight } @@ -584,12 +587,13 @@ class BatchChangeService( startFrom: Option[Int] = None, maxItems: Int = 100, ignoreAccess: Boolean = false, + batchStatus: Option[BatchChangeStatus] = None, approvalStatus: Option[BatchChangeApprovalStatus] = None ): BatchResult[BatchChangeSummaryList] = { val userId = if (ignoreAccess && auth.isSystemAdmin) None else Some(auth.userId) for { listResults <- batchChangeRepo - .getBatchChangeSummaries(userId, startFrom, maxItems, approvalStatus) + .getBatchChangeSummaries(userId, startFrom, maxItems, batchStatus, approvalStatus) .toBatchResult rsOwnerGroupIds = listResults.batchChanges.flatMap(_.ownerGroupId).toSet rsOwnerGroups <- groupRepository.getGroups(rsOwnerGroupIds).toBatchResult diff --git a/modules/api/src/main/scala/vinyldns/api/domain/batch/BatchChangeServiceAlgebra.scala b/modules/api/src/main/scala/vinyldns/api/domain/batch/BatchChangeServiceAlgebra.scala index aa66318a3..eaf9bf6e5 100644 --- a/modules/api/src/main/scala/vinyldns/api/domain/batch/BatchChangeServiceAlgebra.scala +++ b/modules/api/src/main/scala/vinyldns/api/domain/batch/BatchChangeServiceAlgebra.scala @@ -19,6 +19,7 @@ package vinyldns.api.domain.batch import vinyldns.api.domain.batch.BatchChangeInterfaces.BatchResult import vinyldns.core.domain.auth.AuthPrincipal import vinyldns.core.domain.batch.BatchChangeApprovalStatus.BatchChangeApprovalStatus +import vinyldns.core.domain.batch.BatchChangeStatus.BatchChangeStatus import vinyldns.core.domain.batch.{BatchChange, BatchChangeInfo, BatchChangeSummaryList} // $COVERAGE-OFF$ @@ -36,6 +37,7 @@ trait BatchChangeServiceAlgebra { startFrom: Option[Int], maxItems: Int, ignoreAccess: Boolean, + batchStatus: Option[BatchChangeStatus], approvalStatus: Option[BatchChangeApprovalStatus] ): BatchResult[BatchChangeSummaryList] diff --git a/modules/api/src/main/scala/vinyldns/api/route/BatchChangeRouting.scala b/modules/api/src/main/scala/vinyldns/api/route/BatchChangeRouting.scala index f4c021198..dcfc7b4d1 100644 --- a/modules/api/src/main/scala/vinyldns/api/route/BatchChangeRouting.scala +++ b/modules/api/src/main/scala/vinyldns/api/route/BatchChangeRouting.scala @@ -76,16 +76,19 @@ class BatchChangeRoute( "startFrom".as[Int].?, "maxItems".as[Int].?(MAX_ITEMS_LIMIT), "ignoreAccess".as[Boolean].?(false), + "batchStatus".as[String].?, "approvalStatus".as[String].? ) { ( startFrom: Option[Int], maxItems: Int, ignoreAccess: Boolean, + batchStatus: Option[String], approvalStatus: Option[String] ) => { val convertApprovalStatus = approvalStatus.flatMap(BatchChangeApprovalStatus.find) + val convertBatchStatus = batchStatus.flatMap(BatchChangeStatus.find) handleRejections(invalidQueryHandler) { validate( @@ -98,6 +101,7 @@ class BatchChangeRoute( startFrom, maxItems, ignoreAccess, + convertBatchStatus, convertApprovalStatus ) ) { summaries => diff --git a/modules/api/src/test/scala/vinyldns/api/domain/batch/BatchChangeServiceSpec.scala b/modules/api/src/test/scala/vinyldns/api/domain/batch/BatchChangeServiceSpec.scala index 424efb8ac..31d1373be 100644 --- a/modules/api/src/test/scala/vinyldns/api/domain/batch/BatchChangeServiceSpec.scala +++ b/modules/api/src/test/scala/vinyldns/api/domain/batch/BatchChangeServiceSpec.scala @@ -1036,6 +1036,7 @@ class BatchChangeServiceSpec List(), ownerGroupId = Some(okGroup.id), BatchChangeApprovalStatus.ManuallyApproved, + BatchChangeStatus.PendingProcessing, Some(superUser.id), None, Some(Instant.now.truncatedTo(ChronoUnit.MILLIS)) @@ -2313,6 +2314,48 @@ class BatchChangeServiceSpec result.batchChanges(0).ownerGroupId shouldBe Some("no-existo") result.batchChanges(0).ownerGroupName shouldBe None } + + "return list of batchChangeSummaries filtered by batch change status" in { + val batchChangeOne = + BatchChange( + auth.userId, + auth.signedInUser.userName, + None, + Instant.now.truncatedTo(ChronoUnit.MILLIS), + List(), + approvalStatus = BatchChangeApprovalStatus.PendingReview, + batchStatus = BatchChangeStatus.PendingReview + ) + batchChangeRepo.save(batchChangeOne) + + val batchChangeTwo = BatchChange( + auth.userId, + auth.signedInUser.userName, + None, + Instant.ofEpochMilli(Instant.now.truncatedTo(ChronoUnit.MILLIS).toEpochMilli + 1000), + List(), + approvalStatus = BatchChangeApprovalStatus.AutoApproved, + batchStatus = BatchChangeStatus.PendingProcessing + ) + batchChangeRepo.save(batchChangeTwo) + + val result = + underTest + .listBatchChangeSummaries( + auth, + batchStatus = Some(BatchChangeStatus.PendingReview) + ) + .value.unsafeRunSync().toOption.get + + result.maxItems shouldBe 100 + result.nextId shouldBe None + result.startFrom shouldBe None + result.ignoreAccess shouldBe false + result.batchStatus shouldBe Some(BatchChangeStatus.PendingReview) + + result.batchChanges.length shouldBe 1 + result.batchChanges(0).status shouldBe batchChangeOne.batchStatus + } } "getOwnerGroup" should { @@ -2451,6 +2494,7 @@ class BatchChangeServiceSpec List(singleChangeGood, singleChangeNR), Some(authGrp.id), BatchChangeApprovalStatus.ManuallyApproved, + BatchChangeStatus.PendingProcessing, Some("reviewer_id"), Some("approved"), Some(Instant.now.truncatedTo(ChronoUnit.MILLIS)) diff --git a/modules/api/src/test/scala/vinyldns/api/notifier/email/EmailNotifierSpec.scala b/modules/api/src/test/scala/vinyldns/api/notifier/email/EmailNotifierSpec.scala index 3a2c10d2b..aa14065bb 100644 --- a/modules/api/src/test/scala/vinyldns/api/notifier/email/EmailNotifierSpec.scala +++ b/modules/api/src/test/scala/vinyldns/api/notifier/email/EmailNotifierSpec.scala @@ -94,6 +94,7 @@ class EmailNotifierSpec changes, None, BatchChangeApprovalStatus.AutoApproved, + BatchChangeStatus.PendingProcessing, None, None, None, diff --git a/modules/api/src/test/scala/vinyldns/api/notifier/sns/SnsNotifierSpec.scala b/modules/api/src/test/scala/vinyldns/api/notifier/sns/SnsNotifierSpec.scala index 2adc41e7c..6372b017a 100644 --- a/modules/api/src/test/scala/vinyldns/api/notifier/sns/SnsNotifierSpec.scala +++ b/modules/api/src/test/scala/vinyldns/api/notifier/sns/SnsNotifierSpec.scala @@ -26,15 +26,10 @@ import org.mockito.Matchers._ import org.mockito.Mockito._ import org.mockito.ArgumentCaptor import cats.effect.IO -import vinyldns.core.domain.batch.BatchChange +import _root_.vinyldns.core.domain.batch.{BatchChange, BatchChangeApprovalStatus, BatchChangeStatus, SingleAddChange, SingleChange, SingleChangeStatus, SingleDeleteRRSetChange} import java.time.Instant -import vinyldns.core.domain.batch.BatchChangeApprovalStatus -import vinyldns.core.domain.batch.SingleChange -import vinyldns.core.domain.batch.SingleAddChange -import vinyldns.core.domain.batch.SingleDeleteRRSetChange import vinyldns.core.domain.record.RecordType import vinyldns.core.domain.record.AData -import _root_.vinyldns.core.domain.batch.SingleChangeStatus import com.typesafe.config.Config import com.typesafe.config.ConfigFactory import scala.collection.JavaConverters._ @@ -68,6 +63,7 @@ class SnsNotifierSpec changes, None, BatchChangeApprovalStatus.AutoApproved, + BatchChangeStatus.PendingProcessing, None, None, None, diff --git a/modules/api/src/test/scala/vinyldns/api/repository/InMemoryBatchChangeRepository.scala b/modules/api/src/test/scala/vinyldns/api/repository/InMemoryBatchChangeRepository.scala index 06ebf7ccf..a46c0ea2f 100644 --- a/modules/api/src/test/scala/vinyldns/api/repository/InMemoryBatchChangeRepository.scala +++ b/modules/api/src/test/scala/vinyldns/api/repository/InMemoryBatchChangeRepository.scala @@ -23,6 +23,7 @@ import scala.collection.concurrent import cats.effect._ import cats.implicits._ import vinyldns.core.domain.batch.BatchChangeApprovalStatus.BatchChangeApprovalStatus +import vinyldns.core.domain.batch.BatchChangeStatus.BatchChangeStatus class InMemoryBatchChangeRepository extends BatchChangeRepository { @@ -37,6 +38,7 @@ class InMemoryBatchChangeRepository extends BatchChangeRepository { ownerGroupId: Option[String], id: String, approvalStatus: BatchChangeApprovalStatus, + batchStatus: BatchChangeStatus, reviewerId: Option[String], reviewComment: Option[String], reviewTimestamp: Option[Instant] @@ -52,6 +54,7 @@ class InMemoryBatchChangeRepository extends BatchChangeRepository { batchChange.ownerGroupId, batchChange.id, batchChange.approvalStatus, + batchChange.batchStatus, batchChange.reviewerId, batchChange.reviewComment, batchChange.reviewTimestamp @@ -86,6 +89,7 @@ class InMemoryBatchChangeRepository extends BatchChangeRepository { singleChangesFromRepo, sc.ownerGroupId, sc.approvalStatus, + sc.batchStatus, sc.reviewerId, sc.reviewComment, sc.reviewTimestamp, @@ -114,10 +118,12 @@ class InMemoryBatchChangeRepository extends BatchChangeRepository { userId: Option[String], startFrom: Option[Int] = None, maxItems: Int = 100, + batchStatus: Option[BatchChangeStatus] = None, approvalStatus: Option[BatchChangeApprovalStatus] = None ): IO[BatchChangeSummaryList] = { val userBatchChanges = batches.values.toList .filter(b => userId.forall(_ == b.userId)) + .filter(bs => batchStatus.forall(_ == bs.batchStatus)) .filter(as => approvalStatus.forall(_ == as.approvalStatus)) val batchChangeSummaries = for { sc <- userBatchChanges @@ -131,6 +137,7 @@ class InMemoryBatchChangeRepository extends BatchChangeRepository { changes, sc.ownerGroupId, sc.approvalStatus, + sc.batchStatus, sc.reviewerId, sc.reviewComment, sc.reviewTimestamp, @@ -150,6 +157,7 @@ class InMemoryBatchChangeRepository extends BatchChangeRepository { nextId = nextId, maxItems = maxItems, ignoreAccess = ignoreAccess, + batchStatus = batchStatus, approvalStatus = approvalStatus ) ) diff --git a/modules/api/src/test/scala/vinyldns/api/route/BatchChangeJsonProtocolSpec.scala b/modules/api/src/test/scala/vinyldns/api/route/BatchChangeJsonProtocolSpec.scala index 3935418bd..b102ced1a 100644 --- a/modules/api/src/test/scala/vinyldns/api/route/BatchChangeJsonProtocolSpec.scala +++ b/modules/api/src/test/scala/vinyldns/api/route/BatchChangeJsonProtocolSpec.scala @@ -482,6 +482,7 @@ class BatchChangeJsonProtocolSpec List(add, delete), None, BatchChangeApprovalStatus.PendingReview, + BatchChangeStatus.PendingReview, None, None, None, @@ -616,6 +617,7 @@ class BatchChangeJsonProtocolSpec List(add, delete), None, BatchChangeApprovalStatus.PendingReview, + BatchChangeStatus.PendingReview, None, None, None, diff --git a/modules/api/src/test/scala/vinyldns/api/route/BatchChangeRoutingSpec.scala b/modules/api/src/test/scala/vinyldns/api/route/BatchChangeRoutingSpec.scala index c8ba4406d..d0b39a07f 100644 --- a/modules/api/src/test/scala/vinyldns/api/route/BatchChangeRoutingSpec.scala +++ b/modules/api/src/test/scala/vinyldns/api/route/BatchChangeRoutingSpec.scala @@ -38,6 +38,7 @@ import vinyldns.core.TestMembershipData._ import vinyldns.core.domain.BatchChangeIsEmpty import vinyldns.core.domain.auth.AuthPrincipal import vinyldns.core.domain.batch.BatchChangeApprovalStatus.BatchChangeApprovalStatus +import vinyldns.core.domain.batch.BatchChangeStatus.BatchChangeStatus import vinyldns.core.domain.batch._ import vinyldns.core.domain.record.RecordType._ import vinyldns.core.domain.record._ @@ -132,6 +133,7 @@ class BatchChangeRoutingSpec() ), ownerGroupId, approvalStatus, + BatchChangeStatus.PendingProcessing, None, None, None, @@ -313,6 +315,7 @@ class BatchChangeRoutingSpec() startFrom: Option[Int], maxItems: Int, ignoreAccess: Boolean = false, + batchStatus: Option[BatchChangeStatus] = None, approvalStatus: Option[BatchChangeApprovalStatus] = None ): EitherT[IO, BatchChangeErrorResponse, BatchChangeSummaryList] = if (auth.userId == okAuth.userId) diff --git a/modules/core/src/main/scala/vinyldns/core/domain/batch/BatchChange.scala b/modules/core/src/main/scala/vinyldns/core/domain/batch/BatchChange.scala index 71f1da460..ad68d5f99 100644 --- a/modules/core/src/main/scala/vinyldns/core/domain/batch/BatchChange.scala +++ b/modules/core/src/main/scala/vinyldns/core/domain/batch/BatchChange.scala @@ -31,6 +31,7 @@ case class BatchChange( changes: List[SingleChange], ownerGroupId: Option[String] = None, approvalStatus: BatchChangeApprovalStatus, + batchStatus: BatchChangeStatus = BatchChangeStatus.PendingProcessing, reviewerId: Option[String] = None, reviewComment: Option[String] = None, reviewTimestamp: Option[Instant] = None, @@ -92,6 +93,12 @@ object BatchChangeStatus extends Enumeration { case _ => BatchChangeStatus.Complete } } + + private val valueMap = + BatchChangeStatus.values.map(v => v.toString.toLowerCase -> v).toMap + + def find(status: String): Option[BatchChangeStatus] = + valueMap.get(status.toLowerCase) } object BatchChangeApprovalStatus extends Enumeration { diff --git a/modules/core/src/main/scala/vinyldns/core/domain/batch/BatchChangeRepository.scala b/modules/core/src/main/scala/vinyldns/core/domain/batch/BatchChangeRepository.scala index 9901e171c..453e75881 100644 --- a/modules/core/src/main/scala/vinyldns/core/domain/batch/BatchChangeRepository.scala +++ b/modules/core/src/main/scala/vinyldns/core/domain/batch/BatchChangeRepository.scala @@ -18,6 +18,7 @@ package vinyldns.core.domain.batch import cats.effect.IO import vinyldns.core.domain.batch.BatchChangeApprovalStatus.BatchChangeApprovalStatus +import vinyldns.core.domain.batch.BatchChangeStatus.BatchChangeStatus import vinyldns.core.repository.Repository // $COVERAGE-OFF$ @@ -31,6 +32,7 @@ trait BatchChangeRepository extends Repository { userId: Option[String], startFrom: Option[Int] = None, maxItems: Int = 100, + batchStatus: Option[BatchChangeStatus] = None, approvalStatus: Option[BatchChangeApprovalStatus] = None ): IO[BatchChangeSummaryList] diff --git a/modules/core/src/main/scala/vinyldns/core/domain/batch/BatchChangeSummary.scala b/modules/core/src/main/scala/vinyldns/core/domain/batch/BatchChangeSummary.scala index bd47619c2..edab9a050 100644 --- a/modules/core/src/main/scala/vinyldns/core/domain/batch/BatchChangeSummary.scala +++ b/modules/core/src/main/scala/vinyldns/core/domain/batch/BatchChangeSummary.scala @@ -91,5 +91,6 @@ case class BatchChangeSummaryList( nextId: Option[Int] = None, maxItems: Int = 100, ignoreAccess: Boolean = false, + batchStatus: Option[BatchChangeStatus] = None, approvalStatus: Option[BatchChangeApprovalStatus] = None ) diff --git a/modules/core/src/test/scala/vinyldns/core/domain/batch/BatchChangeSummarySpec.scala b/modules/core/src/test/scala/vinyldns/core/domain/batch/BatchChangeSummarySpec.scala index cf3d66e10..b654d338e 100644 --- a/modules/core/src/test/scala/vinyldns/core/domain/batch/BatchChangeSummarySpec.scala +++ b/modules/core/src/test/scala/vinyldns/core/domain/batch/BatchChangeSummarySpec.scala @@ -47,6 +47,7 @@ class BatchChangeSummarySpec extends AnyWordSpec with Matchers { List(pendingChange, failedChange, completeChange), Some("groupId"), BatchChangeApprovalStatus.AutoApproved, + BatchChangeStatus.PendingProcessing, None, None, None, diff --git a/modules/mysql/src/it/scala/vinyldns/mysql/repository/MySqlBatchChangeRepositoryIntegrationSpec.scala b/modules/mysql/src/it/scala/vinyldns/mysql/repository/MySqlBatchChangeRepositoryIntegrationSpec.scala index ac544d770..50f37edd3 100644 --- a/modules/mysql/src/it/scala/vinyldns/mysql/repository/MySqlBatchChangeRepositoryIntegrationSpec.scala +++ b/modules/mysql/src/it/scala/vinyldns/mysql/repository/MySqlBatchChangeRepositoryIntegrationSpec.scala @@ -103,6 +103,7 @@ class MySqlBatchChangeRepositoryIntegrationSpec changes, Some(UUID.randomUUID().toString), BatchChangeApprovalStatus.AutoApproved, + BatchChangeStatus.PendingProcessing, Some(UUID.randomUUID().toString), Some("review comment"), Some(Instant.now.truncatedTo(ChronoUnit.MILLIS).plusSeconds(2)) @@ -150,6 +151,8 @@ class MySqlBatchChangeRepositoryIntegrationSpec createdTimestamp = timeBase.plusMillis(10000000), approvalStatus = BatchChangeApprovalStatus.ManuallyRejected ) + val change_six: BatchChange = + completeBatchChange.copy(createdTimestamp = timeBase.plusMillis(2000), ownerGroupId = None) } import TestData._ @@ -453,7 +456,8 @@ class MySqlBatchChangeRepositoryIntegrationSpec } yield (updated, saved) val (retrieved, saved) = f.unsafeRunSync - retrieved shouldBe saved + // Batch Change Status will be updated once saved + retrieved.map(x => x.copy(batchStatus = BatchChangeStatus.Complete)) shouldBe saved } "return no batch when single changes list is empty" in { diff --git a/modules/mysql/src/main/resources/db/migration/V3.31__BatchStatus.sql b/modules/mysql/src/main/resources/db/migration/V3.31__BatchStatus.sql new file mode 100644 index 000000000..07a93b4c4 --- /dev/null +++ b/modules/mysql/src/main/resources/db/migration/V3.31__BatchStatus.sql @@ -0,0 +1,5 @@ +CREATE SCHEMA IF NOT EXISTS ${dbName}; + +USE ${dbName}; + +ALTER TABLE batch_change ADD batch_status VARCHAR(25) NOT NULL; \ No newline at end of file diff --git a/modules/mysql/src/main/scala/vinyldns/mysql/repository/MySqlBatchChangeRepository.scala b/modules/mysql/src/main/scala/vinyldns/mysql/repository/MySqlBatchChangeRepository.scala index d83c0de50..10a0e9e75 100644 --- a/modules/mysql/src/main/scala/vinyldns/mysql/repository/MySqlBatchChangeRepository.scala +++ b/modules/mysql/src/main/scala/vinyldns/mysql/repository/MySqlBatchChangeRepository.scala @@ -24,6 +24,7 @@ import java.time.Instant import org.slf4j.LoggerFactory import scalikejdbc._ import vinyldns.core.domain.batch.BatchChangeApprovalStatus.BatchChangeApprovalStatus +import vinyldns.core.domain.batch.BatchChangeStatus.BatchChangeStatus import vinyldns.core.domain.batch._ import vinyldns.core.protobuf.{BatchChangeProtobufConversions, SingleChangeType} import vinyldns.core.route.Monitored @@ -48,11 +49,11 @@ class MySqlBatchChangeRepository private final val PUT_BATCH_CHANGE = sql""" | INSERT INTO batch_change(id, user_id, user_name, created_time, comments, owner_group_id, - | approval_status, reviewer_id, review_comment, review_timestamp, + | approval_status, batch_status, reviewer_id, review_comment, review_timestamp, | scheduled_time, cancelled_timestamp) | VALUES ({id}, {userId}, {userName}, {createdTime}, {comments}, {ownerGroupId}, {approvalStatus}, - | {reviewerId}, {reviewComment}, {reviewTimestamp}, {scheduledTime}, {cancelledTimestamp}) - |ON DUPLICATE KEY UPDATE comments={comments}, owner_group_id={ownerGroupId}, approval_status={approvalStatus}, + | {batchStatus}, {reviewerId}, {reviewComment}, {reviewTimestamp}, {scheduledTime}, {cancelledTimestamp}) + |ON DUPLICATE KEY UPDATE comments={comments}, owner_group_id={ownerGroupId}, approval_status={approvalStatus}, batch_status={batchStatus}, | reviewer_id={reviewerId}, review_comment={reviewComment}, review_timestamp={reviewTimestamp}, | scheduled_time={scheduledTime}, cancelled_timestamp={cancelledTimestamp} """.stripMargin @@ -70,14 +71,14 @@ class MySqlBatchChangeRepository private final val GET_BATCH_CHANGE_METADATA = sql""" |SELECT user_id, user_name, created_time, comments, owner_group_id, - | approval_status, reviewer_id, review_comment, review_timestamp, scheduled_time, cancelled_timestamp + | approval_status, batch_status, reviewer_id, review_comment, review_timestamp, scheduled_time, cancelled_timestamp | FROM batch_change bc | WHERE bc.id = ? """.stripMargin private final val GET_BATCH_CHANGE_METADATA_FROM_SINGLE_CHANGE = sql""" - |SELECT bc.id, bc.user_id, bc.user_name, bc.created_time, bc.comments, bc.owner_group_id, bc.approval_status, + |SELECT bc.id, bc.user_id, bc.user_name, bc.created_time, bc.comments, bc.owner_group_id, bc.approval_status, bc.batch_status, | bc.reviewer_id, bc.review_comment, bc.review_timestamp, bc.scheduled_time, bc.cancelled_timestamp | FROM batch_change bc | JOIN (SELECT id, batch_change_id from single_change where id = ?) sc @@ -86,13 +87,13 @@ class MySqlBatchChangeRepository private final val GET_BATCH_CHANGE_SUMMARY_BASE = """ - |SELECT batch_change_page.id, user_id, user_name, created_time, comments, owner_group_id, approval_status, reviewer_id, + |SELECT batch_change_page.id, user_id, user_name, created_time, comments, owner_group_id, approval_status, batch_status, reviewer_id, | review_comment, review_timestamp, scheduled_time, cancelled_timestamp, | SUM(CASE WHEN sc.status LIKE 'Failed' OR sc.status LIKE 'Rejected' THEN 1 ELSE 0 END) AS fail_count, | SUM(CASE WHEN sc.status LIKE 'Pending' OR sc.status LIKE 'NeedsReview' THEN 1 ELSE 0 END) AS pending_count, | SUM(CASE sc.status WHEN 'Complete' THEN 1 ELSE 0 END) AS complete_count, | SUM(CASE sc.status WHEN 'Cancelled' THEN 1 ELSE 0 END) AS cancelled_count - | FROM (SELECT bc.id, bc.user_id, bc.user_name, bc.created_time, bc.comments, bc.owner_group_id, bc.approval_status, + | FROM (SELECT bc.id, bc.user_id, bc.user_name, bc.created_time, bc.comments, bc.owner_group_id, bc.approval_status, bc.batch_status, | bc.reviewer_id, bc.review_comment, bc.review_timestamp, bc.scheduled_time, bc.cancelled_timestamp | FROM batch_change bc """.stripMargin @@ -124,6 +125,13 @@ class MySqlBatchChangeRepository | WHERE id={id} """.stripMargin + private final val UPDATE_BATCH_CHANGE = + sql""" + |UPDATE batch_change + | SET batch_status={batchStatus} + | WHERE id={id} + """.stripMargin + def save(batch: BatchChange): IO[BatchChange] = monitor("repo.BatchChangeJDBC.save") { IO { @@ -182,6 +190,23 @@ class MySqlBatchChangeRepository batchMeta.copy(changes = changes) } + var failCount = 0 + var pendingCount = 0 + var completeCount = 0 + var cancelledCount = 0 + + singleChanges.foreach { sc => + if (sc.status.toString == "Failed" || sc.status.toString == "Rejected") { + failCount += 1 + } else if (sc.status.toString == "Pending" || sc.status.toString == "NeedsReview") { + pendingCount += 1 + } else if (sc.status.toString == "Complete") { + completeCount += 1 + } else { + cancelledCount += 1 + } + } + monitor("repo.BatchChangeJDBC.updateSingleChanges") { IO { logger.info( @@ -193,6 +218,8 @@ class MySqlBatchChangeRepository batchParams = singleChanges.map(convertSingleChangeToParams) _ = UPDATE_SINGLE_CHANGE.batchByName(batchParams: _*).apply() batchChange <- getBatchFromSingleChangeId(headChange.id) + batchStatus = BatchChangeStatus.calculateBatchStatus(batchChange.approvalStatus, pendingCount > 0, failCount > 0, completeCount > 0, batchChange.scheduledTime.isDefined) + _ = UPDATE_BATCH_CHANGE.bindByName('batchStatus -> batchStatus.toString, 'id -> batchChange.id).update().apply() } yield batchChange } } @@ -235,6 +262,7 @@ class MySqlBatchChangeRepository userId: Option[String], startFrom: Option[Int] = None, maxItems: Int = 100, + batchStatus: Option[BatchChangeStatus], approvalStatus: Option[BatchChangeApprovalStatus] ): IO[BatchChangeSummaryList] = monitor("repo.BatchChangeJDBC.getBatchChangeSummaries") { @@ -246,7 +274,8 @@ class MySqlBatchChangeRepository val uid = userId.map(u => s"bc.user_id = '$u'") val as = approvalStatus.map(a => s"bc.approval_status = '${fromApprovalStatus(a)}'") - val opts = uid ++ as + val bs = batchStatus.map(b => s"bc.batch_status = '${fromBatchStatus(b)}'") + val opts = uid ++ as ++ bs if (opts.nonEmpty) sb.append("WHERE ").append(opts.mkString(" AND ")) @@ -262,6 +291,7 @@ class MySqlBatchChangeRepository val complete = res.int("complete_count") val cancelled = res.int("cancelled_count") val approvalStatus = toApprovalStatus(res.intOpt("approval_status")) + val batchChangeStatus = toBatchChangeStatus(res.stringOpt("batch_status")) val schedTime = res.timestampOpt("scheduled_time").map(st => st.toInstant) val cancelledTimestamp = @@ -272,14 +302,7 @@ class MySqlBatchChangeRepository Option(res.string("comments")), res.timestamp("created_time").toInstant, pending + failed + complete + cancelled, - BatchChangeStatus - .calculateBatchStatus( - approvalStatus, - pending > 0, - failed > 0, - complete > 0, - schedTime.isDefined - ), + batchChangeStatus, Option(res.string("owner_group_id")), res.string("id"), None, @@ -303,6 +326,7 @@ class MySqlBatchChangeRepository nextId, maxItems, ignoreAccess, + batchStatus, approvalStatus ) } @@ -333,6 +357,7 @@ class MySqlBatchChangeRepository Nil, result.stringOpt("owner_group_id"), toApprovalStatus(result.intOpt("approval_status")), + toBatchChangeStatus(result.stringOpt("batch_status")), result.stringOpt("reviewer_id"), result.stringOpt("review_comment"), result.timestampOpt("review_timestamp").map(toDateTime), @@ -345,6 +370,33 @@ class MySqlBatchChangeRepository private def saveBatchChange( batchChange: BatchChange )(implicit session: DBSession): BatchChange = { + + var failCount = 0 + var pendingCount = 0 + var completeCount = 0 + var cancelledCount = 0 + + batchChange.changes.foreach { sc => + if (sc.status.toString == "Failed" || sc.status.toString == "Rejected") { + failCount += 1 + } else if (sc.status.toString == "Pending" || sc.status.toString == "NeedsReview") { + pendingCount += 1 + } else if (sc.status.toString == "Complete") { + completeCount += 1 + } else { + cancelledCount += 1 + } + } + + val batchStatus = BatchChangeStatus + .calculateBatchStatus( + batchChange.approvalStatus, + pendingCount > 0, + failCount > 0, + completeCount > 0, + batchChange.scheduledTime.isDefined + ) + PUT_BATCH_CHANGE .bindByName( Seq( @@ -355,6 +407,7 @@ class MySqlBatchChangeRepository 'comments -> batchChange.comments, 'ownerGroupId -> batchChange.ownerGroupId, 'approvalStatus -> fromApprovalStatus(batchChange.approvalStatus), + 'batchStatus -> fromBatchStatus(batchStatus), 'reviewerId -> batchChange.reviewerId, 'reviewComment -> batchChange.reviewComment, 'reviewTimestamp -> batchChange.reviewTimestamp, @@ -420,6 +473,18 @@ class MySqlBatchChangeRepository case BatchChangeApprovalStatus.Cancelled => 5 } + def fromBatchStatus(typ: BatchChangeStatus): String = + typ match { + case BatchChangeStatus.Cancelled => "Cancelled" + case BatchChangeStatus.Complete => "Complete" + case BatchChangeStatus.Failed => "Failed" + case BatchChangeStatus.PartialFailure => "PartialFailure" + case BatchChangeStatus.PendingProcessing => "PendingProcessing" + case BatchChangeStatus.PendingReview => "PendingReview" + case BatchChangeStatus.Rejected => "Rejected" + case BatchChangeStatus.Scheduled => "Scheduled" + } + def toApprovalStatus(key: Option[Int]): BatchChangeApprovalStatus = key match { case Some(1) => BatchChangeApprovalStatus.AutoApproved @@ -430,5 +495,19 @@ class MySqlBatchChangeRepository case _ => BatchChangeApprovalStatus.AutoApproved } + def toBatchChangeStatus(key: Option[String]): BatchChangeStatus = { + key match { + case Some("Cancelled") => BatchChangeStatus.Cancelled + case Some("Complete") => BatchChangeStatus.Complete + case Some("Failed") => BatchChangeStatus.Failed + case Some("PartialFailure") => BatchChangeStatus.PartialFailure + case Some("PendingProcessing") => BatchChangeStatus.PendingProcessing + case Some("PendingReview") => BatchChangeStatus.PendingReview + case Some("Rejected") => BatchChangeStatus.Rejected + case Some("Scheduled") => BatchChangeStatus.Scheduled + case _ => BatchChangeStatus.Complete + } + } + def toDateTime(ts: Timestamp): Instant = ts.toInstant } diff --git a/modules/portal/app/views/dnsChanges/dnsChanges.scala.html b/modules/portal/app/views/dnsChanges/dnsChanges.scala.html index 80d3b6acf..f85a56ad3 100644 --- a/modules/portal/app/views/dnsChanges/dnsChanges.scala.html +++ b/modules/portal/app/views/dnsChanges/dnsChanges.scala.html @@ -44,14 +44,37 @@ New DNS Change @if(meta.manualBatchChangeReviewEnabled){ -
-
-
- +
+ +
+
+
+ +
+
+
}
diff --git a/modules/portal/public/css/vinyldns.css b/modules/portal/public/css/vinyldns.css index 097c30a77..04b63a817 100644 --- a/modules/portal/public/css/vinyldns.css +++ b/modules/portal/public/css/vinyldns.css @@ -590,3 +590,31 @@ input[type="file"] { .flex-1{ flex: 1; } + +.filter-margin { + margin: 5px; +} + +.dropdown-bottom-margin { + margin-bottom: 5px; +} + +.no-margin { + margin: 0px; +} + +.dt-filter { + width: 400px; +} + +.dt-select-box { + top: 318.883px !important; + left: 1275.34px !important; + right: auto !important; + margin-top: 60px !important; + z-index: 9999 !important; +} + +.float-right { + float: right; +} diff --git a/modules/portal/public/lib/dns-change/dns-change.service.js b/modules/portal/public/lib/dns-change/dns-change.service.js index 2bd8f1e13..ae03b4b65 100644 --- a/modules/portal/public/lib/dns-change/dns-change.service.js +++ b/modules/portal/public/lib/dns-change/dns-change.service.js @@ -33,11 +33,12 @@ return $http.post(url, data, {headers: utilityService.getCsrfHeader()}); }; - this.getBatchChanges = function (maxItems, startFrom, ignoreAccess, approvalStatus) { + this.getBatchChanges = function (maxItems, startFrom, ignoreAccess, batchStatus, approvalStatus) { var params = { "maxItems": maxItems, "startFrom": startFrom, "ignoreAccess": ignoreAccess, + "batchStatus": batchStatus, "approvalStatus": approvalStatus }; var url = utilityService.urlBuilder('/api/dnschanges', params); diff --git a/modules/portal/public/lib/dns-change/dns-changes.controller.js b/modules/portal/public/lib/dns-change/dns-changes.controller.js index cae704347..c60ea4b1e 100644 --- a/modules/portal/public/lib/dns-change/dns-changes.controller.js +++ b/modules/portal/public/lib/dns-change/dns-changes.controller.js @@ -20,6 +20,7 @@ angular.module('dns-change') .controller('DnsChangesController', function($scope, $timeout, dnsChangeService, pagingService, utilityService){ $scope.batchChanges = []; + $scope.batchChangeStatuses = ["Cancelled", "Complete", "Failed", "PartialFailure", "PendingProcessing", "PendingReview", "Rejected", "Scheduled"] $scope.currentBatchChange; // Set default params: empty start from and 100 max items @@ -31,7 +32,7 @@ } return dnsChangeService - .getBatchChanges(maxItems, startFrom, $scope.ignoreAccess, $scope.approvalStatus) + .getBatchChanges(maxItems, startFrom, $scope.ignoreAccess, $scope.batchStatus, $scope.approvalStatus) .then(success) .catch(function(error) { handleError(error, 'dnsChangesService::getBatchChanges-failure'); @@ -55,7 +56,7 @@ } return dnsChangeService - .getBatchChanges(batchChangePaging.maxItems, undefined, $scope.ignoreAccess, $scope.approvalStatus) + .getBatchChanges(batchChangePaging.maxItems, undefined, $scope.ignoreAccess, $scope.batchStatus, $scope.approvalStatus) .then(success) .catch(function (error){ handleError(error, 'dnsChangesService::getBatchChanges-failure'); @@ -80,7 +81,7 @@ $scope.prevPage = function() { var startFrom = pagingService.getPrevStartFrom(batchChangePaging); return $scope - .getBatchChanges(batchChangePaging.maxItems, startFrom, $scope.ignoreAccess, $scope.approvalStatus) + .getBatchChanges(batchChangePaging.maxItems, startFrom, $scope.ignoreAccess, $scope.batchStatus, $scope.approvalStatus) .then(function(response) { batchChangePaging = pagingService.prevPageUpdate(response.data.nextId, batchChangePaging); $scope.batchChanges = response.data.batchChanges; @@ -92,7 +93,7 @@ $scope.nextPage = function() { return $scope - .getBatchChanges(batchChangePaging.maxItems, batchChangePaging.next, $scope.ignoreAccess, $scope.approvalStatus) + .getBatchChanges(batchChangePaging.maxItems, batchChangePaging.next, $scope.ignoreAccess, $scope.batchStatus, $scope.approvalStatus) .then(function(response) { var batchChanges = response.data.batchChanges; batchChangePaging = pagingService.nextPageUpdate(batchChanges, response.data.nextId, batchChangePaging); From 82f3fa3e883ed0c0267398152e81fb462f57eb1d Mon Sep 17 00:00:00 2001 From: Aravindh-Raju Date: Thu, 11 Jan 2024 16:16:06 +0530 Subject: [PATCH 2/7] add tests --- ...BatchChangeRepositoryIntegrationSpec.scala | 53 +++++++++++++++++++ .../db/migration/V3.31__BatchStatus.sql | 2 +- 2 files changed, 54 insertions(+), 1 deletion(-) diff --git a/modules/mysql/src/it/scala/vinyldns/mysql/repository/MySqlBatchChangeRepositoryIntegrationSpec.scala b/modules/mysql/src/it/scala/vinyldns/mysql/repository/MySqlBatchChangeRepositoryIntegrationSpec.scala index 50f37edd3..ad8f3a4b3 100644 --- a/modules/mysql/src/it/scala/vinyldns/mysql/repository/MySqlBatchChangeRepositoryIntegrationSpec.scala +++ b/modules/mysql/src/it/scala/vinyldns/mysql/repository/MySqlBatchChangeRepositoryIntegrationSpec.scala @@ -691,6 +691,59 @@ class MySqlBatchChangeRepositoryIntegrationSpec batchChangeSummaries.batchChanges shouldBe empty } + "get batch change summaries by batch change status" in { + val f = + for { + _ <- repo.save(change_one) + _ <- repo.save(change_two) + _ <- repo.save(change_three) + _ <- repo.save(change_four) + _ <- repo.save(otherUserBatchChange) + + retrieved <- repo.getBatchChangeSummaries(None, batchStatus = Some(BatchChangeStatus.PartialFailure)) + } yield retrieved + + // from most recent descending + val expectedChanges = BatchChangeSummaryList( + List( + BatchChangeSummary(change_four) + ) + ) + + areSame(f.unsafeRunSync(), expectedChanges) + } + + "get batch change summaries by user ID, approval status and batch change status" in { + val f = + for { + _ <- repo.save(change_one) + _ <- repo.save(change_two) + _ <- repo.save(change_three) + _ <- repo.save(change_four) + _ <- repo.save(otherUserBatchChange) + + retrieved <- repo.getBatchChangeSummaries( + Some(pendingBatchChange.userId), + approvalStatus = Some(BatchChangeApprovalStatus.AutoApproved), + batchStatus = Some(BatchChangeStatus.Complete) + ) + } yield retrieved + + // from most recent descending + val expectedChanges = BatchChangeSummaryList( + List( + BatchChangeSummary(change_two) + ) + ) + + areSame(f.unsafeRunSync(), expectedChanges) + } + + "return empty list if a batch change summary is not found for a batch change status" in { + val batchChangeSummaries = repo.getBatchChangeSummaries(None, batchStatus = Some(BatchChangeStatus.Scheduled)).unsafeRunSync() + batchChangeSummaries.batchChanges shouldBe empty + } + "properly status check (pending)" in { val chg = randomBatchChange( List( diff --git a/modules/mysql/src/main/resources/db/migration/V3.31__BatchStatus.sql b/modules/mysql/src/main/resources/db/migration/V3.31__BatchStatus.sql index 07a93b4c4..2979d002f 100644 --- a/modules/mysql/src/main/resources/db/migration/V3.31__BatchStatus.sql +++ b/modules/mysql/src/main/resources/db/migration/V3.31__BatchStatus.sql @@ -2,4 +2,4 @@ CREATE SCHEMA IF NOT EXISTS ${dbName}; USE ${dbName}; -ALTER TABLE batch_change ADD batch_status VARCHAR(25) NOT NULL; \ No newline at end of file +ALTER TABLE batch_change ADD batch_status VARCHAR(25) NOT NULL; From fa16fa31324285057b591afbcb65e743cf0e7291 Mon Sep 17 00:00:00 2001 From: Aravindh-Raju Date: Tue, 13 Feb 2024 11:30:48 +0530 Subject: [PATCH 3/7] temporarily remove batch status filter --- .../api/route/BatchChangeRouting.scala | 6 ++--- .../views/dnsChanges/dnsChanges.scala.html | 27 ++----------------- .../lib/dns-change/dns-change.service.js | 3 +-- .../lib/dns-change/dns-changes.controller.js | 9 +++---- 4 files changed, 9 insertions(+), 36 deletions(-) diff --git a/modules/api/src/main/scala/vinyldns/api/route/BatchChangeRouting.scala b/modules/api/src/main/scala/vinyldns/api/route/BatchChangeRouting.scala index dcfc7b4d1..7325116f3 100644 --- a/modules/api/src/main/scala/vinyldns/api/route/BatchChangeRouting.scala +++ b/modules/api/src/main/scala/vinyldns/api/route/BatchChangeRouting.scala @@ -76,19 +76,16 @@ class BatchChangeRoute( "startFrom".as[Int].?, "maxItems".as[Int].?(MAX_ITEMS_LIMIT), "ignoreAccess".as[Boolean].?(false), - "batchStatus".as[String].?, "approvalStatus".as[String].? ) { ( startFrom: Option[Int], maxItems: Int, ignoreAccess: Boolean, - batchStatus: Option[String], approvalStatus: Option[String] ) => { val convertApprovalStatus = approvalStatus.flatMap(BatchChangeApprovalStatus.find) - val convertBatchStatus = batchStatus.flatMap(BatchChangeStatus.find) handleRejections(invalidQueryHandler) { validate( @@ -101,7 +98,8 @@ class BatchChangeRoute( startFrom, maxItems, ignoreAccess, - convertBatchStatus, + // TODO: Update batch status from None to its actual value when the feature is ready for release + None, convertApprovalStatus ) ) { summaries => diff --git a/modules/portal/app/views/dnsChanges/dnsChanges.scala.html b/modules/portal/app/views/dnsChanges/dnsChanges.scala.html index f85a56ad3..ba4745869 100644 --- a/modules/portal/app/views/dnsChanges/dnsChanges.scala.html +++ b/modules/portal/app/views/dnsChanges/dnsChanges.scala.html @@ -44,38 +44,15 @@ New DNS Change
@if(meta.manualBatchChangeReviewEnabled){ -
-
-
+
-
}
@@ -179,4 +156,4 @@ @plugins = {} -@main(rootAccountName)("DnsChangesController")("DNS Changes")(content)(plugins) +@main(rootAccountName)("DnsChangesController")("DNS Changes")(content)(plugins) \ No newline at end of file diff --git a/modules/portal/public/lib/dns-change/dns-change.service.js b/modules/portal/public/lib/dns-change/dns-change.service.js index ae03b4b65..2bd8f1e13 100644 --- a/modules/portal/public/lib/dns-change/dns-change.service.js +++ b/modules/portal/public/lib/dns-change/dns-change.service.js @@ -33,12 +33,11 @@ return $http.post(url, data, {headers: utilityService.getCsrfHeader()}); }; - this.getBatchChanges = function (maxItems, startFrom, ignoreAccess, batchStatus, approvalStatus) { + this.getBatchChanges = function (maxItems, startFrom, ignoreAccess, approvalStatus) { var params = { "maxItems": maxItems, "startFrom": startFrom, "ignoreAccess": ignoreAccess, - "batchStatus": batchStatus, "approvalStatus": approvalStatus }; var url = utilityService.urlBuilder('/api/dnschanges', params); diff --git a/modules/portal/public/lib/dns-change/dns-changes.controller.js b/modules/portal/public/lib/dns-change/dns-changes.controller.js index c60ea4b1e..cae704347 100644 --- a/modules/portal/public/lib/dns-change/dns-changes.controller.js +++ b/modules/portal/public/lib/dns-change/dns-changes.controller.js @@ -20,7 +20,6 @@ angular.module('dns-change') .controller('DnsChangesController', function($scope, $timeout, dnsChangeService, pagingService, utilityService){ $scope.batchChanges = []; - $scope.batchChangeStatuses = ["Cancelled", "Complete", "Failed", "PartialFailure", "PendingProcessing", "PendingReview", "Rejected", "Scheduled"] $scope.currentBatchChange; // Set default params: empty start from and 100 max items @@ -32,7 +31,7 @@ } return dnsChangeService - .getBatchChanges(maxItems, startFrom, $scope.ignoreAccess, $scope.batchStatus, $scope.approvalStatus) + .getBatchChanges(maxItems, startFrom, $scope.ignoreAccess, $scope.approvalStatus) .then(success) .catch(function(error) { handleError(error, 'dnsChangesService::getBatchChanges-failure'); @@ -56,7 +55,7 @@ } return dnsChangeService - .getBatchChanges(batchChangePaging.maxItems, undefined, $scope.ignoreAccess, $scope.batchStatus, $scope.approvalStatus) + .getBatchChanges(batchChangePaging.maxItems, undefined, $scope.ignoreAccess, $scope.approvalStatus) .then(success) .catch(function (error){ handleError(error, 'dnsChangesService::getBatchChanges-failure'); @@ -81,7 +80,7 @@ $scope.prevPage = function() { var startFrom = pagingService.getPrevStartFrom(batchChangePaging); return $scope - .getBatchChanges(batchChangePaging.maxItems, startFrom, $scope.ignoreAccess, $scope.batchStatus, $scope.approvalStatus) + .getBatchChanges(batchChangePaging.maxItems, startFrom, $scope.ignoreAccess, $scope.approvalStatus) .then(function(response) { batchChangePaging = pagingService.prevPageUpdate(response.data.nextId, batchChangePaging); $scope.batchChanges = response.data.batchChanges; @@ -93,7 +92,7 @@ $scope.nextPage = function() { return $scope - .getBatchChanges(batchChangePaging.maxItems, batchChangePaging.next, $scope.ignoreAccess, $scope.batchStatus, $scope.approvalStatus) + .getBatchChanges(batchChangePaging.maxItems, batchChangePaging.next, $scope.ignoreAccess, $scope.approvalStatus) .then(function(response) { var batchChanges = response.data.batchChanges; batchChangePaging = pagingService.nextPageUpdate(batchChanges, response.data.nextId, batchChangePaging); From 2091f0dff234d178624259f63489517d51ed264d Mon Sep 17 00:00:00 2001 From: Aravindh-Raju Date: Tue, 13 Feb 2024 11:45:36 +0530 Subject: [PATCH 4/7] temporarily reomve css --- modules/portal/public/css/vinyldns.css | 28 -------------------------- 1 file changed, 28 deletions(-) diff --git a/modules/portal/public/css/vinyldns.css b/modules/portal/public/css/vinyldns.css index 04b63a817..097c30a77 100644 --- a/modules/portal/public/css/vinyldns.css +++ b/modules/portal/public/css/vinyldns.css @@ -590,31 +590,3 @@ input[type="file"] { .flex-1{ flex: 1; } - -.filter-margin { - margin: 5px; -} - -.dropdown-bottom-margin { - margin-bottom: 5px; -} - -.no-margin { - margin: 0px; -} - -.dt-filter { - width: 400px; -} - -.dt-select-box { - top: 318.883px !important; - left: 1275.34px !important; - right: auto !important; - margin-top: 60px !important; - z-index: 9999 !important; -} - -.float-right { - float: right; -} From 97b5599bef221967d46410f3ae5c9de8d72323a6 Mon Sep 17 00:00:00 2001 From: Aravindh-Raju Date: Tue, 13 Feb 2024 11:46:31 +0530 Subject: [PATCH 5/7] fix format --- .../views/dnsChanges/dnsChanges.scala.html | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/modules/portal/app/views/dnsChanges/dnsChanges.scala.html b/modules/portal/app/views/dnsChanges/dnsChanges.scala.html index ba4745869..80d3b6acf 100644 --- a/modules/portal/app/views/dnsChanges/dnsChanges.scala.html +++ b/modules/portal/app/views/dnsChanges/dnsChanges.scala.html @@ -44,15 +44,15 @@ New DNS Change
@if(meta.manualBatchChangeReviewEnabled){ -
-
-
- -
-
-
+
+
+
+ +
+
+
}
@@ -156,4 +156,4 @@ @plugins = {} -@main(rootAccountName)("DnsChangesController")("DNS Changes")(content)(plugins) \ No newline at end of file +@main(rootAccountName)("DnsChangesController")("DNS Changes")(content)(plugins) From 0d7ceaf3cdfba4476d72293799ab3785e4a936b2 Mon Sep 17 00:00:00 2001 From: Aravindh-Raju Date: Tue, 13 Feb 2024 11:52:06 +0530 Subject: [PATCH 6/7] fix version --- .../migration/{V3.31__BatchStatus.sql => V3.32__BatchStatus.sql} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename modules/mysql/src/main/resources/db/migration/{V3.31__BatchStatus.sql => V3.32__BatchStatus.sql} (100%) diff --git a/modules/mysql/src/main/resources/db/migration/V3.31__BatchStatus.sql b/modules/mysql/src/main/resources/db/migration/V3.32__BatchStatus.sql similarity index 100% rename from modules/mysql/src/main/resources/db/migration/V3.31__BatchStatus.sql rename to modules/mysql/src/main/resources/db/migration/V3.32__BatchStatus.sql From dcd4e9fe06ca249ab64a80d268aef899365f297d Mon Sep 17 00:00:00 2001 From: Aravindh-Raju Date: Mon, 30 Sep 2024 10:37:32 +0530 Subject: [PATCH 7/7] balance parranthesis --- .../src/main/scala/vinyldns/api/route/BatchChangeRouting.scala | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/modules/api/src/main/scala/vinyldns/api/route/BatchChangeRouting.scala b/modules/api/src/main/scala/vinyldns/api/route/BatchChangeRouting.scala index 5da37f81f..e9208bcbe 100644 --- a/modules/api/src/main/scala/vinyldns/api/route/BatchChangeRouting.scala +++ b/modules/api/src/main/scala/vinyldns/api/route/BatchChangeRouting.scala @@ -118,8 +118,7 @@ class BatchChangeRoute( } } } - } - } ~ + } ~ path("zones" / "batchrecordchanges" / Segment) { id => (get & monitor("Endpoint.getBatchChange")) { authenticateAndExecute(batchChangeService.getBatchChange(id, _)) { chg =>