Skip to content

Hide retry button as viewer #2489

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions frontend/src/components/GRetryOperation.vue
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,10 @@ import {
computed,
inject,
} from 'vue'
import { storeToRefs } from 'pinia'

import { useAppStore } from '@/store/app'
import { useAuthzStore } from '@/store/authz.js'

import { useShootItem } from '@/composables/useShootItem'

Expand All @@ -52,7 +54,14 @@ const appStore = useAppStore()

const retryingOperation = ref(false)

const authzStore = useAuthzStore()
const {
canPatchShoots,
} = storeToRefs(authzStore)

const canRetry = computed(() => {
if (!canPatchShoots.value) return // No permission to patch shoots
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the comment is unnecessary, also we always add brackets (should have a linter for it). I also returned false to make it more explicit

Suggested change
if (!canPatchShoots.value) return // No permission to patch shoots
if (!canPatchShoots.value) {
return false
}


const reconcileScheduled = shootGeneration.value !== shootObservedGeneration.value && !!shootObservedGeneration.value

return get(shootLastOperation.value, ['state']) === 'Failed' &&
Expand Down