@@ -3,80 +3,71 @@ import PropTypes from 'prop-types';
33import { FormattedMessage } from 'react-intl' ;
44import { Table } from 'react-bootstrap' ;
55
6+ import PipelineNameContainer from '../../../containers/PipelineNameContainer' ;
67import Box from '../../widgets/Box' ;
78import Markdown from '../../widgets/Markdown' ;
89import DateTime from '../../widgets/DateTime' ;
10+ import Explanation from '../../widgets/Explanation' ;
911import UsersNameContainer from '../../../containers/UsersNameContainer' ;
10- import ExercisesNameContainer from '../../../containers/ExercisesNameContainer' ;
11- import Icon , { UserIcon , CodeIcon } from '../../icons' ;
12+ import Icon , { UserIcon , CodeIcon , ForkIcon } from '../../icons' ;
1213import EnvironmentsList from '../../helpers/EnvironmentsList' ;
1314import Version from '../../widgets/Version/Version' ;
1415import ParametersList from '../ParametersList/ParametersList' ;
1516
1617const PipelineDetail = ( {
1718 author,
18- exercisesIds,
19- name,
2019 description = '' ,
2120 createdAt,
2221 updatedAt,
2322 version,
2423 runtimeEnvironments,
2524 parameters,
25+ forkedFrom = null ,
2626} ) => (
27- < Box title = { name } noPadding unlimitedHeight >
28- < Table responsive size = "sm" >
27+ < Box
28+ title = { < FormattedMessage id = "app.pipeline.properties" defaultMessage = "Pipeline properties" /> }
29+ noPadding
30+ unlimitedHeight >
31+ < Table responsive size = "sm" className = "mb-1" >
2932 < tbody >
30- { Boolean ( author ) && (
31- < tr >
32- < td className = "text-center shrink-col em-padding-left em-padding-right" >
33- < UserIcon />
34- </ td >
35- < th >
36- < FormattedMessage id = "generic.author" defaultMessage = "Author" /> :
37- </ th >
38- < td >
39- < UsersNameContainer userId = { author } link />
40- </ td >
41- </ tr >
42- ) }
43-
4433 < tr >
45- < td className = "text-center shrink-col em-padding-left em-padding-right " >
46- < Icon icon = { [ 'far' , 'file-alt' ] } />
34+ < td className = "text-center shrink-col px-2 text-muted " >
35+ < UserIcon />
4736 </ td >
48- < th className = "text-nowrap" >
49- < FormattedMessage id = "app.pipeline.title " defaultMessage = "Pipeline Detail " />
37+ < th >
38+ < FormattedMessage id = "generic.author " defaultMessage = "Author " /> :
5039 </ th >
5140 < td >
52- < Markdown source = { description } />
41+ { author ? (
42+ < UsersNameContainer userId = { author } link />
43+ ) : (
44+ < i className = "text-muted" >
45+ ReCodEx
46+ < Explanation id = "no-author" >
47+ < FormattedMessage
48+ id = "app.pipeline.noAuthorExplanation"
49+ defaultMessage = "This is a system pipeline. There is no explicit author."
50+ />
51+ </ Explanation >
52+ </ i >
53+ ) }
5354 </ td >
5455 </ tr >
5556
5657 < tr >
57- < td className = "text-center shrink-col em-padding-left em-padding-right " >
58- < Icon icon = "puzzle-piece" />
58+ < td className = "text-center shrink-col px-2 text-muted " >
59+ < Icon icon = { [ 'far' , 'file-alt' ] } />
5960 </ td >
60- < th >
61- < FormattedMessage id = "app.pipeline.exercises " defaultMessage = "Exercises: " />
61+ < th className = "text-nowrap" >
62+ < FormattedMessage id = "app.pipeline.description " defaultMessage = "Description " /> :
6263 </ th >
6364 < td >
64- { exercisesIds . length !== 0 ? (
65- exercisesIds . map ( exerciseId => (
66- < div key = { exerciseId } >
67- < ExercisesNameContainer exerciseId = { exerciseId } />
68- </ div >
69- ) )
70- ) : (
71- < i >
72- < FormattedMessage id = "app.pipeline.publicExercise" defaultMessage = "Public" />
73- </ i >
74- ) }
65+ < Markdown source = { description } />
7566 </ td >
7667 </ tr >
7768
7869 < tr >
79- < td className = "text-center shrink-col em-padding-left em-padding-right " >
70+ < td className = "text-center shrink-col px-2 text-muted " >
8071 < CodeIcon />
8172 </ td >
8273 < th className = "text-nowrap" >
@@ -88,7 +79,7 @@ const PipelineDetail = ({
8879 </ tr >
8980
9081 < tr >
91- < td className = "text-center shrink-col em-padding-left em-padding-right " >
82+ < td className = "text-center shrink-col px-2 text-muted " >
9283 < Icon icon = "stream" />
9384 </ td >
9485 < th className = "text-nowrap" >
@@ -100,7 +91,7 @@ const PipelineDetail = ({
10091 </ tr >
10192
10293 < tr >
103- < td className = "text-center shrink-col em-padding-left em-padding-right " >
94+ < td className = "text-center shrink-col px-2 text-muted " >
10495 < Icon icon = { [ 'far' , 'clock' ] } />
10596 </ td >
10697 < th >
@@ -112,26 +103,39 @@ const PipelineDetail = ({
112103 </ tr >
113104
114105 < tr >
115- < td className = "text-center shrink-col em-padding-left em-padding-right " >
106+ < td className = "text-center shrink-col px-2 text-muted " >
116107 < Icon icon = { [ 'far' , 'copy' ] } />
117108 </ td >
118109 < th >
119- < FormattedMessage id = "app.pipeline.version" defaultMessage = "Version: " />
110+ < FormattedMessage id = "app.pipeline.version" defaultMessage = "Version" /> :
120111 </ th >
121112 < td >
122113 < Version version = { version } createdAt = { createdAt } updatedAt = { updatedAt } />
123114 </ td >
124115 </ tr >
116+
117+ { forkedFrom && (
118+ < tr >
119+ < td className = "text-center shrink-col px-2 text-muted" >
120+ < ForkIcon />
121+ </ td >
122+ < th >
123+ < FormattedMessage id = "app.pipeline.forkedFrom" defaultMessage = "Forked from" /> :
124+ </ th >
125+ < td >
126+ < PipelineNameContainer pipelineId = { forkedFrom } />
127+ </ td >
128+ </ tr >
129+ ) }
125130 </ tbody >
126131 </ Table >
127132 </ Box >
128133) ;
129134
130135PipelineDetail . propTypes = {
131136 id : PropTypes . string . isRequired ,
132- name : PropTypes . string . isRequired ,
133137 author : PropTypes . string ,
134- exercisesIds : PropTypes . array . isRequired ,
138+ forkedFrom : PropTypes . string ,
135139 description : PropTypes . string ,
136140 createdAt : PropTypes . number . isRequired ,
137141 updatedAt : PropTypes . number . isRequired ,
0 commit comments