@@ -26,6 +26,7 @@ import ConfirmModal from '../../common/components/ConfirmModal'
2626import SelectFileModal from '../../common/components/SelectFileModal'
2727import WatchButton from '../../common/containers/WatchButton'
2828import FeedLabel from '../../common/components/FeedLabel'
29+ import LabelAssignerModal from '../components/LabelAssignerModal'
2930import type { Props as ContainerProps } from '../containers/FeedSourceTableRow'
3031import type { Feed , ValidationSummary } from '../../types'
3132import type {
@@ -131,7 +132,8 @@ export default class FeedSourceTableRow extends PureComponent<Props> {
131132 const {
132133 comparisonColumn,
133134 comparisonValidationSummary,
134- feedSource
135+ feedSource,
136+ project
135137 } = this . props
136138
137139 // data for feed source info column
@@ -181,7 +183,7 @@ export default class FeedSourceTableRow extends PureComponent<Props> {
181183 return (
182184 < tr key = { feedSource. id } className = 'feed-source-table-row' >
183185 < td className = 'feed-source-info' >
184- < FeedInfo feedSource = { feedSource } />
186+ < FeedInfo feedSource = { feedSource } project = { project } />
185187 </ td >
186188 { comparisonColumn &&
187189 < td className = 'comparison-column' >
@@ -226,9 +228,9 @@ export default class FeedSourceTableRow extends PureComponent<Props> {
226228 }
227229}
228230
229- class FeedInfo extends PureComponent < { feedSource : Feed } > {
231+ class FeedInfo extends PureComponent < { feedSource : Feed , project : Project } > {
230232 render ( ) {
231- const { feedSource} = this . props
233+ const { feedSource, project } = this . props
232234
233235 const lastUpdateText = feedSource . lastUpdated
234236 ? `Last updated ${ moment ( feedSource . lastUpdated ) . format ( dateFormat ) } `
@@ -241,40 +243,53 @@ class FeedInfo extends PureComponent<{ feedSource: Feed }> {
241243 </ h4 >
242244 < h5 > { lastUpdateText } </ h5 >
243245 < Row >
244- { feedSource . url &&
246+ { feedSource . url && (
245247 < Col xs = { 12 } >
246248 < Icon type = 'link' />
247249 < a href = { feedSource . url } target = '_blank' >
248250 { abbreviate ( feedSource . url ) }
249251 < Icon type = 'external-link' />
250252 </ a >
251253 </ Col >
252- }
253- { feedSource . retrievalMethod === 'FETCHED_AUTOMATICALLY' &&
254+ ) }
255+ { feedSource . retrievalMethod === 'FETCHED_AUTOMATICALLY' && (
254256 < Col xs = { 6 } >
255257 < Icon type = 'feed' />
256258 Auto fetch
257259 </ Col >
258- }
259- { feedSource . deployable &&
260+ ) }
261+ { feedSource . deployable && (
260262 < Col xs = { 6 } >
261263 < Icon type = 'rocket' />
262264 Deployable
263265 </ Col >
264- }
266+ ) }
265267 < Col xs = { 6 } >
266268 < Icon type = { feedSource . isPublic ? 'globe' : 'lock' } />
267269 { feedSource . isPublic ? 'Public' : 'Private' }
268270 </ Col >
269- { feedSource . labels . length > 0 &&
270271 < Col xs = { 12 } >
271272 < div className = 'feedSourceLabelRow' >
272273 < Icon type = { 'tag' } />
274+ < LabelAssignerModal
275+ ref = 'labelAssignerModal'
276+ feedSource = { feedSource }
277+ project = { project }
278+ />
279+ < button
280+ className = 'labelActionButton small'
281+ style = { { marginRight : '5px' } }
282+ onClick = { ( ) => this . refs . labelAssignerModal . open ( ) }
283+ >
284+ Edit
285+ </ button >
273286 < div className = 'feedLabelContainer' >
274- { feedSource . labels . map ( label => < FeedLabel small key = { label . id } label = { label } /> ) }
287+ { feedSource . labels . map ( ( label ) => (
288+ < FeedLabel small key = { label . id } label = { label } />
289+ ) ) }
275290 </ div >
276291 </ div >
277- </ Col > }
292+ </ Col >
278293 </ Row >
279294 </ div >
280295 )
0 commit comments