Skip to content

Typescript migration and fixes#22

Open
jacobsjo wants to merge 5 commits into
mainfrom
typescript-migration-and-fixes
Open

Typescript migration and fixes#22
jacobsjo wants to merge 5 commits into
mainfrom
typescript-migration-and-fixes

Conversation

@jacobsjo

Copy link
Copy Markdown

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?


export default class C3ChartsFactory {

declare private c3ChartsDataProvider: C3ChartsDataProvider;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Ich verstehe immer noch nicht wofür man "declare" benötigt. Weißt du das?

readonly tooltip: string;
readonly priority?: number;

declare private controller: InjectedReference<ChartingDashboardController>;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Ebenso auch hier

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?

import { declare } from "apprt-core/Mutable";
import type { ChartsTab, Relationship, StoreChartsProperties, Tab } from "./api";

export default declare({

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

declare

import type { ChartStore, FeatureAttributes, RelatedDataEntry, Relationship } from "./api";

/** A feature returned by an esri feature service query. */
interface EsriFeature {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Hierfür gibts doch locker types von der esri API oder? :D

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