Skip to content

Commit

Permalink
Integrated code lifecycle: Offer deletion of build plans when using J…
Browse files Browse the repository at this point in the history
…enkins (#8543)
  • Loading branch information
b-fein authored May 17, 2024
1 parent 6e1d3c9 commit 5a4bdf3
Show file tree
Hide file tree
Showing 8 changed files with 19 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ <h5 class="group-title font-weight-bold mb-0">{{ exerciseGroup.title }}</h5>
}}"
deleteConfirmationText="artemisApp.examManagement.exerciseGroup.delete.typeNameToConfirm"
[additionalChecks]="
localVCEnabled
localCIEnabled
? {}
: {
deleteStudentReposBuildPlans: 'artemisApp.programmingExercise.delete.studentReposBuildPlans',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ import {
import { ExamImportComponent } from 'app/exam/manage/exams/exam-import/exam-import.component';
import { ExerciseImportWrapperComponent } from 'app/exercises/shared/import/exercise-import-wrapper/exercise-import-wrapper.component';
import { ProfileService } from 'app/shared/layouts/profiles/profile.service';
import { PROFILE_LOCALVC } from 'app/app.constants';
import { PROFILE_LOCALCI, PROFILE_LOCALVC } from 'app/app.constants';

@Component({
selector: 'jhi-exercise-groups',
Expand All @@ -54,6 +54,7 @@ export class ExerciseGroupsComponent implements OnInit {
exerciseGroupToExerciseTypesDict = new Map<number, ExerciseType[]>();

localVCEnabled = false;
localCIEnabled = false;

// Icons
faPlus = faPlus;
Expand Down Expand Up @@ -100,6 +101,7 @@ export class ExerciseGroupsComponent implements OnInit {
});
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 @@ -211,7 +211,7 @@ <h2><span jhiTranslate="artemisApp.programmingExercise.detail.title"></span> {{
(delete)="deleteProgrammingExercise($event)"
[dialogError]="dialogError$"
[additionalChecks]="
localVCEnabled
localCIEnabled
? {}
: {
deleteStudentReposBuildPlans: 'artemisApp.programmingExercise.delete.studentReposBuildPlans',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ import { ProgrammingLanguageFeatureService } from 'app/exercises/programming/sha
import { DocumentationType } from 'app/shared/components/documentation-button/documentation-button.component';
import { ConsistencyCheckService } from 'app/shared/consistency-check/consistency-check.service';
import { hasEditableBuildPlan } from 'app/shared/layouts/profiles/profile-info.model';
import { PROFILE_IRIS, PROFILE_LOCALVC } from 'app/app.constants';
import { PROFILE_IRIS, PROFILE_LOCALCI, PROFILE_LOCALVC } from 'app/app.constants';
import { ArtemisMarkdownService } from 'app/shared/markdown.service';
import { DetailOverviewSection, DetailType } from 'app/detail-overview-list/detail-overview-list.component';
import { IrisSettingsService } from 'app/iris/settings/shared/iris-settings.service';
Expand Down Expand Up @@ -90,6 +90,7 @@ export class ProgrammingExerciseDetailComponent implements OnInit, OnDestroy {
// Used to hide links to repositories and build plans when the "localvc" profile is active.
// Also used to hide the buttons to lock and unlock all repositories as that does not do anything in the local VCS.
localVCEnabled = false;
localCIEnabled = false;
irisEnabled = false;
irisChatEnabled = false;

Expand Down Expand Up @@ -195,6 +196,7 @@ export class ProgrammingExerciseDetailComponent implements OnInit, OnDestroy {
this.supportsAuxiliaryRepositories =
this.programmingLanguageFeatureService.getProgrammingLanguageFeature(programmingExercise.programmingLanguage).auxiliaryRepositoriesSupported ?? false;
this.localVCEnabled = profileInfo.activeProfiles.includes(PROFILE_LOCALVC);
this.localCIEnabled = profileInfo.activeProfiles.includes(PROFILE_LOCALCI);
this.irisEnabled = profileInfo.activeProfiles.includes(PROFILE_IRIS);
if (this.irisEnabled) {
this.irisSettingsService.getCombinedCourseSettings(this.courseId).subscribe((settings) => {
Expand Down Expand Up @@ -373,15 +375,15 @@ export class ProgrammingExerciseDetailComponent implements OnInit, OnDestroy {
showOpenLink: !this.localVCEnabled,
},
},
!this.localVCEnabled && {
!this.localCIEnabled && {
type: DetailType.Link,
title: 'artemisApp.programmingExercise.templateBuildPlanId',
data: {
href: exercise.templateParticipation?.buildPlanUrl,
text: exercise.templateParticipation?.buildPlanId,
},
},
!this.localVCEnabled && {
!this.localCIEnabled && {
type: DetailType.Link,
title: 'artemisApp.programmingExercise.solutionBuildPlanId',
data: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,7 @@
(delete)="deleteProgrammingExercise(programmingExercise.id!, $event)"
[dialogError]="dialogError$"
[additionalChecks]="
localVCEnabled
localCIEnabled
? {}
: {
deleteStudentReposBuildPlans: 'artemisApp.programmingExercise.delete.studentReposBuildPlans',
Expand Down Expand Up @@ -320,7 +320,7 @@
(delete)="deleteMultipleProgrammingExercises(selectedExercises, $event)"
[requireConfirmationOnlyForAdditionalChecks]="true"
[additionalChecks]="
localVCEnabled
localCIEnabled
? {}
: {
deleteStudentReposBuildPlans: 'artemisApp.programmingExercise.delete.studentReposBuildPlans',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ import {
} from '@fortawesome/free-solid-svg-icons';
import { CourseExerciseService } from 'app/exercises/shared/course-exercises/course-exercise.service';
import { downloadZipFileFromResponse } from 'app/shared/util/download.util';
import { PROFILE_LOCALVC } from 'app/app.constants';
import { PROFILE_LOCALCI, PROFILE_LOCALVC } from 'app/app.constants';

@Component({
selector: 'jhi-programming-exercise',
Expand All @@ -54,6 +54,7 @@ export class ProgrammingExerciseComponent extends ExerciseComponent implements O
templateParticipationType = ProgrammingExerciseParticipationType.TEMPLATE;
// Used to make the repository links download the repositories instead of linking to GitLab.
localVCEnabled = false;
localCIEnabled = false;

// extension points, see shared/extension-point
@ContentChild('overrideRepositoryAndBuildPlan') overrideRepositoryAndBuildPlan: TemplateRef<any>;
Expand Down Expand Up @@ -109,6 +110,7 @@ export class ProgrammingExerciseComponent extends ExerciseComponent implements O
this.profileService.getProfileInfo().subscribe((profileInfo) => {
this.buildPlanLinkTemplate = profileInfo.buildPlanURLTemplate;
this.localVCEnabled = profileInfo.activeProfiles.includes(PROFILE_LOCALVC);
this.localCIEnabled = profileInfo.activeProfiles.includes(PROFILE_LOCALCI);
});
// reconnect exercise with course
this.programmingExercises.forEach((exercise) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@
[dialogError]="dialogError$"
deleteConfirmationText="artemisApp.exercise.delete.typeNameToConfirm"
[additionalChecks]="
localVCEnabled
localCIEnabled
? {}
: {
deleteStudentReposBuildPlans: 'artemisApp.programmingExercise.delete.studentReposBuildPlans',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import { QuizExercise } from 'app/entities/quiz/quiz-exercise.model';
import { EventManager } from 'app/core/util/event-manager.service';
import { faBook, faExclamationTriangle, faEye, faFileExport, faFileSignature, faPencilAlt, faSignal, faTable, faTrash, faUsers, faWrench } from '@fortawesome/free-solid-svg-icons';
import { faListAlt } from '@fortawesome/free-regular-svg-icons';
import { PROFILE_LOCALVC } from 'app/app.constants';
import { PROFILE_LOCALCI, PROFILE_LOCALVC } from 'app/app.constants';
import { ProfileService } from 'app/shared/layouts/profiles/profile.service';

@Component({
Expand Down Expand Up @@ -47,6 +47,7 @@ export class ExamExerciseRowButtonsComponent implements OnInit {
farListAlt = faListAlt;

localVCEnabled = false;
localCIEnabled = false;

constructor(
private textExerciseService: TextExerciseService,
Expand All @@ -61,6 +62,7 @@ export class ExamExerciseRowButtonsComponent implements OnInit {
ngOnInit(): void {
this.profileService.getProfileInfo().subscribe((profileInfo) => {
this.localVCEnabled = profileInfo.activeProfiles.includes(PROFILE_LOCALVC);
this.localCIEnabled = profileInfo.activeProfiles.includes(PROFILE_LOCALCI);
});
}

Expand Down

0 comments on commit 5a4bdf3

Please sign in to comment.