-
Notifications
You must be signed in to change notification settings - Fork 41
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 #1569 from input-output-hk/djo/1554/explorer/impro…
…ve-ctx-ui Explorer: Improve Cardano Transaction Certification & Certificate Chain Validation UI
- Loading branch information
Showing
58 changed files
with
2,601 additions
and
465 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
/** @type {import("fantasticon").RunnerOptions} */ | ||
module.exports = { | ||
inputDir: "./icons", | ||
outputDir: "./public/fonts", | ||
fontTypes: ["woff", "woff2"], | ||
assetTypes: ["css"], | ||
fontsUrl: "/explorer/fonts", | ||
formatOptions: {}, | ||
name: "mithril-icons", | ||
prefix: "mi", | ||
templates: { | ||
css: "./font.css.hbs", | ||
}, | ||
pathOptions: { | ||
css: "./src/app/mithril-icons.css", | ||
}, | ||
codepoints: { | ||
logo: 57344, // 0xe000 = start of unicode private use area | ||
}, | ||
}; |
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,2 +1,3 @@ | ||
out | ||
explorer | ||
font.css.hbs |
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
2 changes: 1 addition & 1 deletion
2
mithril-explorer/__tests__/CardanoTransactionsFormInput.test.js
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
85 changes: 85 additions & 0 deletions
85
mithril-explorer/__tests__/TransactionCertificationBreadcrumb.test.js
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,85 @@ | ||
import { render, screen } from "@testing-library/react"; | ||
import "@testing-library/jest-dom"; | ||
import TransactionCertificationBreadcrumb from "#/CertifyCardanoTransactionsModal/TransactionCertificationBreadcrumb"; | ||
import { validationSteps } from "#/CertifyCardanoTransactionsModal"; | ||
|
||
function setup(currentStep, isProofValid, isCertificateChainValid) { | ||
const utils = [ | ||
render( | ||
<TransactionCertificationBreadcrumb | ||
currentStep={currentStep} | ||
isProofValid={isProofValid} | ||
isCertificateChainValid={isCertificateChainValid} | ||
/>, | ||
), | ||
]; | ||
|
||
const tabs = new Map(); | ||
tabs.set(validationSteps.fetchingProof, screen.getByText(/Fetching Transactions Proof/i)); | ||
tabs.set(validationSteps.validatingProof, screen.getByText(/Verifying Transactions Proof/i)); | ||
tabs.set( | ||
validationSteps.validatingCertificateChain, | ||
screen.getByText(/Validating Certificate Chain/i), | ||
); | ||
tabs.set(validationSteps.done, screen.getByText(/Finish/i)); | ||
|
||
return { | ||
tabs: tabs, | ||
...utils, | ||
}; | ||
} | ||
|
||
const classForVariant = (variant) => `list-group-item-${variant}`; | ||
|
||
describe("TransactionCertificationBreadcrumb", () => { | ||
it("The tab variant are light when default", () => { | ||
const { tabs } = setup(validationSteps.ready, false, false); | ||
|
||
for (const [_key, tab] of tabs) { | ||
expect(tab).toHaveClass(classForVariant("light")); | ||
} | ||
}); | ||
|
||
it.each([ | ||
["fetchingProof", validationSteps.fetchingProof], | ||
["validatingProof", validationSteps.validatingProof], | ||
["validatingCertificateChain", validationSteps.validatingCertificateChain], | ||
])("The tab variant is primary when current and checks are valid : %s", (stepName, stepIndex) => { | ||
const { tabs } = setup(stepIndex, true, true); | ||
|
||
expect(tabs.get(stepIndex)).toHaveClass(classForVariant("primary")); | ||
}); | ||
|
||
it("Current step is done and checks are valid then tabs are light except done step tab that is success", () => { | ||
const { tabs } = setup(validationSteps.done, true, true); | ||
|
||
expect(tabs.get(validationSteps.fetchingProof)).toHaveClass(classForVariant("light")); | ||
expect(tabs.get(validationSteps.validatingProof)).toHaveClass(classForVariant("light")); | ||
expect(tabs.get(validationSteps.validatingCertificateChain)).toHaveClass( | ||
classForVariant("light"), | ||
); | ||
expect(tabs.get(validationSteps.done)).toHaveClass(classForVariant("success")); | ||
}); | ||
|
||
it("Current step is done and proof check is invalid then tabs are danger except tabs before proof validation", () => { | ||
const { tabs } = setup(validationSteps.done, false, true); | ||
|
||
expect(tabs.get(validationSteps.fetchingProof)).toHaveClass(classForVariant("light")); | ||
expect(tabs.get(validationSteps.validatingProof)).toHaveClass(classForVariant("danger")); | ||
expect(tabs.get(validationSteps.validatingCertificateChain)).toHaveClass( | ||
classForVariant("danger"), | ||
); | ||
expect(tabs.get(validationSteps.done)).toHaveClass(classForVariant("danger")); | ||
}); | ||
|
||
it("Current step is done and certificate chain check is invalid then tabs are danger except tabs before certificate chain validation", () => { | ||
const { tabs } = setup(validationSteps.done, true, false); | ||
|
||
expect(tabs.get(validationSteps.fetchingProof)).toHaveClass(classForVariant("light")); | ||
expect(tabs.get(validationSteps.validatingProof)).toHaveClass(classForVariant("light")); | ||
expect(tabs.get(validationSteps.validatingCertificateChain)).toHaveClass( | ||
classForVariant("danger"), | ||
); | ||
expect(tabs.get(validationSteps.done)).toHaveClass(classForVariant("danger")); | ||
}); | ||
}); |
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,28 @@ | ||
/* autogenerated file using `make icons-font` - don't modify manually */ | ||
|
||
@font-face { | ||
font-display: block; | ||
font-family: "{{ name }}"; | ||
src: {{{ fontSrc }}}; | ||
} | ||
|
||
.{{ prefix }}::before, | ||
[class^="{{ prefix }}-"]::before, | ||
[class*=" {{ prefix }}-"]::before { | ||
display: inline-block; | ||
font-family: {{ name }} !important; | ||
font-style: normal; | ||
font-weight: normal !important; | ||
font-variant: normal; | ||
text-transform: none; | ||
line-height: 1; | ||
vertical-align: -.125em; | ||
-webkit-font-smoothing: antialiased; | ||
-moz-osx-font-smoothing: grayscale; | ||
} | ||
|
||
{{# each codepoints }} | ||
.{{ ../prefix }}-{{ @key }}::before { | ||
content: "\\{{ codepoint this }}"; | ||
} | ||
{{/ each }} |
29 changes: 5 additions & 24 deletions
29
mithril-explorer/public/logo.svg → mithril-explorer/icons/logo.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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,8 @@ | ||
{ | ||
"compilerOptions": { | ||
"paths": { | ||
"@/*": ["./src/*"], | ||
"#/*": ["./src/components/*"] | ||
} | ||
} | ||
} |
Oops, something went wrong.