deposit reverts fix (#496)

This commit is contained in:
Denis Ezhov 2021-06-25 15:11:49 +03:00 committed by GitHub
parent 72514c3b4f
commit bd5f01a8cf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 30 additions and 34 deletions

View File

@ -7,7 +7,7 @@
"build": "ng build --prod --extraWebpackConfig webpack.extra.js --progress=false",
"test": "ng test",
"test-ci": "ng run dashboard:test-ci",
"lint": "eslint \"src/**/*.{ts,js,html}\" --max-warnings 2174 --cache",
"lint": "eslint \"src/**/*.{ts,js,html}\" --max-warnings 2171 --cache",
"lint-errors": "npm run lint -- --quiet",
"lint-fix": "npm run lint -- --fix",
"e2e": "ng e2e",

View File

@ -1,37 +1,30 @@
<div fxLayout="column" fxLayoutGap="24px">
<ng-container *ngTemplateOutlet="revertsList"></ng-container>
<ng-container *ngIf="!(isLoading$ | async); else loading">
<dsh-show-more-panel *ngIf="hasMore$ | async" (showMore)="fetchMore()"></dsh-show-more-panel>
</ng-container>
</div>
<ng-template #loading>
<div fxLayout fxFlexAlign="center">
<dsh-spinner size="24"></dsh-spinner>
<div *transloco="let t; scope: 'deposit-reverts'; read: 'depositReverts'" fxLayout="column" fxLayoutGap="24px">
<div class="mat-title">
{{ t('reverts') }}
</div>
<div *ngIf="isLoading$ | async">
{{ t('loading') }}
</div>
</ng-template>
<ng-template #revertsList>
<ng-container *ngIf="reverts$ | async as reverts">
<ng-container *transloco="let t; scope: 'deposit-reverts'; read: 'depositReverts'">
<div class="mat-title">
{{ t('reverts') }}
</div>
<div *ngIf="reverts.length === 0 && !(isLoading$ | async)">
{{ t('noReverts') }}
</div>
<ng-container *ngIf="reverts.length > 0">
<div *ngFor="let revert of reverts; let i = index" fxLayout="column" fxLayoutGap="24px">
<mat-divider *ngIf="i > 0"></mat-divider>
<div
class="mat-subheading-2"
*transloco="let t; scope: 'deposit-revert-info'; read: 'depositRevertInfo'"
>
{{ t('revert') }} #{{ revert.id }}
</div>
<dsh-deposit-revert-details [revert]="revert"></dsh-deposit-revert-details>
<div *ngIf="reverts.length === 0 && !(isLoading$ | async)">
{{ t('noReverts') }}
</div>
<ng-container *ngIf="reverts.length > 0">
<div *ngFor="let revert of reverts; let i = index" fxLayout="column" fxLayoutGap="24px">
<mat-divider *ngIf="i > 0"></mat-divider>
<div
class="mat-subheading-2"
*transloco="let t; scope: 'deposit-revert-info'; read: 'depositRevertInfo'"
>
{{ t('revert') }} #{{ revert.id }}
</div>
</ng-container>
<dsh-deposit-revert-details [revert]="revert"></dsh-deposit-revert-details>
</div>
</ng-container>
</ng-container>
</ng-template>
<button *ngIf="(hasMore$ | async) && !(isLoading$ | async)" dsh-button (click)="fetchMore()">
<ng-container *transloco="let c">
{{ c('showMore') }}
</ng-container>
</button>
</div>

View File

@ -5,6 +5,7 @@ import { MatDividerModule } from '@angular/material/divider';
import { TranslocoModule } from '@ngneat/transloco';
import { DepositRevertDetailsModule } from '@dsh/app/shared';
import { ButtonModule } from '@dsh/components/buttons';
import { IndicatorsModule } from '@dsh/components/indicators';
import { ShowMorePanelModule } from '@dsh/components/show-more-panel';
@ -20,6 +21,7 @@ import { DepositRevertsComponent } from './deposit-reverts.component';
MatDividerModule,
DepositRevertDetailsModule,
TranslocoModule,
ButtonModule,
],
exports: [DepositRevertsComponent],
})

View File

@ -1,4 +1,5 @@
{
"reverts": "Отмены",
"noReverts": "Отмены отсутствуют"
"noReverts": "Отмены отсутствуют",
"loading": "Загрузка..."
}