mirror of
https://github.com/VinylDNS/vinyldns
synced 2025-09-01 14:55:22 +00:00
Email Domains Dropdown for groups
This commit is contained in:
@@ -293,6 +293,15 @@ class VinylDNS @Inject() (
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
def getValidEmailDomains(): Action[AnyContent] = userAction.async { implicit request =>
|
||||||
|
val vinyldnsRequest =
|
||||||
|
VinylDNSRequest("GET", s"$vinyldnsServiceBackend", s"groups/valid/domains")
|
||||||
|
executeRequest(vinyldnsRequest, request.user).map(response => {
|
||||||
|
Status(response.status)(response.body)
|
||||||
|
.withHeaders(cacheHeaders: _*)
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
def getAuthenticatedUserData(): Action[AnyContent] = userAction.async { implicit request =>
|
def getAuthenticatedUserData(): Action[AnyContent] = userAction.async { implicit request =>
|
||||||
Future {
|
Future {
|
||||||
Ok(Json.toJson(VinylDNS.UserInfo.fromUser(request.user)))
|
Ok(Json.toJson(VinylDNS.UserInfo.fromUser(request.user)))
|
||||||
|
@@ -281,6 +281,24 @@
|
|||||||
type="text"
|
type="text"
|
||||||
required>
|
required>
|
||||||
</input>
|
</input>
|
||||||
|
<div>
|
||||||
|
<h5>
|
||||||
|
<a data-toggle="collapse" data-target="#collapseNewGroupInstruction" aria-expanded="false" aria-controls="collapseInstruction">
|
||||||
|
<span class="badge">Valid Domains for Email <span class="fa fa-chevron-down"></span></span>
|
||||||
|
</a>
|
||||||
|
</h5>
|
||||||
|
</div>
|
||||||
|
<div class="collapse" id="collapseNewGroupInstruction">
|
||||||
|
<div class="well">
|
||||||
|
<p>
|
||||||
|
<strong>List Of Valid Email Domains:</strong>
|
||||||
|
<li ng-repeat="validDomains in validEmailDomains">
|
||||||
|
<strong>{{validDomains}} </strong>
|
||||||
|
</li>
|
||||||
|
</p>
|
||||||
|
<hr/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
<span class="help-block">The email distribution list for the group.</span>
|
<span class="help-block">The email distribution list for the group.</span>
|
||||||
</modal-element>
|
</modal-element>
|
||||||
<modal-element label="Description">
|
<modal-element label="Description">
|
||||||
@@ -297,9 +315,12 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="modal-footer">
|
<div class="modal-footer">
|
||||||
<button id="clear-group-button" type="button" class="btn btn-default pull-left" ng-click="reset()">Clear Form</button>
|
<button id="clear-group-button" type="button" class="btn btn-default pull-left" ng-click="reset()"
|
||||||
<button id="create-group-button" class="btn btn-primary pull-right">Create</button>
|
data-toggle="collapse" data-target="#collapseNewGroupInstruction">Clear Form</button>
|
||||||
<button type="button" class="btn btn-default" ng-click="closeModal($evt);">Close</button>
|
<button id="create-group-button" class="btn btn-primary pull-right"
|
||||||
|
data-toggle="collapse" data-target="#collapseNewGroupInstruction">Create</button>
|
||||||
|
<button type="button" class="btn btn-default" ng-click="closeModal($evt);"
|
||||||
|
data-toggle="collapse" data-target="#collapseNewGroupInstruction">Close</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
@@ -343,6 +364,24 @@
|
|||||||
type="text"
|
type="text"
|
||||||
required>
|
required>
|
||||||
</input>
|
</input>
|
||||||
|
<div>
|
||||||
|
<h5>
|
||||||
|
<a data-toggle="collapse" data-target="#collapseEditGroupInstruction" aria-expanded="false" aria-controls="collapseInstruction">
|
||||||
|
<span class="badge">Valid Domains for Email <span class="fa fa-chevron-down"></span></span>
|
||||||
|
</a>
|
||||||
|
</h5>
|
||||||
|
</div>
|
||||||
|
<div class="collapse" id="collapseEditGroupInstruction">
|
||||||
|
<div class="well">
|
||||||
|
<p>
|
||||||
|
<strong>List Of Valid Email Domains:</strong>
|
||||||
|
<li ng-repeat="validDomains in validEmailDomains">
|
||||||
|
<strong>{{validDomains}} </strong>
|
||||||
|
</li>
|
||||||
|
</p>
|
||||||
|
<hr/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
<span class="help-block">The email distribution list for the group.</span>
|
<span class="help-block">The email distribution list for the group.</span>
|
||||||
</modal-element>
|
</modal-element>
|
||||||
<modal-element label="Description">
|
<modal-element label="Description">
|
||||||
@@ -360,8 +399,10 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="modal-footer">
|
<div class="modal-footer">
|
||||||
<button id="edit-group-button" class="btn btn-primary pull-right">Update</button>
|
<button id="edit-group-button" class="btn btn-primary pull-right"
|
||||||
<button type="button" class="btn btn-default" data-dismiss="modal" ng-click="closeEditModal()">Close</button>
|
data-toggle="collapse" data-target="#collapseEditGroupInstruction">Update</button>
|
||||||
|
<button type="button" class="btn btn-default" data-dismiss="modal" ng-click="closeEditModal()"
|
||||||
|
data-toggle="collapse" data-target="#collapseEditGroupInstruction">Close</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
|
@@ -45,6 +45,7 @@ GET /api/zones/:id/recordsetchanges @controllers.VinylDNS.listRecor
|
|||||||
|
|
||||||
GET /api/groups @controllers.VinylDNS.getGroups
|
GET /api/groups @controllers.VinylDNS.getGroups
|
||||||
GET /api/groups/:gid @controllers.VinylDNS.getGroup(gid: String)
|
GET /api/groups/:gid @controllers.VinylDNS.getGroup(gid: String)
|
||||||
|
GET /api/groups/valid/domains @controllers.VinylDNS.getValidEmailDomains
|
||||||
GET /api/groups/:gid/groupchanges @controllers.VinylDNS.listGroupChanges(gid: String)
|
GET /api/groups/:gid/groupchanges @controllers.VinylDNS.listGroupChanges(gid: String)
|
||||||
GET /api/groups/change/:gcid @controllers.VinylDNS.getGroupChange(gcid: String)
|
GET /api/groups/change/:gcid @controllers.VinylDNS.getGroupChange(gcid: String)
|
||||||
POST /api/groups @controllers.VinylDNS.newGroup
|
POST /api/groups @controllers.VinylDNS.newGroup
|
||||||
|
@@ -28,6 +28,7 @@ angular.module('controller.groups', []).controller('GroupsController', function
|
|||||||
$scope.ignoreAccess = false;
|
$scope.ignoreAccess = false;
|
||||||
$scope.hasGroups = false;
|
$scope.hasGroups = false;
|
||||||
$scope.query = "";
|
$scope.query = "";
|
||||||
|
$scope.validEmailDomains= [];
|
||||||
|
|
||||||
// Paging status for group sets
|
// Paging status for group sets
|
||||||
var groupsPaging = pagingService.getNewPagingParams(100);
|
var groupsPaging = pagingService.getNewPagingParams(100);
|
||||||
@@ -44,12 +45,15 @@ angular.module('controller.groups', []).controller('GroupsController', function
|
|||||||
var modalDialog;
|
var modalDialog;
|
||||||
|
|
||||||
$scope.openModal = function (evt) {
|
$scope.openModal = function (evt) {
|
||||||
|
$log.log('First entry');
|
||||||
$scope.currentGroup = {};
|
$scope.currentGroup = {};
|
||||||
|
$scope.validDomains();
|
||||||
void (evt && evt.preventDefault());
|
void (evt && evt.preventDefault());
|
||||||
if (!modalDialog) {
|
if (!modalDialog) {
|
||||||
modalDialog = angular.element('#modal_new_group').modal();
|
modalDialog = angular.element('#modal_new_group').modal();
|
||||||
}
|
}
|
||||||
modalDialog.modal('show');
|
modalDialog.modal('show');
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
$scope.closeModal = function (evt) {
|
$scope.closeModal = function (evt) {
|
||||||
@@ -69,7 +73,6 @@ angular.module('controller.groups', []).controller('GroupsController', function
|
|||||||
$scope.refresh();
|
$scope.refresh();
|
||||||
return true;
|
return true;
|
||||||
};
|
};
|
||||||
|
|
||||||
// Autocomplete for group search
|
// Autocomplete for group search
|
||||||
$("#group-search-text").autocomplete({
|
$("#group-search-text").autocomplete({
|
||||||
source: function( request, response ) {
|
source: function( request, response ) {
|
||||||
@@ -207,6 +210,21 @@ angular.module('controller.groups', []).controller('GroupsController', function
|
|||||||
handleError(error, 'groupsService::getGroups-failure');
|
handleError(error, 'groupsService::getGroups-failure');
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
$scope.validDomains=function getValidEmailDomains() {
|
||||||
|
$log.log('Function Entry');
|
||||||
|
function success(response) {
|
||||||
|
$log.log('groupsService::listEmailDomains-success');
|
||||||
|
return $scope.validEmailDomains = response.data;
|
||||||
|
}
|
||||||
|
|
||||||
|
return groupsService
|
||||||
|
.listEmailDomains($scope.ignoreAccess, $scope.query)
|
||||||
|
.then(success)
|
||||||
|
.catch(function (error) {
|
||||||
|
handleError(error, 'groupsService::listEmailDomains-failure');
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// Return true if there are no groups created by the user
|
// Return true if there are no groups created by the user
|
||||||
$scope.haveNoGroups = function (groupLength) {
|
$scope.haveNoGroups = function (groupLength) {
|
||||||
@@ -228,6 +246,7 @@ angular.module('controller.groups', []).controller('GroupsController', function
|
|||||||
|
|
||||||
$scope.editGroup = function (groupInfo) {
|
$scope.editGroup = function (groupInfo) {
|
||||||
$scope.currentGroup = groupInfo;
|
$scope.currentGroup = groupInfo;
|
||||||
|
$scope.validDomains();
|
||||||
$("#modal_edit_group").modal("show");
|
$("#modal_edit_group").modal("show");
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@@ -43,6 +43,10 @@ angular.module('service.groups', [])
|
|||||||
var url = '/api/groups/' + id;
|
var url = '/api/groups/' + id;
|
||||||
return $http.get(url);
|
return $http.get(url);
|
||||||
};
|
};
|
||||||
|
this.listEmailDomains = function () {
|
||||||
|
var url = '/api/groups/valid/domains'
|
||||||
|
return $http.get(url);
|
||||||
|
};
|
||||||
|
|
||||||
this.deleteGroups = function (id) {
|
this.deleteGroups = function (id) {
|
||||||
var url = '/api/groups/' + id;
|
var url = '/api/groups/' + id;
|
||||||
|
Reference in New Issue
Block a user