{ "tech": "angularnew", "object_type": "form", "sub_object_type": "only header", "example_entity": "Product", "git_repo": "http://157.66.191.31:3000/risadmin_prod/authsec_testangular.git", "git_branch": "main", "ref_folder": "frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/io8.ref", "targets": [ { "profile": "route", "file": "frontend/angular-clarity-master/src/app/modules/main/main-routing.module.ts", "anchor": "// buildercomponents", "dedup": "{{Table}}Component", "import_tpl": "import { {{Table}}Component } from './BuilderComponents/{{repo}}/{{Table}}/{{Table}}.component';", "body_tpl": " { path: '{{table_lower}}', component: {{Table}}Component },", "add": "{ path: '{{table_lower}}', component: {{Table}}Component }," }, { "profile": "plain", "file": "frontend/angular-clarity-master/src/app/modules/main/main.module.ts", "anchor": "// buildercomponents", "dedup": "{{Table}}Component", "import_tpl": "import { {{Table}}Component } from './BuilderComponents/{{repo}}/{{Table}}/{{Table}}.component';", "body_tpl": " {{Table}}Component,", "add": " {{Table}}Component," } ], "files": [ { "source_ref": "frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/io8.ref/product/Product.component.ts", "path_tpl": "frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/{{REPO}}/{{TABLE}}/{{TABLE}}.component.ts", "description": "Component TypeScript file", "content_tpl": "import { Component, OnInit } from '@angular/core';\nimport { ToastrService } from 'ngx-toastr';\nimport { ActivatedRoute, Router } from '@angular/router';\nimport { {{TABLE}}Service } from './{{TABLE}}.service';\nimport { ApiRequestService } from 'src/app/services/api/api-request.service';\n\n@Component({\n selector: 'app-{{TABLE_LOWER}}',\n templateUrl: './{{TABLE}}.component.html',\n styleUrls: ['./{{TABLE}}.component.scss']\n})\nexport class {{TABLE}}Component implements OnInit {\n rowSelected: any = {};\n modaldelete = false;\n modalEdit = false;\n modalAdd = false;\n loading = false;\n items: any[] = [];\n selected: any[] = [];\n error: string;\n/* {{RELATION_DECLARATIONS}} */\n\n constructor(\n private mainService: {{TABLE}}Service,\n private apiRequest: ApiRequestService,\n private toastr: ToastrService,\n private router: Router,\n private route: ActivatedRoute\n ) { }\n\n ngOnInit(): void {\n this.getData();\n/* {{RELATION_LOADERS}} */\n }\n\n getColumns(): string[] {\n if (!this.items || this.items.length === 0) {\n return [];\n }\n return Object.keys(this.items[0]).filter(k => k !== 'id');\n }\n\n getData() {\n this.loading = true;\n this.mainService.getAll().subscribe((data) => {\n this.loading = false;\n this.items = data || [];\n if (this.items.length === 0) {\n this.error = 'No Data Available';\n }\n }, (error) => {\n this.loading = false;\n this.error = 'Server Error';\n });\n }\n\n goToAdd() {\n this.rowSelected = {};\n this.modalAdd = true;\n }\n\n onEdit(row: any) {\n this.rowSelected = Object.assign({}, row);\n this.modalEdit = true;\n }\n\n onDelete(row: any) {\n this.rowSelected = row;\n this.modaldelete = true;\n }\n\n delete(id: number) {\n this.modaldelete = false;\n this.mainService.delete(id).subscribe(() => {\n this.toastr.success('Deleted successfully');\n this.getData();\n }, (error) => {\n this.toastr.error('Failed to delete');\n });\n }\n\n onCreate() {\n this.modalAdd = false;\n this.mainService.create(this.rowSelected).subscribe(() => {\n this.toastr.success('Added successfully');\n this.getData();\n }, (error) => {\n this.toastr.error('Failed to add');\n });\n }\n\n onUpdate(id: number) {\n this.modalEdit = false;\n this.mainService.update(id, this.rowSelected).subscribe(() => {\n this.toastr.success('Updated successfully');\n this.getData();\n }, (error) => {\n this.toastr.error('Failed to update');\n });\n }\n}\n" }, { "source_ref": "frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/io8.ref/product/Product.component.html", "path_tpl": "frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/{{REPO}}/{{TABLE}}/{{TABLE}}.component.html", "description": "Component HTML template", "content_tpl": "
    \n
  1. \n
  2. {{TABLE}}
  3. \n
\n\n
\n
\n
\n

{{TABLE}} Management

\n
\n
\n \n
\n
\n\n \n \n \n \n Loading ...\n \n
{{error}}
\n
\n\n \n \n {{ col | titlecase }}\n \n\n \n \n Action\n \n \n\n \n \n{{LIST_ITEMS}}\n \n \n \n \n \n \n \n \n\n \n \n \n \n \n\n \n \n Items per page\n {{pagination.firstItem + 1}} - {{pagination.lastItem + 1}} of {{pagination.totalItems}} items\n \n \n
\n
\n\n\n\n

Add {{TABLE}}

\n
\n
\n
\n{{FORM_FIELDS}}\n
\n
\n
\n
\n \n \n
\n
\n\n\n\n

Edit {{TABLE}} (ID: {{rowSelected.id}})

\n
\n
\n
\n{{FORM_FIELDS}}\n
\n
\n
\n
\n \n \n
\n
\n\n\n\n

Confirm Delete

\n
\n

Are you sure you want to delete this record (ID: {{rowSelected.id}})?

\n
\n
\n \n \n
\n
\n" }, { "source_ref": "frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/io8.ref/product/Product.component.scss", "path_tpl": "frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/{{REPO}}/{{TABLE}}/{{TABLE}}.component.scss", "description": "Component stylesheet", "content_tpl": ".dg-wrapper {\n margin-top: 15px;\n}\n.heading {\n font-weight: 500;\n margin-bottom: 12px;\n}\n" }, { "source_ref": "frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/io8.ref/product/Product.service.ts", "path_tpl": "frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/{{REPO}}/{{TABLE}}/{{TABLE}}.service.ts", "description": "Component Service file", "content_tpl": "import { Injectable } from '@angular/core';\nimport { Observable } from 'rxjs';\nimport { HttpClient } from '@angular/common/http';\nimport { ApiRequestService } from 'src/app/services/api/api-request.service';\n\n@Injectable({\n providedIn: 'root'\n})\nexport class {{TABLE}}Service {\n private baseURL = '{{REPO}}/{{TABLE}}';\n\n constructor(\n private http: HttpClient,\n private apiRequest: ApiRequestService\n ) { }\n\n getAll(page?: number, size?: number): Observable {\n return this.apiRequest.get(this.baseURL);\n }\n\n getById(id: number): Observable {\n const _http = this.baseURL + '/' + id;\n return this.apiRequest.get(_http);\n }\n\n create(data: any): Observable {\n return this.apiRequest.post(this.baseURL, data);\n }\n\n update(id: number, data: any): Observable {\n const _http = this.baseURL + '/' + id;\n return this.apiRequest.put(_http, data);\n }\n\n delete(id: number): Observable {\n const _http = this.baseURL + '/' + id;\n return this.apiRequest.delete(_http);\n }\n}\n" } ], "datatypes": [ { "key": "textfield", "your_code": "
\n \n \n \n \n
" }, { "key": "number", "your_code": "
\n \n \n \n \n
" }, { "key": "phone", "your_code": "
\n \n \n \n \n
" }, { "key": "paragraph", "your_code": "
\n \n \n \n \n
" }, { "key": "password", "your_code": "
\n \n \n \n \n
" }, { "key": "textarea", "your_code": "
\n \n \n \n \n
" }, { "key": "date", "your_code": "
\n \n \n \n \n
" }, { "key": "datetime", "your_code": "
\n \n \n \n \n
" }, { "key": "email", "your_code": "
\n \n \n \n \n
" }, { "key": "toggle_switch", "your_code": "
\n \n \n \n \n
" }, { "key": "url_field", "your_code": "
\n \n \n \n \n
" }, { "key": "decimal", "your_code": "
\n \n \n \n \n
" }, { "key": "percentage", "your_code": "
\n \n \n \n \n
" }, { "key": "recaptcha", "your_code": "
\n
\n [reCAPTCHA Verification: {{label}}]\n
\n
" }, { "key": "document_seq", "your_code": "
\n \n \n \n \n
" }, { "key": "userid", "your_code": "
\n \n \n \n \n
" }, { "key": "header_field", "your_code": "
\n

{{label}}

\n
" }, { "key": "select_field", "your_code": "
\n \n \n \n \n
" }, { "key": "radio_field", "your_code": "
\n \n \n \n \n \n \n \n
" }, { "key": "checkbox", "your_code": "
\n \n \n \n \n
" }, { "key": "fileupload", "your_code": "
\n \n
" }, { "key": "imageupload", "your_code": "
\n \n
" }, { "key": "audio_field", "your_code": "
\n \n
" }, { "key": "video_field", "your_code": "
\n \n
" }, { "key": "button_field", "your_code": "
\n \n
" }, { "key": "survey_field", "your_code": "
\n \n \n \n \n
" }, { "key": "field_group", "your_code": "
\n
\n
{{label}}
\n
\n
" }, { "key": "relationship", "your_code": "
\n \n \n \n \n
" }, { "key": "currency", "your_code": "
\n \n \n \n \n
" }, { "key": "value_list", "your_code": "
\n \n \n \n \n
" }, { "key": "qr_code", "your_code": "
\n \n \n \n \n
\n \n
\n
" }, { "key": "bar_code", "your_code": "
\n \n \n \n \n
\n \n
\n
" }, { "key": "calculated_field", "your_code": "
\n \n \n \n \n
" }, { "key": "data_grid", "your_code": "
\n \n \n Name\n No {{label}} records added\n \n
" }, { "key": "dependent_dropdown", "your_code": "
\n \n \n \n \n
" }, { "key": "relation", "your_code": "
\n \n \n \n \n
" } ], "list_item_tpl": " {{item.{{fieldName}}}}\n", "ref_files": [ { "name": "Product.component.scss", "path": "frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/io8.ref/product/Product.component.scss", "default_target": "frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/{{REPO}}/{{TABLE}}/{{TABLE}}.component.scss", "content": ".dg-wrapper {\n margin-top: 15px;\n}\n.heading {\n font-weight: 500;\n margin-bottom: 12px;\n}\n" }, { "name": "Product.component.html", "path": "frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/io8.ref/product/Product.component.html", "default_target": "frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/{{REPO}}/{{TABLE}}/{{TABLE}}.component.html", "content": "
    \n
  1. \n
  2. {{TABLE}}
  3. \n
\n\n
\n
\n
\n

{{TABLE}} Management

\n
\n
\n \n
\n
\n\n \n \n \n \n Loading ...\n \n
{{error}}
\n
\n\n \n \n {{ col | titlecase }}\n \n\n \n \n Action\n \n \n\n \n \n{{LIST_ITEMS}}\n \n \n \n \n \n \n \n \n\n \n \n \n \n \n\n \n \n Items per page\n {{pagination.firstItem + 1}} - {{pagination.lastItem + 1}} of {{pagination.totalItems}} items\n \n \n
\n
\n\n\n\n

Add {{TABLE}}

\n
\n
\n
\n{{FORM_FIELDS}}\n
\n
\n
\n
\n \n \n
\n
\n\n\n\n

Edit {{TABLE}} (ID: {{rowSelected.id}})

\n
\n
\n
\n{{FORM_FIELDS}}\n
\n
\n
\n
\n \n \n
\n
\n\n\n\n

Confirm Delete

\n
\n

Are you sure you want to delete this record (ID: {{rowSelected.id}})?

\n
\n
\n \n \n
\n
\n" }, { "name": "Product.service.ts", "path": "frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/io8.ref/product/Product.service.ts", "default_target": "frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/{{REPO}}/{{TABLE}}/{{TABLE}}.service.ts", "content": "import { Injectable } from '@angular/core';\nimport { Observable } from 'rxjs';\nimport { HttpClient } from '@angular/common/http';\nimport { ApiRequestService } from 'src/app/services/api/api-request.service';\n\n@Injectable({\n providedIn: 'root'\n})\nexport class {{TABLE}}Service {\n private baseURL = '{{REPO}}/{{TABLE}}';\n\n constructor(\n private http: HttpClient,\n private apiRequest: ApiRequestService\n ) { }\n\n getAll(page?: number, size?: number): Observable {\n return this.apiRequest.get(this.baseURL);\n }\n\n getById(id: number): Observable {\n const _http = this.baseURL + '/' + id;\n return this.apiRequest.get(_http);\n }\n\n create(data: any): Observable {\n return this.apiRequest.post(this.baseURL, data);\n }\n\n update(id: number, data: any): Observable {\n const _http = this.baseURL + '/' + id;\n return this.apiRequest.put(_http, data);\n }\n\n delete(id: number): Observable {\n const _http = this.baseURL + '/' + id;\n return this.apiRequest.delete(_http);\n }\n}\n" }, { "name": "Product.component.ts", "path": "frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/io8.ref/product/Product.component.ts", "default_target": "frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/{{REPO}}/{{TABLE}}/{{TABLE}}.component.ts", "content": "import { Component, OnInit } from '@angular/core';\nimport { ToastrService } from 'ngx-toastr';\nimport { ActivatedRoute, Router } from '@angular/router';\nimport { {{TABLE}}Service } from './{{TABLE}}.service';\nimport { ApiRequestService } from 'src/app/services/api/api-request.service';\n\n@Component({\n selector: 'app-{{TABLE_LOWER}}',\n templateUrl: './{{TABLE}}.component.html',\n styleUrls: ['./{{TABLE}}.component.scss']\n})\nexport class {{TABLE}}Component implements OnInit {\n rowSelected: any = {};\n modaldelete = false;\n modalEdit = false;\n modalAdd = false;\n loading = false;\n items: any[] = [];\n selected: any[] = [];\n error: string;\n/* {{RELATION_DECLARATIONS}} */\n\n constructor(\n private mainService: {{TABLE}}Service,\n private apiRequest: ApiRequestService,\n private toastr: ToastrService,\n private router: Router,\n private route: ActivatedRoute\n ) { }\n\n ngOnInit(): void {\n this.getData();\n/* {{RELATION_LOADERS}} */\n }\n\n getColumns(): string[] {\n if (!this.items || this.items.length === 0) {\n return [];\n }\n return Object.keys(this.items[0]).filter(k => k !== 'id');\n }\n\n getData() {\n this.loading = true;\n this.mainService.getAll().subscribe((data) => {\n this.loading = false;\n this.items = data || [];\n if (this.items.length === 0) {\n this.error = 'No Data Available';\n }\n }, (error) => {\n this.loading = false;\n this.error = 'Server Error';\n });\n }\n\n goToAdd() {\n this.rowSelected = {};\n this.modalAdd = true;\n }\n\n onEdit(row: any) {\n this.rowSelected = Object.assign({}, row);\n this.modalEdit = true;\n }\n\n onDelete(row: any) {\n this.rowSelected = row;\n this.modaldelete = true;\n }\n\n delete(id: number) {\n this.modaldelete = false;\n this.mainService.delete(id).subscribe(() => {\n this.toastr.success('Deleted successfully');\n this.getData();\n }, (error) => {\n this.toastr.error('Failed to delete');\n });\n }\n\n onCreate() {\n this.modalAdd = false;\n this.mainService.create(this.rowSelected).subscribe(() => {\n this.toastr.success('Added successfully');\n this.getData();\n }, (error) => {\n this.toastr.error('Failed to add');\n });\n }\n\n onUpdate(id: number) {\n this.modalEdit = false;\n this.mainService.update(id, this.rowSelected).subscribe(() => {\n this.toastr.success('Updated successfully');\n this.getData();\n }, (error) => {\n this.toastr.error('Failed to update');\n });\n }\n}\n" } ], "check_command": "" }