fng-audit 0.12.0-beta.33 → 0.12.0-beta.331
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -1
- package/dist/client/fng-audit.js +151 -32
- package/dist/client/fng-audit.js.map +1 -1
- package/dist/client/fng-audit.min.js +1 -1
- package/dist/server/fng-audit.js +555 -289
- package/package.json +55 -25
package/README.md
CHANGED
|
@@ -58,4 +58,7 @@ The following client side routes are added:
|
|
|
58
58
|
|
|
59
59
|
`/<model>/<id>/version/<version>` recreates the value of the specified version of the item and displays it in JSON format
|
|
60
60
|
|
|
61
|
-
Each of these routes also support the `/<model>/<form>/<id>` variants
|
|
61
|
+
Each of these routes also support the `/<model>/<form>/<id>` variants
|
|
62
|
+
|
|
63
|
+
You can set up a function $rootScope.describeUsers ({[userId: string]: any}) => IPromise<{[userId: string]: string}>
|
|
64
|
+
to convert user ids into user descriptions.
|
package/dist/client/fng-audit.js
CHANGED
|
@@ -1,9 +1,63 @@
|
|
|
1
|
+
(function (root, factory) {
|
|
2
|
+
if (root === undefined && window !== undefined) root = window;
|
|
3
|
+
if (typeof define === 'function' && define.amd) {
|
|
4
|
+
// AMD. Register as an anonymous module unless amdModuleId is set
|
|
5
|
+
define(["angular","jsondiffpatch"], function (a0,b1) {
|
|
6
|
+
return (root['null'] = factory(a0,b1));
|
|
7
|
+
});
|
|
8
|
+
} else if (typeof module === 'object' && module.exports) {
|
|
9
|
+
// Node. Does not work with strict CommonJS, but
|
|
10
|
+
// only CommonJS-like environments that support module.exports,
|
|
11
|
+
// like Node.
|
|
12
|
+
module.exports = factory(require("angular"),require("jsondiffpatch"));
|
|
13
|
+
} else {
|
|
14
|
+
root['null'] = factory(root["angular"],root["jsondiffpatch"]);
|
|
15
|
+
}
|
|
16
|
+
}(this, function (angular, jsondiffpatch) {
|
|
17
|
+
|
|
18
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
19
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
20
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
21
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
22
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
23
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
24
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
25
|
+
});
|
|
26
|
+
};
|
|
27
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
28
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
|
|
29
|
+
return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
30
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
31
|
+
function step(op) {
|
|
32
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
33
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
34
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
35
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
36
|
+
switch (op[0]) {
|
|
37
|
+
case 0: case 1: t = op; break;
|
|
38
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
39
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
40
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
41
|
+
default:
|
|
42
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
43
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
44
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
45
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
46
|
+
if (t[2]) _.ops.pop();
|
|
47
|
+
_.trys.pop(); continue;
|
|
48
|
+
}
|
|
49
|
+
op = body.call(thisArg, _);
|
|
50
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
51
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
52
|
+
}
|
|
53
|
+
};
|
|
54
|
+
|
|
1
55
|
(function () {
|
|
2
56
|
'use strict';
|
|
3
57
|
var auditModule = angular.module('fngAuditModule', ['formsAngular']);
|
|
4
58
|
auditModule
|
|
5
|
-
.config(['
|
|
6
|
-
|
|
59
|
+
.config(['RoutingServiceProvider', function (RoutingServiceProvider) {
|
|
60
|
+
RoutingServiceProvider.addRoutes(null, [
|
|
7
61
|
{ route: '/:model/:id/history', state: 'model::history', templateUrl: 'templates/base-history.html' },
|
|
8
62
|
{ route: '/:model/:form/:id/history', state: 'model::history', templateUrl: 'templates/base-history.html' },
|
|
9
63
|
{ route: '/:model/:id/changes', state: 'model::history', templateUrl: 'templates/base-history.html' },
|
|
@@ -11,48 +65,109 @@
|
|
|
11
65
|
{ route: '/:model/:id/version/:version', state: 'model::version', templateUrl: 'templates/base-version.html' },
|
|
12
66
|
{ route: '/:model/:form/:id/version/:version', state: 'model::version', templateUrl: 'templates/base-version.html' }
|
|
13
67
|
]);
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
68
|
+
RoutingServiceProvider.registerAction('history');
|
|
69
|
+
RoutingServiceProvider.registerAction('changes');
|
|
70
|
+
RoutingServiceProvider.registerAction('version');
|
|
17
71
|
}])
|
|
18
|
-
.controller('FngAuditHistCtrl', [
|
|
72
|
+
.controller('FngAuditHistCtrl', [
|
|
73
|
+
'$rootScope',
|
|
74
|
+
'$scope',
|
|
75
|
+
'$location',
|
|
76
|
+
'RoutingService',
|
|
77
|
+
'FngAuditService',
|
|
78
|
+
function ($rootScope, $scope, $location, RoutingService, FngAuditService) {
|
|
19
79
|
$scope.changes = [];
|
|
20
80
|
var path = $location.path();
|
|
21
|
-
angular.extend($scope,
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
81
|
+
angular.extend($scope, RoutingService.parsePathFunc()(path));
|
|
82
|
+
var modelAndForm = "".concat($scope.modelName).concat($scope.formName ? "/".concat($scope.formName) : '');
|
|
83
|
+
$scope.createDate = new Date(parseInt($scope.id.toString().substring(0, 8), 16) * 1000);
|
|
84
|
+
FngAuditService.getHist($scope.modelName, $scope.id, path.split('/').slice(-1)[0])
|
|
85
|
+
.then(function (result) {
|
|
86
|
+
var _a;
|
|
87
|
+
$scope.changes = result.data;
|
|
88
|
+
var users = {};
|
|
89
|
+
$scope.changes.forEach(function (c) {
|
|
90
|
+
if (c.user) {
|
|
91
|
+
users[c.user] = null;
|
|
92
|
+
}
|
|
93
|
+
});
|
|
94
|
+
(_a = $rootScope === null || $rootScope === void 0 ? void 0 : $rootScope.describeUsers(users)) === null || _a === void 0 ? void 0 : _a.then(function (usersDesribed) {
|
|
95
|
+
$scope.changes.forEach(function (c2) {
|
|
96
|
+
if (c2.user) {
|
|
97
|
+
c2.userDesc = usersDesribed[c2.user];
|
|
98
|
+
}
|
|
99
|
+
});
|
|
100
|
+
});
|
|
101
|
+
if ($scope.changes.length > 0) {
|
|
102
|
+
if ($scope.changes[$scope.changes.length - 1].operation !== 'create') {
|
|
103
|
+
$scope.inferCreate = true;
|
|
104
|
+
}
|
|
105
|
+
var lastURL_1 = 'view';
|
|
106
|
+
$scope.changes.forEach(function (c) {
|
|
107
|
+
c.url = lastURL_1;
|
|
108
|
+
if (typeof c.oldVersion !== "undefined") {
|
|
109
|
+
lastURL_1 = 'version/' + c.oldVersion;
|
|
110
|
+
}
|
|
111
|
+
});
|
|
112
|
+
}
|
|
113
|
+
else {
|
|
114
|
+
FngAuditService.checkValidItem($scope.modelName, $scope.id)
|
|
115
|
+
.then(function () { $scope.inferCreate = true; });
|
|
116
|
+
}
|
|
25
117
|
}, function (err) {
|
|
26
|
-
|
|
118
|
+
$scope.errorVisible = true;
|
|
119
|
+
$scope.alertTitle = err.statusText;
|
|
120
|
+
$scope.errorMessage = err.data;
|
|
27
121
|
});
|
|
28
|
-
$scope.buildHistUrl = function (
|
|
29
|
-
return
|
|
30
|
-
};
|
|
31
|
-
$scope.userDesc = function (change) {
|
|
32
|
-
return change.user ? ('User:' + change.user) : '';
|
|
122
|
+
$scope.buildHistUrl = function (lastPart) {
|
|
123
|
+
return RoutingService.buildUrl("".concat(modelAndForm, "/").concat($scope.id, "/").concat(lastPart));
|
|
33
124
|
};
|
|
34
|
-
}
|
|
35
|
-
|
|
125
|
+
}
|
|
126
|
+
])
|
|
127
|
+
.controller('FngAuditVerCtrl', [
|
|
128
|
+
'$scope',
|
|
129
|
+
'$location',
|
|
130
|
+
'RoutingService',
|
|
131
|
+
'FngAuditService',
|
|
132
|
+
function ($scope, $location, RoutingService, FngAuditService) {
|
|
36
133
|
$scope.record = [];
|
|
37
|
-
angular.extend($scope,
|
|
38
|
-
|
|
134
|
+
angular.extend($scope, RoutingService.parsePathFunc()($location.$$path));
|
|
135
|
+
FngAuditService.getVersion($scope.modelName, $scope.id, $scope.tab)
|
|
39
136
|
.then(function (results) {
|
|
40
|
-
|
|
137
|
+
// Check for a generated version 0 of a non existent item
|
|
138
|
+
if ($scope.tab === '0' && Object.keys(results.data).length === 1) {
|
|
139
|
+
$scope.errorVisible = true;
|
|
140
|
+
$scope.alertTitle = 'Error';
|
|
141
|
+
$scope.errorMessage = "No such ".concat($scope.modelName, " as ").concat($scope.id);
|
|
142
|
+
}
|
|
143
|
+
else {
|
|
144
|
+
$scope.version = results.data;
|
|
145
|
+
}
|
|
41
146
|
}, function (err) {
|
|
42
|
-
|
|
147
|
+
$scope.errorVisible = true;
|
|
148
|
+
$scope.alertTitle = err.statusText;
|
|
149
|
+
$scope.errorMessage = err.data;
|
|
43
150
|
});
|
|
44
151
|
$scope.buildHistUrl = function (change) {
|
|
45
|
-
return
|
|
152
|
+
return RoutingService.buildUrl($scope.modelName + '/' + $scope.id + '/version/' + change.oldVersion);
|
|
46
153
|
};
|
|
47
|
-
}
|
|
48
|
-
|
|
154
|
+
}
|
|
155
|
+
])
|
|
156
|
+
.service('FngAuditService', ['$http', function ($http) {
|
|
49
157
|
return {
|
|
50
|
-
getHist: function (
|
|
51
|
-
|
|
52
|
-
|
|
158
|
+
getHist: function (modelName_1, id_1) {
|
|
159
|
+
return __awaiter(this, arguments, void 0, function (modelName, id, histAction) {
|
|
160
|
+
if (histAction === void 0) { histAction = 'history'; }
|
|
161
|
+
return __generator(this, function (_a) {
|
|
162
|
+
return [2 /*return*/, $http.get("/api/".concat(modelName, "/").concat(id, "/").concat(histAction))];
|
|
163
|
+
});
|
|
164
|
+
});
|
|
53
165
|
},
|
|
54
166
|
getVersion: function (modelName, id, version) {
|
|
55
|
-
return $http.get("/api/"
|
|
167
|
+
return $http.get("/api/".concat(modelName, "/").concat(id, "/version/").concat(version));
|
|
168
|
+
},
|
|
169
|
+
checkValidItem: function (modelName, id) {
|
|
170
|
+
return $http.get("/api/".concat(modelName, "/").concat(id));
|
|
56
171
|
}
|
|
57
172
|
};
|
|
58
173
|
}]);
|
|
@@ -62,14 +177,18 @@ angular.module('fngAuditModule').run(['$templateCache', function($templateCache)
|
|
|
62
177
|
'use strict';
|
|
63
178
|
|
|
64
179
|
$templateCache.put('templates/base-history.html',
|
|
65
|
-
"<div ng-controller=FngAuditHistCtrl><div ng-class=\"css('rowFluid')\" class=\"page-header list-header\"><div class=header-lhs><h1>History for {{modelName}} {{id}}</h1></div></div><div class=\"page-body list-body\"><error-display></error-display><div ng-class=\"css('rowFluid')\"><a ng-repeat=\"change in changes\" ng-href={{buildHistUrl(change)}}><div class=list-item><div ng-class=\"css('span',12)\">{{ change.changedAt }} {{ change.comment }} {{ userDesc(change) }}</div></div></a></div></div></div>"
|
|
180
|
+
"<div ng-controller=FngAuditHistCtrl><div ng-class=\"css('rowFluid')\" class=\"page-header list-header\"><div class=header-lhs><h1>History for {{modelName}} {{id}}</h1></div></div><div class=\"page-body list-body\"><error-display></error-display><div ng-class=\"css('rowFluid')\"><a ng-repeat=\"change in changes\" ng-href={{buildHistUrl(change.url)}}><div class=list-item><div ng-class=\"css('span',12)\">{{ change.changedAt | date : 'yy-MM-dd HH:mm:ss' }} <span ng-if=change.chg title=\"{{ change.chg | json}}\"><changes> </span> {{ change.comment }} {{ change.userDesc || (change.user ? (' User: ' + change.user) : '' ) }}</div></div></a></div><div ng-class=\"css('rowFluid')\" ng-show=inferCreate><a ng-href=\"{{buildHistUrl('version/0')}}\"><div class=list-item><div ng-class=\"css('span',12)\">{{ createDate | date : 'yy-MM-dd HH:mm:ss' }} created</div></div></a></div></div></div>"
|
|
66
181
|
);
|
|
67
182
|
|
|
68
183
|
|
|
69
184
|
$templateCache.put('templates/base-version.html',
|
|
70
185
|
"<div ng-controller=FngAuditVerCtrl><div ng-class=\"css('rowFluid')\" class=\"page-header list-header\"><div class=header-lhs><h1>Version {{ tab }} for {{modelName}} {{id}}</h1></div></div><div class=\"page-body list-body\"><error-display></error-display><div ng-class=\"css('rowFluid')\"><pre>\n" +
|
|
71
|
-
"
|
|
72
|
-
"
|
|
186
|
+
"{{ version | json }}\n" +
|
|
187
|
+
"</pre></div></div></div>"
|
|
73
188
|
);
|
|
74
189
|
|
|
75
190
|
}]);
|
|
191
|
+
|
|
192
|
+
return null;
|
|
193
|
+
|
|
194
|
+
}));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fng-audit.js","sourceRoot":"","sources":["fng-audit.ts"],"names":[],"mappings":"AAAA,CAAC;IACG,YAAY,CAAC;IAEb,IAAI,WAAW,GAAQ,OAAO,CAAC,MAAM,CAAC,gBAAgB,EAAE,CAAC,cAAc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G,CAAC,IAAI,CAAC;YACnC,CAAC,CAAC,CAAC;YAEP,MAAM,CAAC,YAAY,GAAG,UAAU,MAAW;gBACvC,OAAO,cAAc,CAAC,QAAQ,CAAC,MAAM,CAAC,SAAS,GAAG,GAAG,GAAG,MAAM,CAAC,EAAE,GAAG,WAAW,GAAG,MAAM,CAAC,UAAU,CAAC,CAAA;YACxG,CAAC,CAAA;QAEL,CAAC;KAAC,CAAC;SACN,OAAO,CAAC,iBAAiB,EAAE,CAAC,OAAO,EAAE,UAAU,KAA2B;YACvE,OAAO;gBACH,OAAO,EAAE;wEAAgB,SAAiB,EAAE,EAAU,EAAE,UAAsB;wBAAtB,2BAAA,EAAA,sBAAsB;;4BAC1E,sBAAO,KAAK,CAAC,GAAG,CAAC,eAAQ,SAAS,cAAI,EAAE,cAAI,UAAU,CAAE,CAAC,EAAC;;;iBAC7D;gBACD,UAAU,EAAE,UAAU,SAAiB,EAAE,EAAU,EAAE,OAAe;oBAChE,OAAO,KAAK,CAAC,GAAG,CAAC,eAAQ,SAAS,cAAI,EAAE,sBAAY,OAAO,CAAE,CAAC,CAAC;gBACnE,CAAC;gBACD,cAAc,EAAE,UAAU,SAAiB,EAAE,EAAU;oBACnD,OAAO,KAAK,CAAC,GAAG,CAAC,eAAQ,SAAS,cAAI,EAAE,CAAE,CAAC,CAAC;gBAChD,CAAC;aACJ,CAAA;QACL,CAAC,CAAC,CAAC,CAAC;AAEZ,CAAC,CAAC,EAAE,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
((n,r)=>{void 0===n&&void 0!==window&&(n=window),"function"==typeof define&&define.amd?define(["angular","jsondiffpatch"],function(e,t){return n.null=r(e)}):"object"==typeof module&&module.exports?module.exports=r(require("angular"),require("jsondiffpatch")):n.null=r(n.angular,n.jsondiffpatch)})(this,function(s,e){var n=this&&this.__awaiter||function(e,s,a,l){return new(a=a||Promise)(function(n,t){function r(e){try{o(l.next(e))}catch(e){t(e)}}function i(e){try{o(l.throw(e))}catch(e){t(e)}}function o(e){var t;e.done?n(e.value):((t=e.value)instanceof a?t:new a(function(e){e(t)})).then(r,i)}o((l=l.apply(e,s||[])).next())})},o=this&&this.__generator||function(r,i){var o,s,a,l={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]},c=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return c.next=e(0),c.throw=e(1),c.return=e(2),"function"==typeof Symbol&&(c[Symbol.iterator]=function(){return this}),c;function e(n){return function(e){var t=[n,e];if(o)throw new TypeError("Generator is already executing.");for(;l=c&&t[c=0]?0:l;)try{if(o=1,s&&(a=2&t[0]?s.return:t[0]?s.throw||((a=s.return)&&a.call(s),0):s.next)&&!(a=a.call(s,t[1])).done)return a;switch(s=0,(t=a?[2&t[0],a.value]:t)[0]){case 0:case 1:a=t;break;case 4:return l.label++,{value:t[1],done:!1};case 5:l.label++,s=t[1],t=[0];continue;case 7:t=l.ops.pop(),l.trys.pop();continue;default:if(!(a=0<(a=l.trys).length&&a[a.length-1])&&(6===t[0]||2===t[0])){l=0;continue}if(3===t[0]&&(!a||t[1]>a[0]&&t[1]<a[3]))l.label=t[1];else if(6===t[0]&&l.label<a[1])l.label=a[1],a=t;else{if(!(a&&l.label<a[2])){a[2]&&l.ops.pop(),l.trys.pop();continue}l.label=a[2],l.ops.push(t)}}t=i.call(r,l)}catch(e){t=[6,e],s=0}finally{o=a=0}if(5&t[0])throw t[1];return{value:t[0]?t[1]:void 0,done:!0}}}};return s.module("fngAuditModule",["formsAngular"]).config(["RoutingServiceProvider",function(e){e.addRoutes(null,[{route:"/:model/:id/history",state:"model::history",templateUrl:"templates/base-history.html"},{route:"/:model/:form/:id/history",state:"model::history",templateUrl:"templates/base-history.html"},{route:"/:model/:id/changes",state:"model::history",templateUrl:"templates/base-history.html"},{route:"/:model/:form/:id/changes",state:"model::history",templateUrl:"templates/base-history.html"},{route:"/:model/:id/version/:version",state:"model::version",templateUrl:"templates/base-version.html"},{route:"/:model/:form/:id/version/:version",state:"model::version",templateUrl:"templates/base-version.html"}]),e.registerAction("history"),e.registerAction("changes"),e.registerAction("version")}]).controller("FngAuditHistCtrl",["$rootScope","$scope","$location","RoutingService","FngAuditService",function(r,i,e,t,o){i.changes=[];var e=e.path(),n=(s.extend(i,t.parsePathFunc()(e)),"".concat(i.modelName).concat(i.formName?"/".concat(i.formName):""));i.createDate=new Date(1e3*parseInt(i.id.toString().substring(0,8),16)),o.getHist(i.modelName,i.id,e.split("/").slice(-1)[0]).then(function(e){i.changes=e.data;var t,n={};i.changes.forEach(function(e){e.user&&(n[e.user]=null)}),null!=(e=null==r?void 0:r.describeUsers(n))&&e.then(function(t){i.changes.forEach(function(e){e.user&&(e.userDesc=t[e.user])})}),0<i.changes.length?("create"!==i.changes[i.changes.length-1].operation&&(i.inferCreate=!0),t="view",i.changes.forEach(function(e){e.url=t,void 0!==e.oldVersion&&(t="version/"+e.oldVersion)})):o.checkValidItem(i.modelName,i.id).then(function(){i.inferCreate=!0})},function(e){i.errorVisible=!0,i.alertTitle=e.statusText,i.errorMessage=e.data}),i.buildHistUrl=function(e){return t.buildUrl("".concat(n,"/").concat(i.id,"/").concat(e))}}]).controller("FngAuditVerCtrl",["$scope","$location","RoutingService","FngAuditService",function(t,e,n,r){t.record=[],s.extend(t,n.parsePathFunc()(e.$$path)),r.getVersion(t.modelName,t.id,t.tab).then(function(e){"0"===t.tab&&1===Object.keys(e.data).length?(t.errorVisible=!0,t.alertTitle="Error",t.errorMessage="No such ".concat(t.modelName," as ").concat(t.id)):t.version=e.data},function(e){t.errorVisible=!0,t.alertTitle=e.statusText,t.errorMessage=e.data}),t.buildHistUrl=function(e){return n.buildUrl(t.modelName+"/"+t.id+"/version/"+e.oldVersion)}}]).service("FngAuditService",["$http",function(i){return{getHist:function(e,t){return n(this,arguments,void 0,function(t,n,r){return void 0===r&&(r="history"),o(this,function(e){return[2,i.get("/api/".concat(t,"/").concat(n,"/").concat(r))]})})},getVersion:function(e,t,n){return i.get("/api/".concat(e,"/").concat(t,"/version/").concat(n))},checkValidItem:function(e,t){return i.get("/api/".concat(e,"/").concat(t))}}}]),s.module("fngAuditModule").run(["$templateCache",function(e){e.put("templates/base-history.html","<div ng-controller=FngAuditHistCtrl><div ng-class=\"css('rowFluid')\" class=\"page-header list-header\"><div class=header-lhs><h1>History for {{modelName}} {{id}}</h1></div></div><div class=\"page-body list-body\"><error-display></error-display><div ng-class=\"css('rowFluid')\"><a ng-repeat=\"change in changes\" ng-href={{buildHistUrl(change.url)}}><div class=list-item><div ng-class=\"css('span',12)\">{{ change.changedAt | date : 'yy-MM-dd HH:mm:ss' }} <span ng-if=change.chg title=\"{{ change.chg | json}}\"><changes> </span> {{ change.comment }} {{ change.userDesc || (change.user ? (' User: ' + change.user) : '' ) }}</div></div></a></div><div ng-class=\"css('rowFluid')\" ng-show=inferCreate><a ng-href=\"{{buildHistUrl('version/0')}}\"><div class=list-item><div ng-class=\"css('span',12)\">{{ createDate | date : 'yy-MM-dd HH:mm:ss' }} created</div></div></a></div></div></div>"),e.put("templates/base-version.html",'<div ng-controller=FngAuditVerCtrl><div ng-class="css(\'rowFluid\')" class="page-header list-header"><div class=header-lhs><h1>Version {{ tab }} for {{modelName}} {{id}}</h1></div></div><div class="page-body list-body"><error-display></error-display><div ng-class="css(\'rowFluid\')"><pre>\n{{ version | json }}\n</pre></div></div></div>')}]),null});
|