-
Notifications
You must be signed in to change notification settings - Fork 281
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(Visualise): Adds context label to counter (LLC-16) (#1508)
- Loading branch information
1 parent
14380dd
commit c3283fe
Showing
10 changed files
with
121 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
39 changes: 39 additions & 0 deletions
39
ui/src/containers/Visualisations/components/ContextLabelForm.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
import React from 'react'; | ||
import PropTypes from 'prop-types'; | ||
|
||
/** | ||
* @param {string} props.visualisationId | ||
* @param {string} propscontextLabel | ||
* @param {(contextLabel: string) => void} props.onChange | ||
*/ | ||
const ContextLabelForm = ({ | ||
visualisationId, | ||
contextLabel, | ||
onChange, | ||
}) => { | ||
const formId = `visualisation-contextLabel-${visualisationId}`; | ||
|
||
return ( | ||
<div className="form-group"> | ||
<label htmlFor={formId}> | ||
Counter description | ||
</label> | ||
|
||
<input | ||
id={formId} | ||
className="form-control" | ||
placeholder="Comment" | ||
maxLength={30} | ||
value={contextLabel} | ||
onChange={e => onChange(e.target.value)} /> | ||
</div> | ||
); | ||
}; | ||
|
||
ContextLabelForm.propTypes = { | ||
visualisationId: PropTypes.string.isRequired, | ||
contextLabel: PropTypes.string.isRequired, | ||
onChange: PropTypes.func.isRequired, | ||
}; | ||
|
||
export default React.memo(ContextLabelForm); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters