Skip to content

Commit

Permalink
add incorect format error type
Browse files Browse the repository at this point in the history
  • Loading branch information
Sworzen1 committed Apr 24, 2024
1 parent f1987ed commit d5f7f23
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ import { Box, Link } from "@mui/material";

import { Typography } from "@atoms";
import { useTranslation } from "@hooks";
import { MetadataValidationStatus } from "@models";
import { openInNewTab } from "@utils";
import { MetadataValidationStatus } from "@/models";

export const DataMissingInfoBox = ({
isDataMissing,
Expand All @@ -26,6 +26,9 @@ export const DataMissingInfoBox = ({
[MetadataValidationStatus.INVALID_HASH]: t(
"errors.gAMetadata.message.notVerifiable",
),
[MetadataValidationStatus.INCORRECT_FORMAT]: t(
"errors.gAMetadata.message.incorrectFormat",
),
}[isDataMissing as MetadataValidationStatus];

const gaMetadataErrorDescription = {
Expand All @@ -38,6 +41,9 @@ export const DataMissingInfoBox = ({
[MetadataValidationStatus.INVALID_HASH]: t(
"errors.gAMetadata.description.notVerifiable",
),
[MetadataValidationStatus.INCORRECT_FORMAT]: t(
"errors.gAMetadata.description.incorrectFormat",
),
}[isDataMissing as MetadataValidationStatus];

return isDataMissing && !isSubmitted && !isInProgress ? (
Expand Down
1 change: 1 addition & 0 deletions govtool/frontend/src/models/metadataValidation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ export enum MetadataValidationStatus {
URL_NOT_FOUND = "URL_NOT_FOUND",
INVALID_JSONLD = "INVALID_JSONLD",
INVALID_HASH = "INVALID_HASH",
INCORRECT_FORMAT = "INCORRECT_FORMAT",
}

export type ValidateMetadataResult = {
Expand Down

0 comments on commit d5f7f23

Please sign in to comment.