Skip to content

Commit

Permalink
🚸 Add iscnOwner to stakeholders
Browse files Browse the repository at this point in the history
  • Loading branch information
AuroraHuang22 committed Jan 9, 2024
1 parent a6bd82e commit 8d6a8a5
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 16 deletions.
52 changes: 37 additions & 15 deletions components/IscnRegisterForm.vue
Original file line number Diff line number Diff line change
Expand Up @@ -809,7 +809,7 @@ export default class IscnRegisterForm extends Vue {
thumbnailUrl: string = ''
authorName: string = ''
authorUrl: string[] = []
authorWalletAddress: string[] = []
authorWalletAddress: any = []
sentArweaveTransactionHashes = new Map<
string, { transactionHash?: string, arweaveId?: string }
>()
Expand Down Expand Up @@ -875,7 +875,12 @@ export default class IscnRegisterForm extends Vue {
}
get authorNames() {
return this.authors.map((a) => a.name)
return this.authors.map((a) => {
if (a.name === this.$t('iscn.meta.stakeholders.name.placeholder')) {
return 'ISCN Owner';
}
return a.name;
});
}
get authorUrls() {
Expand Down Expand Up @@ -1109,21 +1114,38 @@ export default class IscnRegisterForm extends Vue {
}
async mounted() {
if (this.epubMetadata) {
this.name = this.epubMetadata.title;
this.description = this.extractText(this.epubMetadata.description);
this.author.name = this.epubMetadata.author;
this.language = this.epubMetadata.language
this.tags = this.epubMetadata.tags
this.thumbnailUrl = this.formatArweave(this.epubMetadata.thumbnailUrl) as string
if (this.author.name) { this.authors.push(this.author) }
if (this.epubMetadata) {
this.name = this.epubMetadata.title;
this.description = this.extractText(this.epubMetadata.description);
this.author.name = this.epubMetadata.author;
this.author.authorDescription = 'Author'
this.language = this.epubMetadata.language
this.tags = this.epubMetadata.tags
this.thumbnailUrl = this.formatArweave(this.epubMetadata.thumbnailUrl) as string
if (this.author.name) {
this.authors.push(this.author)
}
this.uploadStatus = 'loading'
// ISCN Fee needs Arweave fee to calculate
await this.calculateISCNFee()
this.uploadStatus = ''
}
if (this.address) {
const iscnOwner = {
name: this.$t('iscn.meta.stakeholders.name.placeholder') as string,
wallet: [{
content: this.address,
id: 1,
type: 'like',
isOpenOptions: false,
}],
url: [],
likerId: '',
authorDescription: 'ISCN owner',
}
this.authors.push(iscnOwner)
}
this.uploadStatus = 'loading'
// ISCN Fee needs Arweave fee to calculate
await this.calculateISCNFee()
this.uploadStatus = ''
}
addContentFingerprint() {
this.customContentFingerprints.push(this.contentFingerprintInput)
Expand Down
1 change: 1 addition & 0 deletions locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,7 @@
"iscn.meta.stakeholders.id": "Stakeholder ID",
"iscn.meta.stakeholders.likerId": "Liker ID",
"iscn.meta.stakeholders.name": "Stakeholder Name",
"iscn.meta.stakeholders.name.placeholder": "{ your display name }",
"iscn.meta.stakeholders.url": "URL",
"iscn.meta.stakeholders.wallet.copied": "Copied",
"iscn.meta.stakeholders.wallet.placeholder": "Wallet addresses",
Expand Down
2 changes: 1 addition & 1 deletion types/author.d.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
export interface Author {
name: string;
url: string[];
wallet: string[];
wallet: any;
likerId: string;
authorDescription: string;
}

0 comments on commit 8d6a8a5

Please sign in to comment.