Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
57 commits
Select commit Hold shift + click to select a range
8771ae6
teszt commit
Nov 20, 2019
a868bc7
gitignore updates
Nov 20, 2019
da00147
menü teszt1
Nov 20, 2019
9883391
bugfix
Nov 20, 2019
554ec7d
menu event listener
Nov 20, 2019
efa3e07
extjs menu
Nov 20, 2019
badd191
missing parenthesis
Nov 20, 2019
56bbec8
na most
Nov 20, 2019
4f779cc
bugfix
Nov 20, 2019
b89db94
added styles.css include to templates
Nov 20, 2019
7424f2b
permit all
szteven Nov 29, 2019
7256153
Infinite recursion fix
szteven Nov 30, 2019
b353774
App menu template based on responsive example
szteven Nov 30, 2019
50f3c93
Cleanup + rename
szteven Nov 30, 2019
e057d75
Infinite recursion fix
szteven Nov 30, 2019
5b2f70b
Deleted stuff in /target
szteven Dec 8, 2019
d56421d
.gitignore
szteven Dec 8, 2019
fd65d7c
Deleted stuff in /target
szteven Dec 8, 2019
6a5d302
.gitignore
szteven Dec 8, 2019
7423fe0
Merge branch 'develop' of github.com:szteven/bugtracker into develop
szteven Dec 8, 2019
5a2133a
Project list added to menu
szteven Dec 8, 2019
97016f5
Added grid flex to column layout
szteven Dec 8, 2019
3935d74
page content loader functions added
szteven Dec 8, 2019
33618ef
Create new project
szteven Dec 8, 2019
a6a14c7
Revert "permit all"
szteven Dec 8, 2019
17ad5d9
Default size & padding for new project dialog
szteven Dec 8, 2019
bf44a93
Set successful login to load /main
szteven Dec 8, 2019
66cc378
Bug picture
szteven Dec 8, 2019
155b6eb
Buggy login page :P
szteven Dec 8, 2019
746ccf6
Logout menu
szteven Dec 8, 2019
53a9d9f
Removed unused css include
szteven Dec 9, 2019
f2fcdff
Project details dialog
szteven Dec 9, 2019
f7a9619
Role based menu generation
szteven Dec 9, 2019
1d4746a
Role based menu generation revamp
szteven Dec 9, 2019
af69a2f
Moved all project related functions to projects.js
szteven Dec 9, 2019
9b40a71
Dead code cleanup
szteven Dec 9, 2019
44a87de
s1, s2, s3 localDateTime -> long. We have to store hours or minutes n…
ZombieDroid Dec 3, 2019
e80e945
Changed datetime to number spinners
szteven Dec 9, 2019
dceb3c6
Removed time related unused functions
szteven Dec 9, 2019
e4dcd47
Fixed dialogs behaviour
szteven Dec 9, 2019
91be280
Fixed search panel looks
szteven Dec 9, 2019
270c3a2
Search on enter keypress
szteven Dec 9, 2019
d45bd0d
Search reset button
szteven Dec 9, 2019
51e2fea
Bug icon for menu header
szteven Dec 9, 2019
bfb8f05
Variable rename to avoid conflict
szteven Dec 9, 2019
10d86dd
Implemented users list view
szteven Dec 9, 2019
feeb441
New user & user update
szteven Dec 9, 2019
683646c
Fancied up login page
szteven Dec 9, 2019
440e052
Merge remote-tracking branch 'upstream/develop' into develop
szteven Dec 9, 2019
18c1790
Merge branch 'develop' into BT-21-new
szteven Dec 9, 2019
d3482c0
Ticket list
szteven Dec 9, 2019
6dff211
Added missing title to new user window
szteven Dec 9, 2019
b7729f3
New ticket & ticket update
szteven Dec 9, 2019
567c075
Implemented users search by name in the backend
szteven Dec 9, 2019
2990db5
User search functionality in the frontend
szteven Dec 9, 2019
cd10f67
Cleaned unused date related stuff
szteven Dec 9, 2019
7bdec9d
Added licensing & copyright info for the CSS file
szteven Dec 9, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/bugtracker/target/
19 changes: 18 additions & 1 deletion bugtracker/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -45,4 +45,21 @@ $RECYCLE.BIN/
*.DS_Store
*.iml
target
../.idea
../.idea

# Eclipse
.classpath
.project
.settings/

# Intellij
.idea/
*.iml
*.iws

# Mac
.DS_Store

