From 3588636bf8178b2739823986dbaf513b27b7d5c7 Mon Sep 17 00:00:00 2001 From: Janis Blatsios Date: Tue, 12 Mar 2024 00:51:10 +0100 Subject: [PATCH] przycisk w group-summary.component.html DEPLOY --- src/main/frontend/angular.json | 3 +++ .../group/group-summary/group-summary.component.html | 1 + .../group/group-summary/group-summary.component.ts | 9 ++++++++- 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/src/main/frontend/angular.json b/src/main/frontend/angular.json index 083bef8..7e5c5bd 100644 --- a/src/main/frontend/angular.json +++ b/src/main/frontend/angular.json @@ -23,6 +23,9 @@ "builder": "@angular-devkit/build-angular:browser", "options": { "outputPath": "../resources/frontend", + "allowedCommonJsDependencies": [ + "ts-md5" + ], "index": "src/index.html", "main": "src/main.ts", "polyfills": [ diff --git a/src/main/frontend/src/app/component/group/group-summary/group-summary.component.html b/src/main/frontend/src/app/component/group/group-summary/group-summary.component.html index ac392e0..b3bc6fd 100644 --- a/src/main/frontend/src/app/component/group/group-summary/group-summary.component.html +++ b/src/main/frontend/src/app/component/group/group-summary/group-summary.component.html @@ -1,3 +1,4 @@ +
diff --git a/src/main/frontend/src/app/component/group/group-summary/group-summary.component.ts b/src/main/frontend/src/app/component/group/group-summary/group-summary.component.ts index ead6c34..3645f2a 100644 --- a/src/main/frontend/src/app/component/group/group-summary/group-summary.component.ts +++ b/src/main/frontend/src/app/component/group/group-summary/group-summary.component.ts @@ -3,6 +3,8 @@ import {ActivatedRoute} from "@angular/router"; import {ExpenseService} from "../../../service/expense.service"; import {Expense} from "../../../model/expense"; import {KeyValue} from "@angular/common"; +import {MatDialog} from "@angular/material/dialog"; +import {AddExpenseComponent} from "../../expense/add-expense/add-expense.component"; @Component({ selector: 'group-summary', @@ -14,7 +16,8 @@ export class GroupSummaryComponent implements OnInit { expenses: Map = new Map(); constructor(private expenseService: ExpenseService, - private route: ActivatedRoute + private route: ActivatedRoute, + private dialog: MatDialog ) { } @@ -48,4 +51,8 @@ export class GroupSummaryComponent implements OnInit { reverseKeyOrder = (a: KeyValue, b: KeyValue): number => { return a.key > b.key ? -1 : (b.key > a.key ? 1 : 0); } + + addExpense() { + this.dialog.open(AddExpenseComponent, {data: {groupId: this.groupId}, width: '600px'}); + } }