File tree Expand file tree Collapse file tree 3 files changed +30
-10
lines changed
views/Dashboard/Companies Expand file tree Collapse file tree 3 files changed +30
-10
lines changed Original file line number Diff line number Diff line change 6161 <p class =" text-sm" >{{ company?.billingInfo?.tin }}</p >
6262 </div >
6363 </div >
64+
65+ <ContractDownload
66+ v-if =" canSeeContract"
67+ :company-id =" company?.id as string"
68+ />
6469 </div >
6570
6671 <!-- No Billing Info State -->
7580
7681<script setup lang="ts">
7782import { ref , computed } from " vue" ;
83+ import { useAuthStore } from " @/stores/auth" ;
7884import { useCompanyBillingMutation } from " @/mutations/companies" ;
7985import type { Company , CompanyBillingInfo } from " @/dto/companies" ;
8086import Card from " ../ui/card/Card.vue" ;
@@ -85,6 +91,7 @@ import CardTitle from "../ui/card/CardTitle.vue";
8591import Button from " ../ui/button/Button.vue" ;
8692import BillingForm from " ./BillingForm.vue" ;
8793import EmptyStateCard from " ../ui/EmptyStateCard.vue" ;
94+ import ContractDownload from " ./ContractDownload.vue" ;
8895
8996interface Props {
9097 company? : Company ;
@@ -115,6 +122,14 @@ const hasBillingInfo = computed(() => {
115122const billingMutation = useCompanyBillingMutation ();
116123const { mutate : updateBilling, isLoading : isUpdating } = billingMutation ;
117124
125+ const authStore = useAuthStore ();
126+ const canSeeContract = computed (
127+ () =>
128+ authStore .isAuthenticated &&
129+ authStore .decoded &&
130+ (authStore .decoded as { role? : string }).role === " COORDINATOR" ,
131+ );
132+
118133const startEditing = () => {
119134 isEditing .value = true ;
120135};
Original file line number Diff line number Diff line change 11<template >
2- <div class =" flex gap-2" >
3- <Button :disabled =" isLoading" @click =" download('pt')"
4- >Generate Contract (PT)</Button
2+ <div class =" flex flex-col gap-2" >
3+ <Button
4+ size =" sm"
5+ class =" w-full"
6+ :disabled =" isLoading"
7+ @click =" download('pt')"
58 >
6- <Button :disabled =" isLoading" @click =" download('en')"
7- >Generate Contract (EN)</Button
9+ Generate Contract (PT)
10+ </Button >
11+ <Button
12+ size =" sm"
13+ class =" w-full"
14+ :disabled =" isLoading"
15+ @click =" download('en')"
816 >
17+ Generate Contract (EN)
18+ </Button >
919 </div >
1020</template >
1121
Original file line number Diff line number Diff line change 2121 @updated =" handleCompanyUpdated"
2222 />
2323
24- <div class =" mt-4" >
25- <ContractDownload :company-id =" companyId as string" />
26- </div >
27-
2824 <!-- Company Contacts -->
2925 <!-- prettier-ignore -->
3026 <CompanyContacts
@@ -64,7 +60,6 @@ import CompanyContacts from "@/components/companies/CompanyContacts.vue";
6460import CompanyCommunications from " @/components/companies/CompanyCommunications.vue" ;
6561import ParticipationsCard from " @/components/ParticipationsCard.vue" ;
6662import DirectEmailDialogTrigger from " @/components/DirectEmailDialogTrigger.vue" ;
67- import ContractDownload from " @/components/companies/ContractDownload.vue" ;
6863import type { CompanyWithParticipation } from " @/dto/companies" ;
6964import { withCurrentParticipation } from " @/lib/utils" ;
7065import { useEventStore } from " @/stores/event" ;
You can’t perform that action at this time.
0 commit comments