Comments (8)
payload = Message(
blocks=[
Input(
element=PlainTextInput(action_id="plain_text_input-action"), label="Label"
),
Section(fields=["this is plain_text text", "this is plain_text text"]),
]
).build() its as simple as this build output
from blockkit.
@palakagrawal22 Hi, I've encountered the same issue as you with fields.
The problem is that you should not pass string into the list but MarkdownText or PlainText object.
I don't know what has changed (if Slack changed something...) but according to Slack reference, fields should be an array of text objects (in this package implementation SimpleText or MarkdownText):
fields: Required if no text is provided. An array of text objects. Any text objects included with fields will be rendered in a compact format that allows for 2 columns of side-by-side text. Maximum number of items is 10. Maximum length for the text in each item is 2000 characters.
Using simple string does not generate a text object.
@imryche I guess that simple string should be either converted into PlainText or it should be removed as valid type. I noticed that it has been added some time before.
from blockkit.
Hey everyone who's encountered this issue. It should be fixed in the latest v1.8.3 release.
from blockkit.
It would be great if you could provide the code you used to generate the UI.
from blockkit.
its working for previous version 1.5.2
from blockkit.
Can you please provide the output of the .build()
method call, so I can investigate further?
from blockkit.
also in context i have payload function as : payload = Modal(
title="label",
callback_id="input",
submit="Submit",
close="Cancel",
blocks=[
Input(
block_id="id1",
element=PlainTextInput(action_id="action"),
label="example",
),
Context(
block_id="id2",
elements=[f"Note:"]
)
],
).build()
return payload then output of payload ={'blocks': [{'block_id': 'id1', 'type': 'input', 'label': {'type': 'plain_text', 'text': 'example', 'emoji': True}, 'element': {'action_id': 'channel-rename-input-action', 'type': 'plain_text_input'}}, {'block_id': 'id2', 'type': 'context', 'elements': ['Note:']}], 'callback_id': 'input', 'type': 'modal', 'title': {'type': 'plain_text', 'text': 'label', 'emoji': True}, 'close': {'type': 'plain_text', 'text': 'Cancel', 'emoji': True}, 'submit': {'type': 'plain_text', 'text': 'Submit', 'emoji': True}} getting error The server responded with: {'ok': False, 'error': 'invalid_arguments', 'response_metadata': {'messages': ['[ERROR] failed to match all allowed schemas [json-pointer:/view]', '[ERROR] must provide an object [json-pointer:/view/blocks/1/elements/0]']}}
from blockkit.
@imryche Can you please check?
from blockkit.
Related Issues (20)
- Support for new Rich Text blocks and elements (rich_text_list, rich_text_quote, ...) HOT 2
- setup.py differs from requirements.txt HOT 1
- Context not working with latest release HOT 2
- RichText type error for Message
- https://blockkit.botsignals.co/ is not working HOT 1
- Rich text input
- Links in rich text
- Add method that creates link to Slack Bot Builder HOT 3
- Message surface text attribute HOT 2
- Add attachments to the blockkit HOT 3
- black should be an optional dependency HOT 2
- Passing MarkdownText into Description field of MarkdownOption
- Support Datetime Picker HOT 2
- Inconsistent naming of `Timepicker` class HOT 1
- Missing requirement for pydantic 2 in setup.py HOT 3
- blockkit-generator.com seems dead HOT 1
- issue with blockkit generator site HOT 2
- Mattermost Support
- does not work with pydantic 2.5.2 HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from blockkit.