diff --git a/components/IscnRegisterForm.vue b/components/IscnRegisterForm.vue index f14bc812..cdc986a3 100644 --- a/components/IscnRegisterForm.vue +++ b/components/IscnRegisterForm.vue @@ -163,7 +163,7 @@ v-model="description" :is-textarea="true" :error-message=" - validateField(description, charactersLimit.description, true) + validateField(description, charactersLimit.descriptionMax, true, charactersLimit.descriptionMin) " :placeholder="$t('IscnRegisterForm.placeholder.description')" /> @@ -698,7 +698,8 @@ const walletModule = namespace('wallet') export enum CharactersLimit { name = 100, - description = 1600, + descriptionMax = 1600, + descriptionMin = 10, tagContent = 35, tagNumber = 10, authorName = 100, @@ -1042,12 +1043,13 @@ export default class IscnRegisterForm extends Vue { numbersProtocolAssetId: [...this.numbersProtocolAssetIds.values()], fileSHA256: this.fileRecords.map((file) => file.fileSHA256), author: this.author.name, + authorDescription: this.author.authorDescription, authorNames: this.authorNames, + authorDescriptions: this.authorDescriptions, authorUrls: this.authorUrls, authorWallets: this.authorWalletAddresses, likerIds: this.likerIds, likerIdsAddresses: this.likerIdsAddresses, - authorDescriptions: this.authorDescriptions, contentFingerprints: this.contentFingerprintLinks, inLanguage: this.language, thumbnailUrl: this.thumbnailUrl, @@ -1107,7 +1109,8 @@ export default class IscnRegisterForm extends Vue { this.name && this.description && this.name.length <= CharactersLimit.name && - this.description.length <= CharactersLimit.description + this.description.length <= CharactersLimit.descriptionMax && + this.description.length >= CharactersLimit.descriptionMin ) } @@ -1155,7 +1158,7 @@ export default class IscnRegisterForm extends Vue { this.name = this.epubMetadata.title || '' this.description = this.extractText(this.epubMetadata.description) this.author.name = this.epubMetadata.author || '' - this.author.authorDescription = 'Author' + this.author.authorDescription = '' this.tags = this.epubMetadata.tags || [] this.thumbnailUrl = this.formatArweave( this.epubMetadata.thumbnailArweaveId, @@ -1189,7 +1192,7 @@ export default class IscnRegisterForm extends Vue { wallet: [{ content: address, id: 1, type: 'like', isOpenOptions: false }], url: [], likerId: userData?.user || '', - authorDescription: userData?.description || 'Publisher', + authorDescription: userData?.description || '', } } diff --git a/utils/cosmos/iscn/iscn.type.ts b/utils/cosmos/iscn/iscn.type.ts index cbeb32db..798c9e3d 100644 --- a/utils/cosmos/iscn/iscn.type.ts +++ b/utils/cosmos/iscn/iscn.type.ts @@ -14,6 +14,7 @@ export interface ISCNRegisterPayload { type: string; publisher?: string, author: string; + authorDescription?: string; authorNames: string[]; authorUrls: string[][]; authorWallets: any[][]; diff --git a/utils/cosmos/iscn/sign.ts b/utils/cosmos/iscn/sign.ts index 1c81a027..39464112 100644 --- a/utils/cosmos/iscn/sign.ts +++ b/utils/cosmos/iscn/sign.ts @@ -37,12 +37,13 @@ export function formatISCNTxPayload(payload: ISCNRegisterPayload): ISCNSignPaylo arweaveId, fileSHA256, author, + authorDescription, authorNames, + authorDescriptions, authorUrls, authorWallets, likerIds, likerIdsAddresses, - authorDescriptions, numbersProtocolAssetId, contentFingerprints: contentFingerprintsInput = [], stakeholders: stakeholdersInput = [], @@ -135,10 +136,15 @@ export function formatISCNTxPayload(payload: ISCNRegisterPayload): ISCNSignPaylo } } + const authorEntity = (author && authorDescription) ? { + name: author, + description: authorDescription, + } : author + return { ...data, publisher: publisherInput, - author, + author: authorEntity, keywords: tagsString.split(','), usageInfo: license, contentFingerprints: [...new Set(contentFingerprints)],