Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: migrate two files to typescript #908

Merged
merged 2 commits into from
Sep 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading