Skip to content

Development: Remove unused localVCenabled value from client #10478

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
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
Original file line number Diff line number Diff line change
Expand Up @@ -211,17 +211,11 @@
@if (exercise.type === ExerciseType.PROGRAMMING) {
<div class="col-12">
<h4 jhiTranslate="artemisApp.exerciseAssessmentDashboard.exampleSolution"></h4>
@if (!localVCEnabled) {
<a jhiSecureLink [href]="programmingExercise.solutionParticipation?.repositoryUri || ''">
<jhi-button jhiTranslate="artemisApp.exerciseAssessmentDashboard.programmingExercise.exampleSolution" />
</a>
} @else {
<jhi-code-button
[smallButtons]="true"
[repositoryUri]="programmingExercise.solutionParticipation?.repositoryUri || ''"
[routerLinkForRepositoryView]="['/course-management', courseId, 'programming-exercises', exerciseId, 'repository', 'SOLUTION']"
/>
}
<jhi-code-button
[smallButtons]="true"
[repositoryUri]="programmingExercise.solutionParticipation?.repositoryUri || ''"
[routerLinkForRepositoryView]="['/course-management', courseId, 'programming-exercises', exerciseId, 'repository', 'SOLUTION']"
/>
</div>
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,14 +51,12 @@ import { LegendPosition, PieChartModule } from '@swimlane/ngx-charts';
import dayjs from 'dayjs/esm';
import { faCheckCircle, faExclamationTriangle, faFolderOpen, faListAlt, faQuestionCircle, faSort, faSpinner } from '@fortawesome/free-solid-svg-icons';
import { GraphColors } from 'app/exercise/shared/entities/statistics.model';
import { PROFILE_LOCALVC } from 'app/app.constants';
import { isManualResult } from 'app/exercise/result/result.utils';
import { TutorParticipationGraphComponent } from 'app/shared/dashboards/tutor-participation-graph/tutor-participation-graph.component';
import { SecondCorrectionEnableButtonComponent } from './second-correction-button/second-correction-enable-button.component';
import { SidePanelComponent } from 'app/shared/side-panel/side-panel.component';
import { TranslateDirective } from 'app/shared/language/translate.directive';
import { FaIconComponent } from '@fortawesome/angular-fontawesome';
import { ButtonComponent } from 'app/shared/components/button.component';
import { CodeButtonComponent } from 'app/shared/components/code-button/code-button.component';
import { StructuredGradingInstructionsAssessmentLayoutComponent } from 'app/assessment/manage/structured-grading-instructions-assessment-layout/structured-grading-instructions-assessment-layout.component';
import { NgbTooltip } from '@ng-bootstrap/ng-bootstrap';
Expand All @@ -74,9 +72,7 @@ import { ArtemisDurationFromSecondsPipe } from 'app/shared/pipes/artemis-duratio
import { AssessmentDashboardInformationEntry } from 'app/assessment/shared/assessment-dashboard/assessment-dashboard-information.component';
import { HeaderExercisePageWithDetailsComponent } from 'app/exercise/exercise-headers/header-exercise-page-with-details.component';
import { InfoPanelComponent } from 'app/assessment/shared/info-panel/info-panel.component';
import { SecureLinkDirective } from 'app/assessment/manage/secure-link.directive';
import { ResultComponent } from 'app/exercise/result/result.component';
import { ProfileService } from 'app/core/layouts/profiles/shared/profile.service';
import { TutorParticipationService } from 'app/assessment/shared/assessment-dashboard/exercise-dashboard/tutor-participation.service';

export interface ExampleSubmissionQueryParams {
Expand All @@ -101,8 +97,6 @@ export interface ExampleSubmissionQueryParams {
InfoPanelComponent,
ProgrammingExerciseInstructionComponent,
ModelingEditorComponent,
SecureLinkDirective,
ButtonComponent,
CodeButtonComponent,
StructuredGradingInstructionsAssessmentLayoutComponent,
NgbTooltip,
Expand Down Expand Up @@ -136,7 +130,6 @@ export class ExerciseAssessmentDashboardComponent implements OnInit {
private programmingSubmissionService = inject(ProgrammingSubmissionService);
private guidedTourService = inject(GuidedTourService);
private sortService = inject(SortService);
private profileService = inject(ProfileService);

readonly roundScoreSpecifiedByCourseSettings = roundValueSpecifiedByCourseSettings;
readonly getCourseFromExercise = getCourseFromExercise;
Expand All @@ -152,8 +145,6 @@ export class ExerciseAssessmentDashboardComponent implements OnInit {
isTestRun = false;
isLoading = false;

localVCEnabled = true;

statsForDashboard = new StatsForDashboard();

exerciseId: number;
Expand Down Expand Up @@ -262,9 +253,6 @@ export class ExerciseAssessmentDashboardComponent implements OnInit {
this.translateService.onLangChange.subscribe(() => {
this.setupGraph();
});
this.profileService.getProfileInfo().subscribe((profileInfo) => {
this.localVCEnabled = profileInfo.activeProfiles.includes(PROFILE_LOCALVC);
});
}

setupGraph() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import { faEye, faFolderOpen, faPlayCircle, faRedo, faUsers } from '@fortawesome
import { ParticipationService } from 'app/exercise/participation/participation.service';
import dayjs from 'dayjs/esm';
import { QuizExercise } from 'app/quiz/shared/entities/quiz-exercise.model';
import { PROFILE_ATHENA, PROFILE_LOCALVC } from 'app/app.constants';
import { PROFILE_ATHENA } from 'app/app.constants';
import { AssessmentType } from 'app/assessment/shared/entities/assessment-type.model';
import { ButtonType } from 'app/shared/components/button.component';
import { NgTemplateOutlet } from '@angular/common';
Expand Down Expand Up @@ -79,7 +79,6 @@ export class ExerciseDetailsStudentActionsComponent implements OnInit, OnChanges
hasRatedGradedResult: boolean;
beforeDueDate: boolean;
editorLabel?: string;
localVCEnabled = true;
athenaEnabled = false;
routerLink: string;

Expand All @@ -98,7 +97,6 @@ export class ExerciseDetailsStudentActionsComponent implements OnInit, OnChanges
} else if (this.exercise.type === ExerciseType.PROGRAMMING) {
this.programmingExercise = this.exercise as ProgrammingExercise;
this.profileService.getProfileInfo().subscribe((profileInfo) => {
this.localVCEnabled = profileInfo.activeProfiles?.includes(PROFILE_LOCALVC);
this.athenaEnabled = profileInfo.activeProfiles?.includes(PROFILE_ATHENA);
});
} else if (this.exercise.type === ExerciseType.MODELING) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,17 +29,15 @@
jhiTranslate="artemisApp.userSettings.notificationSettings"
></a>
<a class="list-group-item btn btn-outline-primary" routerLink="science" routerLinkActive="active" jhiTranslate="artemisApp.userSettings.scienceSettings"></a>
@if (localVCEnabled) {
<a class="list-group-item btn btn-outline-primary" routerLink="ssh" routerLinkActive="active" jhiTranslate="artemisApp.userSettings.sshSettings"></a>
@if (isAtLeastTutor) {
<a
class="list-group-item btn btn-outline-primary"
routerLink="vcs-token"
routerLinkActive="active"
jhiTranslate="artemisApp.userSettings.vcsAccessTokenSettings"
>
</a>
}
<a class="list-group-item btn btn-outline-primary" routerLink="ssh" routerLinkActive="active" jhiTranslate="artemisApp.userSettings.sshSettings"></a>
@if (isAtLeastTutor) {
<a
class="list-group-item btn btn-outline-primary"
routerLink="vcs-token"
routerLinkActive="active"
jhiTranslate="artemisApp.userSettings.vcsAccessTokenSettings"
>
</a>
}
<a class="list-group-item btn btn-outline-primary" routerLink="ide-preferences" routerLinkActive="active">
<!--Default IDE Settings-->
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { Component, OnInit, inject } from '@angular/core';
import { faUser } from '@fortawesome/free-solid-svg-icons';
import { ProfileService } from 'app/core/layouts/profiles/shared/profile.service';
import { PROFILE_LOCALVC, addPublicFilePrefix } from 'app/app.constants';
import { addPublicFilePrefix } from 'app/app.constants';
import { User } from 'app/core/user/user.model';
import { AccountService } from 'app/core/auth/account.service';
import { tap } from 'rxjs';
Expand All @@ -19,21 +18,15 @@ import { FontAwesomeModule } from '@fortawesome/angular-fontawesome';
imports: [TranslateDirective, RouterModule, FontAwesomeModule],
})
export class UserSettingsContainerComponent implements OnInit {
private readonly profileService = inject(ProfileService);
private readonly accountService = inject(AccountService);

// Icons
faUser = faUser;

currentUser?: User;
localVCEnabled = true;
isAtLeastTutor = false;

ngOnInit() {
this.profileService.getProfileInfo().subscribe((profileInfo) => {
this.localVCEnabled = profileInfo.activeProfiles.includes(PROFILE_LOCALVC);
});

this.accountService
.getAuthenticationState()
.pipe(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -132,11 +132,7 @@ <h5 class="group-title font-weight-bold mb-0">{{ exerciseGroup.title }}</h5>
<button
jhiDeleteButton
[entityTitle]="exerciseGroup.title || ''"
deleteQuestion="{{
localVCEnabled
? 'artemisApp.examManagement.exerciseGroup.delete.questionLocalVC'
: 'artemisApp.examManagement.exerciseGroup.delete.question'
}}"
deleteQuestion="artemisApp.examManagement.exerciseGroup.delete.questionLocalVC"
deleteConfirmationText="artemisApp.examManagement.exerciseGroup.delete.typeNameToConfirm"
[additionalChecks]="
localCIEnabled
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ import {
import { ExamImportComponent } from 'app/exam/manage/exams/exam-import/exam-import.component';
import { ExerciseImportWrapperComponent } from 'app/exercise/import/exercise-import-wrapper/exercise-import-wrapper.component';
import { ProfileService } from 'app/core/layouts/profiles/shared/profile.service';
import { PROFILE_LOCALCI, PROFILE_LOCALVC } from 'app/app.constants';
import { PROFILE_LOCALCI } from 'app/app.constants';
import { TranslateDirective } from 'app/shared/language/translate.directive';
import { FaIconComponent } from '@fortawesome/angular-fontawesome';
import { HelpIconComponent } from 'app/shared/components/help-icon.component';
Expand Down Expand Up @@ -86,7 +86,6 @@ export class ExerciseGroupsComponent implements OnInit {
latestIndividualEndDate?: dayjs.Dayjs;
exerciseGroupToExerciseTypesDict = new Map<number, ExerciseType[]>();

localVCEnabled = true;
localCIEnabled = true;

// Icons
Expand Down Expand Up @@ -121,7 +120,6 @@ export class ExerciseGroupsComponent implements OnInit {
error: (res: HttpErrorResponse) => onError(this.alertService, res),
});
this.profileService.getProfileInfo().subscribe((profileInfo) => {
this.localVCEnabled = profileInfo.activeProfiles.includes(PROFILE_LOCALVC);
this.localCIEnabled = profileInfo.activeProfiles.includes(PROFILE_LOCALCI);
});
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,7 @@
<div>
<div>
@if (exercise().templateParticipation?.repositoryUri) {
<!--Checks if the programming exercise has a setup with VCS and CI, if this not the case
the links/clone-buttons are disabled--->
@if (!localVCEnabled) {
<span>
<a href="{{ exercise().templateParticipation?.repositoryUri || '' }}" target="_blank">Template</a>
</span>
} @else {
<a [routerLink]="" (click)="downloadRepository(RepositoryType.TEMPLATE)"> <fa-icon [icon]="faDownload" /> Template </a>
}
<a (click)="downloadRepository(RepositoryType.TEMPLATE)"> <fa-icon [icon]="faDownload" /> Template </a>
}
@if (exercise().templateParticipation?.results?.length) {
<jhi-programming-exercise-instructor-status
Expand All @@ -28,13 +20,7 @@
</div>
<div>
@if (exercise().solutionParticipation?.repositoryUri) {
@if (!localVCEnabled) {
<span>
<a href="{{ exercise().solutionParticipation?.repositoryUri || '' }}" target="_blank">Solution</a>
</span>
} @else {
<a [routerLink]="" (click)="downloadRepository(RepositoryType.SOLUTION)"> <fa-icon [icon]="faDownload" /> Solution </a>
}
<a (click)="downloadRepository(RepositoryType.SOLUTION)"> <fa-icon [icon]="faDownload" /> Solution </a>
}
@if (exercise().solutionParticipation?.results?.length) {
<jhi-programming-exercise-instructor-status
Expand All @@ -46,13 +32,7 @@
</div>
<div>
@if (exercise().testRepositoryUri) {
@if (!localVCEnabled) {
<span>
<a href="{{ exercise().testRepositoryUri }}" target="_blank">Test</a>
</span>
} @else {
<a [routerLink]="" (click)="downloadRepository(RepositoryType.TESTS)"> <fa-icon [icon]="faDownload" /> Test </a>
}
<a (click)="downloadRepository(RepositoryType.TESTS)"> <fa-icon [icon]="faDownload" /> Test </a>
}
</div>
</div>
Expand All @@ -61,21 +41,13 @@
<div>
@if (exercise().templateParticipation?.buildPlanId) {
<span>
@if (!localVCEnabled) {
<a target="_blank" rel="noreferrer" href="{{ exercise().templateParticipation!.buildPlanUrl }}">Template</a>
} @else {
{{ exercise().templateParticipation!.buildPlanId }}
}
{{ exercise().templateParticipation!.buildPlanId }}
</span>
}
<br />
@if (exercise().solutionParticipation?.buildPlanId) {
<span>
@if (!localVCEnabled) {
<a target="_blank" rel="noreferrer" href="{{ exercise().solutionParticipation!.buildPlanUrl }}">Solution</a>
} @else {
{{ exercise().solutionParticipation!.buildPlanId }}
}
{{ exercise().templateParticipation!.buildPlanId }}
</span>
}
<br />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@ import { ProgrammingExerciseService } from 'app/programming/manage/services/prog
import { downloadZipFileFromResponse } from 'app/shared/util/download.util';
import { AlertService } from 'app/shared/service/alert.service';
import { faDownload } from '@fortawesome/free-solid-svg-icons';
import { PROFILE_LOCALVC, PROFILE_THEIA } from 'app/app.constants';
import { RouterLink } from '@angular/router';
import { PROFILE_THEIA } from 'app/app.constants';
import { FaIconComponent } from '@fortawesome/angular-fontawesome';
import { ProgrammingExerciseInstructorStatusComponent } from 'app/programming/manage/status/programming-exercise-instructor-status.component';
import { TranslateDirective } from 'app/shared/language/translate.directive';
Expand All @@ -19,7 +18,7 @@ import { ProfileService } from 'app/core/layouts/profiles/shared/profile.service
selector: 'jhi-programming-exercise-group-cell',
templateUrl: './programming-exercise-group-cell.component.html',
styles: [':host{display: contents}'],
imports: [RouterLink, FaIconComponent, ProgrammingExerciseInstructorStatusComponent, TranslateDirective],
imports: [FaIconComponent, ProgrammingExerciseInstructorStatusComponent, TranslateDirective],
})
export class ProgrammingExerciseGroupCellComponent implements OnInit {
private profileService = inject(ProfileService);
Expand All @@ -30,7 +29,6 @@ export class ProgrammingExerciseGroupCellComponent implements OnInit {

protected readonly RepositoryType = RepositoryType;

localVCEnabled = true;
onlineIdeEnabled = false;

displayShortName = input(false);
Expand All @@ -43,7 +41,6 @@ export class ProgrammingExerciseGroupCellComponent implements OnInit {

ngOnInit(): void {
this.profileService.getProfileInfo().subscribe((profileInfo) => {
this.localVCEnabled = profileInfo.activeProfiles.includes(PROFILE_LOCALVC);
this.onlineIdeEnabled = profileInfo.activeProfiles.includes(PROFILE_THEIA);

const projectKey = this.exercise()?.projectKey;
Expand All @@ -62,16 +59,13 @@ export class ProgrammingExerciseGroupCellComponent implements OnInit {
}

/**
* Downloads the instructor repository. Used when the "localvc" profile is active.
* For the local VCS, linking to an external site displaying the repository does not work.
* Instead, the repository is downloaded.
* Downloads the instructor repository.
*
* @param repositoryType
*/
downloadRepository(repositoryType: RepositoryType): void {
const programmingExerciseId = this.exercise()?.id;
if (programmingExerciseId) {
// Repository type cannot be 'AUXILIARY' as auxiliary repositories are currently not supported for the local VCS.
this.programmingExerciseService.exportInstructorRepository(programmingExerciseId, repositoryType, undefined).subscribe((response: HttpResponse<Blob>) => {
downloadZipFileFromResponse(response);
this.alertService.success('artemisApp.programmingExercise.export.successMessageRepos');
Expand Down
Loading
Loading