Skip to content
This repository has been archived by the owner on Feb 26, 2024. It is now read-only.

HealthByRo/survey-form

Repository files navigation

IMAGE

survey-form

survey-form module is a module with SurveyForm container which render survey form based on schema fetched from API based on surveyId property.

IMAGE

Install survey-form in your project

  1. Run yarn add https://github.com/HealthByRo/survey-form
  2. Add to your project reducers and sagas from redux-connect-backend module. Click here for further information

Usage

Usage of the survey form is very easy. You need to import SurveyForm component and pass to it surveyId property.

import SurveyForm from 'survey-form';

<SurveyForm surveyId={105} />

Actions

You can import and watch following action types in your reducer or saga.

  • FORM_SAVE_SUCCESS_ACTION - is dispatched after the form has been successfully saved
  • FORM_SAVE_FAILED_ACTION - is dispatched after the form has been failed saved

Contribution

  1. Run yarn global add getstorybook to instal StoryBook.
  2. Clone this repo using git clone git@github.com:HealthByRo/survey-form.git
  3. Run cd survey-form/
  4. Run yarn to install dependencies.
  5. Run yarn run storybook to start StoryBook.

Link local package to your project

  1. Run cd survey-form/
  2. Run yarn link to create a symbolic link from a global folder to the survey-form/ folder.
  3. Run cd your-project-dir
  4. Run yarn link survey-form

Unlink local package to your project

  1. Run cd your-project-dir
  2. Run yarn unlink survey-form
  3. Run yarn to install back the repo version

Upgrading dependencies

  1. Run yarn
  2. Commit package.json and yarn.log changes
  3. Run flow-typed install --overwrite
  4. Check if yarn flow returns any new errors, if not, commit flow-typed/ changes

Setting up new component after forking survey-form

  1. Run git clone git@github.com:HealthByRo/react-new-component.git
  2. Run cd react-new-component
  3. Run git remote upstream add git@github.com:HealthByRo/survey-form.git
  4. Now, after something gets updated in survey-form (PR merge, straight commit, etc), run git fetch upstream
  5. Run git merge upstream/develop
  6. Changes from upstream repository should now be present in forked repository.