Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[TAS-918] 🚸 Add iscnOwner to stakeholders #435

Merged
merged 2 commits into from
Jan 10, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 = []
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
authorWalletAddress: any = []
authorWalletAddress: any[] = []

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
wallet: any;
wallet: any[];

likerId: string;
authorDescription: string;
}
Loading