Skip to content

Commit 38eaaa8

Browse files
Added more capitalized style
1 parent 66ed65d commit 38eaaa8

File tree

13 files changed

+43
-19
lines changed

13 files changed

+43
-19
lines changed

opencti-platform/opencti-front/src/components/FilterIconButtonGlobalMode.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import React, { FunctionComponent } from 'react';
22
import { useFormatter } from './i18n';
3+
import { capitalizeFirstLetter } from 'src/utils/String';
34

45
interface FilterIconButtonGlobalModeProps {
56
classOperator: string;
@@ -16,7 +17,7 @@ const FilterIconButtonGlobalMode: FunctionComponent<
1617
const { t_i18n } = useFormatter();
1718
return (
1819
<div className={classOperator} onClick={handleSwitchGlobalMode}>
19-
{t_i18n(globalMode.toUpperCase())}
20+
{t_i18n(capitalizeFirstLetter(globalMode))}
2021
</div>
2122
);
2223
};

opencti-platform/opencti-front/src/components/ItemAssignees.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ const ItemAssignees: FunctionComponent<Props> = ({ assignees, stixDomainObjectId
4747
key={assignee.id}
4848
variant="outlined"
4949
icon={<PersonOutline color="primary" />}
50-
label={truncate(assignee.name, 25).toUpperCase()}
50+
label={truncate(assignee.name, 25)}
5151
style={{
5252
color: theme.palette.primary.main,
5353
borderColor: theme.palette.primary.main,

opencti-platform/opencti-front/src/components/ItemParticipants.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ const ItemParticipants: FunctionComponent<ItemParticipantsProps> = ({ participan
4545
key={participant.id}
4646
variant="outlined"
4747
icon={<PersonOutline color="primary" />}
48-
label={truncate(participant.name, 25).toUpperCase()}
48+
label={truncate(participant.name, 25)}
4949
style={{
5050
color: theme.palette.primary.main,
5151
borderColor: theme.palette.primary.main,

opencti-platform/opencti-front/src/components/TaskFilterValue.tsx

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import FilterValuesContent, { filterValuesContentQuery } from './FilterValuesCon
99
import { FilterValuesContentQuery } from './__generated__/FilterValuesContentQuery.graphql';
1010
import { useFormatter } from './i18n';
1111
import { convertOperatorToIcon, filterOperatorsWithIcon, useFilterDefinition } from '../utils/filters/filtersUtils';
12-
import { truncate } from '../utils/String';
12+
import { truncate, capitalizeFirstLetter } from '../utils/String';
1313
import type { Theme } from './Theme';
1414
import DisplayFilterGroup from './filters/DisplayFilterGroup';
1515
import { FilterGroup } from '../utils/filters/filtersHelpers-types';
@@ -55,7 +55,7 @@ const TaskFilterValue = ({
5555
const filtersRepresentativesMap = new Map(
5656
(filtersRepresentatives ?? []).map((n) => [n?.id, n]),
5757
);
58-
const globalFilterMode = t_i18n(filters.mode.toUpperCase());
58+
const globalFilterMode = t_i18n(capitalizeFirstLetter(filters.mode));
5959
return (
6060
<>
6161
{(filters.filters ?? []).map((currentFilter) => {
@@ -101,9 +101,7 @@ const TaskFilterValue = ({
101101
? convertOperatorToIcon(currentFilter.operator ?? 'eq')
102102
: currentFilter.values.length > 0 && ': '}
103103
{currentFilter.values.map((o) => {
104-
const localFilterMode = t_i18n(
105-
(currentFilter.mode ?? 'or').toUpperCase(),
106-
);
104+
const localFilterMode = t_i18n(capitalizeFirstLetter(currentFilter.mode ?? 'or'));
107105
return (
108106
<Tooltip
109107
key={o}

opencti-platform/opencti-front/src/components/ThemeDark.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -414,6 +414,16 @@ const ThemeDark = (
414414
styleOverrides: {
415415
root: {
416416
color: text_color,
417+
textTransform: 'lowercase',
418+
'&::first-letter': {
419+
textTransform: 'uppercase',
420+
},
421+
},
422+
label: {
423+
textTransform: 'lowercase',
424+
'&::first-letter': {
425+
textTransform: 'uppercase',
426+
},
417427
},
418428
},
419429
},

opencti-platform/opencti-front/src/components/ThemeLight.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -418,6 +418,16 @@ const ThemeLight = (
418418
styleOverrides: {
419419
root: {
420420
color: text_color,
421+
textTransform: 'lowercase',
422+
'&::first-letter': {
423+
textTransform: 'uppercase',
424+
},
425+
},
426+
label: {
427+
textTransform: 'lowercase',
428+
'&::first-letter': {
429+
textTransform: 'uppercase',
430+
},
421431
},
422432
},
423433
},

opencti-platform/opencti-front/src/components/filters/FilterValues.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import { WarningOutlined } from '@mui/icons-material';
88
import { Link } from 'react-router-dom';
99
import { useFormatter } from '../i18n';
1010
import { FiltersRestrictions, isFilterEditable, isFilterGroupNotEmpty, isRegardingOfFilterWarning, useFilterDefinition } from '../../utils/filters/filtersUtils';
11-
import { isDateIntervalTranslatable, translateDateInterval, truncate } from '../../utils/String';
11+
import { capitalizeFirstLetter, isDateIntervalTranslatable, translateDateInterval, truncate } from '../../utils/String';
1212
import FilterValuesContent from '../FilterValuesContent';
1313
import { FilterRepresentative } from './FiltersModel';
1414
import { Filter } from '../../utils/filters/filtersHelpers-types';
@@ -186,7 +186,7 @@ const FilterValues: FunctionComponent<FilterValuesProps> = ({
186186
{last(filterValues) !== id && !isRegardingOfFilter
187187
&& (
188188
<div style={localModeStyle} onClick={operatorOnClick}>
189-
{t_i18n((currentFilter.mode ?? 'or').toUpperCase())}
189+
{t_i18n(capitalizeFirstLetter(currentFilter.mode ?? 'or'))}
190190
</div>
191191
)
192192
}

opencti-platform/opencti-front/src/private/components/analyses/security_coverages/SecurityCoverageAttackPatterns.tsx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ import { useFormatter } from '../../../../components/i18n';
2626
import FieldOrEmpty from '../../../../components/FieldOrEmpty';
2727
import ItemIcon from '../../../../components/ItemIcon';
2828
import type { Theme } from '../../../../components/Theme';
29+
import { capitalizeFirstLetter } from 'src/utils/String';
2930

3031
const securityCoverageAttackPatternsFragment = graphql`
3132
fragment SecurityCoverageAttackPatternsFragment on SecurityCoverage {
@@ -193,10 +194,10 @@ const SecurityCoverageAttackPatterns = ({
193194
{killChains.map((chain) => (
194195
<MenuItem key={chain} value={chain}>
195196
{(() => {
196-
if (chain === 'mitre-attack') return 'MITRE ATT&CK';
197+
if (chain === 'mitre-attack') return 'Mitre Attack';
197198
if (chain === 'capec') return 'CAPEC';
198-
if (chain === 'disarm') return 'DISARM';
199-
return chain.toUpperCase();
199+
if (chain === 'disarm') return 'Disarm';
200+
return capitalizeFirstLetter(chain);
200201
})()}
201202
</MenuItem>
202203
))}

opencti-platform/opencti-front/src/private/components/analyses/security_coverages/SecurityCoverageInformation.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import { useFormatter } from '../../../../components/i18n';
88
import { isEmptyField, isNotEmptyField } from '../../../../utils/utils';
99
import { donutChartOptions } from '../../../../utils/Charts';
1010
import type { Theme } from '../../../../components/Theme';
11+
import { capitalizeFirstLetter } from 'src/utils/String';
1112

1213
const useStyles = makeStyles((theme: Theme) => ({
1314
charts: {
@@ -119,7 +120,7 @@ const SecurityCoverageInformation: FunctionComponent<SecurityCoverageInformation
119120
<Chart options={options} series={series} type="donut" width={chartSize} height={chartSize} />
120121
<Tooltip title={`${coverageResult.coverage_name} ${coverageResult.coverage_score}/100`} placement="bottom">
121122
<Avatar className={classes.iconOverlay} sx={{ bgcolor: 'transparent', width: iconSize, height: iconSize }} style={{ top: iconPosition, left: iconPosition, fontSize: iconSize - 2 }}>
122-
<span style={{ color: theme.palette.text?.primary }}>{coverageResult.coverage_name.charAt(0).toUpperCase()}</span>
123+
<span style={{ color: theme.palette.text?.primary }}>{capitalizeFirstLetter(coverageResult.coverage_name)}</span>
123124
</Avatar>
124125
</Tooltip>
125126
</div>
@@ -172,7 +173,7 @@ const SecurityCoverageInformation: FunctionComponent<SecurityCoverageInformation
172173
<Chart options={options} series={series} type="donut" width={70} height={70} />
173174
<Tooltip title={coverageResult.coverage_name} placement="top">
174175
<Avatar className={classes.iconOverlay} sx={{ bgcolor: 'transparent', width: 24, height: 24 }}>
175-
<span style={{ color: theme.palette.text?.primary, fontSize: 18 }}>{coverageResult.coverage_name.charAt(0).toUpperCase()}</span>
176+
<span style={{ color: theme.palette.text?.primary, fontSize: 18 }}>{capitalizeFirstLetter(coverageResult.coverage_name)}</span>
176177
</Avatar>
177178
</Tooltip>
178179
</div>

opencti-platform/opencti-front/src/private/components/settings/retention/RetentionLine.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ export const RetentionLine: FunctionComponent<RetentionLineProps> = ({ dataColum
131131
<Chip
132132
color={scopeColor as 'warning' | 'secondary' | 'primary'}
133133
classes={{ root: classes.chipInList }}
134-
label={t_i18n(data.scope.toUpperCase())}
134+
label={t_i18n(data.scope)}
135135
variant="outlined"
136136
/>
137137
</div>

0 commit comments

Comments
 (0)