Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
https://linear.app/unleash/issue/2-1995/ui-feature-rename-adapt-the-actions-ui https://linear.app/unleash/issue/2-1988/nice-to-have-last-action-status-on-the-action-sets-table Brings the project actions table UI up to par with the new designs, implementing some features that were discussed with UX. ![image](https://github.com/Unleash/unleash/assets/14320932/1a8ef47d-ab33-4284-9650-4c2481dd16dc) ![image](https://github.com/Unleash/unleash/assets/14320932/c19f6691-67a5-4abc-a546-837e25cad388) ![image](https://github.com/Unleash/unleash/assets/14320932/61e3f221-ae93-4d87-98f1-db2782285d2e)
- Loading branch information
Showing
12 changed files
with
163 additions
and
53 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
59 changes: 59 additions & 0 deletions
59
.../ProjectActions/ProjectActionsTable/ProjectActionsActionsCell/ProjectActionsLastEvent.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
import { IActionSet } from 'interfaces/action'; | ||
import { TooltipLink } from 'component/common/TooltipLink/TooltipLink'; | ||
import { useActionEvents } from 'hooks/api/getters/useActionEvents/useActionEvents'; | ||
import { ProjectActionsEventsDetails } from '../ProjectActionsEventsModal/ProjectActionsEventsDetails/ProjectActionsEventsDetails'; | ||
import { CircularProgress, styled } from '@mui/material'; | ||
import { CheckCircle, Error as ErrorIcon } from '@mui/icons-material'; | ||
|
||
const StyledTooltipLink = styled(TooltipLink)(({ theme }) => ({ | ||
display: 'flex', | ||
alignItems: 'center', | ||
})); | ||
|
||
export const StyledSuccessIcon = styled(CheckCircle)(({ theme }) => ({ | ||
color: theme.palette.success.main, | ||
})); | ||
|
||
export const StyledFailedIcon = styled(ErrorIcon)(({ theme }) => ({ | ||
color: theme.palette.error.main, | ||
})); | ||
|
||
interface IProjectActionsLastEventProps { | ||
action: IActionSet; | ||
} | ||
|
||
export const ProjectActionsLastEvent = ({ | ||
action, | ||
}: IProjectActionsLastEventProps) => { | ||
const { id, project } = action; | ||
const { actionEvents } = useActionEvents(id, project, 1, { | ||
refreshInterval: 5000, | ||
}); | ||
|
||
if (actionEvents.length === 0) { | ||
return null; | ||
} | ||
|
||
const actionSetEvent = actionEvents[0]; | ||
|
||
const icon = | ||
actionSetEvent.state === 'success' ? ( | ||
<StyledSuccessIcon /> | ||
) : actionSetEvent.state === 'failed' ? ( | ||
<StyledFailedIcon /> | ||
) : ( | ||
<CircularProgress size={20} /> | ||
); | ||
|
||
return ( | ||
<StyledTooltipLink | ||
tooltipProps={{ | ||
maxWidth: 500, | ||
maxHeight: 600, | ||
}} | ||
tooltip={<ProjectActionsEventsDetails {...actionSetEvent} />} | ||
> | ||
{icon} | ||
</StyledTooltipLink> | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters