Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
c03e363
cp4-icon layers (requires back-end work)
Arbyhisenaj Jan 14, 2026
d6c40b3
cp5-add/remove marker layers
Arbyhisenaj Jan 14, 2026
07b3b22
greyed instead of hidden layers on hexmap
Arbyhisenaj Feb 25, 2026
20f7edd
checkpoint
Arbyhisenaj Feb 25, 2026
71895f0
checkpoint
Arbyhisenaj Feb 25, 2026
e2fa6fa
refactor
Arbyhisenaj Feb 25, 2026
f7c8299
optimised experience/UI
Arbyhisenaj Feb 26, 2026
e621640
removed charts
Arbyhisenaj Feb 26, 2026
79d15f7
Merge branch 'main' into mff-updates
Arbyhisenaj Feb 26, 2026
6ba26d5
latest
Arbyhisenaj Feb 26, 2026
8f52548
latest from work
Arbyhisenaj Feb 26, 2026
47656d4
save inspector settings as default
Arbyhisenaj Feb 27, 2026
99056ce
Update src/app/map/[id]/components/inspector/InspectorSettingsModal/S…
joaquimds Feb 27, 2026
5a02ba4
Update src/app/map/[id]/components/inspector/InspectorSettingsModal/C…
joaquimds Feb 27, 2026
9674f4e
Update src/app/map/[id]/components/inspector/InspectorSettingsModal/C…
joaquimds Feb 27, 2026
50337d7
Merge branch 'main' into mff-updates
joaquimds Feb 27, 2026
bc61ac2
optimising UX
Arbyhisenaj Feb 27, 2026
8bfb914
Merge branch 'mff-updates' of https://github.com/commonknowledge/ts-m…
Arbyhisenaj Feb 27, 2026
d5514c4
merge/lint fixes
Arbyhisenaj Feb 27, 2026
01faacc
Merge branch 'sidebar-updated-ui' into mff-updates
Arbyhisenaj Feb 27, 2026
b629070
updated sidebar
Arbyhisenaj Feb 27, 2026
1d041b6
chore: fix lint
joaquimds Mar 2, 2026
a283744
work laptop checkpoint
Arbyhisenaj Mar 4, 2026
ffa1dce
dang - forgot to push
Arbyhisenaj Mar 10, 2026
7755f56
optimisation
Arbyhisenaj Mar 10, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion migrations/1770299199726_area_geom.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,10 @@ import { type Kysely, sql } from "kysely";
*/

export async function up(db: Kysely<any>): Promise<void> {
// Use Geometry (not MultiPolygon) so rows with Point geography don't fail
await sql`
ALTER TABLE area
ADD COLUMN geom geometry(MultiPolygon, 4326) NOT NULL
ADD COLUMN geom geometry(Geometry, 4326) NOT NULL
GENERATED ALWAYS AS (geography::geometry) STORED
`.execute(db);

Expand Down
17 changes: 17 additions & 0 deletions migrations/1772020000000_data_source_default_inspector_config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
/* eslint-disable @typescript-eslint/no-explicit-any */
import { sql } from "kysely";
import type { Kysely } from "kysely";

export async function up(db: Kysely<any>): Promise<void> {
await sql`
ALTER TABLE "data_source"
ADD COLUMN "default_inspector_config" jsonb DEFAULT NULL
`.execute(db);
}

export async function down(db: Kysely<any>): Promise<void> {
await sql`
ALTER TABLE "data_source"
DROP COLUMN "default_inspector_config"
`.execute(db);
Comment on lines +2 to +16
Copy link

Copilot AI Feb 27, 2026

Choose a reason for hiding this comment

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

Migration style inconsistency: Migration 1772020000000 uses raw SQL with snake_case table name, while migration 1772030000000 uses Kysely schema builder with camelCase. For consistency and to match the pattern in migration 1770912056401_data_source_record_count.ts (which adds columns using schema builder then updates with raw SQL), consider using Kysely's schema builder for both or keeping the same style. This is a minor inconsistency but could confuse future developers.

Suggested change
import { sql } from "kysely";
import type { Kysely } from "kysely";
export async function up(db: Kysely<any>): Promise<void> {
await sql`
ALTER TABLE "data_source"
ADD COLUMN "default_inspector_config" jsonb DEFAULT NULL
`.execute(db);
}
export async function down(db: Kysely<any>): Promise<void> {
await sql`
ALTER TABLE "data_source"
DROP COLUMN "default_inspector_config"
`.execute(db);
import type { Kysely } from "kysely";
export async function up(db: Kysely<any>): Promise<void> {
await db.schema
.alterTable("dataSource")
.addColumn("defaultInspectorConfig", "jsonb", (col) => col.defaultTo(null))
.execute();
}
export async function down(db: Kysely<any>): Promise<void> {
await db.schema
.alterTable("dataSource")
.dropColumn("defaultInspectorConfig")
.execute();

Copilot uses AI. Check for mistakes.
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
/* eslint-disable @typescript-eslint/no-explicit-any */
import type { Kysely } from "kysely";

export async function up(db: Kysely<any>): Promise<void> {
await db.schema
.alterTable("dataSource")
.addColumn("defaultInspectorConfigUpdatedAt", "timestamptz", (col) =>
col.defaultTo(null),
)
.execute();
}

export async function down(db: Kysely<any>): Promise<void> {
await db.schema
.alterTable("dataSource")
.dropColumn("defaultInspectorConfigUpdatedAt")
.execute();
}
17 changes: 17 additions & 0 deletions migrations/1772203924531_data_source_default_inspector_config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
/* eslint-disable @typescript-eslint/no-explicit-any */
import { sql } from "kysely";
import type { Kysely } from "kysely";

export async function up(db: Kysely<any>): Promise<void> {
await sql`
ALTER TABLE "data_source"
ADD COLUMN "default_inspector_config" jsonb DEFAULT NULL
`.execute(db);
}

export async function down(db: Kysely<any>): Promise<void> {
await sql`
ALTER TABLE "data_source"
DROP COLUMN "default_inspector_config"
`.execute(db);
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
/* eslint-disable @typescript-eslint/no-explicit-any */
import type { Kysely } from "kysely";

export async function up(db: Kysely<any>): Promise<void> {
await db.schema
.alterTable("dataSource")
.addColumn("defaultInspectorConfigUpdatedAt", "timestamptz", (col) =>
col.defaultTo(null),
)
.execute();
}

export async function down(db: Kysely<any>): Promise<void> {
await db.schema
.alterTable("dataSource")
.dropColumn("defaultInspectorConfigUpdatedAt")
.execute();
}
83 changes: 50 additions & 33 deletions src/app/(private)/data-sources/[id]/DataSourceDashboard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,17 @@ import {
} from "@/shadcn/ui/breadcrumb";
import { Button } from "@/shadcn/ui/button";
import { Separator } from "@/shadcn/ui/separator";
import ColumnMetadataForm from "./components/ColumnMetadataForm";
import { Tabs, TabsContent, TabsList, TabsTrigger } from "@/shadcn/ui/tabs";
import ConfigurationForm from "./components/ConfigurationForm";
import { DefaultInspectorConfigSection } from "./components/DefaultInspectorConfigSection";
import type { RouterOutputs } from "@/services/trpc/react";

export function DataSourceDashboard({
dataSource,
}: {
dataSource: NonNullable<RouterOutputs["dataSource"]["byId"]>;
}) {
const [dataSourceTab, setDataSourceTab] = useState("datasource");
const [importing, setImporting] = useState(isImporting(dataSource));
const [importError, setImportError] = useState("");
const [lastImported, setLastImported] = useState(
Expand Down Expand Up @@ -222,39 +224,54 @@ export function DataSourceDashboard({
</Alert>
)}

<div className="grid grid-cols-2 gap-20 pb-10">
<div className="flex flex-col gap-6">
<h2 className="font-medium text-xl">About this data source</h2>
<DefinitionList
items={
lastImported
? [
...mappedInformation,
{
label: "Last imported",
value: `${lastImportedDateReadable} (${lastImportedFormattedFromNow})`,
},
]
: mappedInformation
}
/>
<ColumnMetadataForm dataSource={dataSource} />
</div>

<div className="flex flex-col gap-6">
<h2 className="font-medium text-xl">Configuration</h2>
<ConfigurationForm
dataSource={dataSource}
onAutoImportChange={setAutoImportEnabled}
webhookStatus={webhookStatus}
/>
<Separator />
<h2 className="font-medium text-xl">Danger zone</h2>
<div>
<DeleteDataSourceButton dataSource={dataSource} />
<Tabs
value={dataSourceTab}
onValueChange={setDataSourceTab}
className="w-full"
>
<TabsList>
<TabsTrigger value="datasource">
Datasource import settings
</TabsTrigger>
<TabsTrigger value="inspector">Inspector settings</TabsTrigger>
</TabsList>
<TabsContent value="datasource" className="mt-6">
<div className="grid grid-cols-2 gap-20 pb-10">
<div className="flex flex-col gap-6">
<h2 className="font-medium text-xl">Configuration</h2>
<ConfigurationForm
dataSource={dataSource}
onAutoImportChange={setAutoImportEnabled}
webhookStatus={webhookStatus}
/>
<Separator />
<h2 className="font-medium text-xl">Danger zone</h2>
<div>
<DeleteDataSourceButton dataSource={dataSource} />
</div>
</div>
<div className="flex flex-col gap-6">
<h2 className="font-medium text-xl">About this data source</h2>
<DefinitionList
items={
lastImported
? [
...mappedInformation,
{
label: "Last imported",
value: `${lastImportedDateReadable} (${lastImportedFormattedFromNow})`,
},
]
: mappedInformation
}
/>
</div>
</div>
</div>
</div>
</TabsContent>
<TabsContent value="inspector" className="mt-6 w-full pb-10">
<DefaultInspectorConfigSection dataSource={dataSource} />
</TabsContent>
</Tabs>
</div>
);
}
Expand Down
Loading