Commit 9d60bb96 authored by NISUM's avatar NISUM

Refactored Domain controller

parent b6f5ec3d
......@@ -8,6 +8,8 @@ public interface DomainRepo extends MongoRepository<Domain, String> {
List<Domain> findByDomainNameAndAccountId(String domianName,String accountId);
List<Domain> findByDomainIdAndAccountId(String domianId,String accountId);
List<Domain> findByAccountId(String accountId);
Domain findByDomainId(String domainId);
......
......@@ -54,7 +54,7 @@ public class DomainService implements IDomainService {
public boolean isDomainExists(Domain domainReq) {
boolean isDomainExists = false;
int count = 0;
List<Domain> domainListByName = domainRepo.findByDomainNameAndAccountId(domainReq.getDomainName(),
List<Domain> domainListByName = domainRepo.findByDomainIdAndAccountId(domainReq.getDomainId(),
domainReq.getAccountId());
List<Domain> domainListbyAccountId = domainRepo.findByAccountId(domainReq.getAccountId());
......
......@@ -85,7 +85,7 @@ myApp.controller("domainController",
{
method : "GET",
url : appConfig.appUri
+ "/projectTeam/getEmployeesToTeam"
+ "/employees/active/sortByName"
})
.then(
function mySuccess(response) {
......@@ -121,7 +121,7 @@ myApp.controller("domainController",
$scope.gridOptions.enablePaginationControls = false;
}
$scope.gridOptions.data = response.data;
$scope.gridOptions.data = response.data.records;
},
function myError(response) {
showAlert("Something went wrong while fetching data!!!");
......@@ -240,10 +240,10 @@ myApp.controller("domainController",
var allAccounts = myFactory.getAccounts();
function getActiveAccounts(){
var activeAccounts = [];
for (var i in allAccounts){
console.log(allAccounts[i]);
if(allAccounts[i].status == "Active" || allAccounts[i].status == "Y"){
activeAccounts.push(allAccounts[i]);
for (var i in allAccounts.records){
console.log(allAccounts.records[i]);
if(allAccounts.records[i].status == "Active" || allAccounts.records[i].status == "Y"){
activeAccounts.push(allAccounts.records[i]);
}
}
return activeAccounts;
......@@ -383,11 +383,11 @@ myApp.controller("domainController",
}
function updatingGridBasedOnStatus(status, response,result) {
if (response == "Domain saved successfully") {
if (response.message == "Domain has been created") {
updateGrid("Add", result);
} else if (response == "Domain updated successfully") {
} else if (response.message == "Domain has been updated") {
updateGrid("Update", result);
} else if (response == "Domain already exists") {
} else if (response.message == "Domain already existed") {
$scope.alertMsg = "Domain already exist,Please enter new matching";
}
......
......@@ -81,6 +81,7 @@ i.fa.fa-refresh:hover {
color: #34495e;
font-size: 22px;
margin: 14px 0 0 40px;
display: none; /* Need to enable once we check the functionality */
}
#header .dropdown-toggle {
padding: 12px;
......@@ -234,7 +235,7 @@ i.fa.fa-refresh:hover {
/* ===== Main Container ===== */
.main-container {
display: flex;
height: calc(100% - 105px);
/* height: calc(100% - 105px); need to test and enable*/
overflow: hidden;
}
/* .main-container #sidebar-left, .main-container #main {
......@@ -331,6 +332,7 @@ i.fa.fa-refresh:hover {
line-height: 50px;
}
#footer .footer p {
font-size: 13px;
margin: 0;
}
#footer .footer .img {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment