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
cacce2ff
Commit
cacce2ff
authored
8 years ago
by
Jorrit Schaap
Browse files
Options
Downloads
Patches
Plain Diff
Task #9607: fill project and group filters with entries from filtered tasks
parent
7ecdf80d
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
+22
-8
22 additions, 8 deletions
...gnmentEditor/lib/static/app/controllers/gridcontroller.js
with
22 additions
and
8 deletions
SAS/ResourceAssignment/ResourceAssignmentEditor/lib/static/app/controllers/gridcontroller.js
+
22
−
8
View file @
cacce2ff
...
@@ -78,7 +78,7 @@ $scope.columns = [
...
@@ -78,7 +78,7 @@ $scope.columns = [
{
field
:
'
mom_object_group_id
'
,
{
field
:
'
mom_object_group_id
'
,
displayName
:
'
Group
'
,
displayName
:
'
Group
'
,
enableCellEdit
:
false
,
enableCellEdit
:
false
,
cellTemplate
:
'
<a target="_blank" href="https://lofar.astron.nl/mom3/user/project/setUpMom2ObjectDetails.do?view=generalinfo&mom2ObjectId={{row.entity.mom_object_group_mom2object_id}}">{{row.entity.mom_object_group_
name
}} {{row.entity.mom_object_group_
id
}}</a>
'
,
cellTemplate
:
'
<a target="_blank" href="https://lofar.astron.nl/mom3/user/project/setUpMom2ObjectDetails.do?view=generalinfo&mom2ObjectId={{row.entity.mom_object_group_mom2object_id}}">{{row.entity.mom_object_group_
id
}} {{row.entity.mom_object_group_
name
}}</a>
'
,
width
:
'
13%
'
,
width
:
'
13%
'
,
filter
:
{
filter
:
{
condition
:
uiGridConstants
.
filter
.
EXACT
,
condition
:
uiGridConstants
.
filter
.
EXACT
,
...
@@ -255,6 +255,11 @@ $scope.columns = [
...
@@ -255,6 +255,11 @@ $scope.columns = [
$scope
.
$evalAsync
(
jumpToSelectedTaskRows
);
$scope
.
$evalAsync
(
jumpToSelectedTaskRows
);
},
true
);
},
true
);
$scope
.
$watch
(
'
dataService.filteredTaskChangeCntr
'
,
function
()
{
$scope
.
$evalAsync
(
fillProjectsColumFilterSelectOptions
)
$scope
.
$evalAsync
(
fillGroupsColumFilterSelectOptions
);
});
$scope
.
$watch
(
'
dataService.initialLoadComplete
'
,
function
()
{
$scope
.
$watch
(
'
dataService.initialLoadComplete
'
,
function
()
{
$scope
.
$evalAsync
(
function
()
{
$scope
.
$evalAsync
(
function
()
{
taskstatustypenames
=
$scope
.
dataService
.
taskstatustypes
.
map
(
function
(
x
)
{
return
x
.
name
;
});
taskstatustypenames
=
$scope
.
dataService
.
taskstatustypes
.
map
(
function
(
x
)
{
return
x
.
name
;
});
...
@@ -271,10 +276,10 @@ $scope.columns = [
...
@@ -271,10 +276,10 @@ $scope.columns = [
function
fillProjectsColumFilterSelectOptions
()
{
function
fillProjectsColumFilterSelectOptions
()
{
var
projectNames
=
[];
var
projectNames
=
[];
var
momProjectsDict
=
$scope
.
dataService
.
momProjectsDict
;
var
momProjectsDict
=
$scope
.
dataService
.
momProjectsDict
;
var
tasks
=
$scope
.
dataService
.
t
asks
;
var
tasks
=
$scope
.
dataService
.
filteredT
asks
;
//get unique projectIds from tasks
//get unique projectIds from tasks
var
task_project_ids
=
tasks
.
map
(
function
(
t
)
{
return
t
.
project_mom_id
;
});
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
;})
task_project_ids
=
task_project_ids
.
filter
(
function
(
value
,
index
)
{
return
task_project_ids
.
indexOf
(
value
)
==
index
;})
for
(
var
project_id
of
task_project_ids
)
{
for
(
var
project_id
of
task_project_ids
)
{
if
(
momProjectsDict
.
hasOwnProperty
(
project_id
))
{
if
(
momProjectsDict
.
hasOwnProperty
(
project_id
))
{
...
@@ -289,13 +294,22 @@ $scope.columns = [
...
@@ -289,13 +294,22 @@ $scope.columns = [
};
};
function
fillGroupsColumFilterSelectOptions
()
{
function
fillGroupsColumFilterSelectOptions
()
{
var
tasks
=
$scope
.
dataService
.
t
asks
;
var
tasks
=
$scope
.
dataService
.
filteredT
asks
;
//get unique groupNames from tasks
//get unique groupNames from tasks
var
groupNamesAndIds
=
tasks
.
map
(
function
(
t
)
{
return
{
name
:
t
.
mom_object_group_name
,
id
:
t
.
mom_object_group_id
};
});
var
groupId2Name
=
{};
groupNamesAndIds
=
groupNamesAndIds
.
filter
(
function
(
value
,
index
,
arr
)
{
return
arr
.
indexOf
(
value
)
==
index
;})
var
groupIds
=
[];
groupNamesAndIds
.
sort
();
for
(
var
task
of
tasks
)
{
if
(
task
.
mom_object_group_id
)
{
if
(
!
groupId2Name
.
hasOwnProperty
(
task
.
mom_object_group_id
))
{
groupId2Name
[
task
.
mom_object_group_id
]
=
task
.
mom_object_group_name
;
groupIds
.
push
(
task
.
mom_object_group_id
);
}
}
}
var
groupSelectOptions
=
groupNamesAndIds
.
map
(
function
(
obj
)
{
return
{
value
:
obj
.
id
,
label
:
obj
.
name
+
'
'
+
obj
.
id
};
});
var
groupSelectOptions
=
groupIds
.
map
(
function
(
gid
)
{
return
{
value
:
gid
,
label
:
gid
+
'
'
+
groupId2Name
[
gid
]};
});
groupSelectOptions
.
sort
(
function
(
a
,
b
)
{
return
a
.
value
-
b
.
value
;
});
fillColumFilterSelectOptions
(
groupSelectOptions
,
$scope
.
columns
[
7
]);
fillColumFilterSelectOptions
(
groupSelectOptions
,
$scope
.
columns
[
7
]);
};
};
...
...
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