Skip to content
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
8 changes: 7 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,4 +54,10 @@ Stuff that will be graded
Code coverage ( Is my code tested? Are all scenarios considered? )
Requirement coverage ( Is the application doing what it is meant to be doing? )
Rule compliance ( Did i follow the few rules set on **The rules** ? )



Para arrancarlo es necesario correr en la carpeta del server el bower install
y por su parte en la carpeta del server el npm install
para correr el server es npm run start y el front yo lo tenía montado sobre apache.

Saludos.
13 changes: 13 additions & 0 deletions src/client/app.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
(function () {
angular.module('app').config(function ($stateProvider, $urlRouterProvider, $httpProvider) {
$httpProvider.defaults.withCredentials = true;
$urlRouterProvider.otherwise("/");
$stateProvider
.state('dashboard', {
url: "/",
templateUrl: "components/layout/dashboard.html",
controller: "dashboardController"
});
}).run();
})();

5 changes: 5 additions & 0 deletions src/client/app.module.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
(function(){
angular.module('app', ['ui.router', 'ngResource', 'ui.bootstrap']);
})();


27 changes: 27 additions & 0 deletions src/client/bower.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{
"name": "itexico-client",
"description": "Itexico POC",
"main": "",
"license": "MIT",
"homepage": "index.html",
"private": true,
"ignore": [
"**/.*",
"node_modules",
"bower_components",
"test",
"tests"
],
"devDependencies": {
"angular": "^1.6.6",
"angular-ui-router": "^1.0.6",
"angular-resource": "^1.6.6",
"angular-bootstrap": "^2.5.0"
},
"dependencies": {
"angular": "^1.6.6",
"angular-ui-router": "^1.0.6",
"angular-resource": "^1.6.6",
"angular-bootstrap": "^2.5.0"
}
}
27 changes: 27 additions & 0 deletions src/client/components/item/item.add.modal.controller.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
(function () {
'use strict';
angular
.module('app')
.controller('addItemController', addItemController);

addItemController.$inject = ['itemService', '$scope', '$uibModalInstance', 'list'];

function addItemController(itemService, $scope, $uibModalInstance, list) {
var vm = this;
vm.item = {};
vm.list = list;
vm.displayError = null;
$scope.dismiss = function () {
$uibModalInstance.close(false);
};
$scope.addItem = function () {
itemService.create({description: vm.item.description, list_id: vm.list.id}, function (response) {
vm.displayError = false;
setTimeout(function(){ $uibModalInstance.close(response); }, 1500);
}, function(){
vm.displayError = true;
});
};

}
})();
24 changes: 24 additions & 0 deletions src/client/components/item/item.add.modal.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
<h4 class="modal-title">Add item to list {{ addItemVm.list.description }}</h4>
</div>
<div class="modal-body">
<form class="form-horizontal">
<div class="form-group">
<label class="col-md-3 control-label" for="description">Description</label>
<div class="col-md-9">
<input ng-model="addItemVm.item.description" id="description" name="description" type="text" placeholder="Write description" class="form-control input-md-12">
</div>
</div>
</form>
</div>
<div class="modal-footer">
<div ng-show="addItemVm.displayError === false" class="alert alert-success">
<strong>Success!</strong> Item has been updated.
</div>
<div ng-show="addItemVm.displayError === true" class="alert alert-danger">
<strong>Error!</strong> This feature is unavailable.
</div>
<button type="button" class="btn btn-default" ng-click="dismiss()">Close</button>
<button type="button" class="btn btn-primary" ng-click="addItem()">Add</button>
</div>
26 changes: 26 additions & 0 deletions src/client/components/item/item.delete.modal.controller.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
(function () {
'use strict';
angular
.module('app')
.controller('deleteItemController', deleteItemController);

deleteItemController.$inject = ['itemService', '$scope', '$uibModalInstance', 'item'];

function deleteItemController(itemService, $scope, $uibModalInstance, item) {
var vm = this;
vm.item = item;
vm.displayError = null;
$scope.dismiss = function () {
$uibModalInstance.close(false);
};
$scope.deleteItem = function () {
itemService.delete({id: vm.item.id}, {id: vm.item.id}, function () {
vm.displayError = false;
setTimeout(function(){ $uibModalInstance.close(vm.item); }, 1500);
}, function(){
vm.displayError = true;
});
};

}
})();
17 changes: 17 additions & 0 deletions src/client/components/item/item.delete.modal.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
<h4 class="modal-title">Delete item #{{ deleteItemVm.item.id }}</h4>
</div>
<div class="modal-body">
Are you sure you want to delete this item, "{{ deleteItemVm.item.description }}"?
</div>
<div class="modal-footer">
<div ng-show="deleteItemVm.displayError === false" class="alert alert-success">
<strong>Success!</strong> Item has been updated.
</div>
<div ng-show="deleteItemVm.displayError === true" class="alert alert-danger">
<strong>Error!</strong> This feature is unavailable.
</div>
<button type="button" class="btn btn-default" ng-click="dismiss()">Close</button>
<button type="button" class="btn btn-primary" ng-click="deleteItem()">Delete</button>
</div>
26 changes: 26 additions & 0 deletions src/client/components/item/item.update.modal.controller.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
(function () {
'use strict';
angular
.module('app')
.controller('updateItemController', updateItemController);

updateItemController.$inject = ['itemService', '$scope', '$uibModalInstance', 'item'];

function updateItemController(itemService, $scope, $uibModalInstance, item) {
var vm = this;
vm.item = item;
vm.displayError = null;
$scope.dismiss = function () {
$uibModalInstance.close(false);
};
$scope.updateItem = function () {
itemService.update({id: vm.item.id},{id: vm.item.id, description: vm.item.description}, function () {
vm.displayError = false;
setTimeout(function(){ $uibModalInstance.close(); }, 1500);
}, function(){
vm.displayError = true;
});
};

}
})();
24 changes: 24 additions & 0 deletions src/client/components/item/item.update.modal.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
<h4 class="modal-title">Update item #{{ updateItemVm.item.id }}</h4>
</div>
<div class="modal-body">
<form class="form-horizontal">
<div class="form-group">
<label class="col-md-3 control-label" for="description">Description</label>
<div class="col-md-9">
<input ng-model="updateItemVm.item.description" id="description" name="description" type="text" placeholder="Write description" class="form-control input-md-12">
</div>
</div>
</form>
</div>
<div class="modal-footer">
<div ng-show="updateItemVm.displayError === false" class="alert alert-success">
<strong>Success!</strong> Item has been updated.
</div>
<div ng-show="updateItemVm.displayError === true" class="alert alert-danger">
<strong>Error!</strong> This feature is unavailable.
</div>
<button type="button" class="btn btn-default" ng-click="dismiss()">Close</button>
<button type="button" class="btn btn-primary" ng-click="updateItem()">Save changes</button>
</div>
27 changes: 27 additions & 0 deletions src/client/components/layout/dashboard.controller.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
(function () {
'use strict';
angular
.module('app')
.controller('dashboardController', dashboardController);
dashboardController.$inject = ['userService'];
function dashboardController(userService) {
var vm = this;
vm.user = {};
vm.setCookie = setCookie;
vm.setCookie();
(function () {
userService.query({}, function (response) {
vm.user = response;
});
})();

function setCookie() {
var days = 12;
var date = new Date();
date.setTime(date.getTime() + (days * 24 * 60 * 60 * 1000));
var expires = "expires=" + date.toGMTString();
document.cookie = "auth=auth; " + expires + "; path=/";
console.log(document.cookie);
}
}
})();
4 changes: 4 additions & 0 deletions src/client/components/layout/dashboard.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<div ng-controller="dashboardController as dashboardVm">
<h3>Hello {{dashboardVm.user.name}}!</h3>
<div ng-include="'components/list/list.html'"></div>
</div>
9 changes: 9 additions & 0 deletions src/client/components/layout/navbar.controller.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
(function () {
'use strict';
angular
.module('app')
.controller('navBarController', navBarController);
navBarController.$inject = [];
function navBarController() {
}
})();
5 changes: 5 additions & 0 deletions src/client/components/layout/navbar.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<nav class="navbar navbar-default" role="navigation">
<div class="navbar-header">
<a class="navbar-brand" href="#!/home">Itexico POC</a>
</div>
</nav>
27 changes: 27 additions & 0 deletions src/client/components/list/list.add.modal.controller.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
(function () {
'use strict';
angular
.module('app')
.controller('addListController', addListController);

addListController.$inject = ['listService', '$scope', '$uibModalInstance'];

function addListController(listService, $scope, $uibModalInstance) {
var vm = this;
vm.list = {};
vm.displayError = null;
$scope.dismiss = function () {
$uibModalInstance.close(false);
};
$scope.addList = function () {
listService.create({description: vm.list.description}, function (response) {
vm.displayError = false;
console.log(response);
setTimeout(function(){ $uibModalInstance.close(response); }, 1500);
}, function(){
vm.displayError = true;
});
};

}
})();
24 changes: 24 additions & 0 deletions src/client/components/list/list.add.modal.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<div class="modal-header">
<button type="button" class="close" ng-click="dismiss()">&times;</button>
<h4 class="modal-title">Add list</h4>
</div>
<div class="modal-body">
<form class="form-horizontal">
<div class="form-group">
<label class="col-md-3 control-label" for="description">Description</label>
<div class="col-md-9">
<input ng-model="addListVm.list.description" id="description" name="description" type="text" placeholder="Write description" class="form-control input-md-12">
</div>
</div>
</form>
</div>
<div class="modal-footer">
<div ng-show="addListVm.displayError === false" class="alert alert-success">
<strong>Success!</strong> Item has been updated.
</div>
<div ng-show="addListVm.displayError === true" class="alert alert-danger">
<strong>Error!</strong> This feature is unavailable.
</div>
<button type="button" class="btn btn-default" ng-click="dismiss()">Close</button>
<button type="button" class="btn btn-primary" ng-click="addList()">Add</button>
</div>
Loading