Commit b56fdb83 authored by Matija Obreza's avatar Matija Obreza
Browse files

Edit and display Partner description text

parent 0a9d902e
Pipeline #3537 passed with stages
in 4 minutes and 26 seconds
import * as React from 'react';
interface IMarkdownTextProps extends React.ClassAttributes<any> {
value: string;
}
export default function MarkdownText({value}: IMarkdownTextProps) {
return ( <div className="markdown">{ value }</div> );
}
......@@ -2,6 +2,7 @@ import * as React from 'react';
import { Partner } from '../../../model/partner.model';
import Heading from '../../common/heading';
import MarkdownText from '../../common/markdown';
import { Badge } from 'react-bootstrap';
interface IProps extends React.Props<any> {
......@@ -20,9 +21,10 @@ export default function PartnerDisplay({
<Badge>
<span>ID: { partner.id }</span>
</Badge>
{ partner.shortName && <Badge><span>Version: { partner.shortName }</span></Badge> }
{ partner.shortName && <Badge><span>Acronym: { partner.shortName }</span></Badge> }
</div>
{ partner.description && <MarkdownText value={ partner.description } /> }
</div>
);
}
......@@ -11,14 +11,16 @@ class PartnerForm extends React.Component<any, void> {
console.log('Initial values', this.props.initialValues);
const {error, handleSubmit} = this.props;
return (
<Col md={ 3 }>
<Col md={ 6 }>
<form onSubmit={ handleSubmit }>
<Heading title={ this.props.initialValues.name } level={ 2 }/>
<Field name="name" component={ TextField } type="text" label="Partner name"
placeholder="Partner name" value={ this.props.initialValues.name }/>
<Field name="shortName" component={ TextField } type="textarea" label="Short name or acronym"
placeholder="IBM" value={ this.props.initialValues.shortName }/>
<Field name="description" component={ TextField } multiline label="Description"
placeholder="Partner introduction text (markdown)"
value={ this.props.initialValues.description } />
<div>{ error && <strong>{ error }</strong> }</div>
<Button type="submit" bsStyle="primary">Save changes</Button>
</form>
......
......@@ -101,12 +101,12 @@ class PartnerCard extends React.Component<IPartnerCardProps, any> {
</Link> as any
)
}
subheader={ partner.createdDate || 'Joined 1 month ago' }
subheader={ 'Replace with pretty time for partner.createdDate' }
/>
<Divider />
<CardContent>
<Typography component="p" className={ classes.partnerDescription }>
{ partner.shortName }
{ partner.description }
</Typography>
<Grid container spacing={ 0 } className={ classes.tableWrapper }>
<Grid item xs={ 12 }>
......
......@@ -3,6 +3,7 @@ import { UuidModel } from './common.model';
class Partner extends UuidModel {
public name: string;
public shortName: string;
public description: string;
public wiewsCodes: string[];
public constructor(obj?) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment