This is the codeAbility Sharing Platform! Learn more about the codeAbility Sharing Platform.

Skip to content
Snippets Groups Projects
Commit 8ac354a5 authored by Michael Breu's avatar Michael Breu :speech_balloon:
Browse files

Diverse Fixes

parent 872f2e1b
Branches
Tags
No related merge requests found
......@@ -162,7 +162,7 @@ public class UserWatchListService {
log.debug("Request to search for a page of CurrentUserWatchLists for query {}", query);
final List<Sort.Order> cleanSortOrder = pageable.getSort().get().filter(order -> !order.getProperty().equals( "_score")).collect(Collectors.toList());
Pageable cleanedPageRequest = PageRequest.of(pageable.getPageNumber(), pageable.getPageSize(), Sort.by(cleanSortOrder));
return userWatchListRepository.searchForCurrentUser(query, pageable)
return userWatchListRepository.searchForCurrentUser(query, cleanedPageRequest)
.map(userWatchListMapper::toDto);
}
......
......@@ -10,7 +10,6 @@ import javax.validation.Valid;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.http.HttpHeaders;
......@@ -276,7 +275,6 @@ public class UserWatchListResource {
* @return the result of the search.
*/
@GetMapping("/_search/currentuser-watch-lists")
@PreAuthorize("hasAnyRole('ADMIN')")
public ResponseEntity<List<UserWatchListDTO>> searchCurrentUserWatchLists(@RequestParam String query, Pageable pageable) {
log.debug("REST request to search for a current user and page of UserWatchLists for query {}", query);
Page<UserWatchListDTO> page = userWatchListService.searchForCurrentUser(query, pageable);
......
......@@ -9,11 +9,10 @@
</span>
</button>
</h2>
<!--
<jhi-alert-error></jhi-alert-error>
<jhi-alert></jhi-alert>
-->
<div class="row"
infiniteScroll
[infiniteScrollDistance]="2"
......@@ -95,78 +94,6 @@
</jhi-exercise-card>
</div>
</div>
<jhi-exercise-details [exercise]="selectedResult"></jhi-exercise-details>
<!-- old Version
<div class="col-12 col-md-7 col-lg-8 col-xl-9">
<div>
<div class="col-sm-12">
<form name="searchForm" class="form-inline">
<div class="input-group w-100 mt-3">
<input type="text" class="form-control" [(ngModel)]="currentSearch" id="currentSearch" name="currentSearch" placeholder="{{ 'gitsearchApp.userWatchList.home.search' | translate }}">
<button class="input-group-append btn btn-info" (click)="search(currentSearch)">
<fa-icon icon="search"></fa-icon>
</button>
<button class="input-group-append btn btn-danger" (click)="search('')" *ngIf="currentSearch">
<fa-icon icon="trash-alt"></fa-icon>
</button>
</div>
</form>
</div>
</div>
<div class="alert alert-warning" id="no-result" *ngIf="userWatchLists?.length === 0">
<span jhiTranslate="gitsearchApp.userWatchList.home.notFound">No userWatchLists found</span>
</div>
<div class="table-responsive" id="entities" *ngIf="userWatchLists && userWatchLists.length > 0">
<table class="table table-striped" aria-describedby="page-heading">
<thead>
<tr jhiSort [(predicate)]="predicate" [(ascending)]="ascending" [callback]="reset.bind(this)">
<th scope="col" jhiSortBy="id"><span jhiTranslate="global.field.id">ID</span> <fa-icon icon="sort"></fa-icon></th>
<th scope="col" jhiSortBy="name"><span jhiTranslate="gitsearchApp.userWatchList.name">Name</span> <fa-icon icon="sort"></fa-icon></th>
<th scope="col" jhiSortBy="userIdLogin"><span jhiTranslate="gitsearchApp.userWatchList.userId">User Id</span> <fa-icon icon="sort"></fa-icon></th>
<th scope="col"></th>
</tr>
</thead>
<tbody infinite-scroll (scrolled)="loadPage(page + 1)" [infiniteScrollDisabled]="page >= links['last']" [infiniteScrollDistance]="0">
<tr *ngFor="let userWatchList of userWatchLists ;trackBy: trackId">
<td><a [routerLink]="['/user-watch-list', userWatchList.id, 'view']">{{ userWatchList.id }}</a></td>
<td>{{ userWatchList.name }}</td>
<td>
{{ userWatchList.userIdLogin }}
</td>
<td class="text-right">
<div class="btn-group">
<button type="submit"
[routerLink]="['/user-watch-list', userWatchList.id, 'view']"
class="btn btn-info btn-sm">
<fa-icon icon="eye"></fa-icon>
<span class="d-none d-md-inline" jhiTranslate="entity.action.view">View</span>
</button>
<button type="submit"
[routerLink]="['/user-watch-list', userWatchList.id, 'edit']"
class="btn btn-primary btn-sm">
<fa-icon icon="pencil-alt"></fa-icon>
<span class="d-none d-md-inline" jhiTranslate="entity.action.edit">Edit</span>
</button>
<button type="submit" (click)="delete(userWatchList)"
class="btn btn-danger btn-sm">
<fa-icon icon="times"></fa-icon>
<span class="d-none d-md-inline" jhiTranslate="entity.action.delete">Delete</span>
</button>
</div>
</td>
</tr>
</tbody>
</table>
</div>
</div>
-->
</div>
</div>
<jhi-exercise-details [exercise]="selectedResult"></jhi-exercise-details>
......@@ -62,7 +62,7 @@ export class UserWatchListService {
searchForCurrentUser(req: SearchWithPagination): Observable<EntityArrayResponseType> {
const options = createRequestOption(req);
return this.http.get<IUserWatchList[]>(this.resourceSearchUrl, { params: options, observe: 'response' });
return this.http.get<IUserWatchList[]>(this.currentUserResourceSearchUrl, { params: options, observe: 'response' });
}
}
......@@ -46,7 +46,7 @@ export class ExerciseCardComponent implements OnInit {
*/
correctImageURL(event: Event): void {
if (event.srcElement) {
event.srcElement['src'] = '/content/img/gitLab.png';
event.srcElement['src'] = '/content/images/Logo_codeAbility_4c_300dpi_RGB3.gif';
}
}
}
......@@ -106,7 +106,7 @@ export class ExerciseDetailsComponent implements OnInit, OnDestroy {
*/
correctImageURL(event: Event): void {
if (event.srcElement) {
event.srcElement['src'] = '/content/img/gitLab.png';
event.srcElement['src'] = '/content/images/Logo_codeAbility_4c_300dpi_RGB3.gif';
}
}
......
......@@ -2,20 +2,20 @@
"gitsearchApp": {
"watchListEntry": {
"home": {
"title": "Watch List Entries",
"createLabel": "Watch List Entry erstellen",
"createOrEditLabel": "Watch List Entry erstellen oder bearbeiten",
"search": "Suche nach Watch List Entry",
"notFound": "No Watch List Entries found"
"title": "Lesezeichen",
"createLabel": "Lesezeichen erstellen",
"createOrEditLabel": "Lesezeichen erstellen oder bearbeiten",
"search": "Suche nach Lesezeichen",
"notFound": "Keine Lesezeichen gefunden"
},
"created": "Watch List Entry erstellt",
"updated": "Watch List Entry aktualisiert",
"deleted": "Watch List Entry gelscht",
"created": "Lesezeichen erstellt",
"updated": "Lesezeichen aktualisiert",
"deleted": "Lesezeichen gelöscht",
"delete": {
"question": "Soll Watch List Entry {{ id }} wirklich dauerhaft gelöscht werden?"
"question": "Soll Lesezeichen {{ id }} wirklich dauerhaft gelöscht werden?"
},
"detail": {
"title": "Watch List Entry"
"title": "Lesezeichen"
},
"exerciseId": "Exercise Id",
"exerciseName": "Exercise Name",
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment