Skip to content

Commit

Permalink
Merge pull request #75 from IHIW/develop
Browse files Browse the repository at this point in the history
sorting and version up
  • Loading branch information
cyt-mn authored Apr 7, 2020
2 parents d4f634b + 1946305 commit 32081b6
Show file tree
Hide file tree
Showing 15 changed files with 857 additions and 2,349 deletions.
2,523 changes: 241 additions & 2,282 deletions package-lock.json

Large diffs are not rendered by default.

10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,15 @@
"@ngx-translate/core": "11.0.1",
"@ngx-translate/http-loader": "4.0.0",
"bootstrap": "4.3.1",
"bootswatch": "^4.3.1",
"bootswatch": "^4.4.1",
"core-js": "3.1.3",
"country-code-lookup": "0.0.15",
"file-saver": "^2.0.2",
"moment": "2.24.0",
"ng-jhipster": "0.10.1",
"ngx-cookie": "4.0.2",
"ngx-infinite-scroll": "7.2.0",
"ngx-markdown": "^8.1.0",
"ngx-markdown": "^8.2.2",
"ngx-webstorage": "4.0.1",
"rxjs": "6.5.2",
"swagger-ui": "3.23.11",
Expand All @@ -45,9 +45,9 @@
"@types/chai-string": "1.4.1",
"@types/jest": "24.0.14",
"@types/mocha": "5.2.7",
"@types/node": "^10.12.27",
"@types/node": "^10.17.18",
"@types/selenium-webdriver": "4.0.0",
"acorn": "6.1.1",
"acorn": "^6.4.1",
"angular-router-loader": "0.8.5",
"angular2-template-loader": "0.6.2",
"autoprefixer": "9.6.0",
Expand All @@ -64,7 +64,7 @@
"file-loader": "4.0.0",
"fork-ts-checker-webpack-plugin": "1.3.6",
"friendly-errors-webpack-plugin": "1.7.0",
"generator-jhipster": "^6.5.1",
"generator-jhipster": "^6.8.0",
"html-loader": "0.5.5",
"html-webpack-plugin": "3.2.0",
"husky": "2.4.1",
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

<groupId>org.ihiw.management</groupId>
<artifactId>ihiw-management</artifactId>
<version>1.0.14</version>
<version>1.0.17</version>
<packaging>jar</packaging>
<name>Ihiw Management</name>

Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,14 @@
package org.ihiw.management.repository;

import org.ihiw.management.domain.IhiwLab;
import org.springframework.data.jpa.repository.*;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;
import org.springframework.stereotype.Repository;

import java.util.List;
import java.util.Optional;


Expand All @@ -14,4 +19,19 @@
@Repository
public interface IhiwLabRepository extends JpaRepository<IhiwLab, Long> {
Optional<IhiwLab> findByLabCode(String labCode);

Optional<IhiwLab> findById(Long id);

Page<IhiwLab> findAllById(Pageable pageable, Long id);

@Query("select lab from IhiwLab lab")
Page<IhiwLab> findAll(Pageable pageable);


@Query("select lab from IhiwLab lab WHERE lab.id in (:ids)")
Page<IhiwLab> findByLabInIds(Pageable pageable, @Param("ids") List<Long> ids);
}




Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,7 @@ public interface ProjectRepository extends JpaRepository<Project, Long> {

List<Project> findByCreatedBy(IhiwUser currentIhiwUser);

List<Project> findAllByLeaders(IhiwUser leader);

List<Project> findAllByOrderByComponent();
}
13 changes: 11 additions & 2 deletions src/main/java/org/ihiw/management/service/UserService.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,13 @@
import org.ihiw.management.repository.UserRepository;
import org.ihiw.management.security.AuthoritiesConstants;
import org.ihiw.management.security.SecurityUtils;
import org.ihiw.management.service.dto.LabDTO;
import org.ihiw.management.service.dto.UserDTO;
import org.ihiw.management.service.util.RandomUtil;
import org.ihiw.management.web.rest.errors.*;

import org.ihiw.management.web.rest.errors.EmailAlreadyUsedException;
import org.ihiw.management.web.rest.errors.InvalidPasswordException;
import org.ihiw.management.web.rest.errors.LabDoesNotExistException;
import org.ihiw.management.web.rest.errors.LoginAlreadyUsedException;
import org.ihiw.management.web.rest.vm.ManagedUserVM;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
Expand Down Expand Up @@ -359,6 +362,12 @@ public Page<UserDTO> getAllManagedUsers(Pageable pageable) {
return userRepository.findAllByLoginNot(pageable, Constants.ANONYMOUS_USER).map(UserDTO::new);
}

@Transactional(readOnly = true)
public Page<LabDTO> getAllLabs(Pageable pageable) {
return ihiwLabRepository.findAll(pageable).map(LabDTO::new);
}


@Transactional(readOnly = true)
public Page<UserDTO> getMyManagedUsers(Pageable pageable, IhiwLab ihiwLab) {
List<IhiwUser> users = ihiwUserRepository.findByLab(ihiwLab);
Expand Down
Loading

0 comments on commit 32081b6

Please sign in to comment.