Conversation
|
Can one of the admins verify this patch? |
|
please reopen existing pr so the comment history is kept |
|
Resolve conflicts please |
jdamerow
left a comment
There was a problem hiding this comment.
I'll stop here. There seem to be a bunch of wrong formatting and indentation changes, and in general unnecessary changes. Please fix first before I review.
vspace/pom.xml
Outdated
| <javers.version>5.15.0</javers.version> | ||
| <spring-security-version>5.3.3.RELEASE</spring-security-version> | ||
| <thymeleaf.version>3.0.11.RELEASE</thymeleaf.version> | ||
| <javers.version>5.11.1</javers.version> |
There was a problem hiding this comment.
is there are reason these are being downgraded?
vspace/pom.xml
Outdated
| <db.url>jdbc:mysql://localhost:3306/vspace?serverTimezone=UTC</db.url> | ||
| <db.user>root</db.user> | ||
| <db.password>Metroplaza@2023</db.password> | ||
| <uploaded.files.path>/Users/ajayyadav/Downloads/Vpsace_images</uploaded.files.path> |
vspace/pom.xml
Outdated
| <groupId>javax.xml.bind</groupId> | ||
| <artifactId>jaxb-api</artifactId> | ||
| <version>2.3.1</version> | ||
| </dependency> |
vspace/pom.xml
Outdated
| <artifactId>thymeleaf-extras-springsecurity5</artifactId> | ||
| <version>3.0.3.RELEASE</version> | ||
| </dependency> | ||
vspace/pom.xml
Outdated
| </build> | ||
| </project> | ||
|
|
||
| </project> No newline at end of file |
There was a problem hiding this comment.
there are a bunch of versions being downgraded here which they shouldn't
vspace/src/main/java/edu/asu/diging/vspace/core/services/impl/ExternalLinkManager.java
Show resolved
Hide resolved
| protected abstract T getTarget(String linkedId); | ||
|
|
||
| protected abstract U createDisplayLink(L link); | ||
|
|
There was a problem hiding this comment.
I'm so confused, why is this here? I this needed for this ticket?
There was a problem hiding this comment.
ah I see, this should not be moved
There was a problem hiding this comment.
This came from merging changes from the main branch
| @RequestParam("moduleLinkLabel") String moduleLinkLabel, @RequestParam("moduleType") String displayType, | ||
| @RequestParam("moduleLinkImage") MultipartFile file) | ||
| throws NumberFormatException, SpaceDoesNotExistException, IOException, ImageCouldNotBeStoredException { | ||
| public ResponseEntity<String> createModuleLink(@PathVariable("id") String id, @RequestParam("x") String x, |
|
There are still issues: |
|
fixed this error |
| { "code": "ve", "label": "Venda" }, | ||
| { "code": "vi", "label": "Vietlabelse" }, | ||
| { "code": "vo", "label": "Volap�k" }, | ||
| { "code": "vo", "label": "Volap\uFFFDk" }, |
There was a problem hiding this comment.
that seems wrong (as does the change above)
|
Make it so, Jenkins. |
|
There are test failures |
| throws SpaceDoesNotExistException, ImageCouldNotBeStoredException, ImageDoesNotExistException { | ||
|
|
||
| if (title == null || title.trim().isEmpty()) { | ||
| throw new IllegalArgumentException("Title cannot be null or empty."); |
There was a problem hiding this comment.
this is not the right exception to throw; it's a runtime exception so it does not need to be caught and handled, because it would be thrown if it's an argument that simply can't be dealt with. Here, it can definitely be dealt with if the title is null (simply ask the user to enter a title). Also, I don't see why the title couldn't be empty. If the user, for instance, adds an image, there does not need to be title to make this work.
| throw new IllegalArgumentException("Title cannot be null or empty."); | ||
| } | ||
| if (id == null || id.trim().isEmpty()) { | ||
| throw new IllegalArgumentException("ID cannot be null or empty."); |
There was a problem hiding this comment.
see above, wrong exception to be thrown.
| throw new SpaceDoesNotExistException("Linked ID cannot be null or empty."); | ||
| } | ||
| if (displayType == null) { | ||
| throw new IllegalArgumentException("DisplayType cannot be null."); |
| throw new IllegalArgumentException("DisplayType cannot be null."); | ||
| } | ||
| if ((linkImage == null || linkImage.length == 0) && (existingImageId == null || existingImageId.trim().isEmpty())) { | ||
| throw new ImageDoesNotExistException("Either linkImage or existingImageId must be provided."); |
There was a problem hiding this comment.
wrong exception to throw. Image does not exist is different than no image provided.
| // List<ISpace> spaceResults = new ArrayList<>(); | ||
| // spaces.forEach(r -> spaceResults.add(r)); | ||
| // return spaceResults; | ||
| // } |
| if (typeof(file) != "undefined"){ | ||
| chooseFromExisting = false; | ||
| formData.append('file', file); | ||
| } */ |
| $("#module-selectedImage").empty(); | ||
| $("#module-imageId").val(null).trigger('change'); | ||
| $('#errorAlert').hide(); | ||
| console.log("Success"); |
| Mockito.when(externalLinkDisplayRepo.save((ExternalLinkDisplay)externalDisplayLink)).thenReturn((ExternalLinkDisplay)externalDisplayLink); | ||
|
|
||
| IExternalLinkDisplay savedExternalLinkDisplay1 = managerToTest.createLink("New External Link", spaceId1, 10, 30, 40, "EXL001", "New External Link", DisplayType.ARROW, null, null,null); | ||
| IExternalLinkDisplay savedExternalLinkDisplay1 = managerToTest.createLink("New External Link","EXL001", 10.0f, 30.0f, 40, "EXL001", "New External Link", "Description", DisplayType.ARROW, null, null, null, "IMG000000001"); |
There was a problem hiding this comment.
Is the second parameter not the space id? You are replacing the space id with the external link id here.
|
|
||
| Mockito.when(spaceManager.getSpace(spaceId1)).thenReturn(space); | ||
| Mockito.when(spaceLinkRepo.save((SpaceLink)spaceLink)).thenReturn((SpaceLink) spaceLink); | ||
| Mockito.when(spaceManager.getSpace(spaceId1)).thenReturn(space); |
| Mockito.when(spaceDisplayManager.getBySpace(space)).thenReturn(displayAttributes); | ||
| Mockito.when(spaceLinkRepo.save((SpaceLink) spaceLink)).thenReturn((SpaceLink)spaceLink); | ||
| Mockito.when(spaceLinkDisplayRepo.save((SpaceLinkDisplay)spaceLinkDisplay)).thenReturn((SpaceLinkDisplay)spaceLinkDisplayUpdated); | ||
| Mockito.when(imageService.getImageById(Mockito.anyString())).thenReturn(spcImage); |
There was a problem hiding this comment.
only if the id of the image is passed in, spcImage should be returned.
|
Make it so, Jenkins. |
|
Tests are failing. |
Guidelines for Pull Requests
If you haven't yet read our code review guidelines, please do so, You can find them here.
Please confirm the following by adding an x for each item (turn
[ ]into[x]).Please provide a brief description of your ticket
(you can copy the ticket if it hasn't changed)
It should be possible to reuse link images
Anything else the reviewer needs to know?
https://diging.atlassian.net/browse/VSPC-196?focusedCommentId=24055