Skip to content

Commit

Permalink
Keep the type pango_lineage snakecase as this is recognized by LAPIS …
Browse files Browse the repository at this point in the history
…as a type.
  • Loading branch information
anna-parker committed Aug 22, 2024
1 parent 997bff1 commit 4eba0dd
Show file tree
Hide file tree
Showing 13 changed files with 14 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ enum class MetadataType {
@JsonProperty("date")
DATE,

@JsonProperty("pangoLineage")
@JsonProperty("pango_lineage")
PANGO_LINEAGE,

@JsonProperty("boolean")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ private fun validateType(fieldValue: JsonNode, metadata: BaseMetadata) {
MetadataType.PANGO_LINEAGE -> {
if (!isValidPangoLineage(fieldValue.asText())) {
throw ProcessingValidationException(
"Expected type 'pangoLineage' for field '${metadata.name}', " +
"Expected type 'pango_lineage' for field '${metadata.name}', " +
"found value '$fieldValue'. " +
"A pango lineage must be of the form $PANGO_LINEAGE_REGEX_PATTERN, e.g. 'XBB' or 'BA.1.5'.",
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -487,7 +487,7 @@ class SubmitProcessedDataEndpointTest(
accession = "DoesNotMatter",
),
expectedErrorMessage =
"Expected type 'pangoLineage' for field 'pangoLineage', found value '\"A.5.invalid\"'. " +
"Expected type 'pango_lineage' for field 'pangoLineage', found value '\"A.5.invalid\"'. " +
"A pango lineage must be of the form [a-zA-Z]{1,3}(\\.\\d{1,3}){0,3}, e.g. 'XBB' or 'BA.1.5'.",
),
InvalidDataScenario(
Expand Down
4 changes: 2 additions & 2 deletions backend/src/test/resources/backend_config.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
},
{
"name": "pangoLineage",
"type": "pangoLineage",
"type": "pango_lineage",
"autocomplete": true
},
{
Expand Down Expand Up @@ -165,7 +165,7 @@
},
{
"name": "pangoLineage",
"type": "pangoLineage",
"type": "pango_lineage",
"autocomplete": true
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
},
{
"name": "pangoLineage",
"type": "pangoLineage",
"type": "pango_lineage",
"autocomplete": true
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ organisms:
type: string
autocomplete: true
- name: pangoLineage
type: pangoLineage
type: pango_lineage
autocomplete: true
required: true
- name: insdcAccessionFull
Expand Down
2 changes: 1 addition & 1 deletion kubernetes/loculus/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1329,7 +1329,7 @@ defaultOrganisms:
header: "Collection Details"
- name: pangoLineage
initiallyVisible: true
type: pangoLineage
type: pango_lineage
autocomplete: true
required: true
website:
Expand Down
2 changes: 1 addition & 1 deletion preprocessing/specification.md
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ The `metadata` field should contain a flat object consisting of the fields speci
- `int` (integer)
- `float`
- `date` (supplied as a string with complete ISO-8601 date, e.g., "2023-08-30")
- `pangoLineage` (supplied as a string with a properly formatted SARS-CoV-2 Pango lineage, e.g., "B.1.1.7")
- `pango_lineage` (supplied as a string with a properly formatted SARS-CoV-2 Pango lineage, e.g., "B.1.1.7")
- `authors` (comma separated list of authors, treated as a string in the current prepro pipeline)

#### Sequences
Expand Down
2 changes: 1 addition & 1 deletion website/src/components/SearchPage/SearchForm.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ const defaultSearchFormFilters: MetadataFilter[] = [
},
{
name: 'field3',
type: 'pangoLineage',
type: 'pango_lineage',
label: 'Field 3',
autocomplete: true,
initiallyVisible: true,
Expand Down
2 changes: 1 addition & 1 deletion website/src/components/SearchPage/SearchFullUI.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ const defaultSearchFormFilters: MetadataFilter[] = [
},
{
name: 'field3',
type: 'pangoLineage',
type: 'pango_lineage',
label: 'Field 3',
autocomplete: true,
initiallyVisible: true,
Expand Down
2 changes: 1 addition & 1 deletion website/src/components/SearchPage/fields/FieldProps.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,5 @@ export type FieldProps = {
onFocus?: FocusEventHandler<HTMLInputElement | HTMLTextAreaElement>;
onBlur?: FocusEventHandler<HTMLInputElement | HTMLTextAreaElement>;
fieldValue: string;
type?: 'string' | 'boolean' | 'float' | 'int' | 'pangoLineage' | 'authors';
type?: 'string' | 'boolean' | 'float' | 'int' | 'pango_lineage' | 'authors';
};
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export type NormalFieldProps = {
onFocus?: FocusEventHandler<HTMLInputElement | HTMLTextAreaElement>;
onBlur?: FocusEventHandler<HTMLInputElement | HTMLTextAreaElement>;
fieldValue: string | number;
type?: 'string' | 'boolean' | 'float' | 'int' | 'pangoLineage' | 'authors';
type?: 'string' | 'boolean' | 'float' | 'int' | 'pango_lineage' | 'authors';
};

export const NormalTextField = forwardRef<HTMLInputElement, NormalFieldProps>((props, ref) => {
Expand Down
2 changes: 1 addition & 1 deletion website/src/types/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ const metadataPossibleTypes = z.enum([
'date',
'int',
'float',
'pangoLineage',
'pango_lineage',
'timestamp',
'boolean',
'authors',
Expand Down

0 comments on commit 4eba0dd

Please sign in to comment.