File tree Expand file tree Collapse file tree 2 files changed +16
-2
lines changed
routes/(authenticated)/wheresMyProject Expand file tree Collapse file tree 2 files changed +16
-2
lines changed Original file line number Diff line number Diff line change @@ -680,6 +680,7 @@ it's done, you should see your project in FieldWorks Lite and be able to use it.
680680 "user_not_in_beta" : "FieldWorks Lite is currently in a beta testing phase. \n\
681681Only selected early access users can download Lexbox projects in FieldWorks Lite. \n\
682682Click the button below to request to join the early access program. It may take a few days for us to respond.",
683+ "only_managers_can_request_beta" : " Only project managers can request early access to FieldWorks Lite." ,
683684 "request_beta_access" : " Request early access to FieldWorks Lite" ,
684685 "access_request_sent" : " Your request to join the early access program has been submitted" ,
685686 "already_in_beta" : " You're already in the early access program" ,
Original file line number Diff line number Diff line change 11<script lang =" ts" >
2+ import type { PageData } from ' ./$types' ;
23 import { TitlePage } from ' $lib/layout' ;
34 import t from ' $lib/i18n' ;
45 import Markdown from ' svelte-exmarkdown' ;
78 import { page } from ' $app/state' ;
89 import { _sendFWLiteBetaRequestEmail } from ' ./+page' ;
910 import type { UUID } from ' crypto' ;
10- import { SendFwLiteBetaRequestEmailResult } from ' $lib/gql/generated/graphql' ;
11+ import { ProjectRole , SendFwLiteBetaRequestEmailResult } from ' $lib/gql/generated/graphql' ;
1112 import { useNotifications } from ' $lib/notify' ;
1213
14+ interface Props {
15+ data: PageData ;
16+ }
17+
18+ const { data }: Props = $props ();
19+
20+ const user = $derived (data .user );
21+ const managesProjects = $derived (user .isAdmin || user .projects .some (proj => proj .role === ProjectRole .Manager ));
22+
1323 const { notifySuccess } = useNotifications ();
1424
1525 let requesting = $state (false );
4555 {#snippet missingFlagContent ()}
4656 <Markdown md ={$t (' where_is_my_project.user_not_in_beta' )} />
4757 <div class =" text-center" >
48- <Button loading ={requesting } variant ="btn-primary" onclick ={requestBetaAccess }>{$t (' where_is_my_project.request_beta_access' )}</Button >
58+ <Button disabled ={! managesProjects } loading ={requesting } variant ="btn-primary" onclick ={requestBetaAccess }>{$t (' where_is_my_project.request_beta_access' )}</Button >
59+ {#if ! managesProjects }
60+ <p class ="mt-2 text-sm text-error" >{$t (' where_is_my_project.only_managers_can_request_beta' )}</p >
61+ {/if }
4962 </div >
5063 {/ snippet }
5164 </FeatureFlagAlternateContent >
You can’t perform that action at this time.
0 commit comments