Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
ce-deploy-ui
Manage
Activity
Members
Labels
Plan
Jira
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Operate
Environments
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
ccce
dev
ce-deploy-ui
Commits
aa835487
Commit
aa835487
authored
1 year ago
by
cjenkscybercom
Browse files
Options
Downloads
Patches
Plain Diff
CE-2200
: remove tabs from log list view
parent
b6495401
No related branches found
No related tags found
2 merge requests
!407
CE-2141: 3.0.0
,
!405
Qa release tasks
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/views/jobs/JobListView.js
+13
-66
13 additions, 66 deletions
src/views/jobs/JobListView.js
with
13 additions
and
66 deletions
src/views/jobs/JobListView.js
+
13
−
66
View file @
aa835487
import
React
,
{
useContext
,
useState
,
useCallback
,
useMemo
}
from
"
react
"
;
import
React
,
{
useContext
,
useCallback
,
useMemo
}
from
"
react
"
;
import
{
Grid
,
Container
,
TextField
,
Autocomplete
}
from
"
@mui/material
"
;
import
{
Grid
,
TextField
,
Autocomplete
}
from
"
@mui/material
"
;
import
Tabs
from
"
@mui/material/Tabs
"
;
import
Tab
from
"
@mui/material/Tab
"
;
import
{
RootPaper
,
useAPIMethod
}
from
"
@ess-ics/ce-ui-common
"
;
import
{
RootPaper
,
useAPIMethod
}
from
"
@ess-ics/ce-ui-common
"
;
import
{
initRequestParams
}
from
"
../../components/common/Helper
"
;
import
{
initRequestParams
}
from
"
../../components/common/Helper
"
;
import
{
useEffect
}
from
"
react
"
;
import
{
useEffect
}
from
"
react
"
;
...
@@ -15,6 +13,13 @@ import { usePagination } from "../../hooks/pagination";
...
@@ -15,6 +13,13 @@ import { usePagination } from "../../hooks/pagination";
import
{
JobTable
}
from
"
../../components/Job/JobTable
"
;
import
{
JobTable
}
from
"
../../components/Job/JobTable
"
;
import
{
apiContext
}
from
"
../../api/DeployApi
"
;
import
{
apiContext
}
from
"
../../api/DeployApi
"
;
const
jobTypeOptions
=
[
{
label
:
"
Show all
"
},
{
label
:
"
Only deployments
"
,
filter
:
"
DEPLOYMENT
"
},
{
label
:
"
Only commands
"
,
filter
:
"
COMMAND
"
}
];
const
defaultJobTypeOption
=
jobTypeOptions
[
0
];
export
function
JobListView
()
{
export
function
JobListView
()
{
const
client
=
useContext
(
apiContext
);
const
client
=
useContext
(
apiContext
);
...
@@ -31,7 +36,6 @@ export function JobListView() {
...
@@ -31,7 +36,6 @@ export function JobListView() {
const
[
urlState
,
setUrlState
]
=
useUrlState
(
const
[
urlState
,
setUrlState
]
=
useUrlState
(
{
{
tab
:
"
0
"
,
rows
:
"
20
"
,
rows
:
"
20
"
,
page
:
"
0
"
,
page
:
"
0
"
,
query
:
""
,
query
:
""
,
...
@@ -40,32 +44,6 @@ export function JobListView() {
...
@@ -40,32 +44,6 @@ export function JobListView() {
{
navigateMode
:
"
replace
"
}
{
navigateMode
:
"
replace
"
}
);
);
const
[
deploymentStatus
,
setDeploymentStatus
]
=
useState
(
null
);
const
handleTabChange
=
(
event
,
tab
)
=>
{
setUrlState
((
s
)
=>
serialize
(
s
.
tab
)
===
serialize
(
tab
)
?
{
tab
:
serialize
(
tab
)
}
:
{
tab
:
serialize
(
tab
),
page
:
"
0
"
}
);
changeTab
(
tab
);
};
const
changeTab
=
(
tab
)
=>
{
if
(
tab
===
0
)
{
setDeploymentStatus
(
null
);
}
else
if
(
tab
===
1
)
{
setDeploymentStatus
(
"
ONGOING
"
);
}
else
if
(
tab
===
2
)
{
setDeploymentStatus
(
"
FINISHED
"
);
}
};
useEffect
(()
=>
{
urlState
.
tab
&&
changeTab
(
deserialize
(
urlState
.
tab
));
},
[
urlState
]);
const
urlPagination
=
useMemo
(()
=>
{
const
urlPagination
=
useMemo
(()
=>
{
return
{
return
{
rows
:
deserialize
(
urlState
.
rows
),
rows
:
deserialize
(
urlState
.
rows
),
...
@@ -114,10 +92,6 @@ export function JobListView() {
...
@@ -114,10 +92,6 @@ export function JobListView() {
deserialize
(
urlState
.
query
)
deserialize
(
urlState
.
query
)
);
);
if
(
deploymentStatus
)
{
requestParams
.
status
=
deploymentStatus
;
}
if
(
urlState
.
job_type
)
{
if
(
urlState
.
job_type
)
{
requestParams
.
type
=
deserialize
(
urlState
.
job_type
);
requestParams
.
type
=
deserialize
(
urlState
.
job_type
);
}
}
...
@@ -127,14 +101,7 @@ export function JobListView() {
...
@@ -127,14 +101,7 @@ export function JobListView() {
return
()
=>
{
return
()
=>
{
abort
();
abort
();
};
};
},
[
},
[
getOperations
,
urlPagination
,
urlState
.
query
,
urlState
.
job_type
,
abort
]);
getOperations
,
urlPagination
,
urlState
.
query
,
urlState
.
job_type
,
deploymentStatus
,
abort
]);
const
setSearch
=
useCallback
(
const
setSearch
=
useCallback
(
(
query
)
=>
{
(
query
)
=>
{
...
@@ -165,12 +132,6 @@ export function JobListView() {
...
@@ -165,12 +132,6 @@ export function JobListView() {
<
/SearchBar
>
<
/SearchBar
>
);
);
const
jobTypeOptions
=
[
{
label
:
"
Show all
"
},
{
label
:
"
Only deployments
"
,
filter
:
"
DEPLOYMENT
"
},
{
label
:
"
Only commands
"
,
filter
:
"
COMMAND
"
}
];
return
(
return
(
<
RootPaper
>
<
RootPaper
>
<
Grid
<
Grid
...
@@ -180,21 +141,10 @@ export function JobListView() {
...
@@ -180,21 +141,10 @@ export function JobListView() {
<
Grid
<
Grid
container
container
spacing
=
{
1
}
spacing
=
{
1
}
component
=
{
Container
}
justifyContent
=
"
flex-end
"
justifyContent
=
"
space-between
"
alignItems
=
"
center
"
alignItems
=
"
center
"
style
=
{{
display
:
"
flex
"
}}
style
=
{{
display
:
"
flex
"
}}
>
>
<
Grid
item
>
<
Tabs
value
=
{
deserialize
(
urlState
.
tab
)}
onChange
=
{
handleTabChange
}
>
<
Tab
label
=
"
All
"
/>
<
Tab
label
=
"
Only Ongoing
"
/>
<
Tab
label
=
"
Only Completed
"
/>
<
/Tabs
>
<
/Grid
>
<
Grid
<
Grid
item
item
xs
=
{
3
}
xs
=
{
3
}
...
@@ -206,16 +156,13 @@ export function JobListView() {
...
@@ -206,16 +156,13 @@ export function JobListView() {
urlState
.
job_type
urlState
.
job_type
?
jobTypeOptions
.
find
(
?
jobTypeOptions
.
find
(
(
o
)
=>
o
.
filter
===
urlState
.
job_type
(
o
)
=>
o
.
filter
===
urlState
.
job_type
)
||
{
)
||
defaultJobTypeOption
label
:
"
Show all
"
:
defaultJobTypeOption
}
:
{
label
:
"
Show all
"
}
}
}
getOptionLabel
=
{(
option
)
=>
option
.
label
}
getOptionLabel
=
{(
option
)
=>
option
.
label
}
isOptionEqualToValue
=
{(
option
,
value
)
=>
isOptionEqualToValue
=
{(
option
,
value
)
=>
option
.
label
===
value
.
label
option
.
label
===
value
.
label
}
}
style
=
{{
width
:
"
100%
"
}}
renderInput
=
{(
params
)
=>
(
renderInput
=
{(
params
)
=>
(
<
TextField
<
TextField
{...
params
}
{...
params
}
...
...
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