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-2059] ✨ Add ISCN publisher support #1929

Merged
merged 3 commits into from
Nov 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
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
21 changes: 17 additions & 4 deletions src/components/NFTBook/ItemCard.vue
Original file line number Diff line number Diff line change
Expand Up @@ -149,9 +149,20 @@
class="flex flex-col justify-center min-w-0"
>
<NFTBookSpecTableLabel :text="$t('identity_type_author')" />
<span :class="['font-[600]', displayNameStyle]">{{
iscnWorkAuthor
}}</span>
<NFTBookSpecTableLabel
:text="iscnWorkAuthor"
:is-campaign="preset === 'campaign'"
/>
</li>
<li
v-if="iscnWorkPublisher"
class="flex flex-col justify-center min-w-0"
>
<NFTBookSpecTableLabel :text="$t('identity_type_publisher')" />
<NFTBookSpecTableLabel
:text="iscnWorkPublisher"
:is-campaign="preset === 'campaign'"
/>
</li>
<client-only>
<li>
Expand Down Expand Up @@ -180,7 +191,9 @@
:text="
$t(
iscnWorkAuthor
? 'identity_type_publisher'
? iscnWorkPublisher
? 'identity_type_distributor'
: 'identity_type_publisher'
: 'identity_type_creator'
)
"
Expand Down
3 changes: 3 additions & 0 deletions src/mixins/nft.js
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,9 @@ export default {
iscnWorkAuthor() {
return this.iscnData?.contentMetadata?.author?.trim();
},
iscnWorkPublisher() {
return this.iscnData?.contentMetadata?.publisher?.trim();
},
iscnURL() {
return `${APP_LIKE_CO_VIEW}/${encodeURIComponent(this.iscnId)}`;
},
Expand Down
16 changes: 15 additions & 1 deletion src/pages/nft/claim/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -95,12 +95,26 @@
{{ iscnWorkAuthor }}
</p>
</div>
<div v-if="creatorDisplayName" class="flex flex-col w-full">
<div v-if="iscnWorkPublisher" class="flex flex-col w-full">
<Label
preset="h6"
:text="$t('identity_type_publisher')"
class=" text-medium-gray font-[500]"
/>
<p class="text-[16px] font-[500] w-full break-words">
{{ iscnWorkPublisher }}
</p>
</div>
<div v-if="creatorDisplayName" class="flex flex-col w-full">
<Label
preset="h6"
:text="
iscnWorkPublisher
? $t('identity_type_distributor')
: $t('identity_type_publisher')
"
class=" text-medium-gray font-[500]"
/>
<p class="text-[16px] font-[500] w-full break-words">
{{ creatorDisplayName }}
</p>
Expand Down
3 changes: 2 additions & 1 deletion src/pages/nft/class/_classId/_nftId.vue
Original file line number Diff line number Diff line change
Expand Up @@ -484,7 +484,8 @@ export default {
'@context': 'http://www.schema.org',
'@type': this.nftIsNFTBook ? 'Book' : 'CreativeWork',
name: title,
author: this.iscnWorkAuthor,
author: this.iscnWorkAuthor || this.iscnOwner,
publisher: this.iscnWorkPublisher || this.iscnOwner,
image: [this.NFTImageUrl],
description: this.NFTDescription,
brand,
Expand Down
5 changes: 3 additions & 2 deletions src/pages/nft/class/_classId/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -584,7 +584,7 @@ export default {
'@context': 'http://www.schema.org',
'@type': ['CreativeWork', 'Product'],
name: title,
author: this.iscnWorkAuthor,
author: this.iscnWorkAuthor || this.iscnOwnerPerson,
image: [ogImage],
description,
brand: {
Expand Down Expand Up @@ -635,8 +635,9 @@ export default {
url: 'https://liker.land/about/nft-book',
name: 'NFT Book',
},
author: iscnOwnerPerson,
author: this.iscnWorkAuthor || iscnOwnerPerson,
sku: this.classId,
publisher: this.iscnWorkPublisher || iscnOwnerPerson,
isbn: this.iscnData?.contentMetadata?.isbn,
inLanguage: this.iscnData?.contentMetadata?.inLanguage,
productGroupID: this.classId,
Expand Down
16 changes: 15 additions & 1 deletion src/pages/nft/gift/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,24 @@
/>
<Label preset="h5" :text="iscnWorkAuthor" />
</div>
<div class="flex flex-col">
<div v-if="iscnWorkPublisher" class="flex flex-col w-full">
<Label
preset="h6"
:text="$t('identity_type_publisher')"
class=" text-medium-gray font-[500]"
/>
<p class="text-[16px] font-[500] w-full break-words">
{{ iscnWorkPublisher }}
</p>
</div>
<div class="flex flex-col">
<Label
preset="h6"
:text="
iscnWorkPublisher
? $t('identity_type_distributor')
: $t('identity_type_publisher')
"
class=" text-medium-gray"
/>
<Label preset="h5" :text="creatorDisplayName" />
Expand Down
Loading