-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(customer_team_list): Add team list on the teams view for the cus…
…tomer (#1515)
- Loading branch information
Showing
7 changed files
with
289 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
<script setup lang="ts"> | ||
import buttonIcon from "@/ui/components/buttons/ButtonIcon.vue"; | ||
import eyeIcon from "@/assets/icons_svg/Eye.svg"; | ||
import InitialAvatar from "@/ui/components/InitialAvatar.vue"; | ||
import { PropType, onBeforeMount, ref } from "vue"; | ||
import { TeamType } from "@/models/team.type"; | ||
import { TeamLogoType } from "@/models/TeamLogo.type"; | ||
import { teamLogoService } from "@/services/teamLogo.service"; | ||
import { setTeamLogoUrl } from "@/utils/images.utils"; | ||
import { useModalStore } from "@/stores/modalStore"; | ||
import ModalComingSoon from "./modals/ModalComingSoon.vue"; | ||
import { MODALMODE } from "@/constants/modalMode.enum"; | ||
const modalStore = useModalStore(); | ||
const teamLogo = ref<TeamLogoType>({ | ||
teamId: 0, | ||
teamLogoBlob: null, | ||
}); | ||
//define the props | ||
const props = defineProps({ | ||
team: { | ||
type: Object as PropType<TeamType>, | ||
required: true, | ||
}, | ||
}); | ||
//before mount, set logo of the team | ||
onBeforeMount(async () => { | ||
teamLogo.value = await getTeamLogo(props.team.id); | ||
}); | ||
//define the computed | ||
const getTeamLogo = async (teamId: number) => { | ||
const teamLogo: TeamLogoType = await teamLogoService.getTeamLogo(teamId); | ||
return teamLogo; | ||
}; | ||
//define the methods | ||
const onSeeDetailPress = () => { | ||
modalStore.switchModalVisibility(true, MODALMODE.comingSoon); | ||
}; | ||
</script> | ||
|
||
<template> | ||
<article class="user-card__container user-card__accepted_status"> | ||
<figure class="user-card__avatar rounded"> | ||
<div> | ||
<img | ||
class="user-card__avatar-img" | ||
:src="setTeamLogoUrl(teamLogo!.teamLogoBlob)" | ||
alt="user-card" | ||
/> | ||
</div> | ||
</figure> | ||
|
||
<div class="user-card__wrapper-user-infos"> | ||
<p class="user-card__name-text">{{ team.teamName }}</p> | ||
<p class="user-card__info-text"> | ||
{{ $t("teamStatus.lastActivity") }}{{ $t("general.comingSoon") }} | ||
</p> | ||
</div> | ||
<section class="user-card__wrapper-status"> | ||
<div class="user-card__wrapper-status_buttons"> | ||
<button-icon | ||
@click.prevent="onSeeDetailPress" | ||
:icon="eyeIcon" | ||
:alt="$t('buttons.seeDetail')" | ||
/> | ||
</div> | ||
</section> | ||
</article> | ||
</template> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
<script setup lang="ts"> | ||
import TeamInfoCard from "@/ui/components/TeamInfoCard.vue"; | ||
import { TeamType } from "@/models/team.type"; | ||
import { PropType } from "vue"; | ||
import { useTeamStore } from "@/stores/teamStore"; | ||
//Get the stores | ||
const teamStore = useTeamStore(); | ||
const props = defineProps({ | ||
teamList: { | ||
type: Object as PropType<TeamType[]>, | ||
required: true, | ||
}, | ||
}); | ||
</script> | ||
|
||
<template> | ||
<section class="user-list__container"> | ||
<section class="user-list__in-team-container"> | ||
<team-info-card | ||
v-for="team in teamList" | ||
:team="team" | ||
:key="team.id" | ||
/> | ||
</section> | ||
</section> | ||
</template> | ||
|
||
<style scoped lang="scss"> | ||
$border-radius: 24px; | ||
.user-list__container { | ||
padding-block-end: 10rem; | ||
> p:nth-of-type(1) { | ||
padding-block-end: 32px; | ||
} | ||
> p:nth-of-type(2) { | ||
padding-block-end: 16px; | ||
} | ||
.user-list__in-team-container { | ||
border-radius: $border-radius; | ||
article:nth-of-type(1) { | ||
border-top-left-radius: $border-radius; | ||
border-top-right-radius: $border-radius; | ||
} | ||
article:last-of-type { | ||
border-bottom-left-radius: $border-radius; | ||
border-bottom-right-radius: $border-radius; | ||
} | ||
} | ||
} | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters