mirror of
https://github.com/hanzoai/sentinel.git
synced 2026-09-29 22:34:33 +00:00
47 lines
1.4 KiB
TypeScript
47 lines
1.4 KiB
TypeScript
import type {Field} from 'sentry/components/forms/types';
|
|
import {t, tn} from 'sentry/locale';
|
|
|
|
// Export route to make these forms searchable by label/help
|
|
export const route = '/settings/:orgId/projects/:projectId/alerts/';
|
|
|
|
const formatMinutes = (value: number | '') => {
|
|
value = Number(value) / 60;
|
|
return tn('%s minute', '%s minutes', value);
|
|
};
|
|
|
|
export const fields: {[key: string]: Field} = {
|
|
subjectTemplate: {
|
|
name: 'subjectTemplate',
|
|
type: 'string',
|
|
|
|
// additional data/props that is related to rendering of form field rather than data
|
|
label: t('Subject Template'),
|
|
placeholder: 'e.g. $shortID - $title',
|
|
help: t(
|
|
'The email subject to use (excluding the prefix) for individual alerts. Usable variables include: $title, $shortID, $projectID, $orgID, and ${tag:key}, such as ${tag:environment} or ${tag:release}.'
|
|
),
|
|
},
|
|
digestsMinDelay: {
|
|
name: 'digestsMinDelay',
|
|
type: 'range',
|
|
min: 60,
|
|
max: 3600,
|
|
step: 60,
|
|
defaultValue: 300,
|
|
label: t('Minimum delivery interval'),
|
|
help: t('Notifications will be delivered at most this often.'),
|
|
formatLabel: formatMinutes,
|
|
},
|
|
digestsMaxDelay: {
|
|
name: 'digestsMaxDelay',
|
|
type: 'range',
|
|
min: 60,
|
|
max: 3600,
|
|
step: 60,
|
|
defaultValue: 300,
|
|
label: t('Maximum delivery interval'),
|
|
help: t('Notifications will be delivered at least this often.'),
|
|
formatLabel: formatMinutes,
|
|
},
|
|
};
|