diff --git a/changelog.md b/changelog.md index c26dac0..8fc6c0a 100644 --- a/changelog.md +++ b/changelog.md @@ -1,5 +1,11 @@ # Changelog +## 2024-10-06 - 1.1.1 - fix(core) +Remove SelectionDimension functionality + +- Removed SelectionDimension class and references +- Deleted smartrouter.classes.selectiondimension.ts and related imports + ## 2024-10-06 - 1.1.0 - feat(core) Add selection dimensions and route removal functionality diff --git a/ts/00_commitinfo_data.ts b/ts/00_commitinfo_data.ts index 91e820a..3055208 100644 --- a/ts/00_commitinfo_data.ts +++ b/ts/00_commitinfo_data.ts @@ -3,6 +3,6 @@ */ export const commitinfo = { name: '@push.rocks/smartrouter', - version: '1.1.0', + version: '1.1.1', description: 'A JavaScript library providing routing capabilities for web applications.' } diff --git a/ts/smartrouter.classes.selectiondimension.ts b/ts/smartrouter.classes.selectiondimension.ts deleted file mode 100644 index 5a17f00..0000000 --- a/ts/smartrouter.classes.selectiondimension.ts +++ /dev/null @@ -1,50 +0,0 @@ -import * as plugins from './smartrouter.plugins.js'; - -export interface ISelectionOption { - key: string; - detail: T; - selected?: boolean; - action: () => Promise; -} - -export class SelectionDimension { - /** - * the key of the selection dimension - */ - public dimensionKey: string; - /** - * the level of the selection dimension - * a higher level is execution later than a lower level - * during catchup phase - */ - public dimensionLevel: number; - public dimensionPeers: SelectionDimension[] = []; - public selectionOptions: ISelectionOption[] = []; - - public selectionOptionSubject = new plugins.smartrx.rxjs.Subject[]>(); - - public async emitSelectionOptions () { - const selectionOptions = this.selectionOptions.map((selectionOptionArg): ISelectionOption => { - return { - key: selectionOptionArg.key, - detail: selectionOptionArg.detail, - action: async () => { - this.updateSelection(selectionOptionArg); - return await selectionOptionArg.action(); - }, - } - }); - this.selectionOptionSubject.next(selectionOptions); - } - - public async updateSelection (selectionOptionArg: ISelectionOption) { - for (const selectionOption of this.selectionOptions) { - if (selectionOption.key === selectionOptionArg.key) { - selectionOption.selected = true; - } else { - selectionOption.selected = false; - } - } - this.emitSelectionOptions(); - } -} \ No newline at end of file diff --git a/ts/smartrouter.classes.smartrouter.ts b/ts/smartrouter.classes.smartrouter.ts index e3b8e97..2e47951 100644 --- a/ts/smartrouter.classes.smartrouter.ts +++ b/ts/smartrouter.classes.smartrouter.ts @@ -1,7 +1,6 @@ import * as plugins from './smartrouter.plugins.js'; import { QueryParams } from './smartrouter.classes.queryparams.js'; -import { type ISelectionOption, SelectionDimension } from './smartrouter.classes.selectiondimension.js'; const routeLog = (message: string) => { console.log(`%c[Router]%c ${message}`, 'color: rgb(255, 105, 100);', 'color: inherit'); @@ -102,19 +101,4 @@ export class SmartRouter { } as IRouteInfo); // not waiting here } } - - public selectionDimensionsMap = new plugins.lik.ObjectMap(); - public async createSelectionDimension(optionsArg: { - routeArg: string, - keyArg: string, - options: ISelectionOption[], - peers?: SelectionDimension[], - }) { - const selectionDimension = new SelectionDimension(); - selectionDimension.dimensionKey = optionsArg.keyArg; - selectionDimension.dimensionPeers = optionsArg.peers; - selectionDimension.selectionOptions = optionsArg.options; - await this.selectionDimensionsMap.findOneAndRemove(async dimensionArg => dimensionArg.dimensionKey === optionsArg.keyArg); - this.selectionDimensionsMap.addMappedUnique(optionsArg.keyArg, selectionDimension); - } } \ No newline at end of file