added Agency module

This commit is contained in:
Joan Sanchez 2018-09-25 08:53:57 +02:00
parent 7afa99f25d
commit 4388a6dbff
43 changed files with 3862 additions and 3784 deletions

1
client/agency/index.js Normal file
View File

@ -0,0 +1 @@
export * from './src';

58
client/agency/routes.json Normal file
View File

@ -0,0 +1,58 @@
{
"module": "agency",
"name": "Agencies",
"icon" : "local_shipping",
"validations" : true,
"routes": [
{
"url": "/zone",
"state": "zone",
"abstract": true,
"component": "ui-view",
"description": "Zones"
},
{
"url": "/index?q",
"state": "zone.index",
"component": "vn-zone-index",
"description": "List",
"acl": ["developer"]
},
{
"url": "/create",
"state": "zone.create",
"component": "vn-zone-create",
"description": "New zone"
},
{
"url": "/:id",
"state": "zone.card",
"abstract": true,
"component": "vn-zone-card"
},
{
"url": "/basic-data",
"state": "zone.card.basicData",
"component": "vn-zone-basic-data",
"description": "Basic data",
"params": {
"zone": "$ctrl.zone"
},
"menu": {
"icon": "settings"
}
},
{
"url": "/delivery-day",
"state": "zone.card.deliveryDay",
"component": "vn-zone-delivery-day",
"description": "Delivery days",
"params": {
"zone": "$ctrl.zone"
},
"menu": {
"icon": "today"
}
}
]
}

View File

@ -0,0 +1,11 @@
export * from './module';
// import components
import './zone/card';
import './zone/descriptor';
import './zone/search-panel';
import './zone/index';
import './zone/create';
import './zone/basic-data';
import './zone/delivery-day';
import './zone/calendar';

View File

@ -0,0 +1 @@
Agencies: Agencies

View File

@ -0,0 +1,11 @@
Name: Nombre
Agency: Agencia
Warehouse: Almacén
Hour: Hora (ETD)
Price: Precio
Create: Crear
Zones: Zonas
List: Listado
New zone: Nueva zona
Basic data: Datos básicos

View File

@ -0,0 +1,5 @@
import {ng} from 'vendor';
import 'core';
const ngModule = ng.module('agency', ['vnCore']);
export default ngModule;

View File

@ -1,4 +1,4 @@
<mg-ajax path="/route/api/Zones/{{patch.params.id}}" options="vnPatch"></mg-ajax> <mg-ajax path="/agency/api/Zones/{{patch.params.id}}" options="vnPatch"></mg-ajax>
<vn-watcher <vn-watcher
vn-id="watcher" vn-id="watcher"
data="$ctrl.zone" data="$ctrl.zone"
@ -18,7 +18,7 @@
<vn-autocomplete <vn-autocomplete
vn-one vn-one
field="$ctrl.zone.warehouseFk" field="$ctrl.zone.warehouseFk"
url="/route/api/Warehouses" url="/agency/api/Warehouses"
show-field="name" show-field="name"
value-field="id" value-field="id"
label="Warehouse"> label="Warehouse">
@ -26,7 +26,7 @@
<vn-autocomplete <vn-autocomplete
vn-one vn-one
field="$ctrl.zone.agencyModeFk" field="$ctrl.zone.agencyModeFk"
url="/route/api/AgencyModes" url="/agency/api/AgencyModes"
show-field="name" show-field="name"
value-field="id" value-field="id"
label="Agency"> label="Agency">

View File

