-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Closes #1544 hide url controls on checkbox check event #1680
Conversation
Ah, well, thank you, it's just that the URL text input box should disappear as well! |
@afarbman thank you so much for this. Email me (james at posthog.com) for something cool! |
oh, I see. will take care of it. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
At the moment, the URL matching mode selector is shown initially, even though URL matching is disabled. The URL input box meanwhile is shown all the time, when it shouldn't be if URL matching is disabled.
@@ -20,6 +20,14 @@ let getSafeText = (el) => { | |||
} | |||
|
|||
export class ActionStep extends Component { | |||
isUrlChecked = (step) => { | |||
return step?.selection?.indexOf('url') !== -1 ? true : false |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A ternary with ? true : false
is quite odd. !==
already returns a boolean.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done in 24bd7e4
className="btn-group" | ||
style={{ | ||
margin: isEditor ? '4px 0 0 8px' : '0 0 0 8px', | ||
display: this.isUrlChecked(step) ? 'block' : 'none', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This would be better as a render condition (like so: this.isUrlChecked(step) & <div...
) than dynamic display
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done in a4be717
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hm, unfortunately this is crashing the frontend for me when i go to http://localhost:8000/action
and click "Page view".
2ef167a
to
b1b6803
Compare
Ah, I'm still getting a crash when creating a new Page view Action, and URL input is by default shown on already existing Page view Actions even when URL is unchecked. |
Changes
Hide unnecessary URL controls when editing a pageview action
Checklist