You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Too much code, e.g. when comparing to Vaadin screens (Entity entity = table.getSingleSelected())
It's not obvious that selected entity should be taken from items of useEntityList hook. Before found items of , I tried to use entityList and listQueryResult {data}
It would be nice to provide shorter API.
Example of usage:
function isDeactivateButtonDisabled() {
let selectedEntityId = entityListState.selectedEntityId;
const user = items?.find(i => i.id === selectedEntityId);
let currentUserName = mainStore.userName
return user == null || !user.active|| user.username === currentUserName
}
//...
<Button
htmlType="button"
style={{ margin: "0 12px 12px 0" }}
disabled={isDeactivateButtonDisabled()}
onClick={handleDeactivateBtnClick}
key="deactivate"
type="default"
>
<FormattedMessage id="users.deactivate"/>
</Button>
The text was updated successfully, but these errors were encountered:
To get currently selected item in browser screens (table, cards) I should write the following:
Problems:
Entity entity = table.getSingleSelected()
)items
of useEntityList hook. Before founditems
of , I tried to useentityList
andlistQueryResult {data}
It would be nice to provide shorter API.
Example of usage:
The text was updated successfully, but these errors were encountered: