Browse Source

Merge branch 'main' into task/improve-labels-of-client-of-last-request

pull/8149/head
Thomas Kaul 2 days ago
committed by GitHub
parent
commit
09ff476146
No known key found for this signature in database GPG Key ID: B5690EEEBB952194
  1. 4
      CHANGELOG.md
  2. 2
      apps/client/src/app/components/user-account-settings/user-account-settings.html
  3. 10
      apps/client/src/app/directives/file-drop/file-drop.directive.ts
  4. 4
      apps/client/src/app/pages/portfolio/activities/import-activities-dialog/import-activities-dialog.component.ts
  5. 4
      apps/client/src/app/pages/portfolio/activities/import-activities-dialog/import-activities-dialog.html

4
CHANGELOG.md

@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## Unreleased ## Unreleased
### Added
- Added support to paste a file in the import activities dialog
### Changed ### Changed
- Improved the labels of the client of the last request in the users section of the admin control panel - Improved the labels of the client of the last request in the users section of the admin control panel

2
apps/client/src/app/components/user-account-settings/user-account-settings.html

@ -295,7 +295,7 @@
<div class="pr-1 w-50"> <div class="pr-1 w-50">
<div>Ghostfolio AI</div> <div>Ghostfolio AI</div>
<div class="hint-text text-muted" i18n> <div class="hint-text text-muted" i18n>
Data processing by a third-party AI provider Powered by third-party AI providers
</div> </div>
</div> </div>
<div class="pl-1 w-50"> <div class="pl-1 w-50">

10
apps/client/src/app/directives/file-drop/file-drop.directive.ts

@ -2,6 +2,7 @@ import { Directive, output } from '@angular/core';
@Directive({ @Directive({
host: { host: {
'(document:paste)': 'onPaste($event)',
'(dragenter)': 'onDragEnter($event)', '(dragenter)': 'onDragEnter($event)',
'(dragover)': 'onDragOver($event)', '(dragover)': 'onDragOver($event)',
'(drop)': 'onDrop($event)' '(drop)': 'onDrop($event)'
@ -31,4 +32,13 @@ export class GfFileDropDirective {
this.filesDropped.emit(event.dataTransfer.files); this.filesDropped.emit(event.dataTransfer.files);
} }
} }
public onPaste(event: ClipboardEvent) {
const files = event.clipboardData?.files;
if (files?.length) {
event.preventDefault();
this.filesDropped.emit(files);
}
}
} }

4
apps/client/src/app/pages/portfolio/activities/import-activities-dialog/import-activities-dialog.component.ts

@ -123,7 +123,7 @@ export class GfImportActivitiesDialogComponent {
protected details: any[] = []; protected details: any[] = [];
protected dialogTitle = $localize`Import Activities`; protected dialogTitle = $localize`Import Activities`;
protected errorMessages: string[] = []; protected errorMessages: string[] = [];
protected readonly ghostfolioAiTooltip = $localize`The content of your file will be processed by a third-party AI provider. Please remove any personal data before uploading.`; protected readonly ghostfolioAiTooltip = $localize`The content of your file will be processed by third-party AI providers. Please remove any personal data before uploading.`;
protected readonly hasPermissionToEnableGhostfolioAi = hasPermission( protected readonly hasPermissionToEnableGhostfolioAi = hasPermission(
this.data.user?.permissions, this.data.user?.permissions,
@ -259,7 +259,7 @@ export class GfImportActivitiesDialogComponent {
files: FileList; files: FileList;
stepper: MatStepper; stepper: MatStepper;
}) { }) {
if (files.length === 0) { if (files.length === 0 || this.importStep !== ImportStep.UPLOAD_FILE) {
return; return;
} }

4
apps/client/src/app/pages/portfolio/activities/import-activities-dialog/import-activities-dialog.html

@ -134,9 +134,7 @@
[disabled]="isLoading" [disabled]="isLoading"
(change)="onGhostfolioAiChange($event)" (change)="onGhostfolioAiChange($event)"
> >
<ng-container i18n <ng-container i18n>AI-assisted import</ng-container>
>Smart import with Ghostfolio AI</ng-container
>
</mat-checkbox> </mat-checkbox>
<span <span
class="align-items-center d-flex" class="align-items-center d-flex"

Loading…
Cancel
Save