diff --git a/components/IscnRegisterForm.vue b/components/IscnRegisterForm.vue index 5cc827fb..83352992 100644 --- a/components/IscnRegisterForm.vue +++ b/components/IscnRegisterForm.vue @@ -353,11 +353,16 @@ class="mb-[12px]" > + @@ -745,11 +750,6 @@ export default class IscnRegisterForm extends Vue { 'CreativeWork', ] - licenseOptions = [ - 'Copyright. All rights reserved.', - 'CC BY 4.0', - ] - fileTypeOptions = [ 'epub', 'pdf', @@ -758,6 +758,12 @@ export default class IscnRegisterForm extends Vue { 'png', ] + licenseMap: { [key: string]: string | null }= { + 'Copyright. All rights reserved.': 'All Rights Reserved', + 'CC BY 4.0': 'https://creativecommons.org/licenses/by/4.0/', + 'Other': null, + } + author: Author = { name: '', url: [], @@ -773,6 +779,7 @@ export default class IscnRegisterForm extends Vue { sameAs: string[] = [] url: string = '' license: string = this.licenseOptions[0] + customLicense: string = '' authorName: string = '' authorUrl: string[] = [] authorWalletAddress: string[] = [] @@ -852,6 +859,7 @@ export default class IscnRegisterForm extends Vue { get defaultType() { if (this.isPhoto) return 'Photo' if (this.isImage) return 'Image' + if (this.fileType === 'application/pdf' || this.fileType === 'application/epub+zip') return 'Book' return 'CreativeWork' } @@ -884,13 +892,21 @@ export default class IscnRegisterForm extends Vue { } get formattedSameAsList() { - return this.sameAsList.map((sameAs: { filename: any; filetype: any; url: any }) => { - if (sameAs.filename && sameAs.filetype) { - return `${sameAs.url}?name=${sameAs.filename}.${sameAs.filetype}`; - } - return ''; - }); -} + return this.sameAsList.map((sameAs: { filename: any; filetype: any; url: any }) => { + if (sameAs.filename && sameAs.filetype) { + return `${sameAs.url}?name=${sameAs.filename}.${sameAs.filetype}`; + } + return ''; + }); + } + + get licenseOptions() { + return Object.keys(this.licenseMap) + } + + get formattedLicense() { + return this.licenseMap[this.license] || this.customLicense; + } get errorMsg() { switch (this.error) { @@ -964,7 +980,7 @@ export default class IscnRegisterForm extends Vue { sameAs: this.formattedSameAsList, url: this.url, exifInfo: this.exif, - license: this.license, + license: this.formattedLicense, ipfsHash: this.uploadIpfsHash || this.ipfsHash, arweaveId: this.uploadArweaveId || this.arweaveId, numbersProtocolAssetId: this.numbersProtocolAssetId, @@ -1051,15 +1067,6 @@ export default class IscnRegisterForm extends Vue { if (errormsg) this.isOpenWarningSnackbar = true } - // @Watch('contentFingerprintLinks') - // setSameAsList() { - // this.sameAsList = this.contentFingerprintLinks.map((url) => ({ - // url, - // filename: '', - // filetype: this.fileTypeOptions[0], - // })) - // } - async mounted() { this.uploadStatus = 'loading' await this.estimateArweaveFee(); @@ -1192,7 +1199,6 @@ export default class IscnRegisterForm extends Vue { confirmSameAsChange(value: any) { logTrackerEvent(this, 'ISCNCreate', 'ConfirmSameAsChange', '', 1); - console.log('value',value) this.sameAsList = value this.isOpenSameAsDialog = false } diff --git a/components/IscnUploadedInfo.vue b/components/IscnUploadedInfo.vue index ae87d5c2..ff315363 100644 --- a/components/IscnUploadedInfo.vue +++ b/components/IscnUploadedInfo.vue @@ -238,20 +238,11 @@ export default class IscnUploadedInfo extends Vue { } handleClickDownload() { - const { url, name, keywords, usageInfo, author, description, sameAs } = - this.metadata const generateData = { contentMetadata: { - url, - name, + ...this.metadata, '@type': this.type, - version: 1, '@context': "http://schema.org/", - keywords, - usageInfo, - author, - description, - sameAs, }, stakeholders: this.recordData?.stakeholders, contentFingerprints: this.contentFingerprints, diff --git a/components/SameAsFieldList.vue b/components/SameAsFieldList.vue index 42cf2afa..aeedeaf3 100644 --- a/components/SameAsFieldList.vue +++ b/components/SameAsFieldList.vue @@ -25,8 +25,8 @@ @@ -68,7 +68,7 @@ diff --git a/constant/index.ts b/constant/index.ts index f80b4f80..4ea9e079 100644 --- a/constant/index.ts +++ b/constant/index.ts @@ -58,7 +58,7 @@ export const WALLET_TYPES = [ 'eth', ] -export const FILE_TYPES = [ +export const SAME_AS_FILE_TYPES = [ 'epub', 'pdf', 'mp3',