Skip to content

Commit

Permalink
feat: [SDCOSMO-1845] Implement date parameters for dataset creation
Browse files Browse the repository at this point in the history
  • Loading branch information
nborde-CSM committed Jun 20, 2024
1 parent 16c4301 commit d3b4ab8
Showing 1 changed file with 21 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@ import PropTypes from 'prop-types';
import { Grid, Typography } from '@mui/material';
import rfdc from 'rfdc';
import { UploadFile, BasicEnumInput } from '@cosmotech/ui';
// eslint-disable-next-line max-len
import { GenericEnumInput } from '../../../../../../components/ScenarioParameters/components/ScenarioParametersInputs/GenericEnumInput';
// eslint-disable-next-line max-len
import { GenericMultiSelect } from '../../../../../../components/ScenarioParameters/components/ScenarioParametersInputs/GenericMultiSelect';
// eslint-disable-next-line max-len
import { GenericTextInput } from '../../../../../../components/ScenarioParameters/components/ScenarioParametersInputs/GenericTextInput';
import {
GenericEnumInput,
GenericMultiSelect,
GenericTextInput,
GenericDateInput,
} from '../../../../../../components/ScenarioParameters/components/ScenarioParametersInputs';
import { ConfigUtils, SolutionsUtils, TranslationUtils } from '../../../../../../utils';
import { FileManagementUtils } from '../../../../../../utils/FileManagementUtils';
import { useDatasetCreationParameters } from './DatasetCreationParametersHook';
Expand Down Expand Up @@ -62,6 +62,8 @@ export const DatasetCreationParameters = ({ dataSourceRunTemplates, parentDatase
defaultValue = [];
} else if (inputType === '%DATASETID%') {
defaultValue = null;
} else if (inputType === 'date') {
defaultValue = new Date();
} else {
console.error(`VarType "${inputType}" is not supported for ETL runner parameters.`);
return null;
Expand Down Expand Up @@ -126,6 +128,19 @@ export const DatasetCreationParameters = ({ dataSourceRunTemplates, parentDatase
/>
</Grid>
);
} else if (inputType === 'date') {
return (
<Grid container columns={6} sx={{ pt: 1 }}>
<GenericDateInput
parameterData={parameter}
context={{ editMode: true }}
parameterValue={value}
setParameterValue={onChange}
isDirty={null}
error={null}
/>
</Grid>
);
} else {
return null;
}
Expand Down

0 comments on commit d3b4ab8

Please sign in to comment.