Skip to content

Typescript migration and fixes#22

Merged
jacobsjo merged 5 commits into
mainfrom
typescript-migration-and-fixes
Jun 22, 2026
Merged

Typescript migration and fixes#22
jacobsjo merged 5 commits into
mainfrom
typescript-migration-and-fixes

Conversation

@jacobsjo

Copy link
Copy Markdown
Contributor

TypeScript migration + modernization

  • Add a local api.ts for the bundle's domain types.
  • Mark private fields/methods, type selection events from map.apps, convert callbacks
    to async/await, and replace ct/_lang helpers with plain JS.
  • Separate the ChartingDashboardController from ChartingDashboardWidgetModel.
  • Remove dead QueryController methods (getMetadata, getRelatedMetadata,
    findRelatedRecords).

Result-ui bulk action

  • Replace the removed ResultCenterChartingTool with a result-api.BulkTableAction

Per-year charting via related tables (bug fix)

  • Fix QueryController.getRelatedData: it used apprtFetch (which returns a
    Response) with a non-existent handleAs option, so the response body was never
    parsed; switched to apprtFetchJson.
  • Quote string join keys in the where clause (AGS LIKE '05315') - unquoted string keys returned HTTP 400.
  • Fixed the sample app: Add separate Kreisgrenzen_2022 layer joined to the income layer by AGS with timeAttribute: YEAR, rendering a per-year line chart.
image

jacobsjo added 4 commits June 15, 2026 14:33
Convert all bundle sources from JavaScript to TypeScript with strong typing. Add a local api.ts for domain types and an index.d.ts for the vendored dn_charting-c3 library, derive typed i18n Messages, and apply license headers.
Separate the reactive Mutable state model from a behavior controller, mark private fields and methods, type selection events, convert to async/await, and replace ct_lang helpers with plain JS.
Fix the related-data fetch (use apprtFetchJson and quote string join keys) and demonstrate it in the sample app with a Kreisgrenzen relationship.
@ct-mgadomski ct-mgadomski self-requested a review June 18, 2026 09:22
/// limitations under the License.
///

import d_string from "dojo/string";

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ggf. könnte man die dojo-Abhängigkeit noch durch plain TS ersetzen?

Comment thread src/main/js/bundles/dn_charting/C3ChartsFactory.ts
Comment thread src/main/js/bundles/dn_charting/ChartingBulkAction.ts
import Vue from "apprt-vue/Vue";
import VueDijit from "apprt-vue/VueDijit";
import Binding, { type Bindable } from "apprt-binding/Binding";
import d_aspect from "dojo/aspect";

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Dojo-Abhängigkeit. Kann man die ersetzen?

Comment thread src/main/js/bundles/dn_charting/ChartingDashboardWidgetModel.ts
Comment thread src/main/js/bundles/dn_charting/QueryController.ts
@jacobsjo jacobsjo merged commit 5449572 into main Jun 22, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants