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

Put back in place removed docker hub image check (#642)

* Put back removed docker hub image check using proxy

* fixed lint errors

* update scroll so  in case of docker image validation error the input fields are in viewport
This commit is contained in:
Bogdan Fazakas 2021-06-14 15:10:12 +03:00 committed by GitHub
parent 4fc5862654
commit e8033687fb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 25 additions and 18 deletions

View File

@ -2,7 +2,8 @@ module.exports = {
client: {
service: {
name: 'ocean',
url: 'https://subgraph.rinkeby.oceanprotocol.com/subgraphs/name/oceanprotocol/ocean-subgraph',
url:
'https://subgraph.rinkeby.oceanprotocol.com/subgraphs/name/oceanprotocol/ocean-subgraph',
// optional disable SSL validation check
skipSSLValidation: true
}

2
package-lock.json generated
View File

@ -43525,7 +43525,6 @@
"node-abort-controller": "^2.0.0",
"save-file": "^2.3.1",
"uuid": "^8.3.2",
"web3": "^1.3.5",
"web3-eth-contract": "^1.3.6"
}
},
@ -43600,7 +43599,6 @@
"integrity": "sha512-5vwpq6kbvwkQwKqAoOU3L72GZ3Ta8RRrewKj9OJRolx28KLJJ8Dg9Rf7obRwt5jQA9bkYd8gqzMTrI7H3xLfaw==",
"dev": true,
"requires": {
"@oclif/config": "^1.15.1",
"@oclif/errors": "^1.3.3",
"@oclif/parser": "^3.8.3",
"@oclif/plugin-help": "^3",

View File

@ -27,5 +27,5 @@
}
.loaderWrap {
margin-right: calc(var(--spacer)/6);
}
margin-right: calc(var(--spacer) / 6);
}

View File

@ -159,6 +159,8 @@ export default function PublishPage({
values: initialValues as MetadataPublishFormDataset,
status: 'empty'
})
// move user's focus to top of screen
window.scrollTo({ top: 0, left: 0, behavior: 'smooth' })
} catch (error) {
setError(error.message)
Logger.error(error.message)
@ -173,14 +175,10 @@ export default function PublishPage({
): Promise<void> {
const metadata = transformPublishAlgorithmFormToMetadata(values)
const timeout = mapTimeoutStringToSeconds(values.timeout)
// TODO: put back check once #572 is resolved
// https://github.com/oceanprotocol/market/issues/572
const validDockerImage = true
// const validDockerImage =
// values.dockerImage === 'custom image'
// ? await validateDockerImage(values.image, values.containerTag)
// : true
const validDockerImage =
values.dockerImage === 'custom image'
? await validateDockerImage(values.image, values.containerTag)
: true
try {
if (validDockerImage) {
Logger.log('Publish algorithm with ', metadata, values.dataTokenOptions)
@ -208,6 +206,10 @@ export default function PublishPage({
values: initialValuesAlgorithm as MetadataPublishFormAlgorithm,
status: 'empty'
})
// move user's focus to top of screen
window.scrollTo({ top: 0, left: 0, behavior: 'smooth' })
} else {
document.getElementById('image').scrollIntoView({ behavior: 'smooth' })
}
} catch (error) {
setError(error.message)
@ -228,8 +230,6 @@ export default function PublishPage({
: validationSchemaAlgorithm
}
onSubmit={async (values, { resetForm }) => {
// move user's focus to top of screen
window.scrollTo({ top: 0, left: 0, behavior: 'smooth' })
// kick off publishing
publishType === 'dataset'
? await handleSubmit(values, resetForm)

View File

@ -136,10 +136,18 @@ async function isDockerHubImageValid(
tag: string
): Promise<boolean> {
try {
const response = await axios.get(
`https://hub.docker.com/v2/repositories/${image}/tags/${tag}`
const response = await axios.post(
`https://dockerhub-proxy.oceanprotocol.com`,
{
image,
tag
}
)
if (!response || response.status !== 200 || !response.data) {
if (
!response ||
response.status !== 200 ||
response.data.status !== 'success'
) {
toast.error(
'Could not fetch docker hub image info. Please check image name and tag and try again'
)