Browse Source

feat: add dialog to accounts page(mock implementation)

pull/2433/head
Dhoni77 2 years ago
parent
commit
be2e399320
  1. 18
      apps/client/src/app/pages/accounts/accounts-page.component.ts
  2. 10
      apps/client/src/app/pages/accounts/accounts-page.html
  3. 2
      apps/client/src/app/pages/accounts/accounts-page.module.ts

18
apps/client/src/app/pages/accounts/accounts-page.component.ts

@ -16,6 +16,7 @@ import { Subject, Subscription } from 'rxjs';
import { takeUntil } from 'rxjs/operators'; import { takeUntil } from 'rxjs/operators';
import { CreateOrUpdateAccountDialog } from './create-or-update-account-dialog/create-or-update-account-dialog.component'; import { CreateOrUpdateAccountDialog } from './create-or-update-account-dialog/create-or-update-account-dialog.component';
import { TransferCashBalanceDialog } from './transfer-cash-balance/transfer-cash-balance-dialog.component';
@Component({ @Component({
host: { class: 'page' }, host: { class: 'page' },
@ -267,4 +268,21 @@ export class AccountsPageComponent implements OnDestroy, OnInit {
this.router.navigate(['.'], { relativeTo: this.route }); this.router.navigate(['.'], { relativeTo: this.route });
}); });
} }
private transferCashBalanceDialog(): void {
const dialogRef = this.dialog.open(TransferCashBalanceDialog, {
data: {
accounts: this.accounts
},
height: this.deviceType === 'mobile' ? '97.5vh' : '80vh',
width: this.deviceType === 'mobile' ? '100vw' : '50rem'
});
dialogRef
.afterClosed()
.pipe(takeUntil(this.unsubscribeSubject))
.subscribe((data: any) => {
this.router.navigate(['.'], { relativeTo: this.route });
});
}
} }

10
apps/client/src/app/pages/accounts/accounts-page.html

@ -24,7 +24,7 @@
class="fab-container" class="fab-container"
> >
<a <a
class="align-items-center d-flex justify-content-center" class="align-items-center d-flex justify-content-center mt-2"
color="primary" color="primary"
mat-fab mat-fab
[queryParams]="{ createDialog: true }" [queryParams]="{ createDialog: true }"
@ -32,5 +32,13 @@
> >
<ion-icon name="add-outline" size="large"></ion-icon> <ion-icon name="add-outline" size="large"></ion-icon>
</a> </a>
<a
class="align-items-center d-flex justify-content-center mt-2"
color="primary"
mat-fab
(click)="transferCashBalanceDialog()"
>
<ion-icon name="wallet-outline" size="large"></ion-icon>
</a>
</div> </div>
</div> </div>

2
apps/client/src/app/pages/accounts/accounts-page.module.ts

@ -8,6 +8,7 @@ import { GfAccountsTableModule } from '@ghostfolio/client/components/accounts-ta
import { AccountsPageRoutingModule } from './accounts-page-routing.module'; import { AccountsPageRoutingModule } from './accounts-page-routing.module';
import { AccountsPageComponent } from './accounts-page.component'; import { AccountsPageComponent } from './accounts-page.component';
import { GfCreateOrUpdateAccountDialogModule } from './create-or-update-account-dialog/create-or-update-account-dialog.module'; import { GfCreateOrUpdateAccountDialogModule } from './create-or-update-account-dialog/create-or-update-account-dialog.module';
import { GfTransferCashBalanceDialogModule } from './transfer-cash-balance/transfer-cash-balance.module-dialog';
@NgModule({ @NgModule({
declarations: [AccountsPageComponent], declarations: [AccountsPageComponent],
@ -17,6 +18,7 @@ import { GfCreateOrUpdateAccountDialogModule } from './create-or-update-account-
GfAccountDetailDialogModule, GfAccountDetailDialogModule,
GfAccountsTableModule, GfAccountsTableModule,
GfCreateOrUpdateAccountDialogModule, GfCreateOrUpdateAccountDialogModule,
GfTransferCashBalanceDialogModule,
MatButtonModule, MatButtonModule,
RouterModule RouterModule
], ],

Loading…
Cancel
Save