Skip to content

Commit

Permalink
Merge branch 'subspecies-search-support' into africancarnivorewildboo…
Browse files Browse the repository at this point in the history
…k-acw

# Conflicts:
#	archive/fixSomeFields.jsp
#	archive/individualGalleryPanel.jsp
#	src/main/java/org/ecocean/Annotation.java
#	src/main/java/org/ecocean/CommonConfiguration.java
#	src/main/java/org/ecocean/Encounter.java
#	src/main/java/org/ecocean/EncounterQueryProcessor.java
#	src/main/java/org/ecocean/LocationID.java
#	src/main/java/org/ecocean/MetricsBot.java
#	src/main/java/org/ecocean/Occurrence.java
#	src/main/java/org/ecocean/Shepherd.java
#	src/main/java/org/ecocean/StartupWildbook.java
#	src/main/java/org/ecocean/Util.java
#	src/main/java/org/ecocean/identity/IBEISIA.java
#	src/main/java/org/ecocean/security/HiddenDataReporter.java
#	src/main/java/org/ecocean/servlet/SessionExtend.java
#	src/main/java/org/ecocean/servlet/export/EncounterAnnotationExportExcelFile.java
#	src/main/java/org/ecocean/servlet/export/EncounterSearchExportMetadataExcel.java
#	src/main/java/org/ecocean/servlet/export/EncounterSearchExportShapefile.java
#	src/main/java/org/ecocean/servlet/export/ExportColumn.java
#	src/main/java/org/ecocean/servlet/export/OccurrenceSearchExportMetadataExcel.java
#	src/main/resources/bundles/contexts.properties
#	src/main/resources/bundles/en/header.properties
#	src/main/resources/bundles/en/index.properties
#	src/main/resources/bundles/en/pictureBook.properties
#	src/main/resources/bundles/es/header.properties
#	src/main/resources/bundles/fr/header.properties
#	src/main/resources/bundles/fr/index.properties
#	src/main/resources/bundles/fr/submit.properties
#	src/main/resources/bundles/fr/users.properties
#	src/main/resources/bundles/googleKeys.properties
#	src/main/resources/bundles/it/header.properties
#	src/main/resources/bundles/it/submit.properties
#	src/main/resources/bundles/locationID.json
#	src/main/resources/bundles/submitActionClass.properties
#	src/main/resources/emails/en/adoptionSpotting.html
#	src/main/resources/emails/en/individualAddEncounter.html
#	src/main/resources/emails/en/individualCreate.html
#	src/main/resources/emails/en/individualUpdate.html
#	src/main/resources/emails/en/oneTimeDonation.html
#	src/main/webapp/appadmin/iaBreakdownBySpecies.jsp
#	src/main/webapp/contactus.jsp
#	src/main/webapp/cust/mantamatcher/styles/_bootstrap-overrides.less
#	src/main/webapp/encounters/manualAnnotation.jsp
#	src/main/webapp/header.jsp
#	src/main/webapp/javascript/bubbleDiagram/encounter-calls.js
#	src/main/webapp/match.jsp
#	src/main/webapp/privacyPolicy.jsp
#	src/main/webapp/termsOfUse.jsp
  • Loading branch information
holmbergius committed Sep 24, 2024
2 parents c41d55d + 284ba02 commit e261ea2
Show file tree
Hide file tree
Showing 1,117 changed files with 148,022 additions and 127,190 deletions.
2 changes: 1 addition & 1 deletion .factorypath
Original file line number Diff line number Diff line change
Expand Up @@ -232,4 +232,4 @@
<factorypathentry kind="VARJAR" id="M2_REPO/org/glassfish/javax.json/1.0.4/javax.json-1.0.4.jar" enabled="true" runInBatchMode="false"/>
<factorypathentry kind="VARJAR" id="M2_REPO/sutime-stanford-corenlp-models/sutime-stanford-corenlp-models/3.6.0/sutime-stanford-corenlp-models-3.6.0.jar" enabled="true" runInBatchMode="false"/>
<factorypathentry kind="VARJAR" id="M2_REPO/edu/stanford/nlp/stanford-parser/3.7.0/stanford-parser-3.7.0.jar" enabled="true" runInBatchMode="false"/>
</factorypath>
</factorypath>
19 changes: 19 additions & 0 deletions .github/ISSUE_TEMPLATE/bug-report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
---
name: Bug report
about: A problem you find in Wildbook. Can be technical or user-facing
title: ''
labels: bug
assignees: ''

---

**Expected Behavior**
If a user-facing issue, provide step-by-step instructions in a numbered list for test purposes
If a technical issue, provide a general description of what the code should be doing and expected effects of the change.

**Current Behavior**
If a user-facing issue, provide step-by-step instructions for reproducibility and, at a minimum, the page on which the issue is occurring. If the issue is not consistently reproducible, add the `question` label
If a technical issue, provide a general description of the problem, where in the code the issue was found.

**Testing Notes**
If there's any additional considerations for testing, such a secondary confirmation paths, failure or success states, etc, include here.
20 changes: 20 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
name: Feature request
about: Suggest an idea for this project
title: ''
labels: enhancement
assignees: ''

---

**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

**Describe the solution you'd like**
A clear and concise description of what you want to happen.

**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.

**Additional context**
Add any other context or screenshots about the feature request here.
21 changes: 21 additions & 0 deletions .github/ISSUE_TEMPLATE/wild-me-feature.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
---
name: Wild Me feature
about: Features generated by Wild Me team
title: ''
labels: enhancement
assignees: ''

---

## Feature description and context
Why this feature? Why now?

## Feature sign-off requirements
Provide a list of tasks that, once complete, the feature will be done

## Design
- Figma link (static or prototype; specify)
- Component list/reference
- Navigation sitemap
- Product theme references and any known in-line customization that may be needed
- Are there images needed for design? (attach below in zip)
10 changes: 10 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
version: 2
updates:
- package-ecosystem: "maven"
directory: "/" # Location of pom.xml
schedule:
interval: "weekly"
- package-ecosystem: "github-actions"
directory: "/" #actions are all over the build, need to clean up before can get specific
schedule:
interval: "weekly"
2 changes: 1 addition & 1 deletion .github/workflows/maven-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4

- name: Set up JDK 1.8
uses: actions/setup-java@v1
Expand Down
12 changes: 2 additions & 10 deletions .github/workflows/nightly.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
name: Nightly

on:
workflow_dispatch:
push:
branches:
- master
Expand All @@ -9,12 +10,6 @@ on:
- 'v**'
release:
types: [created]
schedule:
- cron: '0 0 * * *' # Every day at midnight
pull_request:
paths:
- '.github/workflows/nightly.yml'
- 'devops/**'

jobs:
devops:
Expand All @@ -23,7 +18,7 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4

# Build containers
- name: Build containers
Expand All @@ -40,6 +35,3 @@ jobs:
- name: Push to GitHub Packages
run: bash devops/publish.sh -t nightly -r docker.pkg.github.com

- name: Push to Docker Hub
if: github.event_name == 'schedule'
run: bash devops/publish.sh -t nightly
10 changes: 9 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
.settings
.settings/
.project
.factorypath
*.DS_Store
target
Expand All @@ -24,6 +25,7 @@ src/main/webapp/encounters/*20*
src/main/caribwhale_data_dir
/webapps
/src/main/webapp/javascript/git-info.json
/src/main/webapp/react/
/node_modules
.vscode/
*.swp
Expand All @@ -32,3 +34,9 @@ src/main/caribwhale_data_dir
.classpath

catalina.base_IS_UNDEFINED

/frontend/node_modules
/frontend/dist
/frontend/.env
/frontend/build
/frontend/.env
48 changes: 48 additions & 0 deletions .husky/java/canonicalize_filename.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
#!/bin/sh

# Provide the canonicalize filename (physical filename with out any symlinks)
# like the GNU version readlink with the -f option regardless of the version of
# readlink (GNU or BSD).

# This file is part of a set of unofficial pre-commit hooks available
# at github.
# Link: https://github.com/ddddavidmartin/Pre-commit-hooks
# Contact: David Martin, [email protected]

###########################################################
# There should be no need to change anything below this line.

# Canonicalize by recursively following every symlink in every component of the
# specified filename. This should reproduce the results of the GNU version of
# readlink with the -f option.
#
# Reference: http://stackoverflow.com/questions/1055671/how-can-i-get-the-behavior-of-gnus-readlink-f-on-a-mac
canonicalize_filename () {
local target_file="$1"
local physical_directory=""
local result=""

# Need to restore the working directory after work.
local working_dir="`pwd`"

cd -- "$(dirname -- "$target_file")"
target_file="$(basename -- "$target_file")"

# Iterate down a (possible) chain of symlinks
while [ -L "$target_file" ]
do
target_file="$(readlink -- "$target_file")"
cd -- "$(dirname -- "$target_file")"
target_file="$(basename -- "$target_file")"
done

# Compute the canonicalized name by finding the physical path
# for the directory we're in and appending the target file.
physical_directory="`pwd -P`"
result="$physical_directory/$target_file"

# restore the working directory after work.
cd -- "$working_dir"

echo "$result"
}
154 changes: 154 additions & 0 deletions .husky/java/pre-commit-uncrustify
Original file line number Diff line number Diff line change
@@ -0,0 +1,154 @@
#!/bin/sh

# git pre-commit hook that runs an Uncrustify stylecheck.
# Features:
# - abort commit when commit does not comply with the style guidelines
# - create a patch of the proposed style changes
#
# More info on Uncrustify: http://uncrustify.sourceforge.net/

# This file is part of a set of unofficial pre-commit hooks available
# at github.
# Link: https://github.com/ddddavidmartin/Pre-commit-hooks
# Contact: David Martin, [email protected]

##################################################################
# There should be no need to change anything below this line.
# For configuration see pre-commit-uncrustify.cfg and
# pre-commit-uncrustify.example.cfg.

. "$(dirname -- "$0")/java/canonicalize_filename.sh"

# exit on error
set -e

# Absolute path to this script, e.g. /home/user/bin/foo.sh
SCRIPT="$(canonicalize_filename "$0")"
# Absolute path this script is in, e.g. /home/user/bin/
SCRIPTPATH="$(dirname -- "$SCRIPT")/java"
CONFIG="$SCRIPTPATH/pre-commit-uncrustify.cfg"


if [ ! -f "$CONFIG" ] ; then
echo "Missing config file $CONFIG."
exit 1
else
. "$CONFIG"
fi

# NOTE: just hard-coding this rather than using $CONFIG, cuz it was
# not working with relative path
UNCRUST_CONFIG="$SCRIPTPATH/uncrustify-style.cfg"
UNCRUSTIFY="$SCRIPTPATH/uncrustify"

# check whether the given file matches any of the set extensions
matches_extension() {
local filename="$(basename -- "$1")"
local extension=".${filename##*.}"
local ext

for ext in $FILE_EXTS; do [ "$ext" = "$extension" ] && return 0; done

return 1
}

# necessary check for initial commit
if git rev-parse --verify HEAD >/dev/null 2>&1 ; then
against=HEAD
else
# Initial commit: diff against an empty tree object
against=4b825dc642cb6eb9a060e54bf8d69288fbee4904
fi

# make sure the config file and executable are correctly set
if [ ! -f "$UNCRUST_CONFIG" ] ; then
printf "Error: uncrustify config file not found.\n"
printf "Set the correct path in $CONFIG.\n"
exit 1
fi

if ! command -v "$UNCRUSTIFY" > /dev/null ; then
printf "Error: uncrustify executable not found.\n"
printf "Set the correct path in $CONFIG.\n"
exit 1
fi

# create a filename to store our generated patch
prefix="pre-commit-uncrustify"
suffix="$(date +%C%y-%m-%d_%Hh%Mm%Ss)"
patch="/tmp/$prefix-$suffix.patch"

# clean up any older uncrustify patches
$DELETE_OLD_PATCHES && rm -f /tmp/$prefix*.patch

# create one patch containing all changes to the files
# sed to remove quotes around the filename, if inserted by the system
# (done sometimes, if the filename contains special characters, like the quote itself)
git diff-index --cached --diff-filter=ACMR --name-only $against -- | \
sed -e 's/^"\(.*\)"$/\1/' | \
while read file
do
# ignore file if we do check for file extensions and the file
# does not match any of the extensions specified in $FILE_EXTS
if $PARSE_EXTS && ! matches_extension "$file"; then
continue;
fi

# escape special characters in the source filename:
# - '\': backslash needs to be escaped
# - '*': used as matching string => '*' would mean expansion
# (curiously, '?' must not be escaped)
# - '[': used as matching string => '[' would mean start of set
# - '|': used as sed split char instead of '/', so it needs to be escaped
# in the filename
# printf %s particularly important if the filename contains the % character
file_escaped_source=$(printf "%s" "$file" | sed -e 's/[\*[|]/\\&/g')

# escape special characters in the target filename:
# phase 1 (characters escaped in the output diff):
# - '\': backslash needs to be escaped in the output diff
# - '"': quote needs to be escaped in the output diff if present inside
# of the filename, as it used to bracket the entire filename part
# phase 2 (characters escaped in the match replacement):
# - '\': backslash needs to be escaped again for sed itself
# (i.e. double escaping after phase 1)
# - '&': would expand to matched string
# - '|': used as sed split char instead of '/'
# printf %s particularly important if the filename contains the % character
file_escaped_target=$(printf "%s" "$file" | sed -e 's/[\"]/\\&/g' -e 's/[\&|]/\\&/g')

# Uncrustify detects the language automatically if it is not specified
language_option=""
if [ "$SOURCE_LANGUAGE" != "AUTO" ] ; then
language_option="-l $SOURCE_LANGUAGE"
fi

# uncrustify our sourcefile, create a patch with diff and append it to our $patch
# The sed call is necessary to transform the patch from
# --- $file timestamp
# +++ - timestamp
# to both lines working on the same file and having a a/ and b/ prefix.
# Else it can not be applied with 'git apply'.
"$UNCRUSTIFY" -c "$UNCRUST_CONFIG" -f "$file" $language_option | \
diff -u -- "$file" - | \
sed -e "1s|--- $file_escaped_source|--- \"a/$file_escaped_target\"|" -e "2s|+++ -|+++ \"b/$file_escaped_target\"|" >> "$patch"
done

# if no patch has been generated all is ok, clean up the file stub and exit
if [ ! -s "$patch" ] ; then
printf "Files in this commit comply with the uncrustify rules.\n"
rm -f "$patch"
exit 0
fi

# a patch has been created, notify the user and exit
printf "\nThe following differences were found between the code to commit "
printf "and the uncrustify rules:\n\n"
cat "$patch"

printf "\nYou can apply these changes with:\n git apply $patch\n"
printf "(may need to be called from the root directory of your repository)\n"
printf "Aborting commit. Apply changes and commit again or skip checking with"
printf " --no-verify (not recommended).\n"

exit 1
Loading

0 comments on commit e261ea2

Please sign in to comment.