Skip to content

Commit

Permalink
✨ Add ISBN field for Book
Browse files Browse the repository at this point in the history
  • Loading branch information
AuroraHuang22 committed Nov 2, 2023
1 parent 68f7e42 commit 4bafeb3
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 2 deletions.
15 changes: 14 additions & 1 deletion components/IscnRegisterForm.vue
Original file line number Diff line number Diff line change
Expand Up @@ -355,6 +355,15 @@
:placeholder="$t('IscnRegisterForm.placeholder.url')"
/>
</FormField>
<FormField
v-if="type === 'Book'"
:label="$t('IscnRegisterForm.label.isbn')"
>
<TextField
v-model="isbn"
:placeholder="$t('IscnRegisterForm.placeholder.isbn')"
/>
</FormField>
<Divider class="my-[12px]" />
<FormField
:label="$t('IscnRegisterForm.label.type')"
Expand Down Expand Up @@ -786,8 +795,10 @@ export default class IscnRegisterForm extends Vue {
tags: string[] = []
sameAs: string[] = []
url: string = ''
isbn: string = ''
license: string = this.licenseOptions[0]
customLicense: string = ''
thumbnailUrl: string = ''
authorName: string = ''
authorUrl: string[] = []
authorWalletAddress: string[] = []
Expand Down Expand Up @@ -991,6 +1002,7 @@ export default class IscnRegisterForm extends Vue {
tagsString: this.tagsString,
sameAs: this.formattedSameAsList,
url: this.url,
isbn: this.isbn,
exifInfo: this.exif.filter(file => file),
license: this.formattedLicense,
ipfsHash: this.ipfsHashList,
Expand All @@ -1006,7 +1018,7 @@ export default class IscnRegisterForm extends Vue {
authorDescriptions: this.authorDescriptions,
contentFingerprints: this.customContentFingerprints,
inLanguage: this.language,
thumbnailUrl: this.epubMetadata?.thumbnailUrl,
thumbnailUrl: this.thumbnailUrl,
}
}
Expand Down Expand Up @@ -1092,6 +1104,7 @@ export default class IscnRegisterForm extends Vue {
this.author.name = this.epubMetadata.author;
this.language = this.epubMetadata.language
this.tags = this.epubMetadata.tags
this.thumbnailUrl = this.epubMetadata.thumbnailUrl
if (this.author.name) { this.authors.push(this.author) }
}
Expand Down
2 changes: 1 addition & 1 deletion components/IscnUploadForm.vue
Original file line number Diff line number Diff line change
Expand Up @@ -740,7 +740,7 @@ export default class UploadForm extends Vue {
if (arweaveId) {
const uploadedData = this.sentArweaveTransactionHashes.get(records.ipfsHash) || {};
this.sentArweaveTransactionHashes.set(records.ipfsHash, { ...uploadedData, arweaveId });
if (tempRecord.fileName === 'cover.jpeg') {
if (tempRecord.fileName.includes('cover.jpeg')) {
const metadata = this.epubMetadataList.find((file: any) => file.ipfsHash === records.ipfsHash)
metadata.thumbnailUrl = `ar://${arweaveId}`
}
Expand Down
2 changes: 2 additions & 0 deletions locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,7 @@
"IscnRegisterForm.label.emptyFile": "No Content",
"IscnRegisterForm.label.fingerprints": "Content Fingerprints",
"IscnRegisterForm.label.iscn": "ISCN Title",
"IscnRegisterForm.label.isbn": "ISBN",
"IscnRegisterForm.label.license": "License",
"IscnRegisterForm.label.likerID": "LikerID",
"IscnRegisterForm.label.sameAs" : "Same As URLs",
Expand All @@ -235,6 +236,7 @@
"IscnRegisterForm.placeholder.fileName": "File Name (en)",
"IscnRegisterForm.placeholder.fileType": "File Type",
"IscnRegisterForm.placeholder.url": "URL",
"IscnRegisterForm.placeholder.isbn": "ISBN 10/ ISCN 13",
"IscnRegisterForm.placeholder.wallet": "Wallet Address",
"IscnRegisterForm.quitAlertDialog.confirm": "Cancel Registration",
"IscnRegisterForm.quitAlertDialog.content": "Your registration will be cancelled if you leave this page, and the paid fee cannot be refunded.",
Expand Down
1 change: 1 addition & 0 deletions utils/cosmos/iscn/iscn.type.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ export interface ISCNRegisterPayload {
memo?: string;
inLanguage?: string;
thumbnailUrl?: string;
isbn?: string | number;
}
export interface ISCNRecordWithID extends ISCNRecord {
id: string;
Expand Down

0 comments on commit 4bafeb3

Please sign in to comment.