Feature/improve activities import dialog (#2016)
* Improve activities import dialog * Update changelog
This commit is contained in:
parent
6857e0314f
commit
206b6567fd
@ -11,6 +11,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|||||||
|
|
||||||
- Added support for localized routes in Spanish (`es`)
|
- Added support for localized routes in Spanish (`es`)
|
||||||
|
|
||||||
|
### Changed
|
||||||
|
|
||||||
|
- Improved the activities import dialog
|
||||||
|
|
||||||
## 1.273.0 - 2023-05-28
|
## 1.273.0 - 2023-05-28
|
||||||
|
|
||||||
### Added
|
### Added
|
||||||
|
@ -61,20 +61,18 @@
|
|||||||
[displayWith]="displayFn"
|
[displayWith]="displayFn"
|
||||||
(optionSelected)="onUpdateSymbol($event)"
|
(optionSelected)="onUpdateSymbol($event)"
|
||||||
>
|
>
|
||||||
<ng-container>
|
<mat-option
|
||||||
<mat-option
|
*ngFor="let lookupItem of filteredLookupItemsObservable | async"
|
||||||
*ngFor="let lookupItem of filteredLookupItemsObservable | async"
|
class="line-height-1"
|
||||||
class="line-height-1"
|
[value]="lookupItem"
|
||||||
[value]="lookupItem"
|
>
|
||||||
|
<span><b>{{ lookupItem.name }}</b></span>
|
||||||
|
<br />
|
||||||
|
<small class="text-muted"
|
||||||
|
>{{ lookupItem.symbol | gfSymbol }} · {{ lookupItem.currency
|
||||||
|
}}</small
|
||||||
>
|
>
|
||||||
<span><b>{{ lookupItem.name }}</b></span>
|
</mat-option>
|
||||||
<br />
|
|
||||||
<small class="text-muted"
|
|
||||||
>{{ lookupItem.symbol | gfSymbol }} · {{ lookupItem.currency
|
|
||||||
}}</small
|
|
||||||
>
|
|
||||||
</mat-option>
|
|
||||||
</ng-container>
|
|
||||||
</mat-autocomplete>
|
</mat-autocomplete>
|
||||||
<mat-spinner *ngIf="isLoading" matSuffix [diameter]="20"></mat-spinner>
|
<mat-spinner *ngIf="isLoading" matSuffix [diameter]="20"></mat-spinner>
|
||||||
</mat-form-field>
|
</mat-form-field>
|
||||||
|
@ -37,6 +37,7 @@ export class ImportActivitiesDialog implements OnDestroy {
|
|||||||
public activities: Activity[] = [];
|
public activities: Activity[] = [];
|
||||||
public details: any[] = [];
|
public details: any[] = [];
|
||||||
public deviceType: string;
|
public deviceType: string;
|
||||||
|
public dialogTitle = $localize`Import Activities`;
|
||||||
public errorMessages: string[] = [];
|
public errorMessages: string[] = [];
|
||||||
public holdings: Position[] = [];
|
public holdings: Position[] = [];
|
||||||
public importStep: ImportStep = ImportStep.UPLOAD_FILE;
|
public importStep: ImportStep = ImportStep.UPLOAD_FILE;
|
||||||
@ -72,6 +73,7 @@ export class ImportActivitiesDialog implements OnDestroy {
|
|||||||
this.data?.activityTypes?.length === 1 &&
|
this.data?.activityTypes?.length === 1 &&
|
||||||
this.data?.activityTypes?.[0] === 'DIVIDEND'
|
this.data?.activityTypes?.[0] === 'DIVIDEND'
|
||||||
) {
|
) {
|
||||||
|
this.dialogTitle = $localize`Import Dividends`;
|
||||||
this.mode = 'DIVIDEND';
|
this.mode = 'DIVIDEND';
|
||||||
this.uniqueAssetForm.controls['uniqueAsset'].disable();
|
this.uniqueAssetForm.controls['uniqueAsset'].disable();
|
||||||
|
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
<gf-dialog-header
|
<gf-dialog-header
|
||||||
mat-dialog-title
|
mat-dialog-title
|
||||||
[deviceType]="data.deviceType"
|
[deviceType]="data.deviceType"
|
||||||
[title]="errorMessages.length === 0 ? 'Import Activities' : 'Import Activities Error'"
|
[title]="dialogTitle"
|
||||||
(closeButtonClicked)="onCancel()"
|
(closeButtonClicked)="onCancel()"
|
||||||
></gf-dialog-header>
|
></gf-dialog-header>
|
||||||
|
|
||||||
@ -15,7 +15,14 @@
|
|||||||
(selectionChange)="onImportStepChange($event)"
|
(selectionChange)="onImportStepChange($event)"
|
||||||
>
|
>
|
||||||
<mat-step [completed]="importStep === 0" [selected]="importStep === 0">
|
<mat-step [completed]="importStep === 0" [selected]="importStep === 0">
|
||||||
<ng-template i18n matStepLabel>Select File</ng-template>
|
<ng-template matStepLabel>
|
||||||
|
<ng-container *ngIf="mode === 'DIVIDEND'" i18n
|
||||||
|
>Select Holding</ng-container
|
||||||
|
>
|
||||||
|
<ng-container *ngIf="mode !== 'DIVIDEND'" i18n
|
||||||
|
>Select File</ng-container
|
||||||
|
>
|
||||||
|
</ng-template>
|
||||||
<div class="pt-3">
|
<div class="pt-3">
|
||||||
<ng-container *ngIf="mode === 'DIVIDEND'; else selectFile">
|
<ng-container *ngIf="mode === 'DIVIDEND'; else selectFile">
|
||||||
<form
|
<form
|
||||||
@ -27,9 +34,16 @@
|
|||||||
<mat-select formControlName="uniqueAsset">
|
<mat-select formControlName="uniqueAsset">
|
||||||
<mat-option
|
<mat-option
|
||||||
*ngFor="let holding of holdings"
|
*ngFor="let holding of holdings"
|
||||||
|
class="line-height-1"
|
||||||
[value]="{dataSource: holding.dataSource, symbol: holding.symbol}"
|
[value]="{dataSource: holding.dataSource, symbol: holding.symbol}"
|
||||||
>{{ holding.name }}</mat-option
|
|
||||||
>
|
>
|
||||||
|
<span><b>{{ holding.name }}</b></span>
|
||||||
|
<br />
|
||||||
|
<small class="text-muted"
|
||||||
|
>{{ holding.symbol | gfSymbol }} · {{ holding.currency
|
||||||
|
}}</small
|
||||||
|
>
|
||||||
|
</mat-option>
|
||||||
</mat-select>
|
</mat-select>
|
||||||
</mat-form-field>
|
</mat-form-field>
|
||||||
<div class="d-flex flex-column justify-content-center">
|
<div class="d-flex flex-column justify-content-center">
|
||||||
@ -77,7 +91,14 @@
|
|||||||
</mat-step>
|
</mat-step>
|
||||||
|
|
||||||
<mat-step [completed]="importStep === 1" [selected]="importStep === 1">
|
<mat-step [completed]="importStep === 1" [selected]="importStep === 1">
|
||||||
<ng-template i18n matStepLabel>Select Activities</ng-template>
|
<ng-template matStepLabel>
|
||||||
|
<ng-container *ngIf="mode === 'DIVIDEND'" i18n
|
||||||
|
>Select Dividends</ng-container
|
||||||
|
>
|
||||||
|
<ng-container *ngIf="mode !== 'DIVIDEND'" i18n
|
||||||
|
>Select Activities</ng-container
|
||||||
|
>
|
||||||
|
</ng-template>
|
||||||
<div class="pt-3">
|
<div class="pt-3">
|
||||||
<ng-container *ngIf="errorMessages.length === 0; else errorMessage">
|
<ng-container *ngIf="errorMessages.length === 0; else errorMessage">
|
||||||
<gf-activities-table
|
<gf-activities-table
|
||||||
|
@ -9,6 +9,7 @@ import { MatSelectModule } from '@angular/material/select';
|
|||||||
import { MatStepperModule } from '@angular/material/stepper';
|
import { MatStepperModule } from '@angular/material/stepper';
|
||||||
import { GfDialogFooterModule } from '@ghostfolio/client/components/dialog-footer/dialog-footer.module';
|
import { GfDialogFooterModule } from '@ghostfolio/client/components/dialog-footer/dialog-footer.module';
|
||||||
import { GfDialogHeaderModule } from '@ghostfolio/client/components/dialog-header/dialog-header.module';
|
import { GfDialogHeaderModule } from '@ghostfolio/client/components/dialog-header/dialog-header.module';
|
||||||
|
import { GfSymbolModule } from '@ghostfolio/client/pipes/symbol/symbol.module';
|
||||||
import { GfActivitiesTableModule } from '@ghostfolio/ui/activities-table/activities-table.module';
|
import { GfActivitiesTableModule } from '@ghostfolio/ui/activities-table/activities-table.module';
|
||||||
|
|
||||||
import { ImportActivitiesDialog } from './import-activities-dialog.component';
|
import { ImportActivitiesDialog } from './import-activities-dialog.component';
|
||||||
@ -21,6 +22,7 @@ import { ImportActivitiesDialog } from './import-activities-dialog.component';
|
|||||||
GfActivitiesTableModule,
|
GfActivitiesTableModule,
|
||||||
GfDialogFooterModule,
|
GfDialogFooterModule,
|
||||||
GfDialogHeaderModule,
|
GfDialogHeaderModule,
|
||||||
|
GfSymbolModule,
|
||||||
MatButtonModule,
|
MatButtonModule,
|
||||||
MatDialogModule,
|
MatDialogModule,
|
||||||
MatExpansionModule,
|
MatExpansionModule,
|
||||||
|
@ -13,7 +13,7 @@
|
|||||||
(click)="onImport()"
|
(click)="onImport()"
|
||||||
>
|
>
|
||||||
<ion-icon class="mr-2" name="cloud-upload-outline"></ion-icon>
|
<ion-icon class="mr-2" name="cloud-upload-outline"></ion-icon>
|
||||||
<span i18n>Import Activities...</span>
|
<ng-container i18n>Import Activities</ng-container>...
|
||||||
</button>
|
</button>
|
||||||
<button
|
<button
|
||||||
*ngIf="hasPermissionToExportActivities"
|
*ngIf="hasPermissionToExportActivities"
|
||||||
@ -31,7 +31,7 @@
|
|||||||
(click)="onImportDividends()"
|
(click)="onImportDividends()"
|
||||||
>
|
>
|
||||||
<ion-icon class="mr-2" name="color-wand-outline"></ion-icon>
|
<ion-icon class="mr-2" name="color-wand-outline"></ion-icon>
|
||||||
<span i18n>Import Dividends...</span>
|
<ng-container i18n>Import Dividends</ng-container>...
|
||||||
</button>
|
</button>
|
||||||
<button
|
<button
|
||||||
*ngIf="hasPermissionToExportActivities"
|
*ngIf="hasPermissionToExportActivities"
|
||||||
@ -463,7 +463,7 @@
|
|||||||
(click)="onImport()"
|
(click)="onImport()"
|
||||||
>
|
>
|
||||||
<ion-icon class="mr-2" name="cloud-upload-outline"></ion-icon>
|
<ion-icon class="mr-2" name="cloud-upload-outline"></ion-icon>
|
||||||
<span i18n>Import Activities...</span>
|
<ng-container i18n>Import Activities</ng-container>...
|
||||||
</button>
|
</button>
|
||||||
<button
|
<button
|
||||||
*ngIf="hasPermissionToCreateActivity"
|
*ngIf="hasPermissionToCreateActivity"
|
||||||
@ -472,7 +472,7 @@
|
|||||||
(click)="onImportDividends()"
|
(click)="onImportDividends()"
|
||||||
>
|
>
|
||||||
<ion-icon class="mr-2" name="color-wand-outline"></ion-icon>
|
<ion-icon class="mr-2" name="color-wand-outline"></ion-icon>
|
||||||
<span i18n>Import Dividends...</span>
|
<ng-container i18n>Import Dividends</ng-container>...
|
||||||
</button>
|
</button>
|
||||||
<button
|
<button
|
||||||
*ngIf="hasPermissionToExportActivities"
|
*ngIf="hasPermissionToExportActivities"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user