Skip to content

Commit

Permalink
[frontend] add missing feature flag for import validation mode (#9300)
Browse files Browse the repository at this point in the history
  • Loading branch information
JeremyCloarec authored Feb 5, 2025
1 parent da10e2c commit c9872d8
Show file tree
Hide file tree
Showing 2 changed files with 52 additions and 42 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ import FileExternalReferencesViewer from '../files/FileExternalReferencesViewer'
import WorkbenchFileViewer from '../files/workbench/WorkbenchFileViewer';
import { fieldSpacingContainerStyle } from '../../../../utils/field';
import { resolveHasUserChoiceParsedCsvMapper } from '../../../../utils/csvMapperUtils';
import useHelper from '../../../../utils/hooks/useHelper';

const styles = (theme) => ({
container: {
Expand Down Expand Up @@ -135,6 +136,8 @@ const StixCoreObjectFilesAndHistory = ({
bypassEntityId,
}) => {
const { t_i18n } = useFormatter();
const { isFeatureEnable } = useHelper();
const isDraftFeatureEnabled = isFeatureEnable('DRAFT_WORKSPACE');
const [fileToImport, setFileToImport] = useState(null);
const [openExport, setOpenExport] = useState(false);
const [selectedConnector, setSelectedConnector] = useState(null);
Expand Down Expand Up @@ -329,28 +332,30 @@ const StixCoreObjectFilesAndHistory = ({
);
})}
</Field>
<Field
component={SelectField}
variant="standard"
name="validation_mode"
label={t_i18n('Validation mode')}
fullWidth={true}
containerstyle={{ marginTop: 20, width: '100%' }}
setFieldValue={setFieldValue}
>
<MenuItem
key={'workbench'}
value={'workbench'}
>
{'Workbench'}
</MenuItem>
<MenuItem
key={'draft'}
value={'draft'}
{isDraftFeatureEnabled && (
<Field
component={SelectField}
variant="standard"
name="validation_mode"
label={t_i18n('Validation mode')}
fullWidth={true}
containerstyle={{ marginTop: 20, width: '100%' }}
setFieldValue={setFieldValue}
>
{'Draft'}
</MenuItem>
</Field>
<MenuItem
key={'workbench'}
value={'workbench'}
>
{'Workbench'}
</MenuItem>
<MenuItem
key={'draft'}
value={'draft'}
>
{'Draft'}
</MenuItem>
</Field>
)}
{selectedConnector?.configurations?.length > 0
? <Field
component={SelectField}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ import { fieldSpacingContainerStyle } from '../../../../utils/field';
import Breadcrumbs from '../../../../components/Breadcrumbs';
import { resolveHasUserChoiceParsedCsvMapper } from '../../../../utils/csvMapperUtils';
import useConnectedDocumentModifier from '../../../../utils/hooks/useConnectedDocumentModifier';
import useHelper from '../../../../utils/hooks/useHelper';

const interval$ = interval(TEN_SECONDS);

Expand Down Expand Up @@ -163,6 +164,8 @@ const ImportContentComponent = ({
const classes = useStyles();
const { t_i18n } = useFormatter();
const { setTitle } = useConnectedDocumentModifier();
const { isFeatureEnable } = useHelper();
const isDraftFeatureEnabled = isFeatureEnable('DRAFT_WORKSPACE');
setTitle(t_i18n('Import: Import | Data'));

const [fileToImport, setFileToImport] = useState(null);
Expand Down Expand Up @@ -466,28 +469,30 @@ const ImportContentComponent = ({
);
})}
</Field>
<Field
component={SelectField}
variant="standard"
name="validation_mode"
label={t_i18n('Validation mode')}
fullWidth={true}
containerstyle={{ marginTop: 20, width: '100%' }}
setFieldValue={setFieldValue}
>
<MenuItem
key={'workbench'}
value={'workbench'}
{isDraftFeatureEnabled && (
<Field
component={SelectField}
variant="standard"
name="validation_mode"
label={t_i18n('Validation mode')}
fullWidth={true}
containerstyle={{ marginTop: 20, width: '100%' }}
setFieldValue={setFieldValue}
>
{'Workbench'}
</MenuItem>
<MenuItem
key={'draft'}
value={'draft'}
>
{'Draft'}
</MenuItem>
</Field>
<MenuItem
key={'workbench'}
value={'workbench'}
>
{'Workbench'}
</MenuItem>
<MenuItem
key={'draft'}
value={'draft'}
>
{'Draft'}
</MenuItem>
</Field>
)}
{selectedConnector?.configurations?.length > 0
? <Field
component={SelectField}
Expand Down

0 comments on commit c9872d8

Please sign in to comment.