@@ -11,11 +11,13 @@ import SimpleTextSearch from '../../components/helpers/SimpleTextSearch';
1111import DeletePipelineButtonContainer from '../../containers/DeletePipelineButtonContainer' ;
1212import PageContent from '../../components/layout/PageContent' ;
1313import Box from '../../components/widgets/Box' ;
14+ import OnlyMounted from '../../components/widgets/OnlyMounted' ;
15+ import PipelinesList from '../../components/Pipelines/PipelinesList' ;
16+ import { AddIcon , EditIcon , PipelineIcon } from '../../components/icons' ;
17+
1418import { canEditPipeline } from '../../redux/selectors/users.js' ;
1519import { loggedInUserIdSelector } from '../../redux/selectors/auth.js' ;
16- import { AddIcon , EditIcon , PipelineIcon } from '../../components/icons' ;
1720import { create as createPipeline } from '../../redux/modules/pipelines.js' ;
18- import PipelinesList from '../../components/Pipelines/PipelinesList' ;
1921
2022import withLinks from '../../helpers/withLinks.js' ;
2123import { withRouterProps } from '../../helpers/withRouter.js' ;
@@ -72,61 +74,68 @@ class Pipelines extends Component {
7274 < PageContent
7375 icon = { < PipelineIcon /> }
7476 title = { < FormattedMessage id = "app.pipelines.title" defaultMessage = "List of All Pipelines" /> } >
75- < Box
76- title = { < FormattedMessage id = "app.pipelines.listTitle" defaultMessage = "Pipelines" /> }
77- footer = {
78- < div className = "text-center" >
79- < Button
80- variant = "success"
81- size = "sm"
82- onClick = { ( ) => {
83- this . newPipeline ( ) ;
84- } } >
85- < AddIcon gapRight = { 2 } />
86- < FormattedMessage id = "app.pipelines.createNew" defaultMessage = "Create New Pipeline" />
87- </ Button >
88- </ div >
89- }
90- unlimitedHeight >
91- < PaginationContainer
92- id = "pipelines-all"
93- endpoint = "pipelines"
94- defaultOrderBy = "name"
95- filtersCreator = { ( filters , setFilters ) => (
96- < SimpleTextSearch
97- query = { filters . search || '' }
98- isLoading = { setFilters === null }
99- onSubmit = { submitHandler ( setFilters ) }
100- />
101- ) } >
102- { ( { data, offset, limit, totalCount, orderByColumn, orderByDescending, setOrderBy, reload } ) => (
103- < PipelinesList
104- pipelines = { data }
105- heading = { this . headingCreator ( {
106- offset,
107- limit,
108- totalCount,
109- orderByColumn,
110- orderByDescending,
111- setOrderBy,
112- } ) }
113- createActions = { id =>
114- isAuthorOfPipeline ( id ) && (
115- < TheButtonGroup >
116- < Link to = { PIPELINE_EDIT_URI_FACTORY ( id ) } >
117- < Button size = "xs" variant = "warning" >
118- < EditIcon gapRight = { 2 } />
119- < FormattedMessage id = "generic.edit" defaultMessage = "Edit" />
120- </ Button >
121- </ Link >
122- < DeletePipelineButtonContainer id = { id } size = "xs" resourceless = { true } onDeleted = { ( ) => reload ( ) } />
123- </ TheButtonGroup >
124- )
125- }
126- />
127- ) }
128- </ PaginationContainer >
129- </ Box >
77+ < OnlyMounted >
78+ < Box
79+ title = { < FormattedMessage id = "app.pipelines.listTitle" defaultMessage = "Pipelines" /> }
80+ footer = {
81+ < div className = "text-center" >
82+ < Button
83+ variant = "success"
84+ size = "sm"
85+ onClick = { ( ) => {
86+ this . newPipeline ( ) ;
87+ } } >
88+ < AddIcon gapRight = { 2 } />
89+ < FormattedMessage id = "app.pipelines.createNew" defaultMessage = "Create New Pipeline" />
90+ </ Button >
91+ </ div >
92+ }
93+ unlimitedHeight >
94+ < PaginationContainer
95+ id = "pipelines-all"
96+ endpoint = "pipelines"
97+ defaultOrderBy = "name"
98+ filtersCreator = { ( filters , setFilters ) => (
99+ < SimpleTextSearch
100+ query = { filters . search || '' }
101+ isLoading = { setFilters === null }
102+ onSubmit = { submitHandler ( setFilters ) }
103+ />
104+ ) } >
105+ { ( { data, offset, limit, totalCount, orderByColumn, orderByDescending, setOrderBy, reload } ) => (
106+ < PipelinesList
107+ pipelines = { data }
108+ heading = { this . headingCreator ( {
109+ offset,
110+ limit,
111+ totalCount,
112+ orderByColumn,
113+ orderByDescending,
114+ setOrderBy,
115+ } ) }
116+ createActions = { id =>
117+ isAuthorOfPipeline ( id ) && (
118+ < TheButtonGroup >
119+ < Link to = { PIPELINE_EDIT_URI_FACTORY ( id ) } >
120+ < Button size = "xs" variant = "warning" >
121+ < EditIcon gapRight = { 2 } />
122+ < FormattedMessage id = "generic.edit" defaultMessage = "Edit" />
123+ </ Button >
124+ </ Link >
125+ < DeletePipelineButtonContainer
126+ id = { id }
127+ size = "xs"
128+ resourceless = { true }
129+ onDeleted = { ( ) => reload ( ) }
130+ />
131+ </ TheButtonGroup >
132+ )
133+ }
134+ />
135+ ) }
136+ </ PaginationContainer >
137+ </ Box >
138+ </ OnlyMounted >
130139 </ PageContent >
131140 ) ;
132141 }
0 commit comments