Skip to content

Commit

Permalink
[frontend] In create entity form (on the fly), spacing of the first f…
Browse files Browse the repository at this point in the history
…ield is not correct (#9567)
  • Loading branch information
ValentinBouzinFiligran authored Jan 17, 2025
1 parent 78afddd commit 40a8cdd
Show file tree
Hide file tree
Showing 31 changed files with 94 additions and 152 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ export const GroupingCreationForm: FunctionComponent<GroupingFormProps> = ({
fullWidth={true}
multiline={true}
rows="4"
style={{ marginTop: 20 }}
style={fieldSpacingContainerStyle}
askAi={true}
/>
<Field
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -229,15 +229,15 @@ MalwareAnalysisFormProps
label={t_i18n('Report name')}
required={mandatoryAttributes.includes('result_name')}
fullWidth={true}
style={{ marginTop: 20 }}
style={fieldSpacingContainerStyle}
/>
<Field
component={TextField}
name="version"
label={t_i18n('Version of the product')}
required={mandatoryAttributes.includes('version')}
fullWidth={true}
style={{ marginTop: 20 }}
style={fieldSpacingContainerStyle}
/>
<Field
component={DateTimePickerField}
Expand All @@ -246,7 +246,7 @@ MalwareAnalysisFormProps
textFieldProps={{
label: t_i18n('Submission date'),
fullWidth: true,
style: { marginTop: 20 },
style: { ...fieldSpacingContainerStyle },
required: mandatoryAttributes.includes('submitted'),
}}
/>
Expand All @@ -271,26 +271,26 @@ MalwareAnalysisFormProps
<CreatedByField
name="createdBy"
required={mandatoryAttributes.includes('createdBy')}
style={{ marginTop: 20, width: '100%' }}
style={fieldSpacingContainerStyle}
setFieldValue={setFieldValue}
/>
<ObjectLabelField
name="objectLabel"
required={mandatoryAttributes.includes('objectLabel')}
style={{ marginTop: 20 }}
style={fieldSpacingContainerStyle}
setFieldValue={setFieldValue}
values={values.objectLabel}
/>
<ObjectMarkingField
name="objectMarking"
required={mandatoryAttributes.includes('objectMarking')}
style={{ marginTop: 20, width: '100%' }}
style={fieldSpacingContainerStyle}
setFieldValue={setFieldValue}
/>
<ExternalReferencesField
name="externalReferences"
required={mandatoryAttributes.includes('externalReferences')}
style={{ marginTop: 20, width: '100%' }}
style={fieldSpacingContainerStyle}
setFieldValue={setFieldValue}
values={values.externalReferences}
/>
Expand All @@ -301,15 +301,15 @@ MalwareAnalysisFormProps
required={mandatoryAttributes.includes('configuration_version')}
label={t_i18n('Configuration version')}
fullWidth
style={{ marginTop: 20 }}
style={fieldSpacingContainerStyle}
/>
<Field
component={DateTimePickerField}
name="analysis_started"
textFieldProps={{
label: t_i18n('Analysis started'),
fullWidth: true,
style: { marginTop: 20 },
style: { ...fieldSpacingContainerStyle },
required: mandatoryAttributes.includes('analysis_started'),
}}
/>
Expand All @@ -319,7 +319,7 @@ MalwareAnalysisFormProps
textFieldProps={{
label: t_i18n('Analysis ended'),
fullWidth: true,
style: { marginTop: 20 },
style: { ...fieldSpacingContainerStyle },
required: mandatoryAttributes.includes('analysis_ended'),
}}
/>
Expand All @@ -329,15 +329,15 @@ MalwareAnalysisFormProps
required={mandatoryAttributes.includes('analysis_engine_version')}
label={t_i18n('Analysis engine version')}
fullWidth
style={{ marginTop: 20 }}
style={fieldSpacingContainerStyle}
/>
<Field
component={TextField}
name="analysis_definition_version"
required={mandatoryAttributes.includes('analysis_definition_version')}
label={t_i18n('Analysis definition version')}
fullWidth
style={{ marginTop: 20 }}
style={fieldSpacingContainerStyle}
/>
<Field
component={TextField}
Expand All @@ -347,7 +347,7 @@ MalwareAnalysisFormProps
fullWidth
multiline
rows="4"
style={{ marginTop: 20 }}
style={fieldSpacingContainerStyle}
/>
<div className={classes.buttons}>
<Button
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ export const ReportCreationForm: FunctionComponent<ReportFormProps> = ({
required: mandatoryAttributes.includes('published'),
variant: 'standard',
fullWidth: true,
style: { marginTop: 20 },
style: { ...fieldSpacingContainerStyle },
}}
/>
<OpenVocabField
Expand Down Expand Up @@ -256,7 +256,7 @@ export const ReportCreationForm: FunctionComponent<ReportFormProps> = ({
fullWidth={true}
multiline={true}
rows="4"
style={{ marginTop: 20 }}
style={fieldSpacingContainerStyle}
askAi={true}
/>
<Field
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -228,43 +228,31 @@ export const ChannelCreationForm: FunctionComponent<ChannelFormProps> = ({
fullWidth={true}
multiline={true}
rows="4"
style={{ marginTop: 20 }}
style={fieldSpacingContainerStyle}
/>
<ConfidenceField
entityType="Channel"
containerStyle={fieldSpacingContainerStyle}
/>
<CreatedByField
name="createdBy"
style={{
marginTop: 20,
width: '100%',
}}
style={fieldSpacingContainerStyle}
setFieldValue={setFieldValue}
/>
<ObjectLabelField
name="objectLabel"
style={{
marginTop: 20,
width: '100%',
}}
style={fieldSpacingContainerStyle}
setFieldValue={setFieldValue}
values={values.objectLabel}
/>
<ObjectMarkingField
name="objectMarking"
style={{
marginTop: 20,
width: '100%',
}}
style={fieldSpacingContainerStyle}
setFieldValue={setFieldValue}
/>
<ExternalReferencesField
name="externalReferences"
style={{
marginTop: 20,
width: '100%',
}}
style={fieldSpacingContainerStyle}
setFieldValue={setFieldValue}
values={values.externalReferences}
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@ export const MalwareCreationForm: FunctionComponent<MalwareFormProps> = ({
fullWidth={true}
multiline={true}
rows="4"
style={{ marginTop: 20 }}
style={fieldSpacingContainerStyle}
askAi={true}
/>
<OpenVocabField
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ export const ToolCreationForm: FunctionComponent<ToolFormProps> = ({
fullWidth={true}
multiline={true}
rows="4"
style={{ marginTop: 20 }}
style={fieldSpacingContainerStyle}
askAi={true}
/>
<ConfidenceField
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@ export const VulnerabilityCreationForm: FunctionComponent<VulnerabilityFormProps
fullWidth={true}
multiline={true}
rows="4"
style={{ marginTop: 20 }}
style={fieldSpacingContainerStyle}
askAi={true}
/>
<Field
Expand All @@ -276,7 +276,7 @@ export const VulnerabilityCreationForm: FunctionComponent<VulnerabilityFormProps
type="number"
step="0.1"
fullWidth={true}
style={{ marginTop: 20 }}
style={fieldSpacingContainerStyle}
/>
{ /* TODO Dont touch until CVSS4 */}
<Field
Expand All @@ -285,10 +285,7 @@ export const VulnerabilityCreationForm: FunctionComponent<VulnerabilityFormProps
name="x_opencti_cvss_base_severity"
label={t_i18n('CVSS3 - Severity')}
fullWidth={true}
containerstyle={{
width: '100%',
marginTop: 20,
}}
containerstyle={fieldSpacingContainerStyle}
>
<MenuItem value="CRITICAL">{t_i18n('CRITICAL')}</MenuItem>
<MenuItem value="HIGH">{t_i18n('HIGH')}</MenuItem>
Expand All @@ -314,7 +311,7 @@ export const VulnerabilityCreationForm: FunctionComponent<VulnerabilityFormProps
name="x_opencti_cisa_kev"
label={t_i18n('CISA KEV')}
fullWidth
containerstyle={{ marginTop: 20 }}
containerstyle={fieldSpacingContainerStyle}
/>
<Field
component={TextField}
Expand All @@ -323,7 +320,7 @@ export const VulnerabilityCreationForm: FunctionComponent<VulnerabilityFormProps
label={t_i18n('EPSS Score')}
type="number"
fullWidth={true}
style={{ marginTop: 20 }}
style={fieldSpacingContainerStyle}
/>
<Field
component={TextField}
Expand All @@ -332,31 +329,22 @@ export const VulnerabilityCreationForm: FunctionComponent<VulnerabilityFormProps
label={t_i18n('EPSS Percentile')}
type="number"
fullWidth={true}
style={{ marginTop: 20 }}
style={fieldSpacingContainerStyle}
/>
<CreatedByField
name="createdBy"
style={{
marginTop: 20,
width: '100%',
}}
style={fieldSpacingContainerStyle}
setFieldValue={setFieldValue}
/>
<ObjectLabelField
name="objectLabel"
style={{
marginTop: 20,
width: '100%',
}}
style={fieldSpacingContainerStyle}
setFieldValue={setFieldValue}
values={values.objectLabel}
/>
<ObjectMarkingField
name="objectMarking"
style={{
marginTop: 20,
width: '100%',
}}
style={fieldSpacingContainerStyle}
setFieldValue={setFieldValue}
/>
<ExternalReferencesField
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ export const CaseIncidentCreationForm: FunctionComponent<IncidentFormProps> = ({
label: t_i18n('Incident date'),
variant: 'standard',
fullWidth: true,
style: { marginTop: 20 },
style: { ...fieldSpacingContainerStyle },
}}
/>
<OpenVocabField
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ export const CaseRfiCreationForm: FunctionComponent<CaseRfiFormProps> = ({
label: t_i18n('Request For Information Date'),
variant: 'standard',
fullWidth: true,
style: { marginTop: 20 },
style: { ...fieldSpacingContainerStyle },
}}
/>
<OpenVocabField
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ export const CaseRftCreationForm: FunctionComponent<CaseRftFormProps> = ({
label: t_i18n('Request For Takedown Date'),
variant: 'standard',
fullWidth: true,
style: { marginTop: 20 },
style: { ...fieldSpacingContainerStyle },
}}
/>
<OpenVocabField
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -797,7 +797,9 @@ const StixDomainPanel = ({
</MenuItem>
))}
</Select>
{renderEntityCreationInterface()}
<div style={{ marginTop: '20px' }}>
{renderEntityCreationInterface()}
</div>
</DialogContent>
</Dialog>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ export const EventCreationForm: FunctionComponent<EventFormProps> = ({
fullWidth={true}
multiline={true}
rows={4}
style={{ marginTop: 20 }}
style={fieldSpacingContainerStyle}
/>
<Field
component={DateTimePickerField}
Expand All @@ -248,7 +248,7 @@ export const EventCreationForm: FunctionComponent<EventFormProps> = ({
label: t_i18n('Start date'),
variant: 'standard',
fullWidth: true,
style: { marginTop: 20 },
style: { ...fieldSpacingContainerStyle },
}}
/>
<Field
Expand All @@ -258,7 +258,7 @@ export const EventCreationForm: FunctionComponent<EventFormProps> = ({
label: t_i18n('End date'),
variant: 'standard',
fullWidth: true,
style: { marginTop: 20 },
style: { ...fieldSpacingContainerStyle },
}}
/>
<ConfidenceField
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ export const IndividualCreationForm: FunctionComponent<IndividualFormProps> = ({
fullWidth={true}
multiline={true}
rows="4"
style={{ marginTop: 20 }}
style={fieldSpacingContainerStyle}
/>
<ConfidenceField
entityType="Individual"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ export const SectorCreationForm: FunctionComponent<SectorFormProps> = ({
fullWidth={true}
multiline={true}
rows="4"
style={{ marginTop: 20 }}
style={fieldSpacingContainerStyle}
/>
<ConfidenceField
entityType="Sector"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ export const SystemCreationForm: FunctionComponent<SystemFormProps> = ({
fullWidth={true}
multiline={true}
rows="4"
style={{ marginTop: 20 }}
style={fieldSpacingContainerStyle}
/>
<ConfidenceField
entityType="System"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -218,15 +218,15 @@ export const IncidentCreationForm: FunctionComponent<IncidentCreationProps> = ({
fullWidth={true}
multiline={true}
rows="4"
style={{ marginTop: 20 }}
style={fieldSpacingContainerStyle}
/>
<Field
component={TextField}
variant="standard"
name="source"
label={t_i18n('Source')}
fullWidth={true}
style={{ marginTop: 20 }}
style={fieldSpacingContainerStyle}
/>
<ObjectAssigneeField
name="objectAssignee"
Expand Down
Loading

0 comments on commit 40a8cdd

Please sign in to comment.