UNPKG

lml-main

Version:

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

43 lines 1.69 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); const React = require("react"); const lodash_1 = require("lodash"); const cosmoui_1 = require("cosmoui"); const abstract_field_1 = require("./abstract-field"); const styles = require('./job-fields.scss'); class PriorityField extends abstract_field_1.AbstractJobField { constructor() { super(...arguments); this.renderPriorityLevel = (priority) => { let cssSubscription; let label; switch (priority.toUpperCase()) { case 'HIGH': cssSubscription = styles.priorityHigh; label = 'HIGH'; break; case 'MEDIUM': cssSubscription = styles.priorityMedium; label = 'MED'; break; case 'LOW': cssSubscription = styles.priorityLow; label = 'LOW'; break; } return (React.createElement("span", { className: cssSubscription }, label)); }; this.labelStyle = () => ({ width: '80px', }); this.valueCodeStyle = () => ({ fontWeight: 'bold', }); } render() { const priority = lodash_1.get(this.props.job, 'metadata.priority'); return (React.createElement(cosmoui_1.Column, { className: styles.frequencyField }, priority ? (React.createElement(cosmoui_1.Row, null, this.renderPriorityLevel(priority))) : (React.createElement("span", null, "\u00A0")))); } } exports.PriorityField = PriorityField; //# sourceMappingURL=priority-field.js.map