Skip to content

Commit

Permalink
[frontend] spacing on entity's form (#9567)
Browse files Browse the repository at this point in the history
  • Loading branch information
ValentinBouzinFiligran committed Jan 15, 2025
1 parent e32b9ec commit 1a31656
Show file tree
Hide file tree
Showing 33 changed files with 125 additions and 152 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,7 @@ export const GroupingCreationForm: FunctionComponent<GroupingFormProps> = ({
detectDuplicate={['Grouping']}
fullWidth={true}
askAi={true}
style={fieldSpacingContainerStyle}
/>
<ConfidenceField
entityType="Grouping"
Expand All @@ -216,7 +217,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 @@ -222,22 +222,23 @@ MalwareAnalysisFormProps
label={t_i18n('Product')}
required={mandatoryAttributes.includes('product')}
fullWidth={true}
style={fieldSpacingContainerStyle}
/>
<Field
component={TextField}
name="result_name"
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 +247,7 @@ MalwareAnalysisFormProps
textFieldProps={{
label: t_i18n('Submission date'),
fullWidth: true,
style: { marginTop: 20 },
style: { ...fieldSpacingContainerStyle },
required: mandatoryAttributes.includes('submitted'),
}}
/>
Expand All @@ -271,26 +272,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 +302,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 +320,7 @@ MalwareAnalysisFormProps
textFieldProps={{
label: t_i18n('Analysis ended'),
fullWidth: true,
style: { marginTop: 20 },
style: { ...fieldSpacingContainerStyle },
required: mandatoryAttributes.includes('analysis_ended'),
}}
/>
Expand All @@ -329,15 +330,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 +348,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 @@ -214,6 +214,7 @@ export const ReportCreationForm: FunctionComponent<ReportFormProps> = ({
detectDuplicate={['Report']}
fullWidth
askAi
style={fieldSpacingContainerStyle}
/>
<Field
component={DateTimePickerField}
Expand All @@ -223,7 +224,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 +257,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 @@ -212,6 +212,7 @@ export const ChannelCreationForm: FunctionComponent<ChannelFormProps> = ({
label={t_i18n('Name')}
fullWidth={true}
detectDuplicate={['Channel', 'Malware']}
style={fieldSpacingContainerStyle}
/>
<OpenVocabField
type="channel_types_ov"
Expand All @@ -228,43 +229,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 @@ -255,6 +255,7 @@ export const MalwareCreationForm: FunctionComponent<MalwareFormProps> = ({
'Malware',
'Tool',
]}
style={fieldSpacingContainerStyle}
/>
<OpenVocabField
label={t_i18n('Malware types')}
Expand All @@ -281,7 +282,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 @@ -217,6 +217,7 @@ export const ToolCreationForm: FunctionComponent<ToolFormProps> = ({
fullWidth={true}
detectDuplicate={['Tool', 'Malware']}
askAi={true}
style={fieldSpacingContainerStyle}
/>
<Field
component={MarkdownField}
Expand All @@ -225,7 +226,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 @@ -257,6 +257,7 @@ export const VulnerabilityCreationForm: FunctionComponent<VulnerabilityFormProps
fullWidth={true}
detectduplicate={['Vulnerability']}
askAi={true}
style={fieldSpacingContainerStyle}
/>
<Field
component={MarkdownField}
Expand All @@ -265,7 +266,7 @@ export const VulnerabilityCreationForm: FunctionComponent<VulnerabilityFormProps
fullWidth={true}
multiline={true}
rows="4"
style={{ marginTop: 20 }}
style={fieldSpacingContainerStyle}
askAi={true}
/>
<Field
Expand All @@ -276,7 +277,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 +286,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 +312,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 +321,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 +330,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 @@ -212,6 +212,7 @@ export const CaseIncidentCreationForm: FunctionComponent<IncidentFormProps> = ({
fullWidth={true}
detectDuplicate={['Case-Incident']}
askAi={true}
style={fieldSpacingContainerStyle}
/>
<Field
component={DateTimePickerField}
Expand All @@ -220,7 +221,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 @@ -207,6 +207,7 @@ export const CaseRfiCreationForm: FunctionComponent<CaseRfiFormProps> = ({
fullWidth={true}
detectDuplicate={['Case-Rfi']}
askAi={true}
style={fieldSpacingContainerStyle}
/>
<Field
component={DateTimePickerField}
Expand All @@ -215,7 +216,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 @@ -208,6 +208,7 @@ export const CaseRftCreationForm: FunctionComponent<CaseRftFormProps> = ({
label={t_i18n('Name')}
fullWidth={true}
detectDuplicate={['Case-Rft']}
style={fieldSpacingContainerStyle}
/>
<Field
component={DateTimePickerField}
Expand All @@ -216,7 +217,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
Loading

0 comments on commit 1a31656

Please sign in to comment.