Skip to content

allowing users to see the number of sightings associated with a given… #1107

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

Conversation

Veda-Gogineni
Copy link
Contributor

… individual.

allowing users to see the number of sightings associated with a given individual.
PR fixes #834

Before you Submit!

  • Is all the text internationalized?
  • If you made a change to the header, did you update the react, jsp, and html?
  • Are all depedencies at a locked version?
  • Did you adhere to best practices?
  • Is there a quick unit test you can add?

@@ -8,8 +8,6 @@ java.net.URL,
org.datanucleus.ExecutionContext,java.text.SimpleDateFormat,
org.joda.time.DateTime,org.ecocean.*,org.ecocean.social.*,org.ecocean.servlet.ServletUtilities,java.io.File, java.util.*, org.ecocean.genetics.*,org.ecocean.security.Collaboration, org.ecocean.security.HiddenEncReporter, com.google.gson.Gson,
org.datanucleus.api.rest.RESTUtils, org.datanucleus.api.jdo.JDOPersistenceManager, java.text.SimpleDateFormat, org.apache.commons.lang3.StringUtils" %>
Copy link
Member

Choose a reason for hiding this comment

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

these need to be left in now, due to Shepherd and ShepherdProperties now (in main) being moved to their own package.

@@ -1384,6 +1382,50 @@ if (sharky.getNames() != null) {
}
%>

Copy link
Member

Choose a reason for hiding this comment

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

i have a suggestion to make this much simpler. i am not sure why the code inside this jsp (not your code) is loading getMarkedIndividual() so many times! its pretty bad form.

so i will suggest rather you set an int value at the top (around line 186) e.g. int encCount = 0 ... then the first time myEncs.size() is calculated -- use that value.

then all of this code you added can be reduced to your <div>....</div> code, but use encCount in there.

Copy link
Member

@naknomum naknomum left a comment

Choose a reason for hiding this comment

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

this file has a history of inefficient code; i have a suggestion to make yours much shorter. see comment in individuals.jsp

@goddesswarship goddesswarship requested a review from naknomum April 22, 2025 16:34
Copy link
Member

@naknomum naknomum left a comment

Choose a reason for hiding this comment

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

looks good!

@naknomum naknomum merged commit 137a5f1 into WildMeOrg:main Apr 22, 2025
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.

Count of sightings on individual page
2 participants