Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Genesys PGR
Genesys Catalog
catalog.genesys-pgr.org
Commits
f39e26ba
Commit
f39e26ba
authored
Jan 21, 2018
by
Matija Obreza
Browse files
Moved Links and Properties from ui/common to ui/catalog
parent
4217bf46
Changes
11
Hide whitespace changes
Inline
Side-by-side
src/ui/c
ommon
/Links.tsx
→
src/ui/c
atalog
/Links.tsx
View file @
f39e26ba
...
...
@@ -12,6 +12,8 @@ import { loadPartner } from 'actions/partner';
import
{
Vocabulary
}
from
'
model/vocabulary.model
'
;
import
{
loadVocabulary
}
from
'
actions/vocabulary
'
;
import
{
Crop
}
from
'
model/crop.model
'
;
import
{
Link
}
from
'
react-router
'
;
interface
IDatasetLinkProps
extends
React
.
Props
<
any
>
{
...
...
@@ -140,5 +142,41 @@ const VocabularyLink_ = ({ to: vocabulary, edit = false, children, loadVocabular
const
VocabularyLink
=
connect
(({})
=>
({}),
(
dispatch
)
=>
bindActionCreators
({
loadVocabulary
},
dispatch
))
(
VocabularyLink_
);
interface
ICropLinkProps
extends
React
.
Props
<
any
>
{
code
:
string
;
crops
:
Map
<
string
,
Crop
>
;
edit
?:
boolean
;
}
class
CropLink1
extends
React
.
Component
<
ICropLinkProps
,
any
>
{
public
render
()
{
const
{
code
,
crops
,
edit
=
false
,
children
}
=
this
.
props
;
const
crop
:
Crop
=
crops
.
get
(
code
);
const
clickMe
=
(
e
)
=>
{
console
.
log
(
'
You clicked me!
'
,
crop
);
};
if
(
crop
)
{
if
(
edit
)
{
return
(
<
Link
to
=
{
`/crops/
${
crop
.
uuid
}
/edit`
}
onClick
=
{
clickMe
}
>
{
children
||
crop
.
title
}
</
Link
>
);
}
else
{
return
(
// Could link to Crop page if we had one :-)
<
span
>
{
children
||
crop
.
title
}
</
span
>
);
}
}
else
{
// no crop
return
<
span
>
{
children
||
code
}
</
span
>;
}
}
}
const
CropLink
=
connect
(({})
=>
((
state
,
ownProps
)
=>
({
crops
:
state
.
lookups
.
crops
})),
null
)
(
CropLink1
);
export
{
DatasetLink
,
DescriptorLink
,
DescriptorListLink
,
FaoWiewsLink
,
PartnerLink
,
VocabularyLink
};
export
{
DatasetLink
,
DescriptorLink
,
DescriptorListLink
,
FaoWiewsLink
,
PartnerLink
,
VocabularyLink
,
CropLink
};
src/ui/c
ommon
/Properties.tsx
→
src/ui/c
atalog
/Properties.tsx
View file @
f39e26ba
File moved
src/ui/catalog/descriptor/DescriptorCard.tsx
View file @
f39e26ba
...
...
@@ -9,7 +9,7 @@ import Button from 'material-ui/Button';
import
{
Descriptor
}
from
'
model/descriptor.model
'
;
import
{
VocabularyTerm
}
from
'
model/vocabulary.model
'
;
import
{
DescriptorLink
,
PartnerLink
}
from
'
ui/c
ommon
/Links
'
;
import
{
DescriptorLink
,
PartnerLink
}
from
'
ui/c
atalog
/Links
'
;
// TODO Introduce T function to the project
...
...
src/ui/catalog/descriptorlist/Card.tsx
View file @
f39e26ba
import
*
as
React
from
'
react
'
;
import
{
DescriptorList
}
from
'
model/descriptor.model
'
;
import
{
DescriptorListLink
}
from
'
ui/c
ommon
/Links
'
;
import
{
Properties
,
PropertiesItem
}
from
'
ui/c
ommon
/Properties
'
;
import
{
DescriptorListLink
,
CropLink
}
from
'
ui/c
atalog
/Links
'
;
import
{
Properties
,
PropertiesItem
}
from
'
ui/c
atalog
/Properties
'
;
import
Card
,
{
CardHeader
,
CardContent
}
from
'
material-ui/Card
'
;
import
Divider
from
'
material-ui/Divider
'
;
...
...
@@ -19,7 +19,7 @@ const DescriptorListCard = ({descriptorList, className}: {descriptorList: Descri
<
CardContent
>
<
Markdown
className
=
"mb-20"
textLength
=
{
200
}
source
=
{
descriptorList
.
description
}
/>
<
Properties
>
{
descriptorList
.
crop
&&
<
PropertiesItem
title
=
"Crop:"
>
{
descriptorList
.
crop
}
</
PropertiesItem
>
}
{
descriptorList
.
crop
&&
<
PropertiesItem
title
=
"Crop:"
>
<
CropLink
code
=
{
descriptorList
.
crop
}
/>
</
PropertiesItem
>
}
<
PropertiesItem
title
=
"Publisher:"
>
{
descriptorList
.
publisher
||
<
i
>
Not specified
</
i
>
}
</
PropertiesItem
>
<
PropertiesItem
title
=
"Version:"
>
{
descriptorList
.
versionTag
}
</
PropertiesItem
>
</
Properties
>
...
...
src/ui/pages/dashboard/c/MyDataTable.tsx
View file @
f39e26ba
...
...
@@ -8,7 +8,7 @@ import Tabs, {Tab} from 'ui/common/Tabs';
import
{
Table
,
TableRow
,
TableCell
}
from
'
ui/common/tables
'
;
import
PaginationComponent
from
'
ui/common/pagination
'
;
import
{
ContentContainer
}
from
'
ui/layout/Container
'
;
import
{
DatasetLink
,
DescriptorLink
,
DescriptorListLink
}
from
'
ui/c
ommon
/Links
'
;
import
{
DatasetLink
,
DescriptorLink
,
DescriptorListLink
}
from
'
ui/c
atalog
/Links
'
;
import
Paper
from
'
material-ui/Paper
'
;
import
Button
from
'
material-ui/Button
'
;
...
...
src/ui/pages/dataset/c/Card.tsx
View file @
f39e26ba
...
...
@@ -8,8 +8,8 @@ import Divider from 'material-ui/Divider';
import
{
Link
}
from
'
react-router
'
;
import
Markdown
from
'
ui/common/markdown
'
;
import
{
PartnerLink
}
from
'
ui/c
ommon
/Links
'
;
import
{
Properties
,
PropertiesItem
}
from
'
ui/c
ommon
/Properties
'
;
import
{
PartnerLink
}
from
'
ui/c
atalog
/Links
'
;
import
{
Properties
,
PropertiesItem
}
from
'
ui/c
atalog
/Properties
'
;
interface
IDatasetCardProps
extends
React
.
ClassAttributes
<
any
>
{
className
?:
string
;
...
...
src/ui/pages/dataset/c/DatasetDisplay.tsx
View file @
f39e26ba
...
...
@@ -16,7 +16,7 @@ import confirm from 'utilities/confirmAlert';
import
Authorize
from
'
ui/common/authorized/Authorize
'
;
import
Section
from
'
ui/common/layout/Section
'
;
import
Markdown
from
'
ui/common/markdown
'
;
import
{
DatasetLink
,
DescriptorLink
}
from
'
ui/c
ommon
/Links
'
;
import
{
DatasetLink
,
DescriptorLink
}
from
'
ui/c
atalog
/Links
'
;
import
Summary
from
'
./Summary
'
;
import
LocationMap
from
'
./LocationMap
'
;
...
...
src/ui/pages/descriptor/DisplayPage.tsx
View file @
f39e26ba
...
...
@@ -13,7 +13,7 @@ import Loading from 'ui/common/Loading';
import
Section
from
'
ui/common/layout/Section
'
;
import
Markdown
from
'
ui/common/markdown
'
;
import
ContentHeaderWithButton
from
'
ui/common/heading/ContentHeaderWithButton
'
;
import
{
PartnerLink
,
DescriptorLink
}
from
'
ui/c
ommon
/Links
'
;
import
{
PartnerLink
,
DescriptorLink
}
from
'
ui/c
atalog
/Links
'
;
import
{
Table
,
TableRow
,
TableCell
}
from
'
ui/common/tables
'
;
import
VocabularyCard
from
'
ui/pages/vocabulary/c/VocabularyCard
'
;
...
...
src/ui/pages/descriptorlist/DisplayPage.tsx
View file @
f39e26ba
...
...
@@ -13,8 +13,8 @@ import Loading from 'ui/common/Loading';
import
Markdown
from
'
ui/common/markdown
'
;
import
DescriptorCard
from
'
ui/catalog/descriptor/DescriptorCard
'
;
import
ContentHeaderWithButton
from
'
ui/common/heading/ContentHeaderWithButton
'
;
import
{
PartnerLink
,
DescriptorListLink
}
from
'
ui/c
ommon
/Links
'
;
import
{
Properties
,
PropertiesItem
}
from
'
ui/c
ommon
/Properties
'
;
import
{
PartnerLink
,
DescriptorListLink
,
CropLink
}
from
'
ui/c
atalog
/Links
'
;
import
{
Properties
,
PropertiesItem
}
from
'
ui/c
atalog
/Properties
'
;
import
Grid
from
'
material-ui/Grid
'
;
import
Card
,
{
CardHeader
,
CardContent
,
CardActions
}
from
'
material-ui/Card
'
;
...
...
@@ -124,7 +124,7 @@ class DescriptorListPage extends React.Component<IDescriptorListPageProps, any>
}
public
render
()
{
const
{
classes
,
uuid
,
descriptorList
}
=
this
.
props
;
const
{
classes
,
uuid
,
descriptorList
}
=
this
.
props
;
const
stillLoading
:
boolean
=
(
!
descriptorList
||
(
uuid
&&
(
descriptorList
.
uuid
!==
uuid
)));
...
...
@@ -146,7 +146,7 @@ class DescriptorListPage extends React.Component<IDescriptorListPageProps, any>
<
Properties
>
{
descriptorList
.
crop
&&
<
PropertiesItem
title
=
"Crop:"
>
{
descriptorList
.
crop
}
</
PropertiesItem
>
}
<
PropertiesItem
title
=
"Crop:"
>
<
CropLink
code
=
{
descriptorList
.
crop
}
/>
</
PropertiesItem
>
}
<
PropertiesItem
title
=
"Publisher:"
>
{
descriptorList
.
publisher
||
<
i
>
Not specified
</
i
>
}
</
PropertiesItem
>
...
...
src/ui/pages/partner/DisplayPage.tsx
View file @
f39e26ba
...
...
@@ -9,7 +9,7 @@ import {Partner} from 'model/partner.model';
import
confirm
from
'
utilities/confirmAlert
'
;
import
Loading
from
'
ui/common/Loading
'
;
import
Markdown
from
'
ui/common/markdown
'
;
import
{
FaoWiewsLink
}
from
'
ui/c
ommon
/Links
'
;
import
{
FaoWiewsLink
}
from
'
ui/c
atalog
/Links
'
;
import
Grid
from
'
material-ui/Grid
'
;
import
Card
,
{
CardHeader
,
CardContent
,
CardActions
}
from
'
material-ui/Card
'
;
...
...
src/ui/pages/vocabulary/DisplayPage.tsx
View file @
f39e26ba
...
...
@@ -12,7 +12,7 @@ import Section from 'ui/common/layout/Section';
import
Markdown
from
'
ui/common/markdown
'
;
import
ContentHeaderWithButton
from
'
ui/common/heading/ContentHeaderWithButton
'
;
import
{
Table
,
TableRow
,
TableCell
}
from
'
ui/common/tables
'
;
import
{
VocabularyLink
}
from
'
ui/c
ommon
/Links
'
;
import
{
VocabularyLink
}
from
'
ui/c
atalog
/Links
'
;
import
Grid
from
'
material-ui/Grid
'
;
import
Card
,
{
CardHeader
,
CardContent
,
CardActions
}
from
'
material-ui/Card
'
;
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment