Commit 9d60bb96 authored by NISUM's avatar NISUM

Refactored Domain controller

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