Facebook
From akoto, 4 Years ago, written in Plain Text.
Embed
Download Paste or View Raw
Hits: 199
  1. /**
  2.  * NewViewRestrictedPayeePanel.js
  3.  */
  4.  
  5. import React, { Component, Fragment } from "react";
  6. import PropTypes from "prop-types";
  7. import { observer } from "mobx-react";
  8. import Col from "react-bootstrap/lib/Col";
  9. import Row from "react-bootstrap/lib/Row";
  10.  
  11. import { BaseContext } from "frontend-react-f4-base-commons";
  12. const { connect } = BaseContext;
  13. import { BaseComponents } from "frontend-react-f4-base-ui";
  14. const { strings } = BaseComponents;
  15.  
  16. import BoViewPortlet from "../BoViewPortlet/BoViewPortlet";
  17. import BoViewField from "../BoViewField/BoViewField";
  18. import BoViewPanel from "../BoViewPanel/BoViewPanel";
  19. import ConfirmAckPage from "../ConfirmAckPage/ConfirmAckPage";
  20. import YesOrNoEnum from "../../enums/YesOrNoEnum";
  21.  
  22. @observer
  23. @connect
  24. class NewViewRestrictedPayeePanel extends Component {
  25.   constructor(props) {
  26.     super(props);
  27.   }
  28.  
  29.   getContent = () => {
  30.     const { data } = this.props;
  31.     return (
  32.       <BoViewPanel {...this.props}>
  33.         <BoViewPortlet
  34.           portletTitle={strings.formatString(
  35.             strings.global_objinfo,
  36.             strings.global_restrictedpayeenm
  37.           )}
  38.         >
  39.           <div className="boviewfield-row">
  40.             <BoViewField
  41.               isHighlighted
  42.               label={strings.global_restrictedpayeenm}
  43.               value={data.payeeName}
  44.             />
  45.           </div>
  46.           <div className="boviewfield-row">
  47.             <BoViewField
  48.               md={10}
  49.               label={strings.global_amount}
  50.               value={data.amount}
  51.             />
  52.           </div>
  53.           <div className="boviewfield-row">
  54.             <BoViewField
  55.               md={10}
  56.               label={strings.global_action}
  57.               // value={
  58.               //   data.isAllowed === true
  59.               //     ? YesOrNoEnum.YES.descriptionKey
  60.               //     : YesOrNoEnum.NO.descriptionKey
  61.               // }
  62.  
  63.               value={
  64.                 data.isAllowed === true
  65.                   ? "Allow Payee but with Override"
  66.                   : "Disallow Payee"
  67.               }
  68.             />
  69.           </div>
  70.           <div className="boviewfield-row">
  71.             <BoViewField
  72.               md={10}
  73.               label={strings.global_character_ignore}
  74.               value={data.charToIgnore}
  75.             />
  76.           </div>
  77.         </BoViewPortlet>
  78.       </BoViewPanel>
  79.     );
  80.   };
  81.  
  82.   getConfirmAck = () => {
  83.     return <ConfirmAckPage {...this.props}>{this.getContent()}</ConfirmAckPage>;
  84.   };
  85.   render() {
  86.     const { data, isConfirm, isAck, isView } = this.props;
  87.  
  88.     return (
  89.       <Fragment>{isView ? this.getContent() : this.getConfirmAck()}</Fragment>
  90.     );
  91.   }
  92. }
  93.  
  94. NewViewRestrictedPayeePanel.propTypes = {
  95.   // props definition
  96. };
  97.  
  98. NewViewRestrictedPayeePanel.defaultProps = {
  99.   // default props
  100. };
  101.  
  102. export default NewViewRestrictedPayeePanel;
  103.  

Replies to NewViewRestrictedPayeePanel rss

Title Name Language When
Re: SearchPayeePanel akoto text 4 Years ago.