Skip to content

Commit

Permalink
[backend/frontend] Finalize Overview layout customization (#6724) (#8308
Browse files Browse the repository at this point in the history
)
  • Loading branch information
Goumies authored Sep 11, 2024
1 parent 13e8b1f commit e94e069
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ const CaseIncident: React.FC<CaseIncidentProps> = ({ caseIncidentData, enableRef
);
case 'task':
return (
<Grid key={key} item={true} xs={width}>
<Grid key={key} item xs={width}>
<CaseTasksLines
caseId={caseIncident.id}
defaultMarkings={convertMarkings(caseIncident)}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ import { FilterGroup } from '../../../../utils/filters/filtersHelpers-types';
// Do not use it for new code.
const useStyles = makeStyles<Theme>((theme) => ({
paper: {
margin: 0,
margin: '-4px 0 0 0',
padding: 0,
borderRadius: 4,
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ import EntitySettingAttributes from './entity_setting/EntitySettingAttributes';
import CustomizationMenu from '../CustomizationMenu';
import SearchInput from '../../../../components/SearchInput';
import { usePaginationLocalStorage } from '../../../../utils/hooks/useLocalStorage';
import useHelper from '../../../../utils/hooks/useHelper';

// Deprecated - https://mui.com/system/styles/basics/
// Do not use it for new code.
Expand Down Expand Up @@ -71,8 +70,6 @@ interface SubTypeProps {

const SubType: React.FC<SubTypeProps> = ({ data }) => {
const { t_i18n } = useFormatter();
const { isFeatureEnable } = useHelper();
const isOverviewLayoutCustomizationEnabled = isFeatureEnable('OVERVIEW_LAYOUT_CUSTOMIZATION');
const classes = useStyles();
const subType = useFragment<SubType_subType$key>(subTypeFragment, data);

Expand Down Expand Up @@ -155,11 +152,9 @@ const SubType: React.FC<SubTypeProps> = ({ data }) => {
</Paper>
</Grid>
)}
{ isOverviewLayoutCustomizationEnabled && (
<EntitySettingCustomOverview
entitySettingsData={subType.settings}
/>
)}
<EntitySettingCustomOverview
entitySettingsData={subType.settings}
/>
</Grid>
</div>
);
Expand Down
3 changes: 1 addition & 2 deletions opencti-platform/opencti-graphql/config/default.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@
"NEW_IMPORT_SCREENS",
"FILIGRAN_LOADER",
"CONTAINERS_AUTHORIZED_MEMBERS",
"TELEMETRY_COUNT_ACTIVE_USERS",
"OVERVIEW_LAYOUT_CUSTOMIZATION"
"TELEMETRY_COUNT_ACTIVE_USERS"
],
"https_cert": {
"ca": [],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import type { EditInput, QueryEntitySettingsArgs } from '../../generated/graphql
import { FilterMode } from '../../generated/graphql';
import { SYSTEM_USER } from '../../utils/access';
import { notify } from '../../database/redis';
import { BUS_TOPICS, isFeatureEnabled } from '../../config/conf';
import { BUS_TOPICS } from '../../config/conf';
import { defaultEntitySetting, type EntitySettingSchemaAttribute, getAvailableSettings, type typeAvailableSetting } from './entitySetting-utils';
import { queryDefaultSubTypes } from '../../domain/subType';
import { publishUserAction } from '../../listener/UserActionListener';
Expand Down Expand Up @@ -92,10 +92,7 @@ export const entitySettingEditField = async (context: AuthContext, user: AuthUse
};

export const getOverviewLayoutCustomization = (entitySetting: BasicStoreEntityEntitySetting) => {
if (!isFeatureEnabled('OVERVIEW_LAYOUT_CUSTOMIZATION') || !entitySetting.overview_layout_customization?.[0]) {
return schemaOverviewLayoutCustomization.get(entitySetting.target_type);
}
return entitySetting.overview_layout_customization;
return entitySetting.overview_layout_customization?.[0] ? entitySetting.overview_layout_customization : schemaOverviewLayoutCustomization.get(entitySetting.target_type);
};

export const entitySettingsEditField = async (context: AuthContext, user: AuthUser, entitySettingIds: string[], input: EditInput[]) => {
Expand Down

0 comments on commit e94e069

Please sign in to comment.