refactor: updated dashboard gql queries and components to use the new infra type of the updated schema (#3455)

This commit is contained in:
Joel Jacob Stephen
2023-11-01 23:40:19 +05:30
committed by GitHub
parent a215860782
commit 9dcbc4a126
19 changed files with 33 additions and 28 deletions

View File

@@ -79,7 +79,7 @@ const t = useI18n();
const toast = useToast();
const props = defineProps<{
team: TeamInfoQuery['admin']['teamInfo'];
team: TeamInfoQuery['infra']['teamInfo'];
teamName: string;
showRenameInput: boolean;
}>();

View File

@@ -213,11 +213,11 @@ const t = useI18n();
// Get Users List
const { data } = useQuery({ query: MetricsDocument });
const usersPerPage = computed(() => data.value?.admin.usersCount || 10000);
const usersPerPage = computed(() => data.value?.infra.usersCount || 10000);
const { list: usersList } = usePagedQuery(
UsersListDocument,
(x) => x.admin.allUsers,
(x) => x.infra.allUsers,
(x) => x.uid,
usersPerPage.value,
{ cursor: undefined, take: usersPerPage.value }

View File

@@ -187,7 +187,7 @@ const emit = defineEmits<{
const showInvite = ref(false);
// Get Team Details
const team = ref<TeamInfoQuery['admin']['teamInfo'] | undefined>();
const team = ref<TeamInfoQuery['infra']['teamInfo'] | undefined>();
const fetching = ref(true);
const route = useRoute();
const { client } = useClientHandle();
@@ -201,8 +201,8 @@ const getTeamInfo = async () => {
if (result.error) {
return toast.error(`${t('teams.load_info_error')}`);
}
if (result.data?.admin.teamInfo) {
team.value = result.data.admin.teamInfo;
if (result.data?.infra.teamInfo) {
team.value = result.data.infra.teamInfo;
}
fetching.value = false;
};

View File

@@ -72,9 +72,9 @@ const fetching = ref(true);
const error = ref(false);
const { client } = useClientHandle();
const route = useRoute();
const team = ref<TeamInfoQuery['admin']['teamInfo'] | undefined>();
const team = ref<TeamInfoQuery['infra']['teamInfo'] | undefined>();
const pendingInvites = ref<
TeamInfoQuery['admin']['teamInfo']['teamInvitations'] | undefined
TeamInfoQuery['infra']['teamInfo']['teamInvitations'] | undefined
>();
const getTeamInfo = async () => {
@@ -88,8 +88,8 @@ const getTeamInfo = async () => {
return toast.error(`${t('teams.load_info_error')}`);
}
if (result.data?.admin.teamInfo) {
team.value = result.data.admin.teamInfo;
if (result.data?.infra.teamInfo) {
team.value = result.data.infra.teamInfo;
pendingInvites.value = team.value.teamInvitations;
}
fetching.value = false;

View File

@@ -92,7 +92,7 @@ import { TeamListQuery } from '~/helpers/backend/graphql';
const tippyActions = ref<TippyComponent | null>(null);
defineProps<{
teamList: TeamListQuery['admin']['allTeams'];
teamList: TeamListQuery['infra']['allTeams'];
}>();
defineEmits<{

View File

@@ -143,7 +143,7 @@ import { useI18n } from '~/composables/i18n';
const t = useI18n();
defineProps<{
usersList: UsersListQuery['admin']['allUsers'];
usersList: UsersListQuery['infra']['allUsers'];
}>();
defineEmits<{