
Research
Security News
Malicious PyPI Package Exploits Deezer API for Coordinated Music Piracy
Socket researchers uncovered a malicious PyPI package exploiting Deezer’s API to enable coordinated music piracy through API abuse and C2 server control.
@genesislcap/foundation-entity-management
Advanced tools
Genesis Foundation Entity Management
The Entity Management micro-front-end is used to connect to a resource on the back end and manage it from the front end. Handlers can be set up for create, update, and delete events; after adding an event, a button appears to perform the action. There is a list of pre-defined events and resources to manage, but you can manage custom resources that you create on the back-end too.
:::tip The buttons are conditionally accessed, based on the specified events. For example, if the current user is only able to edit the entities, then you should only set the edit event on the entity-manager - you need to conditionally set the events based on user authorisations. :::
Two core components are used to manage the entities - the grid and the form. The grid contains an entity on each row and data in each column.
Example grid used to manage counterparties
The other component is the form, and this is used to update an existing entity or create a new one. An example form is shown here.
To enable this micro-front-end in your application, follow the steps below.
@genesislcap/foundation-entity-management
as a dependency in your package.json file. Whenever you change the dependencies of your project, ensure you run the $ npm run bootstrap
command again. For more info see the package.json basics page.{
...
"dependencies": {
"@genesislcap/foundation-entity-management": "latest"
},
...
}
// Import
import { EntityManagement, } from '@genesislcap/foundation-entity-management';
// Declare class
EntityManagement;
// Example html with the entity management used in two different tabs to manage two
// different resources - one managing the counterpartys, and one managing the users.
export const AdminTemplate: ViewTemplate = html`
<zero-tabs>
<zero-tab-panel slot="tabpanel">
<zero-error-boundary>
<entity-management
resourceName="ALL_COUNTERPARTYS"
title="Counterparty Management"
updateEvent="EVENT_COUNTERPARTY_MODIFY"
deleteEvent="EVENT_COUNTERPARTY_DELETE"
createEvent="EVENT_COUNTERPARTY_INSERT"
></entity-management>
</zero-error-boundary>
</zero-tab-panel>
<zero-tab-panel slot="tabpanel">
<zero-error-boundary>
<entity-management
resourceName="ALL_USERS"
title="User Management"
updateEvent="EVENT_AMEND_USER"
deleteEvent="EVENT_DELETE_USER"
createEvent="EVENT_INSERT_USER"
></entity-management>
</zero-error-boundary>
</zero-tab-panel>
</zero-tabs>
`;
The functionality of the Entity Manager is customised through the properties you set on it in the HTML. This section covers the main properties that you need to customise. For a full list of all of the properties, see here.
title
customises the title of the entity list so that the user can see what resource they are managing.
resourceName
refers to the name of either a DATASERVER
query, a ReqRep
definition or a specific EVENT_HANDLER
. This essentially is the resource to be managed. In the above example, we use ALL_COUNTERPARTYS
which is a SDATASERVER
query, as, by convention, they all start with ALL_
.
createEvent
, updateEvent
, deleteEvent
are set to be the events on the back end that handle the specific actions, such as deleting counterparty data. For the create and update functionality, these also define the resource in which the form is populated when the user is creating or updating an entity. After adding an event, a button for performing the selected action appears.
Set this object to configure how the Entity Manager interacts with the resource. See here.
persist-column-state-key
is a string value. It is used to control how the column states are persisted through actions such as page changes or refreshes. If no persist-column-state-key
property is set, then the behaviour will be to not persist the column state, and the grid will revert back to its default state every time the user navigates away from it.
:::warning The string defines the key in which the serialised state of the columns is stored in an object in session storage. Therefore, if you are setting multiple Entity Managers in your application to persist the state you need to use unique keys or you will get undefined behaviour. :::
The User Management micro front-end is used to manage the users on the front end. Two core components are used to manage the entities:
The grid contains an entity on each row and data in each column.
:::info
User Management is a concrete use case of the Entity Management micro front-end, which is provided as part of foundation-ui
.
:::
Here is an example grid view for managing users:
To enable this micro-front-end in your application, follow the steps below:
@genesislcap/foundation-entity-management
as a dependency in your package.json file. Whenever you change the dependencies of your project, ensure you run the $ npm run bootstrap
command again. You can find more information in the package.json basics page.{
...
"dependencies": {
"@genesislcap/foundation-entity-management": "latest"
},
...
}
// Import
import { Users, } from '@genesislcap/foundation-entity-management';
// Declare class
Users;
// Example html with the user management
// You can customise this with additional fields, see futher in this documentation
export const AdminTemplate: ViewTemplate = html`
<zero-tabs>
<zero-tab-panel slot="tabpanel">
<zero-error-boundary>
<user-management></user-management>
</zero-error-boundary>
</zero-tab-panel>
</zero-tabs>
`;
You can customise the functionality of User Management through the properties you set in the html. This section covers the main properties that you can customise. For a full list of all of the properties, see here.
The primary way to configure the User Management functionality is via the columns that are displayed on the grid.
// Default usage, will contain the "default" columns:
// username, first name, last name, email, last login
// as well as the additional entity and status columns
<user-management></user-management>
The default columns are contained in the UserColumnConfig variable. The Entity
and Status
columns are always added to the grid.
To configure the columns yourself, set the columns
attribute when you define the User Management in the html. You can mix in your custom column config with the default user columns config, using the javascript spread
operator.
// Custom usage, will contain the "default" columns:
// username, first name, last name, email, last login
// the custom "userColumns"
// as well as the additional entity and status columns
<user-management :columns=${() => [...UsersColumnConfig, ...userColumns]}>
</user-management>
To see a more verbose version of this example, see the second example here.
In contrast to Entity Management, we have a different way of displaying buttons and performing actions here. In this case, they are displayed if the user has the appropriate permissions from the server.
INSERT_USER
- the user can add new usersDELETE_USER
- the user can delete usersAMEND_USER
- the user can update existing userspersist-column-state-key
is a string value, which is used to control how the column states are persisted through actions such as page changes or refreshes. When using this micro front-end, it is set to entity_profiles_management
.
:::info
For more info on persist-column-state-key
see the section in the entity management.
:::
The Profile Management micro-front-end is used to manage the profiles on the front end. Two core components are used to manage the profiles - the grid and the form.
:::info
Profile Management is a concrete use case of the Entity Management micro front-end, which is provided as part of foundation-ui
.
:::
Example grid view when managing profiles.
To enable this micro-front-end in your application, follow the steps below.
@genesislcap/foundation-entity-management
as a dependency in your package.json file. Whenever you change the dependencies of your project, ensure you run the bootstrap command again. You can find more information in the package.json basics page.{
...
"dependencies": {
"@genesislcap/foundation-entity-management": "latest"
},
...
}
// Import
import { Profiles } from '@genesislcap/foundation-entity-management';
// Declare class
Profiles;
// Example html with the profile management
export const AdminTemplate: ViewTemplate = html`
<zero-tabs>
<zero-tab-panel slot="tabpanel">
<zero-error-boundary>
<profile-management></profile-management>
</zero-error-boundary>
</zero-tab-panel>
</zero-tabs>
`;
The functionality of the profile manager is customised through the properties you set in the html. This section covers the main properties that you will want to customise. For a full list of all of the properties, see here.
In contrast to Entity Management, we have a different way of displaying buttons and performing actions here. In this case, they are displayed if the user has the appropriate permissions from the server.
INSERT_PROFILE
- the user can add new profilesDELETE_PROFILE
- the user can delete profilesAMEND_PROFILE
- the user can update existing profilespersist-column-state-key
is a string value which is used to control how the column states are persisted through actions such as page changes or refreshes. If no persist-column-state-key
property is set, then the behaviour will be to not persist the column state, and the grid will revert back to its default state every time the user navigates away from it.
:::info
For more information on persist-column-state-key
see the section in the Entity Management page.
:::
Note: this project provides front end dependencies and uses licensed components listed in the next section, thus licenses for those components are required during development. Contact Genesis Global for more details.
FAQs
Genesis Foundation Entity Management
The npm package @genesislcap/foundation-entity-management receives a total of 1,494 weekly downloads. As such, @genesislcap/foundation-entity-management popularity was classified as popular.
We found that @genesislcap/foundation-entity-management demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket researchers uncovered a malicious PyPI package exploiting Deezer’s API to enable coordinated music piracy through API abuse and C2 server control.
Research
The Socket Research Team discovered a malicious npm package, '@ton-wallet/create', stealing cryptocurrency wallet keys from developers and users in the TON ecosystem.
Security News
Newly introduced telemetry in devenv 1.4 sparked a backlash over privacy concerns, leading to the removal of its AI-powered feature after strong community pushback.