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 deleted file mode 100644 index 44aee1644..000000000 --- a/apps/client/src/app/components/access-table/access-table.component.html +++ /dev/null @@ -1,84 +0,0 @@ -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Alias - {{ element.alias }} - Grantee - {{ element.grantee }} - Permission -
- @if (element.permissions.includes('READ')) { - - View - } @else if (element.permissions.includes('READ_RESTRICTED')) { - - Restricted view - } -
-
Details - @if (element.type === 'PUBLIC') { - - @if (user?.settings?.isExperimentalFeatures) { -
- GET {{ baseUrl }}/api/v1/public/{{ - element.id - }}/portfolio -
- } - } -
- - - @if (element.type === 'PUBLIC') { - -
- } - -
-
-
diff --git a/apps/client/src/app/components/access-table/access-table.component.scss b/apps/client/src/app/components/access-table/access-table.component.scss deleted file mode 100644 index 22a5d6732..000000000 --- a/apps/client/src/app/components/access-table/access-table.component.scss +++ /dev/null @@ -1,11 +0,0 @@ -:host { - display: block; - - a { - color: rgba(var(--palette-primary-500), 1); - - &:hover { - color: rgba(var(--palette-primary-300), 1); - } - } -} 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 deleted file mode 100644 index c94f86df1..000000000 --- a/apps/client/src/app/components/access-table/access-table.component.ts +++ /dev/null @@ -1,111 +0,0 @@ -import { ConfirmationDialogType } from '@ghostfolio/client/core/notification/confirmation-dialog/confirmation-dialog.type'; -import { NotificationService } from '@ghostfolio/client/core/notification/notification.service'; -import { Access, User } from '@ghostfolio/common/interfaces'; -import { publicRoutes } from '@ghostfolio/common/routes/routes'; - -import { Clipboard, ClipboardModule } from '@angular/cdk/clipboard'; -import { CommonModule } from '@angular/common'; -import { - ChangeDetectionStrategy, - Component, - CUSTOM_ELEMENTS_SCHEMA, - EventEmitter, - Input, - OnChanges, - Output -} from '@angular/core'; -import { MatButtonModule } from '@angular/material/button'; -import { MatMenuModule } from '@angular/material/menu'; -import { MatSnackBar } from '@angular/material/snack-bar'; -import { MatTableDataSource, MatTableModule } from '@angular/material/table'; -import { RouterModule } from '@angular/router'; -import { IonIcon } from '@ionic/angular/standalone'; -import { addIcons } from 'ionicons'; -import { - ellipsisHorizontal, - linkOutline, - lockClosedOutline, - lockOpenOutline -} from 'ionicons/icons'; -import ms from 'ms'; - -@Component({ - changeDetection: ChangeDetectionStrategy.OnPush, - imports: [ - ClipboardModule, - CommonModule, - IonIcon, - MatButtonModule, - MatMenuModule, - MatTableModule, - RouterModule - ], - schemas: [CUSTOM_ELEMENTS_SCHEMA], - selector: 'gf-access-table', - templateUrl: './access-table.component.html', - styleUrls: ['./access-table.component.scss'] -}) -export class GfAccessTableComponent implements OnChanges { - @Input() accesses: Access[]; - @Input() showActions: boolean; - @Input() user: User; - - @Output() accessDeleted = new EventEmitter(); - - public baseUrl = window.location.origin; - public dataSource: MatTableDataSource; - public displayedColumns = []; - - public constructor( - private clipboard: Clipboard, - private notificationService: NotificationService, - private snackBar: MatSnackBar - ) { - addIcons({ - ellipsisHorizontal, - linkOutline, - lockClosedOutline, - lockOpenOutline - }); - } - - public ngOnChanges() { - this.displayedColumns = ['alias', 'grantee', 'type', 'details']; - - if (this.showActions) { - this.displayedColumns.push('actions'); - } - - if (this.accesses) { - this.dataSource = new MatTableDataSource(this.accesses); - } - } - - public getPublicUrl(aId: string): string { - const languageCode = this.user.settings.language; - - return `${this.baseUrl}/${languageCode}/${publicRoutes.public.path}/${aId}`; - } - - public onCopyUrlToClipboard(aId: string): void { - this.clipboard.copy(this.getPublicUrl(aId)); - - this.snackBar.open( - '✅ ' + $localize`Link has been copied to the clipboard`, - undefined, - { - duration: ms('3 seconds') - } - ); - } - - public onDeleteAccess(aId: string) { - this.notificationService.confirm({ - confirmFn: () => { - this.accessDeleted.emit(aId); - }, - confirmType: ConfirmationDialogType.Warn, - title: $localize`Do you really want to revoke this granted access?` - }); - } -} diff --git a/libs/ui/src/lib/accounts-table/accounts-table.component.html b/libs/ui/src/lib/accounts-table/accounts-table.component.html index 609c76ee1..8a7bc98a9 100644 --- a/libs/ui/src/lib/accounts-table/accounts-table.component.html +++ b/libs/ui/src/lib/accounts-table/accounts-table.component.html @@ -353,4 +353,4 @@ width: '100%' }" /> -} +} \ No newline at end of file diff --git a/libs/ui/src/lib/accounts-table/accounts-table.component.stories.ts b/libs/ui/src/lib/accounts-table/accounts-table.component.stories.ts index c8ff855b5..0576ad4d5 100644 --- a/libs/ui/src/lib/accounts-table/accounts-table.component.stories.ts +++ b/libs/ui/src/lib/accounts-table/accounts-table.component.stories.ts @@ -28,7 +28,11 @@ const mockAccounts = [ platform: { name: 'Bank of America', url: 'https://www.bankofamerica.com' - } + }, + createdAt: new Date(), + updatedAt: new Date(), + platformId: 'bofa', + userId: 'user1' }, { id: '2', @@ -44,7 +48,11 @@ const mockAccounts = [ platform: { name: 'Interactive Brokers', url: 'https://www.interactivebrokers.com' - } + }, + createdAt: new Date(), + updatedAt: new Date(), + platformId: 'ibkr', + userId: 'user1' }, { id: '3', @@ -60,7 +68,11 @@ const mockAccounts = [ platform: { name: 'Deutsche Bank', url: 'https://www.deutsche-bank.de' - } + }, + createdAt: new Date(), + updatedAt: new Date(), + platformId: 'db', + userId: 'user1' }, { id: '4', @@ -76,7 +88,11 @@ const mockAccounts = [ platform: { name: 'Local Credit Union', url: null - } + }, + createdAt: new Date(), + updatedAt: new Date(), + platformId: 'lcu', + userId: 'user1' } ]; diff --git a/libs/ui/src/lib/accounts-table/accounts-table.component.ts b/libs/ui/src/lib/accounts-table/accounts-table.component.ts index a7ce6e488..798750aea 100644 --- a/libs/ui/src/lib/accounts-table/accounts-table.component.ts +++ b/libs/ui/src/lib/accounts-table/accounts-table.component.ts @@ -175,4 +175,4 @@ export class GfAccountsTableComponent implements OnChanges, OnDestroy { this.unsubscribeSubject.next(); this.unsubscribeSubject.complete(); } -} +} \ No newline at end of file