diff --git a/src/components/RegistrationNotice.vue b/src/components/RegistrationNotice.vue index c9faffea..19a8aa5d 100644 --- a/src/components/RegistrationNotice.vue +++ b/src/components/RegistrationNotice.vue @@ -1,33 +1,154 @@ +/** * @file RegistrationNotice.vue * @description Reusable component for +displaying user registration status and related actions. * Shows registration +notice when user is not registered, with options to show identifier info * or +access advanced options. * * @author Matthew Raymer * @version 1.0.0 * @created +2025-08-21T17:25:28-08:00 */ + diff --git a/src/views/AccountViewView.vue b/src/views/AccountViewView.vue index eb99665c..aca100ff 100644 --- a/src/views/AccountViewView.vue +++ b/src/views/AccountViewView.vue @@ -55,9 +55,10 @@ @@ -781,6 +782,7 @@ import { DEFAULT_PUSH_SERVER, IMAGE_TYPE_PROFILE, NotificationIface, + PASSKEYS_ENABLED, } from "../constants/app"; import { Contact } from "../db/tables/contacts"; import { @@ -851,6 +853,7 @@ export default class AccountViewView extends Vue { readonly DEFAULT_PUSH_SERVER: string = DEFAULT_PUSH_SERVER; readonly DEFAULT_IMAGE_API_SERVER: string = DEFAULT_IMAGE_API_SERVER; readonly DEFAULT_PARTNER_API_SERVER: string = DEFAULT_PARTNER_API_SERVER; + readonly PASSKEYS_ENABLED: boolean = PASSKEYS_ENABLED; // Identity and settings properties activeDid: string = ""; @@ -1789,20 +1792,6 @@ export default class AccountViewView extends Vue { this.doCopyTwoSecRedo(did, () => (this.showDidCopy = !this.showDidCopy)); } - get showRegistrationNotice(): boolean { - // Show the notice if not registered and any other conditions you want - return !this.isRegistered; - } - - onShareInfo() { - // Navigate to QR code sharing page - mobile uses full scan, web uses basic - if (Capacitor.isNativePlatform()) { - this.$router.push({ name: "contact-qr-scan-full" }); - } else { - this.$router.push({ name: "contact-qr" }); - } - } - onRecheckLimits() { this.checkLimits(); } diff --git a/src/views/HomeView.vue b/src/views/HomeView.vue index 4aa3523d..fe6fbc28 100644 --- a/src/views/HomeView.vue +++ b/src/views/HomeView.vue @@ -86,33 +86,14 @@ Raymer * @version 1.0.0 */ Identity creation is now handled by router navigation guard. -->
-
- To share, someone must register you. -
- -
- -
- - See advanced options - -
-
+ :passkeys-enabled="PASSKEYS_ENABLED" + :given-name="givenName" + message="To share, someone must register you." + /> -
+
@@ -252,8 +233,6 @@ Raymer * @version 1.0.0 */
- - @@ -261,7 +240,6 @@ Raymer * @version 1.0.0 */ import { UAParser } from "ua-parser-js"; import { Component, Vue } from "vue-facing-decorator"; import { Router } from "vue-router"; -import { Capacitor } from "@capacitor/core"; //import App from "../App.vue"; import EntityIcon from "../components/EntityIcon.vue"; @@ -272,10 +250,9 @@ import InfiniteScroll from "../components/InfiniteScroll.vue"; import OnboardingDialog from "../components/OnboardingDialog.vue"; import QuickNav from "../components/QuickNav.vue"; import TopMessage from "../components/TopMessage.vue"; -import UserNameDialog from "../components/UserNameDialog.vue"; -import ChoiceButtonDialog from "../components/ChoiceButtonDialog.vue"; import ImageViewer from "../components/ImageViewer.vue"; import ActivityListItem from "../components/ActivityListItem.vue"; +import RegistrationNotice from "../components/RegistrationNotice.vue"; import { AppString, NotificationIface, @@ -383,12 +360,11 @@ interface FeedError { GiftedPrompts, InfiniteScroll, OnboardingDialog, - ChoiceButtonDialog, QuickNav, TopMessage, - UserNameDialog, ImageViewer, ActivityListItem, + RegistrationNotice, }, mixins: [PlatformServiceMixin], }) @@ -1644,67 +1620,6 @@ export default class HomeView extends Vue { return known ? "text-slate-500" : "text-slate-100"; } - /** - * Shows name input dialog if needed - * - * @public - * @callGraph - * Called by: Template - * Calls: - * - UserNameDialog.open() - * - promptForShareMethod() - * - * @chain - * Template -> showNameThenIdDialog() -> promptForShareMethod() - * - * @requires - * - this.$refs.userNameDialog - * - this.givenName - */ - showNameThenIdDialog() { - if (!this.givenName) { - (this.$refs.userNameDialog as UserNameDialog).open(() => { - this.promptForShareMethod(); - }); - } else { - this.promptForShareMethod(); - } - } - - /** - * Shows dialog for sharing method selection - * - * @internal - * @callGraph - * Called by: showNameThenIdDialog() - * Calls: ChoiceButtonDialog.open() - * - * @chain - * Template -> showNameThenIdDialog() -> promptForShareMethod() - * - * @requires - * - this.$refs.choiceButtonDialog - * - this.$router - */ - promptForShareMethod() { - (this.$refs.choiceButtonDialog as ChoiceButtonDialog).open({ - title: "How can you share your info?", - text: "", - option1Text: "We are in a meeting together", - option2Text: "We are nearby with cameras", - option3Text: "We will share some other way", - onOption1: () => { - this.$router.push({ name: "onboard-meeting-list" }); - }, - onOption2: () => { - this.handleQRCodeClick(); - }, - onOption3: () => { - this.$router.push({ name: "share-my-contact-info" }); - }, - }); - } - /** * Opens image viewer dialog * @@ -1717,14 +1632,6 @@ export default class HomeView extends Vue { this.isImageViewerOpen = true; } - private handleQRCodeClick() { - if (Capacitor.isNativePlatform()) { - this.$router.push({ name: "contact-qr-scan-full" }); - } else { - this.$router.push({ name: "contact-qr" }); - } - } - openPersonDialog( giver?: GiverReceiverInputInfo | "Unnamed", prompt?: string, diff --git a/src/views/ProjectsView.vue b/src/views/ProjectsView.vue index acc6e467..e8709210 100644 --- a/src/views/ProjectsView.vue +++ b/src/views/ProjectsView.vue @@ -216,15 +216,12 @@ button. You'll never know until you try.
-
- - -
+
  • { - 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 @@ -722,14 +686,6 @@ export default class ProjectsView extends Vue { 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 * @returns Object with CSS classes based on current tab selection @@ -754,20 +710,6 @@ export default class ProjectsView extends Vue { * 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 * @deprecated Use computedOfferTabClassNames for backward compatibility diff --git a/test-playwright/00-noid-tests.spec.ts b/test-playwright/00-noid-tests.spec.ts index 5218c330..e4b874af 100644 --- a/test-playwright/00-noid-tests.spec.ts +++ b/test-playwright/00-noid-tests.spec.ts @@ -37,7 +37,7 @@ * Key Selectors: * - Activity list: 'ul#listLatestActivity li' * - Discover list: 'ul#listDiscoverResults li' - * - Account notices: '#noticeBeforeShare', '#noticeBeforeAnnounce' + * - Account notices: '#noticeBeforeShare', '#noticeSomeoneMustRegisterYou' * - Identity details: '#sectionIdentityDetails code.truncate' * * State Verification: @@ -99,7 +99,7 @@ test('Check no-ID messaging in account', async ({ page }) => { await page.goto('./account'); // Check 'a friend needs to register you' notice - await expect(page.locator('#noticeBeforeAnnounce')).toBeVisible(); + await expect(page.locator('#noticeSomeoneMustRegisterYou')).toBeVisible(); }); test('Check ability to share contact', async ({ page }) => {