Ver Fonte

Merge pull request #3223 from weseek/imprv/master-gw4683

implemented to show the slack notification popover
Yuki Takei há 5 anos atrás
pai
commit
294a26404f
1 ficheiros alterados com 7 adições e 6 exclusões
  1. 7 6
      src/client/js/components/SlackNotification.jsx

+ 7 - 6
src/client/js/components/SlackNotification.jsx

@@ -2,6 +2,7 @@ import React from 'react';
 import PropTypes from 'prop-types';
 import PropTypes from 'prop-types';
 
 
 import { withTranslation } from 'react-i18next';
 import { withTranslation } from 'react-i18next';
+import { UncontrolledPopover, PopoverHeader, PopoverBody } from 'reactstrap';
 /**
 /**
  *
  *
  * @author Yuki Takei <yuki@weseek.co.jp>
  * @author Yuki Takei <yuki@weseek.co.jp>
@@ -15,7 +16,7 @@ class SlackNotification extends React.Component {
 
 
   constructor(props) {
   constructor(props) {
     super(props);
     super(props);
-
+    this.idForSlackPopover = `${this.props.id}ForSlackPopover`;
     this.updateCheckboxHandler = this.updateCheckboxHandler.bind(this);
     this.updateCheckboxHandler = this.updateCheckboxHandler.bind(this);
     this.updateSlackChannelsHandler = this.updateSlackChannelsHandler.bind(this);
     this.updateSlackChannelsHandler = this.updateSlackChannelsHandler.bind(this);
   }
   }
@@ -55,16 +56,16 @@ class SlackNotification extends React.Component {
           </label>
           </label>
           <input
           <input
             className="grw-form-control-slack-notification form-control align-top pl-0"
             className="grw-form-control-slack-notification form-control align-top pl-0"
+            id={this.idForSlackPopover}
             type="text"
             type="text"
             value={this.props.slackChannels}
             value={this.props.slackChannels}
             placeholder="Input channels"
             placeholder="Input channels"
-            data-toggle="popover"
-            title={t('slack_notification.popover_title')}
-            data-content={t('slack_notification.popover_desc')}
-            data-trigger="focus"
-            data-placement="top"
             onChange={this.updateSlackChannelsHandler}
             onChange={this.updateSlackChannelsHandler}
           />
           />
+          <UncontrolledPopover trigger="focus" placement="top" target={this.idForSlackPopover}>
+            <PopoverHeader>{t('slack_notification.popover_title')}</PopoverHeader>
+            <PopoverBody>{t('slack_notification.popover_desc')}</PopoverBody>
+          </UncontrolledPopover>
         </div>
         </div>
       </div>
       </div>
     );
     );