Merge branch 'dev' of https://gitea.verdnatura.es/verdnatura/salix into 2689-add_id_in_typeTransaction_client_and_supplier
gitea/salix/pipeline/head This commit looks good
Details
gitea/salix/pipeline/head This commit looks good
Details
This commit is contained in:
commit
f2742b88a2
|
@ -0,0 +1,18 @@
|
||||||
|
CREATE TABLE `vn`.`zoneLog` (
|
||||||
|
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
|
||||||
|
`originFk` int(10) NOT NULL,
|
||||||
|
`userFk` int(10) unsigned DEFAULT NULL,
|
||||||
|
`action` set('insert','update','delete') COLLATE utf8_unicode_ci NOT NULL,
|
||||||
|
`creationDate` timestamp NULL DEFAULT current_timestamp(),
|
||||||
|
`description` text CHARACTER SET utf8 DEFAULT NULL,
|
||||||
|
`changedModel` varchar(45) COLLATE utf8_unicode_ci DEFAULT NULL,
|
||||||
|
`oldInstance` text COLLATE utf8_unicode_ci DEFAULT NULL,
|
||||||
|
`newInstance` text COLLATE utf8_unicode_ci DEFAULT NULL,
|
||||||
|
`changedModelId` int(11) DEFAULT NULL,
|
||||||
|
`changedModelValue` varchar(45) COLLATE utf8_unicode_ci DEFAULT NULL,
|
||||||
|
PRIMARY KEY (`id`),
|
||||||
|
KEY `originFk` (`originFk`),
|
||||||
|
KEY `userFk` (`userFk`),
|
||||||
|
CONSTRAINT `zoneLog_ibfk_1` FOREIGN KEY (`originFk`) REFERENCES `vn`.`zone` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
|
||||||
|
CONSTRAINT `zoneLog_ibfk_2` FOREIGN KEY (`userFk`) REFERENCES `account`.`user` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
|
||||||
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
|
|
@ -145,9 +145,15 @@ module.exports = function(Self) {
|
||||||
rewriteDbError(replaceErrFunc) {
|
rewriteDbError(replaceErrFunc) {
|
||||||
function replaceErr(err, replaceErrFunc) {
|
function replaceErr(err, replaceErrFunc) {
|
||||||
if (Array.isArray(err)) {
|
if (Array.isArray(err)) {
|
||||||
|
const errors = err.filter(error => {
|
||||||
|
return error != undefined && error != null;
|
||||||
|
});
|
||||||
let errs = [];
|
let errs = [];
|
||||||
for (let e of err)
|
for (let e of errors) {
|
||||||
|
if (!(e instanceof UserError))
|
||||||
errs.push(replaceErrFunc(e));
|
errs.push(replaceErrFunc(e));
|
||||||
|
else errs.push(e);
|
||||||
|
}
|
||||||
return errs;
|
return errs;
|
||||||
}
|
}
|
||||||
return replaceErrFunc(err);
|
return replaceErrFunc(err);
|
||||||
|
|
|
@ -31,5 +31,8 @@
|
||||||
},
|
},
|
||||||
"ZoneEstimatedDelivery": {
|
"ZoneEstimatedDelivery": {
|
||||||
"dataSource": "vn"
|
"dataSource": "vn"
|
||||||
|
},
|
||||||
|
"ZoneLog": {
|
||||||
|
"dataSource": "vn"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,10 @@
|
||||||
{
|
{
|
||||||
"name": "ZoneEvent",
|
"name": "ZoneEvent",
|
||||||
"base": "VnModel",
|
"base": "Loggable",
|
||||||
|
"log": {
|
||||||
|
"model":"ZoneLog",
|
||||||
|
"relation": "zone"
|
||||||
|
},
|
||||||
"options": {
|
"options": {
|
||||||
"mysql": {
|
"mysql": {
|
||||||
"table": "zoneEvent"
|
"table": "zoneEvent"
|
||||||
|
|
|
@ -1,6 +1,11 @@
|
||||||
{
|
{
|
||||||
"name": "ZoneIncluded",
|
"name": "ZoneIncluded",
|
||||||
"base": "VnModel",
|
"base": "Loggable",
|
||||||
|
"log": {
|
||||||
|
"model": "ZoneLog",
|
||||||
|
"relation": "zone",
|
||||||
|
"showField": "isIncluded"
|
||||||
|
},
|
||||||
"options": {
|
"options": {
|
||||||
"mysql": {
|
"mysql": {
|
||||||
"table": "zoneIncluded"
|
"table": "zoneIncluded"
|
||||||
|
|
|
@ -0,0 +1,58 @@
|
||||||
|
{
|
||||||
|
"name": "ZoneLog",
|
||||||
|
"base": "VnModel",
|
||||||
|
"options": {
|
||||||
|
"mysql": {
|
||||||
|
"table": "zoneLog"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"properties": {
|
||||||
|
"id": {
|
||||||
|
"id": true,
|
||||||
|
"type": "Number",
|
||||||
|
"forceId": false
|
||||||
|
},
|
||||||
|
"originFk": {
|
||||||
|
"type": "Number",
|
||||||
|
"required": true
|
||||||
|
},
|
||||||
|
"userFk": {
|
||||||
|
"type": "Number"
|
||||||
|
},
|
||||||
|
"action": {
|
||||||
|
"type": "String",
|
||||||
|
"required": true
|
||||||
|
},
|
||||||
|
"changedModel": {
|
||||||
|
"type": "String"
|
||||||
|
},
|
||||||
|
"oldInstance": {
|
||||||
|
"type": "Object"
|
||||||
|
},
|
||||||
|
"newInstance": {
|
||||||
|
"type": "Object"
|
||||||
|
},
|
||||||
|
"creationDate": {
|
||||||
|
"type": "Date"
|
||||||
|
},
|
||||||
|
"changedModelId": {
|
||||||
|
"type": "String"
|
||||||
|
},
|
||||||
|
"changedModelValue": {
|
||||||
|
"type": "String"
|
||||||
|
},
|
||||||
|
"description": {
|
||||||
|
"type": "String"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"relations": {
|
||||||
|
"user": {
|
||||||
|
"type": "belongsTo",
|
||||||
|
"model": "Account",
|
||||||
|
"foreignKey": "userFk"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"scope": {
|
||||||
|
"order": ["creationDate DESC", "id DESC"]
|
||||||
|
}
|
||||||
|
}
|
|
@ -1,6 +1,10 @@
|
||||||
{
|
{
|
||||||
"name": "ZoneWarehouse",
|
"name": "ZoneWarehouse",
|
||||||
"base": "VnModel",
|
"base": "Loggable",
|
||||||
|
"log": {
|
||||||
|
"model":"ZoneLog",
|
||||||
|
"relation": "zone"
|
||||||
|
},
|
||||||
"options": {
|
"options": {
|
||||||
"mysql": {
|
"mysql": {
|
||||||
"table": "zoneWarehouse"
|
"table": "zoneWarehouse"
|
||||||
|
|
|
@ -1,6 +1,10 @@
|
||||||
{
|
{
|
||||||
"name": "Zone",
|
"name": "Zone",
|
||||||
"base": "VnModel",
|
"base": "Loggable",
|
||||||
|
"log": {
|
||||||
|
"model":"ZoneLog",
|
||||||
|
"showField": "name"
|
||||||
|
},
|
||||||
"options": {
|
"options": {
|
||||||
"mysql": {
|
"mysql": {
|
||||||
"table": "zone"
|
"table": "zone"
|
||||||
|
@ -39,11 +43,6 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"relations": {
|
"relations": {
|
||||||
"geolocations": {
|
|
||||||
"type": "hasMany",
|
|
||||||
"model": "ZoneGeo",
|
|
||||||
"foreignKey": "zoneFk"
|
|
||||||
},
|
|
||||||
"agencyMode": {
|
"agencyMode": {
|
||||||
"type": "belongsTo",
|
"type": "belongsTo",
|
||||||
"model": "AgencyMode",
|
"model": "AgencyMode",
|
||||||
|
|
|
@ -16,3 +16,4 @@ import './calendar';
|
||||||
import './location';
|
import './location';
|
||||||
import './calendar';
|
import './calendar';
|
||||||
import './upcoming-deliveries';
|
import './upcoming-deliveries';
|
||||||
|
import './log';
|
||||||
|
|
|
@ -0,0 +1 @@
|
||||||
|
<vn-log url="ZoneLogs" origin-id="$ctrl.$params.id"></vn-log>
|
|
@ -0,0 +1,7 @@
|
||||||
|
import ngModule from '../module';
|
||||||
|
import Section from 'salix/components/section';
|
||||||
|
|
||||||
|
ngModule.vnComponent('vnZoneLog', {
|
||||||
|
template: require('./index.html'),
|
||||||
|
controller: Section,
|
||||||
|
});
|
|
@ -14,6 +14,7 @@
|
||||||
{"state": "zone.card.basicData", "icon": "settings"},
|
{"state": "zone.card.basicData", "icon": "settings"},
|
||||||
{"state": "zone.card.location", "icon": "my_location"},
|
{"state": "zone.card.location", "icon": "my_location"},
|
||||||
{"state": "zone.card.warehouses", "icon": "home"},
|
{"state": "zone.card.warehouses", "icon": "home"},
|
||||||
|
{"state": "zone.card.log", "icon": "history"},
|
||||||
{"state": "zone.card.events", "icon": "today"}
|
{"state": "zone.card.events", "icon": "today"}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
@ -84,6 +85,11 @@
|
||||||
"params": {
|
"params": {
|
||||||
"zone": "$ctrl.zone"
|
"zone": "$ctrl.zone"
|
||||||
}
|
}
|
||||||
|
}, {
|
||||||
|
"url" : "/log",
|
||||||
|
"state": "zone.card.log",
|
||||||
|
"component": "vn-zone-log",
|
||||||
|
"description": "Log"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
Loading…
Reference in New Issue