From 5a9f612dadd3b645c9fbe53c97e7216d0ab78993 Mon Sep 17 00:00:00 2001 From: negilbabu Date: Mon, 23 Jan 2023 11:06:10 +0530 Subject: [PATCH 1/5] alignment --- .../WebSecurityConfiguration.java | 9 +- .../Library/controller/EmailController.java | 10 ++- .../Library/controller/UsersController.java | 6 +- .../Library/src/app/body/body.component.css | 17 ++-- .../Library/src/app/body/body.component.html | 14 +-- .../forgotpassword.component.css | 32 ++++++- .../forgotpassword.component.html | 33 +++---- .../forgotpassword.component.ts | 86 +++++++++++++------ .../Library/src/app/imageupload.service.ts | 23 +++-- .../user-details/user-details.component.css | 5 +- .../user-details/user-details.component.html | 46 +++------- .../src/app/user-reg/user-reg.component.html | 2 +- .../Library/src/app/userservice.service.ts | 3 + .../view-adminprofile.component.ts | 2 +- 14 files changed, 186 insertions(+), 102 deletions(-) diff --git a/BackEnd/Library/src/main/java/com/innovature/Library/configuration/WebSecurityConfiguration.java b/BackEnd/Library/src/main/java/com/innovature/Library/configuration/WebSecurityConfiguration.java index 6209278b..3fd2ef3f 100644 --- a/BackEnd/Library/src/main/java/com/innovature/Library/configuration/WebSecurityConfiguration.java +++ b/BackEnd/Library/src/main/java/com/innovature/Library/configuration/WebSecurityConfiguration.java @@ -53,6 +53,10 @@ protected void configure(HttpSecurity http) throws Exception { .securityContext().and() .anonymous().and() .authorizeRequests() + + .antMatchers(GET,"/users/admin/**/").access("hasRole('ROLE_ADMIN')") + .antMatchers(GET,"/users/admin/viewProfile").access("hasRole('ROLE_ADMIN')") + .antMatchers(OPTIONS, "/users").anonymous() .antMatchers(POST, "/users").anonymous() .antMatchers(OPTIONS, "/login").anonymous() @@ -62,7 +66,7 @@ protected void configure(HttpSecurity http) throws Exception { .antMatchers(OPTIONS, "/**").anonymous() //category - .antMatchers(GET,"/category/admin").access("hasRole('ROLE_ADMIN')") + .antMatchers(GET,"/category/admin/**/").access("hasRole('ROLE_ADMIN')") .antMatchers(POST,"/category").access("hasRole('ROLE_ADMIN')") .antMatchers(DELETE,"/category").access("hasRole('ROLE_ADMIN')") .antMatchers(PUT,"/category/{catogoryId}").access("hasRole('ROLE_ADMIN')") @@ -71,6 +75,7 @@ protected void configure(HttpSecurity http) throws Exception { .antMatchers(GET,"/books/admin/**/").access("hasRole('ROLE_ADMIN')") .antMatchers(GET,"/books/user/**/").access("hasRole('ROLE_USER')") .antMatchers(POST,"/books").access("hasRole('ROLE_ADMIN')") + .antMatchers(POST,"/books/save/image/{booksId}").access("hasRole('ROLE_ADMIN')") .antMatchers(DELETE,"/books/{booksId}").access("hasRole('ROLE_ADMIN')") .antMatchers(PUT,"/books/{booksId}").access("hasRole('ROLE_ADMIN')") @@ -80,6 +85,8 @@ protected void configure(HttpSecurity http) throws Exception { .antMatchers(POST,"/borrow/").access("hasRole('ROLE_USER')") .antMatchers(PUT,"/borrow/admin/**").access("hasRole('ROLE_ADMIN')") + //user + diff --git a/BackEnd/Library/src/main/java/com/innovature/Library/controller/EmailController.java b/BackEnd/Library/src/main/java/com/innovature/Library/controller/EmailController.java index 9fbfda42..54745ee9 100644 --- a/BackEnd/Library/src/main/java/com/innovature/Library/controller/EmailController.java +++ b/BackEnd/Library/src/main/java/com/innovature/Library/controller/EmailController.java @@ -74,13 +74,15 @@ public String sendMail(@PathVariable("userId") Integer userId) { boolean result = this.emailService.sendEmail("OTP Verification","Your OTP to change your password is \t"+ otp +"\tuse it to create a new password.", form.getSentto()); // "OTP Verification", "Your OTP to change your password is "+"otp"+"use it to create a new password." if(result){ - return ResponseEntity.ok("Email Sent!"); - }else{ - return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR).body("Email not sent."); + return new ResponseEntity(null,HttpStatus.ACCEPTED); + } + else{ + return new ResponseEntity(null,HttpStatus.BAD_REQUEST); } } else{ - return null; + return new ResponseEntity(null,HttpStatus.NOT_ACCEPTABLE); + } diff --git a/BackEnd/Library/src/main/java/com/innovature/Library/controller/UsersController.java b/BackEnd/Library/src/main/java/com/innovature/Library/controller/UsersController.java index a9ec46b2..f5f8aba8 100644 --- a/BackEnd/Library/src/main/java/com/innovature/Library/controller/UsersController.java +++ b/BackEnd/Library/src/main/java/com/innovature/Library/controller/UsersController.java @@ -73,6 +73,10 @@ public Collection list(Principal p) { public Collection viewProfile(){ return userService.viewProfile(SecurityUtil.getCurrentUserId()); } + @GetMapping("/admin/viewProfile/") + public Collection viewAdminProfile(){ + return userService.viewProfile(SecurityUtil.getCurrentUserId()); + } @PutMapping("/{userId}") public UserView updates( @@ -102,7 +106,7 @@ public Collection getUserById( - @GetMapping("admin/pagenated/") + @GetMapping("/admin/pagenated/") public ResponseEntity>getAllBooks( @RequestParam(defaultValue = "1") Integer pageNo, @RequestParam(defaultValue = "10") Integer pageSize, diff --git a/FrontEnd/Library/src/app/body/body.component.css b/FrontEnd/Library/src/app/body/body.component.css index db549c8e..e1335abd 100644 --- a/FrontEnd/Library/src/app/body/body.component.css +++ b/FrontEnd/Library/src/app/body/body.component.css @@ -1,5 +1,12 @@ -/* .chart-container col-md-12 mb-5{ - height:30vh; - width:50vw; - margin-left: 30px -} */ \ No newline at end of file + .chart{ + left: 18%; + + } + + + .chart-container { + position: relative; + height: 70vh; + width: 70vw; + } + \ No newline at end of file diff --git a/FrontEnd/Library/src/app/body/body.component.html b/FrontEnd/Library/src/app/body/body.component.html index 1aaea401..61439e28 100644 --- a/FrontEnd/Library/src/app/body/body.component.html +++ b/FrontEnd/Library/src/app/body/body.component.html @@ -15,16 +15,16 @@ } .chart h2{ - font-size: 10px; - } .chart-container col-md-12{ margin-top: 50%; + margin-left: 8%; + } + .chart{ + margin-left: 0%; } - - } @@ -34,15 +34,15 @@


-
-
+
+

BOOKS BY CATEGORY

{{mychart}}


-
+

ISSUE AND RETURNED CHART

{{bar}} diff --git a/FrontEnd/Library/src/app/forgotpassword/forgotpassword.component.css b/FrontEnd/Library/src/app/forgotpassword/forgotpassword.component.css index b31ab8ff..07c23c00 100644 --- a/FrontEnd/Library/src/app/forgotpassword/forgotpassword.component.css +++ b/FrontEnd/Library/src/app/forgotpassword/forgotpassword.component.css @@ -60,4 +60,34 @@ body, html { } .button:hover {color: #ffffff} - \ No newline at end of file + + .email{ + + width: 25%; + height: auto; + padding: 8px 2px; + margin: 0px; + box-sizing: border-box; + border: 1px ; + background-color: #a7bdb08f; + color: rgb(0, 0, 0); + border-radius: 7px; + +} + +input::-webkit-outer-spin-button, +input::-webkit-inner-spin-button { + -webkit-appearance: none; + margin: 0; +} +input[type=number] { + -moz-appearance: textfield; +} + +input { + text-align: center; +} + +::-webkit-input-placeholder { + text-align: center; +} diff --git a/FrontEnd/Library/src/app/forgotpassword/forgotpassword.component.html b/FrontEnd/Library/src/app/forgotpassword/forgotpassword.component.html index 273f2963..ecdf8284 100644 --- a/FrontEnd/Library/src/app/forgotpassword/forgotpassword.component.html +++ b/FrontEnd/Library/src/app/forgotpassword/forgotpassword.component.html @@ -5,8 +5,6 @@
- -
@@ -15,12 +13,12 @@



-
+


-

- +

+ +
@@ -32,30 +30,34 @@ -