-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[#378] feat: create gov action transaction builder & submit
- Loading branch information
1 parent
03c70f3
commit 6a97391
Showing
16 changed files
with
885 additions
and
570 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
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.
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
Oops, something went wrong.