Skip to content

Commit

Permalink
[C-2341] Update tracks table to display tracks marked as deleted as d…
Browse files Browse the repository at this point in the history
…eleted (#3712)
  • Loading branch information
Kyle-Shanks authored Jul 7, 2023
1 parent 23ad32e commit a51c83e
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions packages/web/src/components/tracks-table/TracksTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,8 @@ export const TracksTable = ({
] ?? { isUserAccessTBD: false, doesUserHaveAccess: true }
const isLocked = !isUserAccessTBD && !doesUserHaveAccess
const index = cellInfo.row.index
const deleted = track.is_delete || track.user?.is_deactivated
const deleted =
track.is_delete || track._marked_deleted || !!track.user?.is_deactivated

const renderLocked = () => {
return (
Expand Down Expand Up @@ -311,7 +312,8 @@ export const TracksTable = ({
track.track_id
] ?? { isUserAccessTBD: false, doesUserHaveAccess: true }
const isLocked = !isUserAccessTBD && !doesUserHaveAccess
const deleted = track.is_delete || !!track.user?.is_deactivated
const deleted =
track.is_delete || track._marked_deleted || !!track.user?.is_deactivated
const isOwner = track.owner_id === userId
if (isLocked || deleted || isOwner) {
return <div className={styles.placeholderButton} />
Expand Down Expand Up @@ -345,7 +347,8 @@ export const TracksTable = ({
track.track_id
] ?? { isUserAccessTBD: false, doesUserHaveAccess: true }
const isLocked = !isUserAccessTBD && !doesUserHaveAccess
const deleted = track.is_delete || track.user?.is_deactivated
const deleted =
track.is_delete || track._marked_deleted || !!track.user?.is_deactivated
const isOwner = track.owner_id === userId
if (isLocked || deleted || isOwner) {
return <div className={styles.placeholderButton} />
Expand Down Expand Up @@ -382,7 +385,8 @@ export const TracksTable = ({
track.track_id
] ?? { isUserAccessTBD: false, doesUserHaveAccess: true }
const isLocked = !isUserAccessTBD && !doesUserHaveAccess
const deleted = track.is_delete || !!track.user?.is_deactivated
const deleted =
track.is_delete || track._marked_deleted || !!track.user?.is_deactivated
return (
<div ref={overflowMenuRef}>
<OverflowMenuButton
Expand Down Expand Up @@ -598,7 +602,8 @@ export const TracksTable = ({
track.track_id
] ?? { isUserAccessTBD: false, doesUserHaveAccess: true }
const isLocked = !isUserAccessTBD && !doesUserHaveAccess
const deleted = track.is_delete || track.user?.is_deactivated
const deleted =
track.is_delete || track._marked_deleted || !!track.user?.is_deactivated
const clickedActionButton = [
favoriteButtonRef,
repostButtonRef,
Expand All @@ -618,7 +623,8 @@ export const TracksTable = ({
track.track_id
] ?? { isUserAccessTBD: false, doesUserHaveAccess: true }
const isLocked = !isUserAccessTBD && !doesUserHaveAccess
const deleted = track?.is_delete || !!track?.user?.is_deactivated
const deleted =
track.is_delete || track._marked_deleted || !!track.user?.is_deactivated
return cn(styles.tableRow, {
[styles.disabled]: isLocked || deleted,
[styles.lockedRow]: isLocked && !deleted
Expand Down

0 comments on commit a51c83e

Please sign in to comment.