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

Fixed little issues

- Genesys "text logo" White color
- Reload vocabularies after auto-update
- Also update WIEWS vocabulary
- Descriptor link not a link if not published || no permissions to modify
- Crop page background color and margins
- Don't display owner when there is publisher
- Descriptor Lists pagination says "lists"
- Partner URL links fixed
parent e8ee70c4
Pipeline #4381 passed with stages
in 2 minutes and 44 seconds
......@@ -3,7 +3,7 @@
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
viewBox="0 0 56.2 14" style="enable-background:new 0 0 56.2 14;" xml:space="preserve">
<style type="text/css">
.st0{fill:#E7E5DF;}
.st0{fill:#FFFFFF;}
</style>
<g>
<path class="st0" d="M8.2,9.4c-0.3,0.4-0.7,0.7-1.3,1.1C6.2,10.8,5.4,11,4.4,11c-1.3,0-2.3-0.4-3.2-1.2C0.4,8.9,0,7.9,0,6.6V4.4
......
......@@ -105,12 +105,9 @@ const saveVocabulary = (vocabulary: Vocabulary) => (dispatch, getState) => {
});
};
const autoUpdate = (pagination) => (dispatch, getState) => {
const autoUpdate = () => (dispatch, getState) => {
return VocabularyService.update(getState().login.access_token)
.then(() => {
return dispatch(listVocabularies(pagination.page, pagination.size, pagination.sort, pagination.filter, pagination.dir));
});
return VocabularyService.update(getState().login.access_token);
};
export {
......
......@@ -10,6 +10,7 @@ import { API_BASE_URL } from 'constants/apiURLS';
const API_URL = `${API_BASE_URL}/vocabulary`;
const GEO_URL = `${API_BASE_URL}/geo/update`;
const LANG_URL = `${API_BASE_URL}/lang/update`;
const WIEWS_URL = `${API_BASE_URL}/wiews/update`;
export class VocabularyService {
// List my vocabularies
......@@ -94,6 +95,10 @@ export class VocabularyService {
url: LANG_URL,
method: 'POST',
}),
authenticatedRequest(token, {
url: WIEWS_URL,
method: 'POST',
}),
]);
}
}
......@@ -67,12 +67,14 @@ function DescriptorLink({
{ children || descriptor.title }
</Link>
);
} else {
} else if (descriptor.published || descriptor._permissions.write) {
return (
<Link to={ `/descriptor/${descriptor.uuid}` }>
{ children || descriptor.title }
</Link>
);
} else {
return children || descriptor.title;
}
}
......
......@@ -36,9 +36,9 @@ class BrowsePage extends React.Component<IBrowsePageProps & any, any> {
<Authorize role="ROLE_ADMINISTRATOR">
<ContentHeaderWithButton title="What do you want to do?" buttons={ <Button raised onClick={ createCrop }>Add crop</Button> } />
</Authorize>
<Grid container>
{ crops && crops.map((crop: Crop) => (
<Grid key={ `${crop.code}` } item xs={ 12 } md={ 2 }>
<Grid container spacing={ 0 } className="back-gray">
{ crops && crops.sort((a, b) => a.title.localeCompare(b.title)).map((crop: Crop) => (
<Grid key={ `${crop.code}` } item xs={ 12 } sm={ 6 } md={ 3 } lg={ 2 }>
<CropCard className="m-20" crop={ crop } />
</Grid>
)) }
......
......@@ -121,6 +121,8 @@ class DisplayPage extends React.Component<IDisplayPageProps, any> {
<PropertiesItem title="Publisher:">{ descriptor.publisher || <i>Not specified</i> }</PropertiesItem>
<PropertiesItem title="Version:">{ descriptor.versionTag }</PropertiesItem>
<PropertiesItem title="Category:">{ descriptor.category }</PropertiesItem>
{ (descriptor.publisher === null && descriptor.owner) &&
<PropertiesItem title="Maintained by:"><PartnerLink to={ descriptor.owner } /></PropertiesItem> }
</Properties>
</CardContent>
......
......@@ -98,7 +98,7 @@ class BrowsePage extends React.Component<IBrowsePageProps, any> {
<Grid container spacing={ 0 }>
<Grid item xs={ 12 }>
<PaginationComponent pageObj={ paged }
onChange={ this.onPaginationChange } displayName="datasets"
onChange={ this.onPaginationChange } displayName="lists"
sortOptions={ DescriptorList.SORT_OPTIONS } />
</Grid>
<Grid item xs={ 12 }>
......@@ -119,7 +119,7 @@ class BrowsePage extends React.Component<IBrowsePageProps, any> {
<Grid container spacing={ 0 }>
<Grid item xs={ 12 }>
<PaginationComponent pageObj={ paged }
onChange={ this.onPaginationChange } displayName="datasets"
onChange={ this.onPaginationChange } displayName="lists"
sortOptions={ DescriptorList.SORT_OPTIONS } />
</Grid>
</Grid>
......
......@@ -153,7 +153,7 @@ class DescriptorListPage extends React.Component<IDescriptorListPageProps, any>
{ descriptorList.bibliographicCitation &&
<PropertiesItem title="Bibliographic citation:">{ descriptorList.bibliographicCitation }</PropertiesItem> }
{ descriptorList.owner &&
{ (descriptorList.publisher === null && descriptorList.owner) &&
<PropertiesItem title="Maintained by:"><PartnerLink to={ descriptorList.owner } /></PropertiesItem> }
<PropertiesItem title="Version:">{ descriptorList.versionTag }</PropertiesItem>
......
......@@ -83,7 +83,7 @@ class PartnerPage extends React.Component<IPartnerPageProps, any> {
{ partner.urls.length > 0 && (
<PropertiesItem title="Websites:">
{ partner.urls.map((url) => (
<div key={ url }><a href="{ url }" target="_blank" rel="nofollow">{ url }</a></div>
<div key={ url }><a href={ url } target="_blank" rel="nofollow">{ url }</a></div>
)) }
</PropertiesItem>
) }
......
......@@ -70,7 +70,11 @@ class BrowsePage extends React.Component<IBrowsePageProps & any, any> {
protected autoUpdate = () => {
const {autoUpdate, pagination} = this.props;
autoUpdate(pagination);
autoUpdate()
.then(() => {
console.log('Vocabularies are updated');
listVocabularies(pagination.page, pagination.size, pagination.sort, pagination.filter, pagination.dir);
});
}
public render() {
......
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