fixes #4866 más detalle en faltas #1201

Merged
alexandre merged 14 commits from 4866-detalle-faltas into dev 2023-01-17 07:37:50 +00:00
2 changed files with 12 additions and 4 deletions
Showing only changes of commit 1982e4c989 - Show all commits

View File

@ -3,6 +3,8 @@
url="{{$ctrl.url}}"
filter="$ctrl.filter"
link="{originFk: $ctrl.originId}"
where="{changedModel: $ctrl.changedModel,
changedModelId: $ctrl.changedModelId}"
data="$ctrl.logs"
limit="20"
auto-load="true">
@ -14,9 +16,9 @@
<vn-tr>
<vn-th field="creationDate">Date</vn-th>
<vn-th field="userFk" shrink>User</vn-th>
<vn-th field="changedModel">Model</vn-th>
<vn-th field="changedModel" ng-if="$ctrl.showModelName">Model</vn-th>
<vn-th field="action" shrink>Action</vn-th>
<vn-th field="changedModelValue">Name</vn-th>
<vn-th field="changedModelValue" ng-if="$ctrl.showModelName">Name</vn-th>
<vn-th expand>Changes</vn-th>
</vn-tr>
</vn-thead>
@ -31,13 +33,13 @@
translate>{{::log.user.name || 'System' | translate}}
</span>
</vn-td>
<vn-td>
<vn-td ng-if="$ctrl.showModelName">
{{::log.changedModel}}
</vn-td>
<vn-td translate>
{{::$ctrl.actionsText[log.action]}}
</vn-td>
<vn-td expand>
<vn-td expand ng-if="$ctrl.showModelName">
{{::log.changedModelValue}}
</vn-td>
<vn-td expand>

View File

@ -57,6 +57,10 @@ export default class Controller extends Section {
}
}
get showModelName() {
return !(this.changedModel && this.changedModelId);
}
formatValue(value) {
if (typeof value === 'string' && validDate.test(value))
value = new Date(value);
@ -86,6 +90,8 @@ ngModule.vnComponent('vnLog', {
bindings: {
model: '<',
originId: '<',
changedModel: '<?',
changedModelId: '<?',
url: '@'
}
});