ui5_easy_use
Version:
A utility package for UI5 projects
188 lines (122 loc) ⢠4.36 kB
Markdown
# ez5 š ā UI5 App Generator
**ez5** is an auto-generating UI5 package that helps you build UI5 applications faster and smarter by automating tedious setup processes and providing out-of-the-box utilities.
---
## ⨠Features
### š§ Init App
- **Main Structure**: Defines the overall app layout and routing logic.
- **Side Navigation + Home Page**: Built-in navigation with a tail section on the home page.
- **i18n + Dark Mode Toggle**: Easily switch languages and toggle between dark/light themes.
- **Restricted Page Access**: Control user access to pages based on their roles.
### ā Add Page
- Add new pages easily.
- Automatically registers new pages into `manifest.json` and `navList.json`.
- Instantly available in the side navigation menu.
### š¦ Insert Components
| Component | Description |
|----------|-------------|
| **Form** | Generates a form with validation, error display, and data binding. |
| **Table** | Adds a searchable, filterable, sortable table. |
| **Chart** | *(Coming Soon)* Interactive charts for your dashboards. |
### š Translate (i18n)
- Binds text for multi-language support.
- Includes a language switcher with simple configuration.
---
## š„ Installation
Run the CLI tool to configure the package:
```bash
npm install ui5_easy_use
node node_modules/ui5_easy_use/auto_add_json.js
npm run ez5
````
You will see the following menu:
```
## Init App š
## Add Page š
## Insert Components š§©
## Translate_i18n š
## Exit ā
```
---
## š Usage Guide
### 1ļøā£ Init App
> Defines base setup and enables routing and page access control.
* **Routing Options**:
* `f.route`: Flexible column layout (3-layout structure)
* `m.route`: Standard routing
* **Access Control**:
* **Define User Roles** in `webapp/ez5/helper/Env.js`
* **Assign Page Roles** in `webapp/model/rulesNavList.json`
* Classes Involved:
* `UserModel.js`
* `AuthService.js`
* `AccessControl.js`
* `PagesAccess.js`
* **Overwritten Files**:
* `Component.js`, `App.view.xml`, `App.controller.js`, etc.
* **New Files Added**:
* `SideNavigation.fragment.xml`, `navList.json`, `rulesNavList.json`, etc.
### 2ļøā£ Add Page
> Quickly add new pages with proper routing.
* **Templates**:
* Located at: `webapp/ez5/pagemt/`
* Supports: `Normal`, `Details`, `Details_details` layouts
* **Routing Type**:
* `m.route`: Basic single-page setup
* `f.route`: Supports nested views (List, Details, Sub-details)
### 3ļøā£ Insert Components
#### š Form
* **Location**: `webapp/ez5/Components/form`
* **Steps**:
1. Select Controller ā Update `this.autoG` inside `initialForm`
2. Select View ā Form auto-generated
#### š Table
* **Location**: `webapp/ez5/Components/table`
* **Steps**:
1. Select Controller ā Update `this.autoG` inside `initialTable`
2. Select View ā Table auto-generated
### 4ļøā£ Translate i18n
* **Instructions**:
* Use spacebar to select, `a` to toggle all, `i` to invert, and Enter to proceed.
* Select target folder ā i18n bindings added automatically.
---
## š Folder Structure Highlights
```plaintext
webapp/
āāā ez5/
ā āāā initapp/
ā āāā Components/
ā ā āāā form/
ā ā āāā table/
ā āāā auth/
ā āāā pagemt/
āāā model/
ā āāā navList.json
ā āāā rulesNavList.json
```
---
## š Role-Based Access Sample
```js
// webapp/ez5/auth/AccessControl.js
roleMatrix = {
normalAccess: ["normal", "admin"],
adminAccess: ["admin"]
}
// webapp/ez5/helper/Env.js
roles = ["normal", "admin"]
// webapp/model/rulesNavList.json
{
"AdminPage": ["adminAccess"],
"UserDashboard": ["normalAccess", "adminAccess"]
}
```
---
## š§ Notes
* Fully extensible and customizable.
* Works great for enterprise-ready Fiori apps.
* Ideal for both small projects and large-scale systems.
---
## š Maintainers
Developed and maintained with ā¤ļø by the [ez5 contributors](https://github.com/zyBinjabi/ui5_easy_use).
---
## š License
This project is licensed under the MIT License. See the [LICENSE](LICENSE) file for more info.