Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Persistable + ViewManager #737

Merged
merged 23 commits into from
Nov 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
12c6c06
Checkpoint with ViewManager on Portfolio app
amcclain Oct 30, 2024
9e4a694
Update portfolio example detail to DashContainer
amcclain Oct 30, 2024
c453415
Store orders widget state within DashViewModel
amcclain Nov 1, 2024
c5ce432
Detail view tweaks
amcclain Nov 2, 2024
148def1
Merge branch 'develop' into persistableWithViewManager
amcclain Nov 4, 2024
959a135
Merge branch 'refs/heads/develop' into persistableWithViewManager
amcclain Nov 4, 2024
e78a79b
Update to renamed enableSharing config
amcclain Nov 5, 2024
07c38b0
WIP on Admin test tab for ViewManager
amcclain Nov 5, 2024
ac295ae
Clarify AppModel-based viewManagerModel in Portfolio example
amcclain Nov 5, 2024
b5e9446
Minor updates to test panel
amcclain Nov 5, 2024
66e85cd
Add Dashboard test cases
amcclain Nov 6, 2024
9d8721c
Tweak
amcclain Nov 6, 2024
823bb48
Add example/test of markPersisted model property
amcclain Nov 6, 2024
863ff12
Add pct-based panel model example
amcclain Nov 6, 2024
2488d1c
Merge branch 'develop' into persistableWithViewManager
amcclain Nov 7, 2024
5e444c8
Remove long-unused "WIP" Admin tab
amcclain Nov 8, 2024
7babe6b
Wire example filterChooser faves to local storage
amcclain Nov 8, 2024
4ca6bf4
Label tweak
amcclain Nov 8, 2024
b572fc9
Options to test custom ViewManager component props
amcclain Nov 11, 2024
8d26240
Options to test custom ViewManager component props
amcclain Nov 11, 2024
0ac2a59
Replace `entity` config with `viewType` + `viewTypeDisplayName`
amcclain Nov 11, 2024
815dabb
Run `yarn upgrade`
amcclain Nov 12, 2024
1524bbd
Changelog entry
amcclain Nov 12, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 10 additions & 6 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,13 @@

## v6.0-SNAPSHOT - unreleased

### New Features
* Added the new Hoist `ViewManager` component to the Portfolio example, as well as an in-depth test page hosted within the Admin Console.
* Refactored and updated the Portfolio example for clarity and to better demonstrate potential usages of saved layouts via `ViewManager`.

## v5.3.0 - 2024-10-17

### 📚 Libraries
### Libraries
* hoist-core 24.0.0
* @xh/hoist 69.0.0

Expand All @@ -16,32 +20,32 @@
### Bug Fixes
* Fixed `InputsPanel` "Set Focus" popover.

### 📚 Libraries
### Libraries
* hoist-core 23.0.0
* @xh/hoist 68.1.0

## v5.1.0 - 2024-06-21

### 📚 Libraries
### Libraries
* hoist-core 20.1.0

## v5.0.2 - 2024-06-20

### 📚 Libraries
### Libraries
* hoist-core 20.0.2
* @xh/hoist 64.0.5

## v5.0.1 - 2024-05-19

### 📚 Libraries
### Libraries
* @xh/hoist 64.0.1

## v5.0.0 - 2024-05-17

### New Features
* Support for new `mockDirectoryGroups` config - see `RoleService` for details.

### 📚 Libraries
### Libraries
* hoist-core 20.0 (multi-instance)
* @xh/hoist 64.0
* @ag-grid 31.2
Expand Down
15 changes: 5 additions & 10 deletions client-app/src/admin/AppModel.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
import {XH} from '@xh/hoist/core';
import {AppModel as HoistAdminAppModel} from '@xh/hoist/admin/AppModel';
import {XH} from '@xh/hoist/core';
import {Icon} from '@xh/hoist/icon';
import {PortfolioService} from '../core/svc/PortfolioService';
import {roadmapTab} from './roadmap/RoadmapTab';
import {testsTab} from './tests/TestsTab';
import {wipTab} from './wip/WipTab';

export class AppModel extends HoistAdminAppModel {
static override instance: AppModel;
Expand Down Expand Up @@ -42,14 +41,11 @@ export class AppModel extends HoistAdminAppModel {
{name: 'localDate', path: '/localDate'},
{name: 'panelResizing', path: '/panelResizing'},
{name: 'select', path: '/select'},
{name: 'webSockets', path: '/webSockets'},
{name: 'storeColumnFilters', path: '/storeColumnFilters'},
{name: 'viewColumnFilters', path: '/viewColumnFilters'},
{name: 'storeColumnFilters', path: '/storeColumnFilters'}
{name: 'viewManager', path: '/viewManager'},
{name: 'webSockets', path: '/webSockets'}
]
},
{
name: 'wip',
path: '/wip'
}
];
}
Expand All @@ -58,8 +54,7 @@ export class AppModel extends HoistAdminAppModel {
return [
...super.createTabs(),
{id: 'roadmap', title: 'Roadmap', icon: Icon.mapSigns(), content: roadmapTab},
{id: 'tests', icon: Icon.stopwatch(), content: testsTab},
{id: 'wip', title: 'WIP', icon: Icon.experiment(), content: wipTab}
{id: 'tests', icon: Icon.stopwatch(), content: testsTab}
];
}
}
41 changes: 17 additions & 24 deletions client-app/src/admin/tests/TestsTab.ts
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
import {hoistCmp} from '@xh/hoist/core';
import {tabContainer} from '@xh/hoist/cmp/tab';
// eslint-disable-next-line
import {hoistCmp} from '@xh/hoist/core';
import {asyncLoopPanel} from './asyncLoops/AsyncLoopPanel';
import {GridTestPanel} from './grids/GridTestPanel';
import {storeColumnFilterPanel} from './columnFilters/store/StoreColumnFilterPanel';
import {viewColumnFilterPanel} from './columnFilters/view/ViewColumnFilterPanel';
import {CubeTestPanel} from './cube/CubeTestPanel';
import {WebSocketTestPanel} from './websocket/WebSocketTestPanel';
import {dataViewTestPanel} from './dataview/DataViewTestPanel';
import {FetchApiTestPanel} from './fetch/FetchApiTestPanel';
import {GridTestPanel} from './grids/GridTestPanel';
import {gridScrolling} from './gridScrolling/GridScrolling';
import {LocalDateTestPanel} from './localDate/LocalDateTestPanel';
import {PanelResizingTestPanel} from './panels/PanelResizingTestPanel';
import {FetchApiTestPanel} from './fetch/FetchApiTestPanel';
import {SelectTestPanel} from './select/SelectTestPanel';
import {dataViewTestPanel} from './dataview/DataViewTestPanel';
import {storeColumnFilterPanel} from './columnFilters/store/StoreColumnFilterPanel';
import {viewColumnFilterPanel} from './columnFilters/view/ViewColumnFilterPanel';
import {gridScrolling} from './gridScrolling/GridScrolling';
import {viewManagerTestPanel} from './viewmanager/ViewManagerTestPanel';
import {WebSocketTestPanel} from './websocket/WebSocketTestPanel';

