Learn About Components
Essential knowledge about Components
UX Configuration - Common Concepts
Essential knowledgeCore knowledge to understand Fluent CommerceSome common types and conventions are used across many component definitions. These items are not directly configurable in the manifest but will often be referenced in other component definitions that use them.- The Mystique manifest configures icons, cards, and template strings. Icons come from React Icons.
- Cards have common fields, and template strings allow dynamic values. Dynamic attributes (standard, image, component) offer flexibility based on conditions.
- A selection of helper functions are also available to control and transform these values as required, for example, number, logic, i18n, array, date, and string functions.
- Additional options like TextOptions and ImageOptions provide styling choices.
ICP, Qualification Criteria and Additional Use Cases
Essential knowledgeCore knowledge to understand Fluent CommerceThe article provides a comprehensive guide to identifying the Ideal Customer Profile (ICP) for an Order Management System (OMS), highlighting key criteria and red flags to ensure successful implementation. It also explores Fluent OMS use cases, showcasing its capabilities in order capture, fulfillment, tracking, promising, shipping, and inventory management.- Ideal Customer Profile (ICP) based on specific industries, company maturity, and high order volumes
- Poor fit indicators, such as outdated legacy infrastructure or a lack of executive buy in
- Fast Qualification Framework to rapidly assess a prospect's Budget, Systems, Volume, and Channels.
Introduction to the Component Library
Essential knowledgeCore knowledge to understand Fluent CommerceThis lesson introduces the OMX Component Library, a collection of pre-built, configurable UI components designed for use in Fluent Web Apps. Unlike standard UI components, these components are specifically built to interact natively with the Fluent Platform. We'll explore the various categories of components within the library, including Foundation, Content, Layout, Interaction, and Field Components, and understand their distinct roles in building user interfaces.- Fluent Platform Integration: OMX Components seamlessly integrate with the Fluent Platform.
- Component Categories: The library includes Foundation, Content, Layout, Interaction, and Field Components, each with distinct roles.
- Component Hierarchy: Content and Layout components are typically children of Foundation Components.
- Mobile Responsiveness: Components should be designed with mobile responsiveness in mind.
- Interaction Components: These enable user interaction with the application.
- Field Components: Automatically rendered form elements, essential for complex workflow input, are not configured via the manifest.
Unit Testing Custom Components
Essential knowledgeCore knowledge to understand Fluent CommerceThis lesson covers the process of unit testing custom components using the tools provided within the Component SDK: Jest and React's test renderer. We'll walk through the steps of creating mock objects for dependencies (authentication, data, attributes), arranging the test environment, acting by rendering the component with the mocks, and asserting the output using snapshot testing. This process ensures the reliability and correctness of your custom components.- Testing Framework: The SDK includes Jest and React's test renderer for unit testing.
- Mock Objects: Mock objects are created for external dependencies like authentication (
`useAuth`), data from the page query, and dynamic attributes from the manifest. - Arrange, Act, Assert: The testing process follows the standard Arrange, Act, Assert pattern.
- Arrange: Mocks are set up and configured.
- Act: The component is rendered with the mock data.
- Assert: The rendered output is compared against a snapshot.
- Snapshot Testing: Jest's snapshot feature is used to compare the component's output to a previously saved snapshot, ensuring consistency.
- Testable Components: Unit tests help ensure the reliability and maintainability of custom components.
Enhance Your Custom Fields: Leveraging Existing Components from the Registry
Essential knowledgeCore knowledge to understand Fluent CommerceThis lesson details how to enhance custom form fields by adding structure, styling, and interactive controls. We'll focus on improving the user experience and data capture capabilities of our custom field component. This involves using Material-UI for styling, organizing the field's layout, and integrating pre-built form controls from the component library, such as the `QuantitySelector`. We'll also cover best practices like using the `useEffect` hook for debugging.- Structure and Layout: Learn how to structure and organize the elements within your custom form field for optimal presentation.
- Styling with Material-UI: Use Material-UI's styling capabilities (e.g., makeStyles) to style your custom field and maintain design consistency.
- Form Control Integration: Integrate pre-built form controls, like the QuantitySelector, to efficiently capture specific data types (e.g., integers for quantity).
- Component Registry Retrieval: Learn how to retrieve and use existing components from the component registry (e.g., the QuantitySelector using its alias "number").
- State Management: Manage the state of form inputs using React's state mechanisms.
- Debugging with
`useEffect`: Use the `useEffect` hook to debug and verify the behavior and output of your custom field.
Building Custom Components with the Component SDK
Essential knowledgeCore knowledge to understand Fluent CommerceThis lesson dives into the practical application of the Component SDK, focusing on how to build custom components for OMX Web Apps. We'll explore the different types of custom components you can create, the powerful hooks available for interacting with the Fluent platform, and the utility components that streamline development and ensure consistency. We'll also touch on the crucial concept of component registries.- Types of Custom Components: The Component SDK enables the creation of custom view components (for page content) and custom field components (for workflow user actions), allowing developers to tailor interfaces to specific needs.
- Hooks for OMX Integration: Fluent-specific React hooks (e.g.,
`useAuth`, `useI18n`, `useQuery`) provide easy access to platform functionalities like authentication, localization, and API interaction, simplifying complex tasks. - Utility Components for Consistency: The SDK offers utility components (e.g., Card, Loading, Drawers) that serve as building blocks for custom components, ensuring a consistent look and feel, theme responsiveness, and mobile compatibility.
- Component Registries: Custom components must be registered with the appropriate registry (Component, Field, or Template) before they can be used in OMX Web Apps, making them discoverable and usable within the framework.
Creating Custom Template Helpers
Essential knowledgeCore knowledge to understand Fluent CommerceThis lesson explores the creation and registration of custom template helpers within the Component SDK. Template helpers are powerful utilities that can be used within Manifest documents for tasks like styling, formatting, and calculations. We'll demonstrate how to create a custom template helper, in this case, one that bolds entity references, showcasing how to leverage the `TemplateRegistry` and its utility methods for generating formatted HTML.- Template Helpers: Template helpers are reusable functions that can be called within Manifest documents to perform various operations.
- Use Cases: Template helpers can be used for styling, formatting, calculations, and other data transformations.
`TemplateRegistry`: The `TemplateRegistry` is used to register custom template helpers, making them available for use in Manifests.- HTML Formatting: The lesson demonstrates creating a template helper that bolds entity references using
`TemplateRegistry` utility methods for formatted HTML generation. - Customizability: Custom template helpers extend the functionality of Manifests, allowing for greater flexibility and control over data presentation.
Extending Forms with Custom Field Components
Essential knowledgeCore knowledge to understand Fluent CommerceThis lesson introduces the concept of custom form fields within the UX Framework. While standard form fields are automatically generated based on data types, developers can create custom field components to handle more complex data structures or enhance the user experience for specific scenarios, such as workflow user actions, GraphQL mutations, and list filters. In our client scenario, we'll focus on building a custom form field to capture stock reservation details, which requires a JSON object containing `locationRef` and `quantity`.- Form Field Generation: The UX Framework automatically generates forms based on expected data types.
- Custom Field Components: Developers can create custom field components to handle complex data types or improve UX.
- Extending Scenarios: Custom field components can be used with workflow user actions, GraphQL mutations, and list filters.
- JSON Data Capture: This lesson's focus is on creating a custom field component to capture a JSON object for stock reservation details, containing locationRef and quantity fields.
- Client Scenario: The need for a custom form field arises from the client's requirement to capture stock reservations, which involves a specific JSON structure.
Users Configuration Overview
Essential knowledgeCore knowledge to understand Fluent CommerceOMS Webapp's Users List page allows users to efficiently search and view existing users using a versatile filter component. The Users table provides essential user details, with a clickable Username link leading to a detailed User Details page displaying user information. The paging control at the bottom ensures easy entry management with customizable rows per page and intuitive navigation.`Type`: Understand the different types of users; ADMIN, RETAILER, API, and AGENT- User Status: Be aware of the user status options, ACTIVE and INACTIVE, which reflect the user's current accessibility.
- Filtering Users: Utilize the filter component to efficiently search for users based on various criteria like username, status, creation date, and type.
- Roles and Permissions: Assign roles to users to manage permissions within the system, ensuring each user has the appropriate level of access.
- Paging Control: Utilize the paging controls at the bottom of the Users table to navigate between pages and manage the number of entries displayed per page, with options for 10, 25, or 100 entries.
- Deprecation Notice: Be aware that certain user types such as AGENT, SUPPORT, and others have been deprecated and should not be used for new users.
Escaping / unescaping of values in UX Framework
Essential knowledgeCore knowledge to understand Fluent CommerceCharacter escaping and unescaping are crucial for data integrity and security in UX frameworks. This document focuses on the Mustache.js templating engine, which escapes HTML by default to prevent XSS attacks. When special characters like ampersands need to be displayed, the framework offers unescaping methods to ensure correct and secure rendering.This overview highlights the significance of proper value escaping and the techniques for accurately rendering special characters within the UX framework.- Mustache.js Templating: The UX framework utilizes mustache.js for templating, which automatically escapes HTML characters. This is important for preventing XSS (Cross-Site Scripting) attacks and ensuring data is displayed as intended.
- Unescaping Variables: To display special characters properly, such as ampersands, you must unescape variables using triple mustaches, e.g.,
`{{{variable}}}`, or the `&` symbol in the variable tag, e.g., `{{&variable}}`. - Correct Display of Values: Escaping or unescaping variables correctly is crucial for the accurate representation of data within the UX. This ensures that special characters are rendered as intended, maintaining the integrity of the information displayed to users.