Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
Metabase
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Engineering Digital Service
Metabase
Commits
2cf220df
Commit
2cf220df
authored
9 years ago
by
Allen Gilliland
Browse files
Options
Downloads
Plain Diff
Merge pull request #1566 from metabase/inline-pulse-name-validation
Add simple Pulse name validation
parents
c12339af
6efff0ee
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
frontend/src/pulse/components/PulseEditName.jsx
+13
-3
13 additions, 3 deletions
frontend/src/pulse/components/PulseEditName.jsx
with
13 additions
and
3 deletions
frontend/src/pulse/components/PulseEditName.jsx
+
13
−
3
View file @
2cf220df
import
React
,
{
Component
,
PropTypes
}
from
"
react
"
;
import
_
from
"
underscore
"
;
import
cx
from
"
classnames
"
;
export
default
class
PulseEditName
extends
Component
{
constructor
(
props
)
{
super
(
props
);
this
.
state
=
{};
_
.
bindAll
(
this
,
"
setName
"
);
this
.
state
=
{
valid
:
true
};
_
.
bindAll
(
this
,
"
setName
"
,
"
validate
"
);
}
static
propTypes
=
{};
...
...
@@ -18,6 +22,10 @@ export default class PulseEditName extends Component {
this
.
props
.
setPulse
({
...
pulse
,
name
:
e
.
target
.
value
});
}
validate
()
{
this
.
setState
({
valid
:
!!
React
.
findDOMNode
(
this
.
refs
.
name
).
value
});
}
render
()
{
let
{
pulse
}
=
this
.
props
;
return
(
...
...
@@ -26,10 +34,12 @@ export default class PulseEditName extends Component {
<
p
className
=
"mt1 h4 text-bold text-grey-3"
>
Give your pulse a name to help others understand what it's about.
</
p
>
<
div
className
=
"my3"
>
<
input
className
=
"input h4 text-bold text-default"
ref
=
"name"
className
=
{
cx
(
"
input h4 text-bold text-default
"
,
{
"
border-error
"
:
!
this
.
state
.
valid
})
}
style
=
{
{
"
width
"
:
"
400px
"
}
}
value
=
{
pulse
.
name
}
onChange
=
{
this
.
setName
}
onBlur
=
{
this
.
validate
}
placeholder
=
"Important metrics"
autoFocus
/>
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment