Skip to content

Development: Keep evaluation working after a professor leaves and add a supervisor filter - #2446

Open
az108 wants to merge 7 commits into
mainfrom
feat/research-group-jobs-and-evaluation-cleanup
Open

Development: Keep evaluation working after a professor leaves and add a supervisor filter#2446
az108 wants to merge 7 commits into
mainfrom
feat/research-group-jobs-and-evaluation-cleanup

Conversation

@az108

@az108 az108 commented May 3, 2026

Copy link
Copy Markdown
Collaborator

Checklist

General

Server

Client

Motivation and Context

Three issues on the research-group view for professors / employees, bundled here. Closes #2445.

  1. Bug — Evaluation page crashed when an application's job had a professor that no longer had a research group (the user-retention job anonymises the supervising professor to a sentinel "deleted user" without a research group). `ProfessorDTO.fromEntity` threw `IllegalStateException`, and applications referencing that job stopped loading even though the job and applications are still part of the research group.
  2. Already correct — `/api/jobs/research-group` already returns every job whose research group matches the current member's, so each professor sees the whole group's pipeline. No code change.
  3. Filter — `my-positions` (job management) had only a status filter. Added a supervisor multi-select so a professor can filter to their own jobs (or to any other colleague's).

Description

1. Bug fix

  • New `ProfessorDTO.fromJob(Job)` factory uses `job.getResearchGroup()` as the source of truth — the research group is preserved on the Job even after the supervising professor is anonymised.
  • Made `ProfessorDTO.fromEntity(User)` graceful (returns null research-group fields instead of throwing) for any future caller without a Job in hand.
  • `ApplicationEvaluationDetailDTO.fromApplication` and `InterviewBookingService` switched to `fromJob`.

2. Supervisor filter

  • `ProfessorJobsFilterDTO` gained `List supervisorIds`.
  • `JobRepository.findAllJobsByResearchGroup` query and `JobService.getJobsForCurrentResearchGroup` thread the new param. Null/empty → no filter.
  • `my-positions-page` fetches the research group's professors via the existing `/api/research-groups/professors` endpoint on init and populates a `supervisor` filter alongside the existing `status` filter. Selected names are mapped back to user ids before the API call.
  • New i18n keys: `myPositionsPage.searchFilterSortBar.filterOptions.supervisor` (+ `supervisorSearchPlaceholder`) in EN + DE.
  • OpenAPI yaml updated, TS client regenerated and force-added.

Steps for Testing

Prerequisites:

  1. As an admin, add two professors (A and B) to the same research group.
  2. Both professors create at least one job each, and have at least one submitted application on each of their jobs.
  3. Sign in as professor A and remove professor B from the research group.
  4. Open the evaluation page for one of professor B's applications — it should load and render the application detail without errors (the bug case: the original supervising professor is gone, but the job + applications still belong to the research group).
  5. Open Recruitment > My Positions as professor A — the table should list every job in the research group, including the ones professor B created before being removed.
  6. Open the new Supervisor filter, pick yourself (professor A) — only A's jobs remain. Clear and pick professor B — only B's (now-orphaned) jobs remain.
  7. `./gradlew test --tests "JobResourceTest" --tests "ApplicationEvaluation" --tests "InterviewBooking"` — green.

Screenshots

Adding screenshots.

… add a supervisor filter

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@github-actions github-actions Bot added server Pull requests that update Java code. (Added Automatically!) client Pull requests that update TypeScript code. (Added Automatically!) user management Code changes in user management module. job Code changes in job module. evaluation Code changes in evaluation module. labels May 3, 2026
@codacy-production

codacy-production Bot commented May 3, 2026

Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

🟢 Metrics 4 complexity

Metric Results
Complexity 4

View in Codacy

NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.

@github-actions

github-actions Bot commented May 3, 2026

Copy link
Copy Markdown
Contributor

📊 Client Test Coverage Too Low

🔍 View coverage locally:

npm run test:ci
open build/test-results/vitest/coverage/index.html

🌐 View coverage from GitHub:
Download the "coverage-report-client" artifact from this workflow run.

…ettier

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@github-actions github-actions Bot added the tests label May 3, 2026
@github-actions

github-actions Bot commented May 3, 2026

Copy link
Copy Markdown
Contributor

🤖 No OpenAPI or client changes needed.

@github-actions

github-actions Bot commented May 3, 2026

Copy link
Copy Markdown
Contributor

🤖 No OpenAPI or client changes needed.

@github-actions

Copy link
Copy Markdown
Contributor

There hasn't been any activity on this pull request recently. Therefore, this pull request has been automatically marked as stale and will be closed if no further activity occurs within seven days. Thank you for your contributions.

@az108 az108 removed the stale label May 19, 2026
@github-actions

Copy link
Copy Markdown
Contributor

🤖 No OpenAPI or client changes needed.

@github-actions

Copy link
Copy Markdown
Contributor

There hasn't been any activity on this pull request recently. Therefore, this pull request has been automatically marked as stale and will be closed if no further activity occurs within seven days. Thank you for your contributions.

@github-actions

github-actions Bot commented Jun 4, 2026

Copy link
Copy Markdown
Contributor

There hasn't been any activity on this pull request recently. Therefore, this pull request has been automatically marked as stale and will be closed if no further activity occurs within seven days. Thank you for your contributions.

@github-actions

Copy link
Copy Markdown
Contributor

There hasn't been any activity on this pull request recently. Therefore, this pull request has been automatically marked as stale and will be closed if no further activity occurs within seven days. Thank you for your contributions.

@github-actions

github-actions Bot commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

There hasn't been any activity on this pull request recently. Therefore, this pull request has been automatically marked as stale and will be closed if no further activity occurs within seven days. Thank you for your contributions.

…obs-and-evaluation-cleanup

# Conflicts:
#	src/main/java/de/tum/cit/aet/usermanagement/dto/ProfessorDTO.java
#	src/main/webapp/app/job/my-positions/my-positions-page.component.ts
@codacy-production

codacy-production Bot commented Jul 5, 2026

Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

🟢 Metrics 5 complexity

Metric Results
Complexity 5

View in Codacy

NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.

@github-actions github-actions Bot removed the evaluation Code changes in evaluation module. label Jul 5, 2026
@github-actions

github-actions Bot commented Jul 5, 2026

Copy link
Copy Markdown
Contributor

🤖 No OpenAPI or client changes needed.

@github-actions

Copy link
Copy Markdown
Contributor

There hasn't been any activity on this pull request recently. Therefore, this pull request has been automatically marked as stale and will be closed if no further activity occurs within seven days. Thank you for your contributions.

@github-actions

Copy link
Copy Markdown
Contributor

🤖 No OpenAPI or client changes needed.

@github-actions

Copy link
Copy Markdown
Contributor

There hasn't been any activity on this pull request recently. Therefore, this pull request has been automatically marked as stale and will be closed if no further activity occurs within seven days. Thank you for your contributions.

@github-actions

Copy link
Copy Markdown
Contributor

🤖 No OpenAPI or client changes needed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

client Pull requests that update TypeScript code. (Added Automatically!) job Code changes in job module. ready for review server Pull requests that update Java code. (Added Automatically!) tests user management Code changes in user management module.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Research-group jobs view: keep evaluation working after professor leaves, add supervisor filter to job management

2 participants