Skip to content

Commit

Permalink
feat: add secret download page.
Browse files Browse the repository at this point in the history
  • Loading branch information
gdethier committed May 28, 2024
1 parent 5a63fc6 commit c525bdb
Show file tree
Hide file tree
Showing 19 changed files with 513 additions and 17 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"license": "Apache-2.0",
"dependencies": {
"@creativecommons/cc-assets": "^0.1.0",
"@logion/client": "^0.45.0-10",
"@logion/client": "^0.45.0-11",
"@logion/client-browser": "^0.3.5",
"@logion/crossmint": "^0.1.32",
"@logion/extension": "^0.8.1-1",
Expand Down
14 changes: 14 additions & 0 deletions src/PublicPaths.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -54,3 +54,17 @@ export function getBaseUrl(): string {

export const SECRET_RECOVERY_RELATIVE_PATH = "/secret-recovery";
export const SECRET_RECOVERY_PATH = PUBLIC_PATH + SECRET_RECOVERY_RELATIVE_PATH;

export const SECRET_DOWNLOAD_RELATIVE_PATH = "/secret-download/:locId/:challenge/:requestId";
export const SECRET_DOWNLOAD_PATH = PUBLIC_PATH + SECRET_DOWNLOAD_RELATIVE_PATH;

export function secretDownloadPageUrl(locId: UUID, challenge: string, requestId: string) {
return SECRET_DOWNLOAD_PATH
.replace(":locId", locId.toDecimalString())
.replace(":challenge", challenge)
.replace(":requestId", requestId);
}

export function fullSecretDownloadPageUrl(locId: UUID, challenge: string, requestId: string) {
return `${ getBaseUrl() }${ secretDownloadPageUrl(locId, challenge, requestId) }`;
}
3 changes: 3 additions & 0 deletions src/PublicRouter.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,12 @@ import Certificate from "./certificate/Certificate";
import {
CERTIFICATE_RELATIVE_PATH,
COLLECTION_ITEM_CERTIFICATE_RELATIVE_PATH,
SECRET_DOWNLOAD_RELATIVE_PATH,
SECRET_RECOVERY_RELATIVE_PATH,
TOKENS_RECORD_CERTIFICATE_RELATIVE_PATH
} from "./PublicPaths";
import SecretRecoveryRequestFormPage from "./pages/public/secretrecoveryrequest/SecretRecoveryRequestFormPage";
import SecretDownloadPage from "./pages/public/secretdownload/SecretDownloadPage";

export default function PublicRouter() {
return (
Expand All @@ -17,6 +19,7 @@ export default function PublicRouter() {
<Route path={ TOKENS_RECORD_CERTIFICATE_RELATIVE_PATH } element={ <Certificate /> } />
</Route>
<Route path={ SECRET_RECOVERY_RELATIVE_PATH } element={ <SecretRecoveryRequestFormPage /> } />
<Route path={ SECRET_DOWNLOAD_RELATIVE_PATH } element={ <SecretDownloadPage /> } />
</Routes>
)
}
2 changes: 2 additions & 0 deletions src/common/FormGroup.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,10 @@ export default function FormGroup(props: Props) {
const inlineCss = `
.FormGroup .form-control,
.FormGroup .form-control[readonly],
.FormGroup .form-control[disabled],
.FormGroup .input-group .btn-primary {
color: ${props.colors.foreground};
background-color: ${props.colors.background};
}
`;

Expand Down
54 changes: 54 additions & 0 deletions src/common/__snapshots__/AccountInfo.test.tsx.snap
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,10 @@ exports[`renders and compares with different data 1`] = `
.FormGroup .form-control,
.FormGroup .form-control[readonly],
.FormGroup .form-control[disabled],
.FormGroup .input-group .btn-primary {
color: #000000;
background-color: #eff3fe;
}
</style>
Expand Down Expand Up @@ -75,8 +77,10 @@ exports[`renders and compares with different data 1`] = `
.FormGroup .form-control,
.FormGroup .form-control[readonly],
.FormGroup .form-control[disabled],
.FormGroup .input-group .btn-primary {
color: #000000;
background-color: #eff3fe;
}
</style>
Expand Down Expand Up @@ -126,8 +130,10 @@ exports[`renders and compares with different data 1`] = `
.FormGroup .form-control,
.FormGroup .form-control[readonly],
.FormGroup .form-control[disabled],
.FormGroup .input-group .btn-primary {
color: #000000;
background-color: #eff3fe;
}
</style>
Expand Down Expand Up @@ -173,8 +179,10 @@ exports[`renders and compares with different data 1`] = `
.FormGroup .form-control,
.FormGroup .form-control[readonly],
.FormGroup .form-control[disabled],
.FormGroup .input-group .btn-primary {
color: #000000;
background-color: #eff3fe;
}
</style>
Expand Down Expand Up @@ -231,8 +239,10 @@ exports[`renders and compares with different data 1`] = `
.FormGroup .form-control,
.FormGroup .form-control[readonly],
.FormGroup .form-control[disabled],
.FormGroup .input-group .btn-primary {
color: #000000;
background-color: #eff3fe;
}
</style>
Expand Down Expand Up @@ -282,8 +292,10 @@ exports[`renders and compares with different data 1`] = `
.FormGroup .form-control,
.FormGroup .form-control[readonly],
.FormGroup .form-control[disabled],
.FormGroup .input-group .btn-primary {
color: #000000;
background-color: #eff3fe;
}
</style>
Expand Down Expand Up @@ -333,8 +345,10 @@ exports[`renders and compares with different data 1`] = `
.FormGroup .form-control,
.FormGroup .form-control[readonly],
.FormGroup .form-control[disabled],
.FormGroup .input-group .btn-primary {
color: #000000;
background-color: #eff3fe;
}
</style>
Expand Down Expand Up @@ -380,8 +394,10 @@ exports[`renders and compares with different data 1`] = `
.FormGroup .form-control,
.FormGroup .form-control[readonly],
.FormGroup .form-control[disabled],
.FormGroup .input-group .btn-primary {
color: #000000;
background-color: #eff3fe;
}
</style>
Expand Down Expand Up @@ -431,8 +447,10 @@ exports[`renders and compares with different data 1`] = `
.FormGroup .form-control,
.FormGroup .form-control[readonly],
.FormGroup .form-control[disabled],
.FormGroup .input-group .btn-primary {
color: #000000;
background-color: #eff3fe;
}
</style>
Expand Down Expand Up @@ -493,8 +511,10 @@ exports[`renders and compares with same data 1`] = `
.FormGroup .form-control,
.FormGroup .form-control[readonly],
.FormGroup .form-control[disabled],
.FormGroup .input-group .btn-primary {
color: #000000;
background-color: #eff3fe;
}
</style>
Expand Down Expand Up @@ -540,8 +560,10 @@ exports[`renders and compares with same data 1`] = `
.FormGroup .form-control,
.FormGroup .form-control[readonly],
.FormGroup .form-control[disabled],
.FormGroup .input-group .btn-primary {
color: #000000;
background-color: #eff3fe;
}
</style>
Expand Down Expand Up @@ -591,8 +613,10 @@ exports[`renders and compares with same data 1`] = `
.FormGroup .form-control,
.FormGroup .form-control[readonly],
.FormGroup .form-control[disabled],
.FormGroup .input-group .btn-primary {
color: #000000;
background-color: #eff3fe;
}
</style>
Expand Down Expand Up @@ -638,8 +662,10 @@ exports[`renders and compares with same data 1`] = `
.FormGroup .form-control,
.FormGroup .form-control[readonly],
.FormGroup .form-control[disabled],
.FormGroup .input-group .btn-primary {
color: #000000;
background-color: #eff3fe;
}
</style>
Expand Down Expand Up @@ -696,8 +722,10 @@ exports[`renders and compares with same data 1`] = `
.FormGroup .form-control,
.FormGroup .form-control[readonly],
.FormGroup .form-control[disabled],
.FormGroup .input-group .btn-primary {
color: #000000;
background-color: #eff3fe;
}
</style>
Expand Down Expand Up @@ -747,8 +775,10 @@ exports[`renders and compares with same data 1`] = `
.FormGroup .form-control,
.FormGroup .form-control[readonly],
.FormGroup .form-control[disabled],
.FormGroup .input-group .btn-primary {
color: #000000;
background-color: #eff3fe;
}
</style>
Expand Down Expand Up @@ -798,8 +828,10 @@ exports[`renders and compares with same data 1`] = `
.FormGroup .form-control,
.FormGroup .form-control[readonly],
.FormGroup .form-control[disabled],
.FormGroup .input-group .btn-primary {
color: #000000;
background-color: #eff3fe;
}
</style>
Expand Down Expand Up @@ -845,8 +877,10 @@ exports[`renders and compares with same data 1`] = `
.FormGroup .form-control,
.FormGroup .form-control[readonly],
.FormGroup .form-control[disabled],
.FormGroup .input-group .btn-primary {
color: #000000;
background-color: #eff3fe;
}
</style>
Expand Down Expand Up @@ -896,8 +930,10 @@ exports[`renders and compares with same data 1`] = `
.FormGroup .form-control,
.FormGroup .form-control[readonly],
.FormGroup .form-control[disabled],
.FormGroup .input-group .btn-primary {
color: #000000;
background-color: #eff3fe;
}
</style>
Expand Down Expand Up @@ -958,8 +994,10 @@ exports[`renders without comparison 1`] = `
.FormGroup .form-control,
.FormGroup .form-control[readonly],
.FormGroup .form-control[disabled],
.FormGroup .input-group .btn-primary {
color: #000000;
background-color: #eff3fe;
}
</style>
Expand Down Expand Up @@ -1005,8 +1043,10 @@ exports[`renders without comparison 1`] = `
.FormGroup .form-control,
.FormGroup .form-control[readonly],
.FormGroup .form-control[disabled],
.FormGroup .input-group .btn-primary {
color: #000000;
background-color: #eff3fe;
}
</style>
Expand Down Expand Up @@ -1056,8 +1096,10 @@ exports[`renders without comparison 1`] = `
.FormGroup .form-control,
.FormGroup .form-control[readonly],
.FormGroup .form-control[disabled],
.FormGroup .input-group .btn-primary {
color: #000000;
background-color: #eff3fe;
}
</style>
Expand Down Expand Up @@ -1103,8 +1145,10 @@ exports[`renders without comparison 1`] = `
.FormGroup .form-control,
.FormGroup .form-control[readonly],
.FormGroup .form-control[disabled],
.FormGroup .input-group .btn-primary {
color: #000000;
background-color: #eff3fe;
}
</style>
Expand Down Expand Up @@ -1161,8 +1205,10 @@ exports[`renders without comparison 1`] = `
.FormGroup .form-control,
.FormGroup .form-control[readonly],
.FormGroup .form-control[disabled],
.FormGroup .input-group .btn-primary {
color: #000000;
background-color: #eff3fe;
}
</style>
Expand Down Expand Up @@ -1212,8 +1258,10 @@ exports[`renders without comparison 1`] = `
.FormGroup .form-control,
.FormGroup .form-control[readonly],
.FormGroup .form-control[disabled],
.FormGroup .input-group .btn-primary {
color: #000000;
background-color: #eff3fe;
}
</style>
Expand Down Expand Up @@ -1263,8 +1311,10 @@ exports[`renders without comparison 1`] = `
.FormGroup .form-control,
.FormGroup .form-control[readonly],
.FormGroup .form-control[disabled],
.FormGroup .input-group .btn-primary {
color: #000000;
background-color: #eff3fe;
}
</style>
Expand Down Expand Up @@ -1310,8 +1360,10 @@ exports[`renders without comparison 1`] = `
.FormGroup .form-control,
.FormGroup .form-control[readonly],
.FormGroup .form-control[disabled],
.FormGroup .input-group .btn-primary {
color: #000000;
background-color: #eff3fe;
}
</style>
Expand Down Expand Up @@ -1361,8 +1413,10 @@ exports[`renders without comparison 1`] = `
.FormGroup .form-control,
.FormGroup .form-control[readonly],
.FormGroup .form-control[disabled],
.FormGroup .input-group .btn-primary {
color: #000000;
background-color: #eff3fe;
}
</style>
Expand Down
Loading

0 comments on commit c525bdb

Please sign in to comment.