Skip to content
GitLab
Explore
Sign in
Register
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
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
RadioObservatory
LOFAR
Commits
06ce2eef
Commit
06ce2eef
authored
May 17, 2024
by
Reinder Kraaij
Browse files
Options
Downloads
Plain Diff
Merge branch '
TMSS-3063
-Front-End-Only' into 'master'
FIx Blueprint without draft showing drafts Closes
TMSS-3063
and
TMSS-3064
See merge request
!1411
parents
732c5205
bbe9e302
No related branches found
No related tags found
1 merge request
!1411
FIx Blueprint without draft showing drafts
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
SAS/TMSS/frontend/tmss_webapp/src/routes/Scheduling/SchedulingUnitList.js
+28
-21
28 additions, 21 deletions
...d/tmss_webapp/src/routes/Scheduling/SchedulingUnitList.js
with
28 additions
and
21 deletions
SAS/TMSS/frontend/tmss_webapp/src/routes/Scheduling/SchedulingUnitList.js
+
28
−
21
View file @
06ce2eef
...
@@ -24,6 +24,21 @@ import { useParsedDataWebSocket } from '../../utils/websocket';
...
@@ -24,6 +24,21 @@ import { useParsedDataWebSocket } from '../../utils/websocket';
const
derviedscheduleconstraints
=
{};
const
derviedscheduleconstraints
=
{};
const
getUIAttr
=
(
props
)
=>
{
let
uistore
=
UtilService
.
localStore
({
type
:
'
get
'
,
key
:
props
.
project
?
'
PROJECT_VIEW_UI_ATTR
'
:
'
SCHEDULE_LIST_UI_ATTR
'
})
||
{};
return
uistore
}
function
getStoredSuType
(
props
)
{
let
store
=
getUIAttr
(
props
);
let
sutype
=
store
?.[
'
listType
'
]?.
replaceAll
(
"
_
"
,
"
"
)
||
"
Draft
"
return
sutype
}
export
function
SchedulingUnitList
(
props
)
{
export
function
SchedulingUnitList
(
props
)
{
const
viewtable
=
useRef
(
null
);
const
viewtable
=
useRef
(
null
);
let
defaultSortColumn
=
[{
id
:
"
Name
"
,
desc
:
false
}];
let
defaultSortColumn
=
[{
id
:
"
Name
"
,
desc
:
false
}];
...
@@ -121,8 +136,8 @@ export function SchedulingUnitList(props) {
...
@@ -121,8 +136,8 @@ export function SchedulingUnitList(props) {
let
statusList
=
[];
let
statusList
=
[];
const
[
definitionCache
,
setDefinitionCache
]
=
useState
([]);
const
[
definitionCache
,
setDefinitionCache
]
=
useState
([]);
const
[
suUIAttr
,
setSuUIAttr
]
=
useState
();
const
[
suType
,
setSuType
]
=
useState
(
"
Draft
"
);
const
[
suType
,
setSuType
]
=
useState
(
getStoredSuType
(
props
)
);
const
[
tmpDefaulColumns
,
setTmpDefaulColumns
]
=
useState
();
const
[
tmpDefaulColumns
,
setTmpDefaulColumns
]
=
useState
();
const
[
tmpOptionalColumns
,
setTmpOptionalColumns
]
=
useState
();
const
[
tmpOptionalColumns
,
setTmpOptionalColumns
]
=
useState
();
const
[
tmpColumnOrders
,
setTmpColumnOrders
]
=
useState
();
const
[
tmpColumnOrders
,
setTmpColumnOrders
]
=
useState
();
...
@@ -131,7 +146,7 @@ export function SchedulingUnitList(props) {
...
@@ -131,7 +146,7 @@ export function SchedulingUnitList(props) {
const
[
totalPage
,
setTotalPage
]
=
useState
([]);
const
[
totalPage
,
setTotalPage
]
=
useState
([]);
const
[
userrole
,
setUserrole
]
=
useState
();
const
[
userrole
,
setUserrole
]
=
useState
();
const
[
timelineCommonUtils
,
set
TimelineCommonUtils
]
=
useState
();
const
timelineCommonUtils
=
new
TimelineCommonUtils
();
const
[
priorityQueueTypes
,
setPriorityQueueTypes
]
=
useState
();
const
[
priorityQueueTypes
,
setPriorityQueueTypes
]
=
useState
();
const
[
columnclassname
,
setColumnclassname
]
=
useState
([{
const
[
columnclassname
,
setColumnclassname
]
=
useState
([{
"
Scheduling Unit ID
"
:
"
filter-input-100
"
,
"
Scheduling Unit ID
"
:
"
filter-input-100
"
,
...
@@ -419,6 +434,7 @@ export function SchedulingUnitList(props) {
...
@@ -419,6 +434,7 @@ export function SchedulingUnitList(props) {
*/
*/
const
getSchedulingUnitList
=
async
(
isInitial
,
suType
,
filterQry
,
orderBy
,
limit
,
offset
)
=>
{
const
getSchedulingUnitList
=
async
(
isInitial
,
suType
,
filterQry
,
orderBy
,
limit
,
offset
)
=>
{
//set query param for project if url has project param
//set query param for project if url has project param
console
.
log
(
"
getSchedulingUnitList
"
,
suType
)
if
(
props
.
project
)
{
if
(
props
.
project
)
{
filterQry
+=
(
filterQry
===
''
?
'
project=
'
:
'
&project=
'
)
+
props
.
project
;
filterQry
+=
(
filterQry
===
''
?
'
project=
'
:
'
&project=
'
)
+
props
.
project
;
}
}
...
@@ -453,7 +469,7 @@ export function SchedulingUnitList(props) {
...
@@ -453,7 +469,7 @@ export function SchedulingUnitList(props) {
params
=
'
blueprint
'
;
params
=
'
blueprint
'
;
}
}
if
(
suType
==
"
drafts without blueprint
"
)
{
if
(
suType
.
toLowerCase
()
==
"
drafts without blueprint
"
)
{
filterQry
=
filterQry
+
"
&blueprinted=false
"
filterQry
=
filterQry
+
"
&blueprinted=false
"
}
}
let
response
=
await
ScheduleService
.
getSchedulingUnitsExpandWithFilter
(
params
.
toLowerCase
(),
expand
,
filterQry
,
orderBy
,
limit
,
offset
,
fields
.
join
(
"
,
"
));
let
response
=
await
ScheduleService
.
getSchedulingUnitsExpandWithFilter
(
params
.
toLowerCase
(),
expand
,
filterQry
,
orderBy
,
limit
,
offset
,
fields
.
join
(
"
,
"
));
...
@@ -548,31 +564,20 @@ export function SchedulingUnitList(props) {
...
@@ -548,31 +564,20 @@ export function SchedulingUnitList(props) {
},
[]);
},
[]);
const
init
=
async
()
=>
{
const
init
=
async
()
=>
{
let
store
=
getUIAttr
();
lsKeySortColumn
=
"
SchedulingUnit_
"
+
changesutype
(
suType
)
+
"
_SortData
"
let
sutype
=
store
?.[
'
listType
'
]?.
replaceAll
(
"
_
"
,
"
"
)
||
"
Draft
"
setSuType
(
sutype
)
lsKeySortColumn
=
"
SchedulingUnit_
"
+
changesutype
(
sutype
)
+
"
_SortData
"
const
permission
=
await
AuthUtil
.
getUserRolePermission
();
const
permission
=
await
AuthUtil
.
getUserRolePermission
();
let
priorityQueueTypes
=
await
UtilService
.
getPriorityQueueType
();
let
priorityQueueTypes
=
await
UtilService
.
getPriorityQueueType
();
setPriorityQueueTypes
(
priorityQueueTypes
)
setPriorityQueueTypes
(
priorityQueueTypes
)
setUserrole
(
permission
);
setUserrole
(
permission
);
setPageUpdated
(
true
);
setPageUpdated
(
true
);
getFilterColumns
(
changesutype
());
getFilterColumns
(
changesutype
());
setTimelineCommonUtils
(
new
TimelineCommonUtils
());
}
}
/**
/**
* Function to get the UI attributes from local storage that are stored in the previous view
* Function to get the UI attributes from local storage that are stored in the previous view
*/
*/
const
getUIAttr
=
()
=>
{
let
uistore
=
UtilService
.
localStore
({
type
:
'
get
'
,
key
:
props
.
project
?
'
PROJECT_VIEW_UI_ATTR
'
:
'
SCHEDULE_LIST_UI_ATTR
'
})
||
{};
setSuUIAttr
(
uistore
)
return
uistore
}
/**
/**
* Function that stores the preferred values in local storage to restore the same in the next view
* Function that stores the preferred values in local storage to restore the same in the next view
...
@@ -580,11 +585,13 @@ export function SchedulingUnitList(props) {
...
@@ -580,11 +585,13 @@ export function SchedulingUnitList(props) {
* @param {Object} value
* @param {Object} value
*/
*/
const
storeUIAttr
=
(
key
,
value
)
=>
{
const
storeUIAttr
=
(
key
,
value
)
=>
{
suUIAttr
[
key
]
=
value
;
let
uiAttri
=
getUIAttr
(
props
)
uiAttri
[
key
]
=
value
;
UtilService
.
localStore
({
UtilService
.
localStore
({
type
:
'
set
'
,
type
:
'
set
'
,
key
:
props
.
project
?
'
PROJECT_VIEW_UI_ATTR
'
:
'
SCHEDULE_LIST_UI_ATTR
'
,
key
:
props
.
project
?
'
PROJECT_VIEW_UI_ATTR
'
:
'
SCHEDULE_LIST_UI_ATTR
'
,
value
:
suUI
Attr
value
:
ui
Attr
i
});
});
}
}
...
@@ -720,7 +727,7 @@ export function SchedulingUnitList(props) {
...
@@ -720,7 +727,7 @@ export function SchedulingUnitList(props) {
}
}
setIsLoading
(
false
)
setIsLoading
(
false
)
await
getSchedulingUnitList
(
false
,
change
su
t
ype
()
,
filterQry
,
newOrderBy
,
tablestate
?.
rows
||
15
,
tablestate
?.
first
||
0
);
await
getSchedulingUnitList
(
false
,
su
T
ype
,
filterQry
,
newOrderBy
,
tablestate
?.
rows
||
15
,
tablestate
?.
first
||
0
);
return
[
scheduleunit
,
totalPage
];
return
[
scheduleunit
,
totalPage
];
}
}
...
...
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