Skip to content

Commit

Permalink
feat: migrate two files to typescript (#908)
Browse files Browse the repository at this point in the history
  • Loading branch information
EmmanuelDemey authored Sep 2, 2024
1 parent 5a7ac4b commit 2ed8252
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 19 deletions.
33 changes: 17 additions & 16 deletions src/packages/model/Dataset.ts
Original file line number Diff line number Diff line change
@@ -1,39 +1,40 @@
import { ValidationState } from '../components';

export type CatalogRecord = {
created: string;
updated: string;
contributor: string;
};

export type Dataset = {
accessRights: string;
accrualPeriodicity: string;
confidentialityStatus: string;
id?: string;
issued?: string;
catalogRecord: CatalogRecord;
creators: string[];
publisher: string;
wasGeneratedIRIs: string[];
themes: string[];
validationState: ValidationState;
observationNumber: number;
timeSeriesNumber: number;
linkedDocuments: string[];
keywords: {
lg1: string[];
lg2: string[];
};
statisticalUnit: string[];
dataStructure: string;
temporalCoverageDataType: string;
temporalCoverageStartDate: string;
temporalCoverageEndDate: string;
type: string;
temporalResolution: string;
spacialCoverage: string;
spacialTemporal: string;
spacialResolutions: string[];
observationNumber: number;
timeSeriesNumber: number;
creators: string[];
publisher: string;
wasGeneratedIRIs: string[];
themes: string[];
statisticalUnit: string[];
dataStructure: string;
issued?: string;
type: string;
};
export type CatalogRecord = {
created: string;
updated: string;
contributor: string;
catalogRecord: CatalogRecord;
validationState: ValidationState;
};
export type Distribution = {
Expand Down
5 changes: 5 additions & 0 deletions src/packages/model/theme.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
export type Theme = {
label: string;
idConceptScheme: string;
uri: string;
};
4 changes: 2 additions & 2 deletions src/packages/modules-datasets/datasets/useThemes.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { useQuery } from '@tanstack/react-query';
import { ThemesApi } from '../..//sdk';
import { Theme } from '../../model/Theme';
import { ThemesApi } from '../../sdk';
import { Options } from '../../model/SelectOption';
import { Theme } from '../../model/Theme';

export const useThemes = () =>
useQuery<Options>({
Expand Down
6 changes: 5 additions & 1 deletion src/packages/modules-datasets/datasets/view/menu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,11 @@ export const ViewMenu = ({
<ReturnButton action={() => goBack('/datasets')} />

{(isAdmin || hasDatasetRightsBasedOnStamp) && (
<ValidationButton object={dataset} callback={onPublish} />
<ValidationButton
object={dataset}
callback={onPublish}
disabled={false}
/>
)}
{(isAdmin ||
(hasDatasetRightsBasedOnStamp &&
Expand Down

0 comments on commit 2ed8252

Please sign in to comment.