Skip to content

Commit fa7eba5

Browse files
committed
updated history, quill and typescript to newest version
1 parent b0975a0 commit fa7eba5

10 files changed

Lines changed: 60 additions & 482 deletions

File tree

package-lock.json

Lines changed: 31 additions & 461 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
"classnames": "^2.2.6",
3737
"date-fns": "^4.1.0",
3838
"date-fns-tz": "^3.2.0",
39-
"history": "5.0.1",
39+
"history": "^5.3.0",
4040
"js-big-decimal": "^2.2.0",
4141
"leaflet": "^1.9.4",
4242
"postcss": "^8.4.31",
@@ -47,7 +47,7 @@
4747
"primeicons": "^7.0.0",
4848
"primereact": "^10.9.4",
4949
"query-string": "^9.1.1",
50-
"quill": "^1.3.7",
50+
"quill": "^2.0.3",
5151
"react-error-boundary": "^5.0.0",
5252
"react-helmet": "^6.1.0",
5353
"react-leaflet": "^4.2.1",
@@ -71,7 +71,7 @@
7171
"devDependencies": {
7272
"vite": "^7.0.0",
7373
"vite-plugin-dts": "^4.5.4",
74-
"typescript": "^4.7.3",
74+
"typescript": "^5.8.3",
7575
"@types/leaflet": "^1.9.8",
7676
"@types/node": "^22.14.1",
7777
"@types/quill": "^2.0.14",

src/main/API.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ class API implements IAPI {
7373
* @constructor constructs api instance
7474
* @param server - server instance
7575
*/
76-
constructor (server: BaseServer|Server|ServerFull, store:BaseContentStore|ContentStore|ContentStoreFull, appSettings:AppSettings, sub:SubscriptionManager, history?:History<any>) {
76+
constructor (server: BaseServer|Server|ServerFull, store:BaseContentStore|ContentStore|ContentStoreFull, appSettings:AppSettings, sub:SubscriptionManager, history?:History) {
7777
this.#server = server;
7878
this.#contentStore = store;
7979
this.#appSettings = appSettings;
@@ -91,7 +91,7 @@ class API implements IAPI {
9191
#appSettings: AppSettings
9292

9393
/** the react routers history object */
94-
history?: History<any>;
94+
history?: History;
9595

9696
/** Subscription-Manager instance */
9797
#subManager: SubscriptionManager

src/main/components/editors/linked/UIEditorLinked.tsx

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1160,14 +1160,16 @@ const UIEditorLinked: FC<IEditorLinked & IExtendableLinkedEditor & IComponentCon
11601160
onChange={event => {
11611161
startedEditing.current = true;
11621162

1163-
if (event.value == "") {
1164-
sendFilter(event.value);
1163+
const value = event.value as unknown as string;
1164+
if (value == "") {
1165+
sendFilter(value);
11651166
}
11661167
if (isDisplayRefColNameOrConcat && Array.isArray(event.target.value)) {
11671168
setText(getDisplayValue(event.target.value, unpackValue(event.target.value), linkReference, props.columnName, isDisplayRefColNameOrConcat, cellEditorMetaData, props.dataRow, linkedColumnMetaData?.dataTypeIdentifier, linkedColumnMetaData, context));
11681169
}
11691170
else {
1170-
setText(unpackValue(event.target.value));
1171+
const targetValue = event.target.value as unknown as string;
1172+
setText(unpackValue(targetValue));
11711173
}
11721174
}}
11731175
onFocus={(event) => {

src/main/components/editors/text/UIEditorText.tsx

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -51,14 +51,17 @@ enum FieldTypes {
5151
}
5252

5353
/** custom divider blot to insert <hr> intro quill editor */
54-
let BlockEmbed = Quill.import('blots/block/embed');
55-
class DividerBlot extends BlockEmbed { }
54+
const BlockEmbed = Quill.import('blots/block/embed');
55+
56+
class DividerBlot extends (BlockEmbed as any) { }
5657
DividerBlot.blotName = 'divider';
5758
DividerBlot.tagName = 'hr';
5859
Quill.register(DividerBlot);
5960

6061
const Module = Quill.import('core/module')
6162
class DividerToolbar extends Module {
63+
toolbar :any;
64+
6265
constructor (quill: Quill, options: any) {
6366
super(quill, options)
6467
this.options = options
@@ -68,15 +71,15 @@ class DividerToolbar extends Module {
6871
}
6972

7073
dividerHandler () {
71-
const getSelection = this.quill.getSelection() || {}
72-
let selection = getSelection.index || this.quill.getLength()
74+
const getSelection = this.quill.getSelection()
75+
let selection = getSelection ? getSelection.index : this.quill.getLength()
7376
const [leaf] = this.quill.getLeaf(selection - 1)
7477
if (leaf instanceof DividerBlot) {
7578
this.quill.insertText(selection, '\n', "user")
7679
selection++
7780
}
7881
this.quill.insertEmbed(selection, 'divider', this.options, "user")
79-
if (getSelection.index === 0) {
82+
if (getSelection && getSelection.index === 0) {
8083
selection++
8184
this.quill.insertText(selection, '\n', "user")
8285
}

src/main/components/maps/UIMapGoogle.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,7 @@ const UIMapGoogle: FC<IMap & IExtendableMapGoogle & IComponentConstants> = (prop
223223

224224
if (selectedMarker && props.pointSelectionEnabled && !props.pointSelectionLockedOnCenter) {
225225
selectedMarker.setPosition({lat: e.latLng.lat(), lng: e.latLng.lng()})
226-
sendSetValues(props.pointsDataBook, props.name, [props.latitudeColumnName || "LATITUDE", props.longitudeColumnName || "LONGITUDE"], "" || "LATITUDE", [e.latLng.lat(), e.latLng.lng()], props.context.server, props.topbar);
226+
sendSetValues(props.pointsDataBook, props.name, [props.latitudeColumnName || "LATITUDE", props.longitudeColumnName || "LONGITUDE"], "LATITUDE", [e.latLng.lat(), e.latLng.lng()], props.context.server, props.topbar);
227227
showTopBar(sendSaveRequest(props.pointsDataBook, true, props.context.server), props.topbar)
228228
}
229229
}

src/main/components/tree/UITreeV2.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -396,8 +396,10 @@ const UITreeV2: FC<ITree & IExtendableTree> = (props) => {
396396
});
397397

398398
if (isLevelZeroData) {
399-
setNodes(newNodesPerParent.entries().next().value[1]);
400-
nodesRef.current = newNodesPerParent.entries().next().value[1];
399+
const entry = newNodesPerParent.entries().next().value;
400+
const value = entry ? entry[1] : [];
401+
setNodes(value);
402+
nodesRef.current = value;
401403
}
402404
else {
403405
for (let parentNode of parentNodes) {

src/main/contentstore/BaseContentStore.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ export default abstract class BaseContentStore {
135135
inactiveScreens: string[] = [];
136136

137137
/** the react routers history object */
138-
history?:History<any>;
138+
history?:History;
139139

140140
/** Global components are extra components which are not available in VisionX but are displayable client-side */
141141
addedComponents:Map<string, Function> = new Map<string, Function>().set("SignaturePad", (props: ISignaturPad) => <SignaturePad {...props} />);
@@ -159,7 +159,7 @@ export default abstract class BaseContentStore {
159159
* Initiates a contentstore instance
160160
* @param history - the history
161161
*/
162-
constructor(history?:History<any>) {
162+
constructor(history?:History) {
163163
this.history = history;
164164
}
165165

src/main/hooks/data-hooks/useMenuItems.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,8 @@ const useMenuItems = (menus?:string[], isCorp?:boolean) => {
180180

181181
// If there is only one menugroup, autoexpand this group
182182
if (menuGroup.size === 1) {
183-
const singleGroup = menuGroup.entries().next().value[1];
183+
const entry = menuGroup.entries().next();
184+
const singleGroup = entry.value ? entry.value[1] : [];
184185
primeMenu = getSubItems(singleGroup, true);
185186
}
186187
else {

src/main/server/BaseServer.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ export default abstract class BaseServer {
6767
appSettings:AppSettings;
6868

6969
/** the react routers history object */
70-
history?:History<any>;
70+
history?:History;
7171

7272
/** a map of still open requests */
7373
openRequests: Map<any, Promise<any>>;
@@ -159,7 +159,7 @@ export default abstract class BaseServer {
159159
* @param subManager - subscription-manager instance
160160
* @param history - the history
161161
*/
162-
constructor(store: ContentStore|ContentStoreFull, subManager:SubscriptionManager, appSettings:AppSettings, history?: History<any>) {
162+
constructor(store: ContentStore|ContentStoreFull, subManager:SubscriptionManager, appSettings:AppSettings, history?: History) {
163163
this.contentStore = store;
164164
this.subManager = subManager;
165165
this.appSettings = appSettings;

0 commit comments

Comments
 (0)