From 501d327d841c73e7bb2f404cdde943f854abbab6 Mon Sep 17 00:00:00 2001 From: roiLeo Date: Fri, 15 Jul 2022 08:57:11 +0200 Subject: [PATCH 1/4] =?UTF-8?q?=F0=9F=94=A7=20hotfix=20bsx=20collection=20?= =?UTF-8?q?sort=20&=20own?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/rmrk/Gallery/CollectionItem.vue | 34 +++++++++++++++------- langDir/en.json | 3 ++ 2 files changed, 26 insertions(+), 11 deletions(-) diff --git a/components/rmrk/Gallery/CollectionItem.vue b/components/rmrk/Gallery/CollectionItem.vue index 9b8472bf6f..3143787334 100644 --- a/components/rmrk/Gallery/CollectionItem.vue +++ b/components/rmrk/Gallery/CollectionItem.vue @@ -67,7 +67,11 @@ v-bind.sync="searchQuery" :showOwnerSwitch="!!accountId" :disableToggle="!totalListed" - :sortOption="collectionProfileSortOption"> + :sortOption=" + urlPrefix === 'rmrk' + ? collectionProfileSortOption + : squidCollectionProfileSortOption + "> 0 } @@ -315,9 +328,13 @@ export default class CollectionItem extends mixins( } if (this.searchQuery.owned && this.accountId) { - params.push({ - currentOwner: { equalTo: this.accountId }, - }) + if (this.urlPrefix === 'rmrk') { + params.push({ + currentOwner: { equalTo: this.accountId }, + }) + } else { + params.push({ currentOwner_eq: this.accountId }) + } } return params @@ -341,12 +358,7 @@ export default class CollectionItem extends mixins( client: this.urlPrefix, variables: { id: this.id, - // orderBy: 'blockNumber_DESC', - orderBy: ifRMRK( - this.urlPrefix, - this.searchQuery.sortBy, - 'blockNumber_DESC' - ), + orderBy: this.searchQuery.sortBy, search: this.buildSearchParam(), first: this.first, offset: (page - 1) * this.first, diff --git a/langDir/en.json b/langDir/en.json index dd0bc666b4..cf0ac155c7 100644 --- a/langDir/en.json +++ b/langDir/en.json @@ -396,6 +396,9 @@ "PRICE_DESC": "Price: High to Low", "PRICE_ASC": "Price: Low to High", "SN_ASC": "Serial Number Ascending", + "price_DESC": "Price: High to Low", + "price_ASC": "Price: Low to High", + "sn_ASC": "Serial Number Ascending", "listed": "Buy now", "own": "Own" }, From 81e61412c368e39a308a344bd429274731f087f6 Mon Sep 17 00:00:00 2001 From: roiLeo Date: Fri, 15 Jul 2022 08:57:54 +0200 Subject: [PATCH 2/4] =?UTF-8?q?=F0=9F=94=A7=20sort=20collection=20variable?= =?UTF-8?q?=20visibility?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/rmrk/Gallery/CollectionItem.vue | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/components/rmrk/Gallery/CollectionItem.vue b/components/rmrk/Gallery/CollectionItem.vue index 3143787334..c69d6fa76b 100644 --- a/components/rmrk/Gallery/CollectionItem.vue +++ b/components/rmrk/Gallery/CollectionItem.vue @@ -227,7 +227,7 @@ export default class CollectionItem extends mixins( private isLoading = true private nfts: NFT[] = [] - collectionProfileSortOption: string[] = [ + protected collectionProfileSortOption: string[] = [ 'EMOTES_COUNT_DESC', 'BLOCK_NUMBER_DESC', 'BLOCK_NUMBER_ASC', @@ -238,7 +238,7 @@ export default class CollectionItem extends mixins( 'SN_ASC', ] - squidCollectionProfileSortOption: string[] = [ + protected squidCollectionProfileSortOption: string[] = [ 'blockNumber_DESC', 'blockNumber_ASC', 'updatedAt_DESC', From cce14a4da8e327e5499142107ed18dad023878a9 Mon Sep 17 00:00:00 2001 From: roiLeo Date: Fri, 15 Jul 2022 10:20:28 +0200 Subject: [PATCH 3/4] Update CollectionItem.vue --- components/rmrk/Gallery/CollectionItem.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/rmrk/Gallery/CollectionItem.vue b/components/rmrk/Gallery/CollectionItem.vue index c69d6fa76b..2b4b09ebba 100644 --- a/components/rmrk/Gallery/CollectionItem.vue +++ b/components/rmrk/Gallery/CollectionItem.vue @@ -150,7 +150,7 @@ import { notificationTypes, showNotification } from '@/utils/notification' import resolveQueryPath from '@/utils/queryPathResolver' import shouldUpdate from '@/utils/shouldUpdate' import { sortedEventByDate } from '@/utils/sorting' -import { correctPrefix, ifRMRK, unwrapSafe } from '@/utils/uniquery' +import { correctPrefix, unwrapSafe } from '@/utils/uniquery' import { Component, mixins, Ref, Watch } from 'nuxt-property-decorator' import { Debounce } from 'vue-debounce-decorator' import { CollectionWithMeta, Interaction } from '../service/scheme' From e4ab848f2c808042c1cee3c442144867574fe9c3 Mon Sep 17 00:00:00 2001 From: roiLeo Date: Fri, 15 Jul 2022 14:09:15 +0200 Subject: [PATCH 4/4] =?UTF-8?q?=F0=9F=94=A7=20sorting=20collection=20item?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/rmrk/Gallery/CollectionItem.vue | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/components/rmrk/Gallery/CollectionItem.vue b/components/rmrk/Gallery/CollectionItem.vue index 2b4b09ebba..482a4ed3be 100644 --- a/components/rmrk/Gallery/CollectionItem.vue +++ b/components/rmrk/Gallery/CollectionItem.vue @@ -207,26 +207,29 @@ export default class CollectionItem extends mixins( private searchQuery: SearchQuery = { search: this.$route.query?.search?.toString() ?? '', type: this.$route.query?.type?.toString() ?? '', - sortBy: this.$route.query?.sort?.toString() ?? 'BLOCK_NUMBER_DESC', + sortBy: + this.$route.query?.sort?.toString() ?? this.urlPrefix === 'rmrk' + ? 'BLOCK_NUMBER_DESC' + : 'blockNumber_DESC', listed: this.$route.query?.listed?.toString() === 'true', owned: false, } public activeTab = 'items' + protected isLoading = true protected first = 16 protected totalListed = 0 protected stats: NFT[] = [] protected priceData: [ChartData[], ChartData[]] | [] = [] - private queryLoading = 0 public eventsOfNftCollection: Interaction[] | [] = [] public ownerEventsOfNftCollection: Interaction[] | [] = [] public selectedEvent = 'all' public priceChartData: [Date, number][][] = [] private openHistory = true private openHolder = true - private isLoading = true private nfts: NFT[] = [] + // replacee with constant protected collectionProfileSortOption: string[] = [ 'EMOTES_COUNT_DESC', 'BLOCK_NUMBER_DESC', @@ -238,6 +241,7 @@ export default class CollectionItem extends mixins( 'SN_ASC', ] + // move to constant protected squidCollectionProfileSortOption: string[] = [ 'blockNumber_DESC', 'blockNumber_ASC',