Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(studio): allow changing content-type when editing node content-element #121

Merged
merged 1 commit into from
Sep 28, 2021

Conversation

laurentlp
Copy link
Contributor

@laurentlp laurentlp commented Sep 24, 2021

This PR fixes an issue where when editing a selected content-element in a node, it would not let you change the content-type. The option was only provided when adding a content-element.

Before

simplescreenrecorder-2021-09-24_10.58.25.mp4

After

simplescreenrecorder-2021-09-24_10.56.37.mp4

Closes botpress/v12#1430
Also closes DEV-1535

@laurentlp laurentlp changed the title fix(studio): allow changing conent-type when editing node content-element fix(studio): allow changing content-type when editing node content-element Sep 27, 2021
@linear
Copy link

linear bot commented Sep 27, 2021

DEV-1535 "[BUG]: Failing to change Content Element" (botpress/botpress botpress/v12#1430)

Describe the bug
When a node contains a carousel content, if you try to change it to another content type , you cannot do so,

To Reproduce
Steps to reproduce the behavior:

  1. Create node
  2. Create carousel element and add to node.
  3. Try to change to another content element e.g. image
  4. See error

Expected behavior
I should be able to freely change the content elements in my flow.

Screenshots
image

Environment (please complete the following information):

  • OS: Windows]
  • Botpress Version [e.g. 12.25.0]

botpress/botpress botpress/v12#1430 by @Michael-N-M on GitHub

via LinearSync

@EFF
Copy link
Member

EFF commented Sep 27, 2021

I see pretty much only typing fix, cab you point out where the actual fix is in your changes

Comment on lines 231 to 235
renderCurrentCategoryInfo() {
const { categories } = this.props
const { hideCategoryInfo } = this.state
if (hideCategoryInfo || !categories || categories.length < 2) {
if (!categories || categories.length < 2) {
return null
}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Here is the fix. I simply removed the hideCategoryInfo condition.

Copy link
Member

Choose a reason for hiding this comment

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

Yeah I thought that. Any idea why was it there in the first place ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I have no idea!

@EFF EFF merged commit 4bf2ae2 into master Sep 28, 2021
@EFF EFF deleted the llp_allow_change_content_type_on_edit branch September 28, 2021 12:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BUG]: Failing to change Content Element
2 participants