~girishm/op-mattermost

749d0fb2741df2c0c313b44bbfd3ee1469a8848d — girishm 2 months ago f7f138d
fixing flows
2 files changed, 25 insertions(+), 8 deletions(-)

M resource/uiActions.js
M resource/util.js
M resource/uiActions.js => resource/uiActions.js +1 -1
@@ 273,7 273,7 @@ class UIactions {
      auth: this.opAuth
    }).then((response) => {
      console.log("Time entry deleted. Response %o", response);
      res.set('Content-Type', 'application/json').send(this.util.getTimeLogDelMsgJSON(this.util.timeLogDelMsg)).status(200);
      res.set('Content-Type', 'application/json').send(JSON.stringify(this.util.getTimeLogDelMsgJSON(this.util.timeLogDelMsg, this.intURL))).status(200);
    }).catch((error) => {
      console.log("Error in time entry deletion: ", error);
      this.message.showMsg(req, res, axios, this.util.timeLogDelErrMsg);

M resource/util.js => resource/util.js +24 -7
@@ 134,7 134,7 @@ class Util {
                "options": optArray
              },
              {
                "name": "Cancel search",
                "name": "Cancel Project search",
                "integration": {
                  "url": url + "bye"
                }


@@ 175,9 175,9 @@ class Util {
                  "options": optArray
                },
                {
                  "name": "Cancel search",
                  "name": "Cancel WP search",
                  "integration": {
                    "url": url + "bye"
                    "url": url + "createTimeLog"
                  }
                }]
            }


@@ 231,15 231,32 @@ class Util {
    }
  }

  getTimeLogDelMsgJSON(msg) {
  getTimeLogDelMsgJSON(msg, url) {
    return {
      "update": {
        "response_type": "in_channel",
        "message": msg,
        "props": {}
        "props": {
          "attachments": [
            {
              "text": msg,
              "actions": [
                {
                  "name": "View time logs",
                  "integration": {
                    "url": url + "getTimeLog",
                    "context": {
                      "action": "getTimeLog"
                    }
                  }
                }
              ]
            }
          ]
        }
      }
    }
    };
  }

  getTimeLogJSON(timeLogArray) {
    let tableTxt = '';
    if (timeLogArray.length !== 0) {