Skip to content

Open Source Wealth Management Software. Angular + NestJS + Prisma + Nx + TypeScript 🀍

Feature/add snack bar to copy link to clipboard action in access table (#4175)

Thomas Kaul02681cc4791a
diff --git a/CHANGELOG.md b/CHANGELOG.md
index a973acf3ec..c712f1ffc9 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -9,6 +9,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Changed
+- Improved the usability of the _Copy link to clipboard_ action by adding a confirmation on success in the access table to share the portfolio
- Improved the endpoint to fetch the logo of an asset or a platform by sending the original MIME type
- Eliminated `got` in favor of using `fetch`
- Changed the `REDIS_HOST` from `localhost` to `redis` in `.env.example`
diff --git a/apps/client/src/app/components/access-table/access-table.component.html b/apps/client/src/app/components/access-table/access-table.component.html
index 2a20e46317..44aee16440 100644
--- a/apps/client/src/app/components/access-table/access-table.component.html
+++ b/apps/client/src/app/components/access-table/access-table.component.html
@@ -66,7 +66,7 @@
</button>
<mat-menu #transactionMenu="matMenu" xPosition="before">
@if (element.type === 'PUBLIC') {
- <button mat-menu-item (click)="onCopyToClipboard(element.id)">
+ <button mat-menu-item (click)="onCopyUrlToClipboard(element.id)">
<ng-container i18n>Copy link to clipboard</ng-container>
</button>
<hr class="my-0" />
diff --git a/apps/client/src/app/components/access-table/access-table.component.ts b/apps/client/src/app/components/access-table/access-table.component.ts
index da8ceb0948..32ae7bfefa 100644
--- a/apps/client/src/app/components/access-table/access-table.component.ts
+++ b/apps/client/src/app/components/access-table/access-table.component.ts
@@ -12,6 +12,7 @@ import {
OnChanges,
Output
} from '@angular/core';
+import { MatSnackBar } from '@angular/material/snack-bar';
import { MatTableDataSource } from '@angular/material/table';
@Component({
@@ -34,7 +35,8 @@ export class AccessTableComponent implements OnChanges {
public constructor(
private clipboard: Clipboard,
- private notificationService: NotificationService
+ private notificationService: NotificationService,
+ private snackBar: MatSnackBar
) {}
public ngOnChanges() {
@@ -55,8 +57,16 @@ export class AccessTableComponent implements OnChanges {
return `${this.baseUrl}/${languageCode}/p/${aId}`;
}
- public onCopyToClipboard(aId: string): void {
+ public onCopyUrlToClipboard(aId: string): void {
this.clipboard.copy(this.getPublicUrl(aId));
+
+ this.snackBar.open(
+ 'βœ… ' + $localize`Link has been copied to the clipboard`,
+ undefined,
+ {
+ duration: 3000
+ }
+ );
}
public onDeleteAccess(aId: string) {