Skip to content

Commit

Permalink
Remove configure layoutsets panel and adapt css on layoutsets dropdown (
Browse files Browse the repository at this point in the history
  • Loading branch information
standeren authored Mar 8, 2024
1 parent 1163fa7 commit 4f7ac24
Show file tree
Hide file tree
Showing 12 changed files with 22 additions and 487 deletions.
1 change: 0 additions & 1 deletion frontend/packages/shared/src/utils/featureToggleUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ const persistFeatureKey = 'persistFeatureFlag';
// All the features that you want to be toggle on/off should be added here. To ensure that we type check the feature name.
export type SupportedFeatureFlags =
| 'componentConfigBeta'
| 'configureLayoutSet'
| 'shouldOverrideAppLibCheck'
| 'resourceAccessLists';

Expand Down

This file was deleted.

This file was deleted.

42 changes: 12 additions & 30 deletions frontend/packages/ux-editor-v3/src/components/Elements/Elements.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,14 @@ import React from 'react';
import { useSelector } from 'react-redux';
import { ConfPageToolbar } from './ConfPageToolbar';
import { DefaultToolbar } from './DefaultToolbar';
import { Heading, Paragraph, Accordion } from '@digdir/design-system-react';
import { Heading, Paragraph } from '@digdir/design-system-react';
import { useText } from '../../hooks';
import { selectedLayoutNameSelector } from '../../selectors/formLayoutSelectors';
import { useFormLayoutSettingsQuery } from '../../hooks/queries/useFormLayoutSettingsQuery';
import { useLayoutSetsQuery } from '../../hooks/queries/useLayoutSetsQuery';
import { LayoutSetsContainer } from './LayoutSetsContainer';
import { ConfigureLayoutSetPanel } from './ConfigureLayoutSetPanel';

import { useStudioUrlParams } from 'app-shared/hooks/useStudioUrlParams';
import { shouldDisplayFeature } from 'app-shared/utils/featureToggleUtils';
import classes from './Elements.module.css';
import { useAppContext } from '../../hooks/useAppContext';

Expand All @@ -30,35 +28,19 @@ export const Elements = () => {

return (
<div className={classes.root}>
{shouldDisplayFeature('configureLayoutSet') && layoutSetNames ? (
<ConfigureLayoutSetPanel />
{layoutSetNames && <LayoutSetsContainer />}
<Heading size='xxsmall' className={classes.componentsHeader}>
{t('left_menu.components')}
</Heading>
{hideComponents ? (
<Paragraph className={classes.noPageSelected} size='small'>
{t('left_menu.no_components_selected')}
</Paragraph>
) : receiptName === selectedLayout ? (
<ConfPageToolbar />
) : (
<LayoutSetsContainer />
<DefaultToolbar />
)}
<Accordion color='subtle'>
{shouldDisplayFeature('configureLayoutSet') && (
<Accordion.Item defaultOpen={layoutSetNames?.length > 0}>
<Accordion.Header>{t('left_menu.layout_sets')}</Accordion.Header>
<Accordion.Content>
{layoutSetNames ? <LayoutSetsContainer /> : <ConfigureLayoutSetPanel />}
</Accordion.Content>
</Accordion.Item>
)}
</Accordion>
<div className={classes.componentsList}>
<Heading size='xxsmall' className={classes.componentsHeader}>
{t('left_menu.components')}
</Heading>
{hideComponents ? (
<Paragraph className={classes.noPageSelected} size='small'>
{t('left_menu.no_components_selected')}
</Paragraph>
) : receiptName === selectedLayout ? (
<ConfPageToolbar />
) : (
<DefaultToolbar />
)}
</div>
</div>
);
};

This file was deleted.

This file was deleted.

This file was deleted.

Loading

0 comments on commit 4f7ac24

Please sign in to comment.