diff --git a/.changeset/lovely-ghosts-sin.md b/.changeset/lovely-ghosts-sin.md new file mode 100644 index 000000000..59a28e76a --- /dev/null +++ b/.changeset/lovely-ghosts-sin.md @@ -0,0 +1,5 @@ +--- +'@portaljs/components': patch +--- + +fix bug when there were multiple flatuitable components at the same time diff --git a/.changeset/rare-pianos-repair.md b/.changeset/rare-pianos-repair.md new file mode 100644 index 000000000..de9f69c10 --- /dev/null +++ b/.changeset/rare-pianos-repair.md @@ -0,0 +1,5 @@ +--- +'@portaljs/ckan': patch +--- + +added package_count to organization type diff --git a/packages/ckan/src/interfaces/group.interface.ts b/packages/ckan/src/interfaces/group.interface.ts index 95f1519a7..5bb9b59fd 100644 --- a/packages/ckan/src/interfaces/group.interface.ts +++ b/packages/ckan/src/interfaces/group.interface.ts @@ -1,6 +1,6 @@ -import { Activity } from "./activity.interface"; -import { Dataset, Tag } from "./dataset.interface"; -import { User } from "./user.interface"; +import { Activity } from './activity.interface'; +import { Dataset, Tag } from './dataset.interface'; +import { User } from './user.interface'; export interface Group { display_name: string; @@ -10,9 +10,9 @@ export interface Group { created: string; name: string; is_organization: false; - state: "active" | "deleted" | "inactive"; + state: 'active' | 'deleted' | 'inactive'; image_url: string; - type: "group"; + type: 'group'; title: string; revision_id: string; num_followers: number; diff --git a/packages/ckan/src/interfaces/organization.interface.ts b/packages/ckan/src/interfaces/organization.interface.ts index 7535e5d92..d9f8ece41 100644 --- a/packages/ckan/src/interfaces/organization.interface.ts +++ b/packages/ckan/src/interfaces/organization.interface.ts @@ -1,6 +1,6 @@ -import { Activity } from "./activity.interface"; -import { Dataset, Tag } from "./dataset.interface"; -import { User } from "./user.interface"; +import { Activity } from './activity.interface'; +import { Dataset, Tag } from './dataset.interface'; +import { User } from './user.interface'; export interface Organization { id: string; @@ -13,8 +13,9 @@ export interface Organization { image_display_url?: string; created?: string; is_organization: boolean; - approval_status?: "approved"; - state: "active"; + package_count: number; + approval_status?: 'approved'; + state: 'active'; packages?: Array; activity_stream?: Array; users?: Array; diff --git a/packages/components/portaljs-components-0.1.12.tgz b/packages/components/portaljs-components-0.1.12.tgz deleted file mode 100644 index cbede784c..000000000 Binary files a/packages/components/portaljs-components-0.1.12.tgz and /dev/null differ diff --git a/packages/components/src/components/FlatUiTable.tsx b/packages/components/src/components/FlatUiTable.tsx index a0e442918..f00594f1d 100644 --- a/packages/components/src/components/FlatUiTable.tsx +++ b/packages/components/src/components/FlatUiTable.tsx @@ -42,6 +42,7 @@ export interface FlatUiTableProps { data?: { [key: string]: number | string }[]; rawCsv?: string; corsProxy?: string; + randomId?: number; } export const FlatUiTable: React.FC = ({ url, @@ -49,10 +50,17 @@ export const FlatUiTable: React.FC = ({ rawCsv, corsProxy, }) => { + const randomId = Math.random(); return ( // Provide the client to your App - + ); }; @@ -62,6 +70,7 @@ const TableInner: React.FC = ({ data, rawCsv, corsProxy, + randomId, }) => { if (data) { return ( @@ -71,12 +80,12 @@ const TableInner: React.FC = ({ ); } const { data: csvString, isLoading: isDownloadingCSV } = useQuery( - ['dataCsv', url], + ['dataCsv', url, randomId], () => getCsv(url as string, corsProxy), { enabled: !!url } ); const { data: parsedData, isLoading: isParsing } = useQuery( - ['dataPreview', csvString], + ['dataPreview', csvString, randomId], () => parseCsv(rawCsv ? (rawCsv as string) : (csvString as string)), { enabled: rawCsv ? true : !!csvString } );