diff --git a/modules/portal/app/views/zones/zoneDetail.scala.html b/modules/portal/app/views/zones/zoneDetail.scala.html
index e35699ba2..5683651cc 100644
--- a/modules/portal/app/views/zones/zoneDetail.scala.html
+++ b/modules/portal/app/views/zones/zoneDetail.scala.html
@@ -30,6 +30,17 @@
+
+
+
Zone ID: {{zoneInfo.id}}
+
+ Copy
+
+
+
+
+
diff --git a/modules/portal/public/css/vinyldns.css b/modules/portal/public/css/vinyldns.css
index 7085d6e5e..65797bc38 100644
--- a/modules/portal/public/css/vinyldns.css
+++ b/modules/portal/public/css/vinyldns.css
@@ -288,6 +288,7 @@ body {
.page-title {
padding: 10px 20px 0;
+ height: 100%;
}
.page-content-wrap {
@@ -632,3 +633,42 @@ input[type="file"] {
display: flex;
flex-direction: column;
}
+
+.copy-button {
+ display: inline-flex;
+ align-items: center;
+ padding: 2px 6px;
+ border: 1px solid #d1d5da;
+ background-color: #f6f8fa;
+ border-radius: 4px;
+ cursor: pointer;
+ font-size: 12px;
+ color: #24292e;
+ margin-left: 8px;
+ transition: background-color 0.3s ease;
+}
+
+.copy-button:hover {
+ background-color: #e1e4e8;
+}
+
+.copy-button i {
+ margin-right: 4px;
+ font-size: 12px;
+}
+
+.small-copy-button {
+ font-size: 12px;
+ padding: 2px 6px;
+ display: inline-block;
+ cursor: pointer;
+}
+
+.small-copy-button i {
+ font-size: 12px;
+}
+
+.small-copy-button:hover {
+ background-color: #f0f0f0;
+ border-radius: 4px;
+}
diff --git a/modules/portal/public/lib/controllers/controller.membership.js b/modules/portal/public/lib/controllers/controller.membership.js
index 9c71adbda..d974ca4ad 100644
--- a/modules/portal/public/lib/controllers/controller.membership.js
+++ b/modules/portal/public/lib/controllers/controller.membership.js
@@ -41,6 +41,19 @@ angular.module('controller.membership', []).controller('MembershipController', f
return $sce.trustAsHtml(message);
};
+ // Initialize Bootstrap tooltips
+ $(document).ready(function() {
+ $('[data-toggle="tooltip"]').tooltip();
+ });
+
+ // Function to copy the ID to clipboard
+ $scope.copyToClipboard = function() {
+ utilityService.copyToClipboard($scope.membership.group.id);
+ // Trigger success alert using utilityService
+ var alert = utilityService.success('Successfully copied group id to clipboard');
+ $scope.alerts.push(alert);
+ };
+
// paging status for group changes
var changePaging = pagingService.getNewPagingParams(100);
diff --git a/modules/portal/public/lib/controllers/controller.records.js b/modules/portal/public/lib/controllers/controller.records.js
index 9b2c3121a..6cf94575f 100644
--- a/modules/portal/public/lib/controllers/controller.records.js
+++ b/modules/portal/public/lib/controllers/controller.records.js
@@ -99,6 +99,19 @@ angular.module('controller.records', [])
// paging status for record changes
var changePaging = pagingService.getNewPagingParams(100);
+ // Initialize Bootstrap tooltips
+ $(document).ready(function() {
+ $('[data-toggle="tooltip"]').tooltip();
+ });
+
+ // Function to copy the ID to clipboard
+ $scope.copyToClipboard = function() {
+ utilityService.copyToClipboard($scope.zoneInfo.id);
+ // Trigger success alert using utilityService
+ var alert = utilityService.success('Successfully copied zone id to clipboard');
+ $scope.alerts.push(alert);
+ };
+
/**
* Modal control functions
*/
diff --git a/modules/portal/public/lib/dns-change/dns-change-detail.controller.js b/modules/portal/public/lib/dns-change/dns-change-detail.controller.js
index 7c2d5cf5f..8affcb956 100644
--- a/modules/portal/public/lib/dns-change/dns-change-detail.controller.js
+++ b/modules/portal/public/lib/dns-change/dns-change-detail.controller.js
@@ -26,6 +26,19 @@
$scope.reviewConfirmationMsg;
$scope.reviewType;
+ // Initialize Bootstrap tooltips
+ $(document).ready(function() {
+ $('[data-toggle="tooltip"]').tooltip();
+ });
+
+ // Function to copy the ID to clipboard
+ $scope.copyToClipboard = function() {
+ utilityService.copyToClipboard($scope.batch.id);
+ // Trigger success alert using utilityService
+ var alert = utilityService.success('Successfully copied batch id to clipboard');
+ $scope.alerts.push(alert);
+ };
+
$scope.getBatchChange = function(batchChangeId) {
function success(response) {
$scope.batch = response.data;
diff --git a/modules/portal/public/lib/dns-change/dns-change-new.controller.js b/modules/portal/public/lib/dns-change/dns-change-new.controller.js
index 051b051f3..2cb5013fb 100644
--- a/modules/portal/public/lib/dns-change/dns-change-new.controller.js
+++ b/modules/portal/public/lib/dns-change/dns-change-new.controller.js
@@ -44,6 +44,11 @@
$scope.manualReviewEnabled;
$scope.naptrFlags = ["U", "S", "A", "P"];
+ // Initialize Bootstrap tooltips
+ $(document).ready(function() {
+ $('[data-toggle="tooltip"]').tooltip();
+ });
+
$scope.addSingleChange = function() {
$scope.newBatch.changes.push({changeType: "Add", type: "A+PTR"});
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 b9e046fa2..af121ac58 100644
--- a/modules/portal/public/lib/dns-change/dns-changes.controller.js
+++ b/modules/portal/public/lib/dns-change/dns-changes.controller.js
@@ -50,6 +50,19 @@
$scope.alerts.push(alert);
}
+ // Initialize tooltips after the view has rendered
+ $timeout(function() {
+ $('[data-toggle="tooltip"]').tooltip();
+ }, 0);
+
+ // Function to copy the ID to clipboard
+ $scope.copyToClipboard = function(copyText) {
+ utilityService.copyToClipboard(copyText);
+ // Trigger success alert using utilityService
+ var alert = utilityService.success('Successfully copied batch id to clipboard');
+ $scope.alerts.push(alert);
+ };
+
$scope.refreshBatchChanges = function() {
batchChangePaging = pagingService.resetPaging(batchChangePaging);
diff --git a/modules/portal/public/lib/recordset/recordsets.controller.js b/modules/portal/public/lib/recordset/recordsets.controller.js
index 2fac5cd5a..d1071ebee 100644
--- a/modules/portal/public/lib/recordset/recordsets.controller.js
+++ b/modules/portal/public/lib/recordset/recordsets.controller.js
@@ -80,6 +80,11 @@
var recordType = [];
var recordName = [];
+ // Initialize Bootstrap tooltips
+ $(document).ready(function() {
+ $('[data-toggle="tooltip"]').tooltip();
+ });
+
$( "#record-search-text" ).autocomplete({
source: function( request, response ) {
$.ajax({
diff --git a/modules/portal/public/lib/services/utility/service.utility.js b/modules/portal/public/lib/services/utility/service.utility.js
index 5fb97ebaa..0bd6d23ef 100644
--- a/modules/portal/public/lib/services/utility/service.utility.js
+++ b/modules/portal/public/lib/services/utility/service.utility.js
@@ -46,13 +46,39 @@ angular.module('service.utility', [])
};
this.success = function(message, response, type) {
- var msg = "HTTP " + response.status + " (" + response.statusText + "): " + message;
- $log.debug(type, response);
- return {
- type: "success", content: msg
- };
+ if (response && type) {
+ var msg = "HTTP " + response.status + " (" + response.statusText + "): " + message;
+ $log.debug(type, response);
+ return {
+ type: "success",
+ content: msg
+ };
+ } else {
+ return {
+ type: "success",
+ content: message
+ };
+ }
};
+ // Function to copy the ID to clipboard
+ this.copyToClipboard = function(id) {
+ // Create a temporary input element to hold the ID
+ var tempInput = document.createElement("input");
+ tempInput.style.position = "absolute";
+ tempInput.style.left = "-9999px";
+ tempInput.value = id;
+ document.body.appendChild(tempInput);
+
+ // Select the input value and copy it
+ tempInput.select();
+ document.execCommand("copy");
+
+ // Remove the temporary input
+ document.body.removeChild(tempInput);
+ };
+
+
this.urlBuilder = function (url, obj) {
var result = [];
for (var property in obj) {