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

Skip to content
Snippets Groups Projects
Commit 852e7742 authored by Eduard Frankford's avatar Eduard Frankford
Browse files

ui upgrades to signal better if mistakes happen

parent 2e1108be
Branches
2 merge requests!188Merging Peer Reviewing et. al to Master,!164211 peer reviewing functionality
......@@ -243,6 +243,13 @@ public class ReviewService {
public void deleteReview(Long id) {
log.debug("REST request to delete review: {}", id);
Review review = reviewRepository.findById(id).get();
StatisticsDTO statistics = statisticsService.findOneByExerciseID(review.getResourceID()).orElse(null);
if (statistics != null) {
statistics.setBadgeRewarded(false);
statisticsService.save(statistics);
}
notifyReviewers(review.getId(), "The review for " + review.getResource() + " has been deleted.");
reviewRatingRepository.deleteByReviewId(id);
reviewRepository.deleteById(id);
}
......
......@@ -180,6 +180,7 @@ public class StatisticsResource {
newStats.setDownloads(0);
newStats.setViews(1);
newStats.setExerciseID(exerciseIdString);
newStats.setBadgeRewarded(false);
statisticsService.save(newStats);
log.debug("Created new statistics entry for exerciseID: {}", exerciseIdString);
statisticsDTO = Optional.of(newStats);
......
#H2 Server Properties
#Fri Mar 10 17:43:42 CET 2023
#Mon Mar 13 19:29:10 CET 2023
0=JHipster H2 (Disk)|org.h2.Driver|jdbc\:h2\:file\:./target/h2db/db/gitsearch|gitsearch
webSSL=false
webAllowOthers=true
......
......@@ -86,12 +86,6 @@ spring:
provider:
oidc:
issuer-uri: https://keycloak.sharing-codeability.uibk.ac.at/auth/realms/gitsearch
# localhost will be bound to the guest (container), not the host
# to run KeyCloak as a daemon, i.e., npm run docker:keycloak:up, /etc/hosts must be edited
# and the issuer-uri should be as follows:
# issuer-uri: http://keycloak:9080/auth/realms/jhipster
# gitlabOidc:
# issuer-uri: https://sharing.codeability-austria.uibk.ac.at
registration:
oidc:
client-id: ${OIDC_KEYCLOAK_CLIENTID}
......@@ -166,7 +160,7 @@ application:
registeredConnectorsCallBackURL: http://localhost:8080/api
installationName: Sharing Plattform (Development)
gitlab:
url: https://sharing.codeability-austria.uibk.ac.at
url: ${SECURITY_OAUTH2_CLIENT_PROVIDER_GITLABOIDC_ISSUERURI}
guestAccessToken: ${APPLICATION_GITLAB_GENERALACCESSTOKEN}
adminAccessToken: ${APPLICATION_GITLAB_ADMINACCESSTOKEN}
oerLink: https://oeresource-dev.logic.at
......@@ -73,6 +73,28 @@ export class ReviewManagementUpdateComponent implements OnInit {
this.reviewToEdit!.resource = exercise.title;
}
submitReview() {
this.selectedExercise = this.results.find(exercise => exercise.title === this.reviewToEdit!.resource);
const res = this.reviewToEdit!.users!.filter(o => this.selectedExercise?.contributor?.some(x => x.email == o));
if (res.length > 0) {
alert('The selected users: ' + res.toString() + ' ,are already contributors of this exercise. Please select other users.');
return;
}
const res2 = this.reviewToEdit!.users!.filter(o => this.selectedExercise?.creator.some(x => x.email == o));
if (res2.length > 0) {
alert('The selected users: ' + res2.toString() + ' ,are already creators of this exercise. Please select other users.');
return;
}
const res3 = this.reviewToEdit!.users!.filter(o => this.selectedExercise?.publisher.some(x => x.email == o));
if (res3.length > 0) {
alert('The selected users: ' + res3.toString() + ' ,are already publisher of this exercise. Please select other users.');
return;
}
this.reviewManagementService.update(this.reviewToEdit!).subscribe();
}
}
......@@ -115,7 +115,13 @@
<span class="d-none d-md-inline">Reward Badge</span>
</button>
<button type="submit" [routerLink]="['./', review.id, 'edit']" queryParamsHandling="merge" class="m-1 btn btn-primary btn-sm">
<button
*ngIf="!review.badgeRewarded"
type="submit"
[routerLink]="['./', review.id, 'edit']"
queryParamsHandling="merge"
class="m-1 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>
......
......@@ -72,6 +72,31 @@ export class ReviewManagementComponent implements OnInit, OnChanges {
}
submitReview() {
const res = this.selectedUsers!.filter(o => this.selectedExercise?.contributor?.some(x => x.email == o));
if (res.length > 0) {
alert('The selected users: ' + res.toString() + ' ,are already contributors of this exercise. Please select other users.');
return;
}
const res2 = this.selectedUsers!.filter(o => this.selectedExercise?.creator.some(x => x.email == o));
if (res2.length > 0) {
alert('The selected users: ' + res2.toString() + ' ,are already creators of this exercise. Please select other users.');
return;
}
const res3 = this.selectedUsers!.filter(o => this.selectedExercise?.publisher.some(x => x.email == o));
if (res3.length > 0) {
alert('The selected users: ' + res3.toString() + ' ,are already publisher of this exercise. Please select other users.');
return;
}
if (this.results.filter(e => e.title == this.selectedExercise?.title).length > 0) {
alert('The selected exercise: ' + this.selectedExercise!.title + ' ,is already in the database. Please select other exercise.');
return;
}
this.reviewManagementService
.create(
new ReviewRequest(
......
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