[examples/openspending,home][xl]: removes datasets table, implement dataset cards grid, implement country facet
This commit is contained in:
@@ -1,15 +1,17 @@
|
||||
import { FiscalDataPackage } from './datapackage.interface';
|
||||
import { Project } from './project.interface';
|
||||
|
||||
export function loadDataPackage(
|
||||
datapackage: FiscalDataPackage,
|
||||
owner: string,
|
||||
repo: string
|
||||
): Project {
|
||||
export function loadDataPackage(datapackage: FiscalDataPackage, repo): Project {
|
||||
return {
|
||||
name: datapackage.name,
|
||||
owner: { name: owner },
|
||||
repo: { name: repo },
|
||||
title: datapackage.title,
|
||||
owner: {
|
||||
name: repo.owner.login,
|
||||
logo: repo.owner.avatar_url,
|
||||
// TODO: make this title work
|
||||
title: repo.owner.login,
|
||||
},
|
||||
repo: { name: repo, full_name: repo.full_name },
|
||||
files: datapackage.resources,
|
||||
author: datapackage.author ? datapackage.author : null,
|
||||
cityCode: datapackage.cityCode ? datapackage.cityCode : null,
|
||||
@@ -17,7 +19,8 @@ export function loadDataPackage(
|
||||
? (datapackage.countryCode as string)
|
||||
: null,
|
||||
fiscalPeriod: datapackage.fiscalPeriod
|
||||
? { start: datapackage.fiscalPeriod.start
|
||||
? {
|
||||
start: datapackage.fiscalPeriod.start
|
||||
? datapackage.fiscalPeriod.start
|
||||
: null,
|
||||
end: datapackage.fiscalPeriod.end
|
||||
@@ -26,6 +29,6 @@ export function loadDataPackage(
|
||||
}
|
||||
: null,
|
||||
readme: datapackage.readme ? datapackage.readme : '',
|
||||
datapackage
|
||||
datapackage,
|
||||
};
|
||||
}
|
||||
|
||||
@@ -1,8 +1,11 @@
|
||||
import { FiscalDataPackage, TabularDataResource } from "./datapackage.interface";
|
||||
import {
|
||||
FiscalDataPackage,
|
||||
TabularDataResource,
|
||||
} from './datapackage.interface';
|
||||
|
||||
export interface Project {
|
||||
owner: { name: string; logo?: string }; // Info about the owner of the data repo
|
||||
repo: { name: string; logo?: string }; // Info about the the data repo
|
||||
owner: { name: string; logo?: string; title?: string }; // Info about the owner of the data repo
|
||||
repo: { name: string; full_name: string }; // Info about the the data repo
|
||||
files: TabularDataResource[];
|
||||
name: string;
|
||||
title?: string;
|
||||
@@ -14,5 +17,5 @@ export interface Project {
|
||||
end: string;
|
||||
};
|
||||
readme?: string;
|
||||
datapackage: FiscalDataPackage
|
||||
datapackage: FiscalDataPackage;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user