Skip to content

Commit

Permalink
Show an archive tooltip when a draft is selected
Browse files Browse the repository at this point in the history
  • Loading branch information
p2edwards committed Aug 21, 2023
1 parent bcda6ee commit 5cf1d55
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 3 deletions.
26 changes: 23 additions & 3 deletions jsapp/js/projects/projectsTable/projectQuickActions.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,9 @@ export default function ProjectQuickActions(props: ProjectQuickActionsProps) {

return (
<div className={styles.root}>
{props.asset.deployment__active && (
{/* Archive / Unarchive */}
{/* Archive a deployed project */}
{props.asset.deployment_status === 'deployed' && (
<Button
isDisabled={
!isChangingPossible ||
Expand All @@ -48,10 +50,11 @@ export default function ProjectQuickActions(props: ProjectQuickActionsProps) {
customViewStore.handleAssetChanged(response.asset);
})
}
classNames={['right-tooltip']}
/>
)}

{!props.asset.deployment__active && (
{/* Un-archive a deployed project */}
{props.asset.deployment_status === 'archived' && (
<Button
isDisabled={
!isChangingPossible ||
Expand All @@ -68,9 +71,23 @@ export default function ProjectQuickActions(props: ProjectQuickActionsProps) {
customViewStore.handleAssetChanged(response.asset);
})
}
classNames={['right-tooltip']}
/>
)}
{/* Show tooltip, since drafts can't be archived/unarchived */}
{props.asset.deployment_status === 'draft' && (
<Button
isDisabled
type='bare'
color='storm'
size='s'
startIcon='archived'
tooltip={t('Draft project selected')}
classNames={['right-tooltip']}
/>
)}

{/* Share */}
<Button
isDisabled={!isManagingPossible}
type='bare'
Expand All @@ -79,8 +96,10 @@ export default function ProjectQuickActions(props: ProjectQuickActionsProps) {
startIcon='user-share'
tooltip={t('Share project')}
onClick={() => manageAssetSharing(props.asset.uid)}
classNames={['right-tooltip']}
/>

{/* Delete */}
<Button
isDisabled={!isChangingPossible}
type='bare'
Expand All @@ -97,6 +116,7 @@ export default function ProjectQuickActions(props: ProjectQuickActionsProps) {
}
)
}
classNames={['right-tooltip']}
/>
</div>
);
Expand Down
3 changes: 3 additions & 0 deletions jsapp/js/projects/projectsTable/projectQuickActionsEmpty.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ const NO_PROJECT_SELECTED = t('No project selected');
export default function ProjectQuickActions() {
return (
<div className={styles.root}>
{/* Archive / Unarchive */}
<Button
isDisabled
type='bare'
Expand All @@ -17,6 +18,7 @@ export default function ProjectQuickActions() {
classNames={['right-tooltip']}
/>

{/* Share */}
<Button
isDisabled
type='bare'
Expand All @@ -27,6 +29,7 @@ export default function ProjectQuickActions() {
classNames={['right-tooltip']}
/>

{/* Delete */}
<Button
isDisabled
type='bare'
Expand Down

0 comments on commit 5cf1d55

Please sign in to comment.