-
Notifications
You must be signed in to change notification settings - Fork 3
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
base: develop
Are you sure you want to change the base?
story/VSPC-242 #345
Conversation
vspace/src/main/java/edu/asu/diging/vspace/core/model/impl/ExternalLinkSlide.java
Outdated
Show resolved
Hide resolved
|
||
@OneToOne(targetEntity = VSImage.class) | ||
@NotFound(action = NotFoundAction.IGNORE) | ||
private IVSImage image; |
There was a problem hiding this comment.
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; |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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); |
There was a problem hiding this comment.
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; | ||
} |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
?
$('#addChoice').show(); | ||
$('#choiceSpace').show(); | ||
[/] | ||
|
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this still
There was a problem hiding this comment.
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 { |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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(); |
There was a problem hiding this comment.
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
|
||
public List<IExternalLinkSlide> findBySlide_Id(String slideId); | ||
|
||
public void deleteByExternalLink(IExternalLinkSlide link); |
There was a problem hiding this comment.
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; |
There was a problem hiding this comment.
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; | ||
} |
There was a problem hiding this comment.
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) { |
There was a problem hiding this comment.
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) { |
There was a problem hiding this comment.
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)); |
There was a problem hiding this comment.
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; |
There was a problem hiding this comment.
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) { |
There was a problem hiding this comment.
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{ |
There was a problem hiding this comment.
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 { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
?
DeleteLinkController (see comment)
…aces-2.0 into story/VSPC-242 "divergent local and repo branches"
i had do to multiple merges to fix conflicts and diverging |
@@ -13,7 +13,7 @@ | |||
import edu.asu.diging.vspace.core.services.ISpaceLinkManager; | |||
|
|||
@Controller | |||
public class DeleteLinkController { | |||
public class DeleteSpaceLinkController { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's not correct, is it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What do you mean? I renamed it DeleteSpaceLinkController
because it was housing methods for deleting module slide links and space links and you didn't want to mix them. So now there's DeleteSpaceLinkController
and DeleteSlideLinkController
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do you want me to just keep the name as DeleteLinkController
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, this class does not just delete spacelinks, so the name is misleading.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oh okay, got it. I named it that because they all originate from '/staff/space'. But I see what you mean
@@ -78,6 +79,7 @@ public ResponseEntity<Map<String,Object>> showSpaceLinks(@PathVariable String id | |||
Map<String,Object> responseData = new HashMap<String,Object>(); | |||
responseData.put("spaceLinks", spaceLinkManager.getLinkDisplays(id)); | |||
responseData.put("externalLinks", externalLinkManager.getLinkDisplays(id)); | |||
System.out.println("EXTERNAL LINKS 2: " + externalLinkManager.getLinkDisplays(id)); | |||
responseData.put("moduleLinks", moduleLinkManager.getLinkDisplays(id)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove sysouts
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this still
controllers, cleaned up some unused code in slide.html, and removed comments/print statements
…aces-2.0 into story/VSPC-242 Merging due to mismatch with remote branch
|
||
@Repository | ||
@JaversSpringDataAuditable | ||
public interface SlideExternalLinkRepository extends PagingAndSortingRepository<ExternalLinkSlide, String> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This repo is called SlideExternalLinkRepository
but the model is called ExternalLinkSlide
. Should be consistentn
|
||
@Transactional | ||
@Service | ||
public class SlideExternalLinkManager |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
are you saying that this needs a Javadoc as well or that there is a naming inconsistency similar to above?
} | ||
|
||
@Override | ||
public IExternalLinkSlide createExternalLink(String label, String url, String slideId) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
there needs to be javadoc. Most importantly it needs to be documented that this method does not save the external link it creates, or does it?
return success(link.getId(), link.getExternalLink(), title, null, null); | ||
} | ||
|
||
public ResponseEntity<String> success(String id, String url, String label, String linkedId, String linkedSlideStatus) throws IOException{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this should not be public.
return new ResponseEntity<>("{'error': 'Slide could not be found.'}", HttpStatus.NOT_FOUND); | ||
} | ||
IExternalLinkSlide link = externalLinkManager.updateExternalLink(title, externalLink, id); | ||
return success(link.getId(), link.getExternalLink(), title, null, null); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
success is only called once, right? here? if so, there is really no need to have the last two parameters if they are always null.
also, there are conflicts |
consistency throughout project, added Javadocs, cleaned up unused paramters...
…aces-2.0 into story/VSPC-242 needed to merge in order to push new changes
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)
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!