Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Integration of Webpack in the build process #47

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 16 additions & 9 deletions web-frontend/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,22 @@
<script src="bower_components/angular-google-maps/dist/angular-google-maps.min.js"></script>
<script src="bower_components/satellizer/satellizer.min.js"></script>
<script src="bower_components/angular-smart-table/dist/smart-table.min.js"></script>
<script src="js/app.js"></script>
<script src="js/api.js"></script>
<script src="js/authProvider.js"></script>
<script src="js/geocoderService.js"></script>
<script src="js/routeProvider.js"></script>
<script src="js/translateProvider.js"></script>
<script src="js/controllers/RegisterController.js"></script>
<script src="js/controllers/NavigationController.js"></script>
<script src="js/controllers/VolunteerListController.js"></script>
<script src="src/index.js"></script>
<script src="src/api.js"></script>
<script src="src/components/authentication/index.js"></script>
<script src="src/components/authentication/authProvider.js"></script>
<script src="src/components/geocoder/geocoderService.js"></script>
<script src="src/routeProvider.js"></script>
<script src="src/translateProvider.js"></script>
<script src="src/register/index.js"></script>
<script src="src/register/register-config.js"></script>
<script src="src/register/register-controller.js"></script>
<script src="src/navigation/navigation-config.js"></script>
<script src="src/navigation/navigation-controller.js"></script>
<script src="src/organisation/index.js"></script>
<script src="src/organisation/volunteerList/index.js"></script>
<script src="src/organisation/volunteerList/volunteerList-config.js"></script>
<script src="src/organisation/volunteerList/volunteerList-controller.js"></script>
<link rel="stylesheet" href="bower_components/bootstrap/dist/css/bootstrap.min.css"/>
<link rel="stylesheet" href="bower_components/bootstrap-social/bootstrap-social.css"/>
<link rel="stylesheet" href="bower_components/font-awesome/css/font-awesome.min.css"/>
Expand Down
94 changes: 0 additions & 94 deletions web-frontend/js/controllers/RegisterController.js

This file was deleted.

20 changes: 0 additions & 20 deletions web-frontend/js/controllers/VolunteerListController.js

This file was deleted.

61 changes: 0 additions & 61 deletions web-frontend/js/routeProvider.js

This file was deleted.

12 changes: 0 additions & 12 deletions web-frontend/partials/list.html

This file was deleted.

File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
angular.module('Come2HelpApp').config(['$authProvider', function ($authProvider) {
angular.module('authentication').config(['$authProvider', function ($authProvider) {

$authProvider.signupUrl = '/api/volunteers';
$authProvider.loginUrl = '/api/login/volunteer';
Expand All @@ -14,7 +14,7 @@ angular.module('Come2HelpApp').config(['$authProvider', function ($authProvider)
});
}]);

angular.module('Come2HelpApp')
angular.module('authentication')
.constant('roles', {
USER: 'ROLE_USER',
GUEST: 'ROLE_GUEST',
Expand All @@ -23,7 +23,7 @@ angular.module('Come2HelpApp')
C2H_ADMIN: 'ROLE_C2H_ADMIN'
});

angular.module('Come2HelpApp').provider('authService', [function () {
angular.module('authentication').provider('authService', [function () {
var tokenObservers = [];

this.setToken = function (token) {
Expand All @@ -43,7 +43,7 @@ angular.module('Come2HelpApp').provider('authService', [function () {

}]);

angular.module('Come2HelpApp').service('jwtService', ['authService', '$window', '$auth', 'roles', '$route', function (authService, $window, $auth, roles, $route) {
angular.module('authentication').service('jwtService', ['authService', '$window', '$auth', 'roles', '$route', function (authService, $window, $auth, roles, $route) {
var jwt = null;

this.isAuthenticated = function() {
Expand Down Expand Up @@ -88,7 +88,7 @@ angular.module('Come2HelpApp').service('jwtService', ['authService', '$window',
authService.addTokenObserver(this.parseJWT);
}]);

angular.module('Come2HelpApp').config(['$httpProvider', 'authServiceProvider', function ($httpProvider, authServiceProvider) {
angular.module('authentication').config(['$httpProvider', 'authServiceProvider', function ($httpProvider, authServiceProvider) {
$httpProvider.interceptors.push(function ($q) {
return {
response: function (config) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
angular.module('Come2HelpApp')
angular.module('authentication')
.factory('authentication', ['$route', '$auth', function($route, $auth) {

function login(email, password) {
Expand Down
1 change: 1 addition & 0 deletions web-frontend/src/components/authentication/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
angular.module('authentication', []);
7 changes: 6 additions & 1 deletion web-frontend/js/app.js → web-frontend/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,12 @@ angular.module('Come2HelpApp', [
'uiGmapgoogle-maps',
'pascalprecht.translate',
'satellizer',
'smart-table'
'smart-table',
// come2help modules
'authentication',
'navigation',
'register',
'organisation'
]);

angular.module('Come2HelpController', ['ngResource']);
Empty file.
1 change: 1 addition & 0 deletions web-frontend/src/navigation/navigation-config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
angular.module('navigation', []);
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
angular.module('Come2HelpApp')
.controller('NavigationController', ['jwtService', '$location', function(jwtService, $location) {
var navigationModule = angular.module('navigation');

function NavigationController(jwtService, $location) {
var vm = this;

vm.authenticated = jwtService.isAuthenticated.bind(jwtService);
Expand All @@ -11,7 +12,9 @@ angular.module('Come2HelpApp')
if ($location.path().substr(0, path.length) === path) {
return 'active';
} else {
return '';
}
};
}]);
return '';
}
};
}

navigationModule.controller('NavigationController', ['jwtService', '$location', NavigationController]);
1 change: 1 addition & 0 deletions web-frontend/src/organisation/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
angular.module('organisation', ['organisation.volunteerList']);
1 change: 1 addition & 0 deletions web-frontend/src/organisation/volunteerList/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
angular.module('organisation.volunteerList', []);
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
angular.module('organisation.volunteerList').config(['$routeProvider', function ($routeProvider) {

$routeProvider.
when('/organisation/volunteerList', {
templateUrl: 'src/organisation/volunteerList/volunteerList.html',
controller: 'VolunteerListController',
controllerAs: 'ctrl',
//resolve: {
// loginRequired: loginRequired,
// organisationAdminRequired: organisationAdminRequired
//}
}).
when('/imprint', {
templateUrl: 'src/imprint/imprint.html'
}).
otherwise('/register');

// TODO: Move to authentication module
function organisationAdminRequired($q, $location, jwtService) {
var deferred = $q.defer();
if (jwtService.isOrganisation()) {
deferred.resolve();
} else {
$location.path('/');
}
return deferred.promise;
};
}]);
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
function VolunteerListController(Volunteers, geocoder) {
var vm = this;

vm.volunteers = [];

vm.search = function () {
geocoder.geocode('Germany, ' + vm.zipCode, function (results) {
var latitude = results.results[0].geometry.location.lat();
var longitude = results.results[0].geometry.location.lng();

Volunteers.query({
latitude: latitude,
longitude: longitude,
distance: vm.distance * 1000
}, function (data) {
vm.volunteers = data;
});
});
};
}

angular.module('organisation.volunteerList').controller('VolunteerListController', ['Volunteers', 'geocoder', VolunteerListController]);
1 change: 1 addition & 0 deletions web-frontend/src/register/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
angular.module('register', []);
Loading