-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added tests to verify the behavior of the scaffold generator for rela…
…ted entities.
- Loading branch information
1 parent
8037e79
commit a7a4809
Showing
60 changed files
with
17,426 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
50 changes: 50 additions & 0 deletions
50
src/test/resources/scenario-outputs/many-to-many/index.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
<!doctype html> | ||
<html lang="en" ng-app="test"> | ||
<head> | ||
<meta charset="UTF-8"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | ||
<title>Test</title> | ||
<link href="styles/bootstrap.css" rel="stylesheet" media="screen"> | ||
<link href="styles/main.css" rel="stylesheet" media="screen"> | ||
<link href="styles/bootstrap-responsive.css" rel="stylesheet" media="screen"> | ||
</head> | ||
<body> | ||
<div class="navbar navbar-inverse navbar-fixed-top"> | ||
<div class="navbar-inner"> | ||
<div class="container"> | ||
<a class="brand" href="#">Test</a> | ||
</div> | ||
</div> | ||
</div> | ||
<div class="container-fluid"> | ||
<div class="row-fluid"> | ||
<div class="span3"> | ||
<img src="images/forge-logo.png" alt="JBoss Forge"></img> | ||
<nav class="well sidebar-nav" ng-controller="NavController"> | ||
<ul id="sidebar-entries" class="nav nav-list"> | ||
<li ng-class="{active: matchesRoute('GroupIdentitys')}"><a href="#/GroupIdentitys">GroupIdentitys</a></li> | ||
<li ng-class="{active: matchesRoute('UserIdentitys')}"><a href="#/UserIdentitys">UserIdentitys</a></li> | ||
</ul> | ||
</nav> | ||
</div> | ||
<div class="span9"> | ||
<div id="main" class="well" ng-view> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
<script src="scripts/vendor/angular.js"></script> | ||
<script src="scripts/vendor/angular-resource.js"></script> | ||
<script src="scripts/app.js"></script> | ||
<script src="scripts/filters/startFromFilter.js"></script> | ||
<script src="scripts/services/locationParser.js"></script> | ||
<script src="scripts/services/GroupIdentityFactory.js"></script> | ||
<script src="scripts/controllers/newGroupIdentityController.js"></script> | ||
<script src="scripts/controllers/searchGroupIdentityController.js"></script> | ||
<script src="scripts/controllers/editGroupIdentityController.js"></script> | ||
<script src="scripts/services/UserIdentityFactory.js"></script> | ||
<script src="scripts/controllers/newUserIdentityController.js"></script> | ||
<script src="scripts/controllers/searchUserIdentityController.js"></script> | ||
<script src="scripts/controllers/editUserIdentityController.js"></script> | ||
</body> | ||
</html> |
20 changes: 20 additions & 0 deletions
20
src/test/resources/scenario-outputs/many-to-many/scripts/app.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
'use strict'; | ||
|
||
angular.module('test',['ngResource']) | ||
.config(['$routeProvider', function($routeProvider) { | ||
$routeProvider | ||
.when('/GroupIdentitys',{templateUrl:'views/GroupIdentity/search.html',controller:'SearchGroupIdentityController'}) | ||
.when('/GroupIdentitys/new',{templateUrl:'views/GroupIdentity/detail.html',controller:'NewGroupIdentityController'}) | ||
.when('/GroupIdentitys/edit/:GroupIdentityId',{templateUrl:'views/GroupIdentity/detail.html',controller:'EditGroupIdentityController'}) | ||
.when('/UserIdentitys',{templateUrl:'views/UserIdentity/search.html',controller:'SearchUserIdentityController'}) | ||
.when('/UserIdentitys/new',{templateUrl:'views/UserIdentity/detail.html',controller:'NewUserIdentityController'}) | ||
.when('/UserIdentitys/edit/:UserIdentityId',{templateUrl:'views/UserIdentity/detail.html',controller:'EditUserIdentityController'}) | ||
.otherwise({ | ||
redirectTo: '/' | ||
}); | ||
}]) | ||
.controller('NavController', function NavController($scope, $location) { | ||
$scope.matchesRoute = function(route) { | ||
return ($location.path().indexOf(route) != -1); | ||
}; | ||
}); |
69 changes: 69 additions & 0 deletions
69
...esources/scenario-outputs/many-to-many/scripts/controllers/editGroupIdentityController.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
|
||
|
||
angular.module('test').controller('EditGroupIdentityController', function($scope, $routeParams, $location, GroupIdentityResource , UserIdentityResource) { | ||
var self = this; | ||
$scope.disabled = false; | ||
|
||
$scope.get = function() { | ||
var successCallback = function(data){ | ||
self.original = data; | ||
$scope.groupIdentity = new GroupIdentityResource(self.original); | ||
UserIdentityResource.queryAll(function(data) { | ||
$scope.usersList = data; | ||
angular.forEach($scope.usersList, function(datum){ | ||
angular.forEach($scope.groupIdentity.users, function(nestedDatum,index){ | ||
if(angular.equals(datum,nestedDatum)) { | ||
$scope.groupIdentity.users[index] = datum; | ||
self.original.users[index] = datum; | ||
} | ||
}); | ||
}); | ||
}); | ||
}; | ||
var errorCallback = function() { | ||
$location.path("/GroupIdentitys"); | ||
}; | ||
GroupIdentityResource.get({GroupIdentityId:$routeParams.GroupIdentityId}, successCallback, errorCallback); | ||
}; | ||
|
||
$scope.isClean = function() { | ||
return angular.equals(self.original, $scope.groupIdentity); | ||
}; | ||
|
||
$scope.save = function() { | ||
var successCallback = function(){ | ||
$scope.get(); | ||
$scope.displayError = false; | ||
}; | ||
var errorCallback = function() { | ||
$scope.displayError=true; | ||
}; | ||
$scope.groupIdentity.$update(successCallback, errorCallback); | ||
}; | ||
|
||
$scope.cancel = function() { | ||
$location.path("/GroupIdentitys"); | ||
}; | ||
|
||
$scope.remove = function() { | ||
var successCallback = function() { | ||
$location.path("/GroupIdentitys"); | ||
$scope.displayError = false; | ||
}; | ||
var errorCallback = function() { | ||
$scope.displayError=true; | ||
}; | ||
$scope.groupIdentity.$remove(successCallback, errorCallback); | ||
}; | ||
|
||
$scope.removeusers = function(index) { | ||
$scope.groupIdentity.users.splice(index, 1); | ||
}; | ||
|
||
$scope.addusers = function() { | ||
$scope.groupIdentity.users = $scope.groupIdentity.users || []; | ||
$scope.groupIdentity.users.push(new UserIdentityResource()); | ||
}; | ||
|
||
$scope.get(); | ||
}); |
Oops, something went wrong.