Skip to content

Commit fe14aaf

Browse files
committed
Update ConfType to use plural naming
1 parent 32429e3 commit fe14aaf

File tree

4 files changed

+16
-16
lines changed

4 files changed

+16
-16
lines changed

frontend/src/lib/api/api.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -57,19 +57,19 @@ export class Api {
5757
}
5858

5959
async getJoin(name: string) {
60-
return this.getConf(name, ConfType.JOIN).then((d) => d.join) as Promise<IJoinArgs>;
60+
return this.getConf(name, ConfType.JOINS).then((d) => d.join) as Promise<IJoinArgs>;
6161
}
6262

6363
async getGroupBy(name: string) {
64-
return this.getConf(name, ConfType.GROUP_BY).then((d) => d.groupBy) as Promise<IGroupByArgs>;
64+
return this.getConf(name, ConfType.GROUP_BYS).then((d) => d.groupBy) as Promise<IGroupByArgs>;
6565
}
6666

6767
async getModel(name: string) {
68-
return this.getConf(name, ConfType.MODEL).then((d) => d.model) as Promise<IModelArgs>;
68+
return this.getConf(name, ConfType.MODELS).then((d) => d.model) as Promise<IModelArgs>;
6969
}
7070

7171
async getStagingQuery(name: string) {
72-
return this.getConf(name, ConfType.STAGING_QUERY).then(
72+
return this.getConf(name, ConfType.STAGING_QUERIES).then(
7373
(d) => d.stagingQuery
7474
) as Promise<IStagingQueryArgs>;
7575
}

frontend/src/lib/types/Entity.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ export const EntityType = {
3434
export const entityConfig = {
3535
[EntityType.MODEL]: {
3636
label: 'Models',
37-
confType: ConfType.MODEL,
37+
confType: ConfType.MODELS,
3838
logicalType: LogicalType.MODEL,
3939
path: '/models',
4040
icon: IconCube,
@@ -43,7 +43,7 @@ export const entityConfig = {
4343
},
4444
[EntityType.JOIN]: {
4545
label: 'Joins',
46-
confType: ConfType.JOIN,
46+
confType: ConfType.JOINS,
4747
logicalType: LogicalType.JOIN,
4848
path: '/joins',
4949
icon: IconSquare3Stack3d,
@@ -52,7 +52,7 @@ export const entityConfig = {
5252
},
5353
[EntityType.GROUP_BY]: {
5454
label: 'GroupBys',
55-
confType: ConfType.GROUP_BY,
55+
confType: ConfType.GROUP_BYS,
5656
logicalType: LogicalType.GROUP_BY,
5757
path: '/groupbys',
5858
icon: IconRectangleStack,
@@ -61,7 +61,7 @@ export const entityConfig = {
6161
},
6262
[EntityType.STAGING_QUERY]: {
6363
label: 'Staging Queries',
64-
confType: ConfType.STAGING_QUERY,
64+
confType: ConfType.STAGING_QUERIES,
6565
logicalType: LogicalType.STAGING_QUERY,
6666
path: '/stagingqueries',
6767
icon: IconCubeTransparent,

frontend/src/routes/[conf]/+page.server.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@ import { ConfType, type IConfListResponseArgs } from '$lib/types/codegen';
55
import { getEntityConfigFromPath } from '$src/lib/types/Entity';
66

77
const ConfResponseMap: Record<ConfType, keyof IConfListResponseArgs> = {
8-
[ConfType.MODEL]: 'models',
9-
[ConfType.STAGING_QUERY]: 'stagingQueries',
10-
[ConfType.GROUP_BY]: 'groupBys',
11-
[ConfType.JOIN]: 'joins'
8+
[ConfType.MODELS]: 'models',
9+
[ConfType.STAGING_QUERIES]: 'stagingQueries',
10+
[ConfType.GROUP_BYS]: 'groupBys',
11+
[ConfType.JOINS]: 'joins'
1212
};
1313

1414
export async function load({ fetch, url }) {

frontend/src/routes/[conf]/[name]/+layout.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,22 +6,22 @@ import { error } from '@sveltejs/kit';
66

77
function getConfApi(api: Api, confType: ConfType, confName: string) {
88
switch (confType) {
9-
case ConfType.JOIN:
9+
case ConfType.JOINS:
1010
return {
1111
conf: api.getJoin(confName),
1212
lineage: api.getJoinLineage({ name: confName })
1313
};
14-
case ConfType.GROUP_BY:
14+
case ConfType.GROUP_BYS:
1515
return {
1616
conf: api.getGroupBy(confName),
1717
lineage: api.getGroupByLineage({ name: confName })
1818
};
19-
case ConfType.MODEL:
19+
case ConfType.MODELS:
2020
return {
2121
conf: api.getModel(confName),
2222
lineage: api.getModelLineage({ name: confName })
2323
};
24-
case ConfType.STAGING_QUERY:
24+
case ConfType.STAGING_QUERIES:
2525
return {
2626
conf: api.getStagingQuery(confName),
2727
lineage: api.getStagingQueryLineage({ name: confName })

0 commit comments

Comments
 (0)