X Tutup
Skip to content

Fix #65 by having block_actions as the default when type is missing in constraints#67

Merged
seratch merged 2 commits intoslackapi:mainfrom
seratch:issue-65-default-type-for-action
Sep 9, 2020
Merged

Fix #65 by having block_actions as the default when type is missing in constraints#67
seratch merged 2 commits intoslackapi:mainfrom
seratch:issue-65-default-type-for-action

Conversation

@seratch
Copy link
Contributor

@seratch seratch commented Sep 9, 2020

This pull request fixes #65 by allowing to omit having "type": "block_actions" in constraints for app.action. Also, it enables the framework to consider block_id as one of the conditions for listener executions.

Category (place an x in each of the [ ])

  • slack_bolt.App and/or its core components
  • slack_bolt.async_app.AsyncApp and/or its core components
  • Adapters in slack_bolt.adapter

Requirements (place an x in each [ ])

Please read the Contributing guidelines and Code of Conduct before creating this issue or pull request. By submitting, you are agreeing to those rules.

  • I've read and understood the Contributing Guidelines and have done my best effort to follow them.
  • I've read and agree to the Code of Conduct.
  • I've run ./scripts/run_tests.sh after making the changes.

@seratch seratch added bug Something isn't working area:async area:sync labels Sep 9, 2020
@seratch seratch added this to the 0.5.0a0 milestone Sep 9, 2020
@seratch seratch self-assigned this Sep 9, 2020
Copy link
Contributor Author

@seratch seratch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

comments for reviewers

return workflow_step_edit(constraints["callback_id"], asyncio)

raise BoltError(f"type: {action_type} is unsupported")
elif "action_id" in constraints:
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the key change.

elif isinstance(str_or_pattern, Pattern):
pattern: Pattern = str_or_pattern
return pattern.search(input)
return pattern.search(input) is not None
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just to make the type consistent - bool

@codecov-commenter
Copy link

Codecov Report

Merging #67 into main will increase coverage by 0.13%.
The diff coverage is 88.23%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main      #67      +/-   ##
==========================================
+ Coverage   77.61%   77.75%   +0.13%     
==========================================
  Files         123      123              
  Lines        3404     3416      +12     
==========================================
+ Hits         2642     2656      +14     
+ Misses        762      760       -2     
Impacted Files Coverage Δ
slack_bolt/listener_matcher/builtins.py 87.42% <86.66%> (+2.26%) ⬆️
slack_bolt/app/app.py 83.76% <100.00%> (ø)
slack_bolt/app/async_app.py 91.95% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 4a4dee9...c543ca0. Read the comment docs.

@seratch seratch merged commit d6c66ce into slackapi:main Sep 9, 2020
@seratch seratch deleted the issue-65-default-type-for-action branch September 9, 2020 23:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:async area:sync bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Use "type": "block_actions" when "type" is absent and "action_id" exists in App.action listener constraints

4 participants

X Tutup