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

fix: globally fix text color of buttons in alerts #3323

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
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
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
<aside v-if="$slots.notifications">
<XAlert
class="mb-4"
appearance="warning"
variant="warning"
>
<slot name="notifications" />
</XAlert>
Expand Down
2 changes: 1 addition & 1 deletion packages/kuma-gui/src/app/common/ErrorBlock.vue
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@
v-else
>
<XAlert
appearance="danger"
variant="danger"
>
<div
class="error-block-message"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -508,7 +508,7 @@
>
<XAlert
class="mt-4"
appearance="warning"
variant="warning"
>
<div
v-html="t('data-planes.routes.item.mtls.disabled')"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -195,9 +195,6 @@ html.no-navigation {
</style>

<style lang="scss" scoped>
.upgrade-alert :deep(.k-button) {
color: $kui-color-text-inverse !important;
}
.app-content-container {
padding-top: var(--AppHeaderHeight, initial);
display: var(--AppDisplay);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
>
<XAlert
v-if="data?.closed !== true"
appearance="success"
variant="success"
dismissible
data-testid="onboarding-notification"
@dismiss="async () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@
</div>
<XAlert
v-if="Object.keys(props.data.status.acknowledgements).length === 0"
appearance="info"
variant="info"
>
<template #icon>
<PortalIcon />
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# x-about-card
1 change: 1 addition & 0 deletions packages/kuma-gui/src/app/x/components/x-alert/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# x-alert
35 changes: 35 additions & 0 deletions packages/kuma-gui/src/app/x/components/x-alert/XAlert.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
<template>
<KAlert
:appearance="props.variant"
:dismissible="props.dismissable"
>
<template
v-for="(_, key) in slots"
:key="key"
#[`${key}`]
>
<slot :name="key" />
</template>
</KAlert>
</template>
<script lang="ts" setup>
import { KAlert } from '@kong/kongponents'
import { useSlots } from 'vue'

import type { AlertAppearance } from '@kong/kongponents'

const slots = useSlots()

const props = withDefaults(defineProps<{
variant?: AlertAppearance
dismissable?: boolean
}>(), {
variant: 'warning',
dismissable: false,
})
</script>
<style lang="scss" scoped>
:deep(.k-button.primary) {
color: $kui-color-text-inverse !important;
}
</style>
7 changes: 4 additions & 3 deletions packages/kuma-gui/src/app/x/index.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import Kongponents, { KTooltip, KCard, KPop, KInputSwitch, KAlert, KCheckbox } from '@kong/kongponents'
import Kongponents, { KTooltip, KCard, KPop, KInputSwitch, KCheckbox } from '@kong/kongponents'

import XAboutCard from './components/x-about-card/XAboutCard.vue'
import XAction from './components/x-action/XAction.vue'
import XActionGroup from './components/x-action-group/XActionGroup.vue'
import XAlert from './components/x-alert/XAlert.vue'
import XBadge from './components/x-badge/XBadge.vue'
import XBreadcrumbs from './components/x-breadcrumbs/XBreadcrumbs.vue'
import XCodeBlock from './components/x-code-block/XCodeBlock.vue'
Expand All @@ -27,13 +28,13 @@ type Token = ReturnType<typeof token>

declare module 'vue' {
export interface GlobalComponents {
XAlert: typeof KAlert
XCard: typeof KCard
XPop: typeof KPop
XInputSwitch: typeof KInputSwitch
XCheckbox: typeof KCheckbox
XTooltip: typeof KTooltip
//
XAlert: typeof XAlert
XIcon: typeof XIcon
XI18n: typeof XI18n
XInput: typeof XInput
Expand Down Expand Up @@ -75,7 +76,7 @@ export const services = (app: Record<string, Token>): ServiceDefinition[] => {
[$.xVueComponents, {
service: () => {
return [
['XAlert', KAlert],
['XAlert', XAlert],
['XCard', KCard],
['XPop', KPop],
['XInputSwitch', KInputSwitch],
Expand Down
2 changes: 1 addition & 1 deletion packages/kuma-gui/src/app/zones/views/ZoneConfigView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
v-else
class="mt-4"
data-testid="warning-no-subscriptions"
appearance="warning"
variant="warning"
>
{{ t('zone-cps.detail.no_subscriptions') }}
</XAlert>
Expand Down
Loading