Skip to content

Commit

Permalink
JNG-5965 fix actions (#468)
Browse files Browse the repository at this point in the history
* JNG-5965 JNG-5969 fix actions

* asd
  • Loading branch information
noherczeg authored Oct 11, 2024
1 parent 7c2df8d commit ca13d85
Show file tree
Hide file tree
Showing 19 changed files with 3,417 additions and 21 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -437,6 +437,10 @@ export default function ViewGalaxyStarsRelationViewPage(props: ViewGalaxyStarsRe
});
});
};
// ClearAction: God/(esm/_GuuWAE7vEeycO-gUAWxcVg)/TabularReferenceTableClearAction/(discriminator/God/(esm/_B7jpUE7sEeycO-gUAWxcVg)/RelationFeatureView)
const planetsClearAction = async () => {
storeDiff('planets', []);
};
// OpenCreateFormAction: God/(esm/_GuuWAE7vEeycO-gUAWxcVg)/TabularReferenceTableCreateAction/(discriminator/God/(esm/_B7jpUE7sEeycO-gUAWxcVg)/RelationFeatureView)
const planetsOpenCreateFormAction = async () => {
const itemIndex = (data.planets || []).length; // length gives next without -1-ing it
Expand Down Expand Up @@ -606,6 +610,7 @@ export default function ViewGalaxyStarsRelationViewPage(props: ViewGalaxyStarsRe
observationsRemoveAction,
observationsOpenPageAction,
planetsBulkDeleteAction,
planetsClearAction,
planetsOpenCreateFormAction,
planetsFilterAction,
planetsRowDeleteAction,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -365,6 +365,10 @@ export default function GodGodGalaxiesAccessViewPage() {
});
});
};
// ClearAction: God/(esm/_8AxbAE7tEeycO-gUAWxcVg)/TabularReferenceTableClearAction/(discriminator/God/(esm/_4pyPkM_cEe6fibzd7gNETg)/AccessViewPageDefinition)
const starsClearAction = async () => {
storeDiff('stars', []);
};
// OpenCreateFormAction: God/(esm/_8AxbAE7tEeycO-gUAWxcVg)/TabularReferenceTableCreateAction/(discriminator/God/(esm/_4pyPkM_cEe6fibzd7gNETg)/AccessViewPageDefinition)
const starsOpenCreateFormAction = async () => {
const itemIndex = (data.stars || []).length; // length gives next without -1-ing it
Expand Down Expand Up @@ -538,6 +542,7 @@ export default function GodGodGalaxiesAccessViewPage() {
astronomerUnsetAction,
astronomerOpenPageAction,
starsBulkDeleteAction,
starsClearAction,
starsOpenCreateFormAction,
starsExportAction,
starsFilterAction,
Expand Down
39 changes: 39 additions & 0 deletions judo-ui-react-itest/ActionGroupTest/model/ActionGroupTest-ui.model

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -529,7 +529,14 @@ export function EagerTable<T extends GridValidRowModel, TStored extends T, S ext
<GridToolbarContainer>
{toolBarActions.map((toolBarAction: ToolBarActionProps<T>) =>
actions[toolBarAction.name] &&
toolBarAction.enabled(data, selectionModel, getSelectedRows(), ownerData, isFormUpdateable) ? (
toolBarAction.enabled(
data,
selectionModel,
getSelectedRows(),
ownerData,
isFormUpdateable,
rowModesModel,
) ? (
<Button
key={toolBarAction.id}
id={toolBarAction.id}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import Button from '@mui/material/Button';
import ButtonGroup from '@mui/material/ButtonGroup';
import IconButton from '@mui/material/IconButton';
import Typography from '@mui/material/Typography';
import { GridLogicOperator, useGridApiRef } from '@mui/x-data-grid-pro';
import { GridLogicOperator, GridRowModes, useGridApiRef } from '@mui/x-data-grid-pro';
import { gridColumnDefinitionsSelector } from '@mui/x-data-grid-pro';
import type {
GridColDef,
Expand All @@ -21,6 +21,7 @@ import type {
GridRowClassNameParams,
GridRowId,
GridRowModel,
GridRowModesModel,
GridRowParams,
GridRowSelectionModel,
GridSortItem,
Expand Down Expand Up @@ -377,6 +378,7 @@ export function ViewGalaxyTableTableComponent(props: ViewGalaxyTableTableCompone
selectedRows: ViewGalaxyStored[],
ownerData?: any,
isFormUpdateable?: () => boolean,
rowModesModel?: GridRowModesModel,
): boolean => true,
isBulk: false,
},
Expand All @@ -393,6 +395,7 @@ export function ViewGalaxyTableTableComponent(props: ViewGalaxyTableTableCompone
selectedRows: ViewGalaxyStored[],
ownerData?: any,
isFormUpdateable?: () => boolean,
rowModesModel?: GridRowModesModel,
): boolean => true,
isBulk: false,
},
Expand All @@ -409,6 +412,7 @@ export function ViewGalaxyTableTableComponent(props: ViewGalaxyTableTableCompone
selectedRows: ViewGalaxyStored[],
ownerData?: any,
isFormUpdateable?: () => boolean,
rowModesModel?: GridRowModesModel,
): boolean => true,
isBulk: false,
},
Expand All @@ -425,6 +429,7 @@ export function ViewGalaxyTableTableComponent(props: ViewGalaxyTableTableCompone
selectedRows: ViewGalaxyStored[],
ownerData?: any,
isFormUpdateable?: () => boolean,
rowModesModel?: GridRowModesModel,
): boolean => true,
isBulk: false,
},
Expand All @@ -441,6 +446,7 @@ export function ViewGalaxyTableTableComponent(props: ViewGalaxyTableTableCompone
selectedRows: ViewGalaxyStored[],
ownerData?: any,
isFormUpdateable?: () => boolean,
rowModesModel?: GridRowModesModel,
): boolean => true,
isBulk: false,
},
Expand All @@ -457,6 +463,7 @@ export function ViewGalaxyTableTableComponent(props: ViewGalaxyTableTableCompone
selectedRows: ViewGalaxyStored[],
ownerData?: any,
isFormUpdateable?: () => boolean,
rowModesModel?: GridRowModesModel,
): boolean => true,
isBulk: false,
},
Expand All @@ -473,6 +480,7 @@ export function ViewGalaxyTableTableComponent(props: ViewGalaxyTableTableCompone
selectedRows: ViewGalaxyStored[],
ownerData?: any,
isFormUpdateable?: () => boolean,
rowModesModel?: GridRowModesModel,
): boolean => data.length > 0,
isBulk: false,
},
Expand All @@ -489,6 +497,7 @@ export function ViewGalaxyTableTableComponent(props: ViewGalaxyTableTableCompone
selectedRows: ViewGalaxyStored[],
ownerData?: any,
isFormUpdateable?: () => boolean,
rowModesModel?: GridRowModesModel,
): boolean => selectionModel.length > 0,
isBulk: true,
},
Expand All @@ -505,6 +514,7 @@ export function ViewGalaxyTableTableComponent(props: ViewGalaxyTableTableCompone
selectedRows: ViewGalaxyStored[],
ownerData?: any,
isFormUpdateable?: () => boolean,
rowModesModel?: GridRowModesModel,
): boolean => selectionModel.length > 0,
isBulk: true,
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -365,6 +365,10 @@ export default function GodGodGalaxiesAccessViewPage() {
});
});
};
// ClearAction: God/(esm/_8AxbAE7tEeycO-gUAWxcVg)/TabularReferenceTableClearAction/(discriminator/God/(esm/_4pyPkM_cEe6fibzd7gNETg)/AccessViewPageDefinition)
const starsClearAction = async () => {
storeDiff('stars', []);
};
// OpenCreateFormAction: God/(esm/_8AxbAE7tEeycO-gUAWxcVg)/TabularReferenceTableCreateAction/(discriminator/God/(esm/_4pyPkM_cEe6fibzd7gNETg)/AccessViewPageDefinition)
const starsOpenCreateFormAction = async () => {
const itemIndex = (data.stars || []).length; // length gives next without -1-ing it
Expand Down Expand Up @@ -538,6 +542,7 @@ export default function GodGodGalaxiesAccessViewPage() {
astronomerUnsetAction,
astronomerOpenPageAction,
starsBulkDeleteAction,
starsClearAction,
starsOpenCreateFormAction,
starsExportAction,
starsFilterAction,
Expand Down
Loading

0 comments on commit ca13d85

Please sign in to comment.