Mobile push dynamic setting (#1967)
This commit is contained in:
parent
11abfc3e64
commit
ac2f6edd9b
3 changed files with 29 additions and 22 deletions
|
|
@ -64,4 +64,12 @@ class FeaturesAPIView(APIView):
|
|||
if is_webhooks_enabled_for_organization(request.auth.organization.pk):
|
||||
enabled_features.append(FEATURE_WEBHOOKS2)
|
||||
|
||||
enabled_mobile_test_push = DynamicSetting.objects.get_or_create(
|
||||
name="enabled_mobile_test_push",
|
||||
defaults={"boolean_value": False},
|
||||
)[0]
|
||||
|
||||
if enabled_mobile_test_push.boolean_value:
|
||||
enabled_features.append(FEATURE_MOBILE_TEST_PUSH)
|
||||
|
||||
return enabled_features
|
||||
|
|
|
|||
|
|
@ -200,28 +200,26 @@ const MobileAppConnection = observer(({ userPk }: Props) => {
|
|||
{content}
|
||||
</Block>
|
||||
</div>
|
||||
{false && // temporary disable test notifications
|
||||
mobileAppIsCurrentlyConnected &&
|
||||
isCurrentUser && (
|
||||
<div className={cx('notification-buttons')}>
|
||||
<HorizontalGroup spacing={'md'} justify={'flex-end'}>
|
||||
<Button
|
||||
variant="secondary"
|
||||
onClick={() => onSendTestNotification()}
|
||||
disabled={isAttemptingTestNotification}
|
||||
>
|
||||
Send Test Push notification
|
||||
</Button>
|
||||
<Button
|
||||
variant="destructive"
|
||||
onClick={() => onSendTestNotification(true)}
|
||||
disabled={isAttemptingTestNotification}
|
||||
>
|
||||
Send Critical Test Push notification
|
||||
</Button>
|
||||
</HorizontalGroup>
|
||||
</div>
|
||||
)}
|
||||
{store.hasFeature(AppFeature.MobileTestPush) && mobileAppIsCurrentlyConnected && isCurrentUser && (
|
||||
<div className={cx('notification-buttons')}>
|
||||
<HorizontalGroup spacing={'md'} justify={'flex-end'}>
|
||||
<Button
|
||||
variant="secondary"
|
||||
onClick={() => onSendTestNotification()}
|
||||
disabled={isAttemptingTestNotification}
|
||||
>
|
||||
Send Test Push notification
|
||||
</Button>
|
||||
<Button
|
||||
variant="destructive"
|
||||
onClick={() => onSendTestNotification(true)}
|
||||
disabled={isAttemptingTestNotification}
|
||||
>
|
||||
Send Critical Test Push notification
|
||||
</Button>
|
||||
</HorizontalGroup>
|
||||
</div>
|
||||
)}
|
||||
</VerticalGroup>
|
||||
</WithPermissionControlDisplay>
|
||||
);
|
||||
|
|
|
|||
|
|
@ -6,4 +6,5 @@ export enum AppFeature {
|
|||
CloudConnection = 'grafana_cloud_connection',
|
||||
WebSchedules = 'web_schedules',
|
||||
Webhooks2 = 'webhooks2',
|
||||
MobileTestPush = 'mobile_test_push',
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue