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

story/VSPC-242 #345

Open
wants to merge 68 commits into
base: develop
Choose a base branch
from
Open

story/VSPC-242 #345

wants to merge 68 commits into from

Conversation

jophals
Copy link

@jophals jophals commented Jun 7, 2024

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)

Users should be able to include external links on their slides, which will be visible on the public page.

Anything else the reviewer needs to know?

This is my first Java PR!

@jdamerow
Copy link
Member

There are code factor issues.

@jdamerow jdamerow closed this Jun 10, 2024
@jophals jophals reopened this Jun 10, 2024
Copy link
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 lot of unnecessary code changes and classes that are not needed.


@Repository
@JaversSpringDataAuditable
public interface SlideExternalLinkDisplayRepository extends PagingAndSortingRepository<SlideExternalLinkDisplay, String> {
Copy link
Member

Choose a reason for hiding this comment

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

this is not needed is it? there should be no displays for slide external links

@JaversSpringDataAuditable
public interface SlideExternalLinkRepository extends PagingAndSortingRepository<ExternalLinkSlide, String> {

@Query("SELECT d FROM ExternalLinkSlide d WHERE d.slide.id = ?1")
Copy link
Member

Choose a reason for hiding this comment

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

this is a simple query and it should be possible to use the method naming convention to create the query (something like getBySlide or something like that)

import edu.asu.diging.vspace.core.model.display.impl.SlideDisplay;
import edu.asu.diging.vspace.core.model.display.impl.SpaceDisplay;

public interface SlideDisplayRepository extends PagingAndSortingRepository<SlideDisplay, String>{
Copy link
Member

Choose a reason for hiding this comment

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

there should be no slide display class

@@ -1,6 +1,7 @@
package edu.asu.diging.vspace.core.factory;

import edu.asu.diging.vspace.core.model.IExternalLink;
import edu.asu.diging.vspace.core.model.IExternalLinkSlide;
Copy link
Member

Choose a reason for hiding this comment

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

unnecessary?

Copy link
Member

Choose a reason for hiding this comment

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

unnecessary?

Copy link
Member

Choose a reason for hiding this comment

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

not needed?

Copy link
Member

Choose a reason for hiding this comment

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

not needed?

@@ -4,6 +4,7 @@

import edu.asu.diging.vspace.core.factory.IExternalLinkDisplayFactory;
import edu.asu.diging.vspace.core.model.IExternalLink;
import edu.asu.diging.vspace.core.model.IExternalLinkSlide;
Copy link
Member

Choose a reason for hiding this comment

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

unnecessary?

@@ -4,6 +4,7 @@

import edu.asu.diging.vspace.core.factory.IExternalLinkFactory;
import edu.asu.diging.vspace.core.model.IExternalLink;
import edu.asu.diging.vspace.core.model.ISlide;
Copy link
Member

Choose a reason for hiding this comment

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

unnecessary?

Copy link
Member

Choose a reason for hiding this comment

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

not needed?

@jdamerow jdamerow closed this Jun 11, 2024
@jophals jophals reopened this Jun 12, 2024
@jophals
Copy link
Author

jophals commented Jun 13, 2024

I reopened the PR and thought that the query was working. It's actually breaking the code in the current state that I've pushed. Can you help me with the JPA named queries? The error seems to be "No property findbySlide found for type ExternalLinkSlide"

@jophals
Copy link
Author

jophals commented Jun 13, 2024

Nevermind! I forgot to capitalize the "B", whoops

Copy link
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.

  • there are a bunch of files showing up as changed that actually have not been changed (just unnecessary new line changes, imports, etc)
  • there are still link display classes that are not needed and some unnecessary inheritance

@@ -0,0 +1,12 @@
package edu.asu.diging.vspace.core.model;

public interface ILinkSlide<T extends IVSpaceElement> extends IVSpaceElement {
Copy link
Member

Choose a reason for hiding this comment

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

I don't think we'll introduce anymore links at this point, so this seems overly complicated. Just and external link class for slides is enough


IVSImage getImage();

void setImage(IVSImage image);
Copy link
Member

Choose a reason for hiding this comment

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

what are these images for?

Copy link
Author

Choose a reason for hiding this comment

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

i believe that these are for the ImageBlocks

Copy link
Member

Choose a reason for hiding this comment

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

but why would that be needed here?


import edu.asu.diging.vspace.core.model.IExternalLinkSlide;

public interface ISlideExternalLinkDisplay extends ILinkDisplay {
Copy link
Member

Choose a reason for hiding this comment

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

not needed

import edu.asu.diging.vspace.core.model.impl.ExternalLinkSlide;

@Entity
public class SlideExternalLinkDisplay extends LinkDisplay implements ISlideExternalLinkDisplay {
Copy link
Member

Choose a reason for hiding this comment

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

not needed

}

@Override
public ExternalLinkValue getTarget() {
Copy link
Member

Choose a reason for hiding this comment

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

not needed. external links have a string field with the url they opint to. that's it.

@@ -486,6 +491,7 @@
linkDisplay.css('transform', 'rotate('+link.rotation+'deg)');
linkDisplay.css('fill', 'grey');
linkDisplay.css('color', 'rgba(128,128,128,1)');
console.log('LINK DISPLAY: ', linkDisplay);
Copy link
Member

Choose a reason for hiding this comment

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

remove

@@ -463,7 +467,8 @@
})
externalLinks.forEach(function(link,index){
if(link!=null){
var posX = parseInt($("#space").css('margin-left')) + $("#space").position().left;
var posX = parseInt($("#space").css('margin-left')) + $("#space").position().left;
console.log('posX: ', parseInt($("#space").css('margin-left')), $("#space").position());
Copy link
Member

Choose a reason for hiding this comment

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

remove

Copy link
Member

Choose a reason for hiding this comment

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

it doesn't seem necessary for this file to change?

Copy link
Member

Choose a reason for hiding this comment

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

still this


.imgDiv {
display: inline-block;
}
Copy link
Member

Choose a reason for hiding this comment

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

are all of these css changes needed?

Copy link
Member

Choose a reason for hiding this comment

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

?

$(imageblock[0]).mouseenter(onMouseEnter).mouseleave(onMouseLeave).dblclick(onDoubleClick);
}
// Reset data-attribute to get current selected image ID
$("#uploadImage").data('value', '');
Copy link
Member

Choose a reason for hiding this comment

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

there shouldn't be any image changes needed for this ticket

@jdamerow jdamerow closed this Jun 13, 2024
slide.html errors, and deleted unnecessary classes
@jophals jophals reopened this Jun 14, 2024

@OneToOne(targetEntity = VSImage.class)
@NotFound(action = NotFoundAction.IGNORE)
private IVSImage image;
Copy link
Member

Choose a reason for hiding this comment

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

this should not be needed. slides don't have images

@@ -2,6 +2,7 @@

import edu.asu.diging.vspace.core.exception.ImageCouldNotBeStoredException;
import edu.asu.diging.vspace.core.exception.LinkDoesNotExistsException;
import edu.asu.diging.vspace.core.exception.SlideDoesNotExistException;
Copy link
Member

Choose a reason for hiding this comment

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

is this needed in this class?

Copy link
Member

Choose a reason for hiding this comment

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

?

@@ -33,4 +33,7 @@ public interface ISlideManager {
List<Sequence> getSlideSequences(String slideId, String moduleId);

Page<ISlide> findByNameOrDescription(Pageable requestedPage,String searchText);

void storeSlideDisplay(ISlide slide, IVSImage image);
Copy link
Member

Choose a reason for hiding this comment

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

what is this for? should not be needed for this ticket.

@Override
protected IExternalLinkDisplay createDisplayLink(IExternalLink link) {
return null;
}
Copy link
Member

Choose a reason for hiding this comment

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

what is this all about? this file should not need to be changed.

Copy link
Member

Choose a reason for hiding this comment

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

?

$('#addChoice').show();
$('#choiceSpace').show();
[/]

Copy link
Member

Choose a reason for hiding this comment

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

what is all this added for?

Copy link
Member

Choose a reason for hiding this comment

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

Please fix this file so it's clear what has been changed. Right now i can't tell.

Copy link
Member

Choose a reason for hiding this comment

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

why is this file being changed?

import edu.asu.diging.vspace.core.model.display.ISlideExternalLinkDisplay;

@RunWith(MockitoJUnitRunner.class)
public class SlideExternalLinkDisplayFactoryTest {
Copy link
Member

Choose a reason for hiding this comment

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

There shouldn't be a ExternalLinkDisplayFactory anymore

Copy link
Member

Choose a reason for hiding this comment

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

?

slideImage.setWidth(1300);
slide.setImage(slideImage);

ISlideDisplay displayAttributes = new SlideDisplay();
Copy link
Member

Choose a reason for hiding this comment

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

there should be no such class

@jdamerow jdamerow closed this Jun 20, 2024
@jophals jophals reopened this Jul 18, 2024
@jophals jophals requested a review from jdamerow July 18, 2024 21:13

public List<IExternalLinkSlide> findBySlide_Id(String slideId);

public void deleteByExternalLink(IExternalLinkSlide link);
Copy link
Member

Choose a reason for hiding this comment

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

just deleteByExternalLink. I don't think we need this method.

@@ -2,6 +2,7 @@

import edu.asu.diging.vspace.core.exception.ImageCouldNotBeStoredException;
import edu.asu.diging.vspace.core.exception.LinkDoesNotExistsException;
import edu.asu.diging.vspace.core.exception.SlideDoesNotExistException;
Copy link
Member

Choose a reason for hiding this comment

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

?

@Override
protected IExternalLinkDisplay createDisplayLink(IExternalLink link) {
return null;
}
Copy link
Member

Choose a reason for hiding this comment

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

?

}

@Override
public void removeFromLinkList(ISlide slide, IExternalLinkSlide link) {
Copy link
Member

Choose a reason for hiding this comment

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

does this really need a method? when you want to remove a link, you can just do it directly without calling this extra method.

}

@Override
public void addToLinkList(ISlide slide, IExternalLinkSlide link) {
Copy link
Member

Choose a reason for hiding this comment

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

does this really need a method? when you want to add a link, you can just do it directly without calling this extra method.

@@ -135,6 +136,7 @@ public String slide(Model model, @PathVariable("slideId") String slideId, @PathV
model.addAttribute("currentNumOfSlide", slideIndex + 1);
model.addAttribute("spaceId", spaceId);
model.addAttribute("spaceName", spaceManager.getSpace(spaceId).getName());
model.addAttribute("slideExternalLinkList", slideExternalLinkManager.getLinks(slideId));
Copy link
Member

Choose a reason for hiding this comment

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

?

@@ -16,6 +16,7 @@
import com.fasterxml.jackson.databind.node.ObjectNode;

import edu.asu.diging.vspace.core.exception.ImageCouldNotBeStoredException;
import edu.asu.diging.vspace.core.exception.SlideDoesNotExistException;
Copy link
Member

Choose a reason for hiding this comment

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

?

@@ -41,4 +45,10 @@ public ResponseEntity<String> deleteExternalLink(@PathVariable("id") String spac
externalLinkManager.deleteLink(linkId);
return new ResponseEntity<String>(HttpStatus.OK);
}

@RequestMapping(value = "/staff/module/{id}/slide/{slideId}/externallink/{linkId}", method = RequestMethod.DELETE)
public ResponseEntity<String> deleteSlideExternalLink(@PathVariable("id") String moduleId, @PathVariable("slideId") String slideId, @PathVariable("linkId") String linkId) {
Copy link
Member

Choose a reason for hiding this comment

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

?


}

public ResponseEntity<String> checkIfSlideExists(ISlideManager slideManager, String id) throws IOException{
Copy link
Member

Choose a reason for hiding this comment

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

this extra method seems unnecessary

import edu.asu.diging.vspace.core.model.display.ISlideExternalLinkDisplay;

@RunWith(MockitoJUnitRunner.class)
public class SlideExternalLinkDisplayFactoryTest {
Copy link
Member

Choose a reason for hiding this comment

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

?

@jdamerow jdamerow closed this Oct 22, 2024
@jophals jophals reopened this Oct 31, 2024
@jophals
Copy link
Author

jophals commented Oct 31, 2024

i had do to multiple merges to fix conflicts and diverging

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