# Maven
log/
target/
6 changes: 5 additions & 1 deletion bugtracker/src/main/java/bugtracker/MvcConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@
public class MvcConfig implements WebMvcConfigurer {
public void addViewControllers(ViewControllerRegistry registry) {
registry.addViewController("/").setViewName("login");
registry.addViewController("/home").setViewName("hello");
registry.addViewController("/home").setViewName("main");
registry.addViewController("/main").setViewName("main");
registry.addViewController("/login").setViewName("login");
registry.addViewController("/ticket/all").setViewName("tickets");
registry.addViewController("/ticket").setViewName("ticket");
Expand Down Expand Up @@ -40,5 +41,8 @@ public void addCorsMappings(CorsRegistry registry) {
@Override
public void addResourceHandlers(final ResourceHandlerRegistry registry) {
registry.addResourceHandler("/resources/**").addResourceLocations("/resources/");
registry.addResourceHandler("/css/**").addResourceLocations("classpath:/static/css/");
registry.addResourceHandler("/js/**").addResourceLocations("classpath:/static/js/");
registry.addResourceHandler("/img/**").addResourceLocations("classpath:/static/img/");
}
}
38 changes: 19 additions & 19 deletions bugtracker/src/main/java/bugtracker/SecurityConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -32,31 +32,31 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter {
@Override
protected void configure(HttpSecurity httpSecurity) throws Exception {



httpSecurity.authorizeRequests()
.antMatchers("/login*").access("hasRole('ROLE_USER') or hasRole('ROLE_ADMIN') or hasRole('ROLE_DEVELOPER') or hasRole('ROLE_APPROVER')")
.antMatchers("/user/new").access(" hasRole('ROLE_ADMIN')")
.antMatchers("/user/all*").access("hasRole('ROLE_USER') or hasRole('ROLE_ADMIN') or hasRole('ROLE_DEVELOPER') or hasRole('ROLE_APPROVER')")
.antMatchers("/user/modify*").access("hasRole('ROLE_ADMIN')")
.antMatchers("/project/**").access("hasRole('ROLE_USER') or hasRole('ROLE_ADMIN') or hasRole('ROLE_DEVELOPER') or hasRole('ROLE_APPROVER')")
.antMatchers("/api/**").access("hasRole('ROLE_USER') or hasRole('ROLE_ADMIN') or hasRole('ROLE_DEVELOPER') or hasRole('ROLE_APPROVER')")
.antMatchers("/ticket/**").access("hasRole('ROLE_USER') or hasRole('ROLE_ADMIN') or hasRole('ROLE_DEVELOPER') or hasRole('ROLE_APPROVER')")
.and()
.csrf().disable()
.formLogin()
.loginPage("/login")
.successForwardUrl("/api/user/dispatch")
.permitAll()
.and()
.logout()
.permitAll();
.antMatchers("/css/**", "/js/**", "/images/**").permitAll()
.antMatchers("/login*").access("hasRole('ROLE_USER') or hasRole('ROLE_ADMIN') or hasRole('ROLE_DEVELOPER') or hasRole('ROLE_APPROVER')")
.antMatchers("/user/new").access(" hasRole('ROLE_ADMIN')")
.antMatchers("/user/all*").access("hasRole('ROLE_USER') or hasRole('ROLE_ADMIN') or hasRole('ROLE_DEVELOPER') or hasRole('ROLE_APPROVER')")
.antMatchers("/user/modify*").access("hasRole('ROLE_ADMIN')")
.antMatchers("/project/**").access("hasRole('ROLE_USER') or hasRole('ROLE_ADMIN') or hasRole('ROLE_DEVELOPER') or hasRole('ROLE_APPROVER')")
.antMatchers("/api/user/current/**").permitAll()
.antMatchers("/api/**").access("hasRole('ROLE_USER') or hasRole('ROLE_ADMIN') or hasRole('ROLE_DEVELOPER') or hasRole('ROLE_APPROVER')")
.antMatchers("/ticket/**").access("hasRole('ROLE_USER') or hasRole('ROLE_ADMIN') or hasRole('ROLE_DEVELOPER') or hasRole('ROLE_APPROVER')")
.and()
.csrf().disable()
.formLogin()
.loginPage("/login")
.successForwardUrl("/api/user/dispatch")
.permitAll()
.and()
.logout()
.permitAll();
httpSecurity.userDetailsService(userService);
}

@Override
protected void configure(AuthenticationManagerBuilder auth) throws Exception {
auth.userDetailsService(userDetailsService())
auth.userDetailsService(userService)
.passwordEncoder(passwordEncoder());
}

Expand Down
29 changes: 28 additions & 1 deletion bugtracker/src/main/java/bugtracker/user/UserController.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,19 @@
import org.springframework.http.ResponseEntity;
import org.springframework.security.access.annotation.Secured;
import org.springframework.security.core.Authentication;
import org.springframework.security.core.GrantedAuthority;
import org.springframework.security.core.context.SecurityContext;
import org.springframework.security.core.context.SecurityContextHolder;
import org.springframework.security.core.userdetails.UserDetails;
import org.springframework.web.bind.annotation.*;
import javax.inject.Inject;
import javax.validation.constraints.Null;
import java.net.URI;
import java.net.URISyntaxException;
import java.util.List;
import java.util.stream.Collectors;

import static java.util.stream.Collectors.toList;

@RestController
@RequestMapping("/api/user")
Expand Down Expand Up @@ -71,7 +77,7 @@ public ResponseEntity<Void> dispatchUser() {
if (cc.getAuthentication() != null) {
Authentication auth = cc.getAuthentication();
try {
headers.setLocation(new URI("/project/all"));
headers.setLocation(new URI("/home"));
} catch (URISyntaxException ignored) {}
}

Expand All @@ -87,4 +93,25 @@ public ResponseEntity<List<UserEntity>> getAllDeveloper(){
public ResponseEntity<List<UserEntity>> getAllSimpleUser(){
return new ResponseEntity<>(userService.getUsersByType(2), HttpStatus.OK);
}

@GetMapping("/current/roles")
public ResponseEntity<List<String>> getCurrentUser(Authentication authentication){
if (authentication != null) {
BTUserDetails principal = (BTUserDetails) authentication.getPrincipal();
return new ResponseEntity<>(principal.getAuthorities().stream().map(t -> ((GrantedAuthority) t).getAuthority()).collect(toList()), HttpStatus.OK);
} else {
return new ResponseEntity<>(null, HttpStatus.UNAUTHORIZED);
}
}

@GetMapping("/searchUsers/")
public ResponseEntity<List<UserEntity>> searchAllUsers(){
return new ResponseEntity<>(userService.getAllUser(), HttpStatus.OK);
}

@GetMapping("/searchUsers/{searchText}")
public ResponseEntity<List<UserEntity>> searchUsers(@PathVariable String searchText){
List<UserEntity> users = userService.searchByName(searchText);
return new ResponseEntity<>(users, HttpStatus.OK);
}
}
2 changes: 2 additions & 0 deletions bugtracker/src/main/java/bugtracker/user/UserRepository.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ public interface UserRepository extends JpaRepository<UserEntity, Long> {

List<UserEntity> findByType(Integer type);

List<UserEntity> findByNameContaining(String text);

UserEntity findByName(String name);

}
1 change: 1 addition & 0 deletions bugtracker/src/main/java/bugtracker/user/UserService.java
Original file line number Diff line number Diff line change
Expand Up @@ -74,4 +74,5 @@ public BCryptPasswordEncoder passwordEncoder() {
public List<UserEntity> getUsersByType(Integer type){
return userRepository.findByType(type);
}
public List<UserEntity> searchByName(String text) { return userRepository.findByNameContaining(text); }
}
4 changes: 3 additions & 1 deletion bugtracker/src/main/resources/application.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# ==============================================================
# = Data Source : TODO
# = Data Source
# ==============================================================
#spring.datasource.driver-class-name=com.mysql.jdbc.Driver
#spring.datasource.url=jdbc:mysql://127.0.0.1:3306/dbname?useSSL=false
Expand Down Expand Up @@ -64,3 +64,5 @@ spring.jpa.hibernate.ddl-auto = update

spring.resources.chain.cache=false

spring.resources.add-mappings=true

21 changes: 21 additions & 0 deletions bugtracker/src/main/resources/static/css/pictos.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
/* Pictos Custom Font
* Copyright (C) 2010-2012 Drew Wilson
* http://www.pictos.cc/server - http://drewwilson.com
*
* The fonts included in this document and used on this website are subject to the
* End User License Agreement entered into by the website owner. The fonts are protected
* under domestic and international trademark and copyright law. All parties other than
* the owner of this website are prohibited from using, modifying, reverse engineering,
* duplicating, or distributing the fonts in this document.
* These fonts are NOT free. It is illegal to use these fonts without paying for a license.
*
*/
@font-face {
font-family: 'Pictos';
src: url('pictos.eot');
src: url('pictos.eot?#iefix') format('embedded-opentype'),
url('pictos.woff') format('woff'),
url('pictos.ttf') format('truetype');
font-weight: normal;
font-style: normal;
}
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading