Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
TAM
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
EIP
Labrador
TAM
Merge requests
!199
Improve offer position to specific person feature
Code
Review changes
Check out branch
Open in Workspace
Download
Patches
Plain diff
Expand sidebar
Merged
Improve offer position to specific person feature
55-clarify-offer-position-to-person
into
dev
Overview
12
Commits
5
Pipelines
28
Changes
17
Merged
Improve offer position to specific person feature
Timur Oberhuber
requested to merge
55-clarify-offer-position-to-person
into
dev
Aug 16, 2022
Overview
8
Commits
5
Pipelines
28
Changes
17
Description
Improves error messages
Allow teacher to offer a position via student number in addition to username
Allow teacher to search by name to offer a position
Related Issues
Resolves
#55 (closed)
Checklist
I have added a changelog entry to reflect the significant changes I made.
Edited
Aug 17, 2022
by
Timur Oberhuber
0
0
Merge request reports
Compare
dev
version 16
39b12108
Aug 23, 2022
version 15
42816d72
Aug 23, 2022
version 14
374809dd
Aug 22, 2022
version 13
6314ea22
Aug 22, 2022
version 12
63d35866
Aug 22, 2022
version 11
242a0a44
Aug 17, 2022
version 10
c7a96dc2
Aug 17, 2022
version 9
2dcfb237
Aug 17, 2022
version 8
2539f6be
Aug 17, 2022
version 7
2539f6be
Aug 17, 2022
version 6
2539f6be
Aug 17, 2022
version 5
2539f6be
Aug 16, 2022
version 4
104a048f
Aug 16, 2022
version 3
890bfdb3
Aug 16, 2022
version 2
272b6d82
Aug 16, 2022
version 1
cd707f58
Aug 16, 2022
dev (base)
and
latest version
latest version
39b12108
5 commits,
Sep 1, 2022
version 16
39b12108
23 commits,
Aug 23, 2022
version 15
42816d72
22 commits,
Aug 23, 2022
version 14
374809dd
19 commits,
Aug 22, 2022
version 13
6314ea22
18 commits,
Aug 22, 2022
version 12
63d35866
17 commits,
Aug 22, 2022
version 11
242a0a44
8 commits,
Aug 17, 2022
version 10
c7a96dc2
7 commits,
Aug 17, 2022
version 9
2dcfb237
6 commits,
Aug 17, 2022
version 8
2539f6be
5 commits,
Aug 17, 2022
version 7
2539f6be
11 commits,
Aug 17, 2022
version 6
2539f6be
13 commits,
Aug 17, 2022
version 5
2539f6be
15 commits,
Aug 16, 2022
version 4
104a048f
13 commits,
Aug 16, 2022
version 3
890bfdb3
10 commits,
Aug 16, 2022
version 2
272b6d82
7 commits,
Aug 16, 2022
version 1
cd707f58
6 commits,
Aug 16, 2022
17 files
+
315
−
151
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
17
src/main/java/nl/tudelft/tam/controller/ApplicationController.java
+
0
−
41
View file @ 39b12108
Edit in single-file editor
Open in Web IDE
Show full file
@@ -18,9 +18,7 @@
package
nl.tudelft.tam.controller
;
import
java.io.IOException
;
import
java.util.List
;
import
nl.tudelft.labracore.api.dto.PersonSummaryDTO
;
import
nl.tudelft.labracore.lib.security.user.AuthenticatedPerson
;
import
nl.tudelft.labracore.lib.security.user.Person
;
import
nl.tudelft.tam.service.ApplicationService
;
@@ -35,7 +33,6 @@ import org.springframework.security.access.prepost.PreAuthorize;
import
org.springframework.stereotype.Controller
;
import
org.springframework.ui.Model
;
import
org.springframework.web.bind.annotation.*
;
import
org.springframework.web.servlet.mvc.support.RedirectAttributes
;
@Controller
@RequestMapping
(
"application"
)
@@ -177,44 +174,6 @@ public class ApplicationController {
return
"redirect:/application/my"
+
(
q
!=
null
?
"?q="
+
q
:
""
);
}
/**
* Send a job offer to a specific person
*
* @param offerId The job for which to send the offer
* @param username The username of the person (if chosen option)
* @param studentNumber The student number of the person (if chosen option)
* @param studentName The name of the person (if chosen option)
* @param redirectAttrs The model attributes to keep when redirecting
* @return A redirect to the specific job offer page
*/
@PostMapping
(
"new-offer/{offerId}"
)
@PreAuthorize
(
"@authorisationService.isManagerOfAny()"
)
public
String
sendNewOffer
(
@PathVariable
Long
offerId
,
@RequestParam
(
required
=
false
)
String
username
,
@RequestParam
(
required
=
false
)
Long
studentNumber
,
@RequestParam
(
required
=
false
)
String
studentName
,
RedirectAttributes
redirectAttrs
)
{
boolean
error
=
false
;
if
(
username
!=
null
&&
!
username
.
isEmpty
())
{
error
=
!
applicationService
.
offerByUsername
(
username
,
offerId
);
}
else
if
(
studentNumber
!=
null
)
{
error
=
!
applicationService
.
offerByStudentNumber
(
studentNumber
,
offerId
);
}
else
if
(
studentName
!=
null
&&
!
studentName
.
isEmpty
())
{
try
{
List
<
PersonSummaryDTO
>
possibleStudents
=
personService
.
searchPeopleByDisplayNameContaining
(
studentName
);
redirectAttrs
.
addFlashAttribute
(
"specificOfferStudents"
,
possibleStudents
);
}
catch
(
Exception
e
)
{
error
=
true
;
}
}
else
{
error
=
true
;
}
redirectAttrs
.
addFlashAttribute
(
"specificOfferError"
,
error
);
return
"redirect:/job-offer/"
+
offerId
;
}
// endregion
/**
Loading