|
2 | 2 | # instead of slack_bolt in requirements.txt |
3 | 3 | import sys |
4 | 4 |
|
5 | | - |
6 | 5 | sys.path.insert(1, "..") |
7 | 6 | # ------------------------------------------------ |
8 | 7 |
|
@@ -30,7 +29,7 @@ def log_request(logger, body, next): |
30 | 29 | # https://api.slack.com/tutorials/workflow-builder-steps |
31 | 30 |
|
32 | 31 |
|
33 | | -def edit(ack: Ack, configure: Configure): |
| 32 | +def edit(ack: Ack, step, configure: Configure): |
34 | 33 | ack() |
35 | 34 | configure( |
36 | 35 | blocks=[ |
@@ -85,8 +84,8 @@ def edit(ack: Ack, configure: Configure): |
85 | 84 | ) |
86 | 85 |
|
87 | 86 |
|
88 | | -def save(ack: Ack, body: dict, update: Update): |
89 | | - state_values = body["view"]["state"]["values"] |
| 87 | +def save(ack: Ack, view: dict, update: Update): |
| 88 | + state_values = view["state"]["values"] |
90 | 89 | update( |
91 | 90 | inputs={ |
92 | 91 | "taskName": { |
@@ -121,15 +120,14 @@ def save(ack: Ack, body: dict, update: Update): |
121 | 120 | pseudo_database = {} |
122 | 121 |
|
123 | 122 |
|
124 | | -def execute(body: dict, client: WebClient, complete: Complete, fail: Fail): |
125 | | - step = body["event"]["workflow_step"] |
| 123 | +def execute(step: dict, client: WebClient, complete: Complete, fail: Fail): |
126 | 124 | try: |
127 | 125 | complete( |
128 | 126 | outputs={ |
129 | | - "taskName": step["inputs"]["taskName"]["value"], |
130 | | - "taskDescription": step["inputs"]["taskDescription"]["value"], |
131 | | - "taskAuthorEmail": step["inputs"]["taskAuthorEmail"]["value"], |
132 | | - } |
| 127 | + "taskName": step["inputs"]["taskName"]["value"], |
| 128 | + "taskDescription": step["inputs"]["taskDescription"]["value"], |
| 129 | + "taskAuthorEmail": step["inputs"]["taskAuthorEmail"]["value"], |
| 130 | + } |
133 | 131 | ) |
134 | 132 |
|
135 | 133 | user: SlackResponse = client.users_lookupByEmail( |
@@ -167,6 +165,7 @@ def execute(body: dict, client: WebClient, complete: Complete, fail: Fail): |
167 | 165 | "message": "Something wrong!" |
168 | 166 | }) |
169 | 167 |
|
| 168 | + |
170 | 169 | app.step( |
171 | 170 | callback_id="copy_review", |
172 | 171 | edit=edit, |
|
0 commit comments