1
0
mirror of https://github.com/quay/quay.git synced 2026-01-27 18:42:52 +03:00
Files
quay/web/src/hooks/UseNotificationMethods.ts
jbpratt 92975bb0f3 fix(web): enable Red Hat Quay Notification in new UI (PROJQUAY-9020) (#4376)
* fix(web): enable Red Hat Quay Notification in new UI (PROJQUAY-9020)

Red Hat Quay Notification was disabled in the new UI despite being fully
implemented. The notification drawer in the header is already functional,
so this feature can be enabled.

Changes:
- Enable Quay notification method in UseNotificationMethods.ts
- Uncomment and update Cypress test for creating Quay notifications

Co-authored-by: Claude <noreply@anthropic.com>
Signed-off-by: Brady Pratt <bpratt@redhat.com>

* fix(ui): invalidate notif query for tests

set a delay on invalidating it so the test notification can be processed

Signed-off-by: Brady Pratt <bpratt@redhat.com>

---------

Signed-off-by: Brady Pratt <bpratt@redhat.com>
Co-authored-by: Claude <noreply@anthropic.com>
2025-10-22 12:40:02 -05:00

48 lines
1.2 KiB
TypeScript

import {NotificationMethodType} from 'src/resources/NotificationResource';
import {useQuayConfig} from './UseQuayConfig';
export interface NotificationMethod {
type: NotificationMethodType;
title: string;
enabled: boolean;
}
export function useNotificationMethods() {
const config = useQuayConfig();
const notificationMethods: NotificationMethod[] = [
{
type: NotificationMethodType.email,
title: 'Email Notification',
enabled: config?.features.MAILING,
},
{
type: NotificationMethodType.flowdock,
title: 'Flowdock Team Notification',
enabled: true,
},
{
type: NotificationMethodType.hipchat,
title: 'HipChat Room Notification',
enabled: true,
},
{
type: NotificationMethodType.quaynotification,
title: `${config?.config.REGISTRY_TITLE_SHORT} Notification`,
enabled: true,
},
{
type: NotificationMethodType.slack,
title: 'Slack Notification',
enabled: true,
},
{
type: NotificationMethodType.webhook,
title: 'Webhook POST',
enabled: true,
},
];
return {
notificationMethods: notificationMethods,
};
}