Skip to content

Commit

Permalink
Merge branch 'develop' of https://github.com/xh/toolbox into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
febbraiod committed Oct 14, 2024
2 parents 0c8ef67 + f4c0fec commit 56f49ee
Show file tree
Hide file tree
Showing 19 changed files with 586 additions and 567 deletions.
8 changes: 5 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,19 @@

## v6.0-SNAPSHOT - unreleased

## v5.2.0

### New Features
* Enabled new Correlation ID tracking support in Hoist.

### Bug Fixes
* Fixed `InputsPanel` "Set Focus" popover.

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

## 5.1.0 - 2024-06-21
## v5.1.0 - 2024-06-21

### 📚 Libraries
* hoist-core 20.1.0
Expand Down
10 changes: 1 addition & 9 deletions client-app/.husky/pre-commit
Original file line number Diff line number Diff line change
@@ -1,11 +1,3 @@
cd client-app

yarn run lint-staged

# nullify the paths option if hoist-react is not present
if [ ! -d ../../hoist-react ]
then
yarn run tsc --paths=null
else
yarn run tsc
fi
yarn run tsc
14 changes: 10 additions & 4 deletions client-app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,14 @@
"prepare": "cd .. && husky client-app/.husky"
},
"lint-staged": {
"*.{js,jsx,ts,tsx}": ["prettier --write", "eslint"],
"*.s?(a|c)ss": ["prettier --write", "stylelint"]
"*.{js,jsx,ts,tsx}": [
"prettier --write",
"eslint"
],
"*.s?(a|c)ss": [
"prettier --write",
"stylelint"
]
},
"dependencies": {
"@ag-grid-community/client-side-row-model": "~31.2.0",
Expand All @@ -37,10 +43,10 @@
"@ag-grid-enterprise/side-bar": "~31.2.0",
"@ag-grid-enterprise/sparklines": "~31.2.0",
"@fortawesome/free-brands-svg-icons": "^6.4.0",
"@xh/hoist": "^68.0.0-SNAPSHOT",
"@xh/hoist": "^69.0.0-SNAPSHOT",
"@xh/package-template": "~3.0.1",
"core-js": "3.x",
"highcharts": "11.4.3",
"highcharts": "11.x",
"lodash": "4.x",
"moment": "2.x",
"react": "~18.2.0",
Expand Down
1 change: 1 addition & 0 deletions client-app/src/apps/news.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,6 @@ XH.renderApp({
authModelClass: AuthModel,
isMobileApp: false,
enableLogout: true,
showBrowserContextMenu: true,
checkAccess: () => true
});
15 changes: 13 additions & 2 deletions client-app/src/core/AuthModel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ export class AuthModel extends HoistAuthModel {
client: AuthZeroClient;

override async completeAuthAsync(): Promise<boolean> {
this.setMaskMsg('Authenticating...');

// Toolbox's server-provided configuration allows for OAuth to be disabled entirely, falling back to a username
// and password login. This is intended primarily for development scenarios - e.g. local mobile development
// where you wish to load the app on a local IP that's not a valid redirect URL as per Auth0. Note that this
Expand All @@ -21,7 +23,9 @@ export class AuthModel extends HoistAuthModel {
// then return the result of the server-based auth check - will be false if the user does not have an
// active session, at which point the Hoist login form will be displayed.
XH.appSpec.enableLoginForm = true;
return this.getAuthStatusFromServerAsync();
const ret = await this.getAuthStatusFromServerAsync();
this.setMaskMsg(null);
return ret;
}

// Otherwise we proceed with the primary OAuth flow by constructing and initializing an AuthZeroClient, one of
Expand Down Expand Up @@ -49,7 +53,9 @@ export class AuthModel extends HoistAuthModel {
// installed above, which will be read and validated by Toolbox's server-side implementation of
// `AuthenticationService.completeAuthentication()`. Toolbox is unusual in that it is a deliberately open site
// and will create an account on the fly for any new user, so we expect this request to always return true.
return this.getAuthStatusFromServerAsync();
const ret = await this.getAuthStatusFromServerAsync();
this.setMaskMsg(null);
return ret;
}

// This model's override calls the super implementation to clear the user's session on the Toolbox server, then
Expand All @@ -58,4 +64,9 @@ export class AuthModel extends HoistAuthModel {
await super.logoutAsync();
await this.client?.logoutAsync();
}

// Update overall load mask message to provide an indication that this auth flow is processing.
private setMaskMsg(msg: string) {
XH.appContainerModel.initializingLoadMaskMessage = msg;
}
}
6 changes: 5 additions & 1 deletion client-app/src/examples/news/NewsPanel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,11 @@ export const newsPanel = hoistCmp.factory({
className: 'tb-news-panel',
width: '100%',
height: '100%',
item: dataView(),
item: dataView({
// Allow standard OS-level selection of text within the DataView.
// Works along with AppSpec config `showBrowserContextMenu: true` in news.ts.
agOptions: {enableCellTextSelection: true}
}),
mask: 'onLoad',
bbar: bbar()
});
Expand Down
24 changes: 11 additions & 13 deletions client-app/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,29 +1,27 @@
{
"compilerOptions": {
"noEmit": true,

"target": "ES2022",
"module": "ES2022",
"lib": ["dom", "es2022"],

"jsx": "react",
"moduleResolution": "Node",
"skipLibCheck": true,

"allowSyntheticDefaultImports": true,
"experimentalDecorators": true,
"jsx": "react",
"lib": ["dom", "es2022"],
"module": "ES2022",
"moduleResolution": "Node",
"noEmit": true,
"noImplicitOverride": true,
"resolveJsonModule": true,
"skipLibCheck": true,
"target": "ES2022",
"useDefineForClassFields": true,

// Ignored by tsc when run by husky `pre-commit` hook if hoist-react is not present
// in a wrapper project for inline development. Hoist-react should only be present if
// you are developing hoist-react itself.
// Supports inline development of hoist-react in a wrapper project.
// Ignored if hoist-react is not found at the relative path below.
"paths": {
"@xh/hoist/*": ["../../hoist-react/*"]
}

},
// Reference hoist-react as a composite build.
// Allows for distinct tsconfig options in hoist-react vs. this application.
"references": [
{"path": "./node_modules/@xh/hoist"}
],
Expand Down
Loading

0 comments on commit 56f49ee

Please sign in to comment.