Skip to content

Commit

Permalink
add mock value
Browse files Browse the repository at this point in the history
  • Loading branch information
probsty committed Oct 29, 2023
1 parent 6275d60 commit 54ba21a
Show file tree
Hide file tree
Showing 11 changed files with 233 additions and 23 deletions.
8 changes: 7 additions & 1 deletion bank/frontend/src/app/app.module.ts
Expand Up @@ -23,6 +23,9 @@ import { RouterModule } from '@angular/router';
import {AuthModule, LogLevel} from "angular-auth-oidc-client";
import {AuthEffects} from "./auth/store/auth.effects";
import { FooterComponent } from './components/footer/footer.component';
import { UserInfoComponent } from './components/user-info/user-info.component';
import {MatDividerModule} from "@angular/material/divider";
import {MatTableModule} from "@angular/material/table";

@NgModule({
declarations: [
Expand All @@ -31,7 +34,8 @@ import { FooterComponent } from './components/footer/footer.component';
AppsListComponent,
HomepageComponent,
LoginPageComponent,
FooterComponent
FooterComponent,
UserInfoComponent
],
imports: [
RouterModule,
Expand Down Expand Up @@ -61,6 +65,8 @@ import { FooterComponent } from './components/footer/footer.component';
logLevel: LogLevel.Debug,
},
}),
MatDividerModule,
MatTableModule,
],
providers: [],
bootstrap: [AppComponent]
Expand Down
22 changes: 13 additions & 9 deletions bank/frontend/src/app/components/apps-list/apps-list.component.css
Expand Up @@ -23,18 +23,18 @@ mat-card {
mat-card h2 {
font-size: 24px;
margin-bottom: 12px;
color: #333; /* Dark color for headline for better readability */
color: #333;
}

mat-card p {
font-size: 18px;
margin-bottom: 16px;
color: #555; /* Subtle gray for general text */
color: #555;
}

.card-background {
background-size: cover;
background: linear-gradient(#FAFAFA, #EDEDED); /* Soft gradient from light gray to gray */
background: linear-gradient(#FAFAFA, #EDEDED);
width: 90%;
height: 100%;
display: flex;
Expand All @@ -48,19 +48,23 @@ mat-card p {
margin: 0;
}

.app-icon {
width: 100px;
height: 100px;
display: block;
margin: 0 auto;
}

.app-general-text {
margin: 48px 0;
font-size: 18px;
padding: 20px;
background-color: rgba(245, 245, 245, 0.9); /* Light gray background */
background-color: rgba(245, 245, 245, 0.9);
border-radius: 8px;
text-align: center;
box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.app-icon {
width: 100px; /* Set the desired width */
height: 100px; /* Set the desired height */
display: block; /* To ensure it's centered if its parent has text-align: center */
margin: 0 auto; /* Center the image horizontally */
.wrapper {
margin-top: 3%;
}
@@ -1,7 +1,3 @@
<div class="app-general-text">
<p>We're delighted to have you here. Feel free to open any app of your choice. Please note, third-party applications
are prohibited from accessing your data, as it's securely managed internally by us.</p>
</div>
<div *ngIf="apps && iconDataUrls">
<div class="wrapper">
<mat-grid-list [cols]="cols" rowHeight="2:1" gutterSize="16px">
Expand Down
Expand Up @@ -51,8 +51,6 @@ export class AppsListComponent implements OnInit {
}
});
this.apps = response.data;
console.log(this.apps);
console.log("ici");
this.iconDataUrls = this.apps.map(app => this.convertIconDataToUrl(app.icon.data));
} catch (error) {
console.error('Error :', error);
Expand Down
10 changes: 5 additions & 5 deletions bank/frontend/src/app/components/footer/footer.component.css
@@ -1,8 +1,8 @@
.footer-container {
margin-top: 5%;
width: 100%;
background-color: #2C3E50; /* Deep blue-gray background for the footer */
background-color: #2C3E50;
padding: 10px 0;
position: fixed;
bottom: 0;
z-index: 1000;
}
Expand All @@ -11,17 +11,17 @@
width: 80%;
margin: 0 auto;
text-align: center;
color: #EAEDED; /* Light gray for readability against the footer background */
color: #EAEDED;
font-size: 14px;
}

.footer-content a {
color: #EAEDED; /* Matches the text color */
color: #EAEDED;
text-decoration: none;
margin: 0 10px;
transition: color 0.3s;
}

.footer-content a:hover {
color: #BDC3C7; /* Slightly darker gray for hover state */
color: #BDC3C7;
}
4 changes: 2 additions & 2 deletions bank/frontend/src/app/components/footer/footer.component.html
@@ -1,6 +1,6 @@
<div class="footer-container">
<div class="footer-content">
<!-- Place footer content here, for example: -->
<p>© 2023 Your Company Name. All rights reserved.</p>
<p>We're delighted to have you here. Feel free to open any app of your choice. Please note, third-party applications
are prohibited from accessing your data, as it's securely managed internally by us</p>
</div>
</div>
@@ -1,2 +1,3 @@
<app-user-info></app-user-info>
<app-apps-list></app-apps-list>

95 changes: 95 additions & 0 deletions bank/frontend/src/app/components/user-info/user-info.component.css
@@ -0,0 +1,95 @@
.app-general-text {
background: linear-gradient(135deg, #6c5ce7, #a29bfe);
padding: 30px 40px;
margin-bottom: 40px;
box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
text-align: center;
}

.app-general-text p {
font-family: 'Helvetica Neue', Arial, sans-serif;
font-size: 24px;
font-weight: 500;
color: #ffffff;
margin: 0;
}

.user-info-container {
display: flex;
flex-direction: column;
max-width: 800px;
margin: 0 auto;
}

.user-details {
text-align: center;
margin-bottom: 40px;
}

h2 {
margin-top: 0;
color: #333;
font-size: 24px;
}

.balance-amount {
font-size: 48px;
font-weight: bold;
color: #6c5ce7;
margin: 20px 0;
}

.transaction-container {
background: #f5f5f5;
padding: 20px;
border-radius: 10px;
}

.transaction-card {
background: #ffffff;
padding: 15px;
border-radius: 10px;
box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
margin-bottom: 15px;
}

.transaction-description {
font-size: 18px;
font-weight: bold;
color: #333;
}

.transaction-amount {
font-size: 20px;
color: #6c5ce7;
}

.transaction-location, .transaction-date {
font-size: 16px;
color: #777;
margin: 5px 0;
}

.profile-container {
background: #f5f5f5;
padding: 30px;
margin-bottom: 40px;
border-radius: 10px;
text-align: center;
}

.profile-details {
max-width: 500px;
margin: 0 auto;
}

.profile-label {
font-weight: bold;
color: #6c5ce7;
margin-right: 10px;
}

h2 {
/* ... existing styles ... */
margin-bottom: 20px;
}
@@ -0,0 +1,30 @@
<div class="app-general-text">
<p>Welcome to your secure apps, {{ profile.firstname }}.</p>
</div>

<div class="user-info-container">
<div class="profile-container">
<h2>My profile</h2>
<div class="profile-details">
<p><span class="profile-label">Name:</span> {{ profile.firstname }} {{ profile.lastname }}</p>
<p><span class="profile-label">Birthdate:</span> {{ profile.birthdate | date:'longDate' }}</p>
<p><span class="profile-label">Sex:</span> {{ profile.sex }}</p>
<p><span class="profile-label">City:</span> {{ profile.city }}</p>
</div>
</div>

<div class="transaction-container">
<h2>Transactions (Balance: 5000)</h2>
<ng-container *ngFor="let transaction of transactions">
<div class="transaction-card">
<p class="transaction-description">{{ transaction.description }}</p>
<p class="transaction-amount">${{ transaction.amount.toFixed(2) }}</p>
<p class="transaction-location">{{ transaction.location }}</p>
<p class="transaction-date">{{ transaction.timestamp }}</p>
</div>
</ng-container>
<ng-template #noTransactions>
<p>No transactions available.</p>
</ng-template>
</div>
</div>
@@ -0,0 +1,21 @@
import { ComponentFixture, TestBed } from '@angular/core/testing';

import { UserInfoComponent } from './user-info.component';

describe('UserInfoComponent', () => {
let component: UserInfoComponent;
let fixture: ComponentFixture<UserInfoComponent>;

beforeEach(() => {
TestBed.configureTestingModule({
declarations: [UserInfoComponent]
});
fixture = TestBed.createComponent(UserInfoComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});

it('should create', () => {
expect(component).toBeTruthy();
});
});
59 changes: 59 additions & 0 deletions bank/frontend/src/app/components/user-info/user-info.component.ts
@@ -0,0 +1,59 @@
import { Component } from '@angular/core';
import {Store} from "@ngrx/store";
import {State} from "../../store/state/app.state";
import {BreakpointObserver} from "@angular/cdk/layout";
import {OidcSecurityService} from "angular-auth-oidc-client";
import axios from "axios";

@Component({
selector: 'app-user-info',
templateUrl: './user-info.component.html',
styleUrls: ['./user-info.component.css']
})
export class UserInfoComponent {
displayedColumns: string[] = ['description', 'amount', 'location', 'timestamp'];
accessToken: string | null = null;

profile = {
firstname: 'Penny',
lastname: 'Pennyworth',
birthdate: new Date(1991, 5, 10),
sex: 'Female',
city: 'Zürich'
};

transactions = [
{
timestamp: '27.10.2023, 14:20',
description: 'Purchase at Coop',
amount: -25.00,
location: 'Zürich HB',
},
{
timestamp: '26.10.2023, 21:00',
description: 'Purchase at Myprotein.ch',
amount: -101.00,
location: 'Switzerland'
},
{
timestamp: '25.10.2023, 12:10',
description: 'Purchase at Shell Station',
amount: -118.00,
location: 'Zürich'
},
{
timestamp: '25.10.2023, 08:00',
description: 'Purchase at Zürich Versicherung',
amount: -500.00,
location: 'Zürich'
},
{
timestamp: '25.10.2023, 18:00',
description: 'Purchase at Restaurant Aurora',
amount: -80.00,
location: 'Zürich'
},
];

constructor() {}
}

0 comments on commit 54ba21a

Please sign in to comment.