From e79a5f4117281ce40a62ce94ac3d384bf1671f53 Mon Sep 17 00:00:00 2001 From: Norbert Csaba Herczeg Date: Thu, 16 Mar 2023 13:15:05 +0100 Subject: [PATCH] JNG-4639: qa friendly elements (#29) --- .../ui/generator/react/UiGeneralHelper.java | 7 ++-- .../components-api/components/MenuTree.ts.hbs | 1 + .../dialog/ConfirmationDialog.ts.hbs | 1 + .../dialog/DialogContext.ts.hbs | 5 +-- .../components-api/dialog/FilterDialog.ts.hbs | 11 ++++++- .../components/ApplicationSelector.tsx.hbs | 6 ++-- .../src/components/CustomBreadcrumb.tsx.hbs | 2 +- .../src/components/DropdownButton.tsx.hbs | 5 +-- .../actor/src/components/Hero.tsx.hbs | 8 ++--- .../actor/src/components/Logo.tsx.hbs | 1 + .../actor/src/components/ModeledTabs.tsx.hbs | 14 ++++---- .../actor/src/components/PageHeader.tsx.hbs | 2 +- .../dialog/ConfirmationDialog.tsx.hbs | 9 ++--- .../components/dialog/DialogProvider.tsx.hbs | 8 +++-- .../components/dialog/FilterDialog.tsx.hbs | 33 +++++++++++-------- .../src/components/dialog/RangeDialog.tsx.hbs | 15 +++++---- .../table/table-row-actions.tsx.hbs | 14 +++++--- .../widgets/TrinaryLogicCombobox.tsx.hbs | 6 ++-- .../fragments/action/range-call.fragment.hbs | 1 + .../fragments/relation/column.fragment.hbs | 2 +- .../table/filter-option.fragment.hbs | 1 + .../resources/actor/src/layout/Footer.tsx.hbs | 2 +- .../resources/actor/src/layout/Header.tsx.hbs | 2 +- .../actor/src/layout/Navigator.tsx.hbs | 6 ++-- .../resources/actor/src/menu-items.tsx.hbs | 2 ++ .../actor/src/pages/access/create.hbs | 2 +- .../actor/src/pages/access/table.hbs | 13 +++++--- .../resources/actor/src/pages/access/view.hbs | 12 ++++--- .../pages/actions/action/add-action.tsx.hbs | 1 + .../output-view/output-view.tsx.hbs | 3 +- .../without-input-form.fragment.hbs | 1 + .../actions/action/filter-action.tsx.hbs | 8 ++--- .../actionForm/createActionForm.tsx.hbs | 6 ++-- .../operationInputActionForm.tsx.hbs | 6 ++-- .../actor/src/pages/operation-output/view.hbs | 12 ++++--- .../actor/src/pages/page-fallback.hbs | 4 ++- .../actor/src/pages/relation/table.hbs | 16 +++++---- .../actor/src/pages/relation/view.hbs | 12 ++++--- .../actor/src/pages/widgets/actiongroup.hbs | 4 ++- .../src/pages/widgets/binarytypeinput.hbs | 4 +-- .../actor/src/pages/widgets/button.hbs | 4 +-- .../actor/src/pages/widgets/dateinput.hbs | 1 + .../actor/src/pages/widgets/datetimeinput.hbs | 1 + .../src/pages/widgets/enumerationcombo.hbs | 4 +-- .../src/pages/widgets/enumerationradio.hbs | 4 +-- .../actor/src/pages/widgets/flex/column.hbs | 4 +-- .../actor/src/pages/widgets/flex/row.hbs | 4 +-- .../actor/src/pages/widgets/formatted.hbs | 2 +- .../actor/src/pages/widgets/label.hbs | 2 +- .../actor/src/pages/widgets/link.hbs | 3 +- .../actor/src/pages/widgets/numericinput.hbs | 2 +- .../actor/src/pages/widgets/switch.hbs | 8 ++--- .../actor/src/pages/widgets/tabcontroller.hbs | 3 +- .../actor/src/pages/widgets/table.hbs | 7 ++-- .../actor/src/pages/widgets/text.hbs | 2 +- .../actor/src/pages/widgets/textarea.hbs | 2 +- .../actor/src/pages/widgets/textinput.hbs | 2 +- .../actor/src/pages/widgets/timeinput.hbs | 1 + .../src/pages/widgets/trinarylogiccombo.hbs | 2 +- .../actor/src/utilities/interfaces.ts.hbs | 2 +- .../src/utilities/table-row-actions.tsx.hbs | 1 + 61 files changed, 205 insertions(+), 124 deletions(-) diff --git a/judo-ui-react/src/main/java/hu/blackbelt/judo/ui/generator/react/UiGeneralHelper.java b/judo-ui-react/src/main/java/hu/blackbelt/judo/ui/generator/react/UiGeneralHelper.java index 9cfead5a..a06e3566 100644 --- a/judo-ui-react/src/main/java/hu/blackbelt/judo/ui/generator/react/UiGeneralHelper.java +++ b/judo-ui-react/src/main/java/hu/blackbelt/judo/ui/generator/react/UiGeneralHelper.java @@ -5,15 +5,14 @@ import hu.blackbelt.judo.meta.ui.Application; import hu.blackbelt.judo.meta.ui.NavigationItem; import hu.blackbelt.judo.meta.ui.Sort; -import hu.blackbelt.judo.meta.ui.Stretch; import hu.blackbelt.judo.meta.ui.data.*; import lombok.extern.java.Log; import org.eclipse.emf.ecore.EObject; -import org.eclipse.emf.ecore.xmi.XMIResource; import java.util.Collection; import java.util.stream.Collectors; +import static hu.blackbelt.judo.ui.generator.typescript.rest.commons.UiCommonsHelper.getXMIID; import static java.util.Arrays.stream; @Log @@ -75,6 +74,10 @@ public static String fqClass(String fqName) { .collect(Collectors.joining()); } + public static String createId(EObject element) { + return fqClass(getXMIID(element).replaceAll("@", "")); + } + public static Boolean isNavItemAGroup(NavigationItem navigationItem) { return navigationItem.getTarget() == null; } diff --git a/judo-ui-react/src/main/resources/actor/src/components-api/components/MenuTree.ts.hbs b/judo-ui-react/src/main/resources/actor/src/components-api/components/MenuTree.ts.hbs index 84203fa9..6fafe55f 100644 --- a/judo-ui-react/src/main/resources/actor/src/components-api/components/MenuTree.ts.hbs +++ b/judo-ui-react/src/main/resources/actor/src/components-api/components/MenuTree.ts.hbs @@ -5,6 +5,7 @@ // Template name: {{ template.templateName }} export type MenuItem = { + id: string; icon?: string; label: string; to?: string; diff --git a/judo-ui-react/src/main/resources/actor/src/components-api/dialog/ConfirmationDialog.ts.hbs b/judo-ui-react/src/main/resources/actor/src/components-api/dialog/ConfirmationDialog.ts.hbs index 5eaeb89a..ec4567a5 100644 --- a/judo-ui-react/src/main/resources/actor/src/components-api/dialog/ConfirmationDialog.ts.hbs +++ b/judo-ui-react/src/main/resources/actor/src/components-api/dialog/ConfirmationDialog.ts.hbs @@ -7,6 +7,7 @@ import type { ReactNode } from 'react'; export interface ConfirmationDialogProps { + id: string, confirmationMessage: string | ReactNode; title: string | ReactNode; resolve: (value: boolean) => void; diff --git a/judo-ui-react/src/main/resources/actor/src/components-api/dialog/DialogContext.ts.hbs b/judo-ui-react/src/main/resources/actor/src/components-api/dialog/DialogContext.ts.hbs index bfc1153d..2f6c4c28 100644 --- a/judo-ui-react/src/main/resources/actor/src/components-api/dialog/DialogContext.ts.hbs +++ b/judo-ui-react/src/main/resources/actor/src/components-api/dialog/DialogContext.ts.hbs @@ -18,10 +18,11 @@ export interface PageDialogProviderContext { } export interface ConfirmDialogProviderContext { - openConfirmDialog: (confirmationMessage: string | ReactNode, title?: string | ReactNode) => Promise; + openConfirmDialog: (id: string, confirmationMessage: string | ReactNode, title?: string | ReactNode) => Promise; } export interface OpenRangeDialogProps, U extends QueryCustomizer> { + id: string; columns: GridColumns; defaultSortField: GridSortItem; rangeCall: (queryCustomizer: U) => Promise>; @@ -38,5 +39,5 @@ export interface RangeDialogProviderContext { } export interface FilterDialogProviderContext { - openFilterDialog: (filterOptions: FilterOption[], filters?: Filter[]) => Promise; + openFilterDialog: (id: string, filterOptions: FilterOption[], filters?: Filter[]) => Promise; } diff --git a/judo-ui-react/src/main/resources/actor/src/components-api/dialog/FilterDialog.ts.hbs b/judo-ui-react/src/main/resources/actor/src/components-api/dialog/FilterDialog.ts.hbs index 2dcd4624..c37c8407 100644 --- a/judo-ui-react/src/main/resources/actor/src/components-api/dialog/FilterDialog.ts.hbs +++ b/judo-ui-react/src/main/resources/actor/src/components-api/dialog/FilterDialog.ts.hbs @@ -7,6 +7,7 @@ import { _BooleanOperation, _EnumerationOperation, _NumericOperation, _StringOperation } from '@judo/data-api-common'; export interface FilterOption { + id: string; attributeName: string; label?: string; filterType: FilterType; @@ -32,12 +33,15 @@ export type FilterBy = { }; export interface Filter { - id: number; + id: string; + operationId: string; + valueId: string; filterOption: FilterOption; filterBy: FilterBy; } export interface FilterDialogProps { + id: string; filters?: Filter[]; filterOptions: FilterOption[]; resolve: (value: any) => void; @@ -46,16 +50,21 @@ export interface FilterDialogProps { } export interface FilterOperatorProps { + operatorId: string; + valueId: string; filter: Filter; setFilterOperator: (filter: Filter, newOperator: Operation) => void; } export interface FilterInputProps { + operatorId: string; + valueId: string; filter: Filter; setFilterValue: (filter: Filter, newValue: any) => void; } export interface FilterProps { + id: string; filter: Filter; closeHandler: (filter: Filter) => void; setFilterValue: (filter: Filter, newValue: any) => void; diff --git a/judo-ui-react/src/main/resources/actor/src/components/ApplicationSelector.tsx.hbs b/judo-ui-react/src/main/resources/actor/src/components/ApplicationSelector.tsx.hbs index 04636469..86cd7451 100644 --- a/judo-ui-react/src/main/resources/actor/src/components/ApplicationSelector.tsx.hbs +++ b/judo-ui-react/src/main/resources/actor/src/components/ApplicationSelector.tsx.hbs @@ -28,11 +28,11 @@ export function ApplicationSelector() { return ( <> - { t('judo.applications.available_applications', { defaultValue: 'Available applications' }) as string } {Object.keys(alternativeApplications).map(key => ( - handleMenuItemClick(key)}> + handleMenuItemClick(key)}> {alternativeApplications[key]} ))} diff --git a/judo-ui-react/src/main/resources/actor/src/components/CustomBreadcrumb.tsx.hbs b/judo-ui-react/src/main/resources/actor/src/components/CustomBreadcrumb.tsx.hbs index 17a07fb9..1879fb5f 100644 --- a/judo-ui-react/src/main/resources/actor/src/components/CustomBreadcrumb.tsx.hbs +++ b/judo-ui-react/src/main/resources/actor/src/components/CustomBreadcrumb.tsx.hbs @@ -152,7 +152,7 @@ export const CustomBreadcrumb = () => { const breadcrumbItems = useContext(BreadcrumbContextState); return ( - + {breadcrumbItems.map(({ label, key }, index) => { return ( diff --git a/judo-ui-react/src/main/resources/actor/src/components/DropdownButton.tsx.hbs b/judo-ui-react/src/main/resources/actor/src/components/DropdownButton.tsx.hbs index 04bc1f1e..119746e1 100644 --- a/judo-ui-react/src/main/resources/actor/src/components/DropdownButton.tsx.hbs +++ b/judo-ui-react/src/main/resources/actor/src/components/DropdownButton.tsx.hbs @@ -10,6 +10,7 @@ import type { ReactNode, KeyboardEvent, SyntheticEvent } from 'react'; import { MdiIcon } from './MdiIcon'; interface DropdownMenuItem { + id: string, disabled?: boolean; visible?: boolean; label?: string; @@ -20,7 +21,7 @@ interface DropdownMenuItem { interface DropdownButtonProps { children?: ReactNode; - id?: string | undefined; + id: string; menuItems: DropdownMenuItem[]; disabled?: boolean; showDropdownIcon?: boolean; @@ -107,7 +108,7 @@ export function DropdownButton({ return ( { handleClose(event); diff --git a/judo-ui-react/src/main/resources/actor/src/components/Hero.tsx.hbs b/judo-ui-react/src/main/resources/actor/src/components/Hero.tsx.hbs index 1386d4b2..0b1bc909 100644 --- a/judo-ui-react/src/main/resources/actor/src/components/Hero.tsx.hbs +++ b/judo-ui-react/src/main/resources/actor/src/components/Hero.tsx.hbs @@ -9,13 +9,13 @@ import type { HeroProps } from '../components-api'; export function Hero(props: HeroProps) { return ( - - hero + + hero - {props.preferredUsername && + {props.preferredUsername && {props.preferredUsername} } - {props.email && + {props.email && {props.email} } diff --git a/judo-ui-react/src/main/resources/actor/src/components/Logo.tsx.hbs b/judo-ui-react/src/main/resources/actor/src/components/Logo.tsx.hbs index 955e8f5b..1f1227e7 100644 --- a/judo-ui-react/src/main/resources/actor/src/components/Logo.tsx.hbs +++ b/judo-ui-react/src/main/resources/actor/src/components/Logo.tsx.hbs @@ -24,6 +24,7 @@ export function Logo(props: LogoProps) { } } > @@ -37,12 +38,13 @@ export interface ChildTabProps { } export interface ModeledTabsProps { + id: string, activeIndex: number, childTabs: ChildTabProps[], children: ReactNode; } -export function ModeledTabs({ activeIndex, childTabs, children }: ModeledTabsProps) { +export function ModeledTabs({ id, activeIndex, childTabs, children }: ModeledTabsProps) { const [value, setValue] = useState(activeIndex); const handleChange = (event: SyntheticEvent, newValue: number) => { @@ -50,16 +52,16 @@ export function ModeledTabs({ activeIndex, childTabs, children }: ModeledTabsPro }; return ( - + {childTabs.map((c: any, index: number) => ( - : '' } iconPosition="start" id={c.id} disabled={ {{# if child.enabledBy }}!data.{{ child.enabledBy.name }}{{ else }}false{{/ if }} } /> + : '' } iconPosition="start" disabled={ {{# if child.enabledBy }}!data.{{ child.enabledBy.name }}{{ else }}false{{/ if }} } /> ))} {childTabs.map((c: any, index: number) => ( - + {Array.isArray(children) ? children[index] : ''} ))} diff --git a/judo-ui-react/src/main/resources/actor/src/components/PageHeader.tsx.hbs b/judo-ui-react/src/main/resources/actor/src/components/PageHeader.tsx.hbs index 28b0929c..5e7d32c5 100644 --- a/judo-ui-react/src/main/resources/actor/src/components/PageHeader.tsx.hbs +++ b/judo-ui-react/src/main/resources/actor/src/components/PageHeader.tsx.hbs @@ -28,7 +28,7 @@ export const PageHeader = ({ title, children }: PageHeaderProps) => { - + {title} diff --git a/judo-ui-react/src/main/resources/actor/src/components/dialog/ConfirmationDialog.tsx.hbs b/judo-ui-react/src/main/resources/actor/src/components/dialog/ConfirmationDialog.tsx.hbs index c56d2b69..52895be8 100644 --- a/judo-ui-react/src/main/resources/actor/src/components/dialog/ConfirmationDialog.tsx.hbs +++ b/judo-ui-react/src/main/resources/actor/src/components/dialog/ConfirmationDialog.tsx.hbs @@ -10,6 +10,7 @@ import { useTranslation } from 'react-i18next'; import type { ConfirmationDialogProps } from '../../components-api'; export const ConfirmationDialog = ({ + id, confirmationMessage, title, resolve, @@ -38,18 +39,18 @@ export const ConfirmationDialog = ({ }; return ( - - {title && {title}} + + {title && {title}} {confirmationMessage} - - diff --git a/judo-ui-react/src/main/resources/actor/src/components/dialog/DialogProvider.tsx.hbs b/judo-ui-react/src/main/resources/actor/src/components/dialog/DialogProvider.tsx.hbs index 5a2dee17..f4b70574 100644 --- a/judo-ui-react/src/main/resources/actor/src/components/dialog/DialogProvider.tsx.hbs +++ b/judo-ui-react/src/main/resources/actor/src/components/dialog/DialogProvider.tsx.hbs @@ -56,6 +56,7 @@ export const DialogProvider = ({ children }: DialogProviderProps) => { }; const handleOpenRangeDialog = async , U extends QueryCustomizer>({ + id, columns, defaultSortField, rangeCall, @@ -69,6 +70,7 @@ export const DialogProvider = ({ children }: DialogProviderProps) => { return new Promise((resolve) => { setRangeDialog( + id={id} handleClose={handleCloseRangeDialog} open={true} resolve={resolve} @@ -97,12 +99,13 @@ export const DialogProvider = ({ children }: DialogProviderProps) => { return false; }; - const handleOpenConfirmDialog = async (confirmationMessage: string | ReactNode, title?: string | ReactNode) => { + const handleOpenConfirmDialog = async (id: string, confirmationMessage: string | ReactNode, title?: string | ReactNode) => { setIsOpenConfirmDialog(true); return new Promise((resolve) => { setConfirmDialog( { return false; }; - const handleOpenFilterDialog = async (filterOptions: FilterOption[], filters?: Filter[]) => { + const handleOpenFilterDialog = async (id: string, filterOptions: FilterOption[], filters?: Filter[]) => { setIsOpenFilterDialog(true); return new Promise((resolve) => { setFilterDialog( { } }; -const FilterOperator = ({ filter, setFilterOperator }: FilterOperatorProps) => { +const FilterOperator = ({ filter, operatorId, valueId, setFilterOperator }: FilterOperatorProps) => { const onChangeHandler = (event: ChangeEvent) => { setFilterOperator(filter, getOperationEnumValue(filter, event.target.value)); }; @@ -115,14 +115,14 @@ const FilterOperator = ({ filter, setFilterOperator }: FilterOperatorProps) => { return ( {getOperatorsByFilter(filter).map((item) => ( - + {/* TODO: do not forget localization here*/} {item} @@ -259,17 +259,17 @@ const FilterInput = ({ filter, setFilterValue }: FilterInputProps) => { ); }; -const FilterRow = ({ filter, closeHandler, setFilterOperator, setFilterValue }: FilterProps) => { +const FilterRow = ({ id, filter, closeHandler, setFilterOperator, setFilterValue }: FilterProps) => { return ( - {filter && } + {filter && } - {filter && } + {filter && } - closeHandler(filter)}> + closeHandler(filter)}> @@ -286,7 +286,7 @@ const Transition = forwardRef(function Transition( return ; }); -export const FilterDialog = ({ filters, filterOptions, resolve, open, handleClose }: FilterDialogProps) => { +export const FilterDialog = ({ id, filters, filterOptions, resolve, open, handleClose }: FilterDialogProps) => { const descriptionElementRef = useRef(null); const [tempFilters, setTempFilters] = useState(filters ?? []); const { t } = useTranslation(); @@ -350,6 +350,7 @@ export const FilterDialog = ({ filters, filterOptions, resolve, open, handleClos return ( - + { t('judo.modal.filter.label', { defaultValue: 'Filter' }) as string } @@ -381,6 +382,7 @@ export const FilterDialog = ({ filters, filterOptions, resolve, open, handleClos {tempFilters.map((filter) => ( { return { + id: filterOption.id, label: filterOption.label ?? filterOption.attributeName, onClick: () => setTempFilters((prevTempFilters) => [ ...prevTempFilters, { - id: prevTempFilters.length, + id: filterOption.id, + operationId: `${filterOption.id}-operation`, + valueId: `${filterOption.id}-value`, filterOption: { + id: `${filterOption.id}-option`, attributeName: filterOption.attributeName, label: filterOption.label, filterType: filterOption.filterType, @@ -423,14 +430,14 @@ export const FilterDialog = ({ filters, filterOptions, resolve, open, handleClos - { tempFilters.length > 0 && - } - diff --git a/judo-ui-react/src/main/resources/actor/src/components/dialog/RangeDialog.tsx.hbs b/judo-ui-react/src/main/resources/actor/src/components/dialog/RangeDialog.tsx.hbs index 3f0d78da..bd7cd1d7 100644 --- a/judo-ui-react/src/main/resources/actor/src/components/dialog/RangeDialog.tsx.hbs +++ b/judo-ui-react/src/main/resources/actor/src/components/dialog/RangeDialog.tsx.hbs @@ -28,6 +28,7 @@ import { useSnackbar } from '../../components'; import { useFilterDialog } from './hooks'; interface RangeDialogProps, U extends QueryCustomizer> { + id: string; resolve: (value: any) => void; open: boolean; handleClose: () => void; @@ -41,6 +42,7 @@ interface RangeDialogProps, U extends QueryCustomizer } export const RangeDialog = , U extends QueryCustomizer>({ + id, resolve, open, handleClose, @@ -255,9 +257,9 @@ export const RangeDialog = , U extends QueryCustomizer - { t('judo.modal.range.label', { defaultValue: 'Select' }) as string } - + + { t('judo.modal.range.label', { defaultValue: 'Select' }) as string } + , U extends QueryCustomizer ( - + + ); diff --git a/judo-ui-react/src/main/resources/actor/src/components/table/table-row-actions.tsx.hbs b/judo-ui-react/src/main/resources/actor/src/components/table/table-row-actions.tsx.hbs index 6c08d20d..600ff944 100644 --- a/judo-ui-react/src/main/resources/actor/src/components/table/table-row-actions.tsx.hbs +++ b/judo-ui-react/src/main/resources/actor/src/components/table/table-row-actions.tsx.hbs @@ -13,6 +13,7 @@ import { MdiIcon } from '../MdiIcon'; import { baseColumnConfig } from '../../config'; export const columnsActionCalculator: ColumnActionsProvider = ( + id: string, actions: TableRowAction[], options?: ColumnsActionsOptions, ): GridColDef[] => { @@ -26,21 +27,22 @@ export const columnsActionCalculator: ColumnActionsProvider = ( } if (shownActionsNumber < 0) { - return standaloneActions(actions, options); + return standaloneActions(id, actions, options); } else if (shownActionsNumber === 0) { return []; } else if (shownActionsNumber === 1) { - return dropdownActions(actions, options); + return dropdownActions(id, actions); } else { const sliceNumber = actions.length === shownActionsNumber ? shownActionsNumber : shownActionsNumber - 1; const standaloneRowActions = actions.slice(0, sliceNumber); const dropdownRowActions = actions.slice(sliceNumber); - return [...standaloneActions(standaloneRowActions, options), ...dropdownActions(dropdownRowActions, options)]; + return [...standaloneActions(id, standaloneRowActions, options), ...dropdownActions(id, dropdownRowActions)]; } }; const standaloneActions: ColumnActionsProvider = ( + id: string, actions: TableRowAction[], options?: ColumnsActionsOptions, ): GridColDef[] => { @@ -53,7 +55,7 @@ const standaloneActions: ColumnActionsProvider = ( type: 'actions', renderCell: (params: GridRenderCellParams) => { return ( - @@ -63,7 +65,7 @@ const standaloneActions: ColumnActionsProvider = ( }); }; -const dropdownActions: ColumnActionsProvider = (actions: TableRowAction[]): GridColDef[] => { +const dropdownActions: ColumnActionsProvider = (id: string, actions: TableRowAction[]): GridColDef[] => { if (actions.length === 0) return []; return [ @@ -76,10 +78,12 @@ const dropdownActions: ColumnActionsProvider = (actions: TableRowAction renderCell: (params: GridRenderCellParams) => { return ( { return { + id: action.id, label: action.label, startIcon: action.icon, onClick: () => action.action(params.row), diff --git a/judo-ui-react/src/main/resources/actor/src/components/widgets/TrinaryLogicCombobox.tsx.hbs b/judo-ui-react/src/main/resources/actor/src/components/widgets/TrinaryLogicCombobox.tsx.hbs index 7463b24e..e1646a4b 100644 --- a/judo-ui-react/src/main/resources/actor/src/components/widgets/TrinaryLogicCombobox.tsx.hbs +++ b/judo-ui-react/src/main/resources/actor/src/components/widgets/TrinaryLogicCombobox.tsx.hbs @@ -49,9 +49,9 @@ export const TrinaryLogicCombobox = ({ ), } } > - { t('judo.component.TrinaryLogic.true', { defaultValue: 'Yes' }) as string } - { t('judo.component.TrinaryLogic.false', { defaultValue: 'No' }) as string } - { t('judo.component.TrinaryLogic.unknown', { defaultValue: 'Unknown' }) as string } + { t('judo.component.TrinaryLogic.true', { defaultValue: 'Yes' }) as string } + { t('judo.component.TrinaryLogic.false', { defaultValue: 'No' }) as string } + { t('judo.component.TrinaryLogic.unknown', { defaultValue: 'Unknown' }) as string } ); }; diff --git a/judo-ui-react/src/main/resources/actor/src/fragments/action/range-call.fragment.hbs b/judo-ui-react/src/main/resources/actor/src/fragments/action/range-call.fragment.hbs index 2a6a5f24..b4efd39c 100644 --- a/judo-ui-react/src/main/resources/actor/src/fragments/action/range-call.fragment.hbs +++ b/judo-ui-react/src/main/resources/actor/src/fragments/action/range-call.fragment.hbs @@ -1,4 +1,5 @@ const {{ dataElement.name }}RangeCall = async () => openRangeDialog<{{ classDataName dataElement.target 'Stored' }}, {{ classDataName dataElement.target 'QueryCustomizer' }}>({ + id: '{{ createId dataElement }}', columns: {{ dataElement.name }}Columns, defaultSortField: {{ dataElement.name }}SortModel[0], rangeCall: async (queryCustomizer) => diff --git a/judo-ui-react/src/main/resources/actor/src/fragments/relation/column.fragment.hbs b/judo-ui-react/src/main/resources/actor/src/fragments/relation/column.fragment.hbs index e2b0179c..226f3d04 100644 --- a/judo-ui-react/src/main/resources/actor/src/fragments/relation/column.fragment.hbs +++ b/judo-ui-react/src/main/resources/actor/src/fragments/relation/column.fragment.hbs @@ -13,7 +13,7 @@ type: '{{ columnType column }}', align: 'center', renderCell: (params: GridRenderCellParams) => { return params.row.{{ column.attributeType.name }} - ? diff --git a/judo-ui-react/src/main/resources/actor/src/pages/access/table.hbs b/judo-ui-react/src/main/resources/actor/src/pages/access/table.hbs index e97dd7aa..118b1568 100644 --- a/judo-ui-react/src/main/resources/actor/src/pages/access/table.hbs +++ b/judo-ui-react/src/main/resources/actor/src/pages/access/table.hbs @@ -181,6 +181,7 @@ export default function {{ pageName page }}() { {{# each table.rowActions as |action| }} {{# if action.isDeleteAction }} { + id: '{{ createId action }}', label: t('judo.pages.table.delete', { defaultValue: 'Delete' }) as string, icon: , action: async (row: {{ classDataName table.dataElement.target 'Stored' }}) => {{ actionFunctionName action page }}({{# if (hasDataElementOwner action.dataElement) }}data, {{/ if }}row, () => fetchData()), @@ -189,6 +190,7 @@ export default function {{ pageName page }}() { {{/ if }} {{# if action.isCallOperationAction }} { + id: '{{ createId action }}', label: t('{{ idToTranslationKey action.fQName application }}', { defaultValue: '{{ action.label }}' }) as string, icon: , action: async (row: {{ classDataName table.dataElement.target 'Stored' }}) => {{ actionFunctionName action page }} ({{# if action.operation.isMapped }}row, {{/ if }}() => fetchData()), @@ -204,7 +206,7 @@ export default function {{ pageName page }}() { {{# each (getUniquePageActions page) as |action| }} {{# if action.isCreateAction }} - @@ -212,7 +214,7 @@ export default function {{ pageName page }}() { {{/ if }} {{# if action.isRefreshAction }} - @@ -225,7 +227,7 @@ export default function {{ pageName page }}() { - + row.__identifier} @@ -234,7 +236,7 @@ export default function {{ pageName page }}() { rowCount={rowCount} sortModel={sortModel} onSortModelChange={handleSortModelChange} - columns={[...columns, ...columnsActionCalculator(rowActions, { shownActions: 2 })]} + columns={[...columns, ...columnsActionCalculator('{{ createId page.dataElement }}', rowActions, { shownActions: 2 })]} {{# each (getUniquePageActions page) as |action| }} {{# if action.isViewAction }} onRowClick={ (params: GridRowParams<{{ classDataName page.dataElement.target 'Stored' }}>) => {{ actionFunctionName action page }}(params.row) } @@ -246,8 +248,9 @@ export default function {{ pageName page }}() { {{# each (getUniquePageActions page) as |action| }} {{# if action.isFilterAction }} @@ -276,7 +279,7 @@ export default function {{ pageName page }}() { {{# if page.relationType.isDeletable }} {!editMode && ( - @@ -286,7 +289,7 @@ export default function {{ pageName page }}() { {{# if page.relationType.isUpdatable }} {!editMode && ( - @@ -295,6 +298,7 @@ export default function {{ pageName page }}() { {editMode && ( diff --git a/judo-ui-react/src/main/resources/actor/src/pages/actions/action/add-action.tsx.hbs b/judo-ui-react/src/main/resources/actor/src/pages/actions/action/add-action.tsx.hbs index fb94a7c9..3a5cb8cc 100644 --- a/judo-ui-react/src/main/resources/actor/src/pages/actions/action/add-action.tsx.hbs +++ b/judo-ui-react/src/main/resources/actor/src/pages/actions/action/add-action.tsx.hbs @@ -59,6 +59,7 @@ export const {{ actionFunctionHookName action page }}: {{ actionFunctionTypeName }; const res = await openRangeDialog<{{ classDataName action.dataElement.target 'Stored' }}, {{ classDataName action.dataElement.target 'QueryCustomizer' }}>({ + id: '{{ createId action }}', columns, defaultSortField: sortModel[0], rangeCall: async (queryCustomizer) => diff --git a/judo-ui-react/src/main/resources/actor/src/pages/actions/action/call-operation-action/output-view/output-view.tsx.hbs b/judo-ui-react/src/main/resources/actor/src/pages/actions/action/call-operation-action/output-view/output-view.tsx.hbs index 33c46906..e2792df3 100644 --- a/judo-ui-react/src/main/resources/actor/src/pages/actions/action/call-operation-action/output-view/output-view.tsx.hbs +++ b/judo-ui-react/src/main/resources/actor/src/pages/actions/action/call-operation-action/output-view/output-view.tsx.hbs @@ -101,6 +101,7 @@ export function {{ pageName page }}({ close, result } : {{ pageName page }}Props {title} close() } sx={ { @@ -123,7 +124,7 @@ export function {{ pageName page }}({ close, result } : {{ pageName page }}Props - diff --git a/judo-ui-react/src/main/resources/actor/src/pages/actions/action/call-operation-action/without-input-form.fragment.hbs b/judo-ui-react/src/main/resources/actor/src/pages/actions/action/call-operation-action/without-input-form.fragment.hbs index df74f0d1..9d612090 100644 --- a/judo-ui-react/src/main/resources/actor/src/pages/actions/action/call-operation-action/without-input-form.fragment.hbs +++ b/judo-ui-react/src/main/resources/actor/src/pages/actions/action/call-operation-action/without-input-form.fragment.hbs @@ -31,6 +31,7 @@ return async function {{ actionFunctionName action page }} ({{# if action.operat }; const res = await openRangeDialog<{{ classDataName action.inputParameterPage.dataElement.target 'Stored' }}, {{ classDataName action.inputParameterPage.dataElement.target 'QueryCustomizer' }}>({ + id: '{{ createId action.inputParameterPage }}', columns, defaultSortField: sortModel[0], rangeCall: async (queryCustomizer) => await {{ classServiceName action.dataElement.owner }}Impl.getRangeFor{{ firstToUpper action.dataElement.name }}({{# if action.operation.isMapped }}owner{{ else }}undefined{{/ if }}, processQueryCustomizer(queryCustomizer)), diff --git a/judo-ui-react/src/main/resources/actor/src/pages/actions/action/filter-action.tsx.hbs b/judo-ui-react/src/main/resources/actor/src/pages/actions/action/filter-action.tsx.hbs index 98e06fac..0a2c46e8 100644 --- a/judo-ui-react/src/main/resources/actor/src/pages/actions/action/filter-action.tsx.hbs +++ b/judo-ui-react/src/main/resources/actor/src/pages/actions/action/filter-action.tsx.hbs @@ -7,17 +7,17 @@ import { useFilterDialog } from '{{ relativePathFromAction page action 'componen import type { Filter, FilterOption } from '{{ relativePathFromAction page action 'components-api' }}'; import { mapAllFiltersToQueryCustomizerProperties } from '{{ relativePathFromAction page action 'utilities' }}'; -export type {{ actionFunctionTypeName action page }} = (filterOptions: FilterOption[], filters: Filter[]) => Promise; +export type {{ actionFunctionTypeName action page }} = (id: string, filterOptions: FilterOption[], filters: Filter[]) => Promise; export const {{ actionFunctionHookName action page }} = ( setFilters: (filters: Filter[]) => void, setPage: (page: number) => void, setQueryCustomizer: Function, - openFilterDialog: (filterOptions: FilterOption[], filters: Filter[]) => Promise, + openFilterDialog: (id: string, filterOptions: FilterOption[], filters: Filter[]) => Promise, ): {{ actionFunctionTypeName action page }} => { - return async function {{ actionFunctionName action page }}(filterOptions: FilterOption[], filters: Filter[]) { - const newFilters = await openFilterDialog(filterOptions, filters); + return async function {{ actionFunctionName action page }}(id: string, filterOptions: FilterOption[], filters: Filter[]) { + const newFilters = await openFilterDialog(id, filterOptions, filters); const numberOfElements = 10; if (newFilters) { diff --git a/judo-ui-react/src/main/resources/actor/src/pages/actions/actionForm/createActionForm.tsx.hbs b/judo-ui-react/src/main/resources/actor/src/pages/actions/actionForm/createActionForm.tsx.hbs index 66f2fe1d..029c0843 100644 --- a/judo-ui-react/src/main/resources/actor/src/pages/actions/actionForm/createActionForm.tsx.hbs +++ b/judo-ui-react/src/main/resources/actor/src/pages/actions/actionForm/createActionForm.tsx.hbs @@ -76,6 +76,7 @@ import { baseTableConfig, baseColumnConfig, toastConfig, dividerHeight } from '{ {{# each table.rowActions as |action| }} {{# if action.isRemoveAction }} { + id: '{{ createId action }}', label: t('judo.pages.table.remove', { defaultValue: 'Remove' }) as string, icon: , action: async (row: {{ classDataName table.dataElement.target 'Stored' }}) => { @@ -131,6 +132,7 @@ import { baseTableConfig, baseColumnConfig, toastConfig, dividerHeight } from '{ {title} cancel() } sx={ { @@ -151,10 +153,10 @@ import { baseTableConfig, baseColumnConfig, toastConfig, dividerHeight } from '{ - - diff --git a/judo-ui-react/src/main/resources/actor/src/pages/actions/actionForm/operationInputActionForm.tsx.hbs b/judo-ui-react/src/main/resources/actor/src/pages/actions/actionForm/operationInputActionForm.tsx.hbs index ed024e8e..d9c30a47 100644 --- a/judo-ui-react/src/main/resources/actor/src/pages/actions/actionForm/operationInputActionForm.tsx.hbs +++ b/judo-ui-react/src/main/resources/actor/src/pages/actions/actionForm/operationInputActionForm.tsx.hbs @@ -80,6 +80,7 @@ import { baseTableConfig, baseColumnConfig, toastConfig } from '{{ relativePathF {{# each table.rowActions as |action| }} {{# if action.isRemoveAction }} { + id: '{{ createId action }}', label: t('judo.pages.table.remove', { defaultValue: 'Remove' }) as string, icon: , action: async (row: {{ classDataName table.dataElement.target 'Stored' }}) => { @@ -142,6 +143,7 @@ import { baseTableConfig, baseColumnConfig, toastConfig } from '{{ relativePathF {title} cancel() } sx={ { @@ -164,7 +166,7 @@ import { baseTableConfig, baseColumnConfig, toastConfig } from '{{ relativePathF - - @@ -213,7 +216,7 @@ export default function {{ pageName page }}() { {{# if page.dataElement.isDeletable }} {!editMode && ( - @@ -223,7 +226,7 @@ export default function {{ pageName page }}() { {{# if page.dataElement.isUpdatable }} {!editMode && ( - @@ -232,6 +235,7 @@ export default function {{ pageName page }}() { {editMode && ( diff --git a/judo-ui-react/src/main/resources/actor/src/pages/page-fallback.hbs b/judo-ui-react/src/main/resources/actor/src/pages/page-fallback.hbs index 6d14a1b7..8ee02d68 100644 --- a/judo-ui-react/src/main/resources/actor/src/pages/page-fallback.hbs +++ b/judo-ui-react/src/main/resources/actor/src/pages/page-fallback.hbs @@ -27,7 +27,9 @@ export default function {{ pageName page }}() { - + + Dashboard + ); diff --git a/judo-ui-react/src/main/resources/actor/src/pages/relation/table.hbs b/judo-ui-react/src/main/resources/actor/src/pages/relation/table.hbs index 402b72b8..e72cef32 100644 --- a/judo-ui-react/src/main/resources/actor/src/pages/relation/table.hbs +++ b/judo-ui-react/src/main/resources/actor/src/pages/relation/table.hbs @@ -185,6 +185,7 @@ export default function {{ pageName page }}() { {{# each table.rowActions as |action| }} {{# if action.isRemoveAction }} { + id: '{{ createId action }}', label: t('judo.pages.table.remove', { defaultValue: 'Remove' }) as string, icon: , action: async (row: {{ classDataName table.dataElement.target 'Stored' }}) => {{ actionFunctionName action page }}({ __signedIdentifier: signedIdentifier } as JudoIdentifiable<{{ classDataName table.dataElement.owner '' }}>, row, () => fetchData()), @@ -192,6 +193,7 @@ export default function {{ pageName page }}() { {{/ if }} {{# if action.isDeleteAction }} { + id: '{{ createId action }}', label: t('judo.pages.table.delete', { defaultValue: 'Delete' }) as string, icon: , action: async (row: {{ classDataName table.dataElement.target 'Stored' }}) => {{ actionFunctionName action page }}({ __signedIdentifier: signedIdentifier } as JudoIdentifiable<{{ classDataName table.dataElement.owner '' }}>, row, () => fetchData()), @@ -200,6 +202,7 @@ export default function {{ pageName page }}() { {{/ if }} {{# if action.isCallOperationAction }} { + id: '{{ createId action }}', label: t('{{ idToTranslationKey action.fQName application }}', { defaultValue: '{{ action.label }}' }) as string, icon: , action: async (row: {{ classDataName table.dataElement.target 'Stored' }}) => {{ actionFunctionName action page }} ({{# if action.operation.isMapped }}row, {{/ if }}() => fetchData()), @@ -214,7 +217,7 @@ export default function {{ pageName page }}() { {{# each (getUniquePageActions page) as |action| }} {{# if action.isRefreshAction }} - @@ -222,7 +225,7 @@ export default function {{ pageName page }}() { {{/ if }} {{# if action.isAddAction }} - @@ -230,7 +233,7 @@ export default function {{ pageName page }}() { {{/ if }} {{# if action.isClearAction }} - @@ -243,7 +246,7 @@ export default function {{ pageName page }}() { - + row.__identifier} @@ -252,7 +255,7 @@ export default function {{ pageName page }}() { rowCount={rowCount} sortModel={sortModel} onSortModelChange={handleSortModelChange} - columns={[...columns, ...columnsActionCalculator(rowActions, { shownActions: 2 })]} + columns={[...columns, ...columnsActionCalculator('{{ createId table.dataElement }}', rowActions, { shownActions: 2 })]} {{# each (getUniquePageActions page) as |action| }} {{# if action.isViewAction }} onRowClick={ (params: GridRowParams<{{ classDataName table.dataElement.target 'Stored' }}>) => {{ actionFunctionName action page }}(params.row) } @@ -264,8 +267,9 @@ export default function {{ pageName page }}() { {{# each (getUniquePageActions page) as |action| }} {{# if action.isFilterAction }} @@ -220,7 +223,7 @@ export default function {{ pageName page }}() { {{# if page.relationType.isDeletable }} {!editMode && ( - @@ -230,7 +233,7 @@ export default function {{ pageName page }}() { {{# if page.relationType.isUpdatable }} {!editMode && ( - @@ -239,6 +242,7 @@ export default function {{ pageName page }}() { {editMode && ( diff --git a/judo-ui-react/src/main/resources/actor/src/pages/widgets/actiongroup.hbs b/judo-ui-react/src/main/resources/actor/src/pages/widgets/actiongroup.hbs index 6f1908d2..a61796ac 100644 --- a/judo-ui-react/src/main/resources/actor/src/pages/widgets/actiongroup.hbs +++ b/judo-ui-react/src/main/resources/actor/src/pages/widgets/actiongroup.hbs @@ -4,7 +4,7 @@ {{# each (featuredActionsForActionGroup child) as |action| }} {{# if action.hiddenBy }}( !data.{{ action.hiddenBy.name }} }} && {{/ if }} -