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

BEDS-1011/Gray-out archived dashboard rows in notifications management modal #1338

Open
wants to merge 1 commit into
base: staging
Choose a base branch
from

Conversation

enzo-bitfly
Copy link
Contributor

No description provided.

…tifications management modal

- (BcTablePopoutEdit): improve accessibility by wrapping clickable icon with a button
- replace inexisting `custom property` used for disabled link color
Copy link

Deploying beaconchain with  Cloudflare Pages  Cloudflare Pages

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

View logs

@@ -4,12 +4,13 @@ import { FontAwesomeIcon } from '@fortawesome/vue-fontawesome'

const emit = defineEmits<{ (e: 'onEdit'): void }>()

interface Props {
defineProps<{
disabled?: boolean,
Copy link
Contributor

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 our conventions
Suggested change
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' : ''">
Copy link
Contributor

Choose a reason for hiding this comment

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

more concise:

Suggested change
<span :class="slotProps.data.is_archived ? 'disabled-text' : ''">
<span :class="{'disabled-text': slotProps.data.is_archived}>

label?: string,
noIcon?: boolean,
Copy link
Contributor

Choose a reason for hiding this comment

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

nice 💪

Comment on lines +225 to +227
const isDeleteButtonDisabled = (dashboard: WrappedRow) => {
return !dashboard.subscriptions?.length || dashboard.is_archived
}
Copy link
Contributor

Choose a reason for hiding this comment

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

easier to reason about:

Suggested change
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"
Copy link
Contributor

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)

Suggested change
tooltip-width="320px"
fit-content

<FontAwesomeIcon
v-if="!noIcon"
<BcButtonIcon
:screenreader-text="$t('common.edit')"
Copy link
Contributor

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.'"
Copy link
Contributor

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' : '']">
Copy link
Contributor

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

Suggested change
<div :class="['label', slotProps.data.is_archived ? 'text-disabled' : '']">
<div
class="label"
:class="{'text-disabled' : slotProps.data.is_archived }">

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants