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),
|
state.componentsToUpdate.find((component) => component.id === data.id),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
|
||||||
const {
|
const {
|
||||||
outdated: isOutdated,
|
outdated: isOutdated,
|
||||||
breakingChange: hasBreakingChange,
|
breakingChange: hasBreakingChange,
|
||||||
|
|
@ -330,7 +331,7 @@ function GenericNode({
|
||||||
openAdvancedModal={false}
|
openAdvancedModal={false}
|
||||||
onCloseAdvancedModal={() => {}}
|
onCloseAdvancedModal={() => {}}
|
||||||
updateNode={() => handleUpdateCode()}
|
updateNode={() => handleUpdateCode()}
|
||||||
isOutdated={isOutdated && dismissAll}
|
isOutdated={isOutdated && (dismissAll || isUserEdited)}
|
||||||
isUserEdited={isUserEdited}
|
isUserEdited={isUserEdited}
|
||||||
hasBreakingChange={hasBreakingChange}
|
hasBreakingChange={hasBreakingChange}
|
||||||
/>
|
/>
|
||||||
|
|
|
||||||
|
|
@ -48,7 +48,8 @@ export default function UpdateAllComponents({}: {}) {
|
||||||
const componentsToUpdateFiltered = useMemo(
|
const componentsToUpdateFiltered = useMemo(
|
||||||
() =>
|
() =>
|
||||||
componentsToUpdate.filter(
|
componentsToUpdate.filter(
|
||||||
(component) => !dismissedNodes.includes(component.id),
|
(component) =>
|
||||||
|
!dismissedNodes.includes(component.id) && !component.userEdited,
|
||||||
),
|
),
|
||||||
[componentsToUpdate, dismissedNodes],
|
[componentsToUpdate, dismissedNodes],
|
||||||
);
|
);
|
||||||
|
|
|
||||||
|
|
@ -606,7 +606,9 @@ const NodeToolbarComponent = memo(
|
||||||
shortcuts.find((obj) => obj.name === "Update")
|
shortcuts.find((obj) => obj.name === "Update")
|
||||||
?.shortcut!
|
?.shortcut!
|
||||||
}
|
}
|
||||||
style={hasBreakingChange ? "text-warning" : ""}
|
style={
|
||||||
|
hasBreakingChange ? "text-accent-amber-foreground" : ""
|
||||||
|
}
|
||||||
value={isUserEdited ? "Restore" : "Update"}
|
value={isUserEdited ? "Restore" : "Update"}
|
||||||
icon={isUserEdited ? "RefreshCcwDot" : "CircleArrowUp"}
|
icon={isUserEdited ? "RefreshCcwDot" : "CircleArrowUp"}
|
||||||
dataTestId="update-button-modal"
|
dataTestId="update-button-modal"
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue