fix: fixes inability to rename other widgets, jsactions, pages (#9848)
* fixes inability to rename other widgets, jsactions, pages * adds edge case to handle renaming non action based entities * fix if check
This commit is contained in:
parent
99d813971d
commit
b763fa03d3
|
|
@ -489,7 +489,7 @@ export const getExistingPageNames = createSelector(
|
|||
|
||||
export const getExistingWidgetNames = createSelector(
|
||||
(state: AppState) => state.entities.canvasWidgets,
|
||||
(widgets) => Object.values(widgets).map((widget) => widget.pageName),
|
||||
(widgets) => Object.values(widgets).map((widget) => widget.widgetName),
|
||||
);
|
||||
|
||||
export const getExistingActionNames = createSelector(
|
||||
|
|
@ -507,7 +507,13 @@ export const getExistingActionNames = createSelector(
|
|||
);
|
||||
|
||||
// if the current action being edited is on the same page, filter the actions on the page and return their names.
|
||||
if (editingAction && editingAction[0].config.pageId === currentPageId) {
|
||||
// or if the there is no current action being edited (this happens when a widget, or any other entity is being edited), return the actions on the page.
|
||||
if (
|
||||
(editingAction &&
|
||||
editingAction.length > 0 &&
|
||||
editingAction[0].config.pageId === currentPageId) ||
|
||||
(editingAction && editingAction.length < 1)
|
||||
) {
|
||||
return actions.map(
|
||||
(actionItem: { config: { name: string; pageId: string } }) => {
|
||||
if (actionItem.config.pageId === currentPageId) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user