diff --git a/packages/react-components/src/components/trace-context-component.tsx b/packages/react-components/src/components/trace-context-component.tsx index 718bd657..a4eff110 100644 --- a/packages/react-components/src/components/trace-context-component.tsx +++ b/packages/react-components/src/components/trace-context-component.tsx @@ -7,7 +7,7 @@ import '../../style/status-bar.css'; import { Layout, Responsive, WidthProvider } from 'react-grid-layout'; import { TimelineChart } from 'timeline-chart/lib/time-graph-model'; import { TimeGraphUnitController } from 'timeline-chart/lib/time-graph-unit-controller'; -import { OutputDescriptor } from 'tsp-typescript-client/lib/models/output-descriptor'; +import { OutputDescriptor, ProviderType } from 'tsp-typescript-client/lib/models/output-descriptor'; import { Experiment } from 'tsp-typescript-client/lib/models/experiment'; import { ITspClient } from 'tsp-typescript-client/lib/protocol/tsp-client'; import { TimeRange, TimeRangeString } from 'traceviewer-base/lib/utils/time-range'; @@ -735,7 +735,7 @@ export class TraceContextComponent extends React.Component ); - case 'TIME_GRAPH': + case ProviderType.TIME_GRAPH: if (this.chartPersistedState && this.chartPersistedState.output.id === output.id) { outputProps.persistChartState = this.chartPersistedState.payload; this.chartPersistedState = undefined; @@ -749,7 +749,7 @@ export class TraceContextComponent extends React.Component ); - case 'TREE_TIME_XY': + case ProviderType.TREE_TIME_XY: if (this.chartPersistedState && this.chartPersistedState.output.id === output.id) { outputProps.persistChartState = this.chartPersistedState.payload; this.chartPersistedState = undefined; @@ -761,7 +761,7 @@ export class TraceContextComponent extends React.Component ); - case 'TABLE': + case ProviderType.TABLE: return ( ); - case 'DATA_TREE': + case ProviderType.DATA_TREE: return ( ; export type TspClientProxy = ITspClient; @@ -364,6 +364,73 @@ export class TheiaRpcTspProxy implements ITspClient { ); } + /** + * Fetch all configuration source types for a given experiment and output + * @param expUUID Experiment UUID + * @param outputID Output ID + * @returns Generic response with the model + */ + public async fetchOutputConfigurationTypes( + expUUID: string, + outputID: string + ): Promise> { + return this.toTspClientResponse( + await this.tspClient.fetchOutputConfigurationTypes(expUUID, outputID) + ); + } + + /** + * Fetch configuration source type for a given type ID, experiment and output + * @param expUUID Experiment UUID + * @param outputID Output ID + * @param typeID the ID of the configuration source type + * @returns Generic response with the model + */ + public async fetchOutputConfigurationType( + expUUID: string, + outputID: string, + typeID: string + ): Promise> { + return this.toTspClientResponse( + await this.tspClient.fetchOutputConfigurationType(expUUID, outputID, typeID) + ); + } + + /** + * Create a derived output for a given experiment, output and parameters + * @param expUUID Experiment UUID + * @param outputID Output ID + * @param parameters OutputConfigurationQuery object + * @returns the output descriptor of the derived output + */ + public async createDerivedOutput( + expUUID: string, + outputID: string, + parameters: OutputConfigurationQuery + ): Promise> { + return this.toTspClientResponse( + await this.tspClient.createDerivedOutput(expUUID, outputID, parameters) + ); + } + + /** + * Delete a derived output (and it's configuration) for a given experiment, + * output and derived output + * @param expUUID Experiment UUID + * @param outputID Output ID + * @param derivedOutputID the ID of the derived output + * @returns the output descriptor of the deleted derived output + */ + public async deleteDerivedOutput( + expUUID: string, + outputID: string, + derivedOutputID: string + ): Promise> { + return this.toTspClientResponse( + await this.tspClient.deleteDerivedOutput(expUUID, outputID, derivedOutputID) + ); + } + /** * Check the health status of the server * @returns The Health Status @@ -423,10 +490,13 @@ export class TheiaRpcTspProxy implements ITspClient { /** * Create a configuration for a given type ID and parameters * @param typeId the ID of the configuration source type - * @param parameters Query object + * @param parameters ConfigurationQuery object * @returns Generic response with the model */ - public async createConfiguration(typeId: string, parameters: Query): Promise> { + public async createConfiguration( + typeId: string, + parameters: ConfigurationQuery + ): Promise> { return this.toTspClientResponse(await this.tspClient.createConfiguration(typeId, parameters)); } @@ -434,13 +504,13 @@ export class TheiaRpcTspProxy implements ITspClient { * Update a configuration for a given type ID, config ID and parameters * @param typeId the ID of the configuration source type * @param configId the ID of the configuration - * @param parameters Query object + * @param parameters ConfigurationQuery object * @returns Generic response with the model */ public async updateConfiguration( typeId: string, configId: string, - parameters: Query + parameters: ConfigurationQuery ): Promise> { return this.toTspClientResponse( await this.tspClient.updateConfiguration(typeId, configId, parameters)