rusackas commented on code in PR #32995:
URL: https://github.com/apache/superset/pull/32995#discussion_r2027158913
##########
superset-frontend/src/pages/ChartList/index.tsx:
##########
@@ -478,14 +500,20 @@ function ChartList(props: ChartListProps) {
{confirmDelete => (
<Tooltip
id="delete-action-tooltip"
- title={t('Delete')}
+ title={
+ allowEdit
+ ? t('Delete')
+ : t(
+ 'You must be a chart owner in order to delete.
Please reach out to a chart owner to request modifications or edit access.',
+ )
+ }
placement="bottom"
>
<span
role="button"
tabIndex={0}
- className="action-button"
- onClick={confirmDelete}
+ className={allowEdit ? 'action-button' : 'disabled'}
+ onClick={allowEdit ? confirmDelete : undefined}
>
<Icons.DeleteOutlined iconSize="l" />
Review Comment:
I feel like this "disable the icon/button" approach should be applicable all
over the product. Rather than adding bespoke CSS for this one instance, I feel
like it would be best to add a "disabled" or even "dimmed" prop to the Icons
component, that might just reduce its opacity there by 50% or something. That
would mean we have a lot less CSS in this code, and a reusable Icon prop we can
use everywhere cases like this apply.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]