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

Allows users to select tickscript editor with mouse #3252

Merged
merged 5 commits into from
Apr 19, 2018

Conversation

bthesorceror
Copy link
Contributor

@bthesorceror bthesorceror commented Apr 18, 2018

Closes #3236

  • CHANGELOG.md updated with a link to the PR (not the Issue)
  • Rebased/mergeable
  • Tests pass
  • Sign CLA (if not already signed)

@@ -316,7 +316,7 @@ export class TickscriptPage extends PureComponent<Props, State> {
}
} catch (error) {
console.error(error)
notify(notifyTickscriptLoggingError(error))
notify(notifyTickscriptLoggingError('Could not collect kapacitor logs'))
Copy link
Contributor

Choose a reason for hiding this comment

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

i think we have a central constants file for all error copy

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 was previously just passing through an error and there was nothing in the notifications copy, happy to move.

if (ref) {
const {height} = ref.getBoundingClientRect()
this.setState({height})
this.notificationRef = ref
Copy link
Contributor

Choose a reason for hiding this comment

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

what if you put this at the top of this if block, and then use this.notificationRef.getBoundClientRect() etc.? and then you can factor this and lines 30-31 out into a function for setting the height? or if not factoring it out, at least they'll be consistent syntax

Copy link
Contributor Author

Choose a reason for hiding this comment

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

👍

/>
<label htmlFor="insecureSkipVerifyCheckbox">
Unsafe SSL
{url &&
Copy link
Contributor

Choose a reason for hiding this comment

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

maybe some kind of typechecking, prior guard, or default value could be used to ensure url exists? why would we be able to get here without url?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It was getting a null value right after I saved a new kapacitor configuration.

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 think this component needs to be translated to a class based component, there are enough places that need default values to make it a cleaner experience. However this change was not in service of the issue so didn't want to bog down this PR too much.

Copy link
Contributor

@jaredscheib jaredscheib Apr 19, 2018

Choose a reason for hiding this comment

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

hm. i don't think a url should ever be null after saving a new kapacitor configuration. i suspect introducing this line will cover up part of what, i would agree, should be a larger refactor. could you make a chore issue for the refactor of this component and cite this line and the null upon saving for future consideration?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

sounds good

@@ -19,7 +19,7 @@ class TickscriptID extends Component {
onChange={onChangeID}
placeholder="ID your TICKscript"
spellCheck={false}
autoComplete={false}
autoComplete="false"
Copy link
Contributor

Choose a reason for hiding this comment

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

The prop for autocomplete on inputs is "off"

Copy link
Contributor Author

Choose a reason for hiding this comment

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

👍

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.

3 participants