Giter Site home page Giter Site logo

Comments (8)

palakagrawal22 avatar palakagrawal22 commented on September 7, 2024 1

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.

Kharianne avatar Kharianne commented on September 7, 2024 1

@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.

imryche avatar imryche commented on September 7, 2024 1

Hey everyone who's encountered this issue. It should be fixed in the latest v1.8.3 release.

from blockkit.

imryche avatar imryche commented on September 7, 2024

It would be great if you could provide the code you used to generate the UI.

from blockkit.

palakagrawal22 avatar palakagrawal22 commented on September 7, 2024

its working for previous version 1.5.2

from blockkit.

imryche avatar imryche commented on September 7, 2024

Can you please provide the output of the .build() method call, so I can investigate further?

from blockkit.

palakagrawal22 avatar palakagrawal22 commented on September 7, 2024

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.

palakagrawal22 avatar palakagrawal22 commented on September 7, 2024

@imryche Can you please check?

from blockkit.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.