1
0
mirror of https://github.com/oceanprotocol/market.git synced 2024-12-02 05:57:29 +01:00

fixed issues after merge of main branch

This commit is contained in:
Bogdan Fazakas 2021-06-29 09:20:35 +03:00
parent b0356f559c
commit 127d31d729
4 changed files with 14 additions and 3 deletions

View File

@ -387,7 +387,10 @@ export default function Compute({
text="This algorithm has been set to private by the publisher and can't be downloaded. You can run it against any allowed data sets though!" text="This algorithm has been set to private by the publisher and can't be downloaded. You can run it against any allowed data sets though!"
state="info" state="info"
/> />
<AlgorithmDatasetsListForCompute algorithmDid={ddo.id} /> <AlgorithmDatasetsListForCompute
algorithmDid={ddo.id}
dataset={ddo}
/>
</> </>
) : ( ) : (
<Formik <Formik

View File

@ -176,7 +176,7 @@ export default function Consume({
</div> </div>
</div> </div>
{type === 'algorithm' && ( {type === 'algorithm' && (
<AlgorithmDatasetsListForCompute algorithmDid={ddo.id} /> <AlgorithmDatasetsListForCompute algorithmDid={ddo.id} dataset={ddo} />
)} )}
<footer className={styles.feedback}> <footer className={styles.feedback}>
<Web3Feedback isBalanceSufficient={isBalanceSufficient} /> <Web3Feedback isBalanceSufficient={isBalanceSufficient} />

View File

@ -5,11 +5,14 @@ import { AssetSelectionAsset } from '../../molecules/FormFields/AssetSelection'
import AssetComputeList from '../../molecules/AssetComputeList' import AssetComputeList from '../../molecules/AssetComputeList'
import { useOcean } from '../../../providers/Ocean' import { useOcean } from '../../../providers/Ocean'
import { useAsset } from '../../../providers/Asset' import { useAsset } from '../../../providers/Asset'
import { DDO } from '@oceanprotocol/lib'
export default function AlgorithmDatasetsListForCompute({ export default function AlgorithmDatasetsListForCompute({
algorithmDid algorithmDid,
dataset
}: { }: {
algorithmDid: string algorithmDid: string
dataset: DDO
}): ReactElement { }): ReactElement {
const { config } = useOcean() const { config } = useOcean()
const { type } = useAsset() const { type } = useAsset()
@ -18,8 +21,11 @@ export default function AlgorithmDatasetsListForCompute({
useEffect(() => { useEffect(() => {
async function getDatasetsAllowedForCompute() { async function getDatasetsAllowedForCompute() {
const datasetComputeService = dataset.findServiceByType('compute')
datasetComputeService
const datasets = await getAlgorithmDatasetsForCompute( const datasets = await getAlgorithmDatasetsForCompute(
algorithmDid, algorithmDid,
datasetComputeService?.serviceEndpoint,
config.metadataCacheUri config.metadataCacheUri
) )
setDatasetsForCompute(datasets) setDatasetsForCompute(datasets)

View File

@ -171,6 +171,7 @@ export async function transformDDOToAssetSelection(
export async function getAlgorithmDatasetsForCompute( export async function getAlgorithmDatasetsForCompute(
algorithmId: string, algorithmId: string,
datasetProviderUri: string,
metadataCacheUri: string metadataCacheUri: string
): Promise<AssetSelectionAsset[]> { ): Promise<AssetSelectionAsset[]> {
const source = axios.CancelToken.source() const source = axios.CancelToken.source()
@ -192,6 +193,7 @@ export async function getAlgorithmDatasetsForCompute(
return [] return []
} }
const datasets = await transformDDOToAssetSelection( const datasets = await transformDDOToAssetSelection(
datasetProviderUri,
computeDatasetsForCurrentAlgorithm, computeDatasetsForCurrentAlgorithm,
metadataCacheUri, metadataCacheUri,
[] []