Browse Source

Feature/paste file in import activities dialog (#8152)

* Add support to paste a file into drop area of import activities dialog

* Update changelog
pull/8151/head^2
Thomas Kaul 2 days ago
committed by GitHub
parent
commit
e656277dd5
No known key found for this signature in database GPG Key ID: B5690EEEBB952194
  1. 6
      CHANGELOG.md
  2. 10
      apps/client/src/app/directives/file-drop/file-drop.directive.ts
  3. 2
      apps/client/src/app/pages/portfolio/activities/import-activities-dialog/import-activities-dialog.component.ts

6
CHANGELOG.md

@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
## Unreleased
### Added
- Added support to paste a file in the import activities dialog
## 3.85.0 - 2026-10-12
### Added

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

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

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

@ -259,7 +259,7 @@ export class GfImportActivitiesDialogComponent {
files: FileList;
stepper: MatStepper;
}) {
if (files.length === 0) {
if (files.length === 0 || this.importStep !== ImportStep.UPLOAD_FILE) {
return;
}

Loading…
Cancel
Save