fix: filter Update All components to not include edited ones, changed Node Toolbar to show Restore for edited componetns (#8050)
* Updated updateAllComponents to not include user edited components * Changed GenericNode to display isOutdated to node toolbar if user edited * Changed Restore color --------- Co-authored-by: Edwin Jose <edwin.jose@datastax.com>
This commit is contained in:
parent
fa3d1855e9
commit
04b2019715
3 changed files with 7 additions and 3 deletions
|
|
@ -119,6 +119,7 @@ function GenericNode({
|
|||
state.componentsToUpdate.find((component) => component.id === data.id),
|
||||
),
|
||||
);
|
||||
|
||||
const {
|
||||
outdated: isOutdated,
|
||||
breakingChange: hasBreakingChange,
|
||||
|
|
@ -330,7 +331,7 @@ function GenericNode({
|
|||
openAdvancedModal={false}
|
||||
onCloseAdvancedModal={() => {}}
|
||||
updateNode={() => handleUpdateCode()}
|
||||
isOutdated={isOutdated && dismissAll}
|
||||
isOutdated={isOutdated && (dismissAll || isUserEdited)}
|
||||
isUserEdited={isUserEdited}
|
||||
hasBreakingChange={hasBreakingChange}
|
||||
/>
|
||||
|
|
|
|||
|
|
@ -48,7 +48,8 @@ export default function UpdateAllComponents({}: {}) {
|
|||
const componentsToUpdateFiltered = useMemo(
|
||||
() =>
|
||||
componentsToUpdate.filter(
|
||||
(component) => !dismissedNodes.includes(component.id),
|
||||
(component) =>
|
||||
!dismissedNodes.includes(component.id) && !component.userEdited,
|
||||
),
|
||||
[componentsToUpdate, dismissedNodes],
|
||||
);
|
||||
|
|
|
|||
|
|
@ -606,7 +606,9 @@ const NodeToolbarComponent = memo(
|
|||
shortcuts.find((obj) => obj.name === "Update")
|
||||
?.shortcut!
|
||||
}
|
||||
style={hasBreakingChange ? "text-warning" : ""}
|
||||
style={
|
||||
hasBreakingChange ? "text-accent-amber-foreground" : ""
|
||||
}
|
||||
value={isUserEdited ? "Restore" : "Update"}
|
||||
icon={isUserEdited ? "RefreshCcwDot" : "CircleArrowUp"}
|
||||
dataTestId="update-button-modal"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue