Skip to content

Commit

Permalink
Alerting: Prevent showing View YAML button on new rules (grafana#72278)
Browse files Browse the repository at this point in the history
  • Loading branch information
VikaCep authored Jul 25, 2023
1 parent d6e43a4 commit fe77d03
Showing 1 changed file with 11 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -227,15 +227,17 @@ export const AlertRuleForm = ({ existing, prefill }: Props) => {
</Button>
) : null}

<Button
variant="secondary"
type="button"
onClick={() => setShowEditYaml(true)}
disabled={submitState.loading}
size="sm"
>
{isCortexLokiOrRecordingRule(watch) ? 'Edit YAML' : 'View YAML'}
</Button>
{existing ? (
<Button
variant="secondary"
type="button"
onClick={() => setShowEditYaml(true)}
disabled={submitState.loading}
size="sm"
>
{isCortexLokiOrRecordingRule(watch) ? 'Edit YAML' : 'View YAML'}
</Button>
) : null}
</HorizontalGroup>
);

Expand Down

0 comments on commit fe77d03

Please sign in to comment.