Commit 671ef0bc authored by D’jalmar Gutierrez Titirico's avatar D’jalmar Gutierrez Titirico 🚲

Merge branch 'baseProyecto' into 'desarrollo'

Base proyecto

@gcallejas @tnina Se añado la estructura principal del proyecto, asi tambien como modificaciones al README y cambios para la correcta conexión a la base de datos en el ambiente de desarrollo 

See merge request !1
parents 5869dff0 aee80252
{
"directory": "client/bower_components"
}
# EditorConfig helps developers define and maintain consistent
# coding styles between different editors and IDEs
# editorconfig.org
root = true
[*]
# Change these settings to your own preference
indent_style = space
indent_size = 2
# We recommend you to keep these unchanged
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
[*.md]
trim_trailing_whitespace = false
* text=auto
# These files are text and should be normalized (Convert crlf => lf)
*.php text
*.css text
*.js text
*.htm text
*.html text
*.xml text
*.txt text
*.ini text
*.inc text
.htaccess text
# Denote all files that are truly binary and should not be modified.
# (binary is a macro for -text -diff)
*.png binary
*.jpg binary
*.jpeg binary
*.gif binary
*.ico binary
*.mov binary
*.mp4 binary
*.mp3 binary
*.flv binary
*.fla binary
*.swf binary
*.gz binary
*.zip binary
*.7z binary
*.ttf binary
# Documents
*.doc diff=astextplain
*.DOC diff=astextplain
*.docx diff=astextplain
*.DOCX diff=astextplain
*.dot diff=astextplain
*.DOT diff=astextplain
*.pdf diff=astextplain
*.PDF diff=astextplain
*.rtf diff=astextplain
*.RTF diff=astextplain
node_modules
public
.tmp
.sass-cache
.idea
client/bower_components
dist
/server/config/local.env.js
npm-debug.log
coverage
{
"excludeFiles": [
"client/app/app.constant.js"
],
"esnext": true,
"maximumLineLength": {
"value": 100,
"allowComments": true,
"allowRegex": true
},
"disallowMixedSpacesAndTabs": true,
"disallowMultipleLineStrings": true,
"disallowNewlineBeforeBlockStatements": true,
"disallowSpaceAfterObjectKeys": true,
"disallowSpaceAfterPrefixUnaryOperators": ["++", "--", "+", "-", "~", "!"],
"disallowSpaceBeforeBinaryOperators": [","],
"disallowSpaceBeforePostfixUnaryOperators": ["++", "--"],
"disallowSpacesInAnonymousFunctionExpression": {
"beforeOpeningRoundBrace": true
},
"disallowSpacesInFunctionDeclaration": {
"beforeOpeningRoundBrace": true
},
"disallowSpacesInNamedFunctionExpression": {
"beforeOpeningRoundBrace": true
},
"disallowSpacesInsideArrayBrackets": true,
"disallowSpacesInsideParentheses": true,
"disallowTrailingComma": true,
"disallowTrailingWhitespace": true,
"requireCommaBeforeLineBreak": true,
"requireLineFeedAtFileEnd": true,
"requireSpaceAfterBinaryOperators": ["?", ":", "+", "-", "/", "*", "%", "==", "===", "!=", "!==", ">", ">=", "<", "<=", "&&", "||"],
"requireSpaceBeforeBinaryOperators": ["?", ":", "+", "-", "/", "*", "%", "==", "===", "!=", "!==", ">", ">=", "<", "<=", "&&", "||"],
"requireSpaceAfterKeywords": ["if", "else", "for", "while", "do", "switch", "return", "try", "catch"],
"requireSpaceBeforeBlockStatements": true,
"requireSpacesInConditionalExpression": {
"afterTest": true,
"beforeConsequent": true,
"afterConsequent": true,
"beforeAlternate": true
},
"requireSpacesInFunction": {
"beforeOpeningCurlyBrace": true
},
"validateLineBreaks": "LF",
"validateParameterSeparator": ", "
}
language: node_js
node_js:
- 4.2.3
matrix:
fast_finish: true
allow_failures:
- node_js: 5.1.1
before_script:
- npm install -g bower grunt-cli
- gem install sass
- bower install
services: mongodb
{
"generator-angular-fullstack": {
"generatorVersion": "3.3.0",
"endpointDirectory": "server/api/",
"insertRoutes": true,
"registerRoutesFile": "server/routes.js",
"routesNeedle": "// Insert routes below",
"routesBase": "/api/",
"pluralizeRoutes": true,
"insertSockets": true,
"registerSocketsFile": "server/config/socketio.js",
"socketsNeedle": "// Insert sockets below",
"insertModels": true,
"registerModelsFile": "server/sqldb/index.js",
"modelsNeedle": "// Insert models below",
"filters": {
"js": true,
"babel": true,
"html": true,
"sass": true,
"uirouter": true,
"bootstrap": true,
"uibootstrap": true,
"models": true,
"sequelizeModels": true,
"sequelize": true,
"grunt": true,
"mocha": true,
"jasmine": false,
"should": false,
"expect": true
}
},
"generator-ng-component": {
"routeDirectory": "client/app/",
"directiveDirectory": "client/app/",
"filterDirectory": "client/app/",
"serviceDirectory": "client/app/",
"basePath": "client",
"moduleName": "",
"filters": [
"uirouter",
"mocha",
"expect",
"uirouter"
],
"extensions": [
"babel",
"js",
"html",
"scss"
],
"directiveSimpleTemplates": "",
"directiveComplexTemplates": "",
"filterTemplates": "",
"serviceTemplates": "",
"factoryTemplates": "",
"controllerTemplates": "",
"decoratorTemplates": "",
"providerTemplates": "",
"routeTemplates": ""
}
}
\ No newline at end of file
This diff is collapsed.
Modulo de Personal del Sistema de Gestión Administrativa
========================================================
# modulo-personal
Desarrollar la inteterfaz (backend y frontend) para el modulo "Personal" del sistema de gestión de administrativa.
Este es el modulo de personal del sistema de gestion administrativa
Equipo de desarrollo
========================================================
## Desarrolladores
- D'jalmar
- David
- Gustavo
\ No newline at end of file
- Gustavo
### Prerequisitos
- [Git](https://git-scm.com/)
- [Node.js and npm](nodejs.org) Node ^4.2.3, npm ^2.14.7
- [Bower](bower.io) (`npm install --global bower`)
- [Ruby](https://www.ruby-lang.org) and then `gem install sass`
- [Grunt](http://gruntjs.com/) (`npm install --global grunt-cli`)
- [Postgresql](http://www.postgresql.org.es/)
### Para iniciar el proyecto en desarrollo se deben ejecutar los siguientes comandos en la terminal
1. Ejecutar `npm install` para instalar las dependecias del servidor.
2. Ejecutar `bower install` para instalar las dependecias del cliente.
3. Ejecutar `grunt serve` para iniciar el servidor de desarrollo. Debe iniciar automaticamente el explorador.
## Compilacion y desarrollo
Ejecutar `grunt build` para compilar el proyecto, el proyecto compilado se encuentra en la carpeta `dist` luego ejecutar `grunt serve` para una vista previa.
## Tests
Ejecutar `npm test` para ejecutar todos los test(unitarios y de integracion) del proyecto
{
"name": "modulo-personal",
"version": "0.0.0",
"dependencies": {
"angular": "~1.4.0",
"json3": "~3.3.1",
"es5-shim": "~3.0.1",
"bootstrap-sass-official": "~3.1.1",
"bootstrap": "~3.1.1",
"angular-resource": "~1.4.0",
"angular-cookies": "~1.4.0",
"angular-sanitize": "~1.4.0",
"angular-bootstrap": "~0.13.0",
"font-awesome": ">=4.1.0",
"lodash": "~2.4.1",
"angular-ui-router": "~0.2.15"
},
"devDependencies": {
"angular-mocks": "~1.4.0"
}
}
This diff is collapsed.
{
"node": true,
"browser": true,
"esnext": true,
"bitwise": true,
"camelcase": true,
"curly": true,
"eqeqeq": true,
"immed": true,
"latedef": true,
"newcap": true,
"noarg": true,
"quotmark": "single",
"undef": true,
"unused": true,
"strict": true,
"trailing": true,
"smarttabs": true,
"ignoreDelimiters": [
{ "start": "start-non-standard", "end": "end-non-standard" }
],
"globals": {
"jQuery": true,
"angular": true,
"console": true,
"$": true,
"_": true,
"moment": true,
"describe": true,
"beforeEach": true,
"module": true,
"inject": true,
"it": true,
"expect": true,
"browser": true,
"element": true,
"by": true
}
}
'use strict';
angular.module('moduloPersonalApp', [
'moduloPersonalApp.constants',
'ngCookies',
'ngResource',
'ngSanitize',
'ui.router',
'ui.bootstrap'
])
.config(function($urlRouterProvider, $locationProvider) {
$urlRouterProvider
.otherwise('/');
$locationProvider.html5Mode(true);
});
$icon-font-path: "../bower_components/bootstrap-sass-official/vendor/assets/fonts/bootstrap/";
@import '../bower_components/bootstrap-sass-official/vendor/assets/stylesheets/bootstrap';
$fa-font-path: "../bower_components/font-awesome/fonts";
@import '../bower_components/font-awesome/scss/font-awesome';
/**
* App-wide Styles
*/
.browserupgrade {
margin: 0.2em 0;
background: #ccc;
color: #000;
padding: 0.2em 0;
}
// Component styles are injected through grunt
// injector
@import 'account/login/login.scss';
@import 'admin/admin.scss';
@import 'main/main.scss';
// endinjector
'use strict';
(function() {
class MainController {
constructor($http) {
this.$http = $http;
this.awesomeThings = [];
$http.get('/api/things').then(response => {
this.awesomeThings = response.data;
});
}
addThing() {
if (this.newThing) {
this.$http.post('/api/things', { name: this.newThing });
this.newThing = '';
}
}
deleteThing(thing) {
this.$http.delete('/api/things/' + thing._id);
}
}
angular.module('moduloPersonalApp')
.controller('MainController', MainController);
})();
'use strict';
describe('Controller: MainController', function() {
// load the controller's module
beforeEach(module('moduloPersonalApp'));
beforeEach(module('stateMock'));
var scope;
var MainController;
var state;
var $httpBackend;
// Initialize the controller and a mock scope
beforeEach(inject(function(_$httpBackend_, $controller, $rootScope, $state) {
$httpBackend = _$httpBackend_;
$httpBackend.expectGET('/api/things')
.respond(['HTML5 Boilerplate', 'AngularJS', 'Karma', 'Express']);
scope = $rootScope.$new();
state = $state;
MainController = $controller('MainController', {
$scope: scope
});
}));
it('should attach a list of things to the controller', function() {
$httpBackend.flush();
expect(MainController.awesomeThings.length).to.equal(4);
});
});
<header class="hero-unit" id="banner">
<div class="container">
<h1>'Allo, 'Allo!</h1>
<p class="lead">Kick-start your next web app with Angular Fullstack</p>
<img src="assets/images/yeoman.png" alt="I'm Yeoman">
</div>
</header>
<div class="container">
<div class="row">
<div class="col-lg-12">
<h1 class="page-header">Features:</h1>
<ul class="nav nav-tabs nav-stacked col-md-4 col-lg-4 col-sm-6" ng-repeat="thing in main.awesomeThings">
<li><a href="#" tooltip="{{thing.info}}">{{thing.name}}</a></li>
</ul>
</div>
</div>
</div>
'use strict';
angular.module('moduloPersonalApp')
.config(function($stateProvider) {
$stateProvider
.state('main', {
url: '/',
templateUrl: 'app/main/main.html',
controller: 'MainController',
controllerAs: 'main'
});
});
.thing-form {
margin: 20px 0;
}
#banner {
border-bottom: none;
margin-top: -20px;
}
#banner h1 {
font-size: 60px;
line-height: 1;
letter-spacing: -1px;
}
.hero-unit {
position: relative;
padding: 30px 15px;
color: #F5F5F5;
text-align: center;
text-shadow: 0 1px 0 rgba(0, 0, 0, 0.1);
background: #4393B9;
}
.navbar-text {
margin-left: 15px;
}
This diff was suppressed by a .gitattributes entry.
'use strict';
angular.module('moduloPersonalApp')
.directive('footer', function() {
return {
templateUrl: 'components/footer/footer.html',
restrict: 'E',
link: function(scope, element) {
element.addClass('footer');
}
};
});
<div class="container">
<p>Angular Fullstack v3.3.0 |
<a href="https://twitter.com/tyhenkel">@tyhenkel</a> |
<a href="https://github.com/DaftMonk/generator-angular-fullstack/issues?state=open">Issues</a>
</p>
</div>
footer.footer {
text-align: center;
padding: 30px 0;
margin-top: 70px;
border-top: 1px solid #E5E5E5;
}
<div class="modal-header">
<button ng-if="modal.dismissable" type="button" ng-click="$dismiss()" class="close">&times;</button>
<h4 ng-if="modal.title" ng-bind="modal.title" class="modal-title"></h4>
</div>
<div class="modal-body">
<p ng-if="modal.text" ng-bind="modal.text"></p>
<div ng-if="modal.html" ng-bind-html="modal.html"></div>
</div>
<div class="modal-footer">
<button ng-repeat="button in modal.buttons" ng-class="button.classes" ng-click="button.click($event)" ng-bind="button.text" class="btn"></button>
</div>
.modal-primary,
.modal-info,
.modal-success,
.modal-warning,
.modal-danger {
.modal-header {
color: #fff;
border-radius: 5px 5px 0 0;
}
}
.modal-primary .modal-header {
background: $brand-primary;
}
.modal-info .modal-header {
background: $brand-info;
}
.modal-success .modal-header {
background: $brand-success;
}
.modal-warning .modal-header {
background: $brand-warning;
}
.modal-danger .modal-header {
background: $brand-danger;
}
'use strict';
angular.module('moduloPersonalApp')
.factory('Modal', function($rootScope, $modal) {
/**
* Opens a modal
* @param {Object} scope - an object to be merged with modal's scope
* @param {String} modalClass - (optional) class(es) to be applied to the modal
* @return {Object} - the instance $modal.open() returns
*/
function openModal(scope = {}, modalClass = 'modal-default') {
var modalScope = $rootScope.$new();
angular.extend(modalScope, scope);
return $modal.open({
templateUrl: 'components/modal/modal.html',
windowClass: modalClass,
scope: modalScope
});
}
// Public API here
return {
/* Confirmation modals */
confirm: {
/**
* Create a function to open a delete confirmation modal (ex. ng-click='myModalFn(name, arg1, arg2...)')
* @param {Function} del - callback, ran when delete is confirmed
* @return {Function} - the function to open the modal (ex. myModalFn)
*/
delete(del = angular.noop) {
/**
* Open a delete confirmation modal
* @param {String} name - name or info to show on modal
* @param {All} - any additional args are passed straight to del callback
*/
return function() {
var args = Array.prototype.slice.call(arguments),
name = args.shift(),
deleteModal;
deleteModal = openModal({
modal: {
dismissable: true,
title: 'Confirm Delete',
html: '<p>Are you sure you want to delete <strong>' + name + '</strong> ?</p>',
buttons: [{
classes: 'btn-danger',
text: 'Delete',
click: function(e) {
deleteModal.close(e);
}
}, {
classes: 'btn-default',
text: 'Cancel',
click: function(e) {
deleteModal.dismiss(e);
}
}]
}
}, 'modal-danger');
deleteModal.result.then(function(event) {
del.apply(event, args);
});
};
}
}
};
});
'use strict';
class NavbarController {
//start-non-standard
menu = [{
'title': 'Home',
'state': 'main'
}];
isCollapsed = true;
//end-non-standard
constructor() {
}
}
angular.module('moduloPersonalApp')
.controller('NavbarController', NavbarController);
'use strict';
angular.module('moduloPersonalApp')
.directive('navbar', () => ({
templateUrl: 'components/navbar/navbar.html',
restrict: 'E',
controller: 'NavbarController',
controllerAs: 'nav'
}));
<div class="navbar navbar-default navbar-static-top" ng-controller="NavbarController">
<div class="container">
<div class="navbar-header">
<button class="navbar-toggle" type="button" ng-click="nav.isCollapsed = !nav.isCollapsed">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a href="/" class="navbar-brand">modulo-personal</a>
</div>
<div collapse="nav.isCollapsed" class="navbar-collapse collapse" id="navbar-main">
<ul class="nav navbar-nav">
<li ng-repeat="item in nav.menu" ui-sref-active="active">
<a ui-sref="{{item.state}}">{{item.title}}</a>
</li>
</ul>
</div>
</div>
</div>
'use strict';
angular.module('stateMock', []);
angular.module('stateMock').service('$state', function($q) {
this.expectedTransitions = [];
this.transitionTo = function(stateName) {
if (this.expectedTransitions.length > 0) {
var expectedState = this.expectedTransitions.shift();
if (expectedState !== stateName) {
throw Error('Expected transition to state: ' + expectedState + ' but transitioned to ' + stateName);
}
} else {
throw Error('No more transitions were expected! Tried to transition to ' + stateName);
}
console.log('Mock transition to: ' + stateName);
var deferred = $q.defer();
var promise = deferred.promise;
deferred.resolve();
return promise;
};
this.go = this.transitionTo;
this.expectTransitionTo = function(stateName) {
this.expectedTransitions.push(stateName);
};
this.ensureAllTransitionsHappened = function() {
if (this.expectedTransitions.length > 0) {
throw Error('Not all transitions happened!');
}
};
});
'use strict';
angular.module('moduloPersonalApp.util', []);