Git Product home page Git Product logo

pegasystems / constellation-ui-gallery Goto Github PK

View Code? Open in Web Editor NEW
29.0 11.0 18.0 10.74 MB

This open-source repository provides a collection of ready-to-use and customizable Constellation DX components. Use this resource to gain inspiration, best practices, and a solid foundation for implementing custom components.

Home Page: https://pegasystems.github.io/constellation-ui-gallery/

License: Apache License 2.0

TypeScript 94.20% MDX 5.36% HTML 0.28% JavaScript 0.16%
constellation user-interface

constellation-ui-gallery's Introduction

Constellation DX Components UI Gallery

Constellation's flexible architecture empowers advanced users (professional front-end developers with ReactJS and web technology expertise) to extend the platform. You can achieve this by programmatically combining core Constellation presentational components and leveraging the Constellation DX API to build custom components, known as "Constellation DX components."

This gallery provides a collection of ready-to-use and customizable component. Explore them directly or delve into the source code for deeper understanding. Use this resource to gain inspiration, best practices, and a solid foundation for implementing custom components.

These components have been tested on Pega 23.1 and might not run on other versions of the Pega Platform - For other versions, the recommendation is to download the supported version of the Constellation DX Component builder package @pega/custom-dx-components@XXXX supported by your Pega Platform version and create new components using the command line utility 'npm run create' and then copy the code. You will likely need to modify / update the code, especially if there are CSS selectors. At some point, the project will support new version of the gallery using branches and versions.

A complete demonstration of these Constellation DX components is available at pegasystems.github.io/constellation-ui-gallery

Pre-build versions of these components is available as a RAP file that you can import into your Pega application - see github.com/pegasystems/constellation-ui-gallery/releases

For developers

To build and compile the application - use the following commands:

Tools to install

Install npm from nodejs.org

You should have the following versions installed: System node version 18.x and npm version 8.x.

If you already have VS Code and Docker installed, you can click here to get started. Clicking these links will cause VS Code to automatically install the Dev Containers extension if needed, clone the source code into a container volume, and spin up a dev container for use.

For more details, see docs.pega.com

Note: Make sure to use git clone [email protected]:pegasystems/constellation-ui-gallery.git to download the source code of this repository instead of using the download option. If you download the code, you will not be able to publish the components and you will see the error 'Git needs to be installed' even if you have the git executable installed. This error is generated because you are missing the .git folder. If you face this issue, you can type git init to create the missing folder.

Project setup

npm install

Storybook

npm run start

Linting

Make sure to install the recommended VS Code extensions. Before checking code, make sure that no error are reported:

npm run lint

To fix some of the issues:

npm run fix

Unit testing

For unit test results, you can run:

npm run test

For unit test coverage, you can run:

npm run coverage

The coverage report index.html will be in the 'coverage' folder

Compiles and minifies for production

npm run buildAllComponents

Publish to a Pega Platform

Install the 'keys' folder provided by the Constellation DX Component builder package and edit the tasks.config.json file with your rulesetName, rulesetVersion, server URL, clientID, user and password

npm run authenticate

Once the authentication is completed - you can publish by running

npm run publishAll

If you are having issues deploying the changes, review the documentation docs.pega.com constellation DX component CLI references

constellation-ui-gallery's People

Contributors

cpmotion avatar dependabot[bot] avatar feenr avatar iglep avatar jeankhawand avatar niallriddell avatar ricmars avatar vijayjangid avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

constellation-ui-gallery's Issues

Component grouping for enhanced navigation and discovery

Given the substantial number of components now present in the repository, organizing them into groups would enhance accessibility and discoverability. Given that the components are primarily categorized into three types: Field, Layout, and Widget, we propose creating these three as top-level category folders and relocating the components accordingly.

Here is the list of components for each category:

Field

Component Name Type
Pega_Extensions_ActionableButton Field
Pega_Extensions_CaseReference Field
Pega_Extensions_CheckboxTrigger Field
Pega_Extensions_MaskedInput Field
Pega_Extensions_PasswordInput Field
Pega_Extensions_QRCode Field
Pega_Extensions_Scheduler Field
Pega_Extensions_SignatureCapture Field

Template

