Explorar el Código

addNotificationPattern

itizawa hace 6 años
padre
commit
3914c0ec92

+ 4 - 4
src/client/js/components/Admin/Notification/UserTriggerNotification.jsx

@@ -48,10 +48,10 @@ class UserTriggerNotification extends React.Component {
   }
 
   async onClickSubmit() {
-    const { t } = this.props;
+    const { t, adminNotificationContainer } = this.props;
 
     try {
-      // await adminNotificationContainer.updateSlackAppConfiguration();
+      await adminNotificationContainer.addNotificationPattern();
       toastSuccess(t('notification_setting.add_notification_pattern'));
       this.setState({ pathPattern: '', channel: '' });
     }
@@ -84,7 +84,7 @@ class UserTriggerNotification extends React.Component {
                   className="form-control"
                   type="text"
                   name="pathPattern"
-                  defaultValue=""
+                  value={this.state.pathPattern}
                   placeholder="e.g. /projects/xxx/MTG/*"
                   onChange={(e) => { this.changePathPattern(e.target.value) }}
                 />
@@ -97,7 +97,7 @@ class UserTriggerNotification extends React.Component {
                   className="form-control form-inline"
                   type="text"
                   name="channel"
-                  defaultValue=""
+                  value={this.state.channel}
                   placeholder="e.g. project-xxx"
                   onChange={(e) => { this.changeChannel(e.target.value) }}
                 />

+ 8 - 0
src/client/js/services/AdminNotificationContainer.js

@@ -64,4 +64,12 @@ export default class AdminNotificationContainer extends Container {
 
   }
 
+  /**
+   * Add notificationPattern
+   * @memberOf SlackAppConfiguration
+   */
+  async addNotificationPattern() {
+    // TODO GW-794 create apiV3 addNotificationPattern
+  }
+
 }