Skip to content
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

Programming exercises: Move the open repository buttons to the new code popup #8920

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
49 commits
Select commit Hold shift + click to select a range
b6bc88a
Add router link input to clone repo button
pzdr7 Jun 27, 2024
6696f30
Move router link; programming exam summary component
pzdr7 Jun 27, 2024
fe6ce6f
Move router link; exercise details actions component
pzdr7 Jun 27, 2024
36e17ca
Move router link; participation component
pzdr7 Jun 27, 2024
1bfb9e2
Move router link; detail overview list component
pzdr7 Jun 27, 2024
7df897a
Add router link; repository view
pzdr7 Jun 27, 2024
a7de026
Add router link; exercise scores component
pzdr7 Jun 27, 2024
7c7960c
Allow array router links
pzdr7 Jun 27, 2024
73350c3
Rename translation
pzdr7 Jun 27, 2024
0c2a0db
Remove booleans
pzdr7 Jun 27, 2024
29e12f1
Fix conditions for clone button; remove showOpenButton
pzdr7 Jun 27, 2024
787bca2
Add router link; exercise assessment dashboard
pzdr7 Jun 27, 2024
91612d3
change routing
rabeatwork Jun 28, 2024
e7b27b1
add lazy loading
rabeatwork Jun 28, 2024
db81849
Merge remote-tracking branch 'origin/bugfix/open-repository-button-na…
pzdr7 Jun 29, 2024
3f439f1
Merge branch 'develop' into chore/programming-exercises/remove-open-r…
pzdr7 Jun 30, 2024
7055f35
Merge branch 'develop' into chore/programming-exercises/remove-open-r…
pzdr7 Jul 2, 2024
1970e1b
Tryfix tests
pzdr7 Jul 2, 2024
a111660
Change translations
pzdr7 Jul 2, 2024
8ac7c2a
Remove unused method
pzdr7 Jul 2, 2024
cc4d0d7
Rename class, tryfix playwright
pzdr7 Jul 2, 2024
efe812c
Tryfix playwright; run on separate page
pzdr7 Jul 2, 2024
15091d2
Disable sort in repo uri column
pzdr7 Jul 2, 2024
bbc61c4
Experimental: show code button for jenkins/external as well
pzdr7 Jul 2, 2024
e598632
Revert "Experimental: show code button for jenkins/external as well" …
pzdr7 Jul 2, 2024
bf423a0
Merge branch 'develop' into chore/programming-exercises/remove-open-r…
pzdr7 Jul 2, 2024
56e6cc1
Merge branch 'develop' into chore/programming-exercises/remove-open-r…
pzdr7 Jul 4, 2024
5c83719
Tryfix TS6 bug
pzdr7 Jul 4, 2024
0442762
Refactor: rename clone to code
pzdr7 Jul 4, 2024
8b8a1e4
Update selector: jhi-code-button
pzdr7 Jul 4, 2024
4f53b3f
Update test file name
pzdr7 Jul 4, 2024
bd2a595
Rename button in tests
pzdr7 Jul 4, 2024
2f9b65c
Update directory name
pzdr7 Jul 4, 2024
61f4650
Fix condition
pzdr7 Jul 4, 2024
06bf532
Fix styling; simplify conditions
pzdr7 Jul 4, 2024
ed5eda2
Merge branch 'develop' into chore/programming-exercises/remove-open-r…
pzdr7 Jul 5, 2024
b124fea
Merge branch 'develop' into chore/programming-exercises/remove-open-r…
pzdr7 Jul 6, 2024
e68849c
Merge branch 'develop' into chore/programming-exercises/remove-open-r…
pzdr7 Jul 10, 2024
4109398
Change icon from faDownload to faCode
pzdr7 Jul 11, 2024
ce8fb67
Remove restriction; always show open repo button
pzdr7 Jul 11, 2024
5ecac73
Merge branch 'develop' into chore/programming-exercises/remove-open-r…
pzdr7 Jul 11, 2024
16c32ea
Merge branch 'develop' into chore/programming-exercises/remove-open-r…
pzdr7 Jul 12, 2024
32a5e5b
Docs: update section on localvc
pzdr7 Jul 12, 2024
66dd258
Docs: update section on student exams
pzdr7 Jul 12, 2024
a1a9d45
Docs: Delete clone repo button
pzdr7 Jul 12, 2024
22c9c41
Merge branch 'develop' into chore/programming-exercises/remove-open-r…
pzdr7 Jul 12, 2024
e11fdec
Update docs/user/exercises/programming-integrated-code-lifecycle-repo…
pzdr7 Jul 12, 2024
53b970e
Merge branch 'develop' into chore/programming-exercises/remove-open-r…
krusche Jul 14, 2024
631a89e
Merge branch 'develop' into chore/programming-exercises/remove-open-r…
krusche Jul 14, 2024
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
Binary file removed docs/user/exams/student/buttons/clone_repo.png
Binary file not shown.
Binary file added docs/user/exams/student/buttons/code.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/user/exams/student/exam_clone_repository.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/user/exams/student/exam_programming_exercises.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/user/exams/student/exam_submission_policy_lock.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/user/exams/student/exam_submission_policy_penalty.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 4 additions & 4 deletions docs/user/exams/students_guide.rst
Original file line number Diff line number Diff line change
Expand Up @@ -118,9 +118,9 @@ Exam Conduction
- When there are unsaved **or** unsubmitted changes, the exercise representation in the navigation sidebar becomes |exam_unsaved|.
- When your changes are saved **and** submitted, the exercise representation in the navigation sidebar becomes |exam_saved|.
- |exam_started| indicates that you have not started this exercise.
- |saved_exercises| indicates the number of saved **and** submitted exercises out of the total number of exercises. Here, there are 5 exercises in total, and 2 out of the 5 have been saved and submitted.
- |saved_exercises| indicates the number of saved **and** submitted exercises out of the total number of exercises. Here, there are 5 exercises in total, and 2 out of the 5 have been saved and submitted.

