forked from jsnbuchanan/crowd-funder-for-time-pwa
feat: add claim route deep linking support
- Add claim route to deep link schema - Add claim view test to deeplink tests - Update build docs for clean web builds - Add rm -rf dist to build steps Technical Changes: - Add claim schema with id parameter - Add claim route test using generated claim ID - Add clean step before web/capacitor builds - Update Android build instructions This adds support for deep linking to claim views and improves the build process reliability by ensuring clean builds. The claim route allows direct navigation to claim details via external links.
This commit is contained in:
@@ -135,6 +135,7 @@ Prerequisites: Android Studio with SDK installed
|
|||||||
1. Build the web assets:
|
1. Build the web assets:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
|
rm -rf dist
|
||||||
npm run build:web
|
npm run build:web
|
||||||
npm run build:capacitor
|
npm run build:capacitor
|
||||||
```
|
```
|
||||||
@@ -228,10 +229,11 @@ configurations.all {
|
|||||||
## Building Android from the console
|
## Building Android from the console
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
|
cd android
|
||||||
./gradlew clean
|
./gradlew clean
|
||||||
./gradlew build -Dlint.baselines.continue=true
|
./gradlew build -Dlint.baselines.continue=true
|
||||||
|
cd ..
|
||||||
npx cap
|
npx cap run android
|
||||||
```
|
```
|
||||||
|
|
||||||
## Development
|
## Development
|
||||||
|
|||||||
@@ -110,11 +110,18 @@ export class DeepLinkHandler {
|
|||||||
query: Record<string, string>,
|
query: Record<string, string>,
|
||||||
): Promise<void> {
|
): Promise<void> {
|
||||||
const routeMap: Record<string, string> = {
|
const routeMap: Record<string, string> = {
|
||||||
|
"user-profile": "user-profile",
|
||||||
|
"project": "project",
|
||||||
|
"onboard-meeting-setup": "onboard-meeting-setup",
|
||||||
|
"invite-one-accept": "invite-one-accept",
|
||||||
|
"contact-import": "contact-import",
|
||||||
|
"confirm-gift": "confirm-gift",
|
||||||
|
"claim": "claim",
|
||||||
"claim-cert": "claim-cert",
|
"claim-cert": "claim-cert",
|
||||||
"claim-add-raw": "claim-add-raw",
|
"claim-add-raw": "claim-add-raw",
|
||||||
"contact-edit": "contact-edit",
|
"contact-edit": "contact-edit",
|
||||||
"contacts": "contacts",
|
"contacts": "contacts",
|
||||||
did: "did"
|
"did": "did"
|
||||||
};
|
};
|
||||||
|
|
||||||
const routeName = routeMap[path];
|
const routeName = routeMap[path];
|
||||||
|
|||||||
@@ -36,6 +36,27 @@ export const baseUrlSchema = z.object({
|
|||||||
|
|
||||||
// Parameter validation schemas for each route type
|
// Parameter validation schemas for each route type
|
||||||
export const deepLinkSchemas = {
|
export const deepLinkSchemas = {
|
||||||
|
"user-profile": z.object({
|
||||||
|
id: z.string()
|
||||||
|
}),
|
||||||
|
"project-details": z.object({
|
||||||
|
id: z.string()
|
||||||
|
}),
|
||||||
|
"onboard-meeting-setup": z.object({
|
||||||
|
id: z.string()
|
||||||
|
}),
|
||||||
|
"invite-one-accept": z.object({
|
||||||
|
id: z.string()
|
||||||
|
}),
|
||||||
|
"contact-import": z.object({
|
||||||
|
jwt: z.string()
|
||||||
|
}),
|
||||||
|
"confirm-gift": z.object({
|
||||||
|
id: z.string()
|
||||||
|
}),
|
||||||
|
"claim": z.object({
|
||||||
|
id: z.string()
|
||||||
|
}),
|
||||||
"claim-cert": z.object({
|
"claim-cert": z.object({
|
||||||
id: z.string()
|
id: z.string()
|
||||||
}),
|
}),
|
||||||
|
|||||||
@@ -104,6 +104,9 @@ main() {
|
|||||||
CONTACTS=$(cat .generated/contacts.json)
|
CONTACTS=$(cat .generated/contacts.json)
|
||||||
|
|
||||||
# 1. Claim-based deeplinks
|
# 1. Claim-based deeplinks
|
||||||
|
execute_deeplink "timesafari://claim/$(jq -r .claim_id <<< "$CLAIM_DETAILS")" \
|
||||||
|
"Testing claim view"
|
||||||
|
|
||||||
execute_deeplink "timesafari://claim-cert/$(jq -r .claim_id <<< "$CLAIM_DETAILS")" \
|
execute_deeplink "timesafari://claim-cert/$(jq -r .claim_id <<< "$CLAIM_DETAILS")" \
|
||||||
"Testing claim certificate view"
|
"Testing claim certificate view"
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user