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

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

Merge branch '414_resource_link_wrong' into 'development'

414 resource link wrong

See merge request sharing/codeability-sharing-platform!210
parents c608f658 6b65c95f
Branches
3 merge requests!211Merge new meta data indexing,!210414 resource link wrong,!209fix search results bug
Showing
with 32 additions and 25 deletions
<div class="mt-5" *ngIf="statisticsLoaded | async">
<div class="" *ngIf="statisticsLoaded | async">
<div class="container-fluid pt-3" style="padding-left: 3%; padding-right: 3%; max-width: 1700px">
<h2>{{ 'achievements.title' | translate }}</h2>
......
<div class="mt-5">
<div class="">
<h3 class="p-3">Review management</h3>
<div class="">
<div class="p-4">
......
......@@ -115,7 +115,7 @@ export class PeerReviewingComponent implements OnInit {
selectExercise(gitlabURL: string): ExtendedSearchResultDTO {
const exercise: ExtendedSearchResultDTO = this.exerciseService.populateExerciseWithData(
this.allExercises.find(exercise => exercise.project.url == gitlabURL)!
this.allExercises.find(exercise => this.reviewManagementService.getGitLabUrl(exercise) == gitlabURL)!
);
return exercise;
}
......
<div class="table-responsive mt-5" *ngIf="loggers">
<div class="table-responsive" *ngIf="loggers">
<h2 class="pt-3" id="logs-page-heading" jhiTranslate="logs.title" data-cy="logsPageHeading">Logs</h2>
<p jhiTranslate="logs.nbloggers" [translateValues]="{ total: loggers.length }">There are {{ loggers.length }} loggers.</p>
......
<div class="mt-5">
<div class="">
<h2 class="pt-3">
<span>Review Management</span>
......
......@@ -105,7 +105,7 @@ export class ReviewManagementComponent implements OnInit, OnChanges {
this.selectedExercise!.metadata.title,
this.selectedExercise!.exerciseId,
this.selectedUsers!,
this.selectedExercise!.project.url
this.reviewManagementService.getGitLabUrl(this.selectedExercise!)
)
)
.subscribe(() => {
......
......@@ -5,6 +5,7 @@ import { ApplicationConfigService } from 'app/core/config/application-config.ser
import { ReviewRequest } from './reviewRequest.model';
import { Review, ReviewStatisticsDTO } from './review.model';
import { ReviewRating } from './reviewRating.model';
import { SearchResultDTO } from 'app/shared/model/search/search-result-dto.model';
@Injectable({ providedIn: 'root' })
export class ReviewManagementService {
......@@ -99,4 +100,14 @@ export class ReviewManagementService {
getAllReviewRatings(): Observable<ReviewRating[]> {
return this.http.get<ReviewRating[]>(this.resourceUrl + '/reviewRatings');
}
getGitLabUrl(exercise: SearchResultDTO): string {
const lastSlashPos = exercise?.file.path.lastIndexOf('/');
if (!lastSlashPos || lastSlashPos <= 0) {
return exercise.project.url;
}
const prefix = exercise.file.path.substring(0, lastSlashPos);
const branch = 'main';
return `${exercise.project.url}/-/tree/${branch}/${prefix}`;
}
}
<div class="mt-5">
<div class="">
<h2 class="pt-3">
<span id="user-management-page-heading" jhiTranslate="userManagement.home.title" data-cy="userManagementPageHeading">Users</span>
......
<div class="row justify-content-center mt-5">
<div class="row justify-content-center">
<div class="col-8 pt-3">
<form name="editForm" role="form" novalidate (ngSubmit)="save()" [formGroup]="editForm">
<h2 id="myUserLabel" jhiTranslate="userManagement.home.createOrEditLabel">Create or edit a User</h2>
......
<div class="row mt-5" infiniteScroll [infiniteScrollDistance]="2" [infiniteScrollThrottle]="50" (scrolled)="onScroll()">
<div class="row" infiniteScroll [infiniteScrollDistance]="2" [infiniteScrollThrottle]="50" (scrolled)="onScroll()">
<div class="col-12 pt-3 col-md-5 col-lg-4 col-xl-3">
<div class="bookmarklist-container">
<h2 id="page-heading">
......
<div class="row mt-5">
<div class="row">
<div>
<jhi-pages-markdown-viewer [path]="pagePath"></jhi-pages-markdown-viewer>
</div>
......
<div class="mt-5">
<div class="">
<h2 class="pt-3" id="page-heading">
<span jhiTranslate="gitsearchApp.likes.home.title">Likes</span>
......
<div class="mt-5">
<div class="">
<h2 class="pt-3">
<span>Review Ratings</span>
</h2>
......
<div class="mt-5">
<div class="">
<h2 class="pt-3">
<span>Reviews</span>
......
......@@ -102,7 +102,7 @@ export class ReviewsComponent implements OnInit, OnChanges {
this.selectedExercise!.metadata.title,
this.selectedExercise!.exerciseId,
this.selectedUsers!,
this.selectedExercise!.project.url
this.reviewManagementService.getGitLabUrl(this.selectedExercise!)
)
)
.subscribe(() => {
......
<div class="mt-5">
<div class="">
<h2 class="pt-3" id="page-heading">
<span jhiTranslate="gitsearchApp.statistics.home.title">Statistics</span>
......
......@@ -2,6 +2,7 @@ import { HttpResponse } from '@angular/common/http';
import { Component, EventEmitter, Input, OnDestroy, OnInit, Output } from '@angular/core';
import { Router } from '@angular/router';
import { faFolder } from '@fortawesome/free-solid-svg-icons';
import { ReviewManagementService } from 'app/admin/review-management/review-management.service';
import { ApplicationInfoService } from 'app/core/application/applicationInfo.service';
import { Account } from 'app/core/auth/account.model';
import { AccountService } from 'app/core/auth/account.service';
......@@ -98,6 +99,7 @@ export class ExerciseBodyComponent implements OnInit, OnDestroy {
oerExerciseMatch = /([a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12})$/;
constructor(
private reviewManagementService: ReviewManagementService,
private accountService: AccountService,
protected pluginService: PluginService,
private searchService: SearchService,
......@@ -171,13 +173,7 @@ export class ExerciseBodyComponent implements OnInit, OnDestroy {
}
getGitLabUrl(): string {
const lastSlashPos = this.exercise?.file.path.lastIndexOf('/');
if (!lastSlashPos || lastSlashPos <= 0) {
return this.exercise!.project.url;
}
const prefix = this.exercise!.file.path.substring(0, lastSlashPos);
const branch = 'main';
return `${this.exercise!.project.url}/-/tree/${branch}/${prefix}`;
return this.reviewManagementService.getGitLabUrl(this.exercise!);
}
openLink(link: string): void {
......
<div class="container-fluid overflow-hidden mt-5">
<div class="container-fluid overflow-hidden">
<div class="row">
<div class="col-12" *ngIf="!account">
<jhi-pages-markdown-viewer class="home" path="/notLoggedInPage"></jhi-pages-markdown-viewer>
......
<div class="mt-5"></div>
<div class=""></div>
<div class="pt-4">
<h3 jhitranslate="legal.privacy.title">Privacy Statement</h3>
......
<div class="row mt-5" infiniteScroll [infiniteScrollDistance]="2" [infiniteScrollThrottle]="50" (scrolled)="onScroll()">
<div class="row" infiniteScroll [infiniteScrollDistance]="2" [infiniteScrollThrottle]="50" (scrolled)="onScroll()">
<jhi-search-input class="col-12 col-md-5 col-lg-4 col-xl-3" (searchInputEvent)="updateSearchInput($event)"> </jhi-search-input>
<div class="col-12 col-md-7 col-lg-8 col-xl-9 back pt-4">
<div id="loading" *ngIf="hitCount === 0 && loading">
......
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