- Once you click on another exercise in the navigation sidebar, your changes will be saved and submitted automatically.
- Once you click on another exercise in the navigation sidebar, your changes will be saved and submitted automatically.
- You can also collapse the navigation sidebar to maximize the size of the exercises by clicking on |collapse_sidebar|. When the sidebar is collapsed, you can still see the exercise type and current status of the exercise.

.. warning::
Expand Down Expand Up @@ -251,7 +251,7 @@ Participating in Programming Exercises

Participating in Programming Exercises with the online code editor and local IDE enabled

- If your exercise allows the use of the local IDE you will have access to the button |clone_repo|.
- If your exercise allows the use of the local IDE, you can clone your repository using the |code| button.
- When you click it you can choose to clone the exercise via ``HTTPS`` or ``SSH``, if you have configured your private key.

.. note::
Expand Down Expand Up @@ -452,7 +452,7 @@ Grades
.. |left_arrow| image:: student/buttons/left_arrow.png
.. |outline_box| image:: student/buttons/outline_box.png
.. |build_passed| image:: student/buttons/hidden.png
.. |clone_repo| image:: student/buttons/clone_repo.png
.. |code| image:: student/buttons/code.png
.. |help| image:: student/buttons/help.png
.. |continue| image:: student/buttons/continue.png
.. |complain| image:: student/buttons/complain.png
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,20 @@ For Students
""""""""""""

As a student, you can use the repository to view your course submissions.
To access your submissions, you need to navigate to the exercise and press the '*Open Repository*' button.
To access your submissions, you need to navigate to the exercise, press the '*Code*' button, and click on |open-repository-button|.

.. figure:: programming/open-repository-button.png
:alt: Open Repository Button
.. figure:: programming/open-repository-student.png
:alt: Opening the repository in the student view
:align: center

Open Repository Button
Opening the repository (student view)

After pressing the button, you will be redirected to the **Current Repository Content** page of the repository.
This view shows the current content of the repository with the latest changes in a read-only code editor. You can view the code, but you cannot edit it.
You can also navigate through the whole code by clicking on the file names in the file browser on the left side.
To the right side of the screen, above the problem statement, you can see the result of the submission. Lastly, you can copy the repository URI by pressing
the '*Clone Repository*' button to clone the repository to your local machine and see the full commit history by pressing the '*Open Commit History*' button.
To the right side of the screen, above the problem statement, you can see the result of the submission. You can also copy the repository URI by pressing
the '*Code*' button to clone the repository to your local machine and see the full commit history by pressing the '*Open Commit History*' button. Finally, you can
download the repository as a ZIP file by pressing the '*Download Repository*' button.

