File tree Expand file tree Collapse file tree 2 files changed +10
-2
lines changed Expand file tree Collapse file tree 2 files changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -38,6 +38,7 @@ const QueueLayout = (props: QueueLayoutProps) => {
38
38
39
39
const [ isQueueOpen , setIsQueueOpen ] = useState < boolean > ( ) ;
40
40
const [ isPendingStageEnabled , setIsPendingStageEnabled ] = useState < boolean > ( ) ;
41
+ const [ arePublicTicketsEnabled , setArePublicTicketsEnabled ] = useState < boolean > ( ) ;
41
42
const changeUserRoleMutation = trpc . user . updateUserRole . useMutation ( ) ;
42
43
const { siteSettings } = useSiteSettings ( ) ;
43
44
@@ -71,6 +72,10 @@ const QueueLayout = (props: QueueLayoutProps) => {
71
72
siteSettings . get ( SiteSettings . IS_PENDING_STAGE_ENABLED ) ===
72
73
SiteSettingsValues . TRUE ,
73
74
) ;
75
+ setArePublicTicketsEnabled (
76
+ siteSettings . get ( SiteSettings . ARE_PUBLIC_TICKETS_ENABLED ) ===
77
+ SiteSettingsValues . TRUE ,
78
+ ) ;
74
79
}
75
80
} , [ siteSettings ] ) ;
76
81
@@ -90,7 +95,7 @@ const QueueLayout = (props: QueueLayoutProps) => {
90
95
}
91
96
} ) ;
92
97
93
- if ( isQueueOpen === undefined || isPendingStageEnabled === undefined ) {
98
+ if ( isQueueOpen === undefined || isPendingStageEnabled === undefined || arePublicTicketsEnabled === undefined ) {
94
99
return < Spinner /> ;
95
100
}
96
101
@@ -135,6 +140,7 @@ const QueueLayout = (props: QueueLayoutProps) => {
135
140
userId = { userId }
136
141
userRole = { userRole }
137
142
isPendingStageEnabled = { isPendingStageEnabled }
143
+ arePublicTicketsEnabled = { arePublicTicketsEnabled }
138
144
isQueueOpen = { isQueueOpen }
139
145
personalQueue = { personalQueue }
140
146
/>
Original file line number Diff line number Diff line change @@ -25,6 +25,7 @@ interface TicketQueueProps {
25
25
userRole : UserRole ;
26
26
userId : string ;
27
27
isPendingStageEnabled : boolean ;
28
+ arePublicTicketsEnabled : boolean ;
28
29
isQueueOpen : boolean ;
29
30
personalQueue ?: PersonalQueue ;
30
31
}
@@ -39,6 +40,7 @@ const TicketQueue = (props: TicketQueueProps) => {
39
40
const {
40
41
userRole,
41
42
isPendingStageEnabled,
43
+ arePublicTicketsEnabled,
42
44
isQueueOpen,
43
45
userId,
44
46
personalQueue,
@@ -164,7 +166,7 @@ const TicketQueue = (props: TicketQueueProps) => {
164
166
165
167
const setTabs = ( ) : TabType [ ] => {
166
168
const tabs : TabType [ ] = [ TicketStatus . OPEN , TicketStatus . ASSIGNED ] ;
167
- if ( userRole === UserRole . STUDENT ) {
169
+ if ( userRole === UserRole . STUDENT && arePublicTicketsEnabled ) {
168
170
tabs . unshift ( "Public" ) ;
169
171
} else {
170
172
if ( isPendingStageEnabled ) {
You can’t perform that action at this time.
0 commit comments