Skip to content
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

Added Rotate Credentials Help Dialog #2100

Merged
merged 7 commits into from
Sep 26, 2024
Merged
Show file tree
Hide file tree
Changes from 4 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
36 changes: 36 additions & 0 deletions frontend/src/components/GCredentialRotationHelp.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
<!--
SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and Gardener contributors

SPDX-License-Identifier: Apache-2.0
-->

<template>
<g-generic-action-button-dialog
icon="mdi-help-circle-outline"
color="toolbar-title"
class="mr-4"
caption="Credential Rotation Help"
can-perform-action
cancel-button-text=""
confirm-button-text="Close"
>
<template #tooltip>
<span>Help</span>
</template>
<template #content>
<v-card-text>
There are a lot of different credentials for Shoots to make sure that the various components can communicate with each other and to make sure it is usable and operable.<br>
<g-external-link url="https://github.com/gardener/gardener/blob/master/docs/usage/shoot_credentials_rotation.md">
This page
</g-external-link>
explains how the varieties of credentials can be rotated so that the cluster can be considered secure.
Copy link
Member

Choose a reason for hiding this comment

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

I understand that you have copied the text from the docs, however I guess they need to be improved a bit

Suggested change
There are a lot of different credentials for Shoots to make sure that the various components can communicate with each other and to make sure it is usable and operable.<br>
<g-external-link url="https://github.com/gardener/gardener/blob/master/docs/usage/shoot_credentials_rotation.md">
This page
</g-external-link>
explains how the varieties of credentials can be rotated so that the cluster can be considered secure.
There are many different credentials for Shoots to ensure that various components can communicate with each other and to make sure they are usable and operable.<br>
<g-external-link url="https://github.com/gardener/gardener/blob/master/docs/usage/shoot_credentials_rotation.md">
This page
</g-external-link>
explains how these credentials can be rotated to ensure the cluster's security.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is c&p from the Gardener docu.. maybe we should change this also in the upstream repo? 🤔

</v-card-text>
</template>
</g-generic-action-button-dialog>
</template>

<script setup>

import GGenericActionButtonDialog from '@/components/dialogs/GGenericActionButtonDialog.vue'

</script>
89 changes: 33 additions & 56 deletions frontend/src/components/GResourceQuotaHelp.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,69 +5,46 @@ SPDX-License-Identifier: Apache-2.0
-->

<template>
<div
v-if="resourceQuotaHelpText"
class="mr-2"
<g-generic-action-button-dialog
icon="mdi-help-circle-outline"
color="toolbar-title"
class="mr-4"
caption="Quota Help"
:can-perform-action="!!resourceQuotaHelpText"
cancel-button-text=""
confirm-button-text="Close"
>
<g-action-button
icon="mdi-help-circle-outline"
color="toolbar-title"
@click="showDialog"
>
<template #tooltip>
<span>Help</span>
</template>
</g-action-button>
<g-dialog
ref="gDialog"
confirm-button-text="Ok"
cancel-button-text=""
width="600"
>
<template #caption>
Quota Help
</template>
<template #content>
<v-card-text>
<!-- eslint-disable vue/no-v-html -->
<div
class="wrap-text"
v-html="resourceQuotaHelpHtml"
/>
<!-- eslint-enable vue/no-v-html -->
</v-card-text>
</template>
</g-dialog>
</div>
<template #tooltip>
<span>Help</span>
</template>
<template #content>
<v-card-text>
<!-- eslint-disable vue/no-v-html -->
<div
class="wrap-text"
v-html="resourceQuotaHelpHtml"
/>
<!-- eslint-enable vue/no-v-html -->
</v-card-text>
</template>
</g-generic-action-button-dialog>
</template>

<script>
import { mapState } from 'pinia'
<script setup>
import { storeToRefs } from 'pinia'
import { computed } from 'vue'

import { useConfigStore } from '@/store/config'

import GDialog from '@/components/dialogs/GDialog.vue'
import GActionButton from '@/components/GActionButton.vue'
import GGenericActionButtonDialog from '@/components/dialogs/GGenericActionButtonDialog.vue'

import { transformHtml } from '@/utils'

export default {
components: {
GDialog,
GActionButton,
},
computed: {
...mapState(useConfigStore, [
'resourceQuotaHelpText',
]),
resourceQuotaHelpHtml () {
return transformHtml(this.resourceQuotaHelpText, true)
},
},
methods: {
showDialog () {
this.$refs.gDialog.showDialog()
},
},
}
const configStore = useConfigStore()
const { resourceQuotaHelpText } = storeToRefs(configStore)

const resourceQuotaHelpHtml = computed(() => {
return transformHtml(resourceQuotaHelpText.value, true)
})

</script>
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ SPDX-License-Identifier: Apache-2.0
disable-confirm-input-focus
:can-perform-action="canPatchProject"
:disabled="!canPatchProject"
:is-toolbar-close-button-visible="true"
is-toolbar-close-button-visible
cancel-button-text=""
confirm-button-text="Close"
width="90vw"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,11 @@ SPDX-License-Identifier: Apache-2.0

<template>
<v-card class="mb-4">
<g-toolbar title="Credential Rotation" />
<g-toolbar title="Credential Rotation">
<template #append>
<g-credential-rotation-help />
</template>
</g-toolbar>
<g-list>
<g-credential-tile
type="ALL_CREDENTIALS"
Expand Down Expand Up @@ -45,6 +49,7 @@ SPDX-License-Identifier: Apache-2.0

<script setup>
import GCredentialTile from '@/components/GCredentialTile'
import GCredentialRotationHelp from '@/components/GCredentialRotationHelp'

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

Expand Down