.. figure:: programming/current-repository-content-view.png
:alt: Current Repository Content
Expand Down Expand Up @@ -53,20 +54,23 @@ For Instructors
"""""""""""""""

As an instructor, you can use the repository to view the submissions of your students. For this purpose, you need to navigate to the exercise participations page.
Here you can see all the students’ participations for the exercise and navigate to the repository of a student by pressing the '*Open Repository*' button.
Here you can see all the students’ participations for the exercise and navigate to the repository of a student by pressing the '*Code*' button and clicking on |open-repository-button|.
This will show the repository of the student just like it is shown to the student.

.. figure:: programming/participations-open-repository.png
.. figure:: programming/open-repository-instructor-participations.png
:alt: Open Repository Button in Participations Page
:align: center

Open Repository Button in Participations Page

Furthermore, you can also see the repositories for an exercises **solution**, **template** and **test** repositories.
You can navigate to these repositories by pressing the '*Open Repository*' button in the exercise management page.
You can also see the repositories for an exercises **solution**, **template** and **test** repositories on the exercise management page.
You can navigate to these repositories by pressing the '*Code*' button and clicking |open-repository-button| as described above.

.. figure:: programming/course-management-repositories.png
:alt: Solution, Template and Test Repositories in Exercise Management Page
:align: center

Solution, Template and Test Repositories in Exercise Management Page

.. |open-repository-button| image:: programming/open-repository-button.png
:scale: 50%
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/user/exercises/programming/open-repository-button.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -55,20 +55,12 @@ <h3 class="section-headline" [id]="headlinesRecord[section.headline]">{{ section
<dd id="detail-value-{{ detail.title }}">
@if (detail.data.participation?.repositoryUri && detail.data.exerciseId) {
<div class="clone-buttons">
<jhi-clone-repo-button [smallButtons]="true" [repositoryUri]="detail.data.participation?.repositoryUri!" />
<jhi-code-button
[smallButtons]="true"
[routerLinkForRepositoryView]="['.', 'repository', detail.data.type]"
[repositoryUri]="detail.data.participation?.repositoryUri!"
/>
<jhi-programming-exercise-instructor-repo-download class="ms-2" [exerciseId]="detail.data.exerciseId" [repositoryType]="detail.data.type" />
@if (detail.data.showOpenLink) {
<a [href]="detail.data.participation?.repositoryUri!" target="_blank" class="btn btn-sm btn-info ms-2">
<fa-icon [icon]="faArrowUpRightFromSquare" />
<span jhiTranslate="artemisApp.programmingExercise.openRepository"></span>
</a>
}
@if (isLocalVC) {
<a [routerLink]="['./', 'repository', detail.data.type]" class="btn btn-sm btn-primary ms-2">
<fa-icon [icon]="faCodeBranch" />
<span jhiTranslate="artemisApp.exerciseActions.openRepository"></span>
</a>
}
</div>
} @else {
<ng-container *ngTemplateOutlet="noData" />
Expand All @@ -82,19 +74,13 @@ <h3 class="section-headline" [id]="headlinesRecord[section.headline]">{{ section
@if (auxiliaryRepository.id && auxiliaryRepository.repositoryUri && detail.data.exerciseId) {
<li class="mt-2">
<span>Repository: {{ auxiliaryRepository.name }}</span>
<jhi-clone-repo-button class="ms-2" [smallButtons]="true" [repositoryUri]="auxiliaryRepository.repositoryUri" />
<jhi-code-button class="ms-2" [smallButtons]="true" [repositoryUri]="auxiliaryRepository.repositoryUri" />
<jhi-programming-exercise-instructor-repo-download
class="ms-2"
[exerciseId]="detail.data.exerciseId"
[repositoryType]="'AUXILIARY'"
[auxiliaryRepositoryId]="auxiliaryRepository.id"
/>
@if (detail.data.showOpenLink) {
<a [href]="auxiliaryRepository.repositoryUri" target="_blank" class="btn btn-sm btn-info ms-2">
<fa-icon [icon]="faArrowUpRightFromSquare" />
<span jhiTranslate="artemisApp.programmingExercise.openRepository"></span>
</a>
}
<div class="auxiliaryRepositoryDescription">
@if (!auxiliaryRepository.checkoutDirectory) {
<fa-icon [icon]="faExclamationTriangle" class="text-warning me-1" [ngbTooltip]="noCheckoutDirectorySetTooltip" />
Expand Down
3 changes: 1 addition & 2 deletions src/main/webapp/app/detail-overview-list/detail.model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -88,14 +88,13 @@ interface ProgrammingRepositoryButtonsDetail extends DetailBase {
data: {
exerciseId?: number;
participation?: TemplateProgrammingExerciseParticipation | SolutionProgrammingExerciseParticipation;
showOpenLink?: boolean;
type: ProgrammingExerciseInstructorRepositoryType;
};
}

interface ProgrammingAuxiliaryRepositoryButtonsDetail extends DetailBase {
type: DetailType.ProgrammingAuxiliaryRepositoryButtons;
data: { auxiliaryRepositories: AuxiliaryRepository[]; exerciseId?: number; showOpenLink?: boolean };
data: { auxiliaryRepositories: AuxiliaryRepository[]; exerciseId?: number };
}

interface ProgrammingTestStatusDetail extends DetailBase {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,11 @@
<div class="col-md-4">
<div class="mb-4">
<h5>{{ 'artemisApp.exam.examSummary.yourSubmission' | artemisTranslate }}</h5>
<jhi-clone-repo-button [smallButtons]="true" [repositoryUri]="participation?.userIndependentRepositoryUri || ''" />
@if (localVCEnabled) {
<a
class="btn btn-primary"
[class.btn-sm]="true"
[routerLink]="routerLink + '/exercises/' + exercise.id + '/repository/' + participation.id"
target="_blank"
rel="noopener noreferrer"
>
<fa-icon [icon]="faCodeBranch" [fixedWidth]="true" />
<span class="d-none d-md-inline" jhiTranslate="artemisApp.exerciseActions.openRepository"></span>
</a>
}
<jhi-code-button
[smallButtons]="true"
[repositoryUri]="participation?.userIndependentRepositoryUri || ''"
[routerLinkForRepositoryView]="routerLink + '/exercises/' + exercise.id + '/repository/' + participation.id"
/>
<br />
<span>
{{ 'artemisApp.exam.examSummary.submissionLinkedToCommit' | artemisTranslate }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -362,7 +362,6 @@ export class ProgrammingExerciseDetailComponent implements OnInit, OnDestroy {
participation: exercise.templateParticipation,
exerciseId: exercise.id,
type: 'TEMPLATE',
showOpenLink: !this.localVCEnabled,
},
},
{
Expand All @@ -372,7 +371,6 @@ export class ProgrammingExerciseDetailComponent implements OnInit, OnDestroy {
participation: exercise.solutionParticipation,
exerciseId: exercise.id,
type: 'SOLUTION',
showOpenLink: !this.localVCEnabled,
},
},
{
Expand All @@ -382,7 +380,6 @@ export class ProgrammingExerciseDetailComponent implements OnInit, OnDestroy {
participation: { repositoryUri: exercise.testRepositoryUri },
exerciseId: exercise.id,
type: 'TESTS',
showOpenLink: !this.localVCEnabled,
},
},
this.supportsAuxiliaryRepositories &&
Expand All @@ -392,7 +389,6 @@ export class ProgrammingExerciseDetailComponent implements OnInit, OnDestroy {
data: {
auxiliaryRepositories: exercise.auxiliaryRepositories,
exerciseId: exercise.id,
showOpenLink: !this.localVCEnabled,
},
},
exercise.isAtLeastEditor &&
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,11 @@ <h4>{{ 'artemisApp.exerciseAssessmentDashboard.exampleSolution' | artemisTransla
<jhi-button jhiTranslate="artemisApp.exerciseAssessmentDashboard.programmingExercise.exampleSolution" />
</a>
} @else {
<jhi-clone-repo-button [smallButtons]="true" [repositoryUri]="programmingExercise.solutionParticipation?.repositoryUri || ''" />
<jhi-code-button
[smallButtons]="true"
[routerLinkForRepositoryView]="['/course-management', courseId, 'programming-exercises', exerciseId, 'repository', 'SOLUTION']"
[repositoryUri]="programmingExercise.solutionParticipation?.repositoryUri || ''"
/>
}
</div>
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,12 @@ <h5 jhiTranslate="artemisApp.exercise.export.options"></h5>
Repository
</a>
} @else {
<jhi-clone-repo-button class="me-1" [smallButtons]="true" [repositoryUri]="getRepositoryLink(value) || ''" />
<jhi-code-button
class="me-1"
[routerLinkForRepositoryView]="['/courses', course.id, 'exercises', exercise.id, 'repository', value.id]"
[smallButtons]="true"
[repositoryUri]="getRepositoryLink(value) || ''"
/>
}
}
@if (buildPlanId(value) && !localVCEnabled) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,11 +115,10 @@ <h2>
</ng-template>
</ngx-datatable-column>
@if (exercise?.type === ExerciseType.PROGRAMMING) {
<ngx-datatable-column prop="repositoryUri" [minWidth]="120" [width]="120">
<ngx-datatable-column prop="repositoryUri" [minWidth]="80" [width]="80">
<ng-template ngx-datatable-header-template>
<span class="datatable-header-cell-wrapper" (click)="controls.onSort('repositoryUri')">
<span class="datatable-header-cell-label bold sortable" jhiTranslate="artemisApp.participation.repositoryUri"></span>
<fa-icon [icon]="controls.iconForSortPropField('repositoryUri')" />
<span class="datatable-header-cell-wrapper">
<span class="datatable-header-cell-label bold" jhiTranslate="artemisApp.participation.repository"></span>
</span>
</ng-template>
<ng-template ngx-datatable-cell-template let-value="value" let-row="row">
Expand All @@ -128,28 +127,18 @@ <h2>
@if (!localVCEnabled) {
<a href="{{ getRepositoryLink(row, value) }}" target="_blank" rel="noreferrer noopener">Repository Link</a>
} @else {
<jhi-clone-repo-button class="ms-2" [smallButtons]="true" [repositoryUri]="getRepositoryLink(row, value)" />
<jhi-code-button
class="ms-2"
[smallButtons]="true"
[routerLinkForRepositoryView]="'./' + row.id + '/repository'"
[repositoryUri]="getRepositoryLink(row, value)"
/>
}
</span>
}
</ng-template>
</ngx-datatable-column>
}
@if (exercise?.type === ExerciseType.PROGRAMMING && localVCEnabled) {
<ngx-datatable-column [minWidth]="120" [width]="150">
<ng-template ngx-datatable-header-template>
<span class="datatable-header-cell-wrapper">
<span class="datatable-header-cell-label bold sortable" jhiTranslate="artemisApp.repository.title"></span>
</span>
</ng-template>
<ng-template ngx-datatable-cell-template let-row="row">
<a [routerLink]="['./', row.id, 'repository']" class="btn btn-sm btn-primary ms-2">
<fa-icon [icon]="faCodeBranch" />
<span jhiTranslate="artemisApp.exerciseActions.openRepository"></span>
</a>
</ng-template>
</ngx-datatable-column>
}
@if (exercise?.type === ExerciseType.PROGRAMMING) {
<ngx-datatable-column [minWidth]="100" [width]="100">
<ng-template ngx-datatable-header-template>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@ export class ParticipationComponent implements OnInit, OnDestroy {
gradeStepsDTO?: GradeStepsDTO;
gradeStepsDTOSub: Subscription;

// Used to show the "Clone Repository URI" button instead of a link to GitLab when the "localvc" profile is active.
localVCEnabled = false;

private dialogErrorSource = new Subject<string>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ export const courseExerciseOverviewTour: GuidedTour = {
triggerNextStep: true,
}),
new TextTourStep({
highlightSelector: '.course-exercise-row.guided-tour .clone-repository',
highlightSelector: '.course-exercise-row.guided-tour .code-button',
headlineTranslateKey: 'tour.courseExerciseOverview.repositoryCreated.headline',
contentTranslateKey: 'tour.courseExerciseOverview.repositoryCreated.content',
highlightPadding: 5,
Expand Down
Loading
Loading