-
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.
Merge pull request #551 from IntersectMBO/feat/new-drep-registration-…
…flow feat/new-drep-registration
- Loading branch information
Showing
19 changed files
with
985 additions
and
496 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
import i18n from "@/i18n"; | ||
import { EMAIL_REGEX, NICKNAME_REGEX, URL_REGEX } from "@/utils"; | ||
|
||
export const Rules = { | ||
BIO: { | ||
maxLength: { | ||
value: 500, | ||
message: i18n.t("registration.fields.validations.maxLength", { | ||
maxLength: 500, | ||
}), | ||
}, | ||
}, | ||
DREP_NAME: { | ||
required: { | ||
value: true, | ||
message: i18n.t("registration.fields.validations.required"), | ||
}, | ||
pattern: { | ||
value: NICKNAME_REGEX, | ||
message: i18n.t("registration.fields.validations.nickname"), | ||
}, | ||
maxLength: { | ||
value: 80, | ||
message: i18n.t("registration.fields.validations.maxLength", { | ||
maxLength: 80, | ||
}), | ||
}, | ||
}, | ||
EMAIL: { | ||
pattern: { | ||
value: EMAIL_REGEX, | ||
message: i18n.t("registration.fields.validations.email"), | ||
}, | ||
}, | ||
LINK: { | ||
pattern: { | ||
value: URL_REGEX, | ||
message: i18n.t("registration.fields.validations.url"), | ||
}, | ||
}, | ||
}; |
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,2 @@ | ||
export * from "./fields"; | ||
export * from "./jsonContext"; |
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 @@ | ||
export const CIP_QQQ = | ||
"https://github.com/cardano-foundation/CIPs/blob/master/CIP-QQQ/README.md#"; | ||
|
||
export const DREP_CONTEXT = { | ||
"@language": "en-us", | ||
CIP100: | ||
"https://github.com/cardano-foundation/CIPs/blob/master/CIP-0100/README.md#", | ||
CIPQQQ: CIP_QQQ, | ||
hashAlgorithm: "CIP100:hashAlgorithm", | ||
body: { | ||
"@id": "CIPQQQ:body", | ||
"@context": { | ||
references: { | ||
"@id": "CIPQQQ:references", | ||
"@container": "@set" as const, | ||
"@context": { | ||
GovernanceMetadata: "CIP100:GovernanceMetadataReference", | ||
Other: "CIP100:OtherReference", | ||
label: "CIP100:reference-label", | ||
uri: "CIP100:reference-uri", | ||
referenceHash: { | ||
"@id": "CIPQQQ:referenceHash", | ||
"@context": { | ||
hashDigest: "CIPQQQ:hashDigest", | ||
hashAlgorithm: "CIP100:hashAlgorithm", | ||
}, | ||
}, | ||
}, | ||
}, | ||
dRepName: "CIPQQQ:dRepName", | ||
bio: "CIPQQQ:bio", | ||
email: "CIPQQQ:email", | ||
}, | ||
}, | ||
authors: { | ||
"@id": "CIP100:authors", | ||
"@container": "@set" as const, | ||
"@context": { | ||
name: "http://xmlns.com/foaf/0.1/name", | ||
witness: { | ||
"@id": "CIP100:witness", | ||
"@context": { | ||
witnessAlgorithm: "CIP100:witnessAlgorithm", | ||
publicKey: "CIP100:publicKey", | ||
signature: "CIP100:signature", | ||
}, | ||
}, | ||
}, | ||
}, | ||
}; |
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,41 @@ | ||
import { ModalState } from "@/context"; | ||
import I18n from "@/i18n"; | ||
|
||
export enum MetadataHashValidationErrors { | ||
INVALID_URL = "Invalid URL", | ||
INVALID_JSON = "Invalid JSON", | ||
INVALID_HASH = "Invalid hash", | ||
FETCH_ERROR = "Error fetching data", | ||
} | ||
|
||
const externalDataDoesntMatchModal = { | ||
status: "warning", | ||
title: I18n.t("modals.externalDataDoesntMatch.title"), | ||
message: I18n.t("modals.externalDataDoesntMatch.message"), | ||
buttonText: I18n.t("modals.externalDataDoesntMatch.buttonText"), | ||
cancelText: I18n.t("modals.externalDataDoesntMatch.cancelRegistrationText"), | ||
feedbackText: I18n.t("modals.externalDataDoesntMatch.feedbackText"), | ||
} as const; | ||
|
||
const urlCannotBeFound = { | ||
status: "warning", | ||
title: I18n.t("modals.urlCannotBeFound.title"), | ||
message: I18n.t("modals.urlCannotBeFound.message"), | ||
link: "https://docs.sanchogov.tools", | ||
linkText: I18n.t("modals.urlCannotBeFound.linkText"), | ||
buttonText: I18n.t("modals.urlCannotBeFound.buttonText"), | ||
cancelText: I18n.t("modals.urlCannotBeFound.cancelRegistrationText"), | ||
feedbackText: I18n.t("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, | ||
}; |
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 |
---|---|---|
@@ -1,5 +1,3 @@ | ||
export * from "./fields"; | ||
export * from "./filters"; | ||
export * from "./sorting"; | ||
export * from "./modalConfig"; | ||
export * from "./metadataHashValidationErrors"; |
6 changes: 0 additions & 6 deletions
6
govtool/frontend/src/consts/governanceAction/metadataHashValidationErrors.ts
This file was deleted.
Oops, something went wrong.
50 changes: 0 additions & 50 deletions
50
govtool/frontend/src/consts/governanceAction/modalConfig.ts
This file was deleted.
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
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.