export const testsTab = hoistCmp.factory(() => {
return tabContainer({
Expand All @@ -22,24 +22,17 @@ export const testsTab = hoistCmp.factory(() => {
tabs: [
{id: 'asyncLoop', title: 'Async Loops', content: asyncLoopPanel},
{id: 'cube', title: 'Cube Data', content: CubeTestPanel},
{id: 'dataView', title: 'Data View', content: dataViewTestPanel},
{id: 'dataView', content: dataViewTestPanel},
{id: 'fetchAPI', title: 'Fetch API', content: FetchApiTestPanel},
{id: 'grid', title: 'Grid', content: GridTestPanel},
{id: 'gridScrolling', title: 'Grid Scrolling', content: gridScrolling},
{id: 'gridScrolling', content: gridScrolling},
{id: 'localDate', title: 'LocalDate API', content: LocalDateTestPanel},
{id: 'panelResizing', title: 'Panel Resizing', content: PanelResizingTestPanel},
{id: 'select', title: 'Select', content: SelectTestPanel},
{id: 'webSockets', title: 'WebSockets', content: WebSocketTestPanel},
{
id: 'storeColumnFilters',
title: 'Store Column Filters',
content: storeColumnFilterPanel
},
{
id: 'viewColumnFilters',
title: 'View Column Filters',
content: viewColumnFilterPanel
}
{id: 'panelResizing', content: PanelResizingTestPanel},
{id: 'select', content: SelectTestPanel},
{id: 'storeColumnFilters', content: storeColumnFilterPanel},
{id: 'viewColumnFilters', content: viewColumnFilterPanel},
{id: 'viewManager', content: viewManagerTestPanel},
{id: 'webSockets', title: 'WebSockets', content: WebSocketTestPanel}
]
}
});
Expand Down
15 changes: 5 additions & 10 deletions client-app/src/admin/tests/grids/GridTestModel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import {GridTestMetrics} from './GridTestMetrics';
const pnlColumn: ColumnSpec = {
absSort: true,
align: 'right',
width: 120,
renderer: numberRenderer({
precision: 0,
ledger: true,
Expand All @@ -20,8 +19,9 @@ const pnlColumn: ColumnSpec = {
})
};

const PERSIST_KEY = 'adminGridTest';
export class GridTestModel extends HoistModel {
override persistWith = {localStorageKey: 'persistTest'};
override persistWith = {localStorageKey: PERSIST_KEY};

// Total count (approx) of all nodes generated (parents + children).
@bindable recordCount = 200000;
Expand Down Expand Up @@ -188,7 +188,7 @@ export class GridTestModel extends HoistModel {
}

return new GridModel({
persistWith: persistType ? {[persistType]: 'persistTest'} : null,
persistWith: persistType ? {[persistType]: PERSIST_KEY} : null,
selModel: {mode: 'multiple'},
sortBy: 'id',
emptyText: 'No records found...',
Expand All @@ -211,20 +211,17 @@ export class GridTestModel extends HoistModel {
columns: [
{
field: 'id',
width: 140,
isTreeColumn: this.tree
},
{
field: 'symbol',
agOptions: {
filter: 'agTextColumnFilter',
suppressHeaderMenuButton: false
},
width: 200
}
},
{
field: 'trader',
width: 200
field: 'trader'
},
{
groupId: 'pnl',
Expand All @@ -238,7 +235,6 @@ export class GridTestModel extends HoistModel {
{
field: 'volume',
align: 'right',
width: 130,
highlightOnChange: true,
renderer: millionsRenderer({
precision: 2,
Expand All @@ -249,7 +245,6 @@ export class GridTestModel extends HoistModel {
{
field: 'complex',
align: 'right',
width: 130,
renderer: (v, {record}) => {
return fragment(
fmtMillions(record.data.volume, {precision: 2, label: true}),
Expand Down
39 changes: 39 additions & 0 deletions client-app/src/admin/tests/viewmanager/ViewManagerTest.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
.tb-vm-test {
&__model-conf {
h3 {
border-bottom: var(--xh-border-solid);
font-weight: normal;

&:first-child {
margin-top: 0;
}
}

.xh-form-field-switch-input {
margin-left: 4px;
.xh-form-field-label {
font-size: 0.8em;
}
}
}

&__output {
> .xh-panel__content > .xh-vframe {
overflow-y: auto !important;
}
}

&__comp {
> .xh-panel__content > .xh-vframe {
padding: var(--xh-pad-px);
}

border: var(--xh-border-solid);
flex: none !important;
margin: var(--xh-pad-double-px) var(--xh-pad-double-px) 0 var(--xh-pad-double-px);

&:last-child {
margin-bottom: var(--xh-pad-double-px);
}
}
}
Loading
Loading