Просмотр исходного кода

feat(alerts): Custom free text search message (#62259)

- closes https://github.com/getsentry/sentry/issues/61991

---------

Co-authored-by: Riccardo Busetti <riccardo.busetti@sentry.io>
ArthurKnaus 1 год назад
Родитель
Сommit
c53fbc00c8
1 измененных файлов с 7 добавлено и 0 удалено
  1. 7 0
      static/app/views/alerts/rules/metric/ruleConditionsForm.tsx

+ 7 - 0
static/app/views/alerts/rules/metric/ruleConditionsForm.tsx

@@ -482,10 +482,17 @@ class RuleConditionsForm extends PureComponent<Props, State> {
                     <SearchContainer>
                       <StyledSearchBar
                         disallowWildcard={dataset === Dataset.SESSIONS}
+                        disallowFreeText={[
+                          Dataset.GENERIC_METRICS,
+                          Dataset.TRANSACTIONS,
+                        ].includes(dataset)}
                         invalidMessages={{
                           [InvalidReason.WILDCARD_NOT_ALLOWED]: t(
                             'The wildcard operator is not supported here.'
                           ),
+                          [InvalidReason.FREE_TEXT_NOT_ALLOWED]: t(
+                            'Free text search is not allowed. If you want to partially match transaction names, use glob patterns like "transaction:*transaction-name*"'
+                          ),
                         }}
                         customInvalidTagMessage={item => {
                           if (dataset !== Dataset.GENERIC_METRICS) {