-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #458 from IntersectMBO/feat/378-hash-and-validatio…
…n-of-the-metadata [#378] feat: add hash and validation of the metadata
- Loading branch information
Showing
25 changed files
with
1,139 additions
and
532 deletions.
There are no files selected for viewing
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
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
File renamed without changes.
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,5 @@ | ||
export * from "./fields"; | ||
export * from "./filters"; | ||
export * from "./sorting"; | ||
export * from "./modalConfig"; | ||
export * from "./metadataHashValidationErrors"; |
6 changes: 6 additions & 0 deletions
6
govtool/frontend/src/consts/governanceAction/metadataHashValidationErrors.ts
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,6 @@ | ||
export enum MetadataHashValidationErrors { | ||
INVALID_URL = "Invalid URL", | ||
INVALID_JSON = "Invalid JSON", | ||
INVALID_HASH = "Invalid hash", | ||
FETCH_ERROR = "Error fetching data", | ||
} |
50 changes: 50 additions & 0 deletions
50
govtool/frontend/src/consts/governanceAction/modalConfig.ts
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,50 @@ | ||
import { ModalState } from "@/context"; | ||
import I18n from "@/i18n"; | ||
|
||
import { MetadataHashValidationErrors } from "./metadataHashValidationErrors"; | ||
|
||
const externalDataDoesntMatchModal = { | ||
status: "warning", | ||
title: I18n.t("createGovernanceAction.modals.externalDataDoesntMatch.title"), | ||
message: I18n.t( | ||
"createGovernanceAction.modals.externalDataDoesntMatch.message" | ||
), | ||
buttonText: I18n.t( | ||
"createGovernanceAction.modals.externalDataDoesntMatch.buttonText" | ||
), | ||
cancelText: I18n.t( | ||
"createGovernanceAction.modals.externalDataDoesntMatch.cancelRegistrationText" | ||
), | ||
feedbackText: I18n.t( | ||
"createGovernanceAction.modals.externalDataDoesntMatch.feedbackText" | ||
), | ||
} as const; | ||
|
||
const urlCannotBeFound = { | ||
status: "warning", | ||
title: I18n.t("createGovernanceAction.modals.urlCannotBeFound.title"), | ||
message: I18n.t("createGovernanceAction.modals.urlCannotBeFound.message"), | ||
link: "https://docs.sanchogov.tools", | ||
linkText: I18n.t("createGovernanceAction.modals.urlCannotBeFound.linkText"), | ||
buttonText: I18n.t( | ||
"createGovernanceAction.modals.urlCannotBeFound.buttonText" | ||
), | ||
cancelText: I18n.t( | ||
"createGovernanceAction.modals.urlCannotBeFound.cancelRegistrationText" | ||
), | ||
feedbackText: I18n.t( | ||
"createGovernanceAction.modals.urlCannotBeFound.feedbackText" | ||
), | ||
}; | ||
|
||
export const storageInformationErrorModals: Record< | ||
MetadataHashValidationErrors, | ||
ModalState< | ||
typeof externalDataDoesntMatchModal | typeof urlCannotBeFound | ||
>["state"] | ||
> = { | ||
[MetadataHashValidationErrors.INVALID_URL]: urlCannotBeFound, | ||
[MetadataHashValidationErrors.FETCH_ERROR]: urlCannotBeFound, | ||
[MetadataHashValidationErrors.INVALID_JSON]: externalDataDoesntMatchModal, | ||
[MetadataHashValidationErrors.INVALID_HASH]: externalDataDoesntMatchModal, | ||
}; |
File renamed without changes.
Oops, something went wrong.