Skip to content

Story/vspc 196#344

Open
ajay3568yadav wants to merge 43 commits intodevelopfrom
story/vspc-196
Open

Story/vspc 196#344
ajay3568yadav wants to merge 43 commits intodevelopfrom
story/vspc-196

Conversation

@ajay3568yadav
Copy link
Copy Markdown
Contributor

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]).

  • I have removed all code style changes that are not necessary (e.g. changing blanks across the whole file that don’t need to be changed, adding empty lines in parts other than your own code)
  • I am not making any changes to files that don’t have any effect (e.g. imports added that don’t need to be added)
  • I do not have any sysout statements in my code or commented out code that isn’t needed anymore
  • I am not reformatting any files in the wrong format or without cause.
  • I am not changing file encoding or line endings to something else than UTF-8, LF
  • My pull request does not show an insane amount of files being changed although my ticket only requires a few files being changed
  • I have added Javadoc/documentation where appropriate
  • I have added test cases where appropriate
  • I have explained any part of my code/implementation decisions that is not be self-explanatory

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

@diging-jenkins
Copy link
Copy Markdown

Can one of the admins verify this patch?

@ajay3568yadav ajay3568yadav reopened this Jun 6, 2024
@jdamerow
Copy link
Copy Markdown
Member

please reopen existing pr so the comment history is kept

@jdamerow jdamerow closed this Jun 10, 2024
@ajay3568yadav ajay3568yadav reopened this Jul 24, 2024
@jdamerow
Copy link
Copy Markdown
Member

jdamerow commented Nov 8, 2024

Resolve conflicts please

Copy link
Copy Markdown
Member

@jdamerow jdamerow left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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>
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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>
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should not be changed

vspace/pom.xml Outdated
<groupId>javax.xml.bind</groupId>
<artifactId>jaxb-api</artifactId>
<version>2.3.1</version>
</dependency>
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

formatting

vspace/pom.xml Outdated
<artifactId>thymeleaf-extras-springsecurity5</artifactId>
<version>3.0.3.RELEASE</version>
</dependency>
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

formatting

vspace/pom.xml Outdated
</build>
</project>

</project> No newline at end of file
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

there are a bunch of versions being downgraded here which they shouldn't

protected abstract T getTarget(String linkedId);

protected abstract U createDisplayLink(L link);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm so confused, why is this here? I this needed for this ticket?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah I see, this should not be moved

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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,
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indentation is wrong I believe

@jdamerow jdamerow closed this Nov 8, 2024
@jdamerow
Copy link
Copy Markdown
Member

jdamerow commented Jan 6, 2025

There are still issues:

[ERROR] COMPILATION ERROR : 
[INFO] -------------------------------------------------------------
[ERROR] /var/lib/jenkins/workspace/VSpace_deploy_to_review_on_pr/vspace/src/main/java/edu/asu/diging/vspace/core/services/impl/SpaceManager.java:[318,24] error: method findByName(String) is already defined in class SpaceManager

@jdamerow jdamerow closed this Jan 6, 2025
@ajay3568yadav
Copy link
Copy Markdown
Contributor Author

fixed this error

{ "code": "ve", "label": "Venda" },
{ "code": "vi", "label": "Vietlabelse" },
{ "code": "vo", "label": "Volap�k" },
{ "code": "vo", "label": "Volap\uFFFDk" },
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

that seems wrong (as does the change above)

@jdamerow
Copy link
Copy Markdown
Member

jdamerow commented Feb 7, 2025

Make it so, Jenkins.

@jdamerow
Copy link
Copy Markdown
Member

jdamerow commented Feb 7, 2025

There are test failures

@jdamerow jdamerow closed this Feb 7, 2025
@ajay3568yadav ajay3568yadav reopened this Jul 11, 2025
throws SpaceDoesNotExistException, ImageCouldNotBeStoredException, ImageDoesNotExistException {

if (title == null || title.trim().isEmpty()) {
throw new IllegalArgumentException("Title cannot be null or empty.");
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.");
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.");
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

see above

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.");
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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;
// }
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why is this commented out?

if (typeof(file) != "undefined"){
chooseFromExisting = false;
formData.append('file', file);
} */
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

?

$("#module-selectedImage").empty();
$("#module-imageId").val(null).trigger('change');
$('#errorAlert').hide();
console.log("Success");
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

delete

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");
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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);
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

duplicate of line 152

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);
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

only if the id of the image is passed in, spcImage should be returned.

@jdamerow
Copy link
Copy Markdown
Member

jdamerow commented Aug 6, 2025

Make it so, Jenkins.

@jdamerow
Copy link
Copy Markdown
Member

jdamerow commented Aug 6, 2025

Tests are failing.

@jdamerow jdamerow closed this Aug 6, 2025
@Girik1105 Girik1105 reopened this Feb 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants