Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
beat.web
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
beat
beat.web
Commits
315acf22
Commit
315acf22
authored
8 years ago
by
Jaden Diefenbaugh
Browse files
Options
Downloads
Patches
Plain Diff
addgroup has enter key support, input validation
parent
a9020ca2
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!223
Reports overhaul
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
beat/web/reports/static/reports/app/directives/edit/addGroupMenu.js
+18
-5
18 additions, 5 deletions
...eports/static/reports/app/directives/edit/addGroupMenu.js
with
18 additions
and
5 deletions
beat/web/reports/static/reports/app/directives/edit/addGroupMenu.js
+
18
−
5
View file @
315acf22
...
...
@@ -31,19 +31,32 @@ angular.module('reportApp')
scope
:
{
},
link
:
function
(
scope
){
scope
.
createGroup
=
GroupsService
.
createGroup
;
scope
.
newGroupName
=
{
val
:
''
};
scope
.
hasError
=
(
val
)
=>
{
// if val is undefined, empty, or a dup, its an err
const
isErr
=
!
val
||
val
.
length
===
0
||
GroupsService
.
groups
.
find
(
g
=>
g
.
name
===
val
);
// cast to boolean
return
!!
isErr
;
};
scope
.
createGroup
=
()
=>
{
if
(
scope
.
hasError
(
scope
.
newGroupName
.
val
)){
return
;
}
GroupsService
.
createGroup
(
scope
.
newGroupName
.
val
);
scope
.
newGroupName
.
val
=
''
;
};
},
template
:
`
<form>
<div class='form-group'>
<form
ng-submit='createGroup()'
>
<div class='form-group'
ng-class="{'has-error': hasError(newGroupName.val)}"
>
<div class="input-group">
<span class="input-group-btn">
<button ng-click='createGroup(
newGroupName.val
)' class="btn btn-default" type="button">
<button ng-click='createGroup()' class="btn btn-default" type="button">
<i class="fa fa-plus" aria-hidden="true"></i>
</button>
</span>
<input id='createNewGroupInput' ng-model='newGroupName.val' type="text" class="form-control" placeholder="New group name...">
<input
required
id='createNewGroupInput' ng-model='newGroupName.val' type="text" class="form-control" placeholder="New group name...">
</div>
</div>
</form>
...
...
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