Skip to content

Commit

Permalink
[8.6] Don't show "You have not been authorized to create any Rule typ…
Browse files Browse the repository at this point in the history
…es" message while request to get rule types is in flight (elastic#145407) (elastic#145506)

# Backport

This will backport the following commits from `main` to `8.6`:
- [Don't show "You have not been authorized to create any Rule types"
message while request to get rule types is in flight
(elastic#145407)](elastic#145407)

<!--- Backport version: 8.9.7 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sqren/backport)

<!--BACKPORT [{"author":{"name":"Coen
Warmer","email":"coen.warmer@gmail.com"},"sourceCommit":{"committedDate":"2022-11-17T07:19:07Z","message":"Don't
show \"You have not been authorized to create any Rule types\" message
while request to get rule types is in flight
(elastic#145407)","sha":"e01649e7b23d9bb0b855b2ba2081ae72cc49f815","branchLabelMapping":{"^v8.7.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","Team:ResponseOps","Team:
Actionable
Observability","v8.6.0","v8.7.0"],"number":145407,"url":"https://github.com/elastic/kibana/pull/145407","mergeCommit":{"message":"Don't
show \"You have not been authorized to create any Rule types\" message
while request to get rule types is in flight
(elastic#145407)","sha":"e01649e7b23d9bb0b855b2ba2081ae72cc49f815"}},"sourceBranch":"main","suggestedTargetBranches":["8.6"],"targetPullRequestStates":[{"branch":"8.6","label":"v8.6.0","labelRegex":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"main","label":"v8.7.0","labelRegex":"^v8.7.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/145407","number":145407,"mergeCommit":{"message":"Don't
show \"You have not been authorized to create any Rule types\" message
while request to get rule types is in flight
(elastic#145407)","sha":"e01649e7b23d9bb0b855b2ba2081ae72cc49f815"}}]}]
BACKPORT-->

Co-authored-by: Coen Warmer <coen.warmer@gmail.com>
  • Loading branch information
kibanamachine and CoenWarmer committed Nov 17, 2022
1 parent fa95c97 commit 095f596
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,7 @@ export const RuleForm = ({
ruleTypes,
error: loadRuleTypesError,
ruleTypeIndex,
ruleTypesIsLoading,
} = useLoadRuleTypes({ filteredRuleTypes: ruleTypeToFilter });

// load rule types
Expand Down Expand Up @@ -848,7 +849,7 @@ export const RuleForm = ({
) : null}
{ruleTypeNodes}
</>
) : ruleTypeIndex ? (
) : ruleTypeIndex && !ruleTypesIsLoading ? (
<NoAuthorizedRuleTypes operation={operation} />
) : (
<SectionLoading>
Expand All @@ -871,7 +872,7 @@ const NoAuthorizedRuleTypes = ({ operation }: { operation: string }) => (
<h2>
<FormattedMessage
id="xpack.triggersActionsUI.sections.ruleForm.error.noAuthorizedRuleTypesTitle"
defaultMessage="You have not been authorized to {operation} any Rule types"
defaultMessage="You have not been authorized to {operation} any rule types"
values={{ operation }}
/>
</h2>
Expand Down

0 comments on commit 095f596

Please sign in to comment.