Skip to content

Commit

Permalink
right alignment of icon in add-article
Browse files Browse the repository at this point in the history
  • Loading branch information
Luca-Mag committed Nov 9, 2021
1 parent a9e19fe commit ceb5974
Show file tree
Hide file tree
Showing 7 changed files with 28 additions and 17 deletions.
16 changes: 16 additions & 0 deletions src/app/components/add-article-form/add-article-form.component.css
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,22 @@
margin: 4em 2em 4em 2em;
}

.header-panel{
display: flex;
flex-direction: row;
grid-gap: 2em;
justify-content: center;
align-content: center;
}
.header-panel h2{
margin: 0;
padding: 0;
}

.header-panel mat-icon{
align-self: center;
}

/*
::ng-deep .mat-panel-title {
text-align: center;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
<mat-expansion-panel [expanded]="false" (opened)="formOpened" hideToggle id="add-expansion-panel">
<mat-expansion-panel-header>
<mat-panel-title>
<strong>Add Article</strong> <mat-icon aria-hidden="false" aria-label="Add an article">add_circle_outline</mat-icon>
<mat-panel-title class="header-panel">
<h2>Add Article</h2>
<mat-icon aria-hidden="false" aria-label="Add an article">add_circle_outline</mat-icon>
</mat-panel-title>
</mat-expansion-panel-header>
<div id="add-article-container">
Expand Down
3 changes: 0 additions & 3 deletions src/app/components/article/articles-list.component.css
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
#articles-container{
height: 100%;
overflow: auto;
/*display: flex;*/
/*align-items: center;*/
/*justify-content: center;*/
}

.article-element{
Expand Down
2 changes: 0 additions & 2 deletions src/app/components/article/articles-list.component.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
import {Component, EventEmitter, Input, OnInit, Output} from '@angular/core';
import {Article} from "../../shared/models/article";
import {articles} from "../../hcData/data";
import {Client} from "../../shared/models/client";

@Component({
selector: 'app-articles-list',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ mat-expansion-panel{

.client-list{
height: 400px;
background-color: lightblue;
/*background-color: lightblue;*/
}

.confirm-bill{
Expand Down
4 changes: 2 additions & 2 deletions src/app/components/bill-creation/bill-creation.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,11 @@

<mat-action-row>
<button mat-button color="warn" (click)="prevStep()">Previous</button>
<button mat-button color="primary" (click)="nextStep()">Next</button>
<button mat-button [disabled]="!clientSelected || !articlesSelected || date.value === null" color="primary" (click)="saveBill()">Save</button>
<div>
<mat-form-field appearance="fill">
<mat-label>Choose a date</mat-label>
<input matInput [matDatepicker]="picker">
<input matInput [matDatepicker]="picker" [value]="date.value">
<mat-datepicker-toggle matSuffix [for]="picker"></mat-datepicker-toggle>
<mat-datepicker #picker></mat-datepicker>
</mat-form-field>
Expand Down
13 changes: 6 additions & 7 deletions src/app/components/bill-creation/bill-creation.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import {Article} from "../../shared/models/article";
import {auditTime} from "rxjs/operators";
import {ArticlesServiceService} from "../../services/articles-service.service";
import {ClientService} from "../../services/client.service";
import {FormControl} from "@angular/forms";

@Component({
selector: 'app-bill-creation',
Expand All @@ -21,21 +22,16 @@ export class BillCreationComponent implements OnInit {

articlesSelected:boolean = false;
clientSelected:boolean = false;
date = new FormControl(new Date());

constructor(
private _ArticleService: ArticlesServiceService,
private _ClientService: ClientService,
) { }

ngOnInit() {
console.log("getting client and articles from billCreation")
this.clients = this._ClientService.getClients();
this.articles = this._ArticleService.getArticles();
console.log("Articles")

console.log(this.articles);
console.log("Clients")
console.log(this.clients);
}

setBillClient(client:Client){
Expand All @@ -55,7 +51,6 @@ export class BillCreationComponent implements OnInit {
this.articlesSelected = this.bill.articles.length > 0;
}


setStep(index: number) {
this.step = index;
}
Expand All @@ -68,4 +63,8 @@ export class BillCreationComponent implements OnInit {
this.step--;
}

saveBill(){
//do here an api call to save the bill in the backend
}

}

0 comments on commit ceb5974

Please sign in to comment.