-
Notifications
You must be signed in to change notification settings - Fork 12
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
BEDS-1011/Gray-out archived dashboard rows in notifications management modal #1338
base: staging
Are you sure you want to change the base?
BEDS-1011/Gray-out archived dashboard rows in notifications management modal #1338
Conversation
…tifications management modal - (BcTablePopoutEdit): improve accessibility by wrapping clickable icon with a button - replace inexisting `custom property` used for disabled link color
Deploying beaconchain with
|
Latest commit: |
02386f5
|
Status: | ✅ Deploy successful! |
Preview URL: | https://77ba3776.beaconchain.pages.dev |
Branch Preview URL: | https://beds-1101-gray-out-archived.beaconchain.pages.dev |
@@ -4,12 +4,13 @@ import { FontAwesomeIcon } from '@fortawesome/vue-fontawesome' | |||
|
|||
const emit = defineEmits<{ (e: 'onEdit'): void }>() | |||
|
|||
interface Props { | |||
defineProps<{ | |||
disabled?: boolean, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
our naming convention is boolean props
are starting with is-
or has-
Understandably the question arises what is with DOM attributes
:
- they could be applied via
fallthrough
- so if we specify a
public api via our own props
we should stick to ourconventions
disabled?: boolean, | |
isDisabled?: boolean, |
@@ -273,7 +291,9 @@ const handleDelete = (payload: Parameters<typeof deleteDashboardNotifications>[0 | |||
:header="$t('notifications.col.group')" | |||
> | |||
<template #body="slotProps"> | |||
{{ slotProps.data.group_name }} | |||
<span :class="slotProps.data.is_archived ? 'disabled-text' : ''"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
more concise:
<span :class="slotProps.data.is_archived ? 'disabled-text' : ''"> | |
<span :class="{'disabled-text': slotProps.data.is_archived}> |
label?: string, | ||
noIcon?: boolean, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice 💪
const isDeleteButtonDisabled = (dashboard: WrappedRow) => { | ||
return !dashboard.subscriptions?.length || dashboard.is_archived | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
easier to reason about:
const isDeleteButtonDisabled = (dashboard: WrappedRow) => { | |
return !dashboard.subscriptions?.length || dashboard.is_archived | |
} | |
const isDeleteButtonDisabled = (dashboard: WrappedRow) => { | |
const hasSubscriptions = dashboard.subscriptions?.length | |
return !hasSubscriptions || dashboard.is_archived | |
} |
<span> | ||
<BcTooltip | ||
v-if="slotProps.data.is_archived" | ||
tooltip-width="320px" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this might suffice: (😪 applying it by default would be best)
tooltip-width="320px" | |
fit-content |
<FontAwesomeIcon | ||
v-if="!noIcon" | ||
<BcButtonIcon | ||
:screenreader-text="$t('common.edit')" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
well ideally we would give more context what the button is doing, but I guess this is fine for now
tooltip-width="320px" | ||
tooltip-text-align="left" | ||
class="disabled-text" | ||
:text="'This dashboard has been archived.'" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
plz use a translation
here
@@ -332,22 +356,25 @@ const handleDelete = (payload: Parameters<typeof deleteDashboardNotifications>[0 | |||
<template #expansion="slotProps"> | |||
<div class="expansion"> | |||
<div class="info"> | |||
<div class="label"> | |||
<div :class="['label', slotProps.data.is_archived ? 'text-disabled' : '']"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
more concise and more explicit which parts are conditional which are not
<div :class="['label', slotProps.data.is_archived ? 'text-disabled' : '']"> | |
<div | |
class="label" | |
:class="{'text-disabled' : slotProps.data.is_archived }"> |
No description provided.