market/src/components/Asset/AssetActions/Compute/index.tsx

592 lines
20 KiB
TypeScript
Raw Normal View History

import React, { useState, ReactElement, useEffect, useCallback } from 'react'
import {
Asset,
DDO,
FileInfo,
2022-02-03 14:43:27 +01:00
Datatoken,
ProviderInstance,
2022-02-08 10:30:16 +01:00
ComputeAsset,
ZERO_ADDRESS,
2022-04-28 09:11:19 +02:00
ComputeEnvironment,
2022-04-28 13:43:02 +02:00
LoggerInstance,
ComputeAlgorithm,
2022-05-12 13:39:14 +02:00
ComputeOutput,
ProviderComputeInitializeResults,
Release candidate 09-01-2023 (#1843) * Avoiding getInitialPaymentCollector failure (#1816) * early return is no web3 or ddo * Creating test for MetaFull * adding test: src/components/Asset/AssetContent/MetaSecondary.test.tsx * Adding test for bookmarks * Adding test for displaying payment collector * Removing comments * Renaming assetAquarius * Renaming assetWithAccessDetails * Ensuring that the payment collector is shown even without a wallet connected * Removing broken test * Using getDummyWeb3 for fetching the payment collector address * google validation (#1835) * Updating validation to exclude any google link * Updating Yup validation * Checking if domain includes google.com * Updating isGoogleUrl function * Moving isGoogleUrl into @utils/url/index file * isGoogleUrl function * Updating tests * Adding additional tests for other google domains * Updating tests * Updating isGoogleUrl file path * Updating pricing message (#1842) * Bump @storybook/addon-essentials from 6.5.13 to 6.5.15 (#1841) Bumps [@storybook/addon-essentials](https://github.com/storybookjs/storybook/tree/HEAD/addons/essentials) from 6.5.13 to 6.5.15. - [Release notes](https://github.com/storybookjs/storybook/releases) - [Changelog](https://github.com/storybookjs/storybook/blob/v6.5.15/CHANGELOG.md) - [Commits](https://github.com/storybookjs/storybook/commits/v6.5.15/addons/essentials) --- updated-dependencies: - dependency-name: "@storybook/addon-essentials" dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bump @types/jest from 29.2.3 to 29.2.5 (#1840) Bumps [@types/jest](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/jest) from 29.2.3 to 29.2.5. - [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases) - [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/jest) --- updated-dependencies: - dependency-name: "@types/jest" dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bump prettier from 2.8.0 to 2.8.1 (#1837) Bumps [prettier](https://github.com/prettier/prettier) from 2.8.0 to 2.8.1. - [Release notes](https://github.com/prettier/prettier/releases) - [Changelog](https://github.com/prettier/prettier/blob/main/CHANGELOG.md) - [Commits](https://github.com/prettier/prettier/compare/2.8.0...2.8.1) --- updated-dependencies: - dependency-name: prettier dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bump react-select from 5.6.1 to 5.7.0 (#1839) Bumps [react-select](https://github.com/JedWatson/react-select) from 5.6.1 to 5.7.0. - [Release notes](https://github.com/JedWatson/react-select/releases) - [Changelog](https://github.com/JedWatson/react-select/blob/master/docs/CHANGELOG.md) - [Commits](https://github.com/JedWatson/react-select/compare/react-select@5.6.1...react-select@5.7.0) --- updated-dependencies: - dependency-name: react-select dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bump react-tabs from 5.1.0 to 6.0.0 (#1838) Bumps [react-tabs](https://github.com/reactjs/react-tabs) from 5.1.0 to 6.0.0. - [Release notes](https://github.com/reactjs/react-tabs/releases) - [Commits](https://github.com/reactjs/react-tabs/compare/v5.1.0...v6.0.0) --- updated-dependencies: - dependency-name: react-tabs dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com> Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * fix asset route (#1836) * updating the buy button message for free assets * Updating pricing text for compute and algorithms * Updating tests * Adding a seperate sentence about paying gas fees for network charges with free assets * Fixing tests Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: mihaisc <mihai.scarlat@smartcontrol.ro> * Showing hosting type in File Info (#1846) * Bump @storybook/addon-essentials from 6.5.13 to 6.5.15 (#1841) Bumps [@storybook/addon-essentials](https://github.com/storybookjs/storybook/tree/HEAD/addons/essentials) from 6.5.13 to 6.5.15. - [Release notes](https://github.com/storybookjs/storybook/releases) - [Changelog](https://github.com/storybookjs/storybook/blob/v6.5.15/CHANGELOG.md) - [Commits](https://github.com/storybookjs/storybook/commits/v6.5.15/addons/essentials) --- updated-dependencies: - dependency-name: "@storybook/addon-essentials" dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bump @types/jest from 29.2.3 to 29.2.5 (#1840) Bumps [@types/jest](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/jest) from 29.2.3 to 29.2.5. - [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases) - [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/jest) --- updated-dependencies: - dependency-name: "@types/jest" dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bump prettier from 2.8.0 to 2.8.1 (#1837) Bumps [prettier](https://github.com/prettier/prettier) from 2.8.0 to 2.8.1. - [Release notes](https://github.com/prettier/prettier/releases) - [Changelog](https://github.com/prettier/prettier/blob/main/CHANGELOG.md) - [Commits](https://github.com/prettier/prettier/compare/2.8.0...2.8.1) --- updated-dependencies: - dependency-name: prettier dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bump react-select from 5.6.1 to 5.7.0 (#1839) Bumps [react-select](https://github.com/JedWatson/react-select) from 5.6.1 to 5.7.0. - [Release notes](https://github.com/JedWatson/react-select/releases) - [Changelog](https://github.com/JedWatson/react-select/blob/master/docs/CHANGELOG.md) - [Commits](https://github.com/JedWatson/react-select/compare/react-select@5.6.1...react-select@5.7.0) --- updated-dependencies: - dependency-name: react-select dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bump react-tabs from 5.1.0 to 6.0.0 (#1838) Bumps [react-tabs](https://github.com/reactjs/react-tabs) from 5.1.0 to 6.0.0. - [Release notes](https://github.com/reactjs/react-tabs/releases) - [Commits](https://github.com/reactjs/react-tabs/compare/v5.1.0...v6.0.0) --- updated-dependencies: - dependency-name: react-tabs dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com> Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * fix asset route (#1836) * Adding hosting type to the file info component * Writting smart contract hosting type across two lines Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: mihaisc <mihai.scarlat@smartcontrol.ro> * add initial price value for not supported price assets (#1851) * Fix compute basetoken issue (#1829) * fix lint * add dynamic provider fees * fixes * cleanup and more fixes * bump oceanlib to 2.6.0 * fix 404 styling (#1850) * Fixing the z-index for the tippy component (#1858) * Removing infinite approval (#1857) * Removing infinite approvals * Removing infinite approval content message * Removing infinite approval from default user preferences Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: mihaisc <mihai.scarlat@smartcontrol.ro> Co-authored-by: Bogdan Fazakas <bogdan.fazakas@gmail.com> Co-authored-by: EnzoVezzaro <enzo-vezzaro@live.it>
2023-01-18 11:35:14 +01:00
unitsToAmount,
ProviderFees,
Feat: Consumer Parameters (#1921) * feat: add consumer parameters to publish * fix: publish form validation * feat: update consumer parameters form * feat: add consumer parameter types * feat: update consumer parameter validation * feat: add consumer parameters structure * feat: add InputOptions error handling * feat: update consumer parameters validation * feat: update transformPublishFromToDdo * feat: add default options to parameter options * fix: value handling for select and mutliselect * feat: update "add new parameter" button label * feat: remove unused publish form sections * chore: remove console.log * chore: remove comments * feat: remove multiselect * feat: add consumer parameters section label * feat: update types * feat: update edit form fields * feat: parse consumer parameters in edit form * feat: add consumer parameters field to edit * feat: transform consumer parameters values before edit * feat: update "required" type to select * feat: update "required" type to select on edit form * fix: error object access * fix: edit flow crash * fix: validation when consumer parameters are not selected * feat: update validation for default consumer parameters value * fix: types * feat: add service consumer parameters to publish form * chore: remove console.log * feat: add service consumer parameters edit * chore: remove comments * fix: form edit metadata types * feat: add consume algo parameter structure * feat: consumer parameter required default value condition * feat: add consumer parameter groups to assetActions * fix: consumer parameters grouping * feat: update consumer parameters alignment * feat: update types * feat: allow service consumer parameters on dataset asset type * feat: add consumer parameters to ddo updated values in edit form * feat: add "data service" consumer parameters to consumption form * feat: allow service parameters on all asset types * feat: update parameter consume form design * feat: update asset actions consume parameters location * feat: add service parameters to download assets * refactor: consumer parameters actions * refactor: form action name * refactor: consumer parameters default input * refactor: consumer parameters select input * refactor: consumer parameter input * fix: props name * refactor: variable naming * refactor: consumer parameters form validation * refactor: rename consumer parameters types * refactor: extract consumer parameters form data to separate file * refactor: rename type * feat: controlled tabs for consumer params * feat: restore default value as required * refactor: parse values before edit * feat: add form to handle consumer parameters consumption * feat: send consumer params with download request * feat: send consumer params with compute request * feat: handle compute form initialization * chore: remove unused dependency * feat: handle download form data initialization * chore: remove console.log * feat: update types * fix: consumer parameter value types * feat: update ConsumerParameter type * feat: update ConsumerParameter type * chore: add comments * refactor: consumer parameters inputs * refactor: rename data and algo service params * refactor: consumer parameters form * refactor: consumer parameter form styling * refactor: make headers input reusable as KeyValueInput * refactor: refactorings, reduce duplication (WIP) * refactor: usercustomparameters consumption form creation/validation * refactor: return undefined consistently if property path not found on object * refactor: reuse fieldType and fieldOptions in DefaultInput * fix: parse ddo consumer parameters for edit form * fix: asset view crash for assets w/o consumer params * fix: publish preview for assets with no consumer params * fix: revert accidential rename of algoService * fix: revert publish navigation padding change * feat: update consumer parameters' labels and helpers * fix: consumer parameters validation * feat: update consumer parameter helper wording * chore: merge conflicts * feat: update types * fix: validate form on consumer parameter deletion * feat: add key value input placeholder props * fix: handle boolean type consumer parameters in consume form (#38) * Update src/components/Publish/_validation.ts Co-authored-by: Jamie Hewitt <jamie.hewitt15@gmail.com> * Update src/components/Asset/AssetActions/ConsumerParameters/FormConsumerParameters.module.css Co-authored-by: Jamie Hewitt <jamie.hewitt15@gmail.com> * Update src/components/Asset/Edit/_validation.ts Co-authored-by: Jamie Hewitt <jamie.hewitt15@gmail.com> * Update src/components/Asset/AssetActions/ConsumerParameters/index.tsx Co-authored-by: Jamie Hewitt <jamie.hewitt15@gmail.com> * Update src/components/Asset/AssetActions/ConsumerParameters/FormConsumerParameters.tsx Co-authored-by: Jamie Hewitt <jamie.hewitt15@gmail.com> * Update src/components/@shared/FormInput/index.tsx Co-authored-by: Jamie Hewitt <jamie.hewitt15@gmail.com> * Update src/components/@shared/FormInput/InputElement/ConsumerParameters/index.tsx Co-authored-by: Jamie Hewitt <jamie.hewitt15@gmail.com> * Update src/components/@shared/FormInput/InputElement/ConsumerParameters/index.tsx Co-authored-by: Jamie Hewitt <jamie.hewitt15@gmail.com> * Update src/components/@shared/FormInput/InputElement/ConsumerParameters/OptionsInput.tsx Co-authored-by: Jamie Hewitt <jamie.hewitt15@gmail.com> * Update src/components/@shared/FormInput/InputElement/ConsumerParameters/FormActions.tsx Co-authored-by: Jamie Hewitt <jamie.hewitt15@gmail.com> * Update src/@utils/provider.ts Co-authored-by: Jamie Hewitt <jamie.hewitt15@gmail.com> * fix: import paths * refactor: add consumer parameters validation types * feat: add string length min/max to consumer parameters validation * feat: add cp description to consume form * feat: reduce character limit in CP tab title * feat: update CP fields' placeholders and helpers * fix: show only relevant CPs in asset actions --------- Co-authored-by: Luca Milanese <luca.milanese90@gmail.com> Co-authored-by: Jamie Hewitt <jamie.hewitt15@gmail.com>
2023-09-07 16:14:27 +02:00
UserCustomParameters,
getErrorMessage
} from '@oceanprotocol/lib'
Start compute job (#439) * Wip start compute job * Wip select algorithm design * Asset selection form component, for start compute job (#442) * prototype AssetSelection * assetselection styling * typing "fix" * put back file info icon * AssetSelection styling in context * update start job method, fixed algo select, and fixed option typing * compute logic update * add has previous orders for algo asset * fixed search algorithm assets in start compute form * fixed lint errors * updated previous order for algo logic and compute flow * update use price hook and added buy DT for algo * display only alg of type exchange and sort by value * display only trusted algo for asset if field is set * added logic for allow all published algorithms or no algorithms allowed * asset selection style & spacing tweaks * refactor get algorithms for compute and edit compute * fixed form options and more refactoring * new ButtonBuy component * shared component between consume/compute * dealing with various states: loading, previous orders, help text output * effect dependencies * move error output into toast * formik data flow refactor * ditch custom field change handler * fix initialValues * typed form data & validation * fixes multiple form validation issues along the way * isInitialValid → validateOnMount * metadata display tweaks * error feedback tweaks * oler assets checks, confeti on succes job, market fee on order, removed algo compute logic * more startJob logging * feedback & messaging changes * metadata display * return all algos, fixed & dynamic priced ones * fix DOM nesting * messaging updates * copy tweaks * check algorithm previous history for both acces and compute sercive types * handle start compute error * extra checks on start compute response * styling tweaks, fix toast UI errors * AssetSelection: empty screen, tweak min/max height * fix FRE issues on start compute * check is ordarable before start compute job * logging tweaks * disable eslint no-unused-vars rule for some Apollo code blocks * fix metadata editing for compute assets * consider dataset timeout for compute too Co-authored-by: Matthias Kretschmann <m@kretschmann.io>
2021-04-01 17:21:08 +02:00
import { toast } from 'react-toastify'
2021-10-18 20:44:33 +02:00
import Price from '@shared/Price'
import FileIcon from '@shared/FileIcon'
2021-10-13 18:48:59 +02:00
import Alert from '@shared/atoms/Alert'
Start compute job (#439) * Wip start compute job * Wip select algorithm design * Asset selection form component, for start compute job (#442) * prototype AssetSelection * assetselection styling * typing "fix" * put back file info icon * AssetSelection styling in context * update start job method, fixed algo select, and fixed option typing * compute logic update * add has previous orders for algo asset * fixed search algorithm assets in start compute form * fixed lint errors * updated previous order for algo logic and compute flow * update use price hook and added buy DT for algo * display only alg of type exchange and sort by value * display only trusted algo for asset if field is set * added logic for allow all published algorithms or no algorithms allowed * asset selection style & spacing tweaks * refactor get algorithms for compute and edit compute * fixed form options and more refactoring * new ButtonBuy component * shared component between consume/compute * dealing with various states: loading, previous orders, help text output * effect dependencies * move error output into toast * formik data flow refactor * ditch custom field change handler * fix initialValues * typed form data & validation * fixes multiple form validation issues along the way * isInitialValid → validateOnMount * metadata display tweaks * error feedback tweaks * oler assets checks, confeti on succes job, market fee on order, removed algo compute logic * more startJob logging * feedback & messaging changes * metadata display * return all algos, fixed & dynamic priced ones * fix DOM nesting * messaging updates * copy tweaks * check algorithm previous history for both acces and compute sercive types * handle start compute error * extra checks on start compute response * styling tweaks, fix toast UI errors * AssetSelection: empty screen, tweak min/max height * fix FRE issues on start compute * check is ordarable before start compute job * logging tweaks * disable eslint no-unused-vars rule for some Apollo code blocks * fix metadata editing for compute assets * consider dataset timeout for compute too Co-authored-by: Matthias Kretschmann <m@kretschmann.io>
2021-04-01 17:21:08 +02:00
import { Formik } from 'formik'
Feat: Consumer Parameters (#1921) * feat: add consumer parameters to publish * fix: publish form validation * feat: update consumer parameters form * feat: add consumer parameter types * feat: update consumer parameter validation * feat: add consumer parameters structure * feat: add InputOptions error handling * feat: update consumer parameters validation * feat: update transformPublishFromToDdo * feat: add default options to parameter options * fix: value handling for select and mutliselect * feat: update "add new parameter" button label * feat: remove unused publish form sections * chore: remove console.log * chore: remove comments * feat: remove multiselect * feat: add consumer parameters section label * feat: update types * feat: update edit form fields * feat: parse consumer parameters in edit form * feat: add consumer parameters field to edit * feat: transform consumer parameters values before edit * feat: update "required" type to select * feat: update "required" type to select on edit form * fix: error object access * fix: edit flow crash * fix: validation when consumer parameters are not selected * feat: update validation for default consumer parameters value * fix: types * feat: add service consumer parameters to publish form * chore: remove console.log * feat: add service consumer parameters edit * chore: remove comments * fix: form edit metadata types * feat: add consume algo parameter structure * feat: consumer parameter required default value condition * feat: add consumer parameter groups to assetActions * fix: consumer parameters grouping * feat: update consumer parameters alignment * feat: update types * feat: allow service consumer parameters on dataset asset type * feat: add consumer parameters to ddo updated values in edit form * feat: add "data service" consumer parameters to consumption form * feat: allow service parameters on all asset types * feat: update parameter consume form design * feat: update asset actions consume parameters location * feat: add service parameters to download assets * refactor: consumer parameters actions * refactor: form action name * refactor: consumer parameters default input * refactor: consumer parameters select input * refactor: consumer parameter input * fix: props name * refactor: variable naming * refactor: consumer parameters form validation * refactor: rename consumer parameters types * refactor: extract consumer parameters form data to separate file * refactor: rename type * feat: controlled tabs for consumer params * feat: restore default value as required * refactor: parse values before edit * feat: add form to handle consumer parameters consumption * feat: send consumer params with download request * feat: send consumer params with compute request * feat: handle compute form initialization * chore: remove unused dependency * feat: handle download form data initialization * chore: remove console.log * feat: update types * fix: consumer parameter value types * feat: update ConsumerParameter type * feat: update ConsumerParameter type * chore: add comments * refactor: consumer parameters inputs * refactor: rename data and algo service params * refactor: consumer parameters form * refactor: consumer parameter form styling * refactor: make headers input reusable as KeyValueInput * refactor: refactorings, reduce duplication (WIP) * refactor: usercustomparameters consumption form creation/validation * refactor: return undefined consistently if property path not found on object * refactor: reuse fieldType and fieldOptions in DefaultInput * fix: parse ddo consumer parameters for edit form * fix: asset view crash for assets w/o consumer params * fix: publish preview for assets with no consumer params * fix: revert accidential rename of algoService * fix: revert publish navigation padding change * feat: update consumer parameters' labels and helpers * fix: consumer parameters validation * feat: update consumer parameter helper wording * chore: merge conflicts * feat: update types * fix: validate form on consumer parameter deletion * feat: add key value input placeholder props * fix: handle boolean type consumer parameters in consume form (#38) * Update src/components/Publish/_validation.ts Co-authored-by: Jamie Hewitt <jamie.hewitt15@gmail.com> * Update src/components/Asset/AssetActions/ConsumerParameters/FormConsumerParameters.module.css Co-authored-by: Jamie Hewitt <jamie.hewitt15@gmail.com> * Update src/components/Asset/Edit/_validation.ts Co-authored-by: Jamie Hewitt <jamie.hewitt15@gmail.com> * Update src/components/Asset/AssetActions/ConsumerParameters/index.tsx Co-authored-by: Jamie Hewitt <jamie.hewitt15@gmail.com> * Update src/components/Asset/AssetActions/ConsumerParameters/FormConsumerParameters.tsx Co-authored-by: Jamie Hewitt <jamie.hewitt15@gmail.com> * Update src/components/@shared/FormInput/index.tsx Co-authored-by: Jamie Hewitt <jamie.hewitt15@gmail.com> * Update src/components/@shared/FormInput/InputElement/ConsumerParameters/index.tsx Co-authored-by: Jamie Hewitt <jamie.hewitt15@gmail.com> * Update src/components/@shared/FormInput/InputElement/ConsumerParameters/index.tsx Co-authored-by: Jamie Hewitt <jamie.hewitt15@gmail.com> * Update src/components/@shared/FormInput/InputElement/ConsumerParameters/OptionsInput.tsx Co-authored-by: Jamie Hewitt <jamie.hewitt15@gmail.com> * Update src/components/@shared/FormInput/InputElement/ConsumerParameters/FormActions.tsx Co-authored-by: Jamie Hewitt <jamie.hewitt15@gmail.com> * Update src/@utils/provider.ts Co-authored-by: Jamie Hewitt <jamie.hewitt15@gmail.com> * fix: import paths * refactor: add consumer parameters validation types * feat: add string length min/max to consumer parameters validation * feat: add cp description to consume form * feat: reduce character limit in CP tab title * feat: update CP fields' placeholders and helpers * fix: show only relevant CPs in asset actions --------- Co-authored-by: Luca Milanese <luca.milanese90@gmail.com> Co-authored-by: Jamie Hewitt <jamie.hewitt15@gmail.com>
2023-09-07 16:14:27 +02:00
import { getComputeValidationSchema, getInitialValues } from './_constants'
Start compute job (#439) * Wip start compute job * Wip select algorithm design * Asset selection form component, for start compute job (#442) * prototype AssetSelection * assetselection styling * typing "fix" * put back file info icon * AssetSelection styling in context * update start job method, fixed algo select, and fixed option typing * compute logic update * add has previous orders for algo asset * fixed search algorithm assets in start compute form * fixed lint errors * updated previous order for algo logic and compute flow * update use price hook and added buy DT for algo * display only alg of type exchange and sort by value * display only trusted algo for asset if field is set * added logic for allow all published algorithms or no algorithms allowed * asset selection style & spacing tweaks * refactor get algorithms for compute and edit compute * fixed form options and more refactoring * new ButtonBuy component * shared component between consume/compute * dealing with various states: loading, previous orders, help text output * effect dependencies * move error output into toast * formik data flow refactor * ditch custom field change handler * fix initialValues * typed form data & validation * fixes multiple form validation issues along the way * isInitialValid → validateOnMount * metadata display tweaks * error feedback tweaks * oler assets checks, confeti on succes job, market fee on order, removed algo compute logic * more startJob logging * feedback & messaging changes * metadata display * return all algos, fixed & dynamic priced ones * fix DOM nesting * messaging updates * copy tweaks * check algorithm previous history for both acces and compute sercive types * handle start compute error * extra checks on start compute response * styling tweaks, fix toast UI errors * AssetSelection: empty screen, tweak min/max height * fix FRE issues on start compute * check is ordarable before start compute job * logging tweaks * disable eslint no-unused-vars rule for some Apollo code blocks * fix metadata editing for compute assets * consider dataset timeout for compute too Co-authored-by: Matthias Kretschmann <m@kretschmann.io>
2021-04-01 17:21:08 +02:00
import FormStartComputeDataset from './FormComputeDataset'
import styles from './index.module.css'
2021-10-18 20:44:33 +02:00
import SuccessConfetti from '@shared/SuccessConfetti'
2022-03-08 00:23:54 +01:00
import { getServiceByName, secondsToString } from '@utils/ddo'
2022-02-10 15:33:16 +01:00
import {
isOrderable,
getAlgorithmAssetSelectionList,
2022-02-28 13:56:13 +01:00
getAlgorithmsForAsset,
getComputeEnviroment,
getComputeJobs
2022-02-10 15:33:16 +01:00
} from '@utils/compute'
import { AssetSelectionAsset } from '@shared/FormInput/InputElement/AssetSelection'
import AlgorithmDatasetsListForCompute from './AlgorithmDatasetsListForCompute'
2022-08-02 11:53:22 +02:00
import ComputeHistory from './History'
2021-10-13 18:48:59 +02:00
import ComputeJobs from '../../../Profile/History/ComputeJobs'
import { useCancelToken } from '@hooks/useCancelToken'
import { Decimal } from 'decimal.js'
2022-02-03 14:43:27 +01:00
import { useAbortController } from '@hooks/useAbortController'
2022-03-07 23:09:53 +01:00
import { getOrderPriceAndFees } from '@utils/accessDetailsAndPricing'
2022-05-16 06:57:48 +02:00
import { handleComputeOrder } from '@utils/order'
2022-03-12 13:44:12 +01:00
import { getComputeFeedback } from '@utils/feedback'
2022-05-12 13:39:14 +02:00
import { initializeProviderForCompute } from '@utils/provider'
import { useUserPreferences } from '@context/UserPreferences'
Feature/wagmi (#1912) * wagmi + ethers + web3modal setup * refactor wallet components * fallback providers, more config * kick out useWeb3 * remove all useWeb3 imports * more web3.js usage removal * isAddress utils replacement * restore add token / add network * less accountId changes * web3 legacy tinkering, utils/web3 → utils/wallet * legacy web3 object for ocean.js * graph sync fix, remove custom network switching code * package updates, merge fixes * downgrade to ethers v5 * fix project id * switch to ConnectKit * connectkit theming * add existing chains to wagmi * rewrite getPaymentCollector() * kick out getPaymentCollector completely, use wagmi hooks instead * Revert "kick out getPaymentCollector completely, use wagmi hooks instead" This reverts commit 54c7d1ef1a2dec0b1575a685125ba78336b30f59. * switch getPaymentCollector * calcBaseInGivenDatatokensOut reorg * wip integrate ocean lib 3.0.0 * update orbis components to use wagmi instead of web hooks * more oceanjs integration updates * more refactors * fix build * update ocean lib * fix publish * fix order fixed rate * remove logs * debug and stop infinite cycle orbis connect * fix orbis dm connection * mock use network and fix some more tests * mock wagmi switch network * mock wagmi useProvider createClient and connectKit getDefaultClient * fix jest tests * try storybook fix * cleanups and bump ocean lib * fix order * bump lib to next.5 and add more modal style * bump ocean.js lib to 3.0.0 --------- Co-authored-by: Matthias Kretschmann <m@kretschmann.io>
2023-05-29 12:28:41 +02:00
import { useAccount, useSigner } from 'wagmi'
import { getDummySigner } from '@utils/wallet'
import useNetworkMetadata from '@hooks/useNetworkMetadata'
import { useAsset } from '@context/Asset'
Feat: Consumer Parameters (#1921) * feat: add consumer parameters to publish * fix: publish form validation * feat: update consumer parameters form * feat: add consumer parameter types * feat: update consumer parameter validation * feat: add consumer parameters structure * feat: add InputOptions error handling * feat: update consumer parameters validation * feat: update transformPublishFromToDdo * feat: add default options to parameter options * fix: value handling for select and mutliselect * feat: update "add new parameter" button label * feat: remove unused publish form sections * chore: remove console.log * chore: remove comments * feat: remove multiselect * feat: add consumer parameters section label * feat: update types * feat: update edit form fields * feat: parse consumer parameters in edit form * feat: add consumer parameters field to edit * feat: transform consumer parameters values before edit * feat: update "required" type to select * feat: update "required" type to select on edit form * fix: error object access * fix: edit flow crash * fix: validation when consumer parameters are not selected * feat: update validation for default consumer parameters value * fix: types * feat: add service consumer parameters to publish form * chore: remove console.log * feat: add service consumer parameters edit * chore: remove comments * fix: form edit metadata types * feat: add consume algo parameter structure * feat: consumer parameter required default value condition * feat: add consumer parameter groups to assetActions * fix: consumer parameters grouping * feat: update consumer parameters alignment * feat: update types * feat: allow service consumer parameters on dataset asset type * feat: add consumer parameters to ddo updated values in edit form * feat: add "data service" consumer parameters to consumption form * feat: allow service parameters on all asset types * feat: update parameter consume form design * feat: update asset actions consume parameters location * feat: add service parameters to download assets * refactor: consumer parameters actions * refactor: form action name * refactor: consumer parameters default input * refactor: consumer parameters select input * refactor: consumer parameter input * fix: props name * refactor: variable naming * refactor: consumer parameters form validation * refactor: rename consumer parameters types * refactor: extract consumer parameters form data to separate file * refactor: rename type * feat: controlled tabs for consumer params * feat: restore default value as required * refactor: parse values before edit * feat: add form to handle consumer parameters consumption * feat: send consumer params with download request * feat: send consumer params with compute request * feat: handle compute form initialization * chore: remove unused dependency * feat: handle download form data initialization * chore: remove console.log * feat: update types * fix: consumer parameter value types * feat: update ConsumerParameter type * feat: update ConsumerParameter type * chore: add comments * refactor: consumer parameters inputs * refactor: rename data and algo service params * refactor: consumer parameters form * refactor: consumer parameter form styling * refactor: make headers input reusable as KeyValueInput * refactor: refactorings, reduce duplication (WIP) * refactor: usercustomparameters consumption form creation/validation * refactor: return undefined consistently if property path not found on object * refactor: reuse fieldType and fieldOptions in DefaultInput * fix: parse ddo consumer parameters for edit form * fix: asset view crash for assets w/o consumer params * fix: publish preview for assets with no consumer params * fix: revert accidential rename of algoService * fix: revert publish navigation padding change * feat: update consumer parameters' labels and helpers * fix: consumer parameters validation * feat: update consumer parameter helper wording * chore: merge conflicts * feat: update types * fix: validate form on consumer parameter deletion * feat: add key value input placeholder props * fix: handle boolean type consumer parameters in consume form (#38) * Update src/components/Publish/_validation.ts Co-authored-by: Jamie Hewitt <jamie.hewitt15@gmail.com> * Update src/components/Asset/AssetActions/ConsumerParameters/FormConsumerParameters.module.css Co-authored-by: Jamie Hewitt <jamie.hewitt15@gmail.com> * Update src/components/Asset/Edit/_validation.ts Co-authored-by: Jamie Hewitt <jamie.hewitt15@gmail.com> * Update src/components/Asset/AssetActions/ConsumerParameters/index.tsx Co-authored-by: Jamie Hewitt <jamie.hewitt15@gmail.com> * Update src/components/Asset/AssetActions/ConsumerParameters/FormConsumerParameters.tsx Co-authored-by: Jamie Hewitt <jamie.hewitt15@gmail.com> * Update src/components/@shared/FormInput/index.tsx Co-authored-by: Jamie Hewitt <jamie.hewitt15@gmail.com> * Update src/components/@shared/FormInput/InputElement/ConsumerParameters/index.tsx Co-authored-by: Jamie Hewitt <jamie.hewitt15@gmail.com> * Update src/components/@shared/FormInput/InputElement/ConsumerParameters/index.tsx Co-authored-by: Jamie Hewitt <jamie.hewitt15@gmail.com> * Update src/components/@shared/FormInput/InputElement/ConsumerParameters/OptionsInput.tsx Co-authored-by: Jamie Hewitt <jamie.hewitt15@gmail.com> * Update src/components/@shared/FormInput/InputElement/ConsumerParameters/FormActions.tsx Co-authored-by: Jamie Hewitt <jamie.hewitt15@gmail.com> * Update src/@utils/provider.ts Co-authored-by: Jamie Hewitt <jamie.hewitt15@gmail.com> * fix: import paths * refactor: add consumer parameters validation types * feat: add string length min/max to consumer parameters validation * feat: add cp description to consume form * feat: reduce character limit in CP tab title * feat: update CP fields' placeholders and helpers * fix: show only relevant CPs in asset actions --------- Co-authored-by: Luca Milanese <luca.milanese90@gmail.com> Co-authored-by: Jamie Hewitt <jamie.hewitt15@gmail.com>
2023-09-07 16:14:27 +02:00
import { parseConsumerParameterValues } from '../ConsumerParameters'
Start compute job (#439) * Wip start compute job * Wip select algorithm design * Asset selection form component, for start compute job (#442) * prototype AssetSelection * assetselection styling * typing "fix" * put back file info icon * AssetSelection styling in context * update start job method, fixed algo select, and fixed option typing * compute logic update * add has previous orders for algo asset * fixed search algorithm assets in start compute form * fixed lint errors * updated previous order for algo logic and compute flow * update use price hook and added buy DT for algo * display only alg of type exchange and sort by value * display only trusted algo for asset if field is set * added logic for allow all published algorithms or no algorithms allowed * asset selection style & spacing tweaks * refactor get algorithms for compute and edit compute * fixed form options and more refactoring * new ButtonBuy component * shared component between consume/compute * dealing with various states: loading, previous orders, help text output * effect dependencies * move error output into toast * formik data flow refactor * ditch custom field change handler * fix initialValues * typed form data & validation * fixes multiple form validation issues along the way * isInitialValid → validateOnMount * metadata display tweaks * error feedback tweaks * oler assets checks, confeti on succes job, market fee on order, removed algo compute logic * more startJob logging * feedback & messaging changes * metadata display * return all algos, fixed & dynamic priced ones * fix DOM nesting * messaging updates * copy tweaks * check algorithm previous history for both acces and compute sercive types * handle start compute error * extra checks on start compute response * styling tweaks, fix toast UI errors * AssetSelection: empty screen, tweak min/max height * fix FRE issues on start compute * check is ordarable before start compute job * logging tweaks * disable eslint no-unused-vars rule for some Apollo code blocks * fix metadata editing for compute assets * consider dataset timeout for compute too Co-authored-by: Matthias Kretschmann <m@kretschmann.io>
2021-04-01 17:21:08 +02:00
const refreshInterval = 10000 // 10 sec.
Feature/wagmi (#1912) * wagmi + ethers + web3modal setup * refactor wallet components * fallback providers, more config * kick out useWeb3 * remove all useWeb3 imports * more web3.js usage removal * isAddress utils replacement * restore add token / add network * less accountId changes * web3 legacy tinkering, utils/web3 → utils/wallet * legacy web3 object for ocean.js * graph sync fix, remove custom network switching code * package updates, merge fixes * downgrade to ethers v5 * fix project id * switch to ConnectKit * connectkit theming * add existing chains to wagmi * rewrite getPaymentCollector() * kick out getPaymentCollector completely, use wagmi hooks instead * Revert "kick out getPaymentCollector completely, use wagmi hooks instead" This reverts commit 54c7d1ef1a2dec0b1575a685125ba78336b30f59. * switch getPaymentCollector * calcBaseInGivenDatatokensOut reorg * wip integrate ocean lib 3.0.0 * update orbis components to use wagmi instead of web hooks * more oceanjs integration updates * more refactors * fix build * update ocean lib * fix publish * fix order fixed rate * remove logs * debug and stop infinite cycle orbis connect * fix orbis dm connection * mock use network and fix some more tests * mock wagmi switch network * mock wagmi useProvider createClient and connectKit getDefaultClient * fix jest tests * try storybook fix * cleanups and bump ocean lib * fix order * bump lib to next.5 and add more modal style * bump ocean.js lib to 3.0.0 --------- Co-authored-by: Matthias Kretschmann <m@kretschmann.io>
2023-05-29 12:28:41 +02:00
Start compute job (#439) * Wip start compute job * Wip select algorithm design * Asset selection form component, for start compute job (#442) * prototype AssetSelection * assetselection styling * typing "fix" * put back file info icon * AssetSelection styling in context * update start job method, fixed algo select, and fixed option typing * compute logic update * add has previous orders for algo asset * fixed search algorithm assets in start compute form * fixed lint errors * updated previous order for algo logic and compute flow * update use price hook and added buy DT for algo * display only alg of type exchange and sort by value * display only trusted algo for asset if field is set * added logic for allow all published algorithms or no algorithms allowed * asset selection style & spacing tweaks * refactor get algorithms for compute and edit compute * fixed form options and more refactoring * new ButtonBuy component * shared component between consume/compute * dealing with various states: loading, previous orders, help text output * effect dependencies * move error output into toast * formik data flow refactor * ditch custom field change handler * fix initialValues * typed form data & validation * fixes multiple form validation issues along the way * isInitialValid → validateOnMount * metadata display tweaks * error feedback tweaks * oler assets checks, confeti on succes job, market fee on order, removed algo compute logic * more startJob logging * feedback & messaging changes * metadata display * return all algos, fixed & dynamic priced ones * fix DOM nesting * messaging updates * copy tweaks * check algorithm previous history for both acces and compute sercive types * handle start compute error * extra checks on start compute response * styling tweaks, fix toast UI errors * AssetSelection: empty screen, tweak min/max height * fix FRE issues on start compute * check is ordarable before start compute job * logging tweaks * disable eslint no-unused-vars rule for some Apollo code blocks * fix metadata editing for compute assets * consider dataset timeout for compute too Co-authored-by: Matthias Kretschmann <m@kretschmann.io>
2021-04-01 17:21:08 +02:00
export default function Compute({
2022-02-10 15:33:16 +01:00
asset,
Start compute job (#439) * Wip start compute job * Wip select algorithm design * Asset selection form component, for start compute job (#442) * prototype AssetSelection * assetselection styling * typing "fix" * put back file info icon * AssetSelection styling in context * update start job method, fixed algo select, and fixed option typing * compute logic update * add has previous orders for algo asset * fixed search algorithm assets in start compute form * fixed lint errors * updated previous order for algo logic and compute flow * update use price hook and added buy DT for algo * display only alg of type exchange and sort by value * display only trusted algo for asset if field is set * added logic for allow all published algorithms or no algorithms allowed * asset selection style & spacing tweaks * refactor get algorithms for compute and edit compute * fixed form options and more refactoring * new ButtonBuy component * shared component between consume/compute * dealing with various states: loading, previous orders, help text output * effect dependencies * move error output into toast * formik data flow refactor * ditch custom field change handler * fix initialValues * typed form data & validation * fixes multiple form validation issues along the way * isInitialValid → validateOnMount * metadata display tweaks * error feedback tweaks * oler assets checks, confeti on succes job, market fee on order, removed algo compute logic * more startJob logging * feedback & messaging changes * metadata display * return all algos, fixed & dynamic priced ones * fix DOM nesting * messaging updates * copy tweaks * check algorithm previous history for both acces and compute sercive types * handle start compute error * extra checks on start compute response * styling tweaks, fix toast UI errors * AssetSelection: empty screen, tweak min/max height * fix FRE issues on start compute * check is ordarable before start compute job * logging tweaks * disable eslint no-unused-vars rule for some Apollo code blocks * fix metadata editing for compute assets * consider dataset timeout for compute too Co-authored-by: Matthias Kretschmann <m@kretschmann.io>
2021-04-01 17:21:08 +02:00
dtBalance,
file,
fileIsLoading,
consumableFeedback
Start compute job (#439) * Wip start compute job * Wip select algorithm design * Asset selection form component, for start compute job (#442) * prototype AssetSelection * assetselection styling * typing "fix" * put back file info icon * AssetSelection styling in context * update start job method, fixed algo select, and fixed option typing * compute logic update * add has previous orders for algo asset * fixed search algorithm assets in start compute form * fixed lint errors * updated previous order for algo logic and compute flow * update use price hook and added buy DT for algo * display only alg of type exchange and sort by value * display only trusted algo for asset if field is set * added logic for allow all published algorithms or no algorithms allowed * asset selection style & spacing tweaks * refactor get algorithms for compute and edit compute * fixed form options and more refactoring * new ButtonBuy component * shared component between consume/compute * dealing with various states: loading, previous orders, help text output * effect dependencies * move error output into toast * formik data flow refactor * ditch custom field change handler * fix initialValues * typed form data & validation * fixes multiple form validation issues along the way * isInitialValid → validateOnMount * metadata display tweaks * error feedback tweaks * oler assets checks, confeti on succes job, market fee on order, removed algo compute logic * more startJob logging * feedback & messaging changes * metadata display * return all algos, fixed & dynamic priced ones * fix DOM nesting * messaging updates * copy tweaks * check algorithm previous history for both acces and compute sercive types * handle start compute error * extra checks on start compute response * styling tweaks, fix toast UI errors * AssetSelection: empty screen, tweak min/max height * fix FRE issues on start compute * check is ordarable before start compute job * logging tweaks * disable eslint no-unused-vars rule for some Apollo code blocks * fix metadata editing for compute assets * consider dataset timeout for compute too Co-authored-by: Matthias Kretschmann <m@kretschmann.io>
2021-04-01 17:21:08 +02:00
}: {
asset: AssetExtended
Start compute job (#439) * Wip start compute job * Wip select algorithm design * Asset selection form component, for start compute job (#442) * prototype AssetSelection * assetselection styling * typing "fix" * put back file info icon * AssetSelection styling in context * update start job method, fixed algo select, and fixed option typing * compute logic update * add has previous orders for algo asset * fixed search algorithm assets in start compute form * fixed lint errors * updated previous order for algo logic and compute flow * update use price hook and added buy DT for algo * display only alg of type exchange and sort by value * display only trusted algo for asset if field is set * added logic for allow all published algorithms or no algorithms allowed * asset selection style & spacing tweaks * refactor get algorithms for compute and edit compute * fixed form options and more refactoring * new ButtonBuy component * shared component between consume/compute * dealing with various states: loading, previous orders, help text output * effect dependencies * move error output into toast * formik data flow refactor * ditch custom field change handler * fix initialValues * typed form data & validation * fixes multiple form validation issues along the way * isInitialValid → validateOnMount * metadata display tweaks * error feedback tweaks * oler assets checks, confeti on succes job, market fee on order, removed algo compute logic * more startJob logging * feedback & messaging changes * metadata display * return all algos, fixed & dynamic priced ones * fix DOM nesting * messaging updates * copy tweaks * check algorithm previous history for both acces and compute sercive types * handle start compute error * extra checks on start compute response * styling tweaks, fix toast UI errors * AssetSelection: empty screen, tweak min/max height * fix FRE issues on start compute * check is ordarable before start compute job * logging tweaks * disable eslint no-unused-vars rule for some Apollo code blocks * fix metadata editing for compute assets * consider dataset timeout for compute too Co-authored-by: Matthias Kretschmann <m@kretschmann.io>
2021-04-01 17:21:08 +02:00
dtBalance: string
file: FileInfo
fileIsLoading?: boolean
consumableFeedback?: string
Start compute job (#439) * Wip start compute job * Wip select algorithm design * Asset selection form component, for start compute job (#442) * prototype AssetSelection * assetselection styling * typing "fix" * put back file info icon * AssetSelection styling in context * update start job method, fixed algo select, and fixed option typing * compute logic update * add has previous orders for algo asset * fixed search algorithm assets in start compute form * fixed lint errors * updated previous order for algo logic and compute flow * update use price hook and added buy DT for algo * display only alg of type exchange and sort by value * display only trusted algo for asset if field is set * added logic for allow all published algorithms or no algorithms allowed * asset selection style & spacing tweaks * refactor get algorithms for compute and edit compute * fixed form options and more refactoring * new ButtonBuy component * shared component between consume/compute * dealing with various states: loading, previous orders, help text output * effect dependencies * move error output into toast * formik data flow refactor * ditch custom field change handler * fix initialValues * typed form data & validation * fixes multiple form validation issues along the way * isInitialValid → validateOnMount * metadata display tweaks * error feedback tweaks * oler assets checks, confeti on succes job, market fee on order, removed algo compute logic * more startJob logging * feedback & messaging changes * metadata display * return all algos, fixed & dynamic priced ones * fix DOM nesting * messaging updates * copy tweaks * check algorithm previous history for both acces and compute sercive types * handle start compute error * extra checks on start compute response * styling tweaks, fix toast UI errors * AssetSelection: empty screen, tweak min/max height * fix FRE issues on start compute * check is ordarable before start compute job * logging tweaks * disable eslint no-unused-vars rule for some Apollo code blocks * fix metadata editing for compute assets * consider dataset timeout for compute too Co-authored-by: Matthias Kretschmann <m@kretschmann.io>
2021-04-01 17:21:08 +02:00
}): ReactElement {
Feature/wagmi (#1912) * wagmi + ethers + web3modal setup * refactor wallet components * fallback providers, more config * kick out useWeb3 * remove all useWeb3 imports * more web3.js usage removal * isAddress utils replacement * restore add token / add network * less accountId changes * web3 legacy tinkering, utils/web3 → utils/wallet * legacy web3 object for ocean.js * graph sync fix, remove custom network switching code * package updates, merge fixes * downgrade to ethers v5 * fix project id * switch to ConnectKit * connectkit theming * add existing chains to wagmi * rewrite getPaymentCollector() * kick out getPaymentCollector completely, use wagmi hooks instead * Revert "kick out getPaymentCollector completely, use wagmi hooks instead" This reverts commit 54c7d1ef1a2dec0b1575a685125ba78336b30f59. * switch getPaymentCollector * calcBaseInGivenDatatokensOut reorg * wip integrate ocean lib 3.0.0 * update orbis components to use wagmi instead of web hooks * more oceanjs integration updates * more refactors * fix build * update ocean lib * fix publish * fix order fixed rate * remove logs * debug and stop infinite cycle orbis connect * fix orbis dm connection * mock use network and fix some more tests * mock wagmi switch network * mock wagmi useProvider createClient and connectKit getDefaultClient * fix jest tests * try storybook fix * cleanups and bump ocean lib * fix order * bump lib to next.5 and add more modal style * bump ocean.js lib to 3.0.0 --------- Co-authored-by: Matthias Kretschmann <m@kretschmann.io>
2023-05-29 12:28:41 +02:00
const { address: accountId } = useAccount()
const { chainIds } = useUserPreferences()
Feature/wagmi (#1912) * wagmi + ethers + web3modal setup * refactor wallet components * fallback providers, more config * kick out useWeb3 * remove all useWeb3 imports * more web3.js usage removal * isAddress utils replacement * restore add token / add network * less accountId changes * web3 legacy tinkering, utils/web3 → utils/wallet * legacy web3 object for ocean.js * graph sync fix, remove custom network switching code * package updates, merge fixes * downgrade to ethers v5 * fix project id * switch to ConnectKit * connectkit theming * add existing chains to wagmi * rewrite getPaymentCollector() * kick out getPaymentCollector completely, use wagmi hooks instead * Revert "kick out getPaymentCollector completely, use wagmi hooks instead" This reverts commit 54c7d1ef1a2dec0b1575a685125ba78336b30f59. * switch getPaymentCollector * calcBaseInGivenDatatokensOut reorg * wip integrate ocean lib 3.0.0 * update orbis components to use wagmi instead of web hooks * more oceanjs integration updates * more refactors * fix build * update ocean lib * fix publish * fix order fixed rate * remove logs * debug and stop infinite cycle orbis connect * fix orbis dm connection * mock use network and fix some more tests * mock wagmi switch network * mock wagmi useProvider createClient and connectKit getDefaultClient * fix jest tests * try storybook fix * cleanups and bump ocean lib * fix order * bump lib to next.5 and add more modal style * bump ocean.js lib to 3.0.0 --------- Co-authored-by: Matthias Kretschmann <m@kretschmann.io>
2023-05-29 12:28:41 +02:00
const { data: signer } = useSigner()
2022-06-22 12:46:42 +02:00
const newAbortController = useAbortController()
2022-06-22 13:46:27 +02:00
const newCancelToken = useCancelToken()
2022-06-22 14:40:35 +02:00
const [isOrdering, setIsOrdering] = useState(false)
const [isOrdered, setIsOrdered] = useState(false)
Start compute job (#439) * Wip start compute job * Wip select algorithm design * Asset selection form component, for start compute job (#442) * prototype AssetSelection * assetselection styling * typing "fix" * put back file info icon * AssetSelection styling in context * update start job method, fixed algo select, and fixed option typing * compute logic update * add has previous orders for algo asset * fixed search algorithm assets in start compute form * fixed lint errors * updated previous order for algo logic and compute flow * update use price hook and added buy DT for algo * display only alg of type exchange and sort by value * display only trusted algo for asset if field is set * added logic for allow all published algorithms or no algorithms allowed * asset selection style & spacing tweaks * refactor get algorithms for compute and edit compute * fixed form options and more refactoring * new ButtonBuy component * shared component between consume/compute * dealing with various states: loading, previous orders, help text output * effect dependencies * move error output into toast * formik data flow refactor * ditch custom field change handler * fix initialValues * typed form data & validation * fixes multiple form validation issues along the way * isInitialValid → validateOnMount * metadata display tweaks * error feedback tweaks * oler assets checks, confeti on succes job, market fee on order, removed algo compute logic * more startJob logging * feedback & messaging changes * metadata display * return all algos, fixed & dynamic priced ones * fix DOM nesting * messaging updates * copy tweaks * check algorithm previous history for both acces and compute sercive types * handle start compute error * extra checks on start compute response * styling tweaks, fix toast UI errors * AssetSelection: empty screen, tweak min/max height * fix FRE issues on start compute * check is ordarable before start compute job * logging tweaks * disable eslint no-unused-vars rule for some Apollo code blocks * fix metadata editing for compute assets * consider dataset timeout for compute too Co-authored-by: Matthias Kretschmann <m@kretschmann.io>
2021-04-01 17:21:08 +02:00
const [error, setError] = useState<string>()
const [algorithmList, setAlgorithmList] = useState<AssetSelectionAsset[]>()
const [ddoAlgorithmList, setDdoAlgorithmList] = useState<Asset[]>()
const [selectedAlgorithmAsset, setSelectedAlgorithmAsset] =
useState<AssetExtended>()
Start compute job (#439) * Wip start compute job * Wip select algorithm design * Asset selection form component, for start compute job (#442) * prototype AssetSelection * assetselection styling * typing "fix" * put back file info icon * AssetSelection styling in context * update start job method, fixed algo select, and fixed option typing * compute logic update * add has previous orders for algo asset * fixed search algorithm assets in start compute form * fixed lint errors * updated previous order for algo logic and compute flow * update use price hook and added buy DT for algo * display only alg of type exchange and sort by value * display only trusted algo for asset if field is set * added logic for allow all published algorithms or no algorithms allowed * asset selection style & spacing tweaks * refactor get algorithms for compute and edit compute * fixed form options and more refactoring * new ButtonBuy component * shared component between consume/compute * dealing with various states: loading, previous orders, help text output * effect dependencies * move error output into toast * formik data flow refactor * ditch custom field change handler * fix initialValues * typed form data & validation * fixes multiple form validation issues along the way * isInitialValid → validateOnMount * metadata display tweaks * error feedback tweaks * oler assets checks, confeti on succes job, market fee on order, removed algo compute logic * more startJob logging * feedback & messaging changes * metadata display * return all algos, fixed & dynamic priced ones * fix DOM nesting * messaging updates * copy tweaks * check algorithm previous history for both acces and compute sercive types * handle start compute error * extra checks on start compute response * styling tweaks, fix toast UI errors * AssetSelection: empty screen, tweak min/max height * fix FRE issues on start compute * check is ordarable before start compute job * logging tweaks * disable eslint no-unused-vars rule for some Apollo code blocks * fix metadata editing for compute assets * consider dataset timeout for compute too Co-authored-by: Matthias Kretschmann <m@kretschmann.io>
2021-04-01 17:21:08 +02:00
const [hasAlgoAssetDatatoken, setHasAlgoAssetDatatoken] = useState<boolean>()
const [algorithmDTBalance, setAlgorithmDTBalance] = useState<string>()
const [validOrderTx, setValidOrderTx] = useState('')
const [validAlgorithmOrderTx, setValidAlgorithmOrderTx] = useState('')
const [isConsumablePrice, setIsConsumablePrice] = useState(true)
const [isConsumableaAlgorithmPrice, setIsConsumableAlgorithmPrice] =
useState(true)
2022-03-12 13:44:12 +01:00
const [computeStatusText, setComputeStatusText] = useState('')
const [computeEnv, setComputeEnv] = useState<ComputeEnvironment>()
2022-05-12 13:39:14 +02:00
const [initializedProviderResponse, setInitializedProviderResponse] =
useState<ProviderComputeInitializeResults>()
const [providerFeeAmount, setProviderFeeAmount] = useState<string>('0')
Release candidate 09-01-2023 (#1843) * Avoiding getInitialPaymentCollector failure (#1816) * early return is no web3 or ddo * Creating test for MetaFull * adding test: src/components/Asset/AssetContent/MetaSecondary.test.tsx * Adding test for bookmarks * Adding test for displaying payment collector * Removing comments * Renaming assetAquarius * Renaming assetWithAccessDetails * Ensuring that the payment collector is shown even without a wallet connected * Removing broken test * Using getDummyWeb3 for fetching the payment collector address * google validation (#1835) * Updating validation to exclude any google link * Updating Yup validation * Checking if domain includes google.com * Updating isGoogleUrl function * Moving isGoogleUrl into @utils/url/index file * isGoogleUrl function * Updating tests * Adding additional tests for other google domains * Updating tests * Updating isGoogleUrl file path * Updating pricing message (#1842) * Bump @storybook/addon-essentials from 6.5.13 to 6.5.15 (#1841) Bumps [@storybook/addon-essentials](https://github.com/storybookjs/storybook/tree/HEAD/addons/essentials) from 6.5.13 to 6.5.15. - [Release notes](https://github.com/storybookjs/storybook/releases) - [Changelog](https://github.com/storybookjs/storybook/blob/v6.5.15/CHANGELOG.md) - [Commits](https://github.com/storybookjs/storybook/commits/v6.5.15/addons/essentials) --- updated-dependencies: - dependency-name: "@storybook/addon-essentials" dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bump @types/jest from 29.2.3 to 29.2.5 (#1840) Bumps [@types/jest](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/jest) from 29.2.3 to 29.2.5. - [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases) - [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/jest) --- updated-dependencies: - dependency-name: "@types/jest" dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bump prettier from 2.8.0 to 2.8.1 (#1837) Bumps [prettier](https://github.com/prettier/prettier) from 2.8.0 to 2.8.1. - [Release notes](https://github.com/prettier/prettier/releases) - [Changelog](https://github.com/prettier/prettier/blob/main/CHANGELOG.md) - [Commits](https://github.com/prettier/prettier/compare/2.8.0...2.8.1) --- updated-dependencies: - dependency-name: prettier dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bump react-select from 5.6.1 to 5.7.0 (#1839) Bumps [react-select](https://github.com/JedWatson/react-select) from 5.6.1 to 5.7.0. - [Release notes](https://github.com/JedWatson/react-select/releases) - [Changelog](https://github.com/JedWatson/react-select/blob/master/docs/CHANGELOG.md) - [Commits](https://github.com/JedWatson/react-select/compare/react-select@5.6.1...react-select@5.7.0) --- updated-dependencies: - dependency-name: react-select dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bump react-tabs from 5.1.0 to 6.0.0 (#1838) Bumps [react-tabs](https://github.com/reactjs/react-tabs) from 5.1.0 to 6.0.0. - [Release notes](https://github.com/reactjs/react-tabs/releases) - [Commits](https://github.com/reactjs/react-tabs/compare/v5.1.0...v6.0.0) --- updated-dependencies: - dependency-name: react-tabs dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com> Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * fix asset route (#1836) * updating the buy button message for free assets * Updating pricing text for compute and algorithms * Updating tests * Adding a seperate sentence about paying gas fees for network charges with free assets * Fixing tests Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: mihaisc <mihai.scarlat@smartcontrol.ro> * Showing hosting type in File Info (#1846) * Bump @storybook/addon-essentials from 6.5.13 to 6.5.15 (#1841) Bumps [@storybook/addon-essentials](https://github.com/storybookjs/storybook/tree/HEAD/addons/essentials) from 6.5.13 to 6.5.15. - [Release notes](https://github.com/storybookjs/storybook/releases) - [Changelog](https://github.com/storybookjs/storybook/blob/v6.5.15/CHANGELOG.md) - [Commits](https://github.com/storybookjs/storybook/commits/v6.5.15/addons/essentials) --- updated-dependencies: - dependency-name: "@storybook/addon-essentials" dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bump @types/jest from 29.2.3 to 29.2.5 (#1840) Bumps [@types/jest](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/jest) from 29.2.3 to 29.2.5. - [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases) - [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/jest) --- updated-dependencies: - dependency-name: "@types/jest" dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bump prettier from 2.8.0 to 2.8.1 (#1837) Bumps [prettier](https://github.com/prettier/prettier) from 2.8.0 to 2.8.1. - [Release notes](https://github.com/prettier/prettier/releases) - [Changelog](https://github.com/prettier/prettier/blob/main/CHANGELOG.md) - [Commits](https://github.com/prettier/prettier/compare/2.8.0...2.8.1) --- updated-dependencies: - dependency-name: prettier dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bump react-select from 5.6.1 to 5.7.0 (#1839) Bumps [react-select](https://github.com/JedWatson/react-select) from 5.6.1 to 5.7.0. - [Release notes](https://github.com/JedWatson/react-select/releases) - [Changelog](https://github.com/JedWatson/react-select/blob/master/docs/CHANGELOG.md) - [Commits](https://github.com/JedWatson/react-select/compare/react-select@5.6.1...react-select@5.7.0) --- updated-dependencies: - dependency-name: react-select dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bump react-tabs from 5.1.0 to 6.0.0 (#1838) Bumps [react-tabs](https://github.com/reactjs/react-tabs) from 5.1.0 to 6.0.0. - [Release notes](https://github.com/reactjs/react-tabs/releases) - [Commits](https://github.com/reactjs/react-tabs/compare/v5.1.0...v6.0.0) --- updated-dependencies: - dependency-name: react-tabs dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com> Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * fix asset route (#1836) * Adding hosting type to the file info component * Writting smart contract hosting type across two lines Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: mihaisc <mihai.scarlat@smartcontrol.ro> * add initial price value for not supported price assets (#1851) * Fix compute basetoken issue (#1829) * fix lint * add dynamic provider fees * fixes * cleanup and more fixes * bump oceanlib to 2.6.0 * fix 404 styling (#1850) * Fixing the z-index for the tippy component (#1858) * Removing infinite approval (#1857) * Removing infinite approvals * Removing infinite approval content message * Removing infinite approval from default user preferences Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: mihaisc <mihai.scarlat@smartcontrol.ro> Co-authored-by: Bogdan Fazakas <bogdan.fazakas@gmail.com> Co-authored-by: EnzoVezzaro <enzo-vezzaro@live.it>
2023-01-18 11:35:14 +01:00
const [providerFeesSymbol, setProviderFeesSymbol] = useState<string>('OCEAN')
const [computeValidUntil, setComputeValidUntil] = useState<string>('0')
const [datasetOrderPriceAndFees, setDatasetOrderPriceAndFees] =
useState<OrderPriceAndFees>()
const [algoOrderPriceAndFees, setAlgoOrderPriceAndFees] =
useState<OrderPriceAndFees>()
const [isRequestingAlgoOrderPrice, setIsRequestingAlgoOrderPrice] =
useState(false)
2022-06-22 12:46:42 +02:00
const [refetchJobs, setRefetchJobs] = useState(false)
const [isLoadingJobs, setIsLoadingJobs] = useState(false)
const [jobs, setJobs] = useState<ComputeJobMetaData[]>([])
const [retry, setRetry] = useState<boolean>(false)
const { isSupportedOceanNetwork } = useNetworkMetadata()
const { isAssetNetwork } = useAsset()
2022-06-22 12:46:42 +02:00
const hasDatatoken = Number(dtBalance) >= 1
Start compute job (#439) * Wip start compute job * Wip select algorithm design * Asset selection form component, for start compute job (#442) * prototype AssetSelection * assetselection styling * typing "fix" * put back file info icon * AssetSelection styling in context * update start job method, fixed algo select, and fixed option typing * compute logic update * add has previous orders for algo asset * fixed search algorithm assets in start compute form * fixed lint errors * updated previous order for algo logic and compute flow * update use price hook and added buy DT for algo * display only alg of type exchange and sort by value * display only trusted algo for asset if field is set * added logic for allow all published algorithms or no algorithms allowed * asset selection style & spacing tweaks * refactor get algorithms for compute and edit compute * fixed form options and more refactoring * new ButtonBuy component * shared component between consume/compute * dealing with various states: loading, previous orders, help text output * effect dependencies * move error output into toast * formik data flow refactor * ditch custom field change handler * fix initialValues * typed form data & validation * fixes multiple form validation issues along the way * isInitialValid → validateOnMount * metadata display tweaks * error feedback tweaks * oler assets checks, confeti on succes job, market fee on order, removed algo compute logic * more startJob logging * feedback & messaging changes * metadata display * return all algos, fixed & dynamic priced ones * fix DOM nesting * messaging updates * copy tweaks * check algorithm previous history for both acces and compute sercive types * handle start compute error * extra checks on start compute response * styling tweaks, fix toast UI errors * AssetSelection: empty screen, tweak min/max height * fix FRE issues on start compute * check is ordarable before start compute job * logging tweaks * disable eslint no-unused-vars rule for some Apollo code blocks * fix metadata editing for compute assets * consider dataset timeout for compute too Co-authored-by: Matthias Kretschmann <m@kretschmann.io>
2021-04-01 17:21:08 +02:00
const isComputeButtonDisabled =
2022-06-22 14:40:35 +02:00
isOrdering === true ||
file === null ||
(!validOrderTx && !hasDatatoken && !isConsumablePrice) ||
(!validAlgorithmOrderTx &&
!hasAlgoAssetDatatoken &&
!isConsumableaAlgorithmPrice)
Start compute job (#439) * Wip start compute job * Wip select algorithm design * Asset selection form component, for start compute job (#442) * prototype AssetSelection * assetselection styling * typing "fix" * put back file info icon * AssetSelection styling in context * update start job method, fixed algo select, and fixed option typing * compute logic update * add has previous orders for algo asset * fixed search algorithm assets in start compute form * fixed lint errors * updated previous order for algo logic and compute flow * update use price hook and added buy DT for algo * display only alg of type exchange and sort by value * display only trusted algo for asset if field is set * added logic for allow all published algorithms or no algorithms allowed * asset selection style & spacing tweaks * refactor get algorithms for compute and edit compute * fixed form options and more refactoring * new ButtonBuy component * shared component between consume/compute * dealing with various states: loading, previous orders, help text output * effect dependencies * move error output into toast * formik data flow refactor * ditch custom field change handler * fix initialValues * typed form data & validation * fixes multiple form validation issues along the way * isInitialValid → validateOnMount * metadata display tweaks * error feedback tweaks * oler assets checks, confeti on succes job, market fee on order, removed algo compute logic * more startJob logging * feedback & messaging changes * metadata display * return all algos, fixed & dynamic priced ones * fix DOM nesting * messaging updates * copy tweaks * check algorithm previous history for both acces and compute sercive types * handle start compute error * extra checks on start compute response * styling tweaks, fix toast UI errors * AssetSelection: empty screen, tweak min/max height * fix FRE issues on start compute * check is ordarable before start compute job * logging tweaks * disable eslint no-unused-vars rule for some Apollo code blocks * fix metadata editing for compute assets * consider dataset timeout for compute too Co-authored-by: Matthias Kretschmann <m@kretschmann.io>
2021-04-01 17:21:08 +02:00
2022-08-02 11:53:22 +02:00
const isUnsupportedPricing = asset?.accessDetails?.type === 'NOT_SUPPORTED'
Feature/wagmi (#1912) * wagmi + ethers + web3modal setup * refactor wallet components * fallback providers, more config * kick out useWeb3 * remove all useWeb3 imports * more web3.js usage removal * isAddress utils replacement * restore add token / add network * less accountId changes * web3 legacy tinkering, utils/web3 → utils/wallet * legacy web3 object for ocean.js * graph sync fix, remove custom network switching code * package updates, merge fixes * downgrade to ethers v5 * fix project id * switch to ConnectKit * connectkit theming * add existing chains to wagmi * rewrite getPaymentCollector() * kick out getPaymentCollector completely, use wagmi hooks instead * Revert "kick out getPaymentCollector completely, use wagmi hooks instead" This reverts commit 54c7d1ef1a2dec0b1575a685125ba78336b30f59. * switch getPaymentCollector * calcBaseInGivenDatatokensOut reorg * wip integrate ocean lib 3.0.0 * update orbis components to use wagmi instead of web hooks * more oceanjs integration updates * more refactors * fix build * update ocean lib * fix publish * fix order fixed rate * remove logs * debug and stop infinite cycle orbis connect * fix orbis dm connection * mock use network and fix some more tests * mock wagmi switch network * mock wagmi useProvider createClient and connectKit getDefaultClient * fix jest tests * try storybook fix * cleanups and bump ocean lib * fix order * bump lib to next.5 and add more modal style * bump ocean.js lib to 3.0.0 --------- Co-authored-by: Matthias Kretschmann <m@kretschmann.io>
2023-05-29 12:28:41 +02:00
async function checkAssetDTBalance(asset: DDO) {
2022-03-02 15:42:50 +01:00
if (!asset?.services[0].datatokenAddress) return
const dummySigner = await getDummySigner(asset?.chainId)
const datatokenInstance = new Datatoken(dummySigner)
2022-03-02 15:42:50 +01:00
const dtBalance = await datatokenInstance.balance(
asset?.services[0].datatokenAddress,
accountId || ZERO_ADDRESS // if the user is not connected, we use ZERO_ADDRESS as accountId
)
2022-03-02 15:42:50 +01:00
setAlgorithmDTBalance(new Decimal(dtBalance).toString())
const hasAlgoDt = Number(dtBalance) >= 1
setHasAlgoAssetDatatoken(hasAlgoDt)
Start compute job (#439) * Wip start compute job * Wip select algorithm design * Asset selection form component, for start compute job (#442) * prototype AssetSelection * assetselection styling * typing "fix" * put back file info icon * AssetSelection styling in context * update start job method, fixed algo select, and fixed option typing * compute logic update * add has previous orders for algo asset * fixed search algorithm assets in start compute form * fixed lint errors * updated previous order for algo logic and compute flow * update use price hook and added buy DT for algo * display only alg of type exchange and sort by value * display only trusted algo for asset if field is set * added logic for allow all published algorithms or no algorithms allowed * asset selection style & spacing tweaks * refactor get algorithms for compute and edit compute * fixed form options and more refactoring * new ButtonBuy component * shared component between consume/compute * dealing with various states: loading, previous orders, help text output * effect dependencies * move error output into toast * formik data flow refactor * ditch custom field change handler * fix initialValues * typed form data & validation * fixes multiple form validation issues along the way * isInitialValid → validateOnMount * metadata display tweaks * error feedback tweaks * oler assets checks, confeti on succes job, market fee on order, removed algo compute logic * more startJob logging * feedback & messaging changes * metadata display * return all algos, fixed & dynamic priced ones * fix DOM nesting * messaging updates * copy tweaks * check algorithm previous history for both acces and compute sercive types * handle start compute error * extra checks on start compute response * styling tweaks, fix toast UI errors * AssetSelection: empty screen, tweak min/max height * fix FRE issues on start compute * check is ordarable before start compute job * logging tweaks * disable eslint no-unused-vars rule for some Apollo code blocks * fix metadata editing for compute assets * consider dataset timeout for compute too Co-authored-by: Matthias Kretschmann <m@kretschmann.io>
2021-04-01 17:21:08 +02:00
}
async function setComputeFees(
providerData: ProviderComputeInitializeResults
): Promise<ProviderComputeInitializeResults> {
if (asset.accessDetails.validProviderFees) {
providerData.datasets[0].providerFee.providerFeeAmount = '0'
}
const providerFeeToken =
providerData?.datasets?.[0]?.providerFee?.providerFeeToken
const providerFeeAmount = asset.accessDetails.validProviderFees
? '0'
: providerData?.datasets?.[0]?.providerFee?.providerFeeAmount
const feeValidity = providerData?.datasets?.[0]?.providerFee?.validUntil
const feeAmount = await unitsToAmount(
!isSupportedOceanNetwork || !isAssetNetwork
? await getDummySigner(asset?.chainId)
: signer,
providerFeeToken,
providerFeeAmount
)
setProviderFeeAmount(feeAmount)
const datatoken = new Datatoken(await getDummySigner(asset?.chainId))
setProviderFeesSymbol(await datatoken.getSymbol(providerFeeToken))
const computeDuration = asset.accessDetails.validProviderFees
? asset.accessDetails.validProviderFees.validUntil
: (parseInt(feeValidity) - Math.floor(Date.now() / 1000)).toString()
setComputeValidUntil(computeDuration)
return providerData
}
async function setAlgoPrice(algoProviderFees: ProviderFees) {
if (
selectedAlgorithmAsset?.accessDetails?.addressOrId !== ZERO_ADDRESS &&
selectedAlgorithmAsset?.accessDetails?.type !== 'free' &&
algoProviderFees
) {
const algorithmOrderPriceAndFees = await getOrderPriceAndFees(
selectedAlgorithmAsset,
ZERO_ADDRESS,
Feature/wagmi (#1912) * wagmi + ethers + web3modal setup * refactor wallet components * fallback providers, more config * kick out useWeb3 * remove all useWeb3 imports * more web3.js usage removal * isAddress utils replacement * restore add token / add network * less accountId changes * web3 legacy tinkering, utils/web3 → utils/wallet * legacy web3 object for ocean.js * graph sync fix, remove custom network switching code * package updates, merge fixes * downgrade to ethers v5 * fix project id * switch to ConnectKit * connectkit theming * add existing chains to wagmi * rewrite getPaymentCollector() * kick out getPaymentCollector completely, use wagmi hooks instead * Revert "kick out getPaymentCollector completely, use wagmi hooks instead" This reverts commit 54c7d1ef1a2dec0b1575a685125ba78336b30f59. * switch getPaymentCollector * calcBaseInGivenDatatokensOut reorg * wip integrate ocean lib 3.0.0 * update orbis components to use wagmi instead of web hooks * more oceanjs integration updates * more refactors * fix build * update ocean lib * fix publish * fix order fixed rate * remove logs * debug and stop infinite cycle orbis connect * fix orbis dm connection * mock use network and fix some more tests * mock wagmi switch network * mock wagmi useProvider createClient and connectKit getDefaultClient * fix jest tests * try storybook fix * cleanups and bump ocean lib * fix order * bump lib to next.5 and add more modal style * bump ocean.js lib to 3.0.0 --------- Co-authored-by: Matthias Kretschmann <m@kretschmann.io>
2023-05-29 12:28:41 +02:00
signer,
algoProviderFees
)
if (!algorithmOrderPriceAndFees)
throw new Error('Error setting algorithm price and fees!')
setAlgoOrderPriceAndFees(algorithmOrderPriceAndFees)
}
}
async function setDatasetPrice(datasetProviderFees: ProviderFees) {
if (
asset?.accessDetails?.addressOrId !== ZERO_ADDRESS &&
asset?.accessDetails?.type !== 'free' &&
datasetProviderFees
) {
const datasetPriceAndFees = await getOrderPriceAndFees(
asset,
ZERO_ADDRESS,
Feature/wagmi (#1912) * wagmi + ethers + web3modal setup * refactor wallet components * fallback providers, more config * kick out useWeb3 * remove all useWeb3 imports * more web3.js usage removal * isAddress utils replacement * restore add token / add network * less accountId changes * web3 legacy tinkering, utils/web3 → utils/wallet * legacy web3 object for ocean.js * graph sync fix, remove custom network switching code * package updates, merge fixes * downgrade to ethers v5 * fix project id * switch to ConnectKit * connectkit theming * add existing chains to wagmi * rewrite getPaymentCollector() * kick out getPaymentCollector completely, use wagmi hooks instead * Revert "kick out getPaymentCollector completely, use wagmi hooks instead" This reverts commit 54c7d1ef1a2dec0b1575a685125ba78336b30f59. * switch getPaymentCollector * calcBaseInGivenDatatokensOut reorg * wip integrate ocean lib 3.0.0 * update orbis components to use wagmi instead of web hooks * more oceanjs integration updates * more refactors * fix build * update ocean lib * fix publish * fix order fixed rate * remove logs * debug and stop infinite cycle orbis connect * fix orbis dm connection * mock use network and fix some more tests * mock wagmi switch network * mock wagmi useProvider createClient and connectKit getDefaultClient * fix jest tests * try storybook fix * cleanups and bump ocean lib * fix order * bump lib to next.5 and add more modal style * bump ocean.js lib to 3.0.0 --------- Co-authored-by: Matthias Kretschmann <m@kretschmann.io>
2023-05-29 12:28:41 +02:00
signer,
datasetProviderFees
)
if (!datasetPriceAndFees)
throw new Error('Error setting dataset price and fees!')
setDatasetOrderPriceAndFees(datasetPriceAndFees)
}
}
async function initPriceAndFees() {
2022-06-23 12:38:03 +02:00
try {
const computeEnv = await getComputeEnviroment(asset)
if (!computeEnv || !computeEnv.id)
throw new Error(`Error getting compute environments!`)
setComputeEnv(computeEnv)
const initializedProvider = await initializeProviderForCompute(
asset,
selectedAlgorithmAsset,
accountId || ZERO_ADDRESS, // if the user is not connected, we use ZERO_ADDRESS as accountId
2022-06-23 12:38:03 +02:00
computeEnv
)
2022-06-23 12:38:03 +02:00
if (
!initializedProvider ||
!initializedProvider?.datasets ||
!initializedProvider?.algorithm
)
2022-06-23 12:38:03 +02:00
throw new Error(`Error initializing provider for the compute job!`)
setComputeStatusText(
getComputeFeedback(
asset.accessDetails?.baseToken?.symbol,
asset.accessDetails?.datatoken?.symbol,
asset.metadata.type
)[0]
Release candidate 09-01-2023 (#1843) * Avoiding getInitialPaymentCollector failure (#1816) * early return is no web3 or ddo * Creating test for MetaFull * adding test: src/components/Asset/AssetContent/MetaSecondary.test.tsx * Adding test for bookmarks * Adding test for displaying payment collector * Removing comments * Renaming assetAquarius * Renaming assetWithAccessDetails * Ensuring that the payment collector is shown even without a wallet connected * Removing broken test * Using getDummyWeb3 for fetching the payment collector address * google validation (#1835) * Updating validation to exclude any google link * Updating Yup validation * Checking if domain includes google.com * Updating isGoogleUrl function * Moving isGoogleUrl into @utils/url/index file * isGoogleUrl function * Updating tests * Adding additional tests for other google domains * Updating tests * Updating isGoogleUrl file path * Updating pricing message (#1842) * Bump @storybook/addon-essentials from 6.5.13 to 6.5.15 (#1841) Bumps [@storybook/addon-essentials](https://github.com/storybookjs/storybook/tree/HEAD/addons/essentials) from 6.5.13 to 6.5.15. - [Release notes](https://github.com/storybookjs/storybook/releases) - [Changelog](https://github.com/storybookjs/storybook/blob/v6.5.15/CHANGELOG.md) - [Commits](https://github.com/storybookjs/storybook/commits/v6.5.15/addons/essentials) --- updated-dependencies: - dependency-name: "@storybook/addon-essentials" dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bump @types/jest from 29.2.3 to 29.2.5 (#1840) Bumps [@types/jest](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/jest) from 29.2.3 to 29.2.5. - [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases) - [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/jest) --- updated-dependencies: - dependency-name: "@types/jest" dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bump prettier from 2.8.0 to 2.8.1 (#1837) Bumps [prettier](https://github.com/prettier/prettier) from 2.8.0 to 2.8.1. - [Release notes](https://github.com/prettier/prettier/releases) - [Changelog](https://github.com/prettier/prettier/blob/main/CHANGELOG.md) - [Commits](https://github.com/prettier/prettier/compare/2.8.0...2.8.1) --- updated-dependencies: - dependency-name: prettier dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bump react-select from 5.6.1 to 5.7.0 (#1839) Bumps [react-select](https://github.com/JedWatson/react-select) from 5.6.1 to 5.7.0. - [Release notes](https://github.com/JedWatson/react-select/releases) - [Changelog](https://github.com/JedWatson/react-select/blob/master/docs/CHANGELOG.md) - [Commits](https://github.com/JedWatson/react-select/compare/react-select@5.6.1...react-select@5.7.0) --- updated-dependencies: - dependency-name: react-select dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bump react-tabs from 5.1.0 to 6.0.0 (#1838) Bumps [react-tabs](https://github.com/reactjs/react-tabs) from 5.1.0 to 6.0.0. - [Release notes](https://github.com/reactjs/react-tabs/releases) - [Commits](https://github.com/reactjs/react-tabs/compare/v5.1.0...v6.0.0) --- updated-dependencies: - dependency-name: react-tabs dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com> Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * fix asset route (#1836) * updating the buy button message for free assets * Updating pricing text for compute and algorithms * Updating tests * Adding a seperate sentence about paying gas fees for network charges with free assets * Fixing tests Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: mihaisc <mihai.scarlat@smartcontrol.ro> * Showing hosting type in File Info (#1846) * Bump @storybook/addon-essentials from 6.5.13 to 6.5.15 (#1841) Bumps [@storybook/addon-essentials](https://github.com/storybookjs/storybook/tree/HEAD/addons/essentials) from 6.5.13 to 6.5.15. - [Release notes](https://github.com/storybookjs/storybook/releases) - [Changelog](https://github.com/storybookjs/storybook/blob/v6.5.15/CHANGELOG.md) - [Commits](https://github.com/storybookjs/storybook/commits/v6.5.15/addons/essentials) --- updated-dependencies: - dependency-name: "@storybook/addon-essentials" dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bump @types/jest from 29.2.3 to 29.2.5 (#1840) Bumps [@types/jest](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/jest) from 29.2.3 to 29.2.5. - [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases) - [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/jest) --- updated-dependencies: - dependency-name: "@types/jest" dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bump prettier from 2.8.0 to 2.8.1 (#1837) Bumps [prettier](https://github.com/prettier/prettier) from 2.8.0 to 2.8.1. - [Release notes](https://github.com/prettier/prettier/releases) - [Changelog](https://github.com/prettier/prettier/blob/main/CHANGELOG.md) - [Commits](https://github.com/prettier/prettier/compare/2.8.0...2.8.1) --- updated-dependencies: - dependency-name: prettier dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bump react-select from 5.6.1 to 5.7.0 (#1839) Bumps [react-select](https://github.com/JedWatson/react-select) from 5.6.1 to 5.7.0. - [Release notes](https://github.com/JedWatson/react-select/releases) - [Changelog](https://github.com/JedWatson/react-select/blob/master/docs/CHANGELOG.md) - [Commits](https://github.com/JedWatson/react-select/compare/react-select@5.6.1...react-select@5.7.0) --- updated-dependencies: - dependency-name: react-select dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bump react-tabs from 5.1.0 to 6.0.0 (#1838) Bumps [react-tabs](https://github.com/reactjs/react-tabs) from 5.1.0 to 6.0.0. - [Release notes](https://github.com/reactjs/react-tabs/releases) - [Commits](https://github.com/reactjs/react-tabs/compare/v5.1.0...v6.0.0) --- updated-dependencies: - dependency-name: react-tabs dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com> Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * fix asset route (#1836) * Adding hosting type to the file info component * Writting smart contract hosting type across two lines Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: mihaisc <mihai.scarlat@smartcontrol.ro> * add initial price value for not supported price assets (#1851) * Fix compute basetoken issue (#1829) * fix lint * add dynamic provider fees * fixes * cleanup and more fixes * bump oceanlib to 2.6.0 * fix 404 styling (#1850) * Fixing the z-index for the tippy component (#1858) * Removing infinite approval (#1857) * Removing infinite approvals * Removing infinite approval content message * Removing infinite approval from default user preferences Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: mihaisc <mihai.scarlat@smartcontrol.ro> Co-authored-by: Bogdan Fazakas <bogdan.fazakas@gmail.com> Co-authored-by: EnzoVezzaro <enzo-vezzaro@live.it>
2023-01-18 11:35:14 +01:00
)
await setDatasetPrice(initializedProvider?.datasets?.[0]?.providerFee)
setComputeStatusText(
getComputeFeedback(
selectedAlgorithmAsset?.accessDetails?.baseToken?.symbol,
selectedAlgorithmAsset?.accessDetails?.datatoken?.symbol,
selectedAlgorithmAsset?.metadata?.type
)[0]
Release candidate 09-01-2023 (#1843) * Avoiding getInitialPaymentCollector failure (#1816) * early return is no web3 or ddo * Creating test for MetaFull * adding test: src/components/Asset/AssetContent/MetaSecondary.test.tsx * Adding test for bookmarks * Adding test for displaying payment collector * Removing comments * Renaming assetAquarius * Renaming assetWithAccessDetails * Ensuring that the payment collector is shown even without a wallet connected * Removing broken test * Using getDummyWeb3 for fetching the payment collector address * google validation (#1835) * Updating validation to exclude any google link * Updating Yup validation * Checking if domain includes google.com * Updating isGoogleUrl function * Moving isGoogleUrl into @utils/url/index file * isGoogleUrl function * Updating tests * Adding additional tests for other google domains * Updating tests * Updating isGoogleUrl file path * Updating pricing message (#1842) * Bump @storybook/addon-essentials from 6.5.13 to 6.5.15 (#1841) Bumps [@storybook/addon-essentials](https://github.com/storybookjs/storybook/tree/HEAD/addons/essentials) from 6.5.13 to 6.5.15. - [Release notes](https://github.com/storybookjs/storybook/releases) - [Changelog](https://github.com/storybookjs/storybook/blob/v6.5.15/CHANGELOG.md) - [Commits](https://github.com/storybookjs/storybook/commits/v6.5.15/addons/essentials) --- updated-dependencies: - dependency-name: "@storybook/addon-essentials" dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bump @types/jest from 29.2.3 to 29.2.5 (#1840) Bumps [@types/jest](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/jest) from 29.2.3 to 29.2.5. - [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases) - [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/jest) --- updated-dependencies: - dependency-name: "@types/jest" dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bump prettier from 2.8.0 to 2.8.1 (#1837) Bumps [prettier](https://github.com/prettier/prettier) from 2.8.0 to 2.8.1. - [Release notes](https://github.com/prettier/prettier/releases) - [Changelog](https://github.com/prettier/prettier/blob/main/CHANGELOG.md) - [Commits](https://github.com/prettier/prettier/compare/2.8.0...2.8.1) --- updated-dependencies: - dependency-name: prettier dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bump react-select from 5.6.1 to 5.7.0 (#1839) Bumps [react-select](https://github.com/JedWatson/react-select) from 5.6.1 to 5.7.0. - [Release notes](https://github.com/JedWatson/react-select/releases) - [Changelog](https://github.com/JedWatson/react-select/blob/master/docs/CHANGELOG.md) - [Commits](https://github.com/JedWatson/react-select/compare/react-select@5.6.1...react-select@5.7.0) --- updated-dependencies: - dependency-name: react-select dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bump react-tabs from 5.1.0 to 6.0.0 (#1838) Bumps [react-tabs](https://github.com/reactjs/react-tabs) from 5.1.0 to 6.0.0. - [Release notes](https://github.com/reactjs/react-tabs/releases) - [Commits](https://github.com/reactjs/react-tabs/compare/v5.1.0...v6.0.0) --- updated-dependencies: - dependency-name: react-tabs dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com> Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * fix asset route (#1836) * updating the buy button message for free assets * Updating pricing text for compute and algorithms * Updating tests * Adding a seperate sentence about paying gas fees for network charges with free assets * Fixing tests Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: mihaisc <mihai.scarlat@smartcontrol.ro> * Showing hosting type in File Info (#1846) * Bump @storybook/addon-essentials from 6.5.13 to 6.5.15 (#1841) Bumps [@storybook/addon-essentials](https://github.com/storybookjs/storybook/tree/HEAD/addons/essentials) from 6.5.13 to 6.5.15. - [Release notes](https://github.com/storybookjs/storybook/releases) - [Changelog](https://github.com/storybookjs/storybook/blob/v6.5.15/CHANGELOG.md) - [Commits](https://github.com/storybookjs/storybook/commits/v6.5.15/addons/essentials) --- updated-dependencies: - dependency-name: "@storybook/addon-essentials" dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bump @types/jest from 29.2.3 to 29.2.5 (#1840) Bumps [@types/jest](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/jest) from 29.2.3 to 29.2.5. - [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases) - [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/jest) --- updated-dependencies: - dependency-name: "@types/jest" dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bump prettier from 2.8.0 to 2.8.1 (#1837) Bumps [prettier](https://github.com/prettier/prettier) from 2.8.0 to 2.8.1. - [Release notes](https://github.com/prettier/prettier/releases) - [Changelog](https://github.com/prettier/prettier/blob/main/CHANGELOG.md) - [Commits](https://github.com/prettier/prettier/compare/2.8.0...2.8.1) --- updated-dependencies: - dependency-name: prettier dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bump react-select from 5.6.1 to 5.7.0 (#1839) Bumps [react-select](https://github.com/JedWatson/react-select) from 5.6.1 to 5.7.0. - [Release notes](https://github.com/JedWatson/react-select/releases) - [Changelog](https://github.com/JedWatson/react-select/blob/master/docs/CHANGELOG.md) - [Commits](https://github.com/JedWatson/react-select/compare/react-select@5.6.1...react-select@5.7.0) --- updated-dependencies: - dependency-name: react-select dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bump react-tabs from 5.1.0 to 6.0.0 (#1838) Bumps [react-tabs](https://github.com/reactjs/react-tabs) from 5.1.0 to 6.0.0. - [Release notes](https://github.com/reactjs/react-tabs/releases) - [Commits](https://github.com/reactjs/react-tabs/compare/v5.1.0...v6.0.0) --- updated-dependencies: - dependency-name: react-tabs dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com> Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * fix asset route (#1836) * Adding hosting type to the file info component * Writting smart contract hosting type across two lines Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: mihaisc <mihai.scarlat@smartcontrol.ro> * add initial price value for not supported price assets (#1851) * Fix compute basetoken issue (#1829) * fix lint * add dynamic provider fees * fixes * cleanup and more fixes * bump oceanlib to 2.6.0 * fix 404 styling (#1850) * Fixing the z-index for the tippy component (#1858) * Removing infinite approval (#1857) * Removing infinite approvals * Removing infinite approval content message * Removing infinite approval from default user preferences Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: mihaisc <mihai.scarlat@smartcontrol.ro> Co-authored-by: Bogdan Fazakas <bogdan.fazakas@gmail.com> Co-authored-by: EnzoVezzaro <enzo-vezzaro@live.it>
2023-01-18 11:35:14 +01:00
)
await setAlgoPrice(initializedProvider?.algorithm?.providerFee)
const sanitizedResponse = await setComputeFees(initializedProvider)
setInitializedProviderResponse(sanitizedResponse)
2022-06-23 12:38:03 +02:00
} catch (error) {
setError(error.message)
LoggerInstance.error(`[compute] ${error.message} `)
}
}
useEffect(() => {
2022-08-02 11:53:22 +02:00
if (!asset?.accessDetails || !accountId || isUnsupportedPricing) return
setIsConsumablePrice(asset?.accessDetails?.isPurchasable)
setValidOrderTx(asset?.accessDetails?.validOrderTx)
2022-08-02 11:53:22 +02:00
}, [asset?.accessDetails, accountId, isUnsupportedPricing])
useEffect(() => {
if (!selectedAlgorithmAsset?.accessDetails) return
2022-05-17 10:20:19 +02:00
setIsRequestingAlgoOrderPrice(true)
setIsConsumableAlgorithmPrice(
selectedAlgorithmAsset?.accessDetails?.isPurchasable
)
setValidAlgorithmOrderTx(
selectedAlgorithmAsset?.accessDetails?.validOrderTx
)
setAlgoOrderPriceAndFees(null)
async function initSelectedAlgo() {
await checkAssetDTBalance(selectedAlgorithmAsset)
await initPriceAndFees()
2022-05-17 10:20:19 +02:00
setIsRequestingAlgoOrderPrice(false)
}
initSelectedAlgo()
}, [selectedAlgorithmAsset, accountId])
Start compute job (#439) * Wip start compute job * Wip select algorithm design * Asset selection form component, for start compute job (#442) * prototype AssetSelection * assetselection styling * typing "fix" * put back file info icon * AssetSelection styling in context * update start job method, fixed algo select, and fixed option typing * compute logic update * add has previous orders for algo asset * fixed search algorithm assets in start compute form * fixed lint errors * updated previous order for algo logic and compute flow * update use price hook and added buy DT for algo * display only alg of type exchange and sort by value * display only trusted algo for asset if field is set * added logic for allow all published algorithms or no algorithms allowed * asset selection style & spacing tweaks * refactor get algorithms for compute and edit compute * fixed form options and more refactoring * new ButtonBuy component * shared component between consume/compute * dealing with various states: loading, previous orders, help text output * effect dependencies * move error output into toast * formik data flow refactor * ditch custom field change handler * fix initialValues * typed form data & validation * fixes multiple form validation issues along the way * isInitialValid → validateOnMount * metadata display tweaks * error feedback tweaks * oler assets checks, confeti on succes job, market fee on order, removed algo compute logic * more startJob logging * feedback & messaging changes * metadata display * return all algos, fixed & dynamic priced ones * fix DOM nesting * messaging updates * copy tweaks * check algorithm previous history for both acces and compute sercive types * handle start compute error * extra checks on start compute response * styling tweaks, fix toast UI errors * AssetSelection: empty screen, tweak min/max height * fix FRE issues on start compute * check is ordarable before start compute job * logging tweaks * disable eslint no-unused-vars rule for some Apollo code blocks * fix metadata editing for compute assets * consider dataset timeout for compute too Co-authored-by: Matthias Kretschmann <m@kretschmann.io>
2021-04-01 17:21:08 +02:00
useEffect(() => {
2022-08-02 11:53:22 +02:00
if (!asset?.accessDetails || isUnsupportedPricing) return
2022-02-10 15:33:16 +01:00
getAlgorithmsForAsset(asset, newCancelToken()).then((algorithmsAssets) => {
setDdoAlgorithmList(algorithmsAssets)
2022-02-28 13:56:13 +01:00
getAlgorithmAssetSelectionList(asset, algorithmsAssets).then(
(algorithmSelectionList) => {
setAlgorithmList(algorithmSelectionList)
}
)
Start compute job (#439) * Wip start compute job * Wip select algorithm design * Asset selection form component, for start compute job (#442) * prototype AssetSelection * assetselection styling * typing "fix" * put back file info icon * AssetSelection styling in context * update start job method, fixed algo select, and fixed option typing * compute logic update * add has previous orders for algo asset * fixed search algorithm assets in start compute form * fixed lint errors * updated previous order for algo logic and compute flow * update use price hook and added buy DT for algo * display only alg of type exchange and sort by value * display only trusted algo for asset if field is set * added logic for allow all published algorithms or no algorithms allowed * asset selection style & spacing tweaks * refactor get algorithms for compute and edit compute * fixed form options and more refactoring * new ButtonBuy component * shared component between consume/compute * dealing with various states: loading, previous orders, help text output * effect dependencies * move error output into toast * formik data flow refactor * ditch custom field change handler * fix initialValues * typed form data & validation * fixes multiple form validation issues along the way * isInitialValid → validateOnMount * metadata display tweaks * error feedback tweaks * oler assets checks, confeti on succes job, market fee on order, removed algo compute logic * more startJob logging * feedback & messaging changes * metadata display * return all algos, fixed & dynamic priced ones * fix DOM nesting * messaging updates * copy tweaks * check algorithm previous history for both acces and compute sercive types * handle start compute error * extra checks on start compute response * styling tweaks, fix toast UI errors * AssetSelection: empty screen, tweak min/max height * fix FRE issues on start compute * check is ordarable before start compute job * logging tweaks * disable eslint no-unused-vars rule for some Apollo code blocks * fix metadata editing for compute assets * consider dataset timeout for compute too Co-authored-by: Matthias Kretschmann <m@kretschmann.io>
2021-04-01 17:21:08 +02:00
})
2022-08-02 11:53:22 +02:00
}, [asset, isUnsupportedPricing])
Start compute job (#439) * Wip start compute job * Wip select algorithm design * Asset selection form component, for start compute job (#442) * prototype AssetSelection * assetselection styling * typing "fix" * put back file info icon * AssetSelection styling in context * update start job method, fixed algo select, and fixed option typing * compute logic update * add has previous orders for algo asset * fixed search algorithm assets in start compute form * fixed lint errors * updated previous order for algo logic and compute flow * update use price hook and added buy DT for algo * display only alg of type exchange and sort by value * display only trusted algo for asset if field is set * added logic for allow all published algorithms or no algorithms allowed * asset selection style & spacing tweaks * refactor get algorithms for compute and edit compute * fixed form options and more refactoring * new ButtonBuy component * shared component between consume/compute * dealing with various states: loading, previous orders, help text output * effect dependencies * move error output into toast * formik data flow refactor * ditch custom field change handler * fix initialValues * typed form data & validation * fixes multiple form validation issues along the way * isInitialValid → validateOnMount * metadata display tweaks * error feedback tweaks * oler assets checks, confeti on succes job, market fee on order, removed algo compute logic * more startJob logging * feedback & messaging changes * metadata display * return all algos, fixed & dynamic priced ones * fix DOM nesting * messaging updates * copy tweaks * check algorithm previous history for both acces and compute sercive types * handle start compute error * extra checks on start compute response * styling tweaks, fix toast UI errors * AssetSelection: empty screen, tweak min/max height * fix FRE issues on start compute * check is ordarable before start compute job * logging tweaks * disable eslint no-unused-vars rule for some Apollo code blocks * fix metadata editing for compute assets * consider dataset timeout for compute too Co-authored-by: Matthias Kretschmann <m@kretschmann.io>
2021-04-01 17:21:08 +02:00
const fetchJobs = useCallback(
async (type: string) => {
if (!chainIds || chainIds.length === 0 || !accountId) {
return
}
try {
type === 'init' && setIsLoadingJobs(true)
const computeJobs = await getComputeJobs(
[asset?.chainId] || chainIds,
accountId,
asset,
newCancelToken()
)
setJobs(computeJobs.computeJobs)
setIsLoadingJobs(!computeJobs.isLoaded)
} catch (error) {
LoggerInstance.error(error.message)
setIsLoadingJobs(false)
}
},
[accountId, asset, chainIds, isLoadingJobs, newCancelToken]
)
useEffect(() => {
fetchJobs('init')
// init periodic refresh for jobs
const balanceInterval = setInterval(
() => fetchJobs('repeat'),
refreshInterval
)
return () => {
clearInterval(balanceInterval)
}
}, [refetchJobs])
// Output errors in toast UI
Start compute job (#439) * Wip start compute job * Wip select algorithm design * Asset selection form component, for start compute job (#442) * prototype AssetSelection * assetselection styling * typing "fix" * put back file info icon * AssetSelection styling in context * update start job method, fixed algo select, and fixed option typing * compute logic update * add has previous orders for algo asset * fixed search algorithm assets in start compute form * fixed lint errors * updated previous order for algo logic and compute flow * update use price hook and added buy DT for algo * display only alg of type exchange and sort by value * display only trusted algo for asset if field is set * added logic for allow all published algorithms or no algorithms allowed * asset selection style & spacing tweaks * refactor get algorithms for compute and edit compute * fixed form options and more refactoring * new ButtonBuy component * shared component between consume/compute * dealing with various states: loading, previous orders, help text output * effect dependencies * move error output into toast * formik data flow refactor * ditch custom field change handler * fix initialValues * typed form data & validation * fixes multiple form validation issues along the way * isInitialValid → validateOnMount * metadata display tweaks * error feedback tweaks * oler assets checks, confeti on succes job, market fee on order, removed algo compute logic * more startJob logging * feedback & messaging changes * metadata display * return all algos, fixed & dynamic priced ones * fix DOM nesting * messaging updates * copy tweaks * check algorithm previous history for both acces and compute sercive types * handle start compute error * extra checks on start compute response * styling tweaks, fix toast UI errors * AssetSelection: empty screen, tweak min/max height * fix FRE issues on start compute * check is ordarable before start compute job * logging tweaks * disable eslint no-unused-vars rule for some Apollo code blocks * fix metadata editing for compute assets * consider dataset timeout for compute too Co-authored-by: Matthias Kretschmann <m@kretschmann.io>
2021-04-01 17:21:08 +02:00
useEffect(() => {
const newError = error
if (!newError) return
const errorMsg = newError + '. Please retry.'
toast.error(errorMsg)
}, [error])
Start compute job (#439) * Wip start compute job * Wip select algorithm design * Asset selection form component, for start compute job (#442) * prototype AssetSelection * assetselection styling * typing "fix" * put back file info icon * AssetSelection styling in context * update start job method, fixed algo select, and fixed option typing * compute logic update * add has previous orders for algo asset * fixed search algorithm assets in start compute form * fixed lint errors * updated previous order for algo logic and compute flow * update use price hook and added buy DT for algo * display only alg of type exchange and sort by value * display only trusted algo for asset if field is set * added logic for allow all published algorithms or no algorithms allowed * asset selection style & spacing tweaks * refactor get algorithms for compute and edit compute * fixed form options and more refactoring * new ButtonBuy component * shared component between consume/compute * dealing with various states: loading, previous orders, help text output * effect dependencies * move error output into toast * formik data flow refactor * ditch custom field change handler * fix initialValues * typed form data & validation * fixes multiple form validation issues along the way * isInitialValid → validateOnMount * metadata display tweaks * error feedback tweaks * oler assets checks, confeti on succes job, market fee on order, removed algo compute logic * more startJob logging * feedback & messaging changes * metadata display * return all algos, fixed & dynamic priced ones * fix DOM nesting * messaging updates * copy tweaks * check algorithm previous history for both acces and compute sercive types * handle start compute error * extra checks on start compute response * styling tweaks, fix toast UI errors * AssetSelection: empty screen, tweak min/max height * fix FRE issues on start compute * check is ordarable before start compute job * logging tweaks * disable eslint no-unused-vars rule for some Apollo code blocks * fix metadata editing for compute assets * consider dataset timeout for compute too Co-authored-by: Matthias Kretschmann <m@kretschmann.io>
2021-04-01 17:21:08 +02:00
Feat: Consumer Parameters (#1921) * feat: add consumer parameters to publish * fix: publish form validation * feat: update consumer parameters form * feat: add consumer parameter types * feat: update consumer parameter validation * feat: add consumer parameters structure * feat: add InputOptions error handling * feat: update consumer parameters validation * feat: update transformPublishFromToDdo * feat: add default options to parameter options * fix: value handling for select and mutliselect * feat: update "add new parameter" button label * feat: remove unused publish form sections * chore: remove console.log * chore: remove comments * feat: remove multiselect * feat: add consumer parameters section label * feat: update types * feat: update edit form fields * feat: parse consumer parameters in edit form * feat: add consumer parameters field to edit * feat: transform consumer parameters values before edit * feat: update "required" type to select * feat: update "required" type to select on edit form * fix: error object access * fix: edit flow crash * fix: validation when consumer parameters are not selected * feat: update validation for default consumer parameters value * fix: types * feat: add service consumer parameters to publish form * chore: remove console.log * feat: add service consumer parameters edit * chore: remove comments * fix: form edit metadata types * feat: add consume algo parameter structure * feat: consumer parameter required default value condition * feat: add consumer parameter groups to assetActions * fix: consumer parameters grouping * feat: update consumer parameters alignment * feat: update types * feat: allow service consumer parameters on dataset asset type * feat: add consumer parameters to ddo updated values in edit form * feat: add "data service" consumer parameters to consumption form * feat: allow service parameters on all asset types * feat: update parameter consume form design * feat: update asset actions consume parameters location * feat: add service parameters to download assets * refactor: consumer parameters actions * refactor: form action name * refactor: consumer parameters default input * refactor: consumer parameters select input * refactor: consumer parameter input * fix: props name * refactor: variable naming * refactor: consumer parameters form validation * refactor: rename consumer parameters types * refactor: extract consumer parameters form data to separate file * refactor: rename type * feat: controlled tabs for consumer params * feat: restore default value as required * refactor: parse values before edit * feat: add form to handle consumer parameters consumption * feat: send consumer params with download request * feat: send consumer params with compute request * feat: handle compute form initialization * chore: remove unused dependency * feat: handle download form data initialization * chore: remove console.log * feat: update types * fix: consumer parameter value types * feat: update ConsumerParameter type * feat: update ConsumerParameter type * chore: add comments * refactor: consumer parameters inputs * refactor: rename data and algo service params * refactor: consumer parameters form * refactor: consumer parameter form styling * refactor: make headers input reusable as KeyValueInput * refactor: refactorings, reduce duplication (WIP) * refactor: usercustomparameters consumption form creation/validation * refactor: return undefined consistently if property path not found on object * refactor: reuse fieldType and fieldOptions in DefaultInput * fix: parse ddo consumer parameters for edit form * fix: asset view crash for assets w/o consumer params * fix: publish preview for assets with no consumer params * fix: revert accidential rename of algoService * fix: revert publish navigation padding change * feat: update consumer parameters' labels and helpers * fix: consumer parameters validation * feat: update consumer parameter helper wording * chore: merge conflicts * feat: update types * fix: validate form on consumer parameter deletion * feat: add key value input placeholder props * fix: handle boolean type consumer parameters in consume form (#38) * Update src/components/Publish/_validation.ts Co-authored-by: Jamie Hewitt <jamie.hewitt15@gmail.com> * Update src/components/Asset/AssetActions/ConsumerParameters/FormConsumerParameters.module.css Co-authored-by: Jamie Hewitt <jamie.hewitt15@gmail.com> * Update src/components/Asset/Edit/_validation.ts Co-authored-by: Jamie Hewitt <jamie.hewitt15@gmail.com> * Update src/components/Asset/AssetActions/ConsumerParameters/index.tsx Co-authored-by: Jamie Hewitt <jamie.hewitt15@gmail.com> * Update src/components/Asset/AssetActions/ConsumerParameters/FormConsumerParameters.tsx Co-authored-by: Jamie Hewitt <jamie.hewitt15@gmail.com> * Update src/components/@shared/FormInput/index.tsx Co-authored-by: Jamie Hewitt <jamie.hewitt15@gmail.com> * Update src/components/@shared/FormInput/InputElement/ConsumerParameters/index.tsx Co-authored-by: Jamie Hewitt <jamie.hewitt15@gmail.com> * Update src/components/@shared/FormInput/InputElement/ConsumerParameters/index.tsx Co-authored-by: Jamie Hewitt <jamie.hewitt15@gmail.com> * Update src/components/@shared/FormInput/InputElement/ConsumerParameters/OptionsInput.tsx Co-authored-by: Jamie Hewitt <jamie.hewitt15@gmail.com> * Update src/components/@shared/FormInput/InputElement/ConsumerParameters/FormActions.tsx Co-authored-by: Jamie Hewitt <jamie.hewitt15@gmail.com> * Update src/@utils/provider.ts Co-authored-by: Jamie Hewitt <jamie.hewitt15@gmail.com> * fix: import paths * refactor: add consumer parameters validation types * feat: add string length min/max to consumer parameters validation * feat: add cp description to consume form * feat: reduce character limit in CP tab title * feat: update CP fields' placeholders and helpers * fix: show only relevant CPs in asset actions --------- Co-authored-by: Luca Milanese <luca.milanese90@gmail.com> Co-authored-by: Jamie Hewitt <jamie.hewitt15@gmail.com>
2023-09-07 16:14:27 +02:00
async function startJob(userCustomParameters: {
dataServiceParams?: UserCustomParameters
algoServiceParams?: UserCustomParameters
algoParams?: UserCustomParameters
}): Promise<void> {
try {
2022-06-22 14:40:35 +02:00
setIsOrdering(true)
2022-06-22 16:16:28 +02:00
setIsOrdered(false)
setError(undefined)
const computeService = getServiceByName(asset, 'compute')
const computeAlgorithm: ComputeAlgorithm = {
documentId: selectedAlgorithmAsset.id,
Feat: Consumer Parameters (#1921) * feat: add consumer parameters to publish * fix: publish form validation * feat: update consumer parameters form * feat: add consumer parameter types * feat: update consumer parameter validation * feat: add consumer parameters structure * feat: add InputOptions error handling * feat: update consumer parameters validation * feat: update transformPublishFromToDdo * feat: add default options to parameter options * fix: value handling for select and mutliselect * feat: update "add new parameter" button label * feat: remove unused publish form sections * chore: remove console.log * chore: remove comments * feat: remove multiselect * feat: add consumer parameters section label * feat: update types * feat: update edit form fields * feat: parse consumer parameters in edit form * feat: add consumer parameters field to edit * feat: transform consumer parameters values before edit * feat: update "required" type to select * feat: update "required" type to select on edit form * fix: error object access * fix: edit flow crash * fix: validation when consumer parameters are not selected * feat: update validation for default consumer parameters value * fix: types * feat: add service consumer parameters to publish form * chore: remove console.log * feat: add service consumer parameters edit * chore: remove comments * fix: form edit metadata types * feat: add consume algo parameter structure * feat: consumer parameter required default value condition * feat: add consumer parameter groups to assetActions * fix: consumer parameters grouping * feat: update consumer parameters alignment * feat: update types * feat: allow service consumer parameters on dataset asset type * feat: add consumer parameters to ddo updated values in edit form * feat: add "data service" consumer parameters to consumption form * feat: allow service parameters on all asset types * feat: update parameter consume form design * feat: update asset actions consume parameters location * feat: add service parameters to download assets * refactor: consumer parameters actions * refactor: form action name * refactor: consumer parameters default input * refactor: consumer parameters select input * refactor: consumer parameter input * fix: props name * refactor: variable naming * refactor: consumer parameters form validation * refactor: rename consumer parameters types * refactor: extract consumer parameters form data to separate file * refactor: rename type * feat: controlled tabs for consumer params * feat: restore default value as required * refactor: parse values before edit * feat: add form to handle consumer parameters consumption * feat: send consumer params with download request * feat: send consumer params with compute request * feat: handle compute form initialization * chore: remove unused dependency * feat: handle download form data initialization * chore: remove console.log * feat: update types * fix: consumer parameter value types * feat: update ConsumerParameter type * feat: update ConsumerParameter type * chore: add comments * refactor: consumer parameters inputs * refactor: rename data and algo service params * refactor: consumer parameters form * refactor: consumer parameter form styling * refactor: make headers input reusable as KeyValueInput * refactor: refactorings, reduce duplication (WIP) * refactor: usercustomparameters consumption form creation/validation * refactor: return undefined consistently if property path not found on object * refactor: reuse fieldType and fieldOptions in DefaultInput * fix: parse ddo consumer parameters for edit form * fix: asset view crash for assets w/o consumer params * fix: publish preview for assets with no consumer params * fix: revert accidential rename of algoService * fix: revert publish navigation padding change * feat: update consumer parameters' labels and helpers * fix: consumer parameters validation * feat: update consumer parameter helper wording * chore: merge conflicts * feat: update types * fix: validate form on consumer parameter deletion * feat: add key value input placeholder props * fix: handle boolean type consumer parameters in consume form (#38) * Update src/components/Publish/_validation.ts Co-authored-by: Jamie Hewitt <jamie.hewitt15@gmail.com> * Update src/components/Asset/AssetActions/ConsumerParameters/FormConsumerParameters.module.css Co-authored-by: Jamie Hewitt <jamie.hewitt15@gmail.com> * Update src/components/Asset/Edit/_validation.ts Co-authored-by: Jamie Hewitt <jamie.hewitt15@gmail.com> * Update src/components/Asset/AssetActions/ConsumerParameters/index.tsx Co-authored-by: Jamie Hewitt <jamie.hewitt15@gmail.com> * Update src/components/Asset/AssetActions/ConsumerParameters/FormConsumerParameters.tsx Co-authored-by: Jamie Hewitt <jamie.hewitt15@gmail.com> * Update src/components/@shared/FormInput/index.tsx Co-authored-by: Jamie Hewitt <jamie.hewitt15@gmail.com> * Update src/components/@shared/FormInput/InputElement/ConsumerParameters/index.tsx Co-authored-by: Jamie Hewitt <jamie.hewitt15@gmail.com> * Update src/components/@shared/FormInput/InputElement/ConsumerParameters/index.tsx Co-authored-by: Jamie Hewitt <jamie.hewitt15@gmail.com> * Update src/components/@shared/FormInput/InputElement/ConsumerParameters/OptionsInput.tsx Co-authored-by: Jamie Hewitt <jamie.hewitt15@gmail.com> * Update src/components/@shared/FormInput/InputElement/ConsumerParameters/FormActions.tsx Co-authored-by: Jamie Hewitt <jamie.hewitt15@gmail.com> * Update src/@utils/provider.ts Co-authored-by: Jamie Hewitt <jamie.hewitt15@gmail.com> * fix: import paths * refactor: add consumer parameters validation types * feat: add string length min/max to consumer parameters validation * feat: add cp description to consume form * feat: reduce character limit in CP tab title * feat: update CP fields' placeholders and helpers * fix: show only relevant CPs in asset actions --------- Co-authored-by: Luca Milanese <luca.milanese90@gmail.com> Co-authored-by: Jamie Hewitt <jamie.hewitt15@gmail.com>
2023-09-07 16:14:27 +02:00
serviceId: selectedAlgorithmAsset.services[0].id,
algocustomdata: userCustomParameters?.algoParams,
userdata: userCustomParameters?.algoServiceParams
}
const allowed = await isOrderable(
asset,
computeService.id,
computeAlgorithm,
selectedAlgorithmAsset
)
2022-08-15 15:57:53 +02:00
LoggerInstance.log('[compute] Is dataset orderable?', allowed)
2022-06-23 12:38:03 +02:00
if (!allowed)
throw new Error(
2022-08-15 15:57:53 +02:00
'Dataset is not orderable in combination with selected algorithm.'
)
await initPriceAndFees()
2022-06-23 12:38:03 +02:00
2022-05-16 06:57:48 +02:00
setComputeStatusText(
getComputeFeedback(
2022-05-16 07:08:15 +02:00
selectedAlgorithmAsset.accessDetails.baseToken?.symbol,
selectedAlgorithmAsset.accessDetails.datatoken?.symbol,
selectedAlgorithmAsset.metadata.type
2022-08-02 11:53:22 +02:00
)[selectedAlgorithmAsset.accessDetails?.type === 'fixed' ? 2 : 3]
2022-05-16 06:57:48 +02:00
)
2022-05-12 13:39:14 +02:00
const algorithmOrderTx = await handleComputeOrder(
Feature/wagmi (#1912) * wagmi + ethers + web3modal setup * refactor wallet components * fallback providers, more config * kick out useWeb3 * remove all useWeb3 imports * more web3.js usage removal * isAddress utils replacement * restore add token / add network * less accountId changes * web3 legacy tinkering, utils/web3 → utils/wallet * legacy web3 object for ocean.js * graph sync fix, remove custom network switching code * package updates, merge fixes * downgrade to ethers v5 * fix project id * switch to ConnectKit * connectkit theming * add existing chains to wagmi * rewrite getPaymentCollector() * kick out getPaymentCollector completely, use wagmi hooks instead * Revert "kick out getPaymentCollector completely, use wagmi hooks instead" This reverts commit 54c7d1ef1a2dec0b1575a685125ba78336b30f59. * switch getPaymentCollector * calcBaseInGivenDatatokensOut reorg * wip integrate ocean lib 3.0.0 * update orbis components to use wagmi instead of web hooks * more oceanjs integration updates * more refactors * fix build * update ocean lib * fix publish * fix order fixed rate * remove logs * debug and stop infinite cycle orbis connect * fix orbis dm connection * mock use network and fix some more tests * mock wagmi switch network * mock wagmi useProvider createClient and connectKit getDefaultClient * fix jest tests * try storybook fix * cleanups and bump ocean lib * fix order * bump lib to next.5 and add more modal style * bump ocean.js lib to 3.0.0 --------- Co-authored-by: Matthias Kretschmann <m@kretschmann.io>
2023-05-29 12:28:41 +02:00
signer,
2022-05-12 13:39:14 +02:00
selectedAlgorithmAsset,
2022-05-13 09:27:41 +02:00
algoOrderPriceAndFees,
2022-05-12 13:39:14 +02:00
accountId,
initializedProviderResponse.algorithm,
Feature/wagmi (#1912) * wagmi + ethers + web3modal setup * refactor wallet components * fallback providers, more config * kick out useWeb3 * remove all useWeb3 imports * more web3.js usage removal * isAddress utils replacement * restore add token / add network * less accountId changes * web3 legacy tinkering, utils/web3 → utils/wallet * legacy web3 object for ocean.js * graph sync fix, remove custom network switching code * package updates, merge fixes * downgrade to ethers v5 * fix project id * switch to ConnectKit * connectkit theming * add existing chains to wagmi * rewrite getPaymentCollector() * kick out getPaymentCollector completely, use wagmi hooks instead * Revert "kick out getPaymentCollector completely, use wagmi hooks instead" This reverts commit 54c7d1ef1a2dec0b1575a685125ba78336b30f59. * switch getPaymentCollector * calcBaseInGivenDatatokensOut reorg * wip integrate ocean lib 3.0.0 * update orbis components to use wagmi instead of web hooks * more oceanjs integration updates * more refactors * fix build * update ocean lib * fix publish * fix order fixed rate * remove logs * debug and stop infinite cycle orbis connect * fix orbis dm connection * mock use network and fix some more tests * mock wagmi switch network * mock wagmi useProvider createClient and connectKit getDefaultClient * fix jest tests * try storybook fix * cleanups and bump ocean lib * fix order * bump lib to next.5 and add more modal style * bump ocean.js lib to 3.0.0 --------- Co-authored-by: Matthias Kretschmann <m@kretschmann.io>
2023-05-29 12:28:41 +02:00
hasAlgoAssetDatatoken,
2022-05-12 13:39:14 +02:00
computeEnv.consumerAddress
)
2022-06-23 12:38:03 +02:00
if (!algorithmOrderTx) throw new Error('Failed to order algorithm.')
Restore compute functionality (#1069) * add balance check and check is consumable * add isOrderable and other helpers * finish start compute job * removed unused methods * add more comments * add pool logic for order * move asset selection to compute helper * small fix * fixed get algo list * refactor start compute job and more fixes * update order params * use compute env and compute consumer address * fix prices * fix algorithms selection list on allowAllPublisher case * fix edit compute settings * update compute resources valid until logic * fixes and cleanups * wip compute jobs * fix compute timeout value * fixed compute jobs logic * fix algo selection list name * fixed compute jobs from profile loading * update start compute flow messages * update set algo access details * update compute message logic * added logs * update package lock * remove logs * fix edit compute checksums for files and container * Fix compute dataset algorithm list (#1194) * fix query Signed-off-by: mihaisc <mihai.scarlat@smartcontrol.ro> * remove comment Signed-off-by: mihaisc <mihai.scarlat@smartcontrol.ro> * Fix previous order tx (#1197) * rename nft update query Signed-off-by: mihaisc <mihai.scarlat@smartcontrol.ro> * fix previous order Signed-off-by: mihaisc <mihai.scarlat@smartcontrol.ro> * fix build * handle order price, NaN and default 0 * optional value for all fee, prevent breaking when no value * fix aquarius call and added logs * update provider compute status call * remove percentage fee from price sum, depends smart contract calculation (#1249) Co-authored-by: Soon Huat <soon_huat.phan@daimler.com> * fix display of compute datasets with free price * removed to lowerCase on eth address * fix compute jobs section and your jobs * bumo ocean lib to 1.0.0-next.32 * c2d show price with fee, exclude provider fee * wip get results * include loading when calculating data + algo price, tooltip show order price * update get compute url and use oceanjs helper for download * update computeStatus signature to fix build and CI * added logs * refactor setting price and fees for assets * update compute details and compute results UI and style * update flex value * update download buttons style * update download buttons text * bump ocean lib version and lint fixes * get provier uri for compute results based on job input did * use zero adress for price and fees order * some fixes * Add reuse order in start compute flow (#1352) * wip add reuse order logic * add reuse order in start job * added missing check if no jobs found * update lib Signed-off-by: mihaisc <mihai.scarlat@smartcontrol.ro> * fix lint Signed-off-by: mihaisc <mihai.scarlat@smartcontrol.ro> Co-authored-by: mihaisc <mihai.scarlat@smartcontrol.ro> * fix fixed rate * fix build * fix your compute jobs section when asset network not selected * disable edit compute settings for algorithms * fix compute jobs infinite loading when no jobs found * fix compute form * show token symbol for free assets also on compute price output * removed swp file * some decimal fixes * partial fix for asset with pool fees, algo not working yet * more decimal fixes * fix algo with pool price and fees fetching * fix selecting algorithms when on different network * fix compute jobs table auto refresh and details modal closing * wip compute initialize * order fixes * fix lint * fix conditions and cleanups * fix compute status text display * init prices and fees after starting a compute job * start/order button tweaks * kick in loader earlier * update compute status feedback messages * fixed initial price * compute jobs refetch and reuse order * remove logs * removed logs and added some explanations * use compute env max duration value in seconds * error handling on intializeCompute and order * removed console logs and added one new check * use optional on initialized provider check * remove toast from provider helper * fix compute env issue on start order * disable job selection during actions execution * temporary fix publish algo with custom docker image * fix provider fee display * remove unnecessary condition * fix alignment based button on action type (#1491) * fix alignment based on action type * moving to CSS modules * send providerFeeAmount as string * remove cast on providerFeeAmount * removed some logs and added few comments * update price output tooltip and total price logic * set providerFee amount only when avaialable * bump oceanlib to 1.1.2 * replace FIleMetadata to fix build * used approveWei for approving provider fees * fix free algo price selection and display * fix provider fee load at first algo selection * update compute help text * fix provider fee approve for free assets * cleanup * remove commented out code * remove unused state * removed unused imports * typos in comments, variables, props * more typos * shorten getAccessDetailsFromTokenPrice() a bit * state & hooks access reordering * Update src/@utils/ddo.ts remove metadata from service type Co-authored-by: Matthias Kretschmann <m@kretschmann.io> * effect dependency fixes * state renaming * effect dependency fixes * compute jobs profile visual fixes * effect dependency fixes * more comments removal * add accountId as a dependency in effect * move isOwner to asset provider * refactor handleComputeOrder for less complexity and more useful error reporting * more proper error throwing * provider fee statement tweak * more obvious edit action * empty array for `publisherTrustedAlgorithms` & `publisherTrustedAlgorithmPublishers` by default * ref #1538 * ref #1539 * don t use initial tx values as valid order use subgraph value * fix algo list fetching * closes #1537 * addresses #1538 * fix disable compute button if algo is consumable * move isOwner check to single effect * Correctly display trusted algorithms in compute asset (#1541) * fix allowed algo * fix trusted algo filter Co-authored-by: mihaisc <mihai.scarlat@smartcontrol.ro> Co-authored-by: Soon Huat <soon_huat.phan@daimler.com> Co-authored-by: Soon Huat <soonhuat.phan@hotmail.com> Co-authored-by: Enzo Vezzaro <enzo-vezzaro@live.it> Co-authored-by: Matthias Kretschmann <m@kretschmann.io> Co-authored-by: mihaisc <mihai@oceanprotocol.com>
2022-06-23 17:53:05 +02:00
setComputeStatusText(
getComputeFeedback(
asset.accessDetails.baseToken?.symbol,
asset.accessDetails.datatoken?.symbol,
asset.metadata.type
2022-08-02 11:53:22 +02:00
)[asset.accessDetails?.type === 'fixed' ? 2 : 3]
Restore compute functionality (#1069) * add balance check and check is consumable * add isOrderable and other helpers * finish start compute job * removed unused methods * add more comments * add pool logic for order * move asset selection to compute helper * small fix * fixed get algo list * refactor start compute job and more fixes * update order params * use compute env and compute consumer address * fix prices * fix algorithms selection list on allowAllPublisher case * fix edit compute settings * update compute resources valid until logic * fixes and cleanups * wip compute jobs * fix compute timeout value * fixed compute jobs logic * fix algo selection list name * fixed compute jobs from profile loading * update start compute flow messages * update set algo access details * update compute message logic * added logs * update package lock * remove logs * fix edit compute checksums for files and container * Fix compute dataset algorithm list (#1194) * fix query Signed-off-by: mihaisc <mihai.scarlat@smartcontrol.ro> * remove comment Signed-off-by: mihaisc <mihai.scarlat@smartcontrol.ro> * Fix previous order tx (#1197) * rename nft update query Signed-off-by: mihaisc <mihai.scarlat@smartcontrol.ro> * fix previous order Signed-off-by: mihaisc <mihai.scarlat@smartcontrol.ro> * fix build * handle order price, NaN and default 0 * optional value for all fee, prevent breaking when no value * fix aquarius call and added logs * update provider compute status call * remove percentage fee from price sum, depends smart contract calculation (#1249) Co-authored-by: Soon Huat <soon_huat.phan@daimler.com> * fix display of compute datasets with free price * removed to lowerCase on eth address * fix compute jobs section and your jobs * bumo ocean lib to 1.0.0-next.32 * c2d show price with fee, exclude provider fee * wip get results * include loading when calculating data + algo price, tooltip show order price * update get compute url and use oceanjs helper for download * update computeStatus signature to fix build and CI * added logs * refactor setting price and fees for assets * update compute details and compute results UI and style * update flex value * update download buttons style * update download buttons text * bump ocean lib version and lint fixes * get provier uri for compute results based on job input did * use zero adress for price and fees order * some fixes * Add reuse order in start compute flow (#1352) * wip add reuse order logic * add reuse order in start job * added missing check if no jobs found * update lib Signed-off-by: mihaisc <mihai.scarlat@smartcontrol.ro> * fix lint Signed-off-by: mihaisc <mihai.scarlat@smartcontrol.ro> Co-authored-by: mihaisc <mihai.scarlat@smartcontrol.ro> * fix fixed rate * fix build * fix your compute jobs section when asset network not selected * disable edit compute settings for algorithms * fix compute jobs infinite loading when no jobs found * fix compute form * show token symbol for free assets also on compute price output * removed swp file * some decimal fixes * partial fix for asset with pool fees, algo not working yet * more decimal fixes * fix algo with pool price and fees fetching * fix selecting algorithms when on different network * fix compute jobs table auto refresh and details modal closing * wip compute initialize * order fixes * fix lint * fix conditions and cleanups * fix compute status text display * init prices and fees after starting a compute job * start/order button tweaks * kick in loader earlier * update compute status feedback messages * fixed initial price * compute jobs refetch and reuse order * remove logs * removed logs and added some explanations * use compute env max duration value in seconds * error handling on intializeCompute and order * removed console logs and added one new check * use optional on initialized provider check * remove toast from provider helper * fix compute env issue on start order * disable job selection during actions execution * temporary fix publish algo with custom docker image * fix provider fee display * remove unnecessary condition * fix alignment based button on action type (#1491) * fix alignment based on action type * moving to CSS modules * send providerFeeAmount as string * remove cast on providerFeeAmount * removed some logs and added few comments * update price output tooltip and total price logic * set providerFee amount only when avaialable * bump oceanlib to 1.1.2 * replace FIleMetadata to fix build * used approveWei for approving provider fees * fix free algo price selection and display * fix provider fee load at first algo selection * update compute help text * fix provider fee approve for free assets * cleanup * remove commented out code * remove unused state * removed unused imports * typos in comments, variables, props * more typos * shorten getAccessDetailsFromTokenPrice() a bit * state & hooks access reordering * Update src/@utils/ddo.ts remove metadata from service type Co-authored-by: Matthias Kretschmann <m@kretschmann.io> * effect dependency fixes * state renaming * effect dependency fixes * compute jobs profile visual fixes * effect dependency fixes * more comments removal * add accountId as a dependency in effect * move isOwner to asset provider * refactor handleComputeOrder for less complexity and more useful error reporting * more proper error throwing * provider fee statement tweak * more obvious edit action * empty array for `publisherTrustedAlgorithms` & `publisherTrustedAlgorithmPublishers` by default * ref #1538 * ref #1539 * don t use initial tx values as valid order use subgraph value * fix algo list fetching * closes #1537 * addresses #1538 * fix disable compute button if algo is consumable * move isOwner check to single effect * Correctly display trusted algorithms in compute asset (#1541) * fix allowed algo * fix trusted algo filter Co-authored-by: mihaisc <mihai.scarlat@smartcontrol.ro> Co-authored-by: Soon Huat <soon_huat.phan@daimler.com> Co-authored-by: Soon Huat <soonhuat.phan@hotmail.com> Co-authored-by: Enzo Vezzaro <enzo-vezzaro@live.it> Co-authored-by: Matthias Kretschmann <m@kretschmann.io> Co-authored-by: mihaisc <mihai@oceanprotocol.com>
2022-06-23 17:53:05 +02:00
)
Check provider fees validity (#1849) * fix lint * add dynamic provider fees * fixes * cleanup and more fixes * bump oceanlib to 2.6.0 * Avoiding getInitialPaymentCollector failure (#1816) * early return is no web3 or ddo * Creating test for MetaFull * adding test: src/components/Asset/AssetContent/MetaSecondary.test.tsx * Adding test for bookmarks * Adding test for displaying payment collector * Removing comments * Renaming assetAquarius * Renaming assetWithAccessDetails * Ensuring that the payment collector is shown even without a wallet connected * Removing broken test * Using getDummyWeb3 for fetching the payment collector address * google validation (#1835) * Updating validation to exclude any google link * Updating Yup validation * Checking if domain includes google.com * Updating isGoogleUrl function * Moving isGoogleUrl into @utils/url/index file * isGoogleUrl function * Updating tests * Adding additional tests for other google domains * Updating tests * Updating isGoogleUrl file path * wip * Updating pricing message (#1842) * Bump @storybook/addon-essentials from 6.5.13 to 6.5.15 (#1841) Bumps [@storybook/addon-essentials](https://github.com/storybookjs/storybook/tree/HEAD/addons/essentials) from 6.5.13 to 6.5.15. - [Release notes](https://github.com/storybookjs/storybook/releases) - [Changelog](https://github.com/storybookjs/storybook/blob/v6.5.15/CHANGELOG.md) - [Commits](https://github.com/storybookjs/storybook/commits/v6.5.15/addons/essentials) --- updated-dependencies: - dependency-name: "@storybook/addon-essentials" dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bump @types/jest from 29.2.3 to 29.2.5 (#1840) Bumps [@types/jest](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/jest) from 29.2.3 to 29.2.5. - [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases) - [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/jest) --- updated-dependencies: - dependency-name: "@types/jest" dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bump prettier from 2.8.0 to 2.8.1 (#1837) Bumps [prettier](https://github.com/prettier/prettier) from 2.8.0 to 2.8.1. - [Release notes](https://github.com/prettier/prettier/releases) - [Changelog](https://github.com/prettier/prettier/blob/main/CHANGELOG.md) - [Commits](https://github.com/prettier/prettier/compare/2.8.0...2.8.1) --- updated-dependencies: - dependency-name: prettier dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bump react-select from 5.6.1 to 5.7.0 (#1839) Bumps [react-select](https://github.com/JedWatson/react-select) from 5.6.1 to 5.7.0. - [Release notes](https://github.com/JedWatson/react-select/releases) - [Changelog](https://github.com/JedWatson/react-select/blob/master/docs/CHANGELOG.md) - [Commits](https://github.com/JedWatson/react-select/compare/react-select@5.6.1...react-select@5.7.0) --- updated-dependencies: - dependency-name: react-select dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bump react-tabs from 5.1.0 to 6.0.0 (#1838) Bumps [react-tabs](https://github.com/reactjs/react-tabs) from 5.1.0 to 6.0.0. - [Release notes](https://github.com/reactjs/react-tabs/releases) - [Commits](https://github.com/reactjs/react-tabs/compare/v5.1.0...v6.0.0) --- updated-dependencies: - dependency-name: react-tabs dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com> Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * fix asset route (#1836) * updating the buy button message for free assets * Updating pricing text for compute and algorithms * Updating tests * Adding a seperate sentence about paying gas fees for network charges with free assets * Fixing tests Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: mihaisc <mihai.scarlat@smartcontrol.ro> * Showing hosting type in File Info (#1846) * Bump @storybook/addon-essentials from 6.5.13 to 6.5.15 (#1841) Bumps [@storybook/addon-essentials](https://github.com/storybookjs/storybook/tree/HEAD/addons/essentials) from 6.5.13 to 6.5.15. - [Release notes](https://github.com/storybookjs/storybook/releases) - [Changelog](https://github.com/storybookjs/storybook/blob/v6.5.15/CHANGELOG.md) - [Commits](https://github.com/storybookjs/storybook/commits/v6.5.15/addons/essentials) --- updated-dependencies: - dependency-name: "@storybook/addon-essentials" dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bump @types/jest from 29.2.3 to 29.2.5 (#1840) Bumps [@types/jest](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/jest) from 29.2.3 to 29.2.5. - [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases) - [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/jest) --- updated-dependencies: - dependency-name: "@types/jest" dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bump prettier from 2.8.0 to 2.8.1 (#1837) Bumps [prettier](https://github.com/prettier/prettier) from 2.8.0 to 2.8.1. - [Release notes](https://github.com/prettier/prettier/releases) - [Changelog](https://github.com/prettier/prettier/blob/main/CHANGELOG.md) - [Commits](https://github.com/prettier/prettier/compare/2.8.0...2.8.1) --- updated-dependencies: - dependency-name: prettier dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bump react-select from 5.6.1 to 5.7.0 (#1839) Bumps [react-select](https://github.com/JedWatson/react-select) from 5.6.1 to 5.7.0. - [Release notes](https://github.com/JedWatson/react-select/releases) - [Changelog](https://github.com/JedWatson/react-select/blob/master/docs/CHANGELOG.md) - [Commits](https://github.com/JedWatson/react-select/compare/react-select@5.6.1...react-select@5.7.0) --- updated-dependencies: - dependency-name: react-select dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bump react-tabs from 5.1.0 to 6.0.0 (#1838) Bumps [react-tabs](https://github.com/reactjs/react-tabs) from 5.1.0 to 6.0.0. - [Release notes](https://github.com/reactjs/react-tabs/releases) - [Commits](https://github.com/reactjs/react-tabs/compare/v5.1.0...v6.0.0) --- updated-dependencies: - dependency-name: react-tabs dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com> Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * fix asset route (#1836) * Adding hosting type to the file info component * Writting smart contract hosting type across two lines Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: mihaisc <mihai.scarlat@smartcontrol.ro> * add initial price value for not supported price assets (#1851) * Fix compute basetoken issue (#1829) * fix lint * add dynamic provider fees * fixes * cleanup and more fixes * bump oceanlib to 2.6.0 * fix build * add provider fees * filesize update * use existing providerFees in c2d flow * provider fees c2d logic * add logs * fixed * more debug * remove logs --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: Jamie Hewitt <jamie@oceanprotocol.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: mihaisc <mihai.scarlat@smartcontrol.ro> Co-authored-by: Jamie Hewitt <jamie.hewitt15@gmail.com>
2023-03-06 11:33:58 +01:00
const datasetOrderTx = await handleComputeOrder(
Feature/wagmi (#1912) * wagmi + ethers + web3modal setup * refactor wallet components * fallback providers, more config * kick out useWeb3 * remove all useWeb3 imports * more web3.js usage removal * isAddress utils replacement * restore add token / add network * less accountId changes * web3 legacy tinkering, utils/web3 → utils/wallet * legacy web3 object for ocean.js * graph sync fix, remove custom network switching code * package updates, merge fixes * downgrade to ethers v5 * fix project id * switch to ConnectKit * connectkit theming * add existing chains to wagmi * rewrite getPaymentCollector() * kick out getPaymentCollector completely, use wagmi hooks instead * Revert "kick out getPaymentCollector completely, use wagmi hooks instead" This reverts commit 54c7d1ef1a2dec0b1575a685125ba78336b30f59. * switch getPaymentCollector * calcBaseInGivenDatatokensOut reorg * wip integrate ocean lib 3.0.0 * update orbis components to use wagmi instead of web hooks * more oceanjs integration updates * more refactors * fix build * update ocean lib * fix publish * fix order fixed rate * remove logs * debug and stop infinite cycle orbis connect * fix orbis dm connection * mock use network and fix some more tests * mock wagmi switch network * mock wagmi useProvider createClient and connectKit getDefaultClient * fix jest tests * try storybook fix * cleanups and bump ocean lib * fix order * bump lib to next.5 and add more modal style * bump ocean.js lib to 3.0.0 --------- Co-authored-by: Matthias Kretschmann <m@kretschmann.io>
2023-05-29 12:28:41 +02:00
signer,
asset,
datasetOrderPriceAndFees,
Restore compute functionality (#1069) * add balance check and check is consumable * add isOrderable and other helpers * finish start compute job * removed unused methods * add more comments * add pool logic for order * move asset selection to compute helper * small fix * fixed get algo list * refactor start compute job and more fixes * update order params * use compute env and compute consumer address * fix prices * fix algorithms selection list on allowAllPublisher case * fix edit compute settings * update compute resources valid until logic * fixes and cleanups * wip compute jobs * fix compute timeout value * fixed compute jobs logic * fix algo selection list name * fixed compute jobs from profile loading * update start compute flow messages * update set algo access details * update compute message logic * added logs * update package lock * remove logs * fix edit compute checksums for files and container * Fix compute dataset algorithm list (#1194) * fix query Signed-off-by: mihaisc <mihai.scarlat@smartcontrol.ro> * remove comment Signed-off-by: mihaisc <mihai.scarlat@smartcontrol.ro> * Fix previous order tx (#1197) * rename nft update query Signed-off-by: mihaisc <mihai.scarlat@smartcontrol.ro> * fix previous order Signed-off-by: mihaisc <mihai.scarlat@smartcontrol.ro> * fix build * handle order price, NaN and default 0 * optional value for all fee, prevent breaking when no value * fix aquarius call and added logs * update provider compute status call * remove percentage fee from price sum, depends smart contract calculation (#1249) Co-authored-by: Soon Huat <soon_huat.phan@daimler.com> * fix display of compute datasets with free price * removed to lowerCase on eth address * fix compute jobs section and your jobs * bumo ocean lib to 1.0.0-next.32 * c2d show price with fee, exclude provider fee * wip get results * include loading when calculating data + algo price, tooltip show order price * update get compute url and use oceanjs helper for download * update computeStatus signature to fix build and CI * added logs * refactor setting price and fees for assets * update compute details and compute results UI and style * update flex value * update download buttons style * update download buttons text * bump ocean lib version and lint fixes * get provier uri for compute results based on job input did * use zero adress for price and fees order * some fixes * Add reuse order in start compute flow (#1352) * wip add reuse order logic * add reuse order in start job * added missing check if no jobs found * update lib Signed-off-by: mihaisc <mihai.scarlat@smartcontrol.ro> * fix lint Signed-off-by: mihaisc <mihai.scarlat@smartcontrol.ro> Co-authored-by: mihaisc <mihai.scarlat@smartcontrol.ro> * fix fixed rate * fix build * fix your compute jobs section when asset network not selected * disable edit compute settings for algorithms * fix compute jobs infinite loading when no jobs found * fix compute form * show token symbol for free assets also on compute price output * removed swp file * some decimal fixes * partial fix for asset with pool fees, algo not working yet * more decimal fixes * fix algo with pool price and fees fetching * fix selecting algorithms when on different network * fix compute jobs table auto refresh and details modal closing * wip compute initialize * order fixes * fix lint * fix conditions and cleanups * fix compute status text display * init prices and fees after starting a compute job * start/order button tweaks * kick in loader earlier * update compute status feedback messages * fixed initial price * compute jobs refetch and reuse order * remove logs * removed logs and added some explanations * use compute env max duration value in seconds * error handling on intializeCompute and order * removed console logs and added one new check * use optional on initialized provider check * remove toast from provider helper * fix compute env issue on start order * disable job selection during actions execution * temporary fix publish algo with custom docker image * fix provider fee display * remove unnecessary condition * fix alignment based button on action type (#1491) * fix alignment based on action type * moving to CSS modules * send providerFeeAmount as string * remove cast on providerFeeAmount * removed some logs and added few comments * update price output tooltip and total price logic * set providerFee amount only when avaialable * bump oceanlib to 1.1.2 * replace FIleMetadata to fix build * used approveWei for approving provider fees * fix free algo price selection and display * fix provider fee load at first algo selection * update compute help text * fix provider fee approve for free assets * cleanup * remove commented out code * remove unused state * removed unused imports * typos in comments, variables, props * more typos * shorten getAccessDetailsFromTokenPrice() a bit * state & hooks access reordering * Update src/@utils/ddo.ts remove metadata from service type Co-authored-by: Matthias Kretschmann <m@kretschmann.io> * effect dependency fixes * state renaming * effect dependency fixes * compute jobs profile visual fixes * effect dependency fixes * more comments removal * add accountId as a dependency in effect * move isOwner to asset provider * refactor handleComputeOrder for less complexity and more useful error reporting * more proper error throwing * provider fee statement tweak * more obvious edit action * empty array for `publisherTrustedAlgorithms` & `publisherTrustedAlgorithmPublishers` by default * ref #1538 * ref #1539 * don t use initial tx values as valid order use subgraph value * fix algo list fetching * closes #1537 * addresses #1538 * fix disable compute button if algo is consumable * move isOwner check to single effect * Correctly display trusted algorithms in compute asset (#1541) * fix allowed algo * fix trusted algo filter Co-authored-by: mihaisc <mihai.scarlat@smartcontrol.ro> Co-authored-by: Soon Huat <soon_huat.phan@daimler.com> Co-authored-by: Soon Huat <soonhuat.phan@hotmail.com> Co-authored-by: Enzo Vezzaro <enzo-vezzaro@live.it> Co-authored-by: Matthias Kretschmann <m@kretschmann.io> Co-authored-by: mihaisc <mihai@oceanprotocol.com>
2022-06-23 17:53:05 +02:00
accountId,
initializedProviderResponse.datasets[0],
Feature/wagmi (#1912) * wagmi + ethers + web3modal setup * refactor wallet components * fallback providers, more config * kick out useWeb3 * remove all useWeb3 imports * more web3.js usage removal * isAddress utils replacement * restore add token / add network * less accountId changes * web3 legacy tinkering, utils/web3 → utils/wallet * legacy web3 object for ocean.js * graph sync fix, remove custom network switching code * package updates, merge fixes * downgrade to ethers v5 * fix project id * switch to ConnectKit * connectkit theming * add existing chains to wagmi * rewrite getPaymentCollector() * kick out getPaymentCollector completely, use wagmi hooks instead * Revert "kick out getPaymentCollector completely, use wagmi hooks instead" This reverts commit 54c7d1ef1a2dec0b1575a685125ba78336b30f59. * switch getPaymentCollector * calcBaseInGivenDatatokensOut reorg * wip integrate ocean lib 3.0.0 * update orbis components to use wagmi instead of web hooks * more oceanjs integration updates * more refactors * fix build * update ocean lib * fix publish * fix order fixed rate * remove logs * debug and stop infinite cycle orbis connect * fix orbis dm connection * mock use network and fix some more tests * mock wagmi switch network * mock wagmi useProvider createClient and connectKit getDefaultClient * fix jest tests * try storybook fix * cleanups and bump ocean lib * fix order * bump lib to next.5 and add more modal style * bump ocean.js lib to 3.0.0 --------- Co-authored-by: Matthias Kretschmann <m@kretschmann.io>
2023-05-29 12:28:41 +02:00
hasDatatoken,
Restore compute functionality (#1069) * add balance check and check is consumable * add isOrderable and other helpers * finish start compute job * removed unused methods * add more comments * add pool logic for order * move asset selection to compute helper * small fix * fixed get algo list * refactor start compute job and more fixes * update order params * use compute env and compute consumer address * fix prices * fix algorithms selection list on allowAllPublisher case * fix edit compute settings * update compute resources valid until logic * fixes and cleanups * wip compute jobs * fix compute timeout value * fixed compute jobs logic * fix algo selection list name * fixed compute jobs from profile loading * update start compute flow messages * update set algo access details * update compute message logic * added logs * update package lock * remove logs * fix edit compute checksums for files and container * Fix compute dataset algorithm list (#1194) * fix query Signed-off-by: mihaisc <mihai.scarlat@smartcontrol.ro> * remove comment Signed-off-by: mihaisc <mihai.scarlat@smartcontrol.ro> * Fix previous order tx (#1197) * rename nft update query Signed-off-by: mihaisc <mihai.scarlat@smartcontrol.ro> * fix previous order Signed-off-by: mihaisc <mihai.scarlat@smartcontrol.ro> * fix build * handle order price, NaN and default 0 * optional value for all fee, prevent breaking when no value * fix aquarius call and added logs * update provider compute status call * remove percentage fee from price sum, depends smart contract calculation (#1249) Co-authored-by: Soon Huat <soon_huat.phan@daimler.com> * fix display of compute datasets with free price * removed to lowerCase on eth address * fix compute jobs section and your jobs * bumo ocean lib to 1.0.0-next.32 * c2d show price with fee, exclude provider fee * wip get results * include loading when calculating data + algo price, tooltip show order price * update get compute url and use oceanjs helper for download * update computeStatus signature to fix build and CI * added logs * refactor setting price and fees for assets * update compute details and compute results UI and style * update flex value * update download buttons style * update download buttons text * bump ocean lib version and lint fixes * get provier uri for compute results based on job input did * use zero adress for price and fees order * some fixes * Add reuse order in start compute flow (#1352) * wip add reuse order logic * add reuse order in start job * added missing check if no jobs found * update lib Signed-off-by: mihaisc <mihai.scarlat@smartcontrol.ro> * fix lint Signed-off-by: mihaisc <mihai.scarlat@smartcontrol.ro> Co-authored-by: mihaisc <mihai.scarlat@smartcontrol.ro> * fix fixed rate * fix build * fix your compute jobs section when asset network not selected * disable edit compute settings for algorithms * fix compute jobs infinite loading when no jobs found * fix compute form * show token symbol for free assets also on compute price output * removed swp file * some decimal fixes * partial fix for asset with pool fees, algo not working yet * more decimal fixes * fix algo with pool price and fees fetching * fix selecting algorithms when on different network * fix compute jobs table auto refresh and details modal closing * wip compute initialize * order fixes * fix lint * fix conditions and cleanups * fix compute status text display * init prices and fees after starting a compute job * start/order button tweaks * kick in loader earlier * update compute status feedback messages * fixed initial price * compute jobs refetch and reuse order * remove logs * removed logs and added some explanations * use compute env max duration value in seconds * error handling on intializeCompute and order * removed console logs and added one new check * use optional on initialized provider check * remove toast from provider helper * fix compute env issue on start order * disable job selection during actions execution * temporary fix publish algo with custom docker image * fix provider fee display * remove unnecessary condition * fix alignment based button on action type (#1491) * fix alignment based on action type * moving to CSS modules * send providerFeeAmount as string * remove cast on providerFeeAmount * removed some logs and added few comments * update price output tooltip and total price logic * set providerFee amount only when avaialable * bump oceanlib to 1.1.2 * replace FIleMetadata to fix build * used approveWei for approving provider fees * fix free algo price selection and display * fix provider fee load at first algo selection * update compute help text * fix provider fee approve for free assets * cleanup * remove commented out code * remove unused state * removed unused imports * typos in comments, variables, props * more typos * shorten getAccessDetailsFromTokenPrice() a bit * state & hooks access reordering * Update src/@utils/ddo.ts remove metadata from service type Co-authored-by: Matthias Kretschmann <m@kretschmann.io> * effect dependency fixes * state renaming * effect dependency fixes * compute jobs profile visual fixes * effect dependency fixes * more comments removal * add accountId as a dependency in effect * move isOwner to asset provider * refactor handleComputeOrder for less complexity and more useful error reporting * more proper error throwing * provider fee statement tweak * more obvious edit action * empty array for `publisherTrustedAlgorithms` & `publisherTrustedAlgorithmPublishers` by default * ref #1538 * ref #1539 * don t use initial tx values as valid order use subgraph value * fix algo list fetching * closes #1537 * addresses #1538 * fix disable compute button if algo is consumable * move isOwner check to single effect * Correctly display trusted algorithms in compute asset (#1541) * fix allowed algo * fix trusted algo filter Co-authored-by: mihaisc <mihai.scarlat@smartcontrol.ro> Co-authored-by: Soon Huat <soon_huat.phan@daimler.com> Co-authored-by: Soon Huat <soonhuat.phan@hotmail.com> Co-authored-by: Enzo Vezzaro <enzo-vezzaro@live.it> Co-authored-by: Matthias Kretschmann <m@kretschmann.io> Co-authored-by: mihaisc <mihai@oceanprotocol.com>
2022-06-23 17:53:05 +02:00
computeEnv.consumerAddress
)
if (!datasetOrderTx) throw new Error('Failed to order dataset.')
LoggerInstance.log('[compute] Starting compute job.')
const computeAsset: ComputeAsset = {
documentId: asset.id,
serviceId: asset.services[0].id,
Feat: Consumer Parameters (#1921) * feat: add consumer parameters to publish * fix: publish form validation * feat: update consumer parameters form * feat: add consumer parameter types * feat: update consumer parameter validation * feat: add consumer parameters structure * feat: add InputOptions error handling * feat: update consumer parameters validation * feat: update transformPublishFromToDdo * feat: add default options to parameter options * fix: value handling for select and mutliselect * feat: update "add new parameter" button label * feat: remove unused publish form sections * chore: remove console.log * chore: remove comments * feat: remove multiselect * feat: add consumer parameters section label * feat: update types * feat: update edit form fields * feat: parse consumer parameters in edit form * feat: add consumer parameters field to edit * feat: transform consumer parameters values before edit * feat: update "required" type to select * feat: update "required" type to select on edit form * fix: error object access * fix: edit flow crash * fix: validation when consumer parameters are not selected * feat: update validation for default consumer parameters value * fix: types * feat: add service consumer parameters to publish form * chore: remove console.log * feat: add service consumer parameters edit * chore: remove comments * fix: form edit metadata types * feat: add consume algo parameter structure * feat: consumer parameter required default value condition * feat: add consumer parameter groups to assetActions * fix: consumer parameters grouping * feat: update consumer parameters alignment * feat: update types * feat: allow service consumer parameters on dataset asset type * feat: add consumer parameters to ddo updated values in edit form * feat: add "data service" consumer parameters to consumption form * feat: allow service parameters on all asset types * feat: update parameter consume form design * feat: update asset actions consume parameters location * feat: add service parameters to download assets * refactor: consumer parameters actions * refactor: form action name * refactor: consumer parameters default input * refactor: consumer parameters select input * refactor: consumer parameter input * fix: props name * refactor: variable naming * refactor: consumer parameters form validation * refactor: rename consumer parameters types * refactor: extract consumer parameters form data to separate file * refactor: rename type * feat: controlled tabs for consumer params * feat: restore default value as required * refactor: parse values before edit * feat: add form to handle consumer parameters consumption * feat: send consumer params with download request * feat: send consumer params with compute request * feat: handle compute form initialization * chore: remove unused dependency * feat: handle download form data initialization * chore: remove console.log * feat: update types * fix: consumer parameter value types * feat: update ConsumerParameter type * feat: update ConsumerParameter type * chore: add comments * refactor: consumer parameters inputs * refactor: rename data and algo service params * refactor: consumer parameters form * refactor: consumer parameter form styling * refactor: make headers input reusable as KeyValueInput * refactor: refactorings, reduce duplication (WIP) * refactor: usercustomparameters consumption form creation/validation * refactor: return undefined consistently if property path not found on object * refactor: reuse fieldType and fieldOptions in DefaultInput * fix: parse ddo consumer parameters for edit form * fix: asset view crash for assets w/o consumer params * fix: publish preview for assets with no consumer params * fix: revert accidential rename of algoService * fix: revert publish navigation padding change * feat: update consumer parameters' labels and helpers * fix: consumer parameters validation * feat: update consumer parameter helper wording * chore: merge conflicts * feat: update types * fix: validate form on consumer parameter deletion * feat: add key value input placeholder props * fix: handle boolean type consumer parameters in consume form (#38) * Update src/components/Publish/_validation.ts Co-authored-by: Jamie Hewitt <jamie.hewitt15@gmail.com> * Update src/components/Asset/AssetActions/ConsumerParameters/FormConsumerParameters.module.css Co-authored-by: Jamie Hewitt <jamie.hewitt15@gmail.com> * Update src/components/Asset/Edit/_validation.ts Co-authored-by: Jamie Hewitt <jamie.hewitt15@gmail.com> * Update src/components/Asset/AssetActions/ConsumerParameters/index.tsx Co-authored-by: Jamie Hewitt <jamie.hewitt15@gmail.com> * Update src/components/Asset/AssetActions/ConsumerParameters/FormConsumerParameters.tsx Co-authored-by: Jamie Hewitt <jamie.hewitt15@gmail.com> * Update src/components/@shared/FormInput/index.tsx Co-authored-by: Jamie Hewitt <jamie.hewitt15@gmail.com> * Update src/components/@shared/FormInput/InputElement/ConsumerParameters/index.tsx Co-authored-by: Jamie Hewitt <jamie.hewitt15@gmail.com> * Update src/components/@shared/FormInput/InputElement/ConsumerParameters/index.tsx Co-authored-by: Jamie Hewitt <jamie.hewitt15@gmail.com> * Update src/components/@shared/FormInput/InputElement/ConsumerParameters/OptionsInput.tsx Co-authored-by: Jamie Hewitt <jamie.hewitt15@gmail.com> * Update src/components/@shared/FormInput/InputElement/ConsumerParameters/FormActions.tsx Co-authored-by: Jamie Hewitt <jamie.hewitt15@gmail.com> * Update src/@utils/provider.ts Co-authored-by: Jamie Hewitt <jamie.hewitt15@gmail.com> * fix: import paths * refactor: add consumer parameters validation types * feat: add string length min/max to consumer parameters validation * feat: add cp description to consume form * feat: reduce character limit in CP tab title * feat: update CP fields' placeholders and helpers * fix: show only relevant CPs in asset actions --------- Co-authored-by: Luca Milanese <luca.milanese90@gmail.com> Co-authored-by: Jamie Hewitt <jamie.hewitt15@gmail.com>
2023-09-07 16:14:27 +02:00
transferTxId: datasetOrderTx,
userdata: userCustomParameters?.dataServiceParams
}
2022-03-02 15:42:50 +01:00
computeAlgorithm.transferTxId = algorithmOrderTx
const output: ComputeOutput = {
publishAlgorithmLog: true,
publishOutput: true
}
setComputeStatusText(getComputeFeedback()[4])
const response = await ProviderInstance.computeStart(
asset.services[0].serviceEndpoint,
Feature/wagmi (#1912) * wagmi + ethers + web3modal setup * refactor wallet components * fallback providers, more config * kick out useWeb3 * remove all useWeb3 imports * more web3.js usage removal * isAddress utils replacement * restore add token / add network * less accountId changes * web3 legacy tinkering, utils/web3 → utils/wallet * legacy web3 object for ocean.js * graph sync fix, remove custom network switching code * package updates, merge fixes * downgrade to ethers v5 * fix project id * switch to ConnectKit * connectkit theming * add existing chains to wagmi * rewrite getPaymentCollector() * kick out getPaymentCollector completely, use wagmi hooks instead * Revert "kick out getPaymentCollector completely, use wagmi hooks instead" This reverts commit 54c7d1ef1a2dec0b1575a685125ba78336b30f59. * switch getPaymentCollector * calcBaseInGivenDatatokensOut reorg * wip integrate ocean lib 3.0.0 * update orbis components to use wagmi instead of web hooks * more oceanjs integration updates * more refactors * fix build * update ocean lib * fix publish * fix order fixed rate * remove logs * debug and stop infinite cycle orbis connect * fix orbis dm connection * mock use network and fix some more tests * mock wagmi switch network * mock wagmi useProvider createClient and connectKit getDefaultClient * fix jest tests * try storybook fix * cleanups and bump ocean lib * fix order * bump lib to next.5 and add more modal style * bump ocean.js lib to 3.0.0 --------- Co-authored-by: Matthias Kretschmann <m@kretschmann.io>
2023-05-29 12:28:41 +02:00
signer,
2022-03-07 23:09:53 +01:00
computeEnv?.id,
computeAsset,
computeAlgorithm,
newAbortController(),
null,
2022-03-07 23:09:53 +01:00
output
)
2022-06-23 12:38:03 +02:00
if (!response) throw new Error('Error starting compute job.')
LoggerInstance.log('[compute] Starting compute job response: ', response)
2022-06-22 14:40:35 +02:00
setIsOrdered(true)
2022-06-22 12:46:42 +02:00
setRefetchJobs(!refetchJobs)
initPriceAndFees()
2022-01-27 09:52:53 +01:00
} catch (error) {
const message = getErrorMessage(JSON.parse(error.message))
LoggerInstance.error('[Compute] Error:', message)
setError(message)
setRetry(true)
2022-01-27 09:52:53 +01:00
} finally {
2022-06-22 14:40:35 +02:00
setIsOrdering(false)
2022-01-27 09:52:53 +01:00
}
}
2022-02-10 15:33:16 +01:00
Feat: Consumer Parameters (#1921) * feat: add consumer parameters to publish * fix: publish form validation * feat: update consumer parameters form * feat: add consumer parameter types * feat: update consumer parameter validation * feat: add consumer parameters structure * feat: add InputOptions error handling * feat: update consumer parameters validation * feat: update transformPublishFromToDdo * feat: add default options to parameter options * fix: value handling for select and mutliselect * feat: update "add new parameter" button label * feat: remove unused publish form sections * chore: remove console.log * chore: remove comments * feat: remove multiselect * feat: add consumer parameters section label * feat: update types * feat: update edit form fields * feat: parse consumer parameters in edit form * feat: add consumer parameters field to edit * feat: transform consumer parameters values before edit * feat: update "required" type to select * feat: update "required" type to select on edit form * fix: error object access * fix: edit flow crash * fix: validation when consumer parameters are not selected * feat: update validation for default consumer parameters value * fix: types * feat: add service consumer parameters to publish form * chore: remove console.log * feat: add service consumer parameters edit * chore: remove comments * fix: form edit metadata types * feat: add consume algo parameter structure * feat: consumer parameter required default value condition * feat: add consumer parameter groups to assetActions * fix: consumer parameters grouping * feat: update consumer parameters alignment * feat: update types * feat: allow service consumer parameters on dataset asset type * feat: add consumer parameters to ddo updated values in edit form * feat: add "data service" consumer parameters to consumption form * feat: allow service parameters on all asset types * feat: update parameter consume form design * feat: update asset actions consume parameters location * feat: add service parameters to download assets * refactor: consumer parameters actions * refactor: form action name * refactor: consumer parameters default input * refactor: consumer parameters select input * refactor: consumer parameter input * fix: props name * refactor: variable naming * refactor: consumer parameters form validation * refactor: rename consumer parameters types * refactor: extract consumer parameters form data to separate file * refactor: rename type * feat: controlled tabs for consumer params * feat: restore default value as required * refactor: parse values before edit * feat: add form to handle consumer parameters consumption * feat: send consumer params with download request * feat: send consumer params with compute request * feat: handle compute form initialization * chore: remove unused dependency * feat: handle download form data initialization * chore: remove console.log * feat: update types * fix: consumer parameter value types * feat: update ConsumerParameter type * feat: update ConsumerParameter type * chore: add comments * refactor: consumer parameters inputs * refactor: rename data and algo service params * refactor: consumer parameters form * refactor: consumer parameter form styling * refactor: make headers input reusable as KeyValueInput * refactor: refactorings, reduce duplication (WIP) * refactor: usercustomparameters consumption form creation/validation * refactor: return undefined consistently if property path not found on object * refactor: reuse fieldType and fieldOptions in DefaultInput * fix: parse ddo consumer parameters for edit form * fix: asset view crash for assets w/o consumer params * fix: publish preview for assets with no consumer params * fix: revert accidential rename of algoService * fix: revert publish navigation padding change * feat: update consumer parameters' labels and helpers * fix: consumer parameters validation * feat: update consumer parameter helper wording * chore: merge conflicts * feat: update types * fix: validate form on consumer parameter deletion * feat: add key value input placeholder props * fix: handle boolean type consumer parameters in consume form (#38) * Update src/components/Publish/_validation.ts Co-authored-by: Jamie Hewitt <jamie.hewitt15@gmail.com> * Update src/components/Asset/AssetActions/ConsumerParameters/FormConsumerParameters.module.css Co-authored-by: Jamie Hewitt <jamie.hewitt15@gmail.com> * Update src/components/Asset/Edit/_validation.ts Co-authored-by: Jamie Hewitt <jamie.hewitt15@gmail.com> * Update src/components/Asset/AssetActions/ConsumerParameters/index.tsx Co-authored-by: Jamie Hewitt <jamie.hewitt15@gmail.com> * Update src/components/Asset/AssetActions/ConsumerParameters/FormConsumerParameters.tsx Co-authored-by: Jamie Hewitt <jamie.hewitt15@gmail.com> * Update src/components/@shared/FormInput/index.tsx Co-authored-by: Jamie Hewitt <jamie.hewitt15@gmail.com> * Update src/components/@shared/FormInput/InputElement/ConsumerParameters/index.tsx Co-authored-by: Jamie Hewitt <jamie.hewitt15@gmail.com> * Update src/components/@shared/FormInput/InputElement/ConsumerParameters/index.tsx Co-authored-by: Jamie Hewitt <jamie.hewitt15@gmail.com> * Update src/components/@shared/FormInput/InputElement/ConsumerParameters/OptionsInput.tsx Co-authored-by: Jamie Hewitt <jamie.hewitt15@gmail.com> * Update src/components/@shared/FormInput/InputElement/ConsumerParameters/FormActions.tsx Co-authored-by: Jamie Hewitt <jamie.hewitt15@gmail.com> * Update src/@utils/provider.ts Co-authored-by: Jamie Hewitt <jamie.hewitt15@gmail.com> * fix: import paths * refactor: add consumer parameters validation types * feat: add string length min/max to consumer parameters validation * feat: add cp description to consume form * feat: reduce character limit in CP tab title * feat: update CP fields' placeholders and helpers * fix: show only relevant CPs in asset actions --------- Co-authored-by: Luca Milanese <luca.milanese90@gmail.com> Co-authored-by: Jamie Hewitt <jamie.hewitt15@gmail.com>
2023-09-07 16:14:27 +02:00
const onSubmit = async (values: {
algorithm: string
dataServiceParams?: UserCustomParameters
algoServiceParams?: UserCustomParameters
algoParams?: UserCustomParameters
}) => {
if (!values.algorithm) return
const userCustomParameters = {
dataServiceParams: parseConsumerParameterValues(
values?.dataServiceParams,
asset.services[0].consumerParameters
),
algoServiceParams: parseConsumerParameterValues(
values?.algoServiceParams,
selectedAlgorithmAsset?.services[0].consumerParameters
),
algoParams: parseConsumerParameterValues(
values?.algoParams,
selectedAlgorithmAsset?.metadata?.algorithm?.consumerParameters
)
}
await startJob(userCustomParameters)
}
Start compute job (#439) * Wip start compute job * Wip select algorithm design * Asset selection form component, for start compute job (#442) * prototype AssetSelection * assetselection styling * typing "fix" * put back file info icon * AssetSelection styling in context * update start job method, fixed algo select, and fixed option typing * compute logic update * add has previous orders for algo asset * fixed search algorithm assets in start compute form * fixed lint errors * updated previous order for algo logic and compute flow * update use price hook and added buy DT for algo * display only alg of type exchange and sort by value * display only trusted algo for asset if field is set * added logic for allow all published algorithms or no algorithms allowed * asset selection style & spacing tweaks * refactor get algorithms for compute and edit compute * fixed form options and more refactoring * new ButtonBuy component * shared component between consume/compute * dealing with various states: loading, previous orders, help text output * effect dependencies * move error output into toast * formik data flow refactor * ditch custom field change handler * fix initialValues * typed form data & validation * fixes multiple form validation issues along the way * isInitialValid → validateOnMount * metadata display tweaks * error feedback tweaks * oler assets checks, confeti on succes job, market fee on order, removed algo compute logic * more startJob logging * feedback & messaging changes * metadata display * return all algos, fixed & dynamic priced ones * fix DOM nesting * messaging updates * copy tweaks * check algorithm previous history for both acces and compute sercive types * handle start compute error * extra checks on start compute response * styling tweaks, fix toast UI errors * AssetSelection: empty screen, tweak min/max height * fix FRE issues on start compute * check is ordarable before start compute job * logging tweaks * disable eslint no-unused-vars rule for some Apollo code blocks * fix metadata editing for compute assets * consider dataset timeout for compute too Co-authored-by: Matthias Kretschmann <m@kretschmann.io>
2021-04-01 17:21:08 +02:00
return (
<>
2022-08-02 11:53:22 +02:00
<div
className={`${styles.info} ${
isUnsupportedPricing ? styles.warning : null
}`}
>
2021-10-18 20:44:33 +02:00
<FileIcon file={file} isLoading={fileIsLoading} small />
2022-08-02 11:53:22 +02:00
{isUnsupportedPricing ? (
<Alert
2022-08-02 11:53:22 +02:00
text={`No pricing schema available for this asset.`}
state="info"
/>
2022-08-02 11:53:22 +02:00
) : (
<Price
Fetching prices from Aquarius in AssetList component (#1774) * Fetching prices from Aquarius in AssetList component * Removing unused imports * Removing fetching logic from AssetList * Using Asset Price from Aquarius * removing unused code for loader * Updating ocean.js * Updating price format in tests * removing console logs * Fixing build issues * Updating condition for showing free price * Fixing tests * Removing logs * Showing No pricing schema available on asset teaser * Showing No pricing schema available on asset detail page * Adding additional tests * Removing console logs * Avoiding getInitialPaymentCollector failure (#1816) * early return is no web3 or ddo * Creating test for MetaFull * adding test: src/components/Asset/AssetContent/MetaSecondary.test.tsx * Adding test for bookmarks * Adding test for displaying payment collector * Removing comments * Renaming assetAquarius * Renaming assetWithAccessDetails * Ensuring that the payment collector is shown even without a wallet connected * Removing broken test * Using getDummyWeb3 for fetching the payment collector address * google validation (#1835) * Updating validation to exclude any google link * Updating Yup validation * Checking if domain includes google.com * Updating isGoogleUrl function * Moving isGoogleUrl into @utils/url/index file * isGoogleUrl function * Updating tests * Adding additional tests for other google domains * Updating tests * Updating isGoogleUrl file path * Updating pricing message (#1842) * Bump @storybook/addon-essentials from 6.5.13 to 6.5.15 (#1841) Bumps [@storybook/addon-essentials](https://github.com/storybookjs/storybook/tree/HEAD/addons/essentials) from 6.5.13 to 6.5.15. - [Release notes](https://github.com/storybookjs/storybook/releases) - [Changelog](https://github.com/storybookjs/storybook/blob/v6.5.15/CHANGELOG.md) - [Commits](https://github.com/storybookjs/storybook/commits/v6.5.15/addons/essentials) --- updated-dependencies: - dependency-name: "@storybook/addon-essentials" dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bump @types/jest from 29.2.3 to 29.2.5 (#1840) Bumps [@types/jest](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/jest) from 29.2.3 to 29.2.5. - [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases) - [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/jest) --- updated-dependencies: - dependency-name: "@types/jest" dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bump prettier from 2.8.0 to 2.8.1 (#1837) Bumps [prettier](https://github.com/prettier/prettier) from 2.8.0 to 2.8.1. - [Release notes](https://github.com/prettier/prettier/releases) - [Changelog](https://github.com/prettier/prettier/blob/main/CHANGELOG.md) - [Commits](https://github.com/prettier/prettier/compare/2.8.0...2.8.1) --- updated-dependencies: - dependency-name: prettier dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bump react-select from 5.6.1 to 5.7.0 (#1839) Bumps [react-select](https://github.com/JedWatson/react-select) from 5.6.1 to 5.7.0. - [Release notes](https://github.com/JedWatson/react-select/releases) - [Changelog](https://github.com/JedWatson/react-select/blob/master/docs/CHANGELOG.md) - [Commits](https://github.com/JedWatson/react-select/compare/react-select@5.6.1...react-select@5.7.0) --- updated-dependencies: - dependency-name: react-select dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bump react-tabs from 5.1.0 to 6.0.0 (#1838) Bumps [react-tabs](https://github.com/reactjs/react-tabs) from 5.1.0 to 6.0.0. - [Release notes](https://github.com/reactjs/react-tabs/releases) - [Commits](https://github.com/reactjs/react-tabs/compare/v5.1.0...v6.0.0) --- updated-dependencies: - dependency-name: react-tabs dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com> Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * fix asset route (#1836) * updating the buy button message for free assets * Updating pricing text for compute and algorithms * Updating tests * Adding a seperate sentence about paying gas fees for network charges with free assets * Fixing tests Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: mihaisc <mihai.scarlat@smartcontrol.ro> * Showing hosting type in File Info (#1846) * Bump @storybook/addon-essentials from 6.5.13 to 6.5.15 (#1841) Bumps [@storybook/addon-essentials](https://github.com/storybookjs/storybook/tree/HEAD/addons/essentials) from 6.5.13 to 6.5.15. - [Release notes](https://github.com/storybookjs/storybook/releases) - [Changelog](https://github.com/storybookjs/storybook/blob/v6.5.15/CHANGELOG.md) - [Commits](https://github.com/storybookjs/storybook/commits/v6.5.15/addons/essentials) --- updated-dependencies: - dependency-name: "@storybook/addon-essentials" dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bump @types/jest from 29.2.3 to 29.2.5 (#1840) Bumps [@types/jest](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/jest) from 29.2.3 to 29.2.5. - [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases) - [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/jest) --- updated-dependencies: - dependency-name: "@types/jest" dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bump prettier from 2.8.0 to 2.8.1 (#1837) Bumps [prettier](https://github.com/prettier/prettier) from 2.8.0 to 2.8.1. - [Release notes](https://github.com/prettier/prettier/releases) - [Changelog](https://github.com/prettier/prettier/blob/main/CHANGELOG.md) - [Commits](https://github.com/prettier/prettier/compare/2.8.0...2.8.1) --- updated-dependencies: - dependency-name: prettier dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bump react-select from 5.6.1 to 5.7.0 (#1839) Bumps [react-select](https://github.com/JedWatson/react-select) from 5.6.1 to 5.7.0. - [Release notes](https://github.com/JedWatson/react-select/releases) - [Changelog](https://github.com/JedWatson/react-select/blob/master/docs/CHANGELOG.md) - [Commits](https://github.com/JedWatson/react-select/compare/react-select@5.6.1...react-select@5.7.0) --- updated-dependencies: - dependency-name: react-select dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bump react-tabs from 5.1.0 to 6.0.0 (#1838) Bumps [react-tabs](https://github.com/reactjs/react-tabs) from 5.1.0 to 6.0.0. - [Release notes](https://github.com/reactjs/react-tabs/releases) - [Commits](https://github.com/reactjs/react-tabs/compare/v5.1.0...v6.0.0) --- updated-dependencies: - dependency-name: react-tabs dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com> Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * fix asset route (#1836) * Adding hosting type to the file info component * Writting smart contract hosting type across two lines Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: mihaisc <mihai.scarlat@smartcontrol.ro> * add initial price value for not supported price assets (#1851) * Updating test * Updating accessDetailsAndPricing * Adding orderPriceAndFees back in to show the price with fees on the asset detail page * Using price with fees for compute assets * Fixing conversions by ensuring that the symbol is always sent through * Removing unwanted changes in package-lock.json * Updating use of isUnsupportedPricing variable * Getting rid of getAccessDetailsForAssets completely * Removing unused imports and query * Fixing test * Removing unused import --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: mihaisc <mihai.scarlat@smartcontrol.ro> Co-authored-by: Bogdan Fazakas <bogdan.fazakas@gmail.com>
2023-02-09 10:25:15 +01:00
price={asset.stats?.price}
2022-08-02 11:53:22 +02:00
orderPriceAndFees={datasetOrderPriceAndFees}
conversion
size="large"
/>
)}
</div>
{isUnsupportedPricing ? null : asset.metadata.type === 'algorithm' ? (
<>
{asset.services[0].type === 'compute' && (
<Alert
text={
2022-08-15 15:57:53 +02:00
"This algorithm has been set to private by the publisher and can't be downloaded. You can run it against any allowed datasets though!"
2022-08-02 11:53:22 +02:00
}
state="info"
/>
)}
2022-02-10 15:33:16 +01:00
<AlgorithmDatasetsListForCompute
algorithmDid={asset.id}
2022-02-23 14:58:20 +01:00
asset={asset}
2022-02-10 15:33:16 +01:00
/>
</>
Start compute job (#439) * Wip start compute job * Wip select algorithm design * Asset selection form component, for start compute job (#442) * prototype AssetSelection * assetselection styling * typing "fix" * put back file info icon * AssetSelection styling in context * update start job method, fixed algo select, and fixed option typing * compute logic update * add has previous orders for algo asset * fixed search algorithm assets in start compute form * fixed lint errors * updated previous order for algo logic and compute flow * update use price hook and added buy DT for algo * display only alg of type exchange and sort by value * display only trusted algo for asset if field is set * added logic for allow all published algorithms or no algorithms allowed * asset selection style & spacing tweaks * refactor get algorithms for compute and edit compute * fixed form options and more refactoring * new ButtonBuy component * shared component between consume/compute * dealing with various states: loading, previous orders, help text output * effect dependencies * move error output into toast * formik data flow refactor * ditch custom field change handler * fix initialValues * typed form data & validation * fixes multiple form validation issues along the way * isInitialValid → validateOnMount * metadata display tweaks * error feedback tweaks * oler assets checks, confeti on succes job, market fee on order, removed algo compute logic * more startJob logging * feedback & messaging changes * metadata display * return all algos, fixed & dynamic priced ones * fix DOM nesting * messaging updates * copy tweaks * check algorithm previous history for both acces and compute sercive types * handle start compute error * extra checks on start compute response * styling tweaks, fix toast UI errors * AssetSelection: empty screen, tweak min/max height * fix FRE issues on start compute * check is ordarable before start compute job * logging tweaks * disable eslint no-unused-vars rule for some Apollo code blocks * fix metadata editing for compute assets * consider dataset timeout for compute too Co-authored-by: Matthias Kretschmann <m@kretschmann.io>
2021-04-01 17:21:08 +02:00
) : (
<Formik
Feat: Consumer Parameters (#1921) * feat: add consumer parameters to publish * fix: publish form validation * feat: update consumer parameters form * feat: add consumer parameter types * feat: update consumer parameter validation * feat: add consumer parameters structure * feat: add InputOptions error handling * feat: update consumer parameters validation * feat: update transformPublishFromToDdo * feat: add default options to parameter options * fix: value handling for select and mutliselect * feat: update "add new parameter" button label * feat: remove unused publish form sections * chore: remove console.log * chore: remove comments * feat: remove multiselect * feat: add consumer parameters section label * feat: update types * feat: update edit form fields * feat: parse consumer parameters in edit form * feat: add consumer parameters field to edit * feat: transform consumer parameters values before edit * feat: update "required" type to select * feat: update "required" type to select on edit form * fix: error object access * fix: edit flow crash * fix: validation when consumer parameters are not selected * feat: update validation for default consumer parameters value * fix: types * feat: add service consumer parameters to publish form * chore: remove console.log * feat: add service consumer parameters edit * chore: remove comments * fix: form edit metadata types * feat: add consume algo parameter structure * feat: consumer parameter required default value condition * feat: add consumer parameter groups to assetActions * fix: consumer parameters grouping * feat: update consumer parameters alignment * feat: update types * feat: allow service consumer parameters on dataset asset type * feat: add consumer parameters to ddo updated values in edit form * feat: add "data service" consumer parameters to consumption form * feat: allow service parameters on all asset types * feat: update parameter consume form design * feat: update asset actions consume parameters location * feat: add service parameters to download assets * refactor: consumer parameters actions * refactor: form action name * refactor: consumer parameters default input * refactor: consumer parameters select input * refactor: consumer parameter input * fix: props name * refactor: variable naming * refactor: consumer parameters form validation * refactor: rename consumer parameters types * refactor: extract consumer parameters form data to separate file * refactor: rename type * feat: controlled tabs for consumer params * feat: restore default value as required * refactor: parse values before edit * feat: add form to handle consumer parameters consumption * feat: send consumer params with download request * feat: send consumer params with compute request * feat: handle compute form initialization * chore: remove unused dependency * feat: handle download form data initialization * chore: remove console.log * feat: update types * fix: consumer parameter value types * feat: update ConsumerParameter type * feat: update ConsumerParameter type * chore: add comments * refactor: consumer parameters inputs * refactor: rename data and algo service params * refactor: consumer parameters form * refactor: consumer parameter form styling * refactor: make headers input reusable as KeyValueInput * refactor: refactorings, reduce duplication (WIP) * refactor: usercustomparameters consumption form creation/validation * refactor: return undefined consistently if property path not found on object * refactor: reuse fieldType and fieldOptions in DefaultInput * fix: parse ddo consumer parameters for edit form * fix: asset view crash for assets w/o consumer params * fix: publish preview for assets with no consumer params * fix: revert accidential rename of algoService * fix: revert publish navigation padding change * feat: update consumer parameters' labels and helpers * fix: consumer parameters validation * feat: update consumer parameter helper wording * chore: merge conflicts * feat: update types * fix: validate form on consumer parameter deletion * feat: add key value input placeholder props * fix: handle boolean type consumer parameters in consume form (#38) * Update src/components/Publish/_validation.ts Co-authored-by: Jamie Hewitt <jamie.hewitt15@gmail.com> * Update src/components/Asset/AssetActions/ConsumerParameters/FormConsumerParameters.module.css Co-authored-by: Jamie Hewitt <jamie.hewitt15@gmail.com> * Update src/components/Asset/Edit/_validation.ts Co-authored-by: Jamie Hewitt <jamie.hewitt15@gmail.com> * Update src/components/Asset/AssetActions/ConsumerParameters/index.tsx Co-authored-by: Jamie Hewitt <jamie.hewitt15@gmail.com> * Update src/components/Asset/AssetActions/ConsumerParameters/FormConsumerParameters.tsx Co-authored-by: Jamie Hewitt <jamie.hewitt15@gmail.com> * Update src/components/@shared/FormInput/index.tsx Co-authored-by: Jamie Hewitt <jamie.hewitt15@gmail.com> * Update src/components/@shared/FormInput/InputElement/ConsumerParameters/index.tsx Co-authored-by: Jamie Hewitt <jamie.hewitt15@gmail.com> * Update src/components/@shared/FormInput/InputElement/ConsumerParameters/index.tsx Co-authored-by: Jamie Hewitt <jamie.hewitt15@gmail.com> * Update src/components/@shared/FormInput/InputElement/ConsumerParameters/OptionsInput.tsx Co-authored-by: Jamie Hewitt <jamie.hewitt15@gmail.com> * Update src/components/@shared/FormInput/InputElement/ConsumerParameters/FormActions.tsx Co-authored-by: Jamie Hewitt <jamie.hewitt15@gmail.com> * Update src/@utils/provider.ts Co-authored-by: Jamie Hewitt <jamie.hewitt15@gmail.com> * fix: import paths * refactor: add consumer parameters validation types * feat: add string length min/max to consumer parameters validation * feat: add cp description to consume form * feat: reduce character limit in CP tab title * feat: update CP fields' placeholders and helpers * fix: show only relevant CPs in asset actions --------- Co-authored-by: Luca Milanese <luca.milanese90@gmail.com> Co-authored-by: Jamie Hewitt <jamie.hewitt15@gmail.com>
2023-09-07 16:14:27 +02:00
initialValues={getInitialValues(asset, selectedAlgorithmAsset)}
Start compute job (#439) * Wip start compute job * Wip select algorithm design * Asset selection form component, for start compute job (#442) * prototype AssetSelection * assetselection styling * typing "fix" * put back file info icon * AssetSelection styling in context * update start job method, fixed algo select, and fixed option typing * compute logic update * add has previous orders for algo asset * fixed search algorithm assets in start compute form * fixed lint errors * updated previous order for algo logic and compute flow * update use price hook and added buy DT for algo * display only alg of type exchange and sort by value * display only trusted algo for asset if field is set * added logic for allow all published algorithms or no algorithms allowed * asset selection style & spacing tweaks * refactor get algorithms for compute and edit compute * fixed form options and more refactoring * new ButtonBuy component * shared component between consume/compute * dealing with various states: loading, previous orders, help text output * effect dependencies * move error output into toast * formik data flow refactor * ditch custom field change handler * fix initialValues * typed form data & validation * fixes multiple form validation issues along the way * isInitialValid → validateOnMount * metadata display tweaks * error feedback tweaks * oler assets checks, confeti on succes job, market fee on order, removed algo compute logic * more startJob logging * feedback & messaging changes * metadata display * return all algos, fixed & dynamic priced ones * fix DOM nesting * messaging updates * copy tweaks * check algorithm previous history for both acces and compute sercive types * handle start compute error * extra checks on start compute response * styling tweaks, fix toast UI errors * AssetSelection: empty screen, tweak min/max height * fix FRE issues on start compute * check is ordarable before start compute job * logging tweaks * disable eslint no-unused-vars rule for some Apollo code blocks * fix metadata editing for compute assets * consider dataset timeout for compute too Co-authored-by: Matthias Kretschmann <m@kretschmann.io>
2021-04-01 17:21:08 +02:00
validateOnMount
Feat: Consumer Parameters (#1921) * feat: add consumer parameters to publish * fix: publish form validation * feat: update consumer parameters form * feat: add consumer parameter types * feat: update consumer parameter validation * feat: add consumer parameters structure * feat: add InputOptions error handling * feat: update consumer parameters validation * feat: update transformPublishFromToDdo * feat: add default options to parameter options * fix: value handling for select and mutliselect * feat: update "add new parameter" button label * feat: remove unused publish form sections * chore: remove console.log * chore: remove comments * feat: remove multiselect * feat: add consumer parameters section label * feat: update types * feat: update edit form fields * feat: parse consumer parameters in edit form * feat: add consumer parameters field to edit * feat: transform consumer parameters values before edit * feat: update "required" type to select * feat: update "required" type to select on edit form * fix: error object access * fix: edit flow crash * fix: validation when consumer parameters are not selected * feat: update validation for default consumer parameters value * fix: types * feat: add service consumer parameters to publish form * chore: remove console.log * feat: add service consumer parameters edit * chore: remove comments * fix: form edit metadata types * feat: add consume algo parameter structure * feat: consumer parameter required default value condition * feat: add consumer parameter groups to assetActions * fix: consumer parameters grouping * feat: update consumer parameters alignment * feat: update types * feat: allow service consumer parameters on dataset asset type * feat: add consumer parameters to ddo updated values in edit form * feat: add "data service" consumer parameters to consumption form * feat: allow service parameters on all asset types * feat: update parameter consume form design * feat: update asset actions consume parameters location * feat: add service parameters to download assets * refactor: consumer parameters actions * refactor: form action name * refactor: consumer parameters default input * refactor: consumer parameters select input * refactor: consumer parameter input * fix: props name * refactor: variable naming * refactor: consumer parameters form validation * refactor: rename consumer parameters types * refactor: extract consumer parameters form data to separate file * refactor: rename type * feat: controlled tabs for consumer params * feat: restore default value as required * refactor: parse values before edit * feat: add form to handle consumer parameters consumption * feat: send consumer params with download request * feat: send consumer params with compute request * feat: handle compute form initialization * chore: remove unused dependency * feat: handle download form data initialization * chore: remove console.log * feat: update types * fix: consumer parameter value types * feat: update ConsumerParameter type * feat: update ConsumerParameter type * chore: add comments * refactor: consumer parameters inputs * refactor: rename data and algo service params * refactor: consumer parameters form * refactor: consumer parameter form styling * refactor: make headers input reusable as KeyValueInput * refactor: refactorings, reduce duplication (WIP) * refactor: usercustomparameters consumption form creation/validation * refactor: return undefined consistently if property path not found on object * refactor: reuse fieldType and fieldOptions in DefaultInput * fix: parse ddo consumer parameters for edit form * fix: asset view crash for assets w/o consumer params * fix: publish preview for assets with no consumer params * fix: revert accidential rename of algoService * fix: revert publish navigation padding change * feat: update consumer parameters' labels and helpers * fix: consumer parameters validation * feat: update consumer parameter helper wording * chore: merge conflicts * feat: update types * fix: validate form on consumer parameter deletion * feat: add key value input placeholder props * fix: handle boolean type consumer parameters in consume form (#38) * Update src/components/Publish/_validation.ts Co-authored-by: Jamie Hewitt <jamie.hewitt15@gmail.com> * Update src/components/Asset/AssetActions/ConsumerParameters/FormConsumerParameters.module.css Co-authored-by: Jamie Hewitt <jamie.hewitt15@gmail.com> * Update src/components/Asset/Edit/_validation.ts Co-authored-by: Jamie Hewitt <jamie.hewitt15@gmail.com> * Update src/components/Asset/AssetActions/ConsumerParameters/index.tsx Co-authored-by: Jamie Hewitt <jamie.hewitt15@gmail.com> * Update src/components/Asset/AssetActions/ConsumerParameters/FormConsumerParameters.tsx Co-authored-by: Jamie Hewitt <jamie.hewitt15@gmail.com> * Update src/components/@shared/FormInput/index.tsx Co-authored-by: Jamie Hewitt <jamie.hewitt15@gmail.com> * Update src/components/@shared/FormInput/InputElement/ConsumerParameters/index.tsx Co-authored-by: Jamie Hewitt <jamie.hewitt15@gmail.com> * Update src/components/@shared/FormInput/InputElement/ConsumerParameters/index.tsx Co-authored-by: Jamie Hewitt <jamie.hewitt15@gmail.com> * Update src/components/@shared/FormInput/InputElement/ConsumerParameters/OptionsInput.tsx Co-authored-by: Jamie Hewitt <jamie.hewitt15@gmail.com> * Update src/components/@shared/FormInput/InputElement/ConsumerParameters/FormActions.tsx Co-authored-by: Jamie Hewitt <jamie.hewitt15@gmail.com> * Update src/@utils/provider.ts Co-authored-by: Jamie Hewitt <jamie.hewitt15@gmail.com> * fix: import paths * refactor: add consumer parameters validation types * feat: add string length min/max to consumer parameters validation * feat: add cp description to consume form * feat: reduce character limit in CP tab title * feat: update CP fields' placeholders and helpers * fix: show only relevant CPs in asset actions --------- Co-authored-by: Luca Milanese <luca.milanese90@gmail.com> Co-authored-by: Jamie Hewitt <jamie.hewitt15@gmail.com>
2023-09-07 16:14:27 +02:00
validationSchema={getComputeValidationSchema(
asset.services[0].consumerParameters,
selectedAlgorithmAsset?.services[0].consumerParameters,
selectedAlgorithmAsset?.metadata?.algorithm?.consumerParameters
)}
enableReinitialize
onSubmit={onSubmit}
Start compute job (#439) * Wip start compute job * Wip select algorithm design * Asset selection form component, for start compute job (#442) * prototype AssetSelection * assetselection styling * typing "fix" * put back file info icon * AssetSelection styling in context * update start job method, fixed algo select, and fixed option typing * compute logic update * add has previous orders for algo asset * fixed search algorithm assets in start compute form * fixed lint errors * updated previous order for algo logic and compute flow * update use price hook and added buy DT for algo * display only alg of type exchange and sort by value * display only trusted algo for asset if field is set * added logic for allow all published algorithms or no algorithms allowed * asset selection style & spacing tweaks * refactor get algorithms for compute and edit compute * fixed form options and more refactoring * new ButtonBuy component * shared component between consume/compute * dealing with various states: loading, previous orders, help text output * effect dependencies * move error output into toast * formik data flow refactor * ditch custom field change handler * fix initialValues * typed form data & validation * fixes multiple form validation issues along the way * isInitialValid → validateOnMount * metadata display tweaks * error feedback tweaks * oler assets checks, confeti on succes job, market fee on order, removed algo compute logic * more startJob logging * feedback & messaging changes * metadata display * return all algos, fixed & dynamic priced ones * fix DOM nesting * messaging updates * copy tweaks * check algorithm previous history for both acces and compute sercive types * handle start compute error * extra checks on start compute response * styling tweaks, fix toast UI errors * AssetSelection: empty screen, tweak min/max height * fix FRE issues on start compute * check is ordarable before start compute job * logging tweaks * disable eslint no-unused-vars rule for some Apollo code blocks * fix metadata editing for compute assets * consider dataset timeout for compute too Co-authored-by: Matthias Kretschmann <m@kretschmann.io>
2021-04-01 17:21:08 +02:00
>
<FormStartComputeDataset
algorithms={algorithmList}
ddoListAlgorithms={ddoAlgorithmList}
selectedAlgorithmAsset={selectedAlgorithmAsset}
Start compute job (#439) * Wip start compute job * Wip select algorithm design * Asset selection form component, for start compute job (#442) * prototype AssetSelection * assetselection styling * typing "fix" * put back file info icon * AssetSelection styling in context * update start job method, fixed algo select, and fixed option typing * compute logic update * add has previous orders for algo asset * fixed search algorithm assets in start compute form * fixed lint errors * updated previous order for algo logic and compute flow * update use price hook and added buy DT for algo * display only alg of type exchange and sort by value * display only trusted algo for asset if field is set * added logic for allow all published algorithms or no algorithms allowed * asset selection style & spacing tweaks * refactor get algorithms for compute and edit compute * fixed form options and more refactoring * new ButtonBuy component * shared component between consume/compute * dealing with various states: loading, previous orders, help text output * effect dependencies * move error output into toast * formik data flow refactor * ditch custom field change handler * fix initialValues * typed form data & validation * fixes multiple form validation issues along the way * isInitialValid → validateOnMount * metadata display tweaks * error feedback tweaks * oler assets checks, confeti on succes job, market fee on order, removed algo compute logic * more startJob logging * feedback & messaging changes * metadata display * return all algos, fixed & dynamic priced ones * fix DOM nesting * messaging updates * copy tweaks * check algorithm previous history for both acces and compute sercive types * handle start compute error * extra checks on start compute response * styling tweaks, fix toast UI errors * AssetSelection: empty screen, tweak min/max height * fix FRE issues on start compute * check is ordarable before start compute job * logging tweaks * disable eslint no-unused-vars rule for some Apollo code blocks * fix metadata editing for compute assets * consider dataset timeout for compute too Co-authored-by: Matthias Kretschmann <m@kretschmann.io>
2021-04-01 17:21:08 +02:00
setSelectedAlgorithm={setSelectedAlgorithmAsset}
2022-06-22 14:40:35 +02:00
isLoading={isOrdering || isRequestingAlgoOrderPrice}
Start compute job (#439) * Wip start compute job * Wip select algorithm design * Asset selection form component, for start compute job (#442) * prototype AssetSelection * assetselection styling * typing "fix" * put back file info icon * AssetSelection styling in context * update start job method, fixed algo select, and fixed option typing * compute logic update * add has previous orders for algo asset * fixed search algorithm assets in start compute form * fixed lint errors * updated previous order for algo logic and compute flow * update use price hook and added buy DT for algo * display only alg of type exchange and sort by value * display only trusted algo for asset if field is set * added logic for allow all published algorithms or no algorithms allowed * asset selection style & spacing tweaks * refactor get algorithms for compute and edit compute * fixed form options and more refactoring * new ButtonBuy component * shared component between consume/compute * dealing with various states: loading, previous orders, help text output * effect dependencies * move error output into toast * formik data flow refactor * ditch custom field change handler * fix initialValues * typed form data & validation * fixes multiple form validation issues along the way * isInitialValid → validateOnMount * metadata display tweaks * error feedback tweaks * oler assets checks, confeti on succes job, market fee on order, removed algo compute logic * more startJob logging * feedback & messaging changes * metadata display * return all algos, fixed & dynamic priced ones * fix DOM nesting * messaging updates * copy tweaks * check algorithm previous history for both acces and compute sercive types * handle start compute error * extra checks on start compute response * styling tweaks, fix toast UI errors * AssetSelection: empty screen, tweak min/max height * fix FRE issues on start compute * check is ordarable before start compute job * logging tweaks * disable eslint no-unused-vars rule for some Apollo code blocks * fix metadata editing for compute assets * consider dataset timeout for compute too Co-authored-by: Matthias Kretschmann <m@kretschmann.io>
2021-04-01 17:21:08 +02:00
isComputeButtonDisabled={isComputeButtonDisabled}
2022-10-19 15:47:04 +02:00
hasPreviousOrder={!!validOrderTx}
Start compute job (#439) * Wip start compute job * Wip select algorithm design * Asset selection form component, for start compute job (#442) * prototype AssetSelection * assetselection styling * typing "fix" * put back file info icon * AssetSelection styling in context * update start job method, fixed algo select, and fixed option typing * compute logic update * add has previous orders for algo asset * fixed search algorithm assets in start compute form * fixed lint errors * updated previous order for algo logic and compute flow * update use price hook and added buy DT for algo * display only alg of type exchange and sort by value * display only trusted algo for asset if field is set * added logic for allow all published algorithms or no algorithms allowed * asset selection style & spacing tweaks * refactor get algorithms for compute and edit compute * fixed form options and more refactoring * new ButtonBuy component * shared component between consume/compute * dealing with various states: loading, previous orders, help text output * effect dependencies * move error output into toast * formik data flow refactor * ditch custom field change handler * fix initialValues * typed form data & validation * fixes multiple form validation issues along the way * isInitialValid → validateOnMount * metadata display tweaks * error feedback tweaks * oler assets checks, confeti on succes job, market fee on order, removed algo compute logic * more startJob logging * feedback & messaging changes * metadata display * return all algos, fixed & dynamic priced ones * fix DOM nesting * messaging updates * copy tweaks * check algorithm previous history for both acces and compute sercive types * handle start compute error * extra checks on start compute response * styling tweaks, fix toast UI errors * AssetSelection: empty screen, tweak min/max height * fix FRE issues on start compute * check is ordarable before start compute job * logging tweaks * disable eslint no-unused-vars rule for some Apollo code blocks * fix metadata editing for compute assets * consider dataset timeout for compute too Co-authored-by: Matthias Kretschmann <m@kretschmann.io>
2021-04-01 17:21:08 +02:00
hasDatatoken={hasDatatoken}
dtBalance={dtBalance}
2022-02-10 15:33:16 +01:00
assetType={asset?.metadata.type}
2022-03-08 00:23:54 +01:00
assetTimeout={secondsToString(asset?.services[0].timeout)}
2022-10-19 15:47:04 +02:00
hasPreviousOrderSelectedComputeAsset={!!validAlgorithmOrderTx}
hasDatatokenSelectedComputeAsset={hasAlgoAssetDatatoken}
Release candidate 09-01-2023 (#1843) * Avoiding getInitialPaymentCollector failure (#1816) * early return is no web3 or ddo * Creating test for MetaFull * adding test: src/components/Asset/AssetContent/MetaSecondary.test.tsx * Adding test for bookmarks * Adding test for displaying payment collector * Removing comments * Renaming assetAquarius * Renaming assetWithAccessDetails * Ensuring that the payment collector is shown even without a wallet connected * Removing broken test * Using getDummyWeb3 for fetching the payment collector address * google validation (#1835) * Updating validation to exclude any google link * Updating Yup validation * Checking if domain includes google.com * Updating isGoogleUrl function * Moving isGoogleUrl into @utils/url/index file * isGoogleUrl function * Updating tests * Adding additional tests for other google domains * Updating tests * Updating isGoogleUrl file path * Updating pricing message (#1842) * Bump @storybook/addon-essentials from 6.5.13 to 6.5.15 (#1841) Bumps [@storybook/addon-essentials](https://github.com/storybookjs/storybook/tree/HEAD/addons/essentials) from 6.5.13 to 6.5.15. - [Release notes](https://github.com/storybookjs/storybook/releases) - [Changelog](https://github.com/storybookjs/storybook/blob/v6.5.15/CHANGELOG.md) - [Commits](https://github.com/storybookjs/storybook/commits/v6.5.15/addons/essentials) --- updated-dependencies: - dependency-name: "@storybook/addon-essentials" dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bump @types/jest from 29.2.3 to 29.2.5 (#1840) Bumps [@types/jest](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/jest) from 29.2.3 to 29.2.5. - [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases) - [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/jest) --- updated-dependencies: - dependency-name: "@types/jest" dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bump prettier from 2.8.0 to 2.8.1 (#1837) Bumps [prettier](https://github.com/prettier/prettier) from 2.8.0 to 2.8.1. - [Release notes](https://github.com/prettier/prettier/releases) - [Changelog](https://github.com/prettier/prettier/blob/main/CHANGELOG.md) - [Commits](https://github.com/prettier/prettier/compare/2.8.0...2.8.1) --- updated-dependencies: - dependency-name: prettier dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bump react-select from 5.6.1 to 5.7.0 (#1839) Bumps [react-select](https://github.com/JedWatson/react-select) from 5.6.1 to 5.7.0. - [Release notes](https://github.com/JedWatson/react-select/releases) - [Changelog](https://github.com/JedWatson/react-select/blob/master/docs/CHANGELOG.md) - [Commits](https://github.com/JedWatson/react-select/compare/react-select@5.6.1...react-select@5.7.0) --- updated-dependencies: - dependency-name: react-select dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bump react-tabs from 5.1.0 to 6.0.0 (#1838) Bumps [react-tabs](https://github.com/reactjs/react-tabs) from 5.1.0 to 6.0.0. - [Release notes](https://github.com/reactjs/react-tabs/releases) - [Commits](https://github.com/reactjs/react-tabs/compare/v5.1.0...v6.0.0) --- updated-dependencies: - dependency-name: react-tabs dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com> Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * fix asset route (#1836) * updating the buy button message for free assets * Updating pricing text for compute and algorithms * Updating tests * Adding a seperate sentence about paying gas fees for network charges with free assets * Fixing tests Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: mihaisc <mihai.scarlat@smartcontrol.ro> * Showing hosting type in File Info (#1846) * Bump @storybook/addon-essentials from 6.5.13 to 6.5.15 (#1841) Bumps [@storybook/addon-essentials](https://github.com/storybookjs/storybook/tree/HEAD/addons/essentials) from 6.5.13 to 6.5.15. - [Release notes](https://github.com/storybookjs/storybook/releases) - [Changelog](https://github.com/storybookjs/storybook/blob/v6.5.15/CHANGELOG.md) - [Commits](https://github.com/storybookjs/storybook/commits/v6.5.15/addons/essentials) --- updated-dependencies: - dependency-name: "@storybook/addon-essentials" dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bump @types/jest from 29.2.3 to 29.2.5 (#1840) Bumps [@types/jest](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/jest) from 29.2.3 to 29.2.5. - [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases) - [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/jest) --- updated-dependencies: - dependency-name: "@types/jest" dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bump prettier from 2.8.0 to 2.8.1 (#1837) Bumps [prettier](https://github.com/prettier/prettier) from 2.8.0 to 2.8.1. - [Release notes](https://github.com/prettier/prettier/releases) - [Changelog](https://github.com/prettier/prettier/blob/main/CHANGELOG.md) - [Commits](https://github.com/prettier/prettier/compare/2.8.0...2.8.1) --- updated-dependencies: - dependency-name: prettier dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bump react-select from 5.6.1 to 5.7.0 (#1839) Bumps [react-select](https://github.com/JedWatson/react-select) from 5.6.1 to 5.7.0. - [Release notes](https://github.com/JedWatson/react-select/releases) - [Changelog](https://github.com/JedWatson/react-select/blob/master/docs/CHANGELOG.md) - [Commits](https://github.com/JedWatson/react-select/compare/react-select@5.6.1...react-select@5.7.0) --- updated-dependencies: - dependency-name: react-select dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bump react-tabs from 5.1.0 to 6.0.0 (#1838) Bumps [react-tabs](https://github.com/reactjs/react-tabs) from 5.1.0 to 6.0.0. - [Release notes](https://github.com/reactjs/react-tabs/releases) - [Commits](https://github.com/reactjs/react-tabs/compare/v5.1.0...v6.0.0) --- updated-dependencies: - dependency-name: react-tabs dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com> Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * fix asset route (#1836) * Adding hosting type to the file info component * Writting smart contract hosting type across two lines Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: mihaisc <mihai.scarlat@smartcontrol.ro> * add initial price value for not supported price assets (#1851) * Fix compute basetoken issue (#1829) * fix lint * add dynamic provider fees * fixes * cleanup and more fixes * bump oceanlib to 2.6.0 * fix 404 styling (#1850) * Fixing the z-index for the tippy component (#1858) * Removing infinite approval (#1857) * Removing infinite approvals * Removing infinite approval content message * Removing infinite approval from default user preferences Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: mihaisc <mihai.scarlat@smartcontrol.ro> Co-authored-by: Bogdan Fazakas <bogdan.fazakas@gmail.com> Co-authored-by: EnzoVezzaro <enzo-vezzaro@live.it>
2023-01-18 11:35:14 +01:00
datasetSymbol={
asset?.accessDetails?.baseToken?.symbol ||
(asset?.chainId === 137 ? 'mOCEAN' : 'OCEAN')
}
2022-11-02 16:24:20 +01:00
algorithmSymbol={
selectedAlgorithmAsset?.accessDetails?.baseToken?.symbol ||
Release candidate 09-01-2023 (#1843) * Avoiding getInitialPaymentCollector failure (#1816) * early return is no web3 or ddo * Creating test for MetaFull * adding test: src/components/Asset/AssetContent/MetaSecondary.test.tsx * Adding test for bookmarks * Adding test for displaying payment collector * Removing comments * Renaming assetAquarius * Renaming assetWithAccessDetails * Ensuring that the payment collector is shown even without a wallet connected * Removing broken test * Using getDummyWeb3 for fetching the payment collector address * google validation (#1835) * Updating validation to exclude any google link * Updating Yup validation * Checking if domain includes google.com * Updating isGoogleUrl function * Moving isGoogleUrl into @utils/url/index file * isGoogleUrl function * Updating tests * Adding additional tests for other google domains * Updating tests * Updating isGoogleUrl file path * Updating pricing message (#1842) * Bump @storybook/addon-essentials from 6.5.13 to 6.5.15 (#1841) Bumps [@storybook/addon-essentials](https://github.com/storybookjs/storybook/tree/HEAD/addons/essentials) from 6.5.13 to 6.5.15. - [Release notes](https://github.com/storybookjs/storybook/releases) - [Changelog](https://github.com/storybookjs/storybook/blob/v6.5.15/CHANGELOG.md) - [Commits](https://github.com/storybookjs/storybook/commits/v6.5.15/addons/essentials) --- updated-dependencies: - dependency-name: "@storybook/addon-essentials" dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bump @types/jest from 29.2.3 to 29.2.5 (#1840) Bumps [@types/jest](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/jest) from 29.2.3 to 29.2.5. - [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases) - [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/jest) --- updated-dependencies: - dependency-name: "@types/jest" dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bump prettier from 2.8.0 to 2.8.1 (#1837) Bumps [prettier](https://github.com/prettier/prettier) from 2.8.0 to 2.8.1. - [Release notes](https://github.com/prettier/prettier/releases) - [Changelog](https://github.com/prettier/prettier/blob/main/CHANGELOG.md) - [Commits](https://github.com/prettier/prettier/compare/2.8.0...2.8.1) --- updated-dependencies: - dependency-name: prettier dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bump react-select from 5.6.1 to 5.7.0 (#1839) Bumps [react-select](https://github.com/JedWatson/react-select) from 5.6.1 to 5.7.0. - [Release notes](https://github.com/JedWatson/react-select/releases) - [Changelog](https://github.com/JedWatson/react-select/blob/master/docs/CHANGELOG.md) - [Commits](https://github.com/JedWatson/react-select/compare/react-select@5.6.1...react-select@5.7.0) --- updated-dependencies: - dependency-name: react-select dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bump react-tabs from 5.1.0 to 6.0.0 (#1838) Bumps [react-tabs](https://github.com/reactjs/react-tabs) from 5.1.0 to 6.0.0. - [Release notes](https://github.com/reactjs/react-tabs/releases) - [Commits](https://github.com/reactjs/react-tabs/compare/v5.1.0...v6.0.0) --- updated-dependencies: - dependency-name: react-tabs dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com> Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * fix asset route (#1836) * updating the buy button message for free assets * Updating pricing text for compute and algorithms * Updating tests * Adding a seperate sentence about paying gas fees for network charges with free assets * Fixing tests Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: mihaisc <mihai.scarlat@smartcontrol.ro> * Showing hosting type in File Info (#1846) * Bump @storybook/addon-essentials from 6.5.13 to 6.5.15 (#1841) Bumps [@storybook/addon-essentials](https://github.com/storybookjs/storybook/tree/HEAD/addons/essentials) from 6.5.13 to 6.5.15. - [Release notes](https://github.com/storybookjs/storybook/releases) - [Changelog](https://github.com/storybookjs/storybook/blob/v6.5.15/CHANGELOG.md) - [Commits](https://github.com/storybookjs/storybook/commits/v6.5.15/addons/essentials) --- updated-dependencies: - dependency-name: "@storybook/addon-essentials" dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bump @types/jest from 29.2.3 to 29.2.5 (#1840) Bumps [@types/jest](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/jest) from 29.2.3 to 29.2.5. - [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases) - [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/jest) --- updated-dependencies: - dependency-name: "@types/jest" dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bump prettier from 2.8.0 to 2.8.1 (#1837) Bumps [prettier](https://github.com/prettier/prettier) from 2.8.0 to 2.8.1. - [Release notes](https://github.com/prettier/prettier/releases) - [Changelog](https://github.com/prettier/prettier/blob/main/CHANGELOG.md) - [Commits](https://github.com/prettier/prettier/compare/2.8.0...2.8.1) --- updated-dependencies: - dependency-name: prettier dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bump react-select from 5.6.1 to 5.7.0 (#1839) Bumps [react-select](https://github.com/JedWatson/react-select) from 5.6.1 to 5.7.0. - [Release notes](https://github.com/JedWatson/react-select/releases) - [Changelog](https://github.com/JedWatson/react-select/blob/master/docs/CHANGELOG.md) - [Commits](https://github.com/JedWatson/react-select/compare/react-select@5.6.1...react-select@5.7.0) --- updated-dependencies: - dependency-name: react-select dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bump react-tabs from 5.1.0 to 6.0.0 (#1838) Bumps [react-tabs](https://github.com/reactjs/react-tabs) from 5.1.0 to 6.0.0. - [Release notes](https://github.com/reactjs/react-tabs/releases) - [Commits](https://github.com/reactjs/react-tabs/compare/v5.1.0...v6.0.0) --- updated-dependencies: - dependency-name: react-tabs dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com> Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * fix asset route (#1836) * Adding hosting type to the file info component * Writting smart contract hosting type across two lines Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: mihaisc <mihai.scarlat@smartcontrol.ro> * add initial price value for not supported price assets (#1851) * Fix compute basetoken issue (#1829) * fix lint * add dynamic provider fees * fixes * cleanup and more fixes * bump oceanlib to 2.6.0 * fix 404 styling (#1850) * Fixing the z-index for the tippy component (#1858) * Removing infinite approval (#1857) * Removing infinite approvals * Removing infinite approval content message * Removing infinite approval from default user preferences Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: mihaisc <mihai.scarlat@smartcontrol.ro> Co-authored-by: Bogdan Fazakas <bogdan.fazakas@gmail.com> Co-authored-by: EnzoVezzaro <enzo-vezzaro@live.it>
2023-01-18 11:35:14 +01:00
(selectedAlgorithmAsset?.chainId === 137 ? 'mOCEAN' : 'OCEAN')
}
Release candidate 09-01-2023 (#1843) * Avoiding getInitialPaymentCollector failure (#1816) * early return is no web3 or ddo * Creating test for MetaFull * adding test: src/components/Asset/AssetContent/MetaSecondary.test.tsx * Adding test for bookmarks * Adding test for displaying payment collector * Removing comments * Renaming assetAquarius * Renaming assetWithAccessDetails * Ensuring that the payment collector is shown even without a wallet connected * Removing broken test * Using getDummyWeb3 for fetching the payment collector address * google validation (#1835) * Updating validation to exclude any google link * Updating Yup validation * Checking if domain includes google.com * Updating isGoogleUrl function * Moving isGoogleUrl into @utils/url/index file * isGoogleUrl function * Updating tests * Adding additional tests for other google domains * Updating tests * Updating isGoogleUrl file path * Updating pricing message (#1842) * Bump @storybook/addon-essentials from 6.5.13 to 6.5.15 (#1841) Bumps [@storybook/addon-essentials](https://github.com/storybookjs/storybook/tree/HEAD/addons/essentials) from 6.5.13 to 6.5.15. - [Release notes](https://github.com/storybookjs/storybook/releases) - [Changelog](https://github.com/storybookjs/storybook/blob/v6.5.15/CHANGELOG.md) - [Commits](https://github.com/storybookjs/storybook/commits/v6.5.15/addons/essentials) --- updated-dependencies: - dependency-name: "@storybook/addon-essentials" dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bump @types/jest from 29.2.3 to 29.2.5 (#1840) Bumps [@types/jest](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/jest) from 29.2.3 to 29.2.5. - [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases) - [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/jest) --- updated-dependencies: - dependency-name: "@types/jest" dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bump prettier from 2.8.0 to 2.8.1 (#1837) Bumps [prettier](https://github.com/prettier/prettier) from 2.8.0 to 2.8.1. - [Release notes](https://github.com/prettier/prettier/releases) - [Changelog](https://github.com/prettier/prettier/blob/main/CHANGELOG.md) - [Commits](https://github.com/prettier/prettier/compare/2.8.0...2.8.1) --- updated-dependencies: - dependency-name: prettier dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bump react-select from 5.6.1 to 5.7.0 (#1839) Bumps [react-select](https://github.com/JedWatson/react-select) from 5.6.1 to 5.7.0. - [Release notes](https://github.com/JedWatson/react-select/releases) - [Changelog](https://github.com/JedWatson/react-select/blob/master/docs/CHANGELOG.md) - [Commits](https://github.com/JedWatson/react-select/compare/react-select@5.6.1...react-select@5.7.0) --- updated-dependencies: - dependency-name: react-select dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bump react-tabs from 5.1.0 to 6.0.0 (#1838) Bumps [react-tabs](https://github.com/reactjs/react-tabs) from 5.1.0 to 6.0.0. - [Release notes](https://github.com/reactjs/react-tabs/releases) - [Commits](https://github.com/reactjs/react-tabs/compare/v5.1.0...v6.0.0) --- updated-dependencies: - dependency-name: react-tabs dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com> Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * fix asset route (#1836) * updating the buy button message for free assets * Updating pricing text for compute and algorithms * Updating tests * Adding a seperate sentence about paying gas fees for network charges with free assets * Fixing tests Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: mihaisc <mihai.scarlat@smartcontrol.ro> * Showing hosting type in File Info (#1846) * Bump @storybook/addon-essentials from 6.5.13 to 6.5.15 (#1841) Bumps [@storybook/addon-essentials](https://github.com/storybookjs/storybook/tree/HEAD/addons/essentials) from 6.5.13 to 6.5.15. - [Release notes](https://github.com/storybookjs/storybook/releases) - [Changelog](https://github.com/storybookjs/storybook/blob/v6.5.15/CHANGELOG.md) - [Commits](https://github.com/storybookjs/storybook/commits/v6.5.15/addons/essentials) --- updated-dependencies: - dependency-name: "@storybook/addon-essentials" dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bump @types/jest from 29.2.3 to 29.2.5 (#1840) Bumps [@types/jest](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/jest) from 29.2.3 to 29.2.5. - [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases) - [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/jest) --- updated-dependencies: - dependency-name: "@types/jest" dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bump prettier from 2.8.0 to 2.8.1 (#1837) Bumps [prettier](https://github.com/prettier/prettier) from 2.8.0 to 2.8.1. - [Release notes](https://github.com/prettier/prettier/releases) - [Changelog](https://github.com/prettier/prettier/blob/main/CHANGELOG.md) - [Commits](https://github.com/prettier/prettier/compare/2.8.0...2.8.1) --- updated-dependencies: - dependency-name: prettier dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bump react-select from 5.6.1 to 5.7.0 (#1839) Bumps [react-select](https://github.com/JedWatson/react-select) from 5.6.1 to 5.7.0. - [Release notes](https://github.com/JedWatson/react-select/releases) - [Changelog](https://github.com/JedWatson/react-select/blob/master/docs/CHANGELOG.md) - [Commits](https://github.com/JedWatson/react-select/compare/react-select@5.6.1...react-select@5.7.0) --- updated-dependencies: - dependency-name: react-select dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bump react-tabs from 5.1.0 to 6.0.0 (#1838) Bumps [react-tabs](https://github.com/reactjs/react-tabs) from 5.1.0 to 6.0.0. - [Release notes](https://github.com/reactjs/react-tabs/releases) - [Commits](https://github.com/reactjs/react-tabs/compare/v5.1.0...v6.0.0) --- updated-dependencies: - dependency-name: react-tabs dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com> Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * fix asset route (#1836) * Adding hosting type to the file info component * Writting smart contract hosting type across two lines Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: mihaisc <mihai.scarlat@smartcontrol.ro> * add initial price value for not supported price assets (#1851) * Fix compute basetoken issue (#1829) * fix lint * add dynamic provider fees * fixes * cleanup and more fixes * bump oceanlib to 2.6.0 * fix 404 styling (#1850) * Fixing the z-index for the tippy component (#1858) * Removing infinite approval (#1857) * Removing infinite approvals * Removing infinite approval content message * Removing infinite approval from default user preferences Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: mihaisc <mihai.scarlat@smartcontrol.ro> Co-authored-by: Bogdan Fazakas <bogdan.fazakas@gmail.com> Co-authored-by: EnzoVezzaro <enzo-vezzaro@live.it>
2023-01-18 11:35:14 +01:00
providerFeesSymbol={providerFeesSymbol}
dtSymbolSelectedComputeAsset={
selectedAlgorithmAsset?.datatokens[0]?.symbol
}
dtBalanceSelectedComputeAsset={algorithmDTBalance}
selectedComputeAssetType="algorithm"
2022-03-08 00:23:54 +01:00
selectedComputeAssetTimeout={secondsToString(
2022-03-07 23:09:53 +01:00
selectedAlgorithmAsset?.services[0]?.timeout
2022-03-08 00:23:54 +01:00
)}
// lazy comment when removing pricingStepText
2022-03-12 13:44:12 +01:00
stepText={computeStatusText}
2022-05-02 10:15:50 +02:00
isConsumable={isConsumablePrice}
consumableFeedback={consumableFeedback}
datasetOrderPriceAndFees={datasetOrderPriceAndFees}
algoOrderPriceAndFees={algoOrderPriceAndFees}
providerFeeAmount={providerFeeAmount}
validUntil={computeValidUntil}
retry={retry}
Start compute job (#439) * Wip start compute job * Wip select algorithm design * Asset selection form component, for start compute job (#442) * prototype AssetSelection * assetselection styling * typing "fix" * put back file info icon * AssetSelection styling in context * update start job method, fixed algo select, and fixed option typing * compute logic update * add has previous orders for algo asset * fixed search algorithm assets in start compute form * fixed lint errors * updated previous order for algo logic and compute flow * update use price hook and added buy DT for algo * display only alg of type exchange and sort by value * display only trusted algo for asset if field is set * added logic for allow all published algorithms or no algorithms allowed * asset selection style & spacing tweaks * refactor get algorithms for compute and edit compute * fixed form options and more refactoring * new ButtonBuy component * shared component between consume/compute * dealing with various states: loading, previous orders, help text output * effect dependencies * move error output into toast * formik data flow refactor * ditch custom field change handler * fix initialValues * typed form data & validation * fixes multiple form validation issues along the way * isInitialValid → validateOnMount * metadata display tweaks * error feedback tweaks * oler assets checks, confeti on succes job, market fee on order, removed algo compute logic * more startJob logging * feedback & messaging changes * metadata display * return all algos, fixed & dynamic priced ones * fix DOM nesting * messaging updates * copy tweaks * check algorithm previous history for both acces and compute sercive types * handle start compute error * extra checks on start compute response * styling tweaks, fix toast UI errors * AssetSelection: empty screen, tweak min/max height * fix FRE issues on start compute * check is ordarable before start compute job * logging tweaks * disable eslint no-unused-vars rule for some Apollo code blocks * fix metadata editing for compute assets * consider dataset timeout for compute too Co-authored-by: Matthias Kretschmann <m@kretschmann.io>
2021-04-01 17:21:08 +02:00
/>
</Formik>
)}
<footer className={styles.feedback}>
2022-06-22 14:40:35 +02:00
{isOrdered && (
<SuccessConfetti success="Your job started successfully! Watch the progress below or on your profile." />
Start compute job (#439) * Wip start compute job * Wip select algorithm design * Asset selection form component, for start compute job (#442) * prototype AssetSelection * assetselection styling * typing "fix" * put back file info icon * AssetSelection styling in context * update start job method, fixed algo select, and fixed option typing * compute logic update * add has previous orders for algo asset * fixed search algorithm assets in start compute form * fixed lint errors * updated previous order for algo logic and compute flow * update use price hook and added buy DT for algo * display only alg of type exchange and sort by value * display only trusted algo for asset if field is set * added logic for allow all published algorithms or no algorithms allowed * asset selection style & spacing tweaks * refactor get algorithms for compute and edit compute * fixed form options and more refactoring * new ButtonBuy component * shared component between consume/compute * dealing with various states: loading, previous orders, help text output * effect dependencies * move error output into toast * formik data flow refactor * ditch custom field change handler * fix initialValues * typed form data & validation * fixes multiple form validation issues along the way * isInitialValid → validateOnMount * metadata display tweaks * error feedback tweaks * oler assets checks, confeti on succes job, market fee on order, removed algo compute logic * more startJob logging * feedback & messaging changes * metadata display * return all algos, fixed & dynamic priced ones * fix DOM nesting * messaging updates * copy tweaks * check algorithm previous history for both acces and compute sercive types * handle start compute error * extra checks on start compute response * styling tweaks, fix toast UI errors * AssetSelection: empty screen, tweak min/max height * fix FRE issues on start compute * check is ordarable before start compute job * logging tweaks * disable eslint no-unused-vars rule for some Apollo code blocks * fix metadata editing for compute assets * consider dataset timeout for compute too Co-authored-by: Matthias Kretschmann <m@kretschmann.io>
2021-04-01 17:21:08 +02:00
)}
</footer>
{accountId && asset?.accessDetails?.datatoken && (
<ComputeHistory
title="Your Compute Jobs"
refetchJobs={() => setRefetchJobs(!refetchJobs)}
>
2022-05-26 07:37:31 +02:00
<ComputeJobs
minimal
jobs={jobs}
isLoading={isLoadingJobs}
refetchJobs={() => setRefetchJobs(!refetchJobs)}
2022-05-26 07:37:31 +02:00
/>
2022-08-02 11:53:22 +02:00
</ComputeHistory>
)}
Start compute job (#439) * Wip start compute job * Wip select algorithm design * Asset selection form component, for start compute job (#442) * prototype AssetSelection * assetselection styling * typing "fix" * put back file info icon * AssetSelection styling in context * update start job method, fixed algo select, and fixed option typing * compute logic update * add has previous orders for algo asset * fixed search algorithm assets in start compute form * fixed lint errors * updated previous order for algo logic and compute flow * update use price hook and added buy DT for algo * display only alg of type exchange and sort by value * display only trusted algo for asset if field is set * added logic for allow all published algorithms or no algorithms allowed * asset selection style & spacing tweaks * refactor get algorithms for compute and edit compute * fixed form options and more refactoring * new ButtonBuy component * shared component between consume/compute * dealing with various states: loading, previous orders, help text output * effect dependencies * move error output into toast * formik data flow refactor * ditch custom field change handler * fix initialValues * typed form data & validation * fixes multiple form validation issues along the way * isInitialValid → validateOnMount * metadata display tweaks * error feedback tweaks * oler assets checks, confeti on succes job, market fee on order, removed algo compute logic * more startJob logging * feedback & messaging changes * metadata display * return all algos, fixed & dynamic priced ones * fix DOM nesting * messaging updates * copy tweaks * check algorithm previous history for both acces and compute sercive types * handle start compute error * extra checks on start compute response * styling tweaks, fix toast UI errors * AssetSelection: empty screen, tweak min/max height * fix FRE issues on start compute * check is ordarable before start compute job * logging tweaks * disable eslint no-unused-vars rule for some Apollo code blocks * fix metadata editing for compute assets * consider dataset timeout for compute too Co-authored-by: Matthias Kretschmann <m@kretschmann.io>
2021-04-01 17:21:08 +02:00
</>
)
}