Skip to content

Commit

Permalink
Pinning plus (#744)
Browse files Browse the repository at this point in the history
* Checkpoint

* Checkpoint

* Default settleTime to 1000ms

* Tweak

* Add enableSharing option

---------

Co-authored-by: Anselm McClain <[email protected]>
  • Loading branch information
lbwexler and amcclain authored Dec 13, 2024
1 parent 3096f46 commit 52a1644
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 37 deletions.
20 changes: 5 additions & 15 deletions client-app/src/admin/tests/viewmanager/ViewManagerTestModel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,9 +81,9 @@ export class ViewManagerTestModel extends HoistModel {
'localStorageKey',
'sessionStorageKey',
'manageGlobal',
'enableSharing',
'enableAutoSave',
'enableDefault',
'enableFavorites',
'initialViewName'
].some(it => dirtyFields.includes(it));
}
Expand All @@ -100,24 +100,14 @@ export class ViewManagerTestModel extends HoistModel {
{name: 'localStorageKey', initialValue: 'viewManagerTest'},
{name: 'sessionStorageKey', initialValue: 'viewManagerTest'},
{name: 'manageGlobal', initialValue: true},
{name: 'enableFavorites', initialValue: true},
{name: 'enableSharing', initialValue: true},
{name: 'enableAutoSave', initialValue: true},
{name: 'enableDefault', initialValue: true},
{name: 'initialViewName', initialValue: null},
{name: 'settleTime', initialValue: 250},
{name: 'settleTime', initialValue: 1000},
{name: 'showSaveButton', initialValue: 'whenDirty'},
{name: 'showRevertButton', initialValue: 'never'},
{name: 'buttonSide', initialValue: 'right'},
{
name: 'showPrivateViewsInSubMenu',
displayName: 'Show private views in sub-menu',
initialValue: false
},
{
name: 'showGlobalViewsInSubMenu',
displayName: 'Show global views in sub-menu',
initialValue: false
},
{
name: 'customMenuButtonProps',
displayName: 'Custom menuButtonProps',
Expand All @@ -142,9 +132,9 @@ export class ViewManagerTestModel extends HoistModel {
localStorageKey,
sessionStorageKey,
manageGlobal,
enableSharing,
enableDefault,
enableAutoSave,
enableFavorites,
initialViewName,
settleTime
} = data;
Expand All @@ -161,9 +151,9 @@ export class ViewManagerTestModel extends HoistModel {
typeDisplayName,
globalDisplayName,
manageGlobal,
enableSharing,
enableDefault,
enableAutoSave,
enableFavorites,
persistWith,
settleTime,
initialViewSpec: views => views.find(v => v.name == initialViewName) ?? views[0]
Expand Down
31 changes: 9 additions & 22 deletions client-app/src/admin/tests/viewmanager/ViewManagerTestPanel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ const modelConfigForm = hoistCmp.factory<ViewManagerTestModel>({
modelConfig: {
tabs: [
{id: 'modelConfig', content: modelConfig()},
{id: 'cmpProps', content: cmpProps()}
{id: 'cmpProps', title: 'Component Props', content: cmpProps()}
]
}
})
Expand Down Expand Up @@ -111,14 +111,6 @@ const cmpProps = hoistCmp.factory({
})
}),
hbox(
formField({
field: 'showPrivateViewsInSubMenu',
item: switchInput()
}),
formField({
field: 'showGlobalViewsInSubMenu',
item: switchInput()
}),
formField({
field: 'customMenuButtonProps',
item: switchInput()
Expand Down Expand Up @@ -152,6 +144,7 @@ const modelConfig = hoistCmp.factory({
}),
formField({
field: 'sessionStorageKey',
info: 'If set, will persist pendingValue',
item: textInput({enableClear: true})
}),
formField({
Expand All @@ -168,11 +161,13 @@ const modelConfig = hoistCmp.factory({
item: switchInput()
}),
formField({
field: 'enableAutoSave',
field: 'enableSharing',
item: switchInput()
}),
})
),
hbox(
formField({
field: 'enableFavorites',
field: 'enableAutoSave',
item: switchInput()
}),
formField({
Expand Down Expand Up @@ -223,14 +218,8 @@ const persistablesPanel = hoistCmp.factory<ViewManagerTestModel>({
render({model}) {
if (!model.viewManagerModel) return placeholder('ViewManager not yet created');

const {
showSaveButton,
showRevertButton,
showPrivateViewsInSubMenu,
showGlobalViewsInSubMenu,
customMenuButtonProps,
buttonSide
} = model.configFormModel.values,
const {showSaveButton, showRevertButton, customMenuButtonProps, buttonSide} =
model.configFormModel.values,
menuButtonProps = customMenuButtonProps
? ({
icon: Icon.star(),
Expand All @@ -244,8 +233,6 @@ const persistablesPanel = hoistCmp.factory<ViewManagerTestModel>({
viewManager({
showSaveButton,
showRevertButton,
showPrivateViewsInSubMenu,
showGlobalViewsInSubMenu,
menuButtonProps,
buttonSide
})
Expand Down

0 comments on commit 52a1644

Please sign in to comment.