Skip to content
This repository has been archived by the owner on Oct 21, 2024. It is now read-only.

Commit

Permalink
refactor: move collapse mode to presentation
Browse files Browse the repository at this point in the history
  • Loading branch information
johanlahti committed Aug 18, 2023
1 parent f86837a commit 52174ba
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 35 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -114,41 +114,11 @@ export default function getDataPanelItems(env: IEnv) {
},
},
},
autoConfirmGroup: {
type: 'items',
grouped: true,
show() {
return env?.flags?.isEnabled('IM_4072_FILTERPANE_SETTINGS');
},
items: {
autoConfirm: {
ref: 'autoConfirm',
component: 'checkbox',
translation: 'properties.filterpane.autoConfirm',
defaultValue: false,
},
},
},
collapseMode: {
ref: 'collapseMode',
type: 'string',
component: 'buttongroup', // dropdown
translation: 'properties.filterpane.collapseMode',
defaultValue: 'auto',
options: [
{
value: 'auto',
translation: 'Common.Auto',
},
{
value: 'always',
translation: 'Common.Always',
},
{
value: 'never',
translation: 'Common.Never',
},
],
autoConfirm: {
ref: 'autoConfirm',
component: 'checkbox',
translation: 'properties.filterpane.autoConfirm',
defaultValue: false,
show() {
return env?.flags?.isEnabled('IM_4072_FILTERPANE_SETTINGS');
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,36 @@ export default function getPresentation(env: IEnv) {
},
},
},
collapseModeGroup: {
type: 'items',
grouped: true,
show() {
return env?.flags?.isEnabled('IM_4072_FILTERPANE_SETTINGS');
},
items: {
collapseMode: {
ref: 'collapseMode',
type: 'string',
component: 'dropdown',
translation: 'properties.filterpane.collapseMode',
defaultValue: 'auto',
options: [
{
value: 'auto',
translation: 'Common.Auto',
},
{
value: 'always',
translation: 'Common.Always',
},
{
value: 'never',
translation: 'Common.Never',
},
],
},
},
},
gridModeGroup: {
grouped: true,
type: 'items',
Expand Down
1 change: 1 addition & 0 deletions types/global.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ export interface IListLayout extends EngineAPI.IGenericListLayout {
dense: boolean,
dataLayout?: 'grid' | 'singleColumn',
},
collapseMode?: 'auto' | 'always' | 'never';
showTitle?: boolean,
qHasSoftPatches?: boolean;
qExtendsId?: string;
Expand Down

0 comments on commit 52174ba

Please sign in to comment.