Skip to content

Commit

Permalink
[frontend] Tiny enhancements
Browse files Browse the repository at this point in the history
  • Loading branch information
Samuel Hassine committed Apr 15, 2021
1 parent 500399b commit c89e029
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import { SubscriptionFocus } from '../../../../components/Subscription';
import { commitMutation } from '../../../../relay/environment';
import { dateFormat } from '../../../../utils/Time';
import OpenVocabField from '../../common/form/OpenVocabField';
import SwitchField from '../../../../components/SwitchField';

const malwareMutationFieldPatch = graphql`
mutation MalwareEditionDetailsFieldPatchMutation(
Expand Down Expand Up @@ -91,16 +92,14 @@ class MalwareEditionDetailsComponent extends Component {
'implementation_languages',
malware.implementation_languages ? malware.implementation_languages : [],
),
assoc(
'capabilities',
malware.capabilities ? malware.capabilities : [],
),
assoc('capabilities', malware.capabilities ? malware.capabilities : []),
pick([
'first_seen',
'last_seen',
'architecture_execution_envs',
'implementation_languages',
'capabilities',
'is_family',
]),
)(malware);

Expand Down Expand Up @@ -168,6 +167,17 @@ class MalwareEditionDetailsComponent extends Component {
variant="edit"
editContext={context}
/>
<Field
component={SwitchField}
type="checkbox"
name="is_family"
label={t('Is family?')}
containerstyle={{ marginTop: 20 }}
onChange={this.handleSubmitField.bind(this)}
helperText={
<SubscriptionFocus context={context} fieldName="is_family" />
}
/>
</Form>
)}
</Formik>
Expand All @@ -187,6 +197,7 @@ const MalwareEditionDetails = createFragmentContainer(
malware: graphql`
fragment MalwareEditionDetails_malware on Malware {
id
is_family
first_seen
last_seen
architecture_execution_envs
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,7 @@ class StixDomainObjectOverview extends Component {
<ItemBoolean
status={stixDomainObject.revoked}
label={stixDomainObject.revoked ? t('Yes') : t('No')}
reverse={true}
/>
</div>
) : (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ const styles = (theme) => ({
date: {
float: 'right',
textAlign: 'right',
width: 150,
width: 180,
},
});

Expand Down

0 comments on commit c89e029

Please sign in to comment.