forked from trent_larson/crowd-funder-for-time-pwa
Feat: integrate RegistrationNotice component into ProjectsView
- Replace custom onboarding button with RegistrationNotice component - Maintain v-else conditional rendering for unregistered users - Remove unused methods and imports related to custom registration flow - Use contextual message "To announce a project, get someone to onboard you." - Remove unnecessary wrapping div in RegistrationNotice Completes registration UI standardization across all main views.
This commit is contained in:
@@ -5,30 +5,28 @@ access advanced options. * * @author Matthew Raymer * @version 1.0.0 * @created
|
|||||||
2025-08-21T17:25:28-08:00 */
|
2025-08-21T17:25:28-08:00 */
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<div class="my-4">
|
<div
|
||||||
<div
|
id="noticeSomeoneMustRegisterYou"
|
||||||
id="noticeSomeoneMustRegisterYou"
|
class="bg-amber-200 text-amber-900 border-amber-500 border-dashed border text-center rounded-md overflow-hidden px-4 py-3 my-4"
|
||||||
class="bg-amber-200 text-amber-900 border-amber-500 border-dashed border text-center rounded-md overflow-hidden px-4 py-3"
|
>
|
||||||
>
|
<p class="mb-4">{{ message }}</p>
|
||||||
<p class="mb-4">{{ message }}</p>
|
<div class="grid grid-cols-1 gap-2 sm:flex sm:justify-center">
|
||||||
<div class="grid grid-cols-1 gap-2 sm:flex sm:justify-center">
|
<button
|
||||||
<button
|
class="inline-block text-md font-bold bg-gradient-to-b from-blue-400 to-blue-700 shadow-[inset_0_-1px_0_0_rgba(0,0,0,0.5)] text-white px-4 py-2 rounded-md"
|
||||||
class="inline-block text-md font-bold bg-gradient-to-b from-blue-400 to-blue-700 shadow-[inset_0_-1px_0_0_rgba(0,0,0,0.5)] text-white px-4 py-2 rounded-md"
|
@click="showNameThenIdDialog"
|
||||||
@click="showNameThenIdDialog"
|
>
|
||||||
>
|
Show them {{ passkeysEnabled ? "default" : "your" }} identifier info
|
||||||
Show them {{ passkeysEnabled ? "default" : "your" }} identifier info
|
</button>
|
||||||
</button>
|
<button
|
||||||
<button
|
class="inline-block text-md bg-gradient-to-b from-slate-400 to-slate-700 shadow-[inset_0_-1px_0_0_rgba(0,0,0,0.5)] text-white px-4 py-2 rounded-md"
|
||||||
class="inline-block text-md bg-gradient-to-b from-slate-400 to-slate-700 shadow-[inset_0_-1px_0_0_rgba(0,0,0,0.5)] text-white px-4 py-2 rounded-md"
|
@click="openAdvancedOptions"
|
||||||
@click="openAdvancedOptions"
|
>
|
||||||
>
|
See advanced options
|
||||||
See advanced options
|
</button>
|
||||||
</button>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
<UserNameDialog ref="userNameDialog" />
|
|
||||||
<ChoiceButtonDialog ref="choiceButtonDialog" />
|
|
||||||
</div>
|
</div>
|
||||||
|
<UserNameDialog ref="userNameDialog" />
|
||||||
|
<ChoiceButtonDialog ref="choiceButtonDialog" />
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
|
|||||||
@@ -216,15 +216,12 @@
|
|||||||
<font-awesome icon="plus" :class="plusIconClasses" />
|
<font-awesome icon="plus" :class="plusIconClasses" />
|
||||||
button. You'll never know until you try.
|
button. You'll never know until you try.
|
||||||
</div>
|
</div>
|
||||||
<div v-else>
|
<RegistrationNotice
|
||||||
<button
|
v-else
|
||||||
:class="onboardingButtonClasses"
|
:passkeys-enabled="PASSKEYS_ENABLED"
|
||||||
@click="showNameThenIdDialog()"
|
:given-name="givenName"
|
||||||
>
|
message="To announce a project, get someone to onboard you."
|
||||||
Get someone to onboard you.
|
/>
|
||||||
</button>
|
|
||||||
<UserNameDialog ref="userNameDialog" />
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
<ul id="listProjects" class="border-t border-slate-300">
|
<ul id="listProjects" class="border-t border-slate-300">
|
||||||
<li
|
<li
|
||||||
@@ -266,14 +263,14 @@ import { Component, Vue } from "vue-facing-decorator";
|
|||||||
import { Router } from "vue-router";
|
import { Router } from "vue-router";
|
||||||
// Capacitor import removed - using QRNavigationService instead
|
// Capacitor import removed - using QRNavigationService instead
|
||||||
|
|
||||||
import { NotificationIface } from "../constants/app";
|
import { NotificationIface, PASSKEYS_ENABLED } from "../constants/app";
|
||||||
import EntityIcon from "../components/EntityIcon.vue";
|
import EntityIcon from "../components/EntityIcon.vue";
|
||||||
import InfiniteScroll from "../components/InfiniteScroll.vue";
|
import InfiniteScroll from "../components/InfiniteScroll.vue";
|
||||||
import QuickNav from "../components/QuickNav.vue";
|
import QuickNav from "../components/QuickNav.vue";
|
||||||
import OnboardingDialog from "../components/OnboardingDialog.vue";
|
import OnboardingDialog from "../components/OnboardingDialog.vue";
|
||||||
import ProjectIcon from "../components/ProjectIcon.vue";
|
import ProjectIcon from "../components/ProjectIcon.vue";
|
||||||
import TopMessage from "../components/TopMessage.vue";
|
import TopMessage from "../components/TopMessage.vue";
|
||||||
import UserNameDialog from "../components/UserNameDialog.vue";
|
import RegistrationNotice from "../components/RegistrationNotice.vue";
|
||||||
import { Contact } from "../db/tables/contacts";
|
import { Contact } from "../db/tables/contacts";
|
||||||
import { didInfo, getHeaders, getPlanFromCache } from "../libs/endorserServer";
|
import { didInfo, getHeaders, getPlanFromCache } from "../libs/endorserServer";
|
||||||
import { OfferSummaryRecord, PlanData } from "../interfaces/records";
|
import { OfferSummaryRecord, PlanData } from "../interfaces/records";
|
||||||
@@ -281,14 +278,13 @@ import { OnboardPage, iconForUnitCode } from "../libs/util";
|
|||||||
import { logger } from "../utils/logger";
|
import { logger } from "../utils/logger";
|
||||||
import { PlatformServiceMixin } from "@/utils/PlatformServiceMixin";
|
import { PlatformServiceMixin } from "@/utils/PlatformServiceMixin";
|
||||||
import { createNotifyHelpers, TIMEOUTS } from "@/utils/notify";
|
import { createNotifyHelpers, TIMEOUTS } from "@/utils/notify";
|
||||||
import { QRNavigationService } from "@/services/QRNavigationService";
|
|
||||||
import {
|
import {
|
||||||
NOTIFY_NO_ACCOUNT_ERROR,
|
NOTIFY_NO_ACCOUNT_ERROR,
|
||||||
NOTIFY_PROJECT_LOAD_ERROR,
|
NOTIFY_PROJECT_LOAD_ERROR,
|
||||||
NOTIFY_PROJECT_INIT_ERROR,
|
NOTIFY_PROJECT_INIT_ERROR,
|
||||||
NOTIFY_OFFERS_LOAD_ERROR,
|
NOTIFY_OFFERS_LOAD_ERROR,
|
||||||
NOTIFY_OFFERS_FETCH_ERROR,
|
NOTIFY_OFFERS_FETCH_ERROR,
|
||||||
NOTIFY_CAMERA_SHARE_METHOD,
|
|
||||||
} from "@/constants/notifications";
|
} from "@/constants/notifications";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -318,7 +314,7 @@ import {
|
|||||||
OnboardingDialog,
|
OnboardingDialog,
|
||||||
ProjectIcon,
|
ProjectIcon,
|
||||||
TopMessage,
|
TopMessage,
|
||||||
UserNameDialog,
|
RegistrationNotice,
|
||||||
},
|
},
|
||||||
mixins: [PlatformServiceMixin],
|
mixins: [PlatformServiceMixin],
|
||||||
})
|
})
|
||||||
@@ -336,6 +332,7 @@ export default class ProjectsView extends Vue {
|
|||||||
givenName = "";
|
givenName = "";
|
||||||
isLoading = false;
|
isLoading = false;
|
||||||
isRegistered = false;
|
isRegistered = false;
|
||||||
|
readonly PASSKEYS_ENABLED: boolean = PASSKEYS_ENABLED;
|
||||||
|
|
||||||
// Data collections
|
// Data collections
|
||||||
offers: OfferSummaryRecord[] = [];
|
offers: OfferSummaryRecord[] = [];
|
||||||
@@ -624,39 +621,6 @@ export default class ProjectsView extends Vue {
|
|||||||
* Ensures user has provided their name before proceeding with contact sharing.
|
* Ensures user has provided their name before proceeding with contact sharing.
|
||||||
* Uses UserNameDialog component if name is not set.
|
* Uses UserNameDialog component if name is not set.
|
||||||
*/
|
*/
|
||||||
showNameThenIdDialog() {
|
|
||||||
if (!this.givenName) {
|
|
||||||
(this.$refs.userNameDialog as UserNameDialog).open(() => {
|
|
||||||
this.promptForShareMethod();
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
this.promptForShareMethod();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Prompts user to choose contact sharing method
|
|
||||||
*
|
|
||||||
* Presents modal dialog asking if users are nearby with cameras.
|
|
||||||
* Routes to appropriate sharing method based on user's choice:
|
|
||||||
* - QR code sharing for nearby users with cameras
|
|
||||||
* - Alternative sharing methods for remote users
|
|
||||||
*/
|
|
||||||
promptForShareMethod() {
|
|
||||||
this.$notify(
|
|
||||||
{
|
|
||||||
group: "modal",
|
|
||||||
type: "confirm",
|
|
||||||
title: NOTIFY_CAMERA_SHARE_METHOD.title,
|
|
||||||
text: NOTIFY_CAMERA_SHARE_METHOD.text,
|
|
||||||
onYes: () => this.handleQRCodeClick(),
|
|
||||||
onNo: () => this.$router.push({ name: "share-my-contact-info" }),
|
|
||||||
yesText: NOTIFY_CAMERA_SHARE_METHOD.yesText,
|
|
||||||
noText: NOTIFY_CAMERA_SHARE_METHOD.noText,
|
|
||||||
},
|
|
||||||
TIMEOUTS.MODAL,
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Computed properties for template logic streamlining
|
* Computed properties for template logic streamlining
|
||||||
@@ -722,14 +686,6 @@ export default class ProjectsView extends Vue {
|
|||||||
return "bg-green-600 text-white px-1.5 py-1 rounded-full";
|
return "bg-green-600 text-white px-1.5 py-1 rounded-full";
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* CSS class names for onboarding button
|
|
||||||
* @returns String with CSS classes for the onboarding button
|
|
||||||
*/
|
|
||||||
get onboardingButtonClasses() {
|
|
||||||
return "text-md font-bold bg-gradient-to-b from-blue-400 to-blue-700 shadow-[inset_0_-1px_0_0_rgba(0,0,0,0.5)] text-white mt-2 px-2 py-3 rounded-md";
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* CSS class names for project tab styling
|
* CSS class names for project tab styling
|
||||||
* @returns Object with CSS classes based on current tab selection
|
* @returns Object with CSS classes based on current tab selection
|
||||||
@@ -754,20 +710,6 @@ export default class ProjectsView extends Vue {
|
|||||||
* Utility methods
|
* Utility methods
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
|
||||||
* Handles QR code sharing functionality with platform detection
|
|
||||||
*
|
|
||||||
* Routes to appropriate QR code interface based on current platform:
|
|
||||||
* - Full QR scanner for native mobile platforms
|
|
||||||
* - Web-based QR interface for browser environments
|
|
||||||
*/
|
|
||||||
private handleQRCodeClick() {
|
|
||||||
const qrNavigationService = QRNavigationService.getInstance();
|
|
||||||
const route = qrNavigationService.getQRScannerRoute();
|
|
||||||
|
|
||||||
this.$router.push(route);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Legacy method compatibility
|
* Legacy method compatibility
|
||||||
* @deprecated Use computedOfferTabClassNames for backward compatibility
|
* @deprecated Use computedOfferTabClassNames for backward compatibility
|
||||||
|
|||||||
Reference in New Issue
Block a user