Skip to content

Commit e97ebfb

Browse files
committed
Fix lint
1 parent 66da784 commit e97ebfb

4 files changed

Lines changed: 13145 additions & 12841 deletions

File tree

datajunction-ui/src/app/services/DJGraphQLService.ts

Lines changed: 43 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ export interface CubeForPlannerResult {
6969
// Generic GraphQL fetch helper
7070
async function gqlFetch<T>(
7171
query: string,
72-
variables?: Record<string, unknown>
72+
variables?: Record<string, unknown>,
7373
): Promise<GraphQLResponse<T>> {
7474
const response = await fetch(DJ_GQL, {
7575
method: 'POST',
@@ -343,7 +343,7 @@ export const DJGraphQLService = {
343343
limit: number | null,
344344
sortConfig: SortConfig,
345345
mode: NodeMode | null,
346-
filters: ListNodesFilters = {}
346+
filters: ListNodesFilters = {},
347347
): Promise<GraphQLResponse<ListNodesForLandingQuery>> => {
348348
const {
349349
ownedBy = null,
@@ -375,9 +375,13 @@ export const DJGraphQLService = {
375375
/**
376376
* List cubes for preset dropdown (lightweight)
377377
*/
378-
listCubesForPreset: async (): Promise<Array<{ name: string; display_name: string | null }>> => {
378+
listCubesForPreset: async (): Promise<
379+
Array<{ name: string; display_name: string | null }>
380+
> => {
379381
try {
380-
const result = await gqlFetch<ListCubesForPresetQuery>(LIST_CUBES_FOR_PRESET);
382+
const result = await gqlFetch<ListCubesForPresetQuery>(
383+
LIST_CUBES_FOR_PRESET,
384+
);
381385
const nodes = result.data?.findNodes || [];
382386
return nodes.map(node => ({
383387
name: node.name,
@@ -392,9 +396,14 @@ export const DJGraphQLService = {
392396
/**
393397
* Get cube details for query planner (optimized query)
394398
*/
395-
cubeForPlanner: async (name: string): Promise<CubeForPlannerResult | null> => {
399+
cubeForPlanner: async (
400+
name: string,
401+
): Promise<CubeForPlannerResult | null> => {
396402
try {
397-
const result = await gqlFetch<GetCubeForPlannerQuery>(GET_CUBE_FOR_PLANNER, { name });
403+
const result = await gqlFetch<GetCubeForPlannerQuery>(
404+
GET_CUBE_FOR_PLANNER,
405+
{ name },
406+
);
398407
const node = result.data?.findNodes?.[0];
399408
if (!node) {
400409
return null;
@@ -406,7 +415,7 @@ export const DJGraphQLService = {
406415

407416
// Extract druid_cube materialization if present
408417
const druidMat = (current?.materializations || []).find(
409-
m => m.name === 'druid_cube' || m.name === 'druid_cube_v3'
418+
m => m.name === 'druid_cube' || m.name === 'druid_cube_v3',
410419
);
411420

412421
const cubeMaterialization = druidMat
@@ -439,9 +448,12 @@ export const DJGraphQLService = {
439448
* Get node details for editing
440449
*/
441450
getNodeForEditing: async (
442-
name: string
451+
name: string,
443452
): Promise<GetNodeForEditingQuery['findNodes'][0] | null> => {
444-
const result = await gqlFetch<GetNodeForEditingQuery>(GET_NODE_FOR_EDITING, { name });
453+
const result = await gqlFetch<GetNodeForEditingQuery>(
454+
GET_NODE_FOR_EDITING,
455+
{ name },
456+
);
445457
if (!result.data?.findNodes?.length) {
446458
return null;
447459
}
@@ -452,20 +464,22 @@ export const DJGraphQLService = {
452464
* Get multiple nodes by names (batch fetch)
453465
*/
454466
getNodesByNames: async (
455-
names: string[]
467+
names: string[],
456468
): Promise<GetNodesByNamesQuery['findNodes']> => {
457469
if (!names || names.length === 0) {
458470
return [];
459471
}
460-
const result = await gqlFetch<GetNodesByNamesQuery>(GET_NODES_BY_NAMES, { names });
472+
const result = await gqlFetch<GetNodesByNamesQuery>(GET_NODES_BY_NAMES, {
473+
names,
474+
});
461475
return result.data?.findNodes || [];
462476
},
463477

464478
/**
465479
* Get metric details
466480
*/
467481
getMetric: async (
468-
name: string
482+
name: string,
469483
): Promise<GetMetricQuery['findNodes'][0] | null> => {
470484
const result = await gqlFetch<GetMetricQuery>(GET_METRIC, { name });
471485
return result.data?.findNodes?.[0] || null;
@@ -475,9 +489,12 @@ export const DJGraphQLService = {
475489
* Get cube details for editing
476490
*/
477491
getCubeForEditing: async (
478-
name: string
492+
name: string,
479493
): Promise<GetCubeForEditingQuery['findNodes'][0] | null> => {
480-
const result = await gqlFetch<GetCubeForEditingQuery>(GET_CUBE_FOR_EDITING, { name });
494+
const result = await gqlFetch<GetCubeForEditingQuery>(
495+
GET_CUBE_FOR_EDITING,
496+
{ name },
497+
);
481498
if (!result.data?.findNodes?.length) {
482499
return null;
483500
}
@@ -488,37 +505,42 @@ export const DJGraphQLService = {
488505
* Get upstream nodes
489506
*/
490507
upstreamNodes: async (
491-
nodeNames: string | string[]
508+
nodeNames: string | string[],
492509
): Promise<GetUpstreamNodesQuery['upstreamNodes']> => {
493510
const names = Array.isArray(nodeNames) ? nodeNames : [nodeNames];
494-
const result = await gqlFetch<GetUpstreamNodesQuery>(GET_UPSTREAM_NODES, { nodeNames: names });
511+
const result = await gqlFetch<GetUpstreamNodesQuery>(GET_UPSTREAM_NODES, {
512+
nodeNames: names,
513+
});
495514
return result.data?.upstreamNodes || [];
496515
},
497516

498517
/**
499518
* Get downstream nodes
500519
*/
501520
downstreamNodes: async (
502-
nodeNames: string | string[]
521+
nodeNames: string | string[],
503522
): Promise<GetDownstreamNodesQuery['downstreamNodes']> => {
504523
const names = Array.isArray(nodeNames) ? nodeNames : [nodeNames];
505-
const result = await gqlFetch<GetDownstreamNodesQuery>(GET_DOWNSTREAM_NODES, { nodeNames: names });
524+
const result = await gqlFetch<GetDownstreamNodesQuery>(
525+
GET_DOWNSTREAM_NODES,
526+
{ nodeNames: names },
527+
);
506528
return result.data?.downstreamNodes || [];
507529
},
508530

509531
/**
510532
* Get node columns with partition info
511533
*/
512534
getNodeColumnsWithPartitions: async (
513-
nodeName: string
535+
nodeName: string,
514536
): Promise<{
515537
columns: GetNodeColumnsWithPartitionsQuery['findNodes'][0]['current']['columns'];
516538
temporalPartitions: GetNodeColumnsWithPartitionsQuery['findNodes'][0]['current']['columns'];
517539
}> => {
518540
try {
519541
const result = await gqlFetch<GetNodeColumnsWithPartitionsQuery>(
520542
GET_NODE_COLUMNS_WITH_PARTITIONS,
521-
{ name: nodeName }
543+
{ name: nodeName },
522544
);
523545

524546
const node = result.data?.findNodes?.[0];
@@ -528,7 +550,7 @@ export const DJGraphQLService = {
528550

529551
const columns = node.current?.columns || [];
530552
const temporalPartitions = columns.filter(
531-
col => col.partition?.type_ === 'TEMPORAL'
553+
col => col.partition?.type_ === 'TEMPORAL',
532554
);
533555

534556
return { columns, temporalPartitions };

datajunction-ui/src/app/services/DJService.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
// Note: MarkerType.Arrow is just the string "arrow" - we use the literal
22
// to avoid importing reactflow in this service (which would bloat the main bundle)
3-
const MARKER_TYPE_ARROW = 'arrow';
4-
53
// Import the typed GraphQL service - all GraphQL methods delegate to this
64
import { DJGraphQLService } from './DJGraphQLService';
75

6+
const MARKER_TYPE_ARROW = 'arrow';
7+
88
const DJ_URL = process.env.REACT_APP_DJ_URL
99
? process.env.REACT_APP_DJ_URL
1010
: 'http://localhost:8000';

0 commit comments

Comments
 (0)