Skip to content

medigy/ux-react-lhc-form

Repository files navigation

ux-react-lhc-form

React component for listing LHC form from GitLab

Installation


Create .npmrc file in the project root and add the following GitHub package registry code in the file.

   @medigy:registry=https://npm.pkg.github.com

Then, Install from the command line:

    npm install @medigy/ux-react-lhc-form

OR

Install via package.json:

    "@medigy/ux-react-lhc-form": "^1.0.1"

To list the LHC Form:

Import the following library and styles in your page

    import * as LHCForm from '@medigy/ux-react-lhc-form';
    import '@medigy/ux-react-lhc-form/dist/index.css';

Declare a variable in your component like the following

const lhcFormRef: React.RefObject<LHCForm.LHCFormComponent> = React.createRef();

Then include the component in your render method like the following

    <LHCForm.LHCFormComponent
      ref={lhcFormRef}
      LHCFormPath={apiURL}
      accessToken={accessToken}
    />

Props Configuration

Key Value Type
LHCFormPath GitLab API URL for the LHC Form String
accessToken GitLab personal access token String

To get the LHC Form data:

const formData:| Array<LHCForm.ILHCFormData>| undefined = lhcFormRef.current?.getLHCFormData();

About

React component for listing LHC form from GitLab

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages