UNPKG

ui5_easy_use

Version:
188 lines (122 loc) • 4.36 kB
# 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.