From c53e1bc4dcdf74b97073c48286c711a2e4702dcd Mon Sep 17 00:00:00 2001 From: Kepler Vital Date: Fri, 22 Nov 2024 16:51:58 +0000 Subject: [PATCH 1/2] fix(wallet): transfer requests page should only show transfers --- core/station/impl/src/core/init.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/station/impl/src/core/init.rs b/core/station/impl/src/core/init.rs index acb94dcc2..d99127199 100644 --- a/core/station/impl/src/core/init.rs +++ b/core/station/impl/src/core/init.rs @@ -15,7 +15,7 @@ lazy_static! { pub static ref DEFAULT_PERMISSIONS: Vec<(Allow, Resource)> = vec![ // all authenticated users can read the capabilities of the canister ( - Allow::public(), + Allow::authenticated(), Resource::System(SystemResourceAction::Capabilities), ), // Admins can read the system info which includes the canister's version, cycles, etc. From c5182de07effc214c5fbae14146eb623fdfea6d2 Mon Sep 17 00:00:00 2001 From: Kepler Vital Date: Fri, 22 Nov 2024 17:06:49 +0000 Subject: [PATCH 2/2] ensure domains provided to the requests page are used --- apps/wallet/src/composables/request.composable.ts | 9 ++++++++- apps/wallet/src/pages/RequestsPage.vue | 6 ++++-- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/apps/wallet/src/composables/request.composable.ts b/apps/wallet/src/composables/request.composable.ts index eceda4633..ed4f0db9a 100644 --- a/apps/wallet/src/composables/request.composable.ts +++ b/apps/wallet/src/composables/request.composable.ts @@ -21,7 +21,9 @@ export type AvailableDomain = { types: ListRequestsOperationType[]; }; -export const useAvailableDomains = (): Ref => { +export const useAvailableDomains = ( + opts: { filterBy?: RequestDomains[] } = {}, +): Ref => { const domains: Ref = ref([]); domains.value.push({ id: RequestDomains.All, @@ -86,6 +88,11 @@ export const useAvailableDomains = (): Ref => { ], }); + const filterBy = opts?.filterBy ?? []; + if (filterBy.length) { + domains.value = domains.value.filter(domain => filterBy.includes(domain.id)); + } + return domains; }; diff --git a/apps/wallet/src/pages/RequestsPage.vue b/apps/wallet/src/pages/RequestsPage.vue index 138a53a0c..1f95c105a 100644 --- a/apps/wallet/src/pages/RequestsPage.vue +++ b/apps/wallet/src/pages/RequestsPage.vue @@ -173,7 +173,7 @@ const props = withDefaults(defineProps(), { const i18n = useI18n(); const pageTitle = computed(() => props.title || i18n.t('pages.requests.title')); const station = useStationStore(); -const availableDomains = useAvailableDomains(); +const availableDomains = useAvailableDomains({ filterBy: props.domains }); const statuses = useRequestStatusItems(); const filterUtils = useFilterUtils(); const disableRefresh = ref(false); @@ -200,7 +200,9 @@ const slideGroupIdIndex = ref( watch( slideGroupIdIndex, index => { - filters.value.groupBy = availableDomains.value[index].id ?? RequestDomains.All; + const fallbackDomain = props.domains.length ? props.domains[0] : RequestDomains.All; + + filters.value.groupBy = availableDomains.value?.[index]?.id ?? fallbackDomain; }, { immediate: true }, );