refs #5517, #5667 Fix crudModel status, log fixes
gitea/salix/pipeline/head This commit looks good
Details
gitea/salix/pipeline/head This commit looks good
Details
This commit is contained in:
parent
4818e985ff
commit
d0c8be5697
|
@ -139,7 +139,7 @@ export default class CrudModel extends ModelProxy {
|
|||
filter.limit = this.page * this.limit;
|
||||
}
|
||||
|
||||
return this.sendRequest(filter, append, true);
|
||||
return this.sendRequest(filter, append);
|
||||
}
|
||||
|
||||
clear() {
|
||||
|
@ -231,12 +231,12 @@ export default class CrudModel extends ModelProxy {
|
|||
return params;
|
||||
}
|
||||
|
||||
sendRequest(filter, append, loadMore) {
|
||||
sendRequest(filter, append) {
|
||||
this.cancelRequest();
|
||||
this.canceler = this.$q.defer();
|
||||
this.isPaging = append;
|
||||
|
||||
if (!loadMore)
|
||||
if (!append && this.status != 'ready')
|
||||
this.status = 'loading';
|
||||
|
||||
let params = Object.assign(
|
||||
|
|
|
@ -150,7 +150,7 @@ describe('Component vnCrudModel', () => {
|
|||
|
||||
controller.loadMore(true);
|
||||
|
||||
expect(controller.sendRequest).toHaveBeenCalledWith({'skip': 2}, true, true);
|
||||
expect(controller.sendRequest).toHaveBeenCalledWith({'skip': 2}, true);
|
||||
});
|
||||
});
|
||||
|
||||
|
|
|
@ -7,11 +7,10 @@ export default class DataViewer {
|
|||
}
|
||||
|
||||
get status() {
|
||||
if (this.model)
|
||||
return this.model.status;
|
||||
|
||||
if (this.isLoading)
|
||||
return 'loading';
|
||||
if (this.model)
|
||||
return this.model.status;
|
||||
if (!this.data)
|
||||
return 'clear';
|
||||
if (this.data.length)
|
||||
|
|
|
@ -14,9 +14,12 @@
|
|||
order="changedModel"
|
||||
auto-load="true">
|
||||
</vn-crud-model>
|
||||
<vn-data-viewer model="model" class="vn-w-md vn-px-sm">
|
||||
<vn-data-viewer
|
||||
model="model"
|
||||
is-loading="model.isLoading"
|
||||
class="vn-w-md vn-px-sm">
|
||||
<div class="change vn-mb-sm" ng-repeat="log in $ctrl.logs">
|
||||
<div class="user-wrapper">
|
||||
<div class="left">
|
||||
<vn-avatar class="vn-mt-xs"
|
||||
ng-class="::{system: !log.user}"
|
||||
val="{{::log.user ? log.user.nickname : 'System'}}"
|
||||
|
@ -33,7 +36,7 @@
|
|||
<div class="header vn-mb-sm">
|
||||
<div
|
||||
class="date text-secondary text-caption"
|
||||
title="{{::log.creationDate | date:'dd/MM/yyyy HH:mm'}}">
|
||||
title="{{::log.creationDate | date:'dd/MM/yyyy HH:mm:ss'}}">
|
||||
{{::$ctrl.relativeDate(log.creationDate)}}
|
||||
</div>
|
||||
<span class="chip" ng-class="::$ctrl.actionsClass[log.action]" translate>
|
||||
|
|
|
@ -4,7 +4,7 @@ vn-log {
|
|||
.change {
|
||||
display: flex;
|
||||
|
||||
& > .user-wrapper {
|
||||
& > .left {
|
||||
position: relative;
|
||||
padding-right: 10px;
|
||||
|
||||
|
@ -34,7 +34,7 @@ vn-log {
|
|||
bottom: -8px;
|
||||
}
|
||||
}
|
||||
&:last-child > .user-wrapper > .line {
|
||||
&:last-child > .left > .line {
|
||||
display: none;
|
||||
}
|
||||
.detail {
|
||||
|
|
Loading…
Reference in New Issue