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

Fixes for dataset Creator summary, creation

parent e3d9e88a
Pipeline #3920 passed with stages
in 2 minutes and 28 seconds
......@@ -7,7 +7,7 @@ export class CreatorService {
public static createCreator(token: string, uuid: string): Promise<Creator> {
console.log('Create Creator');
const creator = { role: CreatorRole.CONTACT };
const creator = { role: CreatorRole.CONTACT, fullName: '' };
return authenticatedRequest(token, {
url: `${MAIN_URL_PART_CREATOR_URL}/${uuid}${CREATE_CREATOR_URL}`,
method: 'POST',
......
......@@ -60,11 +60,17 @@ interface ISummaryProps extends React.ClassAttributes<any> {
class Summary extends React.Component<ISummaryProps, any> {
protected renderName = (creators) => {
if (! creators || creators.length === 0) {
return null;
}
const creator: Creator = creators.find((e) => e.role === CreatorRole.CONTACT);
if (creator) {
return `${creator.fullName}`;
} else {
return null;
}
return '';
}
public render() {
......
......@@ -105,7 +105,6 @@ class DatasetCreatorForm extends React.Component<IDatasetCreatorFormProps, any>
placeholder="Jane A. Doe"
onBlur={ this.updateCreator(fields, index) }
/>
/>
<Field name={ `${creator}.email` } component={ TextField } type="text" label="Email*"
placeholder="Email*"
onBlur={ this.updateCreator(fields, index) }
......
......@@ -58,10 +58,6 @@ export default(
</Route>
</Route>
<Route path="/datasets">
<Route component={ DatasetWrapper }>
<IndexRoute exact component={ DatasetBrowsePage } />
<Route path=":uuid" component={ DatasetDetail } />
</Route>
<Route component={ DatasetStepper }>
<Route path="edit" exact component={ BasicInfoStep } />
<Route path=":uuid/edit">
......@@ -73,6 +69,10 @@ export default(
<Route exact path="review-and-publish" component={ ReviewAndPublishStep } />
</Route>
</Route>
<Route component={ DatasetWrapper }>
<IndexRoute exact component={ DatasetBrowsePage } />
<Route path=":uuid" component={ DatasetDetail } />
</Route>
</Route>
<Route path="/descriptorlist" component={ DescriptorListWrapper }>
<IndexRoute exact component={ DescriptorListBrowsePage } />
......
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