-
Notifications
You must be signed in to change notification settings - Fork 228
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor interface definitions and formatting for improved consistenc…
…y and readability
- Loading branch information
Showing
32 changed files
with
272 additions
and
262 deletions.
There are no files selected for viewing
31 changes: 15 additions & 16 deletions
31
Common/Types/Dashboard/DashboardComponents/ComponentArgument.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,22 @@ | ||
import DashboardBaseComponent from "./DashboardBaseComponent"; | ||
|
||
export enum ComponentInputType { | ||
Text = "Text", | ||
Date = "Date", | ||
DateTime = "Date Time", | ||
Boolean = "True or False", | ||
Number = "Number", | ||
Decimal = "Decimal", | ||
MetricsEditor = "MetricsEditor", | ||
LongText = "Long Text", | ||
Text = "Text", | ||
Date = "Date", | ||
DateTime = "Date Time", | ||
Boolean = "True or False", | ||
Number = "Number", | ||
Decimal = "Decimal", | ||
MetricsEditor = "MetricsEditor", | ||
LongText = "Long Text", | ||
} | ||
|
||
|
||
export interface ComponentArgument<T extends DashboardBaseComponent> { | ||
name: string; | ||
description: string; | ||
required: boolean; | ||
type: ComponentInputType; | ||
id: keyof T["arguments"]; | ||
isAdvanced?: boolean | undefined; | ||
placeholder?: string | undefined; | ||
name: string; | ||
description: string; | ||
required: boolean; | ||
type: ComponentInputType; | ||
id: keyof T["arguments"]; | ||
isAdvanced?: boolean | undefined; | ||
placeholder?: string | undefined; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,7 @@ | ||
enum DashboardComponentType { | ||
Chart = 'Chart', | ||
Value = 'Value', | ||
Text = 'Text', | ||
Chart = "Chart", | ||
Value = "Value", | ||
Text = "Text", | ||
} | ||
|
||
|
||
export default DashboardComponentType; | ||
export default DashboardComponentType; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
export default interface MetricAliasData { | ||
metricVariable: string; | ||
title: string; | ||
description: string; | ||
} | ||
metricVariable: string; | ||
title: string; | ||
description: string; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
export default interface MetricFormulaData { | ||
metricFormula: string; | ||
} | ||
metricFormula: string; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
import MetricFormulaConfigData from "./MetricFormulaConfigData"; | ||
import MetricQueryConfigData from "./MetricQueryConfigData"; | ||
|
||
export default interface MetricsViewConfig { | ||
queryConfigs: Array<MetricQueryConfigData>; | ||
formulaConfigs: Array<MetricFormulaConfigData>; | ||
} | ||
export default interface MetricsViewConfig { | ||
queryConfigs: Array<MetricQueryConfigData>; | ||
formulaConfigs: Array<MetricFormulaConfigData>; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 16 additions & 7 deletions
23
Common/Utils/Dashboard/Components/DashboardValueComponent.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,35 +1,44 @@ | ||
import { ComponentArgument, ComponentInputType } from "../../../Types/Dashboard/DashboardComponents/ComponentArgument"; | ||
import { | ||
ComponentArgument, | ||
ComponentInputType, | ||
} from "../../../Types/Dashboard/DashboardComponents/ComponentArgument"; | ||
import DashboardValueComponent from "../../../Types/Dashboard/DashboardComponents/DashboardValueComponent"; | ||
import DashboardComponentType from "../../../Types/Dashboard/DashboardComponentType"; | ||
import { ObjectType } from "../../../Types/JSON"; | ||
import ObjectID from "../../../Types/ObjectID"; | ||
import DashboardBaseComponentUtil from "./DashboardBaseComponent"; | ||
|
||
export default class DashboardValueComponentUtil extends DashboardBaseComponentUtil { | ||
public static override getDefaultComponent(): DashboardValueComponent { | ||
return { | ||
_type: ObjectType.DashboardValueComponent, | ||
_type: ObjectType.DashboardComponent, | ||
componentType: DashboardComponentType.Value, | ||
widthInDashboardUnits: 3, | ||
heightInDashboardUnits: 1, | ||
topInDashboardUnits: 0, | ||
leftInDashboardUnits: 0, | ||
componentId: ObjectID.generate(), | ||
minHeightInDashboardUnits: 1, | ||
minWidthInDashboardUnits: 1, | ||
arguments: {} | ||
arguments: {}, | ||
}; | ||
} | ||
|
||
public static override getComponentConfigArguments(): Array<ComponentArgument<DashboardValueComponent>> { | ||
const componentArguments: Array<ComponentArgument<DashboardValueComponent>> = []; | ||
public static override getComponentConfigArguments(): Array< | ||
ComponentArgument<DashboardValueComponent> | ||
> { | ||
const componentArguments: Array< | ||
ComponentArgument<DashboardValueComponent> | ||
> = []; | ||
|
||
componentArguments.push({ | ||
name: "Metrics", | ||
description: "Please select the metrics to display on the chart", | ||
required: true, | ||
type: ComponentInputType.MetricsEditor, | ||
id: "metricsViewConfig" | ||
id: "metricsViewConfig", | ||
}); | ||
|
||
return componentArguments; | ||
} | ||
} | ||
} |
Oops, something went wrong.