Commit 65a1d30a authored by Matija Obreza's avatar Matija Obreza

Merge branch '275-accessions-map-list-selected-accessions' into 'master'

Accessions map: list selected accessions

Closes #275

See merge request genesys-pgr/genesys-ui!288
parents e3674e8b f33c57b0
......@@ -442,6 +442,7 @@
"andMore": "And {{otherMore}} more",
"kml": "KML",
"filterAccessions": "Filter accessions",
"selectArea": "Select area",
"pick": "Show climate",
"stopPick": "Cancel",
"noClimateData": "No climate data available for selected location",
......
......@@ -388,9 +388,9 @@
"dev": true
},
"@types/prop-types": {
"version": "15.5.8",
"resolved": "https://registry.npmjs.org/@types/prop-types/-/prop-types-15.5.8.tgz",
"integrity": "sha512-3AQoUxQcQtLHsK25wtTWIoIpgYjH3vSDroZOUr7PpCHw/jLY1RB9z9E8dBT/OSmwStVgkRNvdh+ZHNiomRieaw=="
"version": "15.7.1",
"resolved": "https://registry.npmjs.org/@types/prop-types/-/prop-types-15.7.1.tgz",
"integrity": "sha512-CFzn9idOEpHrgdw8JsoTkaDDyRWk1jrzIV8djzcgpq0y9tG4B4lFT+Nxh52DVpDXV+n4+NPNv7M1Dj5uMp6XFg=="
},
"@types/q": {
"version": "1.5.2",
......@@ -399,9 +399,9 @@
"dev": true
},
"@types/react": {
"version": "16.7.18",
"resolved": "https://registry.npmjs.org/@types/react/-/react-16.7.18.tgz",
"integrity": "sha512-Tx4uu3ppK53/iHk6VpamMP3f3ahfDLEVt3ZQc8TFm30a1H3v9lMsCntBREswZIW/SKrvJjkb3Hq8UwO6GREBng==",
"version": "16.8.6",
"resolved": "https://registry.npmjs.org/@types/react/-/react-16.8.6.tgz",
"integrity": "sha512-bN9qDjEMltmHrl0PZRI4IF2AbB7V5UlRfG+OOduckVnRQ4VzXVSzy/1eLAh778IEqhTnW0mmgL9yShfinNverA==",
"requires": {
"@types/prop-types": "*",
"csstype": "^2.2.0"
......@@ -6941,6 +6941,11 @@
"resolved": "https://registry.npmjs.org/is-in-browser/-/is-in-browser-1.1.3.tgz",
"integrity": "sha1-Vv9NtoOgeMYILrldrX3GLh0E+DU="
},
"is-mobile": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/is-mobile/-/is-mobile-2.0.0.tgz",
"integrity": "sha512-k2+p7BBCzhqHMdYJwGUNNo+6zegGiMIVbM6bEPzxWXpQV6BUzV892UW0oDFgqxT6DygO7LdxRbwC0xmOhJdbew=="
},
"is-negated-glob": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/is-negated-glob/-/is-negated-glob-1.0.0.tgz",
......
......@@ -78,6 +78,7 @@
"andMore": "And {{otherMore}} more",
"kml": "KML",
"filterAccessions": "Filter accessions",
"selectArea": "Select area",
"pick": "Show climate",
"stopPick": "Cancel",
"noClimateData": "No climate data available for selected location",
......
This diff is collapsed.
......@@ -31,7 +31,9 @@ export default function crop(state = INITIAL_STATE, action: IReducerAction = {ty
return updateIndex === -1 ?
update(state, {
details: {$set: null},
list: {$push: action.payload ? [action.payload] : []},
list: {
data: {$push: action.payload ? [action.payload] : []},
},
})
:
update(state, {
......
......@@ -51,8 +51,9 @@ function datasetsPublic(state = INITIAL_STATE, action: { type?: string, payload?
accessionRefs: { $set: mustRemoveAccessions ? null : state.accessionRefs },
paged: {
content: {
[receivedIndex]: { $set: apiCall },
[receivedIndex]: { $set: apiCall.data },
},
loading: {$set: false},
},
});
} else {
......
......@@ -12,7 +12,7 @@ import { loadCrops } from 'crop/actions/public';
import DescriptorPicker from 'descriptors/ui/c/DescriptorPicker';
import { importDescriptor } from 'descriptors/actions/editor';
import { listAccessibleDescriptors, moreAccessibleDescriptors, clearDescriptors } from 'descriptors/actions/dashboard';
import Page, { IPageRequest } from 'model/Page';
import Page, { IPageRequest, SortDirection } from 'model/Page';
import Pagination from 'model/Pagination';
import {
loadDescriptorList, saveDescriptorList, addDescriptorsToDescriptorList, removeDescriptorsFromDescriptorList,
......@@ -43,7 +43,7 @@ interface IDescriptorListProps extends React.ClassAttributes<any> {
class SelectDescriptorsStep extends StepperTemplate<IDescriptorListProps> {
protected static needs = [
({ search }) => listAccessibleDescriptors({ page: parse(search).p, size: parse(search).l, properties: parse(search).s, direction: parse(search).d }),
({ search }) => listAccessibleDescriptors({ page: +parse(search).p, size: +parse(search).l, properties: [...parse(search).s], direction: parse(search).d as SortDirection }),
];
protected renderContent = () => (
<DescriptorPicker
......
......@@ -30,6 +30,7 @@ function dashboardInstitutes(state = INITIAL_STATE, action: IReducerAction) {
content: {
[receivedIndex]: {$set: apiCall.data},
},
loading: {$set: false},
},
});
} else {
......
......@@ -31,6 +31,7 @@ function publicInstitutes(state = INITIAL_STATE, action: IReducerAction) {
content: {
[receivedIndex]: {$set: apiCall.data},
},
loading: {$set: false},
},
});
} else {
......
......@@ -144,7 +144,7 @@ export default function admin(state = INITIAL_STATE, action: IReducerAction) {
// only update lastRun
const {apiCall} = action.payload;
return update(state, {
exec: { details: { lastRun: { $set: apiCall.data } } },
exec: { details: { lastRun: { $set: apiCall.data } } as any },
});
}
case ADMIN_RECEIVE_EXEC_RUNS: {
......
......@@ -10,7 +10,7 @@ const INITIAL_STATE: {
clientId: string;
googleClientId: string;
lang: string,
anonToken: string,
anonToken: any,
} = {
frontendUrl: 'http://localhost:3000',
frontendPath: '',
......
......@@ -3,7 +3,7 @@ import update from 'immutability-helper';
import { UPDATE_HISTORY } from 'constants/history';
const INITIAL_STATE: {
hasHistory: false,
hasHistory: boolean,
lastLocation: string;
} = {
hasHistory: false,
......
......@@ -40,6 +40,7 @@ function publicSubsets(state = INITIAL_STATE, action: IReducerAction) {
content: {
[receivedIndex]: { $set: apiCall },
},
loading: {$set: false},
},
});
} else {
......
......@@ -43,7 +43,7 @@ const mapStateToProps = (state, ownProps) => ({
pageSort: parse(ownProps.location.search).s || 'lastModifiedDate', // page sort
pageDir: parse(ownProps.location.search).d || 'DESC', // page sort direction
filterCode: parse(ownProps.location.search).filter, // filter code
filter: state.filterCode.filters && parse(ownProps.location.search).filter && state.filterCode.filters[parse(ownProps.location.search).filter] || null,
filter: state.filterCode.filters && parse(ownProps.location.search).filter && state.filterCode.filters[parse(ownProps.location.search).filter as string] || null,
});
const mapDispatchToProps = (dispatch) => bindActionCreators({
......
......@@ -122,7 +122,7 @@ const mapStateToProps = (state, ownProps) => ({
pageSort: parse(ownProps.location.search).s, // page sort
pageDir: parse(ownProps.location.search).d, // page sort direction
filterCode: parse(ownProps.location.search).filter, // filter code
filter: state.filterCode.filters && parse(ownProps.location.search).filter && state.filterCode.filters[parse(ownProps.location.search).filter] || null,
filter: state.filterCode.filters && parse(ownProps.location.search).filter && state.filterCode.filters[parse(ownProps.location.search).filter as string] || null,
});
const mapDispatchToProps = (dispatch) => bindActionCreators({
......
......@@ -96,13 +96,21 @@ export default function user(state = INITIAL_STATE, action: IReducerAction) {
}
case ADMIN_RECEIVE_OAUTH_CLIENT: {
const { apiCall } = action.payload;
return update(state, {
return state.oAuthClient ? update(state, {
oAuthClient: {
$set: {
data: {
clientDetails: {$set: apiCall.data},
},
},
})
: update(state, {
oAuthClient: {
$set: {
...apiCall,
data: {
clientDetails: apiCall.data,
},
},
},
});
}
......
......@@ -51,11 +51,11 @@ class EditOAuthClientPage extends React.Component<IEditPageProps, any> {
public render() {
const { oAuthClient, t } = this.props;
const clientDetails = oAuthClient && oAuthClient.clientDetails !== null ? oAuthClient.clientDetails : new OAuthClient();
const clientDetails = oAuthClient && oAuthClient.clientDetails ? oAuthClient.clientDetails : new OAuthClient();
return clientDetails === null ? (<Loading/>) : (
<div>
<ContentHeaderWithButton title={ clientDetails.title || t('user.admin.p.oAuthEdit.createNew') }/>
<ContentHeaderWithButton title={ clientDetails && clientDetails.title || t('user.admin.p.oAuthEdit.createNew') }/>
<PageContents className="pt-1rem">
<Card>
<CardContent>
......
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