Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
LOFAR
Manage
Activity
Members
Labels
Plan
Issues
Wiki
Jira issues
Open Jira
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Code review analytics
Insights
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
RadioObservatory
LOFAR
Commits
11d2df7b
Commit
11d2df7b
authored
9 years ago
by
Jorrit Schaap
Browse files
Options
Downloads
Patches
Plain Diff
Task #8887: only show projects for which there is a task in the filter box
parent
295945da
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
SAS/ResourceAssignment/ResourceAssignmentEditor/lib/static/app/controllers/gridcontroller.js
+14
-5
14 additions, 5 deletions
...gnmentEditor/lib/static/app/controllers/gridcontroller.js
with
14 additions
and
5 deletions
SAS/ResourceAssignment/ResourceAssignmentEditor/lib/static/app/controllers/gridcontroller.js
+
14
−
5
View file @
11d2df7b
...
@@ -142,6 +142,8 @@ gridControllerMod.controller('GridController', ['$scope', 'dataService', 'uiGrid
...
@@ -142,6 +142,8 @@ gridControllerMod.controller('GridController', ['$scope', 'dataService', 'uiGrid
$scope
.
gridOptions
.
data
=
$scope
.
dataService
.
tasks
;
$scope
.
gridOptions
.
data
=
$scope
.
dataService
.
tasks
;
else
else
$scope
.
gridOptions
.
data
=
[]
$scope
.
gridOptions
.
data
=
[]
fillProjectsColumFilterSelectOptions
();
},
true
);
},
true
);
$scope
.
$watch
(
'
dataService.taskstatustypes
'
,
function
()
{
$scope
.
$watch
(
'
dataService.taskstatustypes
'
,
function
()
{
...
@@ -155,12 +157,17 @@ gridControllerMod.controller('GridController', ['$scope', 'dataService', 'uiGrid
...
@@ -155,12 +157,17 @@ gridControllerMod.controller('GridController', ['$scope', 'dataService', 'uiGrid
fillColumFilterSelectOptions
(
tasktypenames
,
$scope
.
columns
[
7
]);
fillColumFilterSelectOptions
(
tasktypenames
,
$scope
.
columns
[
7
]);
});
});
$scope
.
$watch
(
'
dataService.momProjectsDict
'
,
func
tion
()
{
function
fillProjectsColumFilterSelectOp
tion
s
()
{
var
projectNames
=
[];
var
projectNames
=
[];
var
momProjectsDict
=
$scope
.
dataService
.
momProjectsDict
;
var
momProjectsDict
=
$scope
.
dataService
.
momProjectsDict
;
for
(
var
key
in
momProjectsDict
)
{
var
tasks
=
$scope
.
dataService
.
tasks
;
if
(
momProjectsDict
.
hasOwnProperty
(
key
))
{
//get unique projectIds from tasks
var
projectName
=
momProjectsDict
[
key
].
name
;
var
task_project_ids
=
tasks
.
map
(
function
(
t
)
{
return
t
.
project_mom_id
;
});
task_project_ids
=
task_project_ids
.
filter
(
function
(
value
,
index
,
arr
)
{
return
arr
.
indexOf
(
value
)
==
index
;})
for
(
var
project_id
of
task_project_ids
)
{
if
(
momProjectsDict
.
hasOwnProperty
(
project_id
))
{
var
projectName
=
momProjectsDict
[
project_id
].
name
;
if
(
!
(
projectName
in
projectNames
))
{
if
(
!
(
projectName
in
projectNames
))
{
projectNames
.
push
(
projectName
);
projectNames
.
push
(
projectName
);
}
}
...
@@ -168,7 +175,9 @@ gridControllerMod.controller('GridController', ['$scope', 'dataService', 'uiGrid
...
@@ -168,7 +175,9 @@ gridControllerMod.controller('GridController', ['$scope', 'dataService', 'uiGrid
}
}
projectNames
.
sort
();
projectNames
.
sort
();
fillColumFilterSelectOptions
(
projectNames
,
$scope
.
columns
[
1
]);
fillColumFilterSelectOptions
(
projectNames
,
$scope
.
columns
[
1
]);
});
};
$scope
.
$watch
(
'
dataService.momProjectsDict
'
,
fillProjectsColumFilterSelectOptions
);
$scope
.
$watch
(
'
dataService.selected_task_id
'
,
function
()
{
$scope
.
$watch
(
'
dataService.selected_task_id
'
,
function
()
{
var
taskIdx
=
$scope
.
gridOptions
.
data
.
findIndex
(
function
(
row
)
{
return
row
.
id
==
dataService
.
selected_task_id
});
var
taskIdx
=
$scope
.
gridOptions
.
data
.
findIndex
(
function
(
row
)
{
return
row
.
id
==
dataService
.
selected_task_id
});
...
...
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