forked from Luke-Sikina/picsure-search-refinement
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[ALS-7437] Switch study to dataset for concept node detail
- Loading branch information
1 parent
a778ee8
commit e749611
Showing
18 changed files
with
895 additions
and
175 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
#!/bin/sh -e | ||
CWD=$(pwd) | ||
cd $(git rev-parse --show-toplevel) | ||
format_cmd="" | ||
|
||
# skip if NO_VERIFY env var set | ||
if [ "$NO_VERIFY" ]; then | ||
echo 'code formatting skipped' 1>&2 | ||
exit 0 | ||
fi | ||
|
||
# I'm not great at bash, so this is a bit ugly, but I'll explain each pipe | ||
# 1. Get all staged files | ||
# 2. Reduce to just .java files | ||
# 3. Replace newlines with commas (this was really hard to do in sed) | ||
# 4. Replace commas with $,^.* | ||
# 5. Crop off the last 4 chars | ||
# This results in foo.java$,^.*bar.java$,^.*baz.java$ | ||
# I then append ^.* to the beginning of that. | ||
STAGED_JAVA_FILES_AS_REGEX=$(git diff --staged --name-only --diff-filter=ACMR | grep '.java$' | tr '\n' ',' | sed -e 's/,/$,^.*/g' | sed 's/.\{4\}$//') | ||
FILES_TO_RESTAGE=$(git diff --staged --name-only --diff-filter=ACMR) | ||
if [ -n "$STAGED_JAVA_FILES_AS_REGEX" ]; then | ||
echo "Found the following staged java files to format: $STAGED_JAVA_FILES_AS_REGEX" | ||
mvn spotless:apply -DspotlessFiles=^.*$STAGED_JAVA_FILES_AS_REGEX | ||
git add $FILES_TO_RESTAGE | ||
fi | ||
|
||
cd $CWD |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 16 additions & 0 deletions
16
src/main/java/edu/harvard/dbmi/avillach/dictionary/dataset/Dataset.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
package edu.harvard.dbmi.avillach.dictionary.dataset; | ||
|
||
import jakarta.annotation.Nullable; | ||
|
||
import java.util.Map; | ||
|
||
public record Dataset(String ref, String fullName, String abbreviation, String description, @Nullable Map<String, String> meta) { | ||
|
||
public Dataset(String ref, String fullName, String abbreviation, String description) { | ||
this(ref, fullName, abbreviation, description, null); | ||
} | ||
|
||
public Dataset withMeta(Map<String, String> meta) { | ||
return new Dataset(ref, fullName, abbreviation, description, meta); | ||
} | ||
} |
15 changes: 15 additions & 0 deletions
15
src/main/java/edu/harvard/dbmi/avillach/dictionary/dataset/DatasetMapper.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
package edu.harvard.dbmi.avillach.dictionary.dataset; | ||
|
||
import org.springframework.jdbc.core.RowMapper; | ||
import org.springframework.stereotype.Component; | ||
|
||
import java.sql.ResultSet; | ||
import java.sql.SQLException; | ||
|
||
@Component | ||
public class DatasetMapper implements RowMapper<Dataset> { | ||
@Override | ||
public Dataset mapRow(ResultSet rs, int rowNum) throws SQLException { | ||
return new Dataset(rs.getString("ref"), rs.getString("full_name"), rs.getString("abbreviation"), rs.getString("description")); | ||
} | ||
} |
Oops, something went wrong.