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 React, { useState, ReactElement, useEffect, useCallback } from 'react'
|
2022-01-11 20:05:07 +01:00
|
|
|
import {
|
|
|
|
LoggerInstance,
|
|
|
|
ComputeAlgorithm,
|
2022-01-11 20:45:14 +01:00
|
|
|
ComputeOutput,
|
|
|
|
Asset,
|
|
|
|
DDO,
|
2022-01-11 20:58:39 +01:00
|
|
|
PublisherTrustedAlgorithm,
|
|
|
|
FileMetadata
|
2022-01-11 20:05:07 +01:00
|
|
|
} 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'
|
|
|
|
import { useSiteMetadata } from '@hooks/useSiteMetadata'
|
|
|
|
import { useWeb3 } from '@context/Web3'
|
|
|
|
import { usePricing } from '@hooks/usePricing'
|
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 {
|
2021-10-21 09:24:00 +02:00
|
|
|
generateBaseQuery,
|
|
|
|
getFilterTerm,
|
2021-10-19 14:06:16 +02:00
|
|
|
queryMetadata,
|
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
|
|
|
transformDDOToAssetSelection
|
2021-10-13 18:48:59 +02:00
|
|
|
} from '@utils/aquarius'
|
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'
|
2021-10-13 18:48:59 +02:00
|
|
|
import { getInitialValues, validationSchema } 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 axios from 'axios'
|
|
|
|
import FormStartComputeDataset from './FormComputeDataset'
|
|
|
|
import styles from './index.module.css'
|
2021-10-18 20:44:33 +02:00
|
|
|
import SuccessConfetti from '@shared/SuccessConfetti'
|
2021-11-11 08:51:13 +01:00
|
|
|
import { getServiceByName, secondsToString } from '@utils/ddo'
|
2021-11-15 19:29:20 +01:00
|
|
|
import { AssetSelectionAsset } from '@shared/FormFields/AssetSelection'
|
2021-10-28 11:38:40 +02:00
|
|
|
import AlgorithmDatasetsListForCompute from './AlgorithmDatasetsListForCompute'
|
2022-02-03 12:29:39 +01:00
|
|
|
import { getPreviousOrders } from '@utils/subgraph'
|
2021-10-25 15:26:00 +02:00
|
|
|
import AssetActionHistoryTable from '../AssetActionHistoryTable'
|
2021-10-13 18:48:59 +02:00
|
|
|
import ComputeJobs from '../../../Profile/History/ComputeJobs'
|
|
|
|
import { useCancelToken } from '@hooks/useCancelToken'
|
|
|
|
import { useIsMounted } from '@hooks/useIsMounted'
|
2021-10-21 13:31:19 +02:00
|
|
|
import { SortTermOptions } from '../../../../@types/aquarius/SearchQuery'
|
2022-02-03 12:29:39 +01:00
|
|
|
import { getAccessDetails } from '@utils/accessDetailsAndPricing'
|
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({
|
2021-11-23 13:53:09 +01:00
|
|
|
ddo,
|
2022-02-03 12:29:39 +01:00
|
|
|
accessDetails,
|
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,
|
2021-06-10 10:39:24 +02:00
|
|
|
file,
|
2021-07-06 08:51:37 +02:00
|
|
|
fileIsLoading,
|
|
|
|
isConsumable,
|
|
|
|
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
|
|
|
}: {
|
2021-11-23 13:53:09 +01:00
|
|
|
ddo: Asset
|
2022-02-03 12:29:39 +01:00
|
|
|
accessDetails: AccessDetails
|
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: FileMetadata
|
2021-06-10 10:39:24 +02:00
|
|
|
fileIsLoading?: boolean
|
2021-07-06 08:51:37 +02:00
|
|
|
isConsumable?: 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 {
|
2021-05-31 12:53:37 +02:00
|
|
|
const { appConfig } = useSiteMetadata()
|
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 { accountId } = useWeb3()
|
|
|
|
const { buyDT, pricingError, pricingStepText } = usePricing()
|
|
|
|
const [isJobStarting, setIsJobStarting] = useState(false)
|
|
|
|
const [error, setError] = useState<string>()
|
|
|
|
|
|
|
|
const [algorithmList, setAlgorithmList] = useState<AssetSelectionAsset[]>()
|
2021-11-11 08:51:13 +01:00
|
|
|
const [ddoAlgorithmList, setDdoAlgorithmList] = useState<Asset[]>()
|
|
|
|
const [selectedAlgorithmAsset, setSelectedAlgorithmAsset] = useState<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
|
|
|
const [hasAlgoAssetDatatoken, setHasAlgoAssetDatatoken] = useState<boolean>()
|
|
|
|
const [isPublished, setIsPublished] = useState(false)
|
|
|
|
const [hasPreviousDatasetOrder, setHasPreviousDatasetOrder] = useState(false)
|
|
|
|
const [previousDatasetOrderId, setPreviousDatasetOrderId] = useState<string>()
|
2021-05-20 00:44:51 +02:00
|
|
|
const [hasPreviousAlgorithmOrder, setHasPreviousAlgorithmOrder] =
|
|
|
|
useState(false)
|
2021-04-08 17:10:51 +02:00
|
|
|
const [algorithmDTBalance, setalgorithmDTBalance] = useState<string>()
|
2022-02-03 12:29:39 +01:00
|
|
|
const [algorithmConsumeDetails, setAlgorithmConsumeDetails] =
|
|
|
|
useState<AccessDetails>()
|
2021-05-20 00:44:51 +02:00
|
|
|
const [previousAlgorithmOrderId, setPreviousAlgorithmOrderId] =
|
|
|
|
useState<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
|
|
|
const [datasetTimeout, setDatasetTimeout] = useState<string>()
|
2021-04-08 17:10:51 +02:00
|
|
|
const [algorithmTimeout, setAlgorithmTimeout] = useState<string>()
|
2021-09-24 13:56:42 +02:00
|
|
|
const newCancelToken = useCancelToken()
|
2021-07-22 13:04:55 +02:00
|
|
|
const hasDatatoken = Number(dtBalance) >= 1
|
2021-09-24 13:56:42 +02:00
|
|
|
const isMounted = useIsMounted()
|
|
|
|
const [isConsumablePrice, setIsConsumablePrice] = useState(true)
|
|
|
|
const [isAlgoConsumablePrice, setIsAlgoConsumablePrice] = useState(true)
|
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 =
|
2021-07-06 08:51:37 +02:00
|
|
|
isJobStarting === true ||
|
|
|
|
file === null ||
|
2021-09-24 13:56:42 +02:00
|
|
|
(!hasPreviousDatasetOrder && !hasDatatoken && !isConsumablePrice) ||
|
|
|
|
(!hasPreviousAlgorithmOrder &&
|
|
|
|
!hasAlgoAssetDatatoken &&
|
|
|
|
!isAlgoConsumablePrice)
|
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
|
|
|
|
2021-11-11 08:51:13 +01:00
|
|
|
const { timeout } = ddo?.services[0]
|
|
|
|
|
2021-04-12 16:09:41 +02:00
|
|
|
async function checkPreviousOrders(ddo: DDO) {
|
2021-11-11 08:51:13 +01:00
|
|
|
const { type } = ddo.metadata
|
|
|
|
|
2021-04-11 01:13:43 +02:00
|
|
|
const orderId = await getPreviousOrders(
|
2021-11-11 08:51:13 +01:00
|
|
|
ddo.services[0].datatokenAddress?.toLowerCase(),
|
2021-04-11 01:13:43 +02:00
|
|
|
accountId?.toLowerCase(),
|
2021-04-12 16:09:41 +02:00
|
|
|
timeout.toString()
|
2021-04-11 01:13:43 +02:00
|
|
|
)
|
2021-09-24 13:56:42 +02:00
|
|
|
|
|
|
|
if (!isMounted()) return
|
2021-11-11 08:51:13 +01:00
|
|
|
if (type === 'algorithm') {
|
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
|
|
|
setPreviousAlgorithmOrderId(orderId)
|
|
|
|
setHasPreviousAlgorithmOrder(!!orderId)
|
|
|
|
} else {
|
|
|
|
setPreviousDatasetOrderId(orderId)
|
|
|
|
setHasPreviousDatasetOrder(!!orderId)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
async function checkAssetDTBalance(asset: DDO) {
|
2022-01-11 20:05:07 +01:00
|
|
|
// const AssetDtBalance = await ocean.datatokens.balance(
|
|
|
|
// asset.services[0].datatokenAddress,
|
|
|
|
// accountId
|
|
|
|
// )
|
|
|
|
// setalgorithmDTBalance(AssetDtBalance)
|
|
|
|
// setHasAlgoAssetDatatoken(Number(AssetDtBalance) >= 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
|
|
|
}
|
|
|
|
|
|
|
|
function getQuerryString(
|
2021-11-11 08:51:13 +01:00
|
|
|
trustedAlgorithmList: PublisherTrustedAlgorithm[],
|
2021-07-20 08:58:45 +02:00
|
|
|
chainId?: number
|
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
|
|
|
): SearchQuery {
|
2021-10-21 09:24:00 +02:00
|
|
|
const algorithmDidList = trustedAlgorithmList.map((x) => x.did)
|
|
|
|
|
|
|
|
const baseParams = {
|
|
|
|
chainIds: [chainId],
|
|
|
|
sort: { sortBy: SortTermOptions.Created },
|
|
|
|
filters: [
|
|
|
|
getFilterTerm('service.attributes.main.type', 'algorithm'),
|
|
|
|
getFilterTerm('id', algorithmDidList)
|
|
|
|
]
|
|
|
|
} as BaseQueryParams
|
|
|
|
|
|
|
|
const query = generateBaseQuery(baseParams)
|
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 query
|
|
|
|
}
|
|
|
|
|
|
|
|
async function getAlgorithmList(): Promise<AssetSelectionAsset[]> {
|
|
|
|
const source = axios.CancelToken.source()
|
2021-11-11 08:51:13 +01:00
|
|
|
const computeService = ddo.services[0]
|
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
|
|
|
let algorithmSelectionList: AssetSelectionAsset[]
|
|
|
|
if (
|
2021-11-11 10:22:22 +01:00
|
|
|
!computeService.compute ||
|
|
|
|
!computeService.compute.publisherTrustedAlgorithms ||
|
|
|
|
computeService.compute.publisherTrustedAlgorithms.length === 0
|
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
|
|
|
) {
|
|
|
|
algorithmSelectionList = []
|
|
|
|
} else {
|
|
|
|
const gueryResults = await queryMetadata(
|
|
|
|
getQuerryString(
|
2021-11-11 10:22:22 +01:00
|
|
|
computeService.compute.publisherTrustedAlgorithms,
|
2021-07-20 08:58:45 +02:00
|
|
|
ddo.chainId
|
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
|
|
|
),
|
|
|
|
source.token
|
|
|
|
)
|
|
|
|
setDdoAlgorithmList(gueryResults.results)
|
2021-11-11 08:51:13 +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
|
|
|
algorithmSelectionList = await transformDDOToAssetSelection(
|
2021-11-11 08:51:13 +01:00
|
|
|
computeService?.serviceEndpoint,
|
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
|
|
|
gueryResults.results,
|
2021-09-24 13:56:42 +02:00
|
|
|
[],
|
|
|
|
newCancelToken()
|
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 algorithmSelectionList
|
|
|
|
}
|
|
|
|
|
2021-11-11 08:51:13 +01:00
|
|
|
const initMetadata = useCallback(async (ddo: Asset): Promise<void> => {
|
2021-09-24 13:56:42 +02:00
|
|
|
if (!ddo) return
|
2022-02-03 12:29:39 +01:00
|
|
|
const accessDetails = await getAccessDetails(
|
|
|
|
ddo.chainId,
|
|
|
|
ddo.services[0].datatokenAddress
|
|
|
|
)
|
|
|
|
setAlgorithmConsumeDetails(accessDetails)
|
2021-09-24 13:56:42 +02:00
|
|
|
}, [])
|
|
|
|
|
|
|
|
useEffect(() => {
|
2022-02-03 12:29:39 +01:00
|
|
|
if (!algorithmConsumeDetails) return
|
2021-09-24 13:56:42 +02:00
|
|
|
|
2022-02-03 12:29:39 +01:00
|
|
|
setIsAlgoConsumablePrice(algorithmConsumeDetails.isConsumable)
|
|
|
|
}, [algorithmConsumeDetails])
|
2021-11-11 08:51:13 +01:00
|
|
|
|
2021-09-24 13:56:42 +02:00
|
|
|
useEffect(() => {
|
2022-02-03 12:29:39 +01:00
|
|
|
if (!accessDetails) return
|
2021-09-24 13:56:42 +02:00
|
|
|
|
2022-02-03 12:29:39 +01:00
|
|
|
setIsConsumablePrice(accessDetails.isConsumable)
|
|
|
|
}, [accessDetails])
|
2021-09-24 13:56:42 +02:00
|
|
|
|
2021-11-11 08:51:13 +01:00
|
|
|
// useEffect(() => {
|
|
|
|
// setDatasetTimeout(secondsToString(timeout))
|
|
|
|
// }, [ddo])
|
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(() => {
|
|
|
|
if (!ddo) return
|
|
|
|
getAlgorithmList().then((algorithms) => {
|
|
|
|
setAlgorithmList(algorithms)
|
|
|
|
})
|
|
|
|
}, [ddo])
|
|
|
|
|
|
|
|
useEffect(() => {
|
2022-01-11 20:05:07 +01:00
|
|
|
if (!accountId) return
|
2021-04-12 16:09:41 +02:00
|
|
|
checkPreviousOrders(ddo)
|
2022-01-11 20:05:07 +01:00
|
|
|
}, [ddo, 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(() => {
|
2021-04-28 14:23:44 +02:00
|
|
|
if (!selectedAlgorithmAsset) return
|
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
|
|
|
|
|
|
|
initMetadata(selectedAlgorithmAsset)
|
2021-04-28 14:23:44 +02:00
|
|
|
|
2021-11-11 08:51:13 +01:00
|
|
|
const { timeout } = ddo.services[0]
|
|
|
|
|
|
|
|
// setAlgorithmTimeout(secondsToString(timeout))
|
2021-04-28 14:23:44 +02:00
|
|
|
|
|
|
|
if (accountId) {
|
2021-11-11 08:51:13 +01:00
|
|
|
if (getServiceByName(selectedAlgorithmAsset, 'access')) {
|
2021-04-28 14:23:44 +02:00
|
|
|
checkPreviousOrders(selectedAlgorithmAsset).then(() => {
|
|
|
|
if (
|
|
|
|
!hasPreviousAlgorithmOrder &&
|
2021-11-11 08:51:13 +01:00
|
|
|
getServiceByName(selectedAlgorithmAsset, 'compute')
|
2021-04-28 14:23:44 +02:00
|
|
|
) {
|
|
|
|
checkPreviousOrders(selectedAlgorithmAsset)
|
|
|
|
}
|
|
|
|
})
|
2021-11-11 08:51:13 +01:00
|
|
|
} else if (getServiceByName(selectedAlgorithmAsset, 'compute')) {
|
2021-04-28 14:23:44 +02:00
|
|
|
checkPreviousOrders(selectedAlgorithmAsset)
|
|
|
|
}
|
|
|
|
}
|
2022-01-11 20:05:07 +01:00
|
|
|
// ocean && checkAssetDTBalance(selectedAlgorithmAsset)
|
|
|
|
}, [ddo, selectedAlgorithmAsset, accountId, hasPreviousAlgorithmOrder])
|
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
|
|
|
|
|
|
|
// Output errors in toast UI
|
|
|
|
useEffect(() => {
|
|
|
|
const newError = error || pricingError
|
|
|
|
if (!newError) return
|
|
|
|
toast.error(newError)
|
|
|
|
}, [error, pricingError])
|
|
|
|
|
2021-11-11 08:51:13 +01:00
|
|
|
// async function startJob(algorithmId: string) {
|
|
|
|
// try {
|
|
|
|
// if (!ocean) return
|
|
|
|
|
|
|
|
// setIsJobStarting(true)
|
|
|
|
// setIsPublished(false)
|
|
|
|
// setError(undefined)
|
|
|
|
|
|
|
|
// const computeService = getServiceByName(ddo, 'compute')
|
|
|
|
// const serviceAlgo = getServiceByName(selectedAlgorithmAsset, 'access')
|
|
|
|
// ? getServiceByName(selectedAlgorithmAsset, 'access')
|
|
|
|
// : getServiceByName(selectedAlgorithmAsset, 'compute')
|
|
|
|
|
|
|
|
// const computeAlgorithm: ComputeAlgorithm = {
|
|
|
|
// did: selectedAlgorithmAsset.id,
|
|
|
|
// serviceIndex: serviceAlgo.index,
|
|
|
|
// dataToken: selectedAlgorithmAsset.services[0].datatokenAddress
|
|
|
|
// }
|
|
|
|
// const allowed = await ocean.compute.isOrderable(
|
|
|
|
// ddo.id,
|
|
|
|
// computeService.index,
|
|
|
|
// computeAlgorithm
|
|
|
|
// )
|
2021-12-10 12:33:47 +01:00
|
|
|
// LoggerInstance.log('[compute] Is data set orderable?', allowed)
|
2021-11-11 08:51:13 +01:00
|
|
|
|
|
|
|
// if (!allowed) {
|
|
|
|
// setError(
|
|
|
|
// 'Data set is not orderable in combination with selected algorithm.'
|
|
|
|
// )
|
2021-12-10 12:33:47 +01:00
|
|
|
// LoggerInstance.error(
|
2021-11-11 08:51:13 +01:00
|
|
|
// '[compute] Error starting compute job. Dataset is not orderable in combination with selected algorithm.'
|
|
|
|
// )
|
|
|
|
// return
|
|
|
|
// }
|
|
|
|
|
|
|
|
// if (!hasPreviousDatasetOrder && !hasDatatoken) {
|
|
|
|
// const tx = await buyDT('1', price, ddo)
|
|
|
|
// if (!tx) {
|
|
|
|
// setError('Error buying datatoken.')
|
2021-12-10 12:33:47 +01:00
|
|
|
// LoggerInstance.error('[compute] Error buying datatoken for data set ', ddo.id)
|
2021-11-11 08:51:13 +01:00
|
|
|
// return
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|
|
|
|
|
// if (!hasPreviousAlgorithmOrder && !hasAlgoAssetDatatoken) {
|
|
|
|
// const tx = await buyDT('1', algorithmPrice, selectedAlgorithmAsset)
|
|
|
|
// if (!tx) {
|
|
|
|
// setError('Error buying datatoken.')
|
2021-12-10 12:33:47 +01:00
|
|
|
// LoggerInstance.error(
|
2021-11-11 08:51:13 +01:00
|
|
|
// '[compute] Error buying datatoken for algorithm ',
|
|
|
|
// selectedAlgorithmAsset.id
|
|
|
|
// )
|
|
|
|
// return
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|
|
|
|
|
// // TODO: pricingError is always undefined even upon errors during buyDT for whatever reason.
|
|
|
|
// // So manually drop out above, but ideally could be replaced with this alone.
|
|
|
|
// if (pricingError) {
|
|
|
|
// setError(pricingError)
|
|
|
|
// return
|
|
|
|
// }
|
|
|
|
|
|
|
|
// const assetOrderId = hasPreviousDatasetOrder
|
|
|
|
// ? previousDatasetOrderId
|
|
|
|
// : await ocean.compute.orderAsset(
|
|
|
|
// accountId,
|
|
|
|
// ddo.id,
|
|
|
|
// computeService.index,
|
|
|
|
// computeAlgorithm,
|
|
|
|
// appConfig.marketFeeAddress,
|
|
|
|
// undefined,
|
|
|
|
// null,
|
|
|
|
// false
|
|
|
|
// )
|
|
|
|
|
|
|
|
// assetOrderId &&
|
2021-12-10 12:33:47 +01:00
|
|
|
// LoggerInstance.log(
|
2021-11-11 08:51:13 +01:00
|
|
|
// `[compute] Got ${
|
|
|
|
// hasPreviousDatasetOrder ? 'existing' : 'new'
|
|
|
|
// } order ID for dataset: `,
|
|
|
|
// assetOrderId
|
|
|
|
// )
|
|
|
|
|
|
|
|
// const algorithmAssetOrderId = hasPreviousAlgorithmOrder
|
|
|
|
// ? previousAlgorithmOrderId
|
|
|
|
// : await ocean.compute.orderAlgorithm(
|
|
|
|
// algorithmId,
|
|
|
|
// serviceAlgo.type,
|
|
|
|
// accountId,
|
|
|
|
// serviceAlgo.index,
|
|
|
|
// appConfig.marketFeeAddress,
|
|
|
|
// undefined,
|
|
|
|
// null,
|
|
|
|
// false
|
|
|
|
// )
|
|
|
|
|
|
|
|
// algorithmAssetOrderId &&
|
2021-12-10 12:33:47 +01:00
|
|
|
// LoggerInstance.log(
|
2021-11-11 08:51:13 +01:00
|
|
|
// `[compute] Got ${
|
|
|
|
// hasPreviousAlgorithmOrder ? 'existing' : 'new'
|
|
|
|
// } order ID for algorithm: `,
|
|
|
|
// algorithmAssetOrderId
|
|
|
|
// )
|
|
|
|
|
|
|
|
// if (!assetOrderId || !algorithmAssetOrderId) {
|
|
|
|
// setError('Error ordering assets.')
|
|
|
|
// return
|
|
|
|
// }
|
|
|
|
|
|
|
|
// computeAlgorithm.transferTxId = algorithmAssetOrderId
|
2021-12-10 12:33:47 +01:00
|
|
|
// LoggerInstance.log('[compute] Starting compute job.')
|
2021-11-11 08:51:13 +01:00
|
|
|
|
|
|
|
// const output: ComputeOutput = {
|
|
|
|
// publishAlgorithmLog: true,
|
|
|
|
// publishOutput: true
|
|
|
|
// }
|
|
|
|
// const response = await ocean.compute.start(
|
|
|
|
// ddo.id,
|
|
|
|
// assetOrderId,
|
|
|
|
// ddo.services[0].datatokenAddress,
|
|
|
|
// account,
|
|
|
|
// computeAlgorithm,
|
|
|
|
// output,
|
|
|
|
// `${computeService.index}`,
|
|
|
|
// computeService.type
|
|
|
|
// )
|
|
|
|
|
|
|
|
// if (!response) {
|
|
|
|
// setError('Error starting compute job.')
|
|
|
|
// return
|
|
|
|
// }
|
|
|
|
|
2021-12-10 12:33:47 +01:00
|
|
|
// LoggerInstance.log('[compute] Starting compute job response: ', response)
|
2021-11-11 08:51:13 +01:00
|
|
|
|
|
|
|
// await checkPreviousOrders(selectedAlgorithmAsset)
|
|
|
|
// await checkPreviousOrders(ddo)
|
|
|
|
// setIsPublished(true)
|
|
|
|
// } catch (error) {
|
|
|
|
// await checkPreviousOrders(selectedAlgorithmAsset)
|
|
|
|
// await checkPreviousOrders(ddo)
|
|
|
|
// setError('Failed to start job!')
|
2021-12-10 12:33:47 +01:00
|
|
|
// LoggerInstance.error('[compute] Failed to start job: ', error.message)
|
2021-11-11 08:51:13 +01:00
|
|
|
// } finally {
|
|
|
|
// setIsJobStarting(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
|
|
|
|
|
|
|
return (
|
|
|
|
<>
|
|
|
|
<div className={styles.info}>
|
2021-10-18 20:44:33 +02:00
|
|
|
<FileIcon file={file} isLoading={fileIsLoading} small />
|
2022-02-03 12:29:39 +01:00
|
|
|
<Price accessDetails={accessDetails} conversion />
|
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
|
|
|
</div>
|
|
|
|
|
2021-11-11 08:51:13 +01:00
|
|
|
{ddo.metadata.type === 'algorithm' ? (
|
2021-06-14 14:37:03 +02:00
|
|
|
<>
|
|
|
|
<Alert
|
|
|
|
text="This algorithm has been set to private by the publisher and can't be downloaded. You can run it against any allowed data sets though!"
|
|
|
|
state="info"
|
|
|
|
/>
|
2021-11-23 13:53:09 +01:00
|
|
|
<AlgorithmDatasetsListForCompute algorithmDid={ddo.id} ddo={ddo} />
|
2021-06-14 14:37:03 +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
|
|
|
) : (
|
|
|
|
<Formik
|
|
|
|
initialValues={getInitialValues()}
|
|
|
|
validateOnMount
|
|
|
|
validationSchema={validationSchema}
|
2021-11-11 08:51:13 +01:00
|
|
|
onSubmit={async (values) => {
|
|
|
|
// await startJob(values.algorithm)
|
|
|
|
}}
|
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}
|
|
|
|
setSelectedAlgorithm={setSelectedAlgorithmAsset}
|
|
|
|
isLoading={isJobStarting}
|
|
|
|
isComputeButtonDisabled={isComputeButtonDisabled}
|
2021-04-08 17:10:51 +02:00
|
|
|
hasPreviousOrder={hasPreviousDatasetOrder}
|
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}
|
2021-09-24 13:56:42 +02:00
|
|
|
datasetLowPoolLiquidity={!isConsumablePrice}
|
2021-11-23 13:53:09 +01:00
|
|
|
assetType={ddo?.metadata.type}
|
2021-04-08 17:10:51 +02:00
|
|
|
assetTimeout={datasetTimeout}
|
|
|
|
hasPreviousOrderSelectedComputeAsset={hasPreviousAlgorithmOrder}
|
|
|
|
hasDatatokenSelectedComputeAsset={hasAlgoAssetDatatoken}
|
2022-02-03 12:29:39 +01:00
|
|
|
oceanSymbol={accessDetails ? accessDetails.baseToken.symbol : ''}
|
2021-04-08 17:10:51 +02:00
|
|
|
dtSymbolSelectedComputeAsset={
|
2022-01-11 20:45:14 +01:00
|
|
|
selectedAlgorithmAsset?.datatokens[0]?.symbol
|
2021-04-08 17:10:51 +02:00
|
|
|
}
|
|
|
|
dtBalanceSelectedComputeAsset={algorithmDTBalance}
|
2021-09-24 13:56:42 +02:00
|
|
|
selectedComputeAssetLowPoolLiquidity={!isAlgoConsumablePrice}
|
2021-04-08 17:10:51 +02:00
|
|
|
selectedComputeAssetType="algorithm"
|
|
|
|
selectedComputeAssetTimeout={algorithmTimeout}
|
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
|
|
|
stepText={pricingStepText || 'Starting Compute Job...'}
|
2022-02-03 12:29:39 +01:00
|
|
|
algorithmConsumeDetails={algorithmConsumeDetails}
|
2021-07-06 08:51:37 +02:00
|
|
|
isConsumable={isConsumable}
|
|
|
|
consumableFeedback={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
|
|
|
/>
|
|
|
|
</Formik>
|
|
|
|
)}
|
|
|
|
|
|
|
|
<footer className={styles.feedback}>
|
|
|
|
{isPublished && (
|
2021-10-06 11:30:17 +02:00
|
|
|
<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>
|
2022-02-03 12:29:39 +01:00
|
|
|
{accountId && accessDetails?.datatoken && (
|
2021-08-04 14:26:03 +02:00
|
|
|
<AssetActionHistoryTable title="Your Compute Jobs">
|
2021-09-01 15:15:25 +02:00
|
|
|
<ComputeJobs minimal />
|
2021-08-04 14:26:03 +02:00
|
|
|
</AssetActionHistoryTable>
|
|
|
|
)}
|
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
|
|
|
</>
|
|
|
|
)
|
|
|
|
}
|