diff --git a/FrontEnd/Library/src/app/addbooks/addbooks.component.css b/FrontEnd/Library/src/app/addbooks/addbooks.component.css index 5fbd13fe..42f8c76a 100644 --- a/FrontEnd/Library/src/app/addbooks/addbooks.component.css +++ b/FrontEnd/Library/src/app/addbooks/addbooks.component.css @@ -60,7 +60,7 @@ margin-left: 20%; table{ width: 90%; border: none; - text-align: center; + text-align: left; height: 100px; text-size-adjust: auto; @@ -68,12 +68,13 @@ margin-left: 20%; th { background-color: #ffffff; color: rgb(0, 0, 0); - text-align: center; + text-align: left; border: none; } td { border: none; padding-top: 6px;padding-bottom: 6px; + text-align: left; } /* .form-control{ width: fit-content; diff --git a/FrontEnd/Library/src/app/addbooks/addbooks.component.html b/FrontEnd/Library/src/app/addbooks/addbooks.component.html index e8536c29..767049f8 100644 --- a/FrontEnd/Library/src/app/addbooks/addbooks.component.html +++ b/FrontEnd/Library/src/app/addbooks/addbooks.component.html @@ -35,13 +35,6 @@ .form-control{ width: 30vh; } - - /* .col-md-6{ - display: flex; - flex-wrap: wrap; - flex-direction: row; - } */ - } @@ -67,7 +60,7 @@ - + @@ -198,104 +191,3 @@ - diff --git a/FrontEnd/Library/src/app/addbooks/addbooks.component.ts b/FrontEnd/Library/src/app/addbooks/addbooks.component.ts index 505840b5..112c2cfc 100644 --- a/FrontEnd/Library/src/app/addbooks/addbooks.component.ts +++ b/FrontEnd/Library/src/app/addbooks/addbooks.component.ts @@ -160,11 +160,16 @@ onTableDataChange(event:any) { const dialogConfig = new MatDialogConfig(); this.dialog.open(BooksComponent, { + closeOnNavigation: true, // width:'32%',height:'70%' width:'55%',height:'auto' } ); + this.router.events + .subscribe(() => { + this.dialog.closeAll(); + }); } @@ -194,10 +199,15 @@ onTableDataChange(event:any) { const dialogConfig = new MatDialogConfig(); this.dialog.open(BooksComponent, { + closeOnNavigation: true, width:'30%',height:'70%' } ); + this.router.events + .subscribe(() => { + this.dialog.closeAll(); + }); } @@ -208,6 +218,7 @@ onTableDataChange(event:any) { selectFile($event:any) { this.selectedFiles=$event.target.files; + console.log("sel-",this.selectedFiles) } @@ -223,15 +234,19 @@ selectFile($event:any) { console.log(res); if(res!==null){ this.toast.success({detail:'SUCCESS',summary:'The CSV File upload is successfull',duration:5000}); + setTimeout(() => { window.location.reload() - }, 5000); - + }, 5000); } - }) + }), + (error: any) =>{ + console.log("in error") + this.toast.error({detail:'CSV upload failed',summary:'Invalid csv file',duration:5000}); + console.log(error)}; } diff --git a/FrontEnd/Library/src/app/addcategory/addcategory.component.css b/FrontEnd/Library/src/app/addcategory/addcategory.component.css index 46baf45a..fa8b69b6 100644 --- a/FrontEnd/Library/src/app/addcategory/addcategory.component.css +++ b/FrontEnd/Library/src/app/addcategory/addcategory.component.css @@ -2,7 +2,7 @@ table{ width: auto; border: none; - text-align: center; + text-align: left; } /* tr{ @@ -11,12 +11,18 @@ th { background-color: #ffffff; color: rgb(0, 0, 0); - text-align: center; + text-align: left; + /* text-align: center; */ border: none; } td { border: none; padding-top: 16px;padding-bottom: 6px; - text-align: center; + text-align: left; + /* text-align: center; */ + } + + td text{ + padding-top: 30%; } \ No newline at end of file diff --git a/FrontEnd/Library/src/app/addcategory/addcategory.component.html b/FrontEnd/Library/src/app/addcategory/addcategory.component.html index f79951fe..e9d5b17f 100644 --- a/FrontEnd/Library/src/app/addcategory/addcategory.component.html +++ b/FrontEnd/Library/src/app/addcategory/addcategory.component.html @@ -7,11 +7,11 @@
| + | Category Name @@ -34,7 +34,7 @@ | {{category.categoryName}} |
-
+
diff --git a/FrontEnd/Library/src/app/addcategory/addcategory.component.ts b/FrontEnd/Library/src/app/addcategory/addcategory.component.ts
index 9e79391f..9c6ba825 100644
--- a/FrontEnd/Library/src/app/addcategory/addcategory.component.ts
+++ b/FrontEnd/Library/src/app/addcategory/addcategory.component.ts
@@ -124,11 +124,15 @@ editCategory(categoryId:any) {
this.dialog.open(CategoryComponent,
{
- // width:'25%',height:'35%'
+ closeOnNavigation: true,
width:'auto',height:'auto'
}
);
+ this.router.events
+ .subscribe(() => {
+ this.dialog.closeAll();
+ });
}
diff --git a/FrontEnd/Library/src/app/books.service.ts b/FrontEnd/Library/src/app/books.service.ts
index 66bff396..515d1576 100644
--- a/FrontEnd/Library/src/app/books.service.ts
+++ b/FrontEnd/Library/src/app/books.service.ts
@@ -23,6 +23,13 @@ handleError(err: HttpErrorResponse): any {
localStorage.clear()
this.router.navigateByUrl(`/login`); }
}
+handleCsvError(err: HttpErrorResponse): any {
+ console.log('hhhii');
+ if ( err.status === 417) {
+ alert("CSV upload failed : Invalid csv file")
+
+ }
+}
//////////////////////////////////////////////
@@ -37,7 +44,7 @@ handleError(err: HttpErrorResponse): any {
const formData: FormData = new FormData();
formData.append('file', file);
- return this.http.post('http://localhost:8080/csv/admin/upload', formData)
+ return this.http.post('http://localhost:8080/csv/admin/upload', formData).pipe((catchError(err => this.handleCsvError(err))))
}
//pie
diff --git a/FrontEnd/Library/src/app/books/books.component.html b/FrontEnd/Library/src/app/books/books.component.html
index 4c509fff..f967989b 100644
--- a/FrontEnd/Library/src/app/books/books.component.html
+++ b/FrontEnd/Library/src/app/books/books.component.html
@@ -49,30 +49,31 @@
-
-
+
+
@@ -103,49 +104,3 @@
-
-
-
diff --git a/FrontEnd/Library/src/app/books/books.component.ts b/FrontEnd/Library/src/app/books/books.component.ts
index 306c5d0b..d0801a09 100644
--- a/FrontEnd/Library/src/app/books/books.component.ts
+++ b/FrontEnd/Library/src/app/books/books.component.ts
@@ -30,6 +30,7 @@ export class BooksComponent implements OnInit {
booksdata:any;
catdata: any;
ObjSampleForm:FormGroup;
+ displayStyle: any;
constructor(private router:Router ,
private booksService:BooksService,
@@ -45,7 +46,7 @@ export class BooksComponent implements OnInit {
publication:new FormControl('',[Validators.required]),
booksName:new FormControl('',[Validators.required]),
auther:new FormControl('',[Validators.required]),
- booksCopies:new FormControl('',[Validators.required]) ,
+ booksCopies:new FormControl('',[Validators.required])
// categoryId:new FormControl('',[Validators.required]) ,
}
);
@@ -77,7 +78,8 @@ LoadCategory() {
clear() {
localStorage.removeItem('categoryId');
- window.location.reload()
+
+
}
onSubmit(){
@@ -99,18 +101,19 @@ onSubmit(){
console.log("bid=",result.booksId)
// MatDialog.close();
this.router.navigate(['/imageupload'])
-
+ this.displayStyle = "none";
}
else{
this.toast.error({detail:'Invalid',summary:'Add new Book Failed',duration:5000});
}
})
-
-
}
}
+closePopup() {
+ this.displayStyle = "none";
+}
loadEdit(): void{
diff --git a/FrontEnd/Library/src/app/borrow/borrow.component.css b/FrontEnd/Library/src/app/borrow/borrow.component.css
index 8ff5235b..6b980aff 100644
--- a/FrontEnd/Library/src/app/borrow/borrow.component.css
+++ b/FrontEnd/Library/src/app/borrow/borrow.component.css
@@ -27,12 +27,23 @@
position: relative;
top: 4%;
left: 70%;
+ top:3%;
transform: translate(-50%, -50%);
text-align: center;
display: flex;
flex-wrap: nowrap;
flex-direction: row;
+ }
+
+ .centr {
+ position: relative;
+ top: 5%;
+ left: 40%;
+ transform: translate(-50%, -50%);
+ text-align: center;
+
+
}
.table-responsive{
overflow-x: hidden;
@@ -46,18 +57,23 @@
table{
width: 90%;
border: none;
- text-align: center;
+ text-align: left;
}
th {
- background-color: #ffffff;
+ background-color: #fffdfd;
color: rgb(0, 0, 0);
- text-align: center;
+ text-align: left;
+ /* border: 3px; */
}
td {
-
+ text-align: left;
padding-top: 6px;padding-bottom: 6px;
- }
\ No newline at end of file
+ }
+
+.h2{
+ margin-left: 10%;
+}
diff --git a/FrontEnd/Library/src/app/borrow/borrow.component.html b/FrontEnd/Library/src/app/borrow/borrow.component.html
index 4e215b49..662750fd 100644
--- a/FrontEnd/Library/src/app/borrow/borrow.component.html
+++ b/FrontEnd/Library/src/app/borrow/borrow.component.html
@@ -29,16 +29,18 @@
-
+
+ Borrow Details+ + |
|---|
| NAME | : | {{userdata[0].firstName}} {{userdata.lastName}} |
| ADDRESS | : | {{userdata[0].address}} |
| PHONE | : | {{userdata[0].phone}} |
| NAME | : | {{userdata[0].firstName}} {{userdata.lastName}} |
| ADDRESS | : | {{userdata[0].address}} |
| PHONE | : | {{userdata[0].phone}} |
| : | {{userdata[0].email}} | |
| DOB | : | {{userdata[0].dob| date:'dd/MM/yyyy'}} |
| CREATED DATE | : | {{userdata[0].createDate| date:'dd/MM/yyyy'}} |
| UPDATE DATE | : | {{userdata[0].updateDate| date:'dd/MM/yyyy'}} |