1
0
mirror of https://github.com/oceanprotocol/market.git synced 2024-11-15 01:34:57 +01:00

Merge pull request #143 from oceanprotocol/fix/removeLicense

remove license
This commit is contained in:
Matthias Kretschmann 2020-10-27 13:18:08 +01:00 committed by GitHub
commit 7053530160
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 3 additions and 51 deletions

View File

@ -54,40 +54,12 @@
"help": "Give proper attribution for your data set.", "help": "Give proper attribution for your data set.",
"required": true "required": true
}, },
{
"name": "copyrightHolder",
"label": "Copyright Holder",
"placeholder": "e.g. Marine Institute of Jellyfish",
"help": "Add this if the holder of the copyright is different from the author."
},
{ {
"name": "tags", "name": "tags",
"label": "Tags", "label": "Tags",
"placeholder": "e.g. logistics, ai", "placeholder": "e.g. logistics, ai",
"help": "Separate tags with comma." "help": "Separate tags with comma."
}, },
{
"name": "license",
"label": "License",
"type": "select",
"options": [
"Public Domain",
"PDDL: Public Domain Dedication and License",
"ODC-By: Attribution License",
"ODC-ODbL: Open Database License",
"CDLA-Sharing: Community Data License Agreement",
"CDLA-Permissive: Community Data License Agreement",
"CC0: Public Domain Dedication",
"CC BY: Attribution 4.0 International",
"CC BY-SA: Attribution-ShareAlike 4.0 International",
"CC BY-ND: Attribution-NoDerivatives 4.0 International",
"CC BY-NC: Attribution-NonCommercial 4.0 International",
"CC BY-NC-SA: Attribution-NonCommercial-ShareAlike 4.0 International",
"CC BY-NC-ND: Attribution-NonCommercial-NoDerivatives 4.0 International",
"No License Specified"
],
"required": true
},
{ {
"name": "termsAndConditions", "name": "termsAndConditions",
"label": "Terms & Conditions", "label": "Terms & Conditions",

View File

@ -30,12 +30,10 @@ export interface MetadataPublishForm {
description: string description: string
files: string | File[] files: string | File[]
author: string author: string
license: string
dataTokenOptions: DataTokenOptions dataTokenOptions: DataTokenOptions
access: 'Download' | 'Compute' | string access: 'Download' | 'Compute' | string
termsAndConditions: boolean termsAndConditions: boolean
// ---- optional fields ---- // ---- optional fields ----
copyrightHolder?: string
tags?: string tags?: string
links?: string | File[] links?: string | File[]
} }

View File

@ -13,19 +13,11 @@ export default function MetaFull({
metadata: MetadataMarket metadata: MetadataMarket
}): ReactElement { }): ReactElement {
const { id } = ddo const { id } = ddo
const { dateCreated, datePublished, license } = metadata.main const { dateCreated, datePublished } = metadata.main
return ( return (
<div className={styles.metaFull}> <div className={styles.metaFull}>
<MetaItem title="Author" content={metadata?.main.author} /> <MetaItem title="Author" content={metadata?.main.author} />
{metadata?.additionalInformation?.copyrightHolder && (
<MetaItem
title="Copyright Holder"
content={metadata?.additionalInformation?.copyrightHolder}
/>
)}
<MetaItem title="License" content={license} />
{metadata?.additionalInformation?.categories && ( {metadata?.additionalInformation?.categories && (
<MetaItem <MetaItem

View File

@ -39,10 +39,7 @@ export default function AssetContent({
<div className={styles.content}> <div className={styles.content}>
<aside className={styles.meta}> <aside className={styles.meta}>
<p className={styles.author}> <p className={styles.author}>{metadata?.main.author}</p>
{metadata?.additionalInformation?.copyrightHolder ||
metadata?.main.author}
</p>
<p className={styles.datatoken}> <p className={styles.datatoken}>
<EtherscanLink <EtherscanLink

View File

@ -17,9 +17,7 @@ export function transformPublishFormToMetadata(
const { const {
name, name,
author, author,
license,
description, description,
copyrightHolder,
tags, tags,
links, links,
termsAndConditions, termsAndConditions,
@ -34,12 +32,11 @@ export function transformPublishFormToMetadata(
dateCreated: currentTime, dateCreated: currentTime,
datePublished: currentTime, datePublished: currentTime,
files: typeof files !== 'string' && files, files: typeof files !== 'string' && files,
license license: 'https://market.oceanprotocol.com/terms'
}, },
additionalInformation: { additionalInformation: {
...AssetModel.additionalInformation, ...AssetModel.additionalInformation,
description, description,
copyrightHolder,
tags: transformTags(tags), tags: transformTags(tags),
links: typeof links !== 'string' && links, links: typeof links !== 'string' && links,
termsAndConditions termsAndConditions

View File

@ -14,14 +14,12 @@ export const validationSchema = Yup.object().shape<MetadataPublishForm>({
.required('Required'), .required('Required'),
files: Yup.array<FileMetadata>().required('Required').nullable(), files: Yup.array<FileMetadata>().required('Required').nullable(),
description: Yup.string().required('Required'), description: Yup.string().required('Required'),
license: Yup.string().required('Required'),
access: Yup.string() access: Yup.string()
.matches(/Compute|Download/g) .matches(/Compute|Download/g)
.required('Required'), .required('Required'),
termsAndConditions: Yup.boolean().required('Required'), termsAndConditions: Yup.boolean().required('Required'),
// ---- optional fields ---- // ---- optional fields ----
copyrightHolder: Yup.string().nullable(),
tags: Yup.string().nullable(), tags: Yup.string().nullable(),
links: Yup.object<FileMetadata[]>().nullable() links: Yup.object<FileMetadata[]>().nullable()
}) })
@ -35,7 +33,6 @@ export const initialValues: Partial<MetadataPublishForm> = {
}, },
files: '', files: '',
description: '', description: '',
license: '',
access: '', access: '',
termsAndConditions: false termsAndConditions: false
} }

View File

@ -3,7 +3,6 @@ import { MetadataPublishForm } from '../../../src/@types/MetaData'
const testFormData: MetadataPublishForm = { const testFormData: MetadataPublishForm = {
author: '', author: '',
files: [], files: [],
license: '',
dataTokenOptions: { dataTokenOptions: {
name: '', name: '',
symbol: '' symbol: ''