HomeWiki
HomeWiki
  1. Components
  • Back to home
  • 1. Themes
  • Layout
    • New Layout
    • Legacy Layout
  • Components
    • Announcement
    • Banner Carousel
    • Banner With Products Carousel
    • Blog Category List
    • Blog List
    • Brand List
    • Brands Carousel
    • Breadcrumb
    • Call To Action
    • Cart
    • Categories List
    • Change Password
    • Checkout
    • Cookie Manager
    • Filter list
    • Footer
    • Forgot Password
    • Form
    • Hero Carousel
    • Icon Block
    • Invitation
    • Last Visited Products
    • Layout
    • Login
    • Map
    • Nav Bar
    • Offer
    • Product Attachments
    • Product Attributes
    • Product Documentation
    • Product Expected
    • Product Modal
    • Products Block
    • Products Carousel
    • Product Single
    • Profile
    • Quote
    • Register
    • Related Products
    • Search
    • Stores
    • Subscribe Newsletter
    • Text with Image
    • Top Bar
    • Video
  • Reusables
    • Getting Started
  • Assets
    • Getting Started
  • SDK
    • Products
      • _findProductsByCategory
      • _findProductsByIds
      • _findProductsByTitle
      • _findProductsByFilter
      • _findProductsByCriteria
      • _findProductsAndCalculate
      • _findProductsThenCalculate
      • _getProductAttributeSet
      • _setLastVisited
    • Categories
      • _findCategoryTreeById
      • _findCategoriesByIds
      • _findCategoryByAlias
      • _findCategoryTreeByAlias
      • _getCategoryContent
    • Collections
      • _getCollectionContent
      • _findCollectionsByIds
      • _findCollectionsByIdsThenCalculate
    • Brands
      • _getBrandContent
      • _findBrandsByIds
    • Cart
      • _addToCartMulti
      • _addToCart
      • _setCart
      • _clearCart
      • _setCartListener
      • _removeFromCart
      • _calculateCart
    • Checkout
      • _startCheckout
      • _updateCheckout
      • _completeCheckout
    • Shopping Lists
      • _getShoppingLists
      • _updateShoppingList
      • _createShoppingList
      • _deleteShoppingList
      • _getShoppingListByAlias
    • Navigation
      • _getFooterMenu
      • _getHeaderMenu
    • Users
      • _getUserById
    • Utils
      • _calculateCurrency
      • _getCurrencySymbol
      • _getCulture
      • _subscribeToNewsletter
      • _findUnitsByIds
  • Vs Code
    • Getting Started
  1. Components

Invitation

Documentation: Invitation Component#

The Invitation Component is a Vue.js component designed to handle user invitations with a registration form. It allows users to input their first name, last name, password, and confirm their password, while handling validation and error reporting. This component is particularly useful for scenarios where users need to register or set a new password through an invitation link.

Overview#

The Invitation Component provides a form for users to complete their registration or password reset process. It includes fields for personal information and password creation, along with client-side validation to ensure all input meets specified criteria. The component also manages form submission and error handling, displaying appropriate messages based on user input and server responses.

Model Documentation#

The model object is used to configure the Invitation Component. It provides dynamic text and error messages for the form based on user input and validation results.
Model Structure#
id: String
A unique identifier for the component's root element, used to set the id attribute.
cssClass: String
Optional CSS class(es) for additional styling of the component.
Example Model#
{
  "id": "invitation-form",
  "cssClass": "invitation-form",
}

Component Structure#

The Invitation Component includes:
1.
Form Header: Displays the title of the form (Invitation).
2.
Form Fields: Collects user information including first name, last name, password, confirm password, and email.
3.
Validation Messages: Provides feedback for form validation errors.
4.
Submit Button: Submits the form and triggers the validation and registration process.

HTML Template#

The HTML template defines the layout and structure of the component:

JavaScript#

The JavaScript code handles form logic, validation, and submission:

Explanation#

Data Handling: The component manages user input and validation states with Vue.js data properties.
Validation: Custom methods ensure the password meets security policies and that all fields are correctly filled out. Errors are flagged and displayed if validation fails.
Form Submission: Upon submission, the component checks for validation errors, makes an API request to register the user, and handles responses including errors and successful registrations.
Email Extraction: The component retrieves the email from the URL, which is encoded in Base64 and decoded for use.

Usage#

To integrate the Invitation Component into a Vue.js application:
1.
Include the Component:
Register invitationdefault in your Vue app.
2.
Provide the Model:
Pass a configuration object to the component to define error messages and other dynamic content.
3.
Initialize the Component:
The component automatically handles form setup, validation, and submission based on user input and server responses.
4.
Customize as Needed:
Adjust the model and styles to fit your application's design and error messaging requirements.
Previous
Icon Block
Next
Last Visited Products
Built with