UNPKG

lml-main

Version:

This is now a mono repository published into many standalone packages.

53 lines 2.48 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); const React = require("react"); const react_redux_1 = require("react-redux"); const lodash_1 = require("lodash"); const cosmoui_1 = require("cosmoui"); const tables_1 = require("../tables"); const forms_1 = require("../forms"); const constants_1 = require("../../constants"); const selectors_1 = require("../../selectors"); class ManageJobLabelsComponent extends cosmoui_1.StylableComponent { constructor() { super(...arguments); this.dividerStyle = { height: '40px', borderColor: '#dedede', margin: '0 15px', }; this.headerStyle = { minHeight: 'max-content', marginBottom: this.margin(200), backgroundColor: 'white', paddingBottom: 0, }; this.bodyStyle = { backgroundColor: 'white', overflow: 'auto', }; this.showLabelForm = () => { this.props.openDrawer(constants_1.JOB_LABEL_FORM_DRAWER_KEY); }; } render() { return (React.createElement(cosmoui_1.Column, null, React.createElement(cosmoui_1.Paper, { style: this.headerStyle }, React.createElement(cosmoui_1.Row, { justify: "space-between" }, React.createElement(cosmoui_1.Header, { primary: true }, "Labels"), React.createElement(cosmoui_1.Row, null, React.createElement(forms_1.JobLabelRegionForm, null), React.createElement(cosmoui_1.Divider, { vertical: true, style: this.dividerStyle }), React.createElement(cosmoui_1.Button, { id: 'add-new-place-button', onClick: this.showLabelForm, style: { marginBottom: '10px' } }, "Add New Label")))), React.createElement(cosmoui_1.Paper, { style: this.bodyStyle }, React.createElement(tables_1.JobLabelTable, { labels: this.props.labels })))); } } const mapStateToProps = (state, ownProps) => ({ labels: selectors_1.getJobLabelsByRegion(state, lodash_1.get(cosmoui_1.getFormFieldValue(state, constants_1.JOB_LABEL_REGION_FORM_KEY, constants_1.JOB_LABEL_REGION_FORM_SELECT_KEY), 'label')), }); const mapDispatchToProps = { openDrawer: cosmoui_1.openDrawer, }; exports.ManageJobLabels = react_redux_1.connect(mapStateToProps, mapDispatchToProps)(ManageJobLabelsComponent); //# sourceMappingURL=manage-job-labels.js.map