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
988d63ba
Commit
988d63ba
authored
7 years ago
by
Jaden Diefenbaugh
Browse files
Options
Downloads
Patches
Plain Diff
fix tablefield generation using startswith instead of actual matching,
#21
parent
74c7a43b
No related branches found
No related tags found
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/tableFieldSelector.js
+21
-3
21 additions, 3 deletions
.../static/reports/app/directives/edit/tableFieldSelector.js
with
21 additions
and
3 deletions
beat/web/reports/static/reports/app/directives/edit/tableFieldSelector.js
+
21
−
3
View file @
988d63ba
...
...
@@ -63,7 +63,9 @@ angular.module('reportApp')
// converting to and from a Set is a simple way of
// removing dups
return
Array
.
from
(
new
Set
(
fieldArr
));
const
arr
=
Array
.
from
(
new
Set
(
fieldArr
));
return
arr
;
};
// has this fieldName already been processed?
...
...
@@ -101,12 +103,28 @@ angular.module('reportApp')
.
filter
(
f
=>
f
.
includes
(
'
.
'
))
.
map
(
f
=>
f
.
split
(
'
.
'
)[
0
]);
return
Array
.
from
(
new
Set
(
groupNames
)).
sort
((
a
,
b
)
=>
groupNames
.
indexOf
(
a
)
-
groupNames
.
indexOf
(
b
));
const
sorted
=
Array
.
from
(
new
Set
(
groupNames
))
.
sort
((
a
,
b
)
=>
groupNames
.
indexOf
(
a
)
-
groupNames
.
indexOf
(
b
))
return
sorted
;
};
// finds the actual field name whether its in a field group or not
scope
.
groupName
=
(
field
)
=>
field
.
includes
(
'
.
'
)
?
field
.
split
(
'
.
'
)[
0
]
:
field
;
// finds the actual field name whether its in a field group or not
scope
.
subfieldName
=
(
field
)
=>
field
.
includes
(
'
.
'
)
?
field
.
split
(
'
.
'
).
slice
(
1
).
join
(
'
.
'
)
:
field
;
scope
.
shouldShowField
=
(
fName
,
gName
)
=>
{
const
isUnique
=
scope
.
isUniqueTableable
(
fName
);
const
isInGroup
=
scope
.
groupName
(
fName
)
==
gName
;
// console.log(`for field "${fName}" and group "${gName}":`);
// console.log(`isUnique: ${isUnique}; isInGroup: ${isInGroup}`);
return
isUnique
&&
isInGroup
;
}
// toggle the selection of a field
scope
.
toggleField
=
(
fName
)
=>
{
let
idx
=
scope
.
colsSelected
.
indexOf
(
fName
);
...
...
@@ -145,7 +163,7 @@ angular.module('reportApp')
<h4>{{ gName }}</h4>
<div
ng-repeat='fName in tableables()'
ng-if='
isUniqueTableable(fName) && fName.startsWith(
gName)'>
ng-if='
shouldShowField(fName,
gName)'>
<label>
<input
type='checkbox'
...
...
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