feat: introduced table component in storybook

This commit is contained in:
Joel Jacob Stephen
2023-07-09 12:46:13 +05:30
parent 0962718b0c
commit b0e29b2e6c
4 changed files with 68 additions and 25 deletions

View File

@@ -193,7 +193,8 @@ const createTeam = async (newTeamName: string, ownerEmail: string) => {
// Go To Individual Team Details Page
const router = useRouter();
const goToTeamDetails = (team: any) => router.push('/teams/' + team.id);
const goToTeamDetails = (team: { id: string }) =>
router.push('/teams/' + team.id);
// Reload Teams Page when routed back to the teams page
const route = useRoute();
@@ -207,7 +208,7 @@ const teamDeletion = useMutation(RemoveTeamDocument);
const confirmDeletion = ref(false);
const deleteTeamID = ref<string | null>(null);
const deleteTeam = (team: any) => {
const deleteTeam = (team: { id: string }) => {
confirmDeletion.value = true;
deleteTeamID.value = team.id;
};

View File

@@ -38,7 +38,7 @@
:headings="headings"
@goToDetails="goToUserDetails"
:badge-name="t('users.admin')"
:badge-row-index="adminUsersIndexes"
:badge-row-indices="adminUsersIndices"
badge-col-name="name"
:subtitles="subtitles"
>
@@ -195,13 +195,12 @@ const isUserAdmin = (
};
// Returns index of all the admin users
const adminUsersIndexes = computed(() =>
usersList.value.map((user, index) => {
if (user.isAdmin) {
return index;
}
})
);
const adminUsersIndices = computed(() => {
const indices = [];
for (let index = 0; index < usersList.value.length; index++)
if (usersList.value[index].isAdmin) indices.push(index);
return indices;
});
// Returns created time of all the users
const createdTime = computed(() =>
@@ -248,7 +247,8 @@ const sendInvite = async (email: string) => {
// Go to Individual User Details Page
const route = useRoute();
const router = useRouter();
const goToUserDetails = (user: any) => router.push('/users/' + user.uid);
const goToUserDetails = (user: { uid: string }) =>
router.push('/users/' + user.uid);
watch(
() => route.params.id,
@@ -284,7 +284,7 @@ const userToAdmin = useMutation(MakeUserAdminDocument);
const confirmUserToAdmin = ref(false);
const userToAdminUID = ref<string | null>(null);
const makeUserAdmin = (user: any) => {
const makeUserAdmin = (user: { uid: string }) => {
confirmUserToAdmin.value = true;
userToAdminUID.value = user.uid;
};
@@ -318,12 +318,12 @@ const adminToUser = useMutation(RemoveUserAsAdminDocument);
const confirmAdminToUser = ref(false);
const adminToUserUID = ref<string | null>(null);
const makeAdminToUser = (user: any) => {
const makeAdminToUser = (user: { uid: string }) => {
confirmAdminToUser.value = true;
adminToUserUID.value = user.uid;
};
const deleteUser = (user: any) => {
const deleteUser = (user: { uid: string }) => {
confirmDeletion.value = true;
deleteUserUID.value = user.uid;
};