0.0.6 • Published 4 years ago

@opensrp/population-characteristics v0.0.6

Weekly downloads
7
License
Apache-2.0
Repository
github
Last release
4 years ago

Population Characteristics

This package provides a UI for Editing OpenSrp population characteristics. With a list of all population characteristics for a specific location and ability to traverse through location hierarchies it is easy to edit each characteristic.

Instalation

yarn add @opensrp/population-characteristics

Importing default characteristics table styles

import '@opensrp/population-characteristics/dist/styles/index.css';

Edit characteristics

import ConnectedEditSetings from '@opensrp/population-characteristics'

const EditSetingsPage = () => {

    const editSetingsProps = {
        LoadingComponent: <loading component>, // optional,
        baseURL: <OpenSRP API base url without rest at end>,
        getPayload: <function for generating OpenSrp API headers>,
        locationsEndpoint: <OpenSrp API location tree endpoint>,
        restBaseURL: <OpenSRP API base url>,
        secAuthEndpoint: <OpenSrp API security authenticate endpoint>,
        settingsEndpoint: <OpenSrp API settings endpoint>,
        v2BaseUrl: <OpenSRP API v2 base url without rest at end>
    };
    return <ConnectedEditSetings {...editSetingsProps} />
};

Required props

baseURL: OpenSRP API base url without rest at end i.e https://.../opensrp/ getPayload: Function for generating OpenSrp API headers locationsEndpoint: OpenSrp API location tree endpoint restBaseURL: OpenSRP API base url secAuthEndpoint: OpenSrp API security authenticate endpoint, settingsEndpoint: OpenSrp API settings endpoint, v2BaseUrl: OpenSRP API v2 base url without rest at end

Optional props

debounceTime: debounce time in milliseconds. expects a value of type number. labels: object with the following keys:    descriptionLabel    editLabel    inheritedLable    inheritSettingsLabel    nameLabel    noDataFound    pageTitle    placeholder    settingLabel    setToNoLabel    setToYesLabel All of the label keys expect values of type strings.