Skip to content

Commit

Permalink
✨ Add publisher and datePublished support (#496)
Browse files Browse the repository at this point in the history
* ✨ Add publisher and datePublished support

* 🔥 Remove unused console.log
  • Loading branch information
williamchong authored Nov 1, 2024
1 parent b4d8f90 commit 92e6369
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 0 deletions.
22 changes: 22 additions & 0 deletions components/IscnRegisterForm.vue
Original file line number Diff line number Diff line change
Expand Up @@ -330,6 +330,24 @@
:placeholder="$t('IscnRegisterForm.placeholder.isbn')"
/>
</FormField>
<FormField
v-if="type === 'Book'"
:label="$t('IscnRegisterForm.label.publisher')"
>
<TextField
v-model="publisher"
:placeholder="$t('IscnRegisterForm.placeholder.publisher')"
/>
</FormField>
<FormField
v-if="type === 'Book'"
:label="$t('IscnRegisterForm.label.datePublished')"
>
<input
v-model="datePublished"
type="date"
/>
</FormField>
<FormField
v-if="shouldShowUploadToNumbers"
:label="$t('IscnRegisterForm.label.numbersProtocol')"
Expand Down Expand Up @@ -745,6 +763,8 @@ export default class IscnRegisterForm extends Vue {
authors: Author[] = []
name: string = ''
description: string = ''
publisher: string = ''
datePublished: null | string = null
tags: string[] = []
sameAs: string[] = []
url: string = ''
Expand Down Expand Up @@ -1007,6 +1027,8 @@ export default class IscnRegisterForm extends Vue {
contentFingerprints: this.customContentFingerprints,
inLanguage: this.language,
thumbnailUrl: this.thumbnailUrl,
publisher: this.publisher,
datePublished: this.datePublished ? new Date(this.datePublished).toISOString() : undefined,
}
}
Expand Down
3 changes: 3 additions & 0 deletions locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,7 @@
"IscnRegisterForm.fileSHA256.link": "hash://sha256/{hash}",
"IscnRegisterForm.label.author": "Author",
"IscnRegisterForm.label.stakeholder": "Stakeholders",
"IscnRegisterForm.label.datePublished": "Original Date Published",
"IscnRegisterForm.label.description": "Description",
"IscnRegisterForm.label.emptyFile": "No Content",
"IscnRegisterForm.label.fingerprints": "Content Fingerprints",
Expand All @@ -234,6 +235,7 @@
"IscnRegisterForm.label.fileName": "File name",
"IscnRegisterForm.label.fileType": "File type",
"IscnRegisterForm.label.originFile": "origin file: {name}",
"IscnRegisterForm.label.publisher": "Publisher",
"IscnRegisterForm.label.numbersProtocol": "Numbers Protocol",
"IscnRegisterForm.label.numbersProtocol.details": "Register your image asset in {link}",
"IscnRegisterForm.label.numbersProtocol.details.link": "Numbers Protocol",
Expand All @@ -252,6 +254,7 @@
"IscnRegisterForm.placeholder.name": "Name",
"IscnRegisterForm.placeholder.fileName": "File Name (en)",
"IscnRegisterForm.placeholder.fileType": "File Type",
"IscnRegisterForm.placeholder.publisher": "Publisher",
"IscnRegisterForm.placeholder.url": "URL",
"IscnRegisterForm.placeholder.isbn": "ISBN 10/ ISBN 13",
"IscnRegisterForm.placeholder.wallet": "Wallet Address",
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 @@ -25,6 +25,7 @@ export interface ISCNRegisterPayload {
recordNotes?: string;
memo?: string;
inLanguage?: string;
datePublished?: string,
thumbnailUrl?: string;
isbn?: string;
}
Expand Down
1 change: 1 addition & 0 deletions utils/cosmos/iscn/sign.ts
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,7 @@ export function formatISCNTxPayload(payload: ISCNRegisterPayload): ISCNSignPaylo

return {
...data,
publisher: publisherInput,
author,
keywords: tagsString.split(','),
usageInfo: license,
Expand Down

0 comments on commit 92e6369

Please sign in to comment.