From 63bfe4f75e330df65938a736b7436d6256683f94 Mon Sep 17 00:00:00 2001 From: Sam Schantz Date: Mon, 15 Jul 2024 15:47:53 -0300 Subject: [PATCH 1/2] adding reg dashboard --- strr-web/composables/useRegistrations.ts | 12 ++- .../interfaces/paginated-registrations-i.ts | 6 ++ strr-web/interfaces/pagination-i.ts | 14 +++ strr-web/pages/registry-dashboard.vue | 93 ++++++++++++++++++- 4 files changed, 118 insertions(+), 7 deletions(-) create mode 100644 strr-web/interfaces/paginated-registrations-i.ts create mode 100644 strr-web/interfaces/pagination-i.ts diff --git a/strr-web/composables/useRegistrations.ts b/strr-web/composables/useRegistrations.ts index 2491235a..735e0ec3 100644 --- a/strr-web/composables/useRegistrations.ts +++ b/strr-web/composables/useRegistrations.ts @@ -2,6 +2,7 @@ import axios from 'axios' import { SbcCreationResponseE } from '~/enums/sbc-creation-response-e' import { AutoApprovalDataI } from '~/interfaces/auto-approval-data-i' import { LtsaDataI } from '~/interfaces/ltsa-data-i' +import { PaginationI } from '~/interfaces/pagination-i' import { RegistrationHistoryEventI } from '~/interfaces/registration-history-event-i' export const useRegistrations = () => { @@ -24,9 +25,15 @@ export const useRegistrations = () => { ) }) + const getPaginatedRegistrations = (paginationObject: PaginationI): Promise => { + const params = new URLSearchParams(paginationObject as unknown as Record) + return axiosInstance.get(`${apiURL}/registrations${params.size ? `/?${params}` : ''}`) + .then(res => res.data) + } + const getRegistration = (id: string): Promise => - axiosInstance.get(`${apiURL}/registrations`) - .then(res => res.data.find((registration: any) => registration.id.toString() === id)) + axiosInstance.get(`${apiURL}/registration/${id}`) + .then(res => res.data) const getLtsa = (id: string): Promise => axiosInstance.get(`${apiURL}/registrations/${id}/ltsa`) @@ -89,6 +96,7 @@ export const useRegistrations = () => { createSbcRegistration, getDocumentsForRegistration, getRegistrations, + getPaginatedRegistrations, getRegistration, getRegistrationHistory, getLtsa, diff --git a/strr-web/interfaces/paginated-registrations-i.ts b/strr-web/interfaces/paginated-registrations-i.ts new file mode 100644 index 00000000..e066ce7a --- /dev/null +++ b/strr-web/interfaces/paginated-registrations-i.ts @@ -0,0 +1,6 @@ +import { RegistrationI } from './registration-i' + +export interface PaginatedRegistrationsI { + count: number, + results: RegistrationI[] +} diff --git a/strr-web/interfaces/pagination-i.ts b/strr-web/interfaces/pagination-i.ts new file mode 100644 index 00000000..585ac3d6 --- /dev/null +++ b/strr-web/interfaces/pagination-i.ts @@ -0,0 +1,14 @@ +export interface PaginationI { + filter_by_status?: string, + offset?: string, + limit?: string +} + +export enum RegistrationStatusesE { + PENDING, + APPROVED, + UNDER_REVIEW, + MORE_INFO_NEEDED, + PROVISIONAL, + DENIED +} diff --git a/strr-web/pages/registry-dashboard.vue b/strr-web/pages/registry-dashboard.vue index 2d62cb19..f7a7000c 100644 --- a/strr-web/pages/registry-dashboard.vue +++ b/strr-web/pages/registry-dashboard.vue @@ -4,22 +4,105 @@
-
+
- +
- + + +
- + +
+ Showing... + +