|
|
|
@ -5,123 +5,152 @@
|
|
|
|
|
(closeButtonClicked)="onCancel()"
|
|
|
|
|
></gf-dialog-header>
|
|
|
|
|
|
|
|
|
|
<div class="flex-grow-1 py-3" mat-dialog-content>
|
|
|
|
|
<ng-container *ngIf="!isFileSelected">
|
|
|
|
|
<ng-container *ngIf="mode === 'DIVIDEND'; else selectFile">
|
|
|
|
|
<form [formGroup]="uniqueAssetForm" (ngSubmit)="onLoadDividends()">
|
|
|
|
|
<mat-form-field appearance="outline" class="w-100">
|
|
|
|
|
<mat-label i18n>Holding</mat-label>
|
|
|
|
|
<mat-select formControlName="uniqueAsset">
|
|
|
|
|
<mat-option
|
|
|
|
|
*ngFor="let holding of holdings"
|
|
|
|
|
[value]="{dataSource: holding.dataSource, symbol: holding.symbol}"
|
|
|
|
|
>{{ holding.name }}</mat-option
|
|
|
|
|
>
|
|
|
|
|
</mat-select>
|
|
|
|
|
</mat-form-field>
|
|
|
|
|
<div class="d-flex justify-content-center flex-column">
|
|
|
|
|
<button
|
|
|
|
|
color="primary"
|
|
|
|
|
mat-flat-button
|
|
|
|
|
type="submit"
|
|
|
|
|
[disabled]="!uniqueAssetForm.valid"
|
|
|
|
|
>
|
|
|
|
|
<span i18n>Load Dividends</span>
|
|
|
|
|
</button>
|
|
|
|
|
</div>
|
|
|
|
|
</form>
|
|
|
|
|
</ng-container>
|
|
|
|
|
<ng-template #selectFile>
|
|
|
|
|
<div class="d-flex justify-content-center flex-column">
|
|
|
|
|
<button
|
|
|
|
|
class="py-4"
|
|
|
|
|
color="primary"
|
|
|
|
|
mat-stroked-button
|
|
|
|
|
(click)="onSelectFile()"
|
|
|
|
|
>
|
|
|
|
|
<ion-icon class="mr-2" name="cloud-upload-outline"></ion-icon>
|
|
|
|
|
<span i18n>Choose File</span>
|
|
|
|
|
</button>
|
|
|
|
|
<p class="mb-0 mt-4 text-center">
|
|
|
|
|
<span class="mr-1" i18n
|
|
|
|
|
>The following file formats are supported:</span
|
|
|
|
|
>
|
|
|
|
|
<a
|
|
|
|
|
href="https://github.com/ghostfolio/ghostfolio/blob/main/test/import/ok.csv"
|
|
|
|
|
target="_blank"
|
|
|
|
|
>CSV</a
|
|
|
|
|
>
|
|
|
|
|
<span class="mx-1" i18n>or</span>
|
|
|
|
|
<a
|
|
|
|
|
href="https://github.com/ghostfolio/ghostfolio/blob/main/test/import/ok.json"
|
|
|
|
|
target="_blank"
|
|
|
|
|
>JSON</a
|
|
|
|
|
<div class="flex-grow-1" mat-dialog-content>
|
|
|
|
|
<mat-stepper
|
|
|
|
|
#stepper
|
|
|
|
|
[animationDuration]="0"
|
|
|
|
|
[linear]="true"
|
|
|
|
|
[orientation]="stepperOrientation"
|
|
|
|
|
[selectedIndex]="importStep"
|
|
|
|
|
(selectionChange)="onImportStepChange($event)"
|
|
|
|
|
>
|
|
|
|
|
<mat-step [completed]="importStep === 0" [selected]="importStep === 0">
|
|
|
|
|
<ng-template i18n matStepLabel>Select File</ng-template>
|
|
|
|
|
<div class="pt-3">
|
|
|
|
|
<ng-container *ngIf="mode === 'DIVIDEND'; else selectFile">
|
|
|
|
|
<form
|
|
|
|
|
[formGroup]="uniqueAssetForm"
|
|
|
|
|
(ngSubmit)="onLoadDividends(stepper)"
|
|
|
|
|
>
|
|
|
|
|
</p>
|
|
|
|
|
</div>
|
|
|
|
|
</ng-template>
|
|
|
|
|
</ng-container>
|
|
|
|
|
<ng-container *ngIf="isFileSelected">
|
|
|
|
|
<ng-container *ngIf="errorMessages.length === 0; else errorMessage">
|
|
|
|
|
<gf-activities-table
|
|
|
|
|
[activities]="activities"
|
|
|
|
|
[baseCurrency]="data?.user?.settings?.baseCurrency"
|
|
|
|
|
[deviceType]="data?.deviceType"
|
|
|
|
|
[hasPermissionToCreateActivity]="false"
|
|
|
|
|
[hasPermissionToExportActivities]="false"
|
|
|
|
|
[hasPermissionToFilter]="false"
|
|
|
|
|
[hasPermissionToOpenDetails]="false"
|
|
|
|
|
[locale]="data?.user?.settings?.locale"
|
|
|
|
|
[pageSize]="maxSafeInteger"
|
|
|
|
|
[showActions]="false"
|
|
|
|
|
[showCheckbox]="true"
|
|
|
|
|
[showFooter]="false"
|
|
|
|
|
[showSymbolColumn]="false"
|
|
|
|
|
(selectedActivities)="updateSelection($event)"
|
|
|
|
|
></gf-activities-table>
|
|
|
|
|
</ng-container>
|
|
|
|
|
<ng-template #errorMessage>
|
|
|
|
|
<mat-accordion displayMode="flat">
|
|
|
|
|
<mat-expansion-panel
|
|
|
|
|
*ngFor="let message of errorMessages; let i = index"
|
|
|
|
|
[disabled]="!details[i]"
|
|
|
|
|
>
|
|
|
|
|
<mat-expansion-panel-header class="pl-1">
|
|
|
|
|
<mat-panel-title>
|
|
|
|
|
<div class="d-flex">
|
|
|
|
|
<div class="align-items-center d-flex mr-2">
|
|
|
|
|
<ion-icon name="warning-outline"></ion-icon>
|
|
|
|
|
</div>
|
|
|
|
|
<div>{{ message }}</div>
|
|
|
|
|
</div>
|
|
|
|
|
</mat-panel-title>
|
|
|
|
|
</mat-expansion-panel-header>
|
|
|
|
|
<pre
|
|
|
|
|
*ngIf="details[i]"
|
|
|
|
|
class="m-0"
|
|
|
|
|
><code>{{ details[i] | json }}</code></pre>
|
|
|
|
|
</mat-expansion-panel>
|
|
|
|
|
</mat-accordion>
|
|
|
|
|
<div class="mt-2">
|
|
|
|
|
<button mat-button (click)="onReset()">
|
|
|
|
|
<ion-icon class="mr-2" name="arrow-back-outline"></ion-icon>
|
|
|
|
|
<span i18n>Back</span>
|
|
|
|
|
</button>
|
|
|
|
|
<mat-form-field appearance="outline" class="w-100">
|
|
|
|
|
<mat-label i18n>Holding</mat-label>
|
|
|
|
|
<mat-select formControlName="uniqueAsset">
|
|
|
|
|
<mat-option
|
|
|
|
|
*ngFor="let holding of holdings"
|
|
|
|
|
[value]="{dataSource: holding.dataSource, symbol: holding.symbol}"
|
|
|
|
|
>{{ holding.name }}</mat-option
|
|
|
|
|
>
|
|
|
|
|
</mat-select>
|
|
|
|
|
</mat-form-field>
|
|
|
|
|
<div class="d-flex flex-column justify-content-center">
|
|
|
|
|
<button
|
|
|
|
|
color="primary"
|
|
|
|
|
mat-flat-button
|
|
|
|
|
type="submit"
|
|
|
|
|
[disabled]="!uniqueAssetForm.valid"
|
|
|
|
|
>
|
|
|
|
|
<span i18n>Load Dividends</span>
|
|
|
|
|
</button>
|
|
|
|
|
</div>
|
|
|
|
|
</form>
|
|
|
|
|
</ng-container>
|
|
|
|
|
<ng-template #selectFile>
|
|
|
|
|
<div class="d-flex flex-column justify-content-center">
|
|
|
|
|
<button
|
|
|
|
|
class="py-4"
|
|
|
|
|
color="primary"
|
|
|
|
|
mat-stroked-button
|
|
|
|
|
(click)="onSelectFile(stepper)"
|
|
|
|
|
>
|
|
|
|
|
<ion-icon class="mr-2" name="cloud-upload-outline"></ion-icon>
|
|
|
|
|
<span i18n>Choose File</span>
|
|
|
|
|
</button>
|
|
|
|
|
<p class="mb-0 mt-4 text-center">
|
|
|
|
|
<span class="mr-1" i18n
|
|
|
|
|
>The following file formats are supported:</span
|
|
|
|
|
>
|
|
|
|
|
<a
|
|
|
|
|
href="https://github.com/ghostfolio/ghostfolio/blob/main/test/import/ok.csv"
|
|
|
|
|
target="_blank"
|
|
|
|
|
>CSV</a
|
|
|
|
|
>
|
|
|
|
|
<span class="mx-1" i18n>or</span>
|
|
|
|
|
<a
|
|
|
|
|
href="https://github.com/ghostfolio/ghostfolio/blob/main/test/import/ok.json"
|
|
|
|
|
target="_blank"
|
|
|
|
|
>JSON</a
|
|
|
|
|
>
|
|
|
|
|
</p>
|
|
|
|
|
</div>
|
|
|
|
|
</ng-template>
|
|
|
|
|
</div>
|
|
|
|
|
</ng-template>
|
|
|
|
|
</ng-container>
|
|
|
|
|
</div>
|
|
|
|
|
</mat-step>
|
|
|
|
|
|
|
|
|
|
<div *ngIf="isFileSelected" class="justify-content-end" mat-dialog-actions>
|
|
|
|
|
<button i18n mat-button (click)="onCancel()">Cancel</button>
|
|
|
|
|
<button
|
|
|
|
|
color="primary"
|
|
|
|
|
mat-flat-button
|
|
|
|
|
[disabled]="!selectedActivities?.length"
|
|
|
|
|
(click)="onImportActivities()"
|
|
|
|
|
>
|
|
|
|
|
<ng-container i18n>Import</ng-container>
|
|
|
|
|
</button>
|
|
|
|
|
<mat-step [completed]="importStep === 1" [selected]="importStep === 1">
|
|
|
|
|
<ng-template i18n matStepLabel>Select Activities</ng-template>
|
|
|
|
|
<div class="pt-3">
|
|
|
|
|
<ng-container *ngIf="errorMessages.length === 0; else errorMessage">
|
|
|
|
|
<gf-activities-table
|
|
|
|
|
*ngIf="importStep === 1"
|
|
|
|
|
[activities]="activities"
|
|
|
|
|
[baseCurrency]="data?.user?.settings?.baseCurrency"
|
|
|
|
|
[deviceType]="data?.deviceType"
|
|
|
|
|
[hasPermissionToCreateActivity]="false"
|
|
|
|
|
[hasPermissionToExportActivities]="false"
|
|
|
|
|
[hasPermissionToFilter]="false"
|
|
|
|
|
[hasPermissionToOpenDetails]="false"
|
|
|
|
|
[locale]="data?.user?.settings?.locale"
|
|
|
|
|
[pageSize]="maxSafeInteger"
|
|
|
|
|
[showActions]="false"
|
|
|
|
|
[showCheckbox]="true"
|
|
|
|
|
[showFooter]="false"
|
|
|
|
|
[showSymbolColumn]="false"
|
|
|
|
|
(selectedActivities)="updateSelection($event)"
|
|
|
|
|
></gf-activities-table>
|
|
|
|
|
<div class="d-flex justify-content-end mt-3">
|
|
|
|
|
<button mat-button (click)="onReset(stepper)">
|
|
|
|
|
<ng-container i18n>Back</ng-container>
|
|
|
|
|
</button>
|
|
|
|
|
<button
|
|
|
|
|
class="ml-1"
|
|
|
|
|
color="primary"
|
|
|
|
|
mat-flat-button
|
|
|
|
|
[disabled]="!selectedActivities?.length"
|
|
|
|
|
(click)="onImportActivities()"
|
|
|
|
|
>
|
|
|
|
|
<ng-container i18n>Import</ng-container>
|
|
|
|
|
</button>
|
|
|
|
|
</div>
|
|
|
|
|
</ng-container>
|
|
|
|
|
<ng-template #errorMessage>
|
|
|
|
|
<mat-accordion displayMode="flat">
|
|
|
|
|
<mat-expansion-panel
|
|
|
|
|
*ngFor="let message of errorMessages; let i = index"
|
|
|
|
|
[disabled]="!details[i]"
|
|
|
|
|
>
|
|
|
|
|
<mat-expansion-panel-header class="pl-1">
|
|
|
|
|
<mat-panel-title>
|
|
|
|
|
<div class="d-flex">
|
|
|
|
|
<div class="align-items-center d-flex mr-2">
|
|
|
|
|
<ion-icon name="warning-outline"></ion-icon>
|
|
|
|
|
</div>
|
|
|
|
|
<div>{{ message }}</div>
|
|
|
|
|
</div>
|
|
|
|
|
</mat-panel-title>
|
|
|
|
|
</mat-expansion-panel-header>
|
|
|
|
|
<pre
|
|
|
|
|
*ngIf="details[i]"
|
|
|
|
|
class="m-0"
|
|
|
|
|
><code>{{ details[i] | json }}</code></pre>
|
|
|
|
|
</mat-expansion-panel>
|
|
|
|
|
</mat-accordion>
|
|
|
|
|
<div class="d-flex justify-content-end mt-3">
|
|
|
|
|
<button mat-button (click)="onReset(stepper)">
|
|
|
|
|
<ng-container i18n>Back</ng-container>
|
|
|
|
|
</button>
|
|
|
|
|
<button
|
|
|
|
|
class="ml-1"
|
|
|
|
|
color="primary"
|
|
|
|
|
mat-flat-button
|
|
|
|
|
[disabled]="true"
|
|
|
|
|
>
|
|
|
|
|
<ng-container i18n>Import</ng-container>
|
|
|
|
|
</button>
|
|
|
|
|
</div>
|
|
|
|
|
</ng-template>
|
|
|
|
|
</div>
|
|
|
|
|
</mat-step>
|
|
|
|
|
</mat-stepper>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<gf-dialog-footer
|
|
|
|
|