Component Name Type
Pega_Extensions_FieldGroupAsRow Template
Pega_Extensions_FormFullWidth Template
Pega_Extensions_RatingLayout Template

Widget

Component Name Type
Pega_Extensions_Banner Widget
Pega_Extensions_Calendar Widget
Pega_Extensions_CardGallery Widget
Pega_Extensions_CaseLauncher Widget
Pega_Extensions_ChatGenAI Widget
Pega_Extensions_KanbanBoard Widget
Pega_Extensions_NetworkDiagram Widget
Pega_Extensions_Shortcuts Widget
Pega_Extensions_UtilityList Widget

Does anyone anticipate encountering any difficulties with this restructuring?
NOTE: We have the similar grouping in storybook though!

cc @ricmars @niallriddell

Gantt chart component

The goal is to represent a list of data objects in a Gantt chart along with there dependencies. The objects could be cases or data objects.

Add unit tests based on the story

Right now the testing is pretty basic and just opens each story and check that no error is reported
We should extend the functionality by added a couple of unit tests for each story using https://storybook.js.org/docs/writing-tests/stories-in-unit-tests

the unit test should switch some of the props and check the outcome - it should leverage the same mock and infrastructure used in the story already.

showing code coverage would be great -

This should be run in the pipeline on every merge - see existing github action

Implement a Kanban or Task board

Similar to the Calendar component, I would like to represent a list of cases or data objects in a Kanban view where a status property will be used to group the objects into different columns. Using drag and drop or an action menu, I should be able to move the object from one status to the other.

Goal of this work is to identify a library that is accessible and does not rely only on drag and drop to move the cards inside the board. The UI should be able to take all the available height or support a fixed height. The list of available status will likely need to be passed as parameter

Actionable button parameter "value" can not be set leading to error "Resource not found"

When i configure the Actionable Button, i dont get the option to specify the pzInsKey. When i only specify the flowaction I get the error "Resource not found"

Documentation:
image

Design time configuration:
image

Error at runtime:
{
"errorClassification": "Resource not found",
"localizedValue": "The resource cannot be found.",
"errorDetails": [
{
"message": "Error_Case_Not_Found",
"erroneousInputOutputFieldInPage": "",
"erroneousInputOutputIdentifier": "",
"errorClassification": "",
"localizedValue": "Case not found for the given parameter ID",
"messageParameters": []
}
]
}

Radio button within CompareTable does not announce column heading as contextual label.

Issue

Radio button used for selecting a column in compare table does not announce column heading as contextual label.
Assistive technology used: Mac VoiceOver
compare-table-radio-accessibility

Steps to reproduce

  1. Press tab to focus on first select radio button in compare table.
  2. Observe screen reader announcement
  3. Screen reader announces
    Select, selected, radio button, 1 of 3
  4. Press 'right arrow' and the focus moves to next radio button in column 2. The announcement changes to
    Select, selected, radio button, 2 of 3
  5. As obsereved in step 3 and 4, only the Radio button label 'Select' is announced with no context about the column header in the table. This makes it inaccessible and difficult to figure out which item is being selected.

