|
4 | 4 | Group, |
5 | 5 | NumberInput, |
6 | 6 | Paper, |
| 7 | + Select, |
7 | 8 | Stack, |
8 | 9 | Text, |
9 | 10 | Textarea, |
@@ -38,7 +39,11 @@ export const SubscriptionSettingsWidget = (props: IProps) => { |
38 | 39 | const form = useForm<UpdateSubscriptionSettingsCommand.Request>({ |
39 | 40 | name: 'edit-subscription-settings-form', |
40 | 41 | mode: 'uncontrolled', |
41 | | - validate: zodResolver(UpdateSubscriptionSettingsCommand.RequestSchema) |
| 42 | + validate: zodResolver( |
| 43 | + UpdateSubscriptionSettingsCommand.RequestSchema.omit({ |
| 44 | + isProfileWebpageUrlEnabled: true |
| 45 | + }) |
| 46 | + ) |
42 | 47 | }) |
43 | 48 |
|
44 | 49 | const updateExpiredRemarks = useCallback((newRemarks: string[]) => { |
@@ -82,6 +87,12 @@ export const SubscriptionSettingsWidget = (props: IProps) => { |
82 | 87 | profileUpdateInterval: subscriptionSettings.profileUpdateInterval, |
83 | 88 | happAnnounce: subscriptionSettings.happAnnounce, |
84 | 89 | happRouting: subscriptionSettings.happRouting, |
| 90 | + |
| 91 | + // @ts-expect-error - TODO: fix this |
| 92 | + isProfileWebpageUrlEnabled: subscriptionSettings.isProfileWebpageUrlEnabled |
| 93 | + ? 'true' |
| 94 | + : 'false', |
| 95 | + |
85 | 96 | expiredUsersRemarks: subscriptionSettings.expiredUsersRemarks, |
86 | 97 | limitedUsersRemarks: subscriptionSettings.limitedUsersRemarks, |
87 | 98 | disabledUsersRemarks: subscriptionSettings.disabledUsersRemarks |
@@ -109,10 +120,15 @@ export const SubscriptionSettingsWidget = (props: IProps) => { |
109 | 120 | }) |
110 | 121 | return |
111 | 122 | } |
| 123 | + |
| 124 | + const isProfileWebpageUrlEnabled = |
| 125 | + (values.isProfileWebpageUrlEnabled as unknown as string) === 'true' |
| 126 | + |
112 | 127 | updateSubscriptionSettings({ |
113 | 128 | variables: { |
114 | 129 | ...values, |
115 | 130 | uuid: values.uuid, |
| 131 | + isProfileWebpageUrlEnabled, |
116 | 132 | expiredUsersRemarks: expiredFiltered, |
117 | 133 | limitedUsersRemarks: limitedFiltered, |
118 | 134 | disabledUsersRemarks: disabledFiltered |
@@ -168,6 +184,25 @@ export const SubscriptionSettingsWidget = (props: IProps) => { |
168 | 184 | {...form.getInputProps('supportLink')} |
169 | 185 | /> |
170 | 186 | </Grid.Col> |
| 187 | + |
| 188 | + <Grid.Col span={{ xs: 12, sm: 6 }}> |
| 189 | + <Select |
| 190 | + allowDeselect={false} |
| 191 | + comboboxProps={{ |
| 192 | + transitionProps: { transition: 'pop', duration: 200 } |
| 193 | + }} |
| 194 | + data={[ |
| 195 | + { label: 'Enabled', value: 'true' }, |
| 196 | + { label: 'Disabled', value: 'false' } |
| 197 | + ]} |
| 198 | + description={ |
| 199 | + 'Used by some clients. Enabled by default, domain resolved from SUB_PUBLIC_DOMAIN .env variable.' |
| 200 | + } |
| 201 | + key={form.key('isProfileWebpageUrlEnabled')} |
| 202 | + label={'Profile Webpage URL'} |
| 203 | + {...form.getInputProps('isProfileWebpageUrlEnabled')} |
| 204 | + /> |
| 205 | + </Grid.Col> |
171 | 206 | </Grid> |
172 | 207 | </Stack> |
173 | 208 | </Paper> |
|
0 commit comments