Skip to content

Commit d53fcef

Browse files
committed
fix: [FIXUP]
1 parent 14e78d9 commit d53fcef

File tree

2 files changed

+30
-1
lines changed

2 files changed

+30
-1
lines changed

src/components/TechnicalInfoContent/TechnicalInfoContent.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ export const TechnicalInfoContent = () => {
2121
id: 'webappVersion',
2222
label: t('genericcomponent.dialog.technicalInfo.webAppVersion', 'Webapp version:'),
2323
content: ConfigService.getParameterValue('APP_VERSION'),
24-
subcontent: ConfigService.getParameterValue('BUILD_NUMBER'),
24+
subcontent: ConfigService.getParameterValue('BUILD_NUMBER')?.substring(0, 7),
2525
},
2626
{
2727
id: 'apiVersion',

src/hooks/DatasetRunnerHooks.js

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
// Copyright (c) Cosmo Tech.
2+
// Licensed under the MIT license.
3+
import { useCallback } from 'react';
4+
import { RUNNER_RUN_STATE } from '../services/config/ApiConstants.js';
5+
import RunnerRunService from '../services/runnerRun/RunnerRunService';
6+
import { useRunner } from '../state/runner/hooks';
7+
import { DatasetsUtils, RunnersUtils } from '../utils';
8+
9+
// Retrieve the status of the last run of the runner linked to the provided dataset
10+
export const useGetDatasetRunnerStatus = (dataset) => {
11+
const warnAndReturnUnknownStatus = (message) => {
12+
console.warn(message);
13+
return RUNNER_RUN_STATE.UNKNOWN;
14+
}
15+
16+
const runnerId = DatasetsUtils.getDatasetOption(dataset, 'runnerId');
17+
if(!runnerId) return warnAndReturnUnknownStatus(`No option "runnedId" defined for dataset "${dataset.id}"`);
18+
19+
const runner = useRunner(runnerId);
20+
if(!runner) return warnAndReturnUnknownStatus(`No runner found with id "${runnerId}"`);
21+
22+
const lastRunId = RunnersUtils.getLastRunId(runner);
23+
if(!lastRunId) return warnAndReturnUnknownStatus(`Last run id not found in runner "${runnerId}"`);
24+
25+
return useCallback(
26+
() => RunnerRunService.downloadLogsFile(organizationId, workspaceId, runnerId, runId),
27+
[organizationId, workspaceId, runnerId, runId]
28+
);
29+
};

0 commit comments

Comments
 (0)