Signature component style issue

  1. Signature component buttons have customs style override, should we not just use OOTB button style and default padding within the container to avoid buttons touching the container border? (unless it's a design choice)
  2. The current design have focus ring bleed issue as shown in attached screenshot below.
    Screenshot 2024-02-26 at 10 51 03 PM

Issues With Dynamic Hierarchical Form Template

Please find below issues for Dynamic Hierarchical Form Template.

  1. Once we delete option in Check box combo, it is not getting populated again in the auto complete
  2. Property message is not displaying on the property.

Step to reproduce for Issue 1:

  1. We have imported ConstellationUIGallery:01-01 for using Dynamic Hierarchical Form Template
  2. Created a view using Dynamic Hierarchical Form Template
  3. Configured all details
  4. Once we delete option in Check box combo, it is not getting populated again in the auto complete

Step to reproduce for Issue 2:

  1. Setting error message on some property in the tab, message is not getting populated on the proper

Dynamic Hierarchical Form Template Issue.docx

Fix theme usage in all the components

The components should be using the theme and inheriting some of the color from the theme used by the application

The compare table, network diagram are the ones that have a lot of custom styles and should be converted to use the theme

CompareTable issues related to missing Theme tokens, HTML semantics and accessibility

CompareTable component is currently implemented using HTML<table> tags and hardcoded styles for colors, spacing, borders etc, missing HTML5 table semantics causing accessiblity concerns.
examples:


Question:
For the spreadsheet display format we could achieve the UX using OOTB Table component as well. Is there any specific reason to not use OOTB Table, any challenges in particular?

Suggestion:
OOTB Table component supports column renderers and could be used to render Radio buttons within table cells. We can also easily align column data left | center | right as needed. This OOTB component does takes care of proper HTML table semantics along with accessibility.

Here are the screenshots of OOTB Table achieving similar results.

Current implementation
custom-table

Using OOTB Table
cosmos-table

OOTB Table Limitations:

  1. It doesn't support table body cells to be rendered as th. It renders every cell as td implicitely.
  2. Heading is aligned to left always. Although this can be overridden in Styles if need be.
  3. Cannot be used in complex case. i.e. displayFormat = 'financial-report'

@ricmars / @niallriddell Please suggest should we replace the implementation with OOTB Table or fix the current code to use Theme tokens, Table semantics and accessibility guidelines.

Tree List component

While it is possible to achieve some tree list representation using table grouping, this approach requires flattening the data structure and does not guarantee the order of the nesting.

The goal of this component is to be able to take a recursive data page that has embedded list and represent the data in a Tree list view - Ability to support row level action would be great but at a minimum should render pyID as link. Support for column filtering, search can also be considered.

Fix hardcoded CardDetails viewname in Kanban utils

2 places the viewname is hardcode.


meta: fetchViewResources('CardDetails', getPConnect(), classname),

the viewname is coming as a prop to the component: detailsViewName so this should be used accordingly.

PS: identified these while working on Gantt compnonent, fixed there as part of this comment

UtilityList code review

Missing effect dependency: secondaryFieldTypes should be added as dependency. The list is not updating when field types are changed alone.

}, [dataPage, primaryField, secondaryFields]);

Redundent check: item.pxObjClass && item.pyID can be removed

item.pxObjClass && item.pyID && linkURL ? (

HeadingTag should be used "h3" for utility summary lists we are using h3 in other places (Attachments, Stakeholders etc). Consider passing prop headingTag='h3'

Issues faced with @pega/custom-dx-components

Hello,

I'm currently facing a few issues with the package https://www.npmjs.com/package/@pega/custom-dx-components which is used in this repository constellation-ui-gallery.

  1. When executing the command npm run promoteWebPack, it uncomments a line in node_modules/@pega/custom-dx-components/src/tasks/bundle/builder/index.js to point to the new webpack.config.js file placed in the project's root path.
    However, when installing or updating an npm package, the whole node_modules directory is refreshed and the changes made by promoteWebPack are lost
    image

  2. I tried to pass rulesetName, rulesetVersion and dBuild as arguments to npm run publishAll but it didn't work.
    When having a look at the source code of custom-dx-components, I found the condition causing this issue.
    In node_modules/@pega/custom-dx-components/src/tasks/publish-all/index.js, at line 79, there is a condition checking if options.params.length >= 7 but there is only a total of 6 params including the 3 I'm manually passing.
    BTW, there is no reference to options.params[6] in this file, which means checking for a length of 7 is not even accurate.
    image
    I then tried to pass a 4th argument (counting as the 7th) but I encountered another issue.
    The whole process started without asking any question but nothing was sent to Pega.
    FYI, when running npm run publishAll and answering questions, the components are sent to Pega and the message "Success : Component successfully created in ruleset Demo:01-01-01" is displayed.
    Again, I started searching in the source code and found this in node_modules/@pega/custom-dx-components/src/tasks/publish-all/index.js
    image
    The boolean variable doFetch is then passed as an argument to the function publishComponentToServer which is then calling Pega only if doFetch is true
    image
    So, if I pass only 3 arguments like npm run publishAll Demo 01-01-01 N, then I still have to answer the questions if it's a dev build and what is the ruleset name and version.
    And if I pass 4 arguments like npm run publishAll Demo 01-01-01 N dummyText, then I don't have to answer the previous questions but during the task "Publish Component", nothing is sent to Pega.

Fix RTL support

RTL has some issues for a couple of components like the network diagram and the signature capture

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.