Skip to content

Commit

Permalink
feat(*): add description on entity list pages (#61)
Browse files Browse the repository at this point in the history
  • Loading branch information
Leopoldthecoder committed Jul 28, 2023
1 parent 4d8b4c7 commit 23c8c21
Show file tree
Hide file tree
Showing 23 changed files with 220 additions and 32 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Kong Manager OSS

[Installation](#getting-started) | [Provide feedback](https://github.com/Kong/kong-manager/issues/new) | [Ask a question](https://join.slack.com/t/kongcommunity/shared_invite/zt-1s4nb74vo-jLdMEk8MoTm~uMWYMMLPWg) | [Contributing](#contributing) | [Blog](https://konghq.com/blog)
[Installation](#getting-started) | [Provide feedback](https://github.com/Kong/kong-manager/issues/new/choose) | [Ask a question](https://join.slack.com/t/kongcommunity/shared_invite/zt-1s4nb74vo-jLdMEk8MoTm~uMWYMMLPWg) | [Contributing](#contributing) | [Blog](https://konghq.com/blog)

![Kong Manager OSS - Plugin list](./media/Plugin%20list.png)

Expand Down
Binary file modified media/Plugin configuration tooltip.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified media/Plugin list.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified media/Service edit.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
"@kong-ui/entities-shared": "^0.44.2",
"@kong-ui/entities-snis": "^0.14.2",
"@kong-ui/entities-upstreams-targets": "^0.16.2",
"@kong-ui/entities-vaults": "^0.16.2",
"@kong-ui/entities-vaults": "^0.17.0",
"@kong-ui/forms": "^0.21.1",
"@kong/kongponents": "^8.97.0",
"@material-design-icons/font": "^0.14.9",
Expand Down
2 changes: 1 addition & 1 deletion src/components/PageHeader.vue
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ const tag = computed(() => `h${props.size}`)
h1, h2, h3, h4, h5, h6, nav {
margin-top: 0px;
margin-bottom: 20px;
margin-bottom: 12px;
display: flex;
align-items: center;
}
Expand Down
12 changes: 12 additions & 0 deletions src/components/SupportText.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<template>
<div class="support-text">
<slot />
</div>
</template>

<style scoped lang="scss">
.support-text {
color: var(--black-45);
margin-bottom: 16px;
}
</style>
25 changes: 25 additions & 0 deletions src/composables/useDocsLink.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import { computed } from 'vue'
import { formatVersion } from '@/utils'
import { config } from 'config'

export const useDocsLink = (entity: string) => {
const version = computed(() => {
if (!config.GATEWAY_VERSION) {
return 'latest'
}

return `${formatVersion(config.GATEWAY_VERSION)}.x`
})

const docsBase = computed(() => `https://docs.konghq.com/gateway/${version.value}/admin-api`)
const docsLink = computed(() => {
switch (entity) {
case 'key-set':
return `${docsBase.value}/#key-sets-entity`
default:
return `${docsBase.value}/#${entity}-object`
}
})

return docsLink
}
14 changes: 13 additions & 1 deletion src/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
"edit": "Edit",
"save": "Save",
"create": "Create"
}
},
"learn.more": "Learn more"
},
"overview": {
"info": {
Expand Down Expand Up @@ -72,6 +73,7 @@
},
"entities": {
"service": {
"description": "Gateway Service entities are abstractions of each of your own upstream services, e.g., a data transformation microservice, a billing API.",
"created": "Gateway Service {name} is successfully created!",
"updated": "Gateway Service {name} is successfully updated!",
"deleted": "Gateway Service {name} is successfully deleted!",
Expand All @@ -81,6 +83,7 @@
"edit.form.title": "Edit Gateway Service"
},
"route": {
"description": "A Route defines rules to match client requests, and is associated with a Service.",
"created": "Route {name} is successfully created!",
"updated": "Route {name} is successfully updated!",
"deleted": "Route {name} is successfully deleted!",
Expand All @@ -90,6 +93,7 @@
"edit.form.title": "Edit Route"
},
"consumer": {
"description": "Consumers are the end users of a service.",
"created": "Consumer {name} is successfully created!",
"updated": "Consumer {name} is successfully updated!",
"deleted": "Consumer {name} is successfully deleted!",
Expand All @@ -111,6 +115,7 @@
"edit.form.title": "Edit: {type}"
},
"plugin": {
"description": "Plugins allow you to extend Kong's capabilities with features like rate limiting, authentication, and logging.",
"created": "Plugin {name} is successfully created!",
"updated": "Plugin {name} is successfully updated!",
"deleted": "Plugin {name} is successfully deleted!",
Expand All @@ -121,6 +126,7 @@
"edit.form.title": "Edit Plugin"
},
"upstream": {
"description": "An Upstream represents a virtual hostname and can be used to load balance incoming requests over multiple Services.",
"created": "Upstream {name} is successfully created!",
"updated": "Upstream {name} is successfully updated!",
"deleted": "Upstream {name} is successfully deleted!",
Expand All @@ -130,6 +136,7 @@
"edit.form.title": "Edit Upstream"
},
"certificate": {
"description": "Certificates handle SSL/TLS termination for encrypted requests.",
"created": "Certificate {id} is successfully created!",
"updated": "Certificate {id} is successfully updated!",
"deleted": "Certificate {id} is successfully deleted!",
Expand All @@ -139,6 +146,7 @@
"edit.form.title": "Edit Certificate"
},
"ca-certificate": {
"description": "CA certificates validate client or server certificates.",
"created": "CA Certificate {id} is successfully created!",
"updated": "CA Certificate {id} is successfully updated!",
"deleted": "CA Certificate {id} is successfully deleted!",
Expand All @@ -148,6 +156,7 @@
"edit.form.title": "Edit CA Certificate"
},
"sni": {
"description": "An SNI object represents a many-to-one mapping of hostnames to a certificate.",
"created": "SNI {name} is successfully created!",
"updated": "SNI {name} is successfully updated!",
"deleted": "SNI {name} is successfully deleted!",
Expand All @@ -168,6 +177,7 @@
"edit.form.title": "Edit Target"
},
"vault": {
"description": "Improve the security of your Kong Gateway deployment with centralized secrets.",
"created": "Vault {name} is successfully created!",
"updated": "Vault {name} is successfully updated!",
"deleted": "Vault {name} is successfully deleted!",
Expand All @@ -177,6 +187,7 @@
"edit.form.title": "Edit Vault"
},
"key": {
"description": "A Key object holds a representation of asymmetric keys in various formats.",
"created": "Key {name} is successfully created!",
"updated": "Key {name} is successfully updated!",
"deleted": "Key {name} is successfully deleted!",
Expand All @@ -186,6 +197,7 @@
"edit.form.title": "Edit Key"
},
"key-set": {
"description": "A Key Set object holds a collection of asymmetric key objects.",
"created": "Key Set {name} is successfully created!",
"updated": "Key Set {name} is successfully updated!",
"deleted": "Key Set {name} is successfully deleted!",
Expand Down
17 changes: 14 additions & 3 deletions src/pages/ca-certificates/List.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
<template>
<PageHeader :title="t('entities.ca-certificate.list.title')" />
<PageHeader :title="t('entities.ca-certificate.list.title')">
<template #below-title>
<SupportText>
{{ t('entities.ca-certificate.description') }}
<KExternalLink :href="docsLink">
{{ t('global.learn.more') }}
</KExternalLink>
</SupportText>
</template>
</PageHeader>
<CACertificateList
:config="caCertificateListConfig"
:can-create="canCreate"
Expand All @@ -13,13 +22,14 @@
</template>

<script setup lang="ts">
import { computed, reactive } from 'vue'
import { CACertificateList, type EntityRow } from '@kong-ui/entities-certificates'
import { useCopyEventHandlers } from '@/composables/useCopyEventHandlers'
import { useI18n } from '@/composables/useI18n'
import { useListGeneralConfig } from '@/composables/useListGeneralConfig'
import { useListRedirect } from '@/composables/useListRedirect'
import { useToaster } from '@/composables/useToaster'
import { CACertificateList, type EntityRow } from '@kong-ui/entities-certificates'
import { computed, reactive } from 'vue'
import { useDocsLink } from '@/composables/useDocsLink'
defineOptions({
name: 'CACertificateList',
Expand All @@ -28,6 +38,7 @@ defineOptions({
const { createRedirectRouteQuery } = useListRedirect()
const toaster = useToaster()
const { t } = useI18n()
const docsLink = useDocsLink('ca-certificate')
const createRoute = computed(() => {
return { name: 'ca-certificate-create' }
Expand Down
17 changes: 14 additions & 3 deletions src/pages/certificates/List.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
<template>
<PageHeader :title="t('entities.certificate.list.title')" />
<PageHeader :title="t('entities.certificate.list.title')">
<template #below-title>
<SupportText>
{{ t('entities.certificate.description') }}
<KExternalLink :href="docsLink">
{{ t('global.learn.more') }}
</KExternalLink>
</SupportText>
</template>
</PageHeader>
<CertificateList
:config="certificateListConfig"
:can-create="canCreate"
Expand All @@ -13,13 +22,14 @@
</template>

<script setup lang="ts">
import { computed, reactive } from 'vue'
import { CertificateList, type EntityRow } from '@kong-ui/entities-certificates'
import { useCopyEventHandlers } from '@/composables/useCopyEventHandlers'
import { useI18n } from '@/composables/useI18n'
import { useListGeneralConfig } from '@/composables/useListGeneralConfig'
import { useListRedirect } from '@/composables/useListRedirect'
import { useToaster } from '@/composables/useToaster'
import { CertificateList, type EntityRow } from '@kong-ui/entities-certificates'
import { computed, reactive } from 'vue'
import { useDocsLink } from '@/composables/useDocsLink'
defineOptions({
name: 'CertificateList',
Expand All @@ -28,6 +38,7 @@ defineOptions({
const { createRedirectRouteQuery } = useListRedirect()
const toaster = useToaster()
const { t } = useI18n()
const docsLink = useDocsLink('certificate')
const createRoute = computed(() => {
return { name: 'certificate-create' }
Expand Down
13 changes: 12 additions & 1 deletion src/pages/consumers/List.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
<template>
<PageHeader :title="t('entities.consumer.list.title')" />
<PageHeader :title="t('entities.consumer.list.title')">
<template #below-title>
<SupportText>
{{ t('entities.consumer.description') }}
<KExternalLink :href="docsLink">
{{ t('global.learn.more') }}
</KExternalLink>
</SupportText>
</template>
</PageHeader>
<ConsumerList
:config="consumerListConfig"
:can-create="canCreate"
Expand All @@ -21,6 +30,7 @@ import { useListRedirect } from '@/composables/useListRedirect'
import { useCopyEventHandlers } from '@/composables/useCopyEventHandlers'
import { useToaster } from '@/composables/useToaster'
import { useI18n } from '@/composables/useI18n'
import { useDocsLink } from '@/composables/useDocsLink'
defineOptions({
name: 'ConsumerList',
Expand All @@ -29,6 +39,7 @@ defineOptions({
const { createRedirectRouteQuery } = useListRedirect()
const toaster = useToaster()
const { t } = useI18n()
const docsLink = useDocsLink('consumer')
const createRoute = computed(() => {
return { name: 'consumer-create' }
Expand Down
13 changes: 12 additions & 1 deletion src/pages/key-sets/List.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
<template>
<PageHeader :title="t('entities.key-set.list.title')" />
<PageHeader :title="t('entities.key-set.list.title')">
<template #below-title>
<SupportText>
{{ t('entities.key-set.description') }}
<KExternalLink :href="docsLink">
{{ t('global.learn.more') }}
</KExternalLink>
</SupportText>
</template>
</PageHeader>
<KeySetList
:config="keyListConfig"
:can-create="canCreate"
Expand All @@ -21,6 +30,7 @@ import { useListRedirect } from '@/composables/useListRedirect'
import { useToaster } from '@/composables/useToaster'
import { useCopyEventHandlers } from '@/composables/useCopyEventHandlers'
import { useI18n } from '@/composables/useI18n'
import { useDocsLink } from '@/composables/useDocsLink'
defineOptions({
name: 'KeySetList',
Expand All @@ -29,6 +39,7 @@ defineOptions({
const { createRedirectRouteQuery } = useListRedirect()
const toaster = useToaster()
const { t } = useI18n()
const docsLink = useDocsLink('key-set')
const filterSchema = computed<FilterSchema>(() => {
return {
Expand Down
13 changes: 12 additions & 1 deletion src/pages/keys/List.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,16 @@
<PageHeader
v-if="!keySetId"
:title="t('entities.key.list.title')"
/>
>
<template #below-title>
<SupportText>
{{ t('entities.key.description') }}
<KExternalLink :href="docsLink">
{{ t('global.learn.more') }}
</KExternalLink>
</SupportText>
</template>
</PageHeader>
<KeyList
:cache-identifier="cacheIdentifier"
:config="keyListConfig"
Expand All @@ -26,6 +35,7 @@ import { useListRedirect } from '@/composables/useListRedirect'
import { useToaster } from '@/composables/useToaster'
import { useCopyEventHandlers } from '@/composables/useCopyEventHandlers'
import { useI18n } from '@/composables/useI18n'
import { useDocsLink } from '@/composables/useDocsLink'
defineOptions({
name: 'KeyList',
Expand All @@ -35,6 +45,7 @@ const { createRedirectRouteQuery } = useListRedirect()
const toaster = useToaster()
const route = useRoute()
const { t } = useI18n()
const docsLink = useDocsLink('keys')
const keySetId = computed(() => (route.params?.id ?? '') as string)
const cacheIdentifier = computed(() => `routes-${keySetId.value}`)
Expand Down
8 changes: 5 additions & 3 deletions src/pages/overview/Overview.vue
Original file line number Diff line number Diff line change
Expand Up @@ -193,11 +193,13 @@ onBeforeMount(async () => {
</script>

<style scoped lang="scss">
$card-spacing: 32px;
.info-container {
display: grid;
grid-template-columns: 1fr 1fr;
grid-gap: 32px;
margin-bottom: 32px;
grid-gap: $card-spacing;
margin-bottom: $card-spacing;
}
.info-list, .resource-list {
list-style: none;
Expand Down Expand Up @@ -234,7 +236,7 @@ onBeforeMount(async () => {
.resource-card {
padding: 0;
margin-bottom: 32px;
margin-bottom: $card-spacing;
:deep(.k-card-header) {
padding: var(--spacing-lg);
Expand Down
Loading

0 comments on commit 23c8c21

Please sign in to comment.