@ -18,7 +18,7 @@ class Controller {
] ]
}; };
let json = encodeURIComponent(JSON.stringify(filter)); let json = encodeURIComponent(JSON.stringify(filter));
let query = `/route/api/Zones/${this.$stateParams.id}?filter=${json}`; let query = `/agency/api/Zones/${this.$stateParams.id}?filter=${json}`;
this.$http.get(query).then(res => { this.$http.get(query).then(res => {
if (res.data) if (res.data)
this.zone = res.data; this.zone = res.data;

View File

@ -1,6 +1,6 @@
import './index.js'; import './index.js';
describe('Route', () => { describe('Agency', () => {
describe('Component vnZoneCard', () => { describe('Component vnZoneCard', () => {
let $componentController; let $componentController;
let $scope; let $scope;
@ -9,7 +9,7 @@ describe('Route', () => {
let $stateParams; let $stateParams;
beforeEach(() => { beforeEach(() => {
angular.mock.module('route'); angular.mock.module('agency');
}); });
beforeEach(angular.mock.inject((_$componentController_, $rootScope, _$httpBackend_) => { beforeEach(angular.mock.inject((_$componentController_, $rootScope, _$httpBackend_) => {
@ -30,7 +30,7 @@ describe('Route', () => {
] ]
}; };
let json = encodeURIComponent(JSON.stringify(filter)); let json = encodeURIComponent(JSON.stringify(filter));
$httpBackend.expectGET(`/route/api/Zones/1?filter=${json}`).respond({id: 1}); $httpBackend.expectGET(`/agency/api/Zones/1?filter=${json}`).respond({id: 1});
controller.getCard(); controller.getCard();
$httpBackend.flush(); $httpBackend.flush();

View File

@ -1,4 +1,4 @@
<mg-ajax path="/route/api/Zones" options="vnPost"></mg-ajax> <mg-ajax path="/agency/api/Zones" options="vnPost"></mg-ajax>
<vn-watcher <vn-watcher
vn-id="watcher" vn-id="watcher"
data="$ctrl.zone" data="$ctrl.zone"
@ -19,7 +19,7 @@
<vn-autocomplete <vn-autocomplete
vn-one vn-one
field="$ctrl.zone.warehouseFk" field="$ctrl.zone.warehouseFk"
url="/route/api/Warehouses" url="/agency/api/Warehouses"
show-field="name" show-field="name"
value-field="id" value-field="id"
label="Warehouse"> label="Warehouse">
@ -27,7 +27,7 @@
<vn-autocomplete <vn-autocomplete
vn-one vn-one
field="$ctrl.zone.agencyModeFk" field="$ctrl.zone.agencyModeFk"
url="/route/api/AgencyModes" url="/agency/api/AgencyModes"
show-field="name" show-field="name"
value-field="id" value-field="id"
label="Agency"> label="Agency">

View File

@ -1,7 +1,7 @@
import './index'; import './index';
import {watcher} from '../../../../helpers/watcherHelper'; import {watcher} from '../../../../helpers/watcherHelper';
describe('Route', () => { describe('Agency', () => {
describe('Component vnZoneCreate', () => { describe('Component vnZoneCreate', () => {
let $componentController; let $componentController;
let $httpBackend; let $httpBackend;
@ -10,14 +10,13 @@ describe('Route', () => {
let controller; let controller;
beforeEach(() => { beforeEach(() => {
angular.mock.module('route'); angular.mock.module('agency');
}); });
beforeEach(angular.mock.inject((_$componentController_, $rootScope, _$httpBackend_, _$state_) => { beforeEach(angular.mock.inject((_$componentController_, $rootScope, _$httpBackend_, _$state_) => {
$componentController = _$componentController_; $componentController = _$componentController_;
$httpBackend = _$httpBackend_; $httpBackend = _$httpBackend_;
$httpBackend.when('GET', /\/locale\/\w+\/[a-z]{2}\.json/).respond({}); $httpBackend.when('GET', /\/locale\/\w+\/[a-z]{2}\.json/).respond({});
$httpBackend.when('GET', 'claim/api/Claims/ClaimBeginnings').respond({});
$scope = $rootScope.$new(); $scope = $rootScope.$new();
$state = _$state_; $state = _$state_;
$scope.watcher = watcher; $scope.watcher = watcher;

View File

@ -1,6 +1,6 @@
<vn-crud-model <vn-crud-model
vn-id="model" vn-id="model"
url="/route/api/Zones" url="/agency/api/Zones"
filter="::$ctrl.filter" filter="::$ctrl.filter"
limit="20" limit="20"
data="zones" data="zones"
@ -51,5 +51,5 @@
</div> </div>
<a ui-sref="zone.create" vn-tooltip="New zone" vn-bind="+" fixed-bottom-right> <a ui-sref="zone.create" vn-tooltip="New zone" vn-bind="+" fixed-bottom-right>
<vn-float-button icon="add_location"></vn-float-button> <vn-float-button icon="add"></vn-float-button>
</a> </a>

View File

@ -1,12 +1,12 @@
import './index.js'; import './index.js';
describe('Route', () => { describe('Agency', () => {
describe('Component vnZoneIndex', () => { describe('Component vnZoneIndex', () => {
let $componentController; let $componentController;
let controller; let controller;
beforeEach(() => { beforeEach(() => {
angular.mock.module('route'); angular.mock.module('agency');
}); });
beforeEach(angular.mock.inject(_$componentController_ => { beforeEach(angular.mock.inject(_$componentController_ => {

View File

@ -7,3 +7,4 @@ ticket: [item, client]
order: [item, ticket] order: [item, ticket]
claim: [item, client] claim: [item, client]
route: [] route: []
agency: []

View File

@ -4,7 +4,7 @@
"icon" : "local_shipping", "icon" : "local_shipping",
"validations" : true, "validations" : true,
"routes": [ "routes": [
/* { {
"url": "/route", "url": "/route",
"state": "route", "state": "route",
"abstract": true, "abstract": true,
@ -17,56 +17,6 @@
"component": "vn-route-index", "component": "vn-route-index",
"description": "List", "description": "List",
"acl": ["developer"] "acl": ["developer"]
}, */
{
"url": "/zone",
"state": "zone",
"abstract": true,
"component": "ui-view",
"description": "Zones"
},
{
"url": "/index?q",
"state": "zone.index",
"component": "vn-zone-index",
"description": "List",
"acl": ["developer"]
},
{
"url": "/create",
"state": "zone.create",
"component": "vn-zone-create",
"description": "New zone"
},
{
"url": "/:id",
"state": "zone.card",
"abstract": true,
"component": "vn-zone-card"
},
{
"url": "/basic-data",
"state": "zone.card.basicData",
"component": "vn-zone-basic-data",
"description": "Basic data",
"params": {
"zone": "$ctrl.zone"
},
"menu": {
"icon": "settings"
}
},
{
"url": "/delivery-day",
"state": "zone.card.deliveryDay",
"component": "vn-zone-delivery-day",
"description": "Delivery days",
"params": {
"zone": "$ctrl.zone"
},
"menu": {
"icon": "today"
}
} }
] ]
} }

View File

@ -1,11 +1,3 @@
export * from './module'; export * from './module';
// import components // import components
import './zone/card';
import './zone/descriptor';
import './zone/search-panel';
import './zone/index';
import './zone/create';
import './zone/basic-data';
import './zone/delivery-day';
import './zone/calendar';

View File

@ -1,11 +1,2 @@
Name: Nombre Routes: Rutas
Agency: Agencia List: Listado
Warehouse: Almacén
Hour: Hora (ETD)
Price: Precio
Create: Crear
Zones: Zonas
List: Listado
New zone: Nueva zona
Basic data: Datos básicos

View File

@ -25,4 +25,5 @@ Return to module index: Volver a la página principal del módulo
Routes: Rutas Routes: Rutas
What is new: Novedades de la versión What is new: Novedades de la versión
Web Account inactive: Sin acceso Web Web Account inactive: Sin acceso Web
Orders: Pedidos Orders: Pedidos
Agencies: Agencias

View File

@ -10,5 +10,7 @@ export default {
order: order:
cb => require.ensure([], () => cb(require('order'))), cb => require.ensure([], () => cb(require('order'))),
claim: claim:
cb => require.ensure([], () => cb(require('claim'))) cb => require.ensure([], () => cb(require('claim'))),
agency:
cb => require.ensure([], () => cb(require('agency')))
}; };

7390
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,5 @@
FROM vn-loopback:latest
COPY route /app
WORKDIR /app
CMD ["pm2-docker", "./server/server.js"]

View File

@ -0,0 +1,19 @@
{
"name": "vn-agency",
"version": "1.0.0",
"main": "server/server.js",
"scripts": {
"lint": "eslint .",
"start": "node .",
"posttest": "npm run lint && nsp check"
},
"repository": {
"type": "git",
"url": "https://git.verdnatura.es/salix"
},
"license": "GPL-3.0",
"description": "vn-agency",
"dependencies": {
"vn-loopback": "file:../loopback"
}
}

View File

@ -0,0 +1,14 @@
{
"Zone": {
"dataSource": "vn"
},
"ZoneGeo": {
"dataSource": "vn"
},
"ZoneCalendar": {
"dataSource": "vn"
},
"ZoneIncluded": {
"dataSource": "vn"
}
}

View File

@ -0,0 +1,5 @@
var vnLoopback = require('vn-loopback/server/server.js');
var app = module.exports = vnLoopback.loopback();
vnLoopback.boot(app, __dirname, module);

View File

@ -4,17 +4,5 @@
}, },
"Vehicle": { "Vehicle": {
"dataSource": "vn" "dataSource": "vn"
},
"Zone": {
"dataSource": "vn"
},
"ZoneGeo": {
"dataSource": "vn"
},
"ZoneCalendar": {
"dataSource": "vn"
},
"ZoneIncluded": {
"dataSource": "vn"
} }
} }