Commit 5babcd5e authored by Matija Obreza's avatar Matija Obreza
Browse files

Fix: Owner not listed in dashboard

parent 0a0f8457
Pipeline #7063 passed with stages
in 5 minutes and 20 seconds
......@@ -16,6 +16,7 @@ import DatasetService from 'service/DatasetService';
// Utility
import { log } from 'utilities/debug';
import { dereferenceReferences } from 'utilities';
const removeDataset = (dataset: Dataset) => ({
type: DASHBOARD_REMOVE_DATASET, payload: dataset,
......@@ -47,6 +48,7 @@ function listMyDatasets(page?, results?, sortBy?: string[], filter?: string | Da
return DatasetService.myDatasets(filter, { page, size: results, properties: sortBy, direction: order })
.then((paged) => {
dereferenceReferences(paged.content, 'owner');
if (paged.number === 0) {
dispatch(receiveDatasetPage(paged, page, results, sortBy, filter, order));
} else {
......
......@@ -17,6 +17,7 @@ import DescriptorListService from 'service/DescriptorListService';
// Util
import { log } from 'utilities/debug';
import { dereferenceReferences } from 'utilities';
const receiveDescriptorLists = (paged: Page<DescriptorList>, page, results, sortBy, filter: string | DescriptorListFilter, order) => ({
......@@ -51,14 +52,15 @@ export const listMyDescriptorLists = (page?, results?, sortBy?: string[], filter
return DescriptorListService.myDescriptorLists(filter, { page, size: results, properties: sortBy, direction: order })
// receive the current descriptor list
.then((descriptorLists) => {
if (descriptorLists.number === 0) {
dispatch(receiveDescriptorLists(descriptorLists, page, results, sortBy, descriptorLists.filter, order));
.then((paged) => {
dereferenceReferences(paged.content, 'owner');
if (paged.number === 0) {
dispatch(receiveDescriptorLists(paged, page, results, sortBy, paged.filter, order));
} else {
dispatch(appendDescriptorLists(descriptorLists, page, results, sortBy, descriptorLists.filter, order));
dispatch(appendDescriptorLists(paged, page, results, sortBy, paged.filter, order));
}
dispatch(loadDescriptorListTitles(descriptorLists.content));
return dispatch(addFilterCode(descriptorLists.filterCode, descriptorLists.filter));
dispatch(loadDescriptorListTitles(paged.content));
return dispatch(addFilterCode(paged.filterCode, paged.filter));
}).catch((error) => {
log(`Error loading my descriptor lists`, error);
});
......
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