This commit is contained in:
string 2025-05-16 15:05:48 +05:30
parent 4013e475cc
commit f43ea4fa7f
19 changed files with 1505 additions and 756 deletions

View File

@ -1,10 +1,10 @@
import { Component, OnInit } from '@angular/core';
import { Router } from '@angular/router';
import { LoginService } from '../../../services/api/login.service';
import { ActivatedRoute} from '@angular/router';
import { ActivatedRoute } from '@angular/router';
import { HttpErrorResponse } from '@angular/common/http';
import { ToastrService } from 'ngx-toastr';
import{environment} from 'src/environments/environment';
import { environment } from 'src/environments/environment';
// import { ExtendedLoginEnvironment, LoginEnvironment } from './login_environment';
//import { UserRegistrationService } from 'src/app/services/api/user-registration.service';
import { LoginEnvironment } from './login_environment';
@ -19,24 +19,6 @@ export class LoginPageComponent implements OnInit {
loginEnvironment = LoginEnvironment;
showLogin2 = true;
// loginEnvironment: LoginEnvironment = {
// companyName: 'io8.dev',
// imagePath: '../../../../assets/images/new.png',
// fpass: 'forgot password',
// isSignup: true,
// // template:'',
// };
// loginEnvironment: ExtendedLoginEnvironment = {
// companyName: 'io8.dev',
// imagePath: '../../../../assets/images/new.png',
// fpass: 'Forgot Password?',
// isSignup: true // or false based on your requirement
// };
email = '';
password = '';
@ -46,7 +28,7 @@ export class LoginPageComponent implements OnInit {
errMsg: string = '';
constructor(
private router: Router,
private route:ActivatedRoute,
private route: ActivatedRoute,
private loginService: LoginService,
private toastr: ToastrService,
) { }
@ -98,9 +80,9 @@ export class LoginPageComponent implements OnInit {
);
}
goaccount(){
goaccount() {
}
goforgotpass(){
goforgotpass() {
this.router.navigate(["../forgotpass"], { relativeTo: this.route });
}

View File

@ -4,7 +4,7 @@ export const LoginEnvironment = {
"templateNo": "Template 1",
"loginHeading": "Welcome to",
"loginHeading2": "io8.dev",
"loginHeading2": "Visa App",
"isSignup": "true",
"loginSignup": "Use your ID to sign in OR ",
"loginSignup2": "create one now",

View File

@ -1,4 +1,3 @@
<ol class="breadcrumb breadcrumb-arrow font-trirong">
<li><a href="javascript://" [routerLink]="['/cns-portal/dashboard/order']"><clr-icon shape="home"></clr-icon></a></li>
<li><a href="javascript://"><clr-icon shape="lock"></clr-icon>{{ 'SECURITY' | translate }}</a></li>
@ -6,37 +5,38 @@
</ol>
<!-- <div class="clr-row">
<!-- <div class="clr-row">
<div class="clr-col-12" style="text-align: right;">
<button id="add" *ngIf="mcreate == 'true'" class="btn btn-primary" (click)="goToAdd()">
<clr-icon shape="plus"></clr-icon>ADD New
</button>
</div>
</div> -->
<div class="clr-row" style="margin-top: 15px;">
<div class="clr-col">
<h3 style="font-weight: 300;display: inline;">{{ 'MENU_MAINTENANCE' | translate }} </h3>
<span class="label label-light-blue" style="display: inline;margin-left: 30px;">{{ 'MAIN_MENU' | translate }}</span><br>
<div class="clr-row" style="margin-top: 15px;">
<div class="clr-col">
<h3 style="font-weight: 300;display: inline;">{{ 'MENU_MAINTENANCE' | translate }} </h3>
<span class="label label-light-blue" style="display: inline;margin-left: 30px;">{{ 'MAIN_MENU' | translate
}}</span><br>
</div>
<div class="clr-col" style="text-align: right;">
<div class="btn-group">
<button class="btn text-dark" (click)="downloadFiles()"><b>{{ 'DOWNLOAD_TEMPLATE' | translate }}</b></button>
</div>
<div class="clr-col" style="text-align: right;">
<div class="btn-group">
<button class="btn text-dark" (click)="downloadFiles()"><b>{{ 'DOWNLOAD_TEMPLATE' | translate }}</b></button>
</div>
<button class="btn btn-primary" (click)="csvImport()">{{ 'IMPORT' | translate }}</button>
<button class="btn btn-outline" (click)="onExport()">
<clr-icon shape="export"></clr-icon> {{ 'EXPORT_XLSX' | translate }}
</button>
<button id="add" class="btn btn-primary" (click)="goToAdd()">
<clr-icon shape="plus"></clr-icon> {{ 'ADD' | translate }}
</button>
</div>
<button id="add" class="btn btn-primary" (click)="goToAdd()">
<clr-icon shape="plus"></clr-icon> {{ 'ADD' | translate }}
</button>
</div>
</div>
<!-- <table class="table">
<!-- <table class="table">
<thead>
<tr>
<th>NO.</th>
@ -144,298 +144,269 @@
</tbody>
</table> -->
<clr-datagrid [clrDgLoading]="loading" [(clrDgSelected)]="selected">
<clr-dg-placeholder><ng-template #loadingSpinner><clr-spinner>{{'LOADING'|translate}} ... </clr-spinner></ng-template>
<div *ngIf="error;else loadingSpinner">{{error}}</div></clr-dg-placeholder>
<clr-dg-column [clrDgField]="''" style="max-width: 40px;">
<ng-container *clrDgHideableColumn="{hidden: false}"></ng-container>
</clr-dg-column>
<clr-dg-column>
<ng-container *clrDgHideableColumn="{hidden: false}">
{{'NO' | translate}}
</ng-container>
</clr-dg-column>
<clr-dg-column>
<ng-container *clrDgHideableColumn="{hidden: false}">
{{'MENU_ITEM_NAME' | translate}}
</ng-container>
</clr-dg-column>
<clr-dg-column>
<ng-container *clrDgHideableColumn="{hidden: false}">
{{'ID' | translate}}
</ng-container>
</clr-dg-column>
<clr-dg-column>
<ng-container *clrDgHideableColumn="{hidden: false}">
{{'SEQUENCE' | translate}}
</ng-container>
</clr-dg-column>
<clr-dg-column>
<ng-container *clrDgHideableColumn="{hidden: false}">
{{'MODULE_NAME' | translate}}
</ng-container>
</clr-dg-column>
<clr-dg-column>
<ng-container *clrDgHideableColumn="{hidden: false}">
{{'MENU_ACTION_LINK' | translate}}
</ng-container>
</clr-dg-column>
<clr-dg-column>
<ng-container *clrDgHideableColumn="{hidden: false}">
{{'STATUS' | translate}}
</ng-container>
</clr-dg-column>
<clr-dg-column>
<ng-container *clrDgHideableColumn="{hidden: false}">
{{'SUB_MENU' | translate}}
</ng-container>
</clr-dg-column>
<clr-dg-column>
<ng-container *clrDgHideableColumn="{hidden: false}">
<clr-icon shape="bars"></clr-icon>
{{'ACTION' | translate}}
</ng-container>
</clr-dg-column>
<clr-datagrid [clrDgLoading]="loading" [(clrDgSelected)]="selected">
<clr-dg-placeholder><ng-template #loadingSpinner><clr-spinner>{{'LOADING'|translate}} ... </clr-spinner></ng-template>
<div *ngIf="error;else loadingSpinner">{{error}}</div>
</clr-dg-placeholder>
<clr-dg-column [clrDgField]="''" style="max-width: 40px;">
<ng-container *clrDgHideableColumn="{hidden: false}"></ng-container>
</clr-dg-column>
<clr-dg-row *clrDgItems="let user of menus;let i = index" [clrDgItem]="user">
<clr-dg-cell style="max-width: 40px;">
<span style="cursor: pointer;"><clr-icon shape="edit" (click)="goToEdit(user)" class="red is-error" style="color:red;"></clr-icon></span>
</clr-dg-cell>
<clr-dg-cell >{{i+1}}</clr-dg-cell>
<clr-dg-cell>{{user.menuItemDesc}}</clr-dg-cell>
<clr-dg-cell >{{user.menuId}}</clr-dg-cell>
<clr-dg-cell >{{user.itemSeq}}</clr-dg-cell>
<clr-dg-cell > {{user.moduleName}} </clr-dg-cell>
<clr-dg-cell > {{user.main_menu_action_name}}</clr-dg-cell>
<clr-dg-cell >{{user.status}} </clr-dg-cell>
<clr-dg-cell ><clr-icon shape="bullet-list" (click)="submenu(user.menuItemId)" style="color: rgb(108, 108, 194);"></clr-icon> </clr-dg-cell>
<clr-dg-cell>
<span style="cursor: pointer;padding: 10px; "><clr-icon shape="trash" (click)="onDelete(user)" class="red is-error" style="color: red;"></clr-icon></span>
<clr-signpost>
<span style="cursor: pointer;" clrSignpostTrigger><clr-icon shape="help" class="success" style="color: rgb(0, 130, 236);"></clr-icon></span>
<clr-signpost-content [clrPosition]="'left-middle'" *clrIfOpen>
<h5 style="margin-top: 0">{{'WHO_COLUMN'|translate}} </h5>
<div>{{'ACCOUNT_ID'|translate}} <code class="clr-code">{{user.accountId}}</code></div>
<div>{{'CREATED_AT'|translate}} <code class="clr-code">{{user.createdAt| date}}</code></div>
<div>{{'CREATED_BY'|translate}} <code class="clr-code">{{user.createdBy}}</code></div>
<div>{{'UPDATED_AT'|translate}} <code class="clr-code">{{user.updatedAt | date}}</code></div>
<div>{{'UPDATED_BY'|translate}} <code class="clr-code">{{user.updatedBy}}</code></div>
</clr-signpost-content>
</clr-signpost>
</clr-dg-cell>
<!-- <clr-dg-action-overflow>
<button class="action-item" *ngIf="medit == 'true'" (click)="goToEdit(user)">Edit <clr-icon shape="edit" class="is-error"></clr-icon></button>
<button class="action-item" *ngIf="mdelete == 'true'" (click)="onDelete(user)">Delete<clr-icon shape="trash" class="is-error"></clr-icon></button>
</clr-dg-action-overflow> -->
<clr-dg-column>
<ng-container *clrDgHideableColumn="{hidden: false}">
{{'NO' | translate}}
</ng-container>
</clr-dg-column>
<clr-dg-row-detail *clrIfExpanded >
<table class="table">
<tr>
<td class="td-title">Menu Name: </td>
<td class="td-content">{{user.menuItemDesc}}</td>
</tr>
</table>
</clr-dg-row-detail>
</clr-dg-row>
<clr-dg-column>
<ng-container *clrDgHideableColumn="{hidden: false}">
{{'MENU_ITEM_NAME' | translate}}
</ng-container>
</clr-dg-column>
<clr-dg-footer>
<clr-dg-pagination #pagination [clrDgPageSize]="10">
<clr-dg-page-size [clrPageSizeOptions]="[10,20,50,100]">Users per page</clr-dg-page-size>
{{pagination.firstItem + 1}} - {{pagination.lastItem + 1}}
of {{pagination.totalItems}} users
</clr-dg-pagination>
</clr-dg-footer>
</clr-datagrid>
<clr-dg-column>
<ng-container *clrDgHideableColumn="{hidden: false}">
{{'ID' | translate}}
</ng-container>
</clr-dg-column>
<clr-modal [(clrModalOpen)]="modalAdd" [clrModalSize]="'md'" [clrModalStaticBackdrop]="true">
<h3 class="modal-title">Add Menu Maintenance</h3>
<div class="modal-body">
<form [formGroup]="entryForm" (ngSubmit)="onSubmit()">
<div class="clr-row">
<!-- <div class="clr-col-sm-12">
<label for="name">Menu Item ID<span class="required-field">*</span></label>
<input type="text" class="clr-input" formControlName="menuItemId">
</div> -->
<div class="clr-col-sm-12">
<label for="name">Menu ID<span class="required-field">*</span></label>
<input type="text" class="clr-input" formControlName="menuId" name="menuId" [(ngModel)]="mainid" readonly>
</div>
<div class="clr-col-sm-12">
<label for="name">Menu Item Name<span class="required-field">*</span></label>
<input type="text" class="clr-input" formControlName="menuItemDesc">
<div *ngIf="submitted && entryForm.controls.menuItemDesc.errors" class="error_mess">
<div *ngIf="submitted && entryForm.controls.menuItemDesc.errors.required" class="error_mess">*This field is Required</div>
<clr-dg-column>
<ng-container *clrDgHideableColumn="{hidden: false}">
{{'SEQUENCE' | translate}}
</ng-container>
</clr-dg-column>
<clr-dg-column>
<ng-container *clrDgHideableColumn="{hidden: false}">
{{'MODULE_NAME' | translate}}
</ng-container>
</clr-dg-column>
<clr-dg-column>
<ng-container *clrDgHideableColumn="{hidden: false}">
{{'MENU_ACTION_LINK' | translate}}
</ng-container>
</clr-dg-column>
<clr-dg-column>
<ng-container *clrDgHideableColumn="{hidden: false}">
{{'STATUS' | translate}}
</ng-container>
</clr-dg-column>
<clr-dg-column>
<ng-container *clrDgHideableColumn="{hidden: false}">
{{'SUB_MENU' | translate}}
</ng-container>
</clr-dg-column>
<clr-dg-column>
<ng-container *clrDgHideableColumn="{hidden: false}">
<clr-icon shape="bars"></clr-icon>
{{'ACTION' | translate}}
</ng-container>
</clr-dg-column>
<clr-dg-row *clrDgItems="let user of menus;let i = index" [clrDgItem]="user">
<clr-dg-cell style="max-width: 40px;">
<span style="cursor: pointer;"><clr-icon shape="edit" (click)="goToEdit(user)" class="red is-error"
style="color:red;"></clr-icon></span>
</clr-dg-cell>
<clr-dg-cell>{{i+1}}</clr-dg-cell>
<clr-dg-cell>{{user.menuItemDesc}}</clr-dg-cell>
<clr-dg-cell>{{user.menuId}}</clr-dg-cell>
<clr-dg-cell>{{user.itemSeq}}</clr-dg-cell>
<clr-dg-cell> {{user.moduleName}} </clr-dg-cell>
<clr-dg-cell> {{user.main_menu_action_name}}</clr-dg-cell>
<clr-dg-cell>{{user.status}} </clr-dg-cell>
<clr-dg-cell><clr-icon shape="bullet-list" (click)="submenu(user.menuItemId)"
style="color: rgb(108, 108, 194);"></clr-icon> </clr-dg-cell>
<clr-dg-cell>
<span style="cursor: pointer;padding: 10px; "><clr-icon shape="trash" (click)="onDelete(user)"
class="red is-error" style="color: red;"></clr-icon></span>
<clr-signpost>
<span style="cursor: pointer;" clrSignpostTrigger><clr-icon shape="help" class="success"
style="color: rgb(0, 130, 236);"></clr-icon></span>
<clr-signpost-content [clrPosition]="'left-middle'" *clrIfOpen>
<h5 style="margin-top: 0">{{'WHO_COLUMN'|translate}} </h5>
<div>{{'ACCOUNT_ID'|translate}} <code class="clr-code">{{user.accountId}}</code></div>
<div>{{'CREATED_AT'|translate}} <code class="clr-code">{{user.createdAt| date}}</code></div>
<div>{{'CREATED_BY'|translate}} <code class="clr-code">{{user.createdBy}}</code></div>
<div>{{'UPDATED_AT'|translate}} <code class="clr-code">{{user.updatedAt | date}}</code></div>
<div>{{'UPDATED_BY'|translate}} <code class="clr-code">{{user.updatedBy}}</code></div>
</clr-signpost-content>
</clr-signpost>
</clr-dg-cell>
<clr-dg-row-detail *clrIfExpanded>
<table class="table">
<tr>
<td class="td-title">Menu Name: </td>
<td class="td-content">{{user.menuItemDesc}}</td>
</tr>
</table>
</clr-dg-row-detail>
</clr-dg-row>
<clr-dg-footer>
<clr-dg-pagination #pagination [clrDgPageSize]="10">
<clr-dg-page-size [clrPageSizeOptions]="[10,20,50,100]">Users per page</clr-dg-page-size>
{{pagination.firstItem + 1}} - {{pagination.lastItem + 1}}
of {{pagination.totalItems}} users
</clr-dg-pagination>
</clr-dg-footer>
</clr-datagrid>
<clr-modal [(clrModalOpen)]="modalAdd" [clrModalSize]="'md'" [clrModalStaticBackdrop]="true">
<h3 class="modal-title">Add Menu Maintenance</h3>
<div class="modal-body">
<form [formGroup]="entryForm" (ngSubmit)="onSubmit()">
<div class="clr-row">
<div class="clr-col-sm-12">
<label for="name">Menu ID<span class="required-field">*</span></label>
<input type="text" class="clr-input" formControlName="menuId" name="menuId" [(ngModel)]="mainid" readonly>
</div>
<div class="clr-col-sm-12">
<label for="name">Menu Item Name<span class="required-field">*</span></label>
<input type="text" class="clr-input" formControlName="menuItemDesc">
<div *ngIf="submitted && entryForm.controls.menuItemDesc.errors" class="error_mess">
<div *ngIf="submitted && entryForm.controls.menuItemDesc.errors.required" class="error_mess">*This field is
Required</div>
</div>
<div class="clr-col-sm-12">
<label for="tags">Sequence</label>
<input type="text" class="clr-input" formControlName="itemSeq">
<div *ngIf="submitted && entryForm.controls.itemSeq.errors" class="error_mess">
<div *ngIf="submitted && entryForm.controls.itemSeq.errors.required" class="error_mess">*This field is Required</div>
</div>
<div class="clr-col-sm-12">
<label for="tags">Sequence</label>
<input type="text" class="clr-input" formControlName="itemSeq">
<div *ngIf="submitted && entryForm.controls.itemSeq.errors" class="error_mess">
<div *ngIf="submitted && entryForm.controls.itemSeq.errors.required" class="error_mess">*This field is
Required</div>
</div>
<div *ngIf="submitted && entryForm.controls.itemSeq.errors" class="error_mess">
<div *ngIf="submitted && entryForm.controls.itemSeq.errors.pattern" class="error_mess">*Required Only Number</div>
</div>
<div *ngIf="submitted && entryForm.controls.itemSeq.errors.pattern" class="error_mess">*Required Only Number
</div>
<div class="clr-col-sm-12">
<label for="tags">Module Name</label>
<input type="text" class="clr-input" formControlName="moduleName">
<div *ngIf="submitted && entryForm.controls.moduleName.errors" class="error_mess">
<div *ngIf="submitted && entryForm.controls.moduleName.errors.required" class="error_mess">*This field is Required</div>
</div>
</div>
<div class="clr-col-sm-12">
<label for="tags">Status</label>
<select id="" formControlName="status">
<option value="Enable">Enable</option>
<option value="Disable">Disable</option>
</select>
<div *ngIf="submitted && entryForm.controls.status.errors" class="error_mess">
<div *ngIf="submitted && entryForm.controls.status.errors.required" class="error_mess">*This field is Required</div>
</div>
</div>
<div class="clr-col-sm-12">
<label for="tags">Menu Action Link</label>
<input type="text" class="clr-input" formControlName="main_menu_action_name">
<div *ngIf="submitted && entryForm.controls.main_menu_action_name.errors" class="error_mess">
<div *ngIf="submitted && entryForm.controls.main_menu_action_name.errors.required" class="error_mess">*This field is Required</div>
</div>
<!-- <select NAME="menu_id" >
<option SELECTED >Home Menu
<OPTION >Home
<OPTION >Job
<OPTION >&nbsp;&nbsp;&nbsp;Job logs
<OPTION >&nbsp;&nbsp;&nbsp;Pending Jobs
<OPTION >&nbsp;&nbsp;&nbsp;Defined Jobs
<OPTION >&nbsp;&nbsp;&nbsp;Surewebsocket
<OPTION >Security
<OPTION >&nbsp;&nbsp;&nbsp;User Maintance
<OPTION >&nbsp;&nbsp;&nbsp;User Group Maintance
<OPTION >&nbsp;&nbsp;&nbsp;System parametrs
<OPTION >&nbsp;&nbsp;&nbsp;Menu access control
<OPTION >&nbsp;&nbsp;&nbsp;Menu Maintance
<OPTION >SureBoard
<OPTION >&nbsp;&nbsp;&nbsp;Road Map
<OPTION >&nbsp;&nbsp;&nbsp;Iteration Release
<OPTION >&nbsp;&nbsp;&nbsp;Milestone
<OPTION >&nbsp;&nbsp;&nbsp;Goal
<OPTION >&nbsp;&nbsp;&nbsp;Wbs Task Board
<OPTION >Projects
<OPTION >&nbsp;&nbsp;&nbsp;My projects
<OPTION >&nbsp;&nbsp;&nbsp;All Projects
<OPTION >&nbsp;&nbsp;&nbsp;Templates
<OPTION >&nbsp;&nbsp;&nbsp;Repositories
<OPTION >&nbsp;&nbsp;&nbsp;Recently Modify
<OPTION >&nbsp;&nbsp;&nbsp;Recently Archived
<OPTION >&nbsp;&nbsp;&nbsp;Shared with Me
<OPTION >&nbsp;&nbsp;&nbsp;My Fav
</select> -->
</div>
<div class="clr-col-sm-12">
<label for="tags">Menu Icon Name</label>
<input type="text" class="clr-input" formControlName="main_menu_icon_name">
<div *ngIf="submitted && entryForm.controls.main_menu_icon_name.errors" class="error_mess">
<div *ngIf="submitted && entryForm.controls.main_menu_icon_name.errors.required" class="error_mess">*This field is Required</div>
</div>
</div>
</div>
</div>
<br>
<div class="modal-footer">
<button type="button" class="btn btn-outline" (click)="modalAdd = false">Cancel</button>
<button type="submit" class="btn btn-primary" >ADD</button>
<div class="clr-col-sm-12">
<label for="tags">Module Name</label>
<input type="text" class="clr-input" formControlName="moduleName">
<div *ngIf="submitted && entryForm.controls.moduleName.errors" class="error_mess">
<div *ngIf="submitted && entryForm.controls.moduleName.errors.required" class="error_mess">*This field is
Required</div>
</div>
</div>
</form>
</div>
<div class="clr-col-sm-12">
<label for="tags">Status</label>
<select id="" formControlName="status">
<option value="Enable">Enable</option>
<option value="Disable">Disable</option>
</select>
<div *ngIf="submitted && entryForm.controls.status.errors" class="error_mess">
<div *ngIf="submitted && entryForm.controls.status.errors.required" class="error_mess">*This field is
Required</div>
</div>
</div>
<div class="clr-col-sm-12">
<label for="tags">Menu Action Link</label>
<input type="text" class="clr-input" formControlName="main_menu_action_name">
<div *ngIf="submitted && entryForm.controls.main_menu_action_name.errors" class="error_mess">
<div *ngIf="submitted && entryForm.controls.main_menu_action_name.errors.required" class="error_mess">*This
field is Required</div>
</div>
</clr-modal>
<clr-modal [(clrModalOpen)]="modaldelete" [clrModalSize]="'lg'" [clrModalStaticBackdrop]="true">
<div class="modal-body" *ngIf="rowSelected.menuItemId">
<h1 class="delete">Are You Sure Want to delete?</h1>
<h2 class="heading">{{rowSelected.menuItemId}}</h2>
<div class="modal-footer">
<button type="button" class="btn btn-outline" (click)="modaldelete = false">Cancel</button>
<button type="submit" (click)="delete(rowSelected.menuItemId)" class="btn btn-primary" >Delete</button>
</div>
<div class="clr-col-sm-12">
<label for="tags">Menu Icon Name</label>
<input type="text" class="clr-input" formControlName="main_menu_icon_name">
<div *ngIf="submitted && entryForm.controls.main_menu_icon_name.errors" class="error_mess">
<div *ngIf="submitted && entryForm.controls.main_menu_icon_name.errors.required" class="error_mess">*This
field is Required</div>
</div>
</div>
</div>
</div>
</clr-modal>
<br>
<div class="modal-footer">
<button type="button" class="btn btn-outline" (click)="modalAdd = false">Cancel</button>
<button type="submit" class="btn btn-primary">ADD</button>
</div>
</form>
</div>
</clr-modal>
<clr-modal [(clrModalOpen)]="modaledit" [clrModalSize]="'md'" [clrModalStaticBackdrop]="true">
<h3 class="modal-title">Update Menu Maintenance</h3>
<div class="modal-body" *ngIf="rowSelected.menuItemId">
<h2 class="heading">{{rowSelected.menuItemId}}</h2>
<form (ngSubmit)="onUpdate(rowSelected.menuItemId)">
<div class="clr-row">
<clr-modal [(clrModalOpen)]="modaldelete" [clrModalSize]="'lg'" [clrModalStaticBackdrop]="true">
<div class="clr-col-sm-12">
<label for="name">Menu ID<span class="required-field">*</span></label>
<input type="text" class="clr-input" name="menuId" [(ngModel)]="rowSelected.menuId" readonly>
</div>
<div class="clr-col-sm-12">
<label for="name">Menu Item Name<span class="required-field">*</span></label>
<input type="text" class="clr-input" name="menuItemDesc" [(ngModel)]="rowSelected.menuItemDesc">
</div>
<div class="clr-col-sm-12">
<label for="tags">Sequence</label>
<input type="text" class="clr-input" name="itemSeq" [(ngModel)]="rowSelected.itemSeq">
</div>
<div class="clr-col-sm-12">
<label for="tags">Module Name</label>
<input type="text" class="clr-input" name="moduleName" [(ngModel)]="rowSelected.moduleName">
</div>
<div class="clr-col-sm-12">
<label for="tags">Status</label>
<select id="" name="status" [(ngModel)]="rowSelected.status">
<option value="Enable">Enable</option>
<option value="Disable">Disable</option>
</select>
</div>
<div class="clr-col-sm-12">
<label for="tags">Menu Action Link</label>
<input type="text" class="clr-input" name="main_menu_action_name" [(ngModel)]="rowSelected.main_menu_action_name">
</div>
<div class="clr-col-sm-12">
<label for="tags">Menu Icon Name </label>
<input type="text" class="clr-input" name="main_menu_icon_name" [(ngModel)]="rowSelected.main_menu_icon_name">
</div>
</div>
<br>
<div class="modal-footer">
<button type="button" class="btn btn-outline" (click)="modaledit = false">Cancel</button>
<button type="submit" class="btn btn-primary" >Update</button>
</div>
</form>
</div>
</clr-modal>
<clr-modal [(clrModalOpen)]="modalCsv" [clrModalSize]="'sm'" [clrModalStaticBackdrop]="false">
<h3 class="modal-title">Import File</h3>
<div class="modal-body">
<input type="file" name="file" class="file" (change)="selectFile($event)" accept=".csv, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet, application/vnd.ms-excel">
</div>
<div class="modal-body" *ngIf="rowSelected.menuItemId">
<h1 class="delete">Are You Sure Want to delete?</h1>
<h2 class="heading">{{rowSelected.menuItemId}}</h2>
<div class="modal-footer">
<button class="btn btn-primary" type="button" [disabled]="!selectedFiles" (click)="saveCsv()">Import</button>
<button type="button" class="btn btn-outline" (click)="modaldelete = false">Cancel</button>
<button type="submit" (click)="delete(rowSelected.menuItemId)" class="btn btn-primary">Delete</button>
</div>
</clr-modal>
</div>
</clr-modal>
<clr-modal [(clrModalOpen)]="modaledit" [clrModalSize]="'md'" [clrModalStaticBackdrop]="true">
<h3 class="modal-title">Update Menu Maintenance</h3>
<div class="modal-body" *ngIf="rowSelected.menuItemId">
<h2 class="heading">{{rowSelected.menuItemId}}</h2>
<form (ngSubmit)="onUpdate(rowSelected.menuItemId)">
<div class="clr-row">
<div class="clr-col-sm-12">
<label for="name">Menu ID<span class="required-field">*</span></label>
<input type="text" class="clr-input" name="menuId" [(ngModel)]="rowSelected.menuId" readonly>
</div>
<div class="clr-col-sm-12">
<label for="name">Menu Item Name<span class="required-field">*</span></label>
<input type="text" class="clr-input" name="menuItemDesc" [(ngModel)]="rowSelected.menuItemDesc">
</div>
<div class="clr-col-sm-12">
<label for="tags">Sequence</label>
<input type="text" class="clr-input" name="itemSeq" [(ngModel)]="rowSelected.itemSeq">
</div>
<div class="clr-col-sm-12">
<label for="tags">Module Name</label>
<input type="text" class="clr-input" name="moduleName" [(ngModel)]="rowSelected.moduleName">
</div>
<div class="clr-col-sm-12">
<label for="tags">Status</label>
<select id="" name="status" [(ngModel)]="rowSelected.status">
<option value="Enable">Enable</option>
<option value="Disable">Disable</option>
</select>
</div>
<div class="clr-col-sm-12">
<label for="tags">Menu Action Link</label>
<input type="text" class="clr-input" name="main_menu_action_name"
[(ngModel)]="rowSelected.main_menu_action_name">
</div>
<div class="clr-col-sm-12">
<label for="tags">Menu Icon Name </label>
<input type="text" class="clr-input" name="main_menu_icon_name" [(ngModel)]="rowSelected.main_menu_icon_name">
</div>
</div>
<br>
<div class="modal-footer">
<button type="button" class="btn btn-outline" (click)="modaledit = false">Cancel</button>
<button type="submit" class="btn btn-primary">Update</button>
</div>
</form>
</div>
</clr-modal>
<clr-modal [(clrModalOpen)]="modalCsv" [clrModalSize]="'sm'" [clrModalStaticBackdrop]="false">
<h3 class="modal-title">Import File</h3>
<div class="modal-body">
<input type="file" name="file" class="file" (change)="selectFile($event)"
accept=".csv, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet, application/vnd.ms-excel">
</div>
<div class="modal-footer">
<button class="btn btn-primary" type="button" [disabled]="!selectedFiles" (click)="saveCsv()">Import</button>
</div>
</clr-modal>

View File

@ -1,7 +1,7 @@
import { Component, OnInit } from '@angular/core';
import { FormBuilder, FormGroup, Validators } from '@angular/forms';
import { ToastrService } from 'ngx-toastr';
import {MenumaintanceService} from '../../../../services/admin/menumaintance.service';
import { MenumaintanceService } from '../../../../services/admin/menumaintance.service';
import { Rn_Main_Menu } from '../../../../models/builder/Rn_Main_Menu';
import { ActivatedRoute, Router } from '@angular/router';
import { MenuGroupService } from 'src/app/services/admin/menu-group.service';
@ -17,25 +17,25 @@ import { TranslateService } from '@ngx-translate/core';
export class MenumaintanceComponent implements OnInit {
loading = false;
selected: any[] = [];
rowSelected :any= {};
modaldelete=false;
modalAdd= false;
modaledit=false;
rowSelected: any = {};
modaldelete = false;
modalAdd = false;
modaledit = false;
givendata;
menus: Rn_Main_Menu[];
mainid=0;
mainid = 0;
public entryForm: FormGroup;
mcreate;
mdelete;
medit;
showdata;
error;
submitted=false;
constructor(private menuservice:MenumaintanceService,
private toastr:ToastrService,
submitted = false;
constructor(private menuservice: MenumaintanceService,
private toastr: ToastrService,
private excel: ExcelService,
private _fb: FormBuilder,
private route:ActivatedRoute,
private route: ActivatedRoute,
private menuGroupService: MenuGroupService,
private csvService: CsvService,
private translate: TranslateService,
@ -44,12 +44,12 @@ export class MenumaintanceComponent implements OnInit {
ngOnInit(): void {
this.showdata = this.menuGroupService.getdata();
console.log(this.showdata);
this.mcreate=this.showdata.mcreate;
console.log(this.mcreate);
this.mdelete=this.showdata.mdelete
console.log(this.mdelete);
this.medit=this.showdata.medit
console.log(this.medit);
this.mcreate = this.showdata.mcreate;
console.log(this.mcreate);
this.mdelete = this.showdata.mdelete
console.log(this.mdelete);
this.medit = this.showdata.medit
console.log(this.medit);
// this.menuservice.getAll().subscribe((data) => {
// console.log(data);
@ -57,124 +57,123 @@ export class MenumaintanceComponent implements OnInit {
// });
this.entryForm = this._fb.group({
// menuItemId:[null],
menuId:[null],
menuItemDesc:['',[Validators.required]] ,
itemSeq:['',[Validators.required, Validators.pattern(/^-?(0|[1-9]\d*)?$/)]] ,
moduleName:['',[Validators.required]] ,
status:['',[Validators.required]] ,
main_menu_action_name:['',[Validators.required]],
main_menu_icon_name:['',[Validators.required]]
});
this.getdata();
// menuItemId:[null],
menuId: [null],
menuItemDesc: ['', [Validators.required]],
itemSeq: ['', [Validators.required, Validators.pattern(/^-?(0|[1-9]\d*)?$/)]],
moduleName: ['', [Validators.required]],
status: ['', [Validators.required]],
main_menu_action_name: ['', [Validators.required]],
main_menu_icon_name: ['', [Validators.required]]
});
this.getdata();
}
switchLanguage(language: string) {
this.translate.use(language);
}
getdata(){
getdata() {
this.menuservice.getByCurrentUserMenuGroupId1().subscribe(resp => {
this.menus = resp;
console.log('menus: ', this.menus);
if(this.menus.length==0){
this.error="No data Available";
if (this.menus.length == 0) {
this.error = "No data Available";
console.log(this.error)
}
},(error) => {
console.log(error);
if(error){
this.error="Server Error";
}
})
}, (error) => {
console.log(error);
if (error) {
this.error = "Server Error";
}
})
}
onSubmit(){
this.submitted=true;
onSubmit() {
this.submitted = true;
if (this.entryForm.invalid) {
return;
}
this.menuservice.create1(this.entryForm.value).subscribe((data)=>{
console.log(data);
if (data) {
this.toastr.success('Added successfully');
this.menuservice.create1(this.entryForm.value).subscribe((data) => {
console.log(data);
if (data) {
this.toastr.success('Added successfully');
}
this.ngOnInit();
},
(error) => {
console.log('Error in adding data...', +error);
if (error) {
this.toastr.error('Not added Data Getting Some Error');
}
this.ngOnInit();
},
(error) => {
console.log('Error in adding data...',+error);
if(error){
this.toastr.error('Not added Data Getting Some Error');
}
this.getdata();
});
this.modalAdd=false;
this.getdata();
});
this.modalAdd = false;
}
goToAdd() {
this.modalAdd=true;
}
submenu(id:any){
this.router.navigate(["../submenu/" +id], { relativeTo: this.route })
}
data:{};
shrink(id:any,row){
this.rowSelected = row;
console.log(this.rowSelected);
if(this.rowSelected.subMenus!=0){
this.rowSelected.subMenus=[]
}console.log(this.rowSelected);
this.menuservice.sink(id,this.rowSelected).subscribe((data)=>{
console.log(data);
})
}
goToEdit(row) {
this.rowSelected = row;
console.log(row)
this.modaledit=true;
//this.router.navigate(["../edit/" + id], { relativeTo: this.route });
}
onDelete(row) {
this.rowSelected = row;
this.modaldelete=true;
}
this.modalAdd = true;
}
submenu(id: any) {
this.router.navigate(["../submenu/" + id], { relativeTo: this.route })
}
data: {};
shrink(id: any, row) {
this.rowSelected = row;
console.log(this.rowSelected);
if (this.rowSelected.subMenus != 0) {
this.rowSelected.subMenus = []
} console.log(this.rowSelected);
this.menuservice.sink(id, this.rowSelected).subscribe((data) => {
console.log(data);
})
}
goToEdit(row) {
this.rowSelected = row;
console.log(row)
this.modaledit = true;
//this.router.navigate(["../edit/" + id], { relativeTo: this.route });
}
onDelete(row) {
this.rowSelected = row;
this.modaldelete = true;
}
delete(id)
{
this.modaldelete = false;
console.log("in delete "+id);
this.menuservice.delete1(id).subscribe((data)=>{
console.log(data);
this.toastr.success('Deleted successfully');
this.ngOnInit();
},
delete(id) {
this.modaldelete = false;
console.log("in delete " + id);
this.menuservice.delete1(id).subscribe((data) => {
console.log(data);
this.toastr.success('Deleted successfully');
this.ngOnInit();
},
(error) => {
console.log('Error in adding data...',+error);
if(error){
console.log('Error in adding data...', +error);
if (error) {
this.toastr.error('Not Deleted Data Getting Some Error');
}
});
}
onUpdate(id){
this.modaledit=false;
this.menuservice.update1(id,this.rowSelected).subscribe((data)=>{
console.log(data);
if (data) {
this.toastr.success('Updated successfully');
}
},
(error) => {
console.log('Error in adding data...',+error);
if(error){
this.toastr.error('Not updated Data Getting Some Error');
}
});
}
onUpdate(id) {
this.modaledit = false;
this.menuservice.update1(id, this.rowSelected).subscribe((data) => {
console.log(data);
if (data) {
this.toastr.success('Updated successfully');
}
},
(error) => {
console.log('Error in adding data...', +error);
if (error) {
this.toastr.error('Not updated Data Getting Some Error');
}
});
}
onExport() {
this.excel.exportAsExcelFile(this.givendata, 'menumaintanance_',
moment().format('YYYYMMDD_HHmmss'))
}
onExport() {
this.excel.exportAsExcelFile(this.givendata, 'menumaintanance_',
moment().format('YYYYMMDD_HHmmss'))
}
// csv
// csv
modalCsv = false;
selectedFiles: File;

View File

@ -1,5 +1,5 @@
import { Component, OnInit } from '@angular/core';
import {MenumaintanceService} from '../../../../services/admin/menumaintance.service';
import { MenumaintanceService } from '../../../../services/admin/menumaintance.service';
import { Rn_Main_Menu } from '../../../../models/builder/Rn_Main_Menu';
import { ActivatedRoute, Router } from '@angular/router';
import { AbstractControl, FormBuilder, FormGroup, Validators } from '@angular/forms';
@ -18,121 +18,120 @@ function numberValidator(control: AbstractControl): { [key: string]: any } | nul
})
export class SubmenuComponent implements OnInit {
loading = false;
modalAdd= false;
modaledit=false;
modaldelete=false;
modalAdd = false;
modaledit = false;
modaldelete = false;
selected: any[] = [];
rowSelected :any= {};
rowSelected: any = {};
givendata;
menus: Rn_Main_Menu[];
sub;
id;
mainid;
submitted=false;
submitted = false;
public entryForm: FormGroup;
constructor(private menuservice:MenumaintanceService,
private toastr:ToastrService,
constructor(private menuservice: MenumaintanceService,
private toastr: ToastrService,
private _fb: FormBuilder,
private route:ActivatedRoute,
private route: ActivatedRoute,
private router: Router,) { }
ngOnInit(): void {
this.id = this.route.snapshot.params["id"];
console.log("project mainmenu with id = ", this.id);
this.getById(this.id);
this.mainid=this.id
this.mainid = this.id
this.entryForm = this._fb.group({
// menuItemId:[null],
menuId:[this.mainid],
menuItemDesc:['',[Validators.required]] ,
// menuItemId:[null],
menuId: [this.mainid],
menuItemDesc: ['', [Validators.required]],
// itemSeq:['',[Validators.required]] ,
// itemSeq: ['', [Validators.required, numberValidator]],
// itemSeq: ['', [Validators.required, numberValidator]],
itemSeq: ['', [Validators.required, Validators.pattern('^[0-9]*$')]],
moduleName:['',[Validators.required]] ,
status:['',[Validators.required]] ,
main_menu_action_name:['',[Validators.required]]
});
moduleName: ['', [Validators.required]],
status: ['', [Validators.required]],
main_menu_action_name: ['', [Validators.required]]
});
// this.getdata();
// this.getdata();
}
getById(id:any){
this.menuservice.getbyid(id).subscribe((data)=>{
this.sub=data;
getById(id: any) {
this.menuservice.getbyid(id).subscribe((data) => {
this.sub = data;
console.log(this.sub)
})
}
getdata(){
getdata() {
this.menuservice.getByCurrentUserMenuGroupId1().subscribe(resp => {
this.menus = resp;
console.log('menus: ', this.menus);
})
console.log('menus: ', this.menus);
})
}
goToAdd() {
this.modalAdd=true;
this.modalAdd = true;
}
onSubmit() {
this.submitted = true;
if (this.entryForm.invalid) {
return;
}
onSubmit(){
this.submitted=true;
if (this.entryForm.invalid) {
return;
this.menuservice.create1(this.entryForm.value).subscribe((data) => {
console.log(data);
if (data) {
this.toastr.success('Added successfully');
}
this.menuservice.create1(this.entryForm.value).subscribe((data)=>{
console.log(data);
if (data) {
this.toastr.success('Added successfully');
}
},
},
(error) => {
console.log('Error in adding data...',+error);
if(error){
this.toastr.error('Not added Data Getting Some Error');
}
console.log('Error in adding data...', +error);
if (error) {
this.toastr.error('Not added Data Getting Some Error');
}
});
this.modalAdd=false;
}
this.modalAdd = false;
}
goToEdit(row) {
this.rowSelected = row;
console.log(row)
this.modaledit=true;
//this.router.navigate(["../edit/" + id], { relativeTo: this.route });
}
onDelete(row) {
this.rowSelected = row;
this.modaldelete=true;
}
delete(id)
{
this.modaldelete = false;
console.log("in delete "+id);
this.menuservice.delete1(id).subscribe((data)=>{
console.log(data);
if (data) {
this.toastr.success('Deleted successfully');
}
},
(error) => {
console.log('Error in adding data...',+error);
if(error){
this.toastr.error('Not Deleted Data Getting Some Error');
}
});
goToEdit(row) {
this.rowSelected = row;
console.log(row)
this.modaledit = true;
//this.router.navigate(["../edit/" + id], { relativeTo: this.route });
}
onDelete(row) {
this.rowSelected = row;
this.modaldelete = true;
}
delete(id) {
this.modaldelete = false;
console.log("in delete " + id);
this.menuservice.delete1(id).subscribe((data) => {
console.log(data);
if (data) {
this.toastr.success('Deleted successfully');
}
},
(error) => {
console.log('Error in adding data...', +error);
if (error) {
this.toastr.error('Not Deleted Data Getting Some Error');
}
onUpdate(id){
this.modaledit=false;
this.menuservice.update1(id,this.rowSelected).subscribe((data)=>{
});
}
onUpdate(id) {
this.modaledit = false;
this.menuservice.update1(id, this.rowSelected).subscribe((data) => {
console.log(data);
if (data) {
this.toastr.success('Updated successfully');
}
},
(error) => {
console.log('Error in adding data...',+error);
if(error){
this.toastr.error('Not updated Data Getting Some Error');
}
});
},
(error) => {
console.log('Error in adding data...', +error);
if (error) {
this.toastr.error('Not updated Data Getting Some Error');
}
});
}
}

View File

@ -42,9 +42,7 @@
</ng-container></clr-dg-column>
<clr-dg-column [clrDgField]="'Technology'"> <ng-container *clrDgHideableColumn="{hidden: false}">
Technolgy Stack
</ng-container></clr-dg-column>
<clr-dg-column [clrDgField]="'Type Render'"> <ng-container *clrDgHideableColumn="{hidden: false}"> Type Render
</ng-container></clr-dg-column>
@ -88,12 +86,9 @@
<clr-dg-cell>{{user.uitype }}</clr-dg-cell>
<clr-dg-cell>{{user.techstack }}</clr-dg-cell>
<clr-dg-cell>{{user.typerender }}</clr-dg-cell>
<clr-dg-cell (click)="goToReplaceStringhtmljson (user.html)"
style="cursor: pointer; align-items: center;"><clr-icon shape="details"></clr-icon>
</clr-dg-cell>
@ -358,10 +353,7 @@
<label>Type Render</label>
<input class="clr-input" type="text" [(ngModel)]="rowSelected.typerender" name="typerender" />
</div>
<div class="clr-col-sm-12">
<label>Technolgy Stack</label>
<input class="clr-input" type="text" [(ngModel)]="rowSelected.techstack" name="techstack" />
</div>
<div class="clr-col-sm-12">
@ -481,11 +473,6 @@
<input class="clr-input" type="text" formControlName="typerender" />
</div>
<div class="clr-col-sm-12">
<label> Technolgy Stack</label>
<input class="clr-input" type="text" formControlName="techstack" />
</div>
<div class="clr-col-sm-12">
<label> Active</label>
<input type="checkbox" formControlName="active" clrToggle />

View File

@ -10,6 +10,7 @@ import { UserInfoService } from 'src/app/services/user-info.service';
import { SiteTreeservice } from '../SiteBuilderGrid/SiteTree.service';
import { COMMON_CSS } from '../WireframesUi/common-css';
import { Download_Css } from '../WireframesUi/download-css';
import { ActivatedRoute } from '@angular/router';
// import { Download_Css } from '../WireframesUi/download-css';
declare var JsBarcode: any;
@Component({
@ -52,6 +53,7 @@ export class Design_lbraryComponent implements OnInit {
newLine: any;
additionalFieldsFromBackend: any[] = [];
formcode = 'Design_lbrary_formCode'
headerId;
tableName = 'Design_lbrary'; checkFormCode; selected: any[] = []; constructor(
private extensionService: ExtensionService,
private userInfoService: UserInfoService,
@ -60,10 +62,13 @@ export class Design_lbraryComponent implements OnInit {
private toastr: ToastrService,
private _fb: FormBuilder,
private siteTreeService: SiteTreeservice,
private route: ActivatedRoute,
) { }
// component button
ngOnInit(): void {
this.headerId = this.route.snapshot.params["id"];
console.log("headerId : = ", this.headerId);
if (this.cardmodeldata !== '') {
this.cardmodal = JSON.parse(this.cardmodeldata);
this.dashboardArray = this.cardmodal.dashboard.slice();
@ -85,11 +90,9 @@ export class Design_lbraryComponent implements OnInit {
uitype: [null],
javacode: [null],
typerender: [null],
techstack: [null],
// techstack: [null],
html: [null],
hedaer_id: [this.headerId],
}); // component_button200
// form code start
@ -111,39 +114,16 @@ export class Design_lbraryComponent implements OnInit {
});
}
});
console.log(this.entryForm.value);
console.log('form code ', this.entryForm.value);
// form code end
}
error;
getData() {
this.mainService.getAll().subscribe((data) => {
console.log(data);
this.product = data;
this.mainService.getAll(this.headerId).subscribe((data) => {
console.log('get all ', data);
// this.product = data;
this.product = Array.isArray(data) ? data : [];
if (this.product.length == 0) {
this.error = "No Data Available"
}
@ -156,19 +136,6 @@ export class Design_lbraryComponent implements OnInit {
}
onEdit(row) {
this.rowSelected = row;
this.modalEdit = true;
}
onDelete(row) {
@ -187,18 +154,6 @@ export class Design_lbraryComponent implements OnInit {
}
onUpdate(id) {
this.modalEdit = false;
//console.log("in update");
console.log("id " + id);
console.log(this.rowSelected);
@ -213,17 +168,6 @@ export class Design_lbraryComponent implements OnInit {
this.ngOnInit();
}, 500);
}, (error) => {
console.log(error);
if (error.status >= 200 && error.status <= 299) {
@ -242,18 +186,6 @@ export class Design_lbraryComponent implements OnInit {
}
onCreate() {
this.modalAdd = false;
this.mainService.create(this.entryForm.value).subscribe(
(data) => {
console.log(data);
@ -264,17 +196,6 @@ export class Design_lbraryComponent implements OnInit {
this.ngOnInit();
}, 500);
}, (error) => {
console.log(error);
if (error.status >= 200 && error.status <= 299) {
@ -294,17 +215,6 @@ export class Design_lbraryComponent implements OnInit {
goToAdd(row) {
this.modalAdd = true; this.submitted = false;
}
submitted = false;
onSubmit() {
@ -312,11 +222,11 @@ export class Design_lbraryComponent implements OnInit {
this.submitted = true;
if (this.entryForm.invalid) {
return;
} this.onCreate();
}
this.onCreate();
}
rsModaldescription = false;
goToReplaceStringdescription(row) {
this.rowSelected = row; this.rsModaldescription = true;

View File

@ -2,17 +2,17 @@ import { Injectable } from '@angular/core';
import { Observable } from "rxjs";
import { HttpClient, HttpHeaders, HttpParams, } from "@angular/common/http";
import { ApiRequestService } from "src/app/services/api/api-request.service";
import { environment } from 'src/environments/environment';
import { environment } from 'src/environments/environment';
@Injectable({
providedIn: 'root'
})
export class Design_lbraryservice{
private baseURL = "Design_lbrary/Design_lbrary" ; constructor(
export class Design_lbraryservice {
private baseURL = "Design_lbrary/Design_lbrary"; constructor(
private http: HttpClient,
private apiRequest: ApiRequestService,
) { }
getAll(page?: number, size?: number): Observable<any> {
return this.apiRequest.get(this.baseURL);
getAll(id: number, page?: number, size?: number): Observable<any> {
return this.apiRequest.get(this.baseURL + "/line/" + id);
}
getById(id: number): Observable<any> {
const _http = this.baseURL + "/" + id;
@ -29,17 +29,17 @@ export class Design_lbraryservice{
const _http = this.baseURL + "/" + id;
return this.apiRequest.delete(_http);
}
// updateaction
// updateaction
}

View File

@ -0,0 +1,447 @@
<ol class="breadcrumb breadcrumb-arrow font-trirong">
<li><a href="javascript://"> DlfHeader</a></li>
</ol>
<div class="dg-wrapper">
<div class="clr-row">
<div class="clr-col-8">
<h3>DlfHeader </h3>
</div>
<div class="clr-col-4" style="text-align: right;">
<button *ngIf="cardButton" id="add" class="btn btn-primary btn-icon" (click)="changeView()">
<clr-icon *ngIf="!isCardview" shape="grid-view"></clr-icon> <clr-icon *ngIf="isCardview"
shape="bars"></clr-icon>
</button>
<!-- button -->
<button id="add" class="btn btn-primary" (click)="goToAdd(product)">
<clr-icon shape="plus"></clr-icon>ADD
</button>
</div>
</div>
<ng-container *ngIf="!isCardview"> <!-- GET ALL --> <clr-datagrid [clrDgLoading]="loading"
[(clrDgSelected)]="selected">
<clr-dg-placeholder>
<ng-template #loadingSpinner>
<clr-spinner>Loading ... </clr-spinner>
</ng-template>
<div *ngIf="error;else loadingSpinner">{{error}}</div>
</clr-dg-placeholder>
<clr-dg-column [clrDgField]="' name'"> <ng-container *clrDgHideableColumn="{hidden: false}"> Name
</ng-container></clr-dg-column>
<clr-dg-column [clrDgField]="' description'"> <ng-container *clrDgHideableColumn="{hidden: false}"> Description
</ng-container></clr-dg-column>
<clr-dg-column [clrDgField]="'Technology'"> <ng-container *clrDgHideableColumn="{hidden: false}">
Technolgy Stack
</ng-container></clr-dg-column>
<clr-dg-column [clrDgField]="' type'"> <ng-container *clrDgHideableColumn="{hidden: false}"> type
</ng-container></clr-dg-column>
<clr-dg-column [clrDgField]="' active'"> <ng-container *clrDgHideableColumn="{hidden: false}"> Active
</ng-container></clr-dg-column>
<clr-dg-column>
<ng-container *clrDgHideableColumn="{hidden: false}">
Line
</ng-container>
</clr-dg-column>
<!-- who column -->
<clr-dg-column> <ng-container *clrDgHideableColumn="{hidden: false}">
<clr-icon shape="bars"></clr-icon> Action
</ng-container></clr-dg-column>
<!-- end -->
<clr-dg-row *clrDgItems="let user of product" [clrDgItem]="user">
<clr-dg-cell>{{user. name }}</clr-dg-cell>
<clr-dg-cell (click)="goToReplaceStringdescription (user.description)"
style="cursor: pointer; align-items: center;"><clr-icon shape="details"></clr-icon>
</clr-dg-cell>
<clr-dg-cell>{{user.techstack }}</clr-dg-cell>
<clr-dg-cell>{{user. type }}</clr-dg-cell>
<clr-dg-cell>{{user. active }}</clr-dg-cell>
<clr-dg-cell><clr-icon shape="bullet-list" (click)="goToDlfLine(user.id)"
style="color: rgb(108, 108, 194);"></clr-icon> </clr-dg-cell>
<!-- who column -->
<clr-dg-cell>
<clr-signpost>
<span style="cursor: pointer;" clrSignpostTrigger><clr-icon shape="help" class="success"
style="color: rgb(0, 130, 236);"></clr-icon></span>
<clr-signpost-content [clrPosition]="'left-middle'" *clrIfOpen>
<h5 style="margin-top: 0">Who Column</h5>
<div>Account ID: <code class="clr-code">{{user.accountId}}</code></div>
<div>Created At: <code class="clr-code">{{user.createdAt| date}}</code></div>
<div>Created By: <code class="clr-code">{{user.createdBy}}</code></div>
<div>Updated At: <code class="clr-code">{{user.updatedAt | date}}</code></div>
<div>Updated By: <code class="clr-code">{{user.updatedBy}}</code></div>
</clr-signpost-content>
</clr-signpost>
</clr-dg-cell>
<!-- who colmn -->
<clr-dg-action-overflow>
<button class="action-item" (click)="onEdit(user)">Edit</button>
<button class="action-item" (click)="onDelete(user)">Delete</button>
</clr-dg-action-overflow>
</clr-dg-row>
<clr-dg-footer>
<clr-dg-pagination #pagination [clrDgPageSize]="10">
<clr-dg-page-size [clrPageSizeOptions]="[10,20,50,100]">Users per page</clr-dg-page-size>
{{pagination.firstItem + 1}} - {{pagination.lastItem + 1}}
of {{pagination.totalItems}} users
</clr-dg-pagination>
</clr-dg-footer>
</clr-datagrid> </ng-container>
<ng-template #showInfo>
<div class="alert alert-info" role="alert">
<div class="alert-items">
<div class="alert-item static">
<span class="alert-text">
<clr-icon class="alert-icon" shape="info-circle"></clr-icon>
Data could be found. Loading..
<clr-spinner [clrMedium]="true">Loading ...</clr-spinner>
</span>
</div>
</div>
</div>
</ng-template><ng-container *ngIf="isCardview">
<div *ngIf="product; else showInfo" class="clr-row clr-align-items-start clr-justify-content-start">
<div *ngFor="let app of product| filter:search; let index = i" class="clr-col-auto">
<div class="clr-row">
<div class="clr-col-lg-12 clr-col-md-4 clr-col-sm-4 clr-col-12" style="width: 410px;">
<div class="card" style="padding: 10px; "
[style.background-color]="cardmodal.cardColor !== '' ? cardmodal.cardColor : 'white'">
<div class="card-body"
style="display: grid; grid-template-columns: repeat(13, 1fr); grid-template-rows: repeat(7, 1fr); gap: 5px;">
<ng-container *ngFor="let item of dashboardArray">
<div [style.gridColumn]="item.x + 1" [style.gridRow]="item.y + 1"
[style.gridColumnEnd]="item.x + item.cols + 1" [style.gridRowEnd]="item.y + item.rows + 1">
<div *ngIf="item.name === 'textField'" class="title-card card-title"
[style.text-align]="item.alignment !== '' ? item.alignment : 'left'"
[style.line-height]="item.textlineheight !== '' ? item.textlineheight : '1'"
[style.font-family]="item.fontName !== '' ? item.fontName : 'Metropolis'"
[style.font-size]="item.fontSize !== '' ? item.fontSize : '100%'"
[style.font-style]="item.italic == true ? 'Italic' : 'normal'"
[style.font-weight]="item.bold == true ? 'bold' : 'normal'" [style.text-decoration]="(item.underline && item.strikethough) ? 'underline line-through' :
(item.underline ? 'underline' : (item.strikethough ? 'line-through' : 'none'))"
[style.background-color]="item.backgroundcolor !== '' ? item.backgroundcolor : 'white'"
[style.color]="item.textcolor !== '' ? item.textcolor : 'black'"
[style.background-color]="item.conditionValue == app[transform(item.fieldtext) ] ? item.conditionbackgroundcolor : item.backgroundcolor"
[style.color]="item.conditionValue == app[transform(item.fieldtext) ] ? item.conditiontextcolor : item.textcolor">
{{beforeText(item.fieldtext)}}
{{ app[transform(item.fieldtext) ] }}
{{afterText(item.fieldtext)}}
</div>
<div *ngIf="item.name === 'dateField'" class="title-card card-title"
[style.text-align]="item.alignment !== '' ? item.alignment : 'left'"
[style.line-height]="item.textlineheight !== '' ? item.textlineheight : '1'"
[style.font-family]="item.fontName !== '' ? item.fontName : 'Metropolis'"
[style.font-size]="item.fontSize !== '' ? item.fontSize : '100%'"
[style.font-style]="item.italic == true ? 'Italic' : 'normal'"
[style.font-weight]="item.bold == true ? 'bold' : 'normal'" [style.text-decoration]="(item.underline && item.strikethough) ? 'underline line-through' :
(item.underline ? 'underline' : (item.strikethough ? 'line-through' : 'none'))"
[style.background-color]="item.backgroundcolor !== '' ? item.backgroundcolor : 'white'"
[style.color]="item.textcolor !== '' ? item.textcolor : 'black'"
[style.background-color]="item.conditionValue == app[transform(item.fieldtext) ] ? item.conditionbackgroundcolor : item.backgroundcolor"
[style.color]="item.conditionValue == app[transform(item.fieldtext) ] ? item.conditiontextcolor : item.textcolor">
{{beforeText(item.fieldtext)}}
{{ app[transform(item.fieldtext) ] | date}}
{{afterText(item.fieldtext)}}
</div>
<div *ngIf="item.name === 'numberField'" class="title-card card-title"
[style.text-align]="item.alignment !== '' ? item.alignment : 'left'"
[style.line-height]="item.textlineheight !== '' ? item.textlineheight : '1'"
[style.font-family]="item.fontName !== '' ? item.fontName : 'Metropolis'"
[style.font-size]="item.fontSize !== '' ? item.fontSize : '100%'"
[style.font-style]="item.italic == true ? 'Italic' : 'normal'"
[style.font-weight]="item.bold == true ? 'bold' : 'normal'" [style.text-decoration]="(item.underline && item.strikethough) ? 'underline line-through' :
(item.underline ? 'underline' : (item.strikethough ? 'line-through' : 'none'))"
[style.background-color]="item.backgroundcolor !== '' ? item.backgroundcolor : 'white'"
[style.color]="item.textcolor !== '' ? item.textcolor : 'black'"
[style.background-color]="item.conditionValue == app[transform(item.fieldtext) ] ? item.conditionbackgroundcolor : item.backgroundcolor"
[style.color]="item.conditionValue == app[transform(item.fieldtext) ] ? item.conditiontextcolor : item.textcolor">
{{beforeText(item.fieldtext)}}
{{ app[transform(item.fieldtext) ]}}
{{afterText(item.fieldtext)}}
</div>
<div *ngIf="item.name === 'Line'" class="title-card card-title"
[style.text-align]="item.alignment !== '' ? item.alignment : 'left'"
[style.line-height]="item.textlineheight !== '' ? item.textlineheight : '1'"
[style.font-family]="item.fontName !== '' ? item.fontName : 'Metropolis'"
[style.font-size]="item.fontSize !== '' ? item.fontSize : '100%'"
[style.font-style]="item.italic == true ? 'Italic' : 'normal'"
[style.font-weight]="item.bold == true ? 'bold' : 'normal'" [style.text-decoration]="(item.underline && item.strikethough) ? 'underline line-through' :
(item.underline ? 'underline' : (item.strikethough ? 'line-through' : 'none'))"
[style.background-color]="item.backgroundcolor !== '' ? item.backgroundcolor : 'white'"
[style.color]="item.textcolor !== '' ? item.textcolor : 'black'">
<hr>
</div>
<div *ngIf="item.name === 'Icon'" class="icon-card"
[style.text-align]="item.alignment !== '' ? item.alignment : 'left'"
[style.line-height]="item.textlineheight !== '' ? item.textlineheight : '1'"
[style.font-family]="item.fontName !== '' ? item.fontName : 'Metropolis'"
[style.font-size]="item.fontSize !== '' ? item.fontSize : '100%'"
[style.font-style]="item.italic == true ? 'Italic' : 'normal'"
[style.font-weight]="item.bold == true ? 'bold' : 'normal'" [style.text-decoration]="(item.underline && item.strikethough) ? 'underline line-through' :
(item.underline ? 'underline' : (item.strikethough ? 'line-through' : 'none'))"
[style.background-color]="item.backgroundcolor !== '' ? item.backgroundcolor : 'white'"
[style.color]="item.textcolor !== '' ? item.textcolor : 'black'">
<clr-icon [attr.shape]="item.iconName"></clr-icon>
</div>
<div *ngIf="item.name == 'Image'"
[style.text-align]="item.alignment !== '' ? item.alignment : 'left'"
[style.line-height]="item.textlineheight !== '' ? item.textlineheight : '1'"
[style.font-family]="item.fontName !== '' ? item.fontName : 'Metropolis'"
[style.font-size]="item.fontSize !== '' ? item.fontSize : '100%'"
[style.font-style]="item.italic == true ? 'Italic' : 'normal'"
[style.font-weight]="item.bold == true ? 'bold' : 'normal'" [style.text-decoration]="(item.underline && item.strikethough) ? 'underline line-through' :
(item.underline ? 'underline' : (item.strikethough ? 'line-through' : 'none'))"
[style.background-color]="item.backgroundcolor !== '' ? item.backgroundcolor : 'white'"
[style.color]="item.textcolor !== '' ? item.textcolor : 'black'"
[style.background-color]="item.conditionValue == app[transform(item.fieldtext) ] ? item.conditionbackgroundcolor : item.backgroundcolor"
[style.color]="item.conditionValue == app[transform(item.fieldtext) ] ? item.conditiontextcolor : item.textcolor">
<img id="filePreview" [src]="item.imageURL" alt="File Preview"
[style.width]="item.imagewidth !== '' ? item.imagewidth + 'px' : '100px'"
[style.height]="item.imagewidth !== '' ? item.imagewidth + 'px' : '100px'">
</div>
</div>
</ng-container>
</div>
</div>
</div>
</div>
</div>
</div>
</ng-container>
</div>
<clr-modal [(clrModalOpen)]="rsModaldescription" [clrModalSize]="'xl'" [clrModalStaticBackdrop]="true">
<div class="modal-body">
<textarea class="form-control" style="width:100%; height: 400px;" readonly>{{rowSelected}}</textarea>
</div>
</clr-modal>
<!-- // EDIT DATA......... -->
<clr-modal [(clrModalOpen)]="modalEdit" [clrModalSize]="'lg'" [clrModalStaticBackdrop]="true">
<h3 class="modal-title">Update DlfHeader
<!--update button -->
</h3>
<div class="modal-body" *ngIf="rowSelected.id">
<h2 class="heading">{{rowSelected.id}}</h2>
<!-- button -->
<form>
<div class="clr-row">
<div class="clr-col-sm-12">
<label>Name</label>
<input class="clr-input" type="text" [(ngModel)]="rowSelected.name" name="name" />
</div>
<div class="clr-col-sm-12">
<label> Description</label>
<textarea cols="10" rows="2" [(ngModel)]="rowSelected.description" name="description "
placeholder="Textarea"> </textarea>
</div>
<div class="clr-col-sm-12">
<label> Active</label>
<input type="checkbox" name="active" clrToggle [(ngModel)]="rowSelected.active" />
</div>
<div class="clr-col-sm-12">
<label>Technolgy Stack</label>
<input class="clr-input" type="text" [(ngModel)]="rowSelected.techstack" name="techstack" />
</div>
<div class="clr-col-sm-12">
<label>type</label>
<input class="clr-input" type="text" [(ngModel)]="rowSelected.type" name="type" />
</div>
<div class="clr-col-sm-12">
<label> Active</label>
<input type="checkbox" name="active" clrToggle [(ngModel)]="rowSelected.active" />
</div>
</div>
<!-- form code start -->
<div *ngIf="checkFormCode">
<h4 style="font-weight: 300;display: inline;">Extension</h4>
<br>
<hr>
<div class="clr-row">
<div class="clr-col-4" *ngFor="let field of additionalFieldsFromBackend">
<ng-container *ngIf="field.formCode === formcode" [ngSwitch]="field.fieldType">
<!-- Text Input --> <label *ngSwitchCase="'text'">{{ field.fieldName }}</label>
<input *ngSwitchCase="'text'" [type]="field.fieldType" name="{{ field.extValue }}"
[(ngModel)]="rowSelected[field.extValue]" class="clr-input" />
<!-- Date Input --> <label *ngSwitchCase="'date'">{{ field.fieldName }}</label>
<input *ngSwitchCase="'date'" [type]="field.fieldType" name="{{ field.extValue }}"
[(ngModel)]="rowSelected[field.extValue]" class="clr-input" />
<!-- Textarea --> <label *ngSwitchCase="'textarea'">{{ field.fieldName }}</label>
<textarea *ngSwitchCase="'textarea'" name="{{ field.extValue }}" [(ngModel)]="rowSelected[field.extValue]"
col="10" row="2"></textarea>
<!-- Checkbox --> <label *ngSwitchCase="'checkbox'">{{ field.fieldName }}</label><br>
<input *ngSwitchCase="'checkbox'" [type]="field.fieldType" name="{{ field.extValue }}"
[(ngModel)]="rowSelected[field.extValue]" class="clr-checkbox" />
</ng-container>
</div>
</div>
</div>
<!-- form code end -->
<div class="modal-footer">
<button type="button" class="btn btn-outline" (click)="modalEdit = false">Cancel</button>
<button type="submit" class="btn btn-primary" (click)="onUpdate(rowSelected.id)">Update</button>
</div>
</form>
</div>
</clr-modal>
<clr-modal [(clrModalOpen)]="modaldelete" [clrModalSize]="'lg'" [clrModalStaticBackdrop]="true">
<div class="modal-body" *ngIf="rowSelected.id">
<h1 class="delete">Are You Sure Want to delete?</h1>
<h2 class="heading">{{rowSelected.id}}</h2>
<div class="modal-footer">
<button type="button" class="btn btn-outline" (click)="modaldelete = false">Cancel</button>
<button type="button" (click)="delete(rowSelected.id)" class="btn btn-primary">Delete</button>
</div>
</div>
</clr-modal>
<!-- ADD FORM ..... -->
<clr-modal [(clrModalOpen)]="modalAdd" [clrModalSize]="'lg'" [clrModalStaticBackdrop]="true">
<h3 class="modal-title">Add DlfHeader
<!-- aeroplane icon -->
&nbsp; &nbsp; &nbsp; &nbsp;
<a *ngIf="userrole.includes('ADMIN')" style="float: right;" href="javascript:void(0)" role="tooltip"
aria-haspopup="true" class="tooltip tooltip-sm tooltip-bottom-left">
<a id="build_extension" [routerLink]="['../extension/all']" [queryParams]="{ formCode: 'Dlf_header_formCode' }">
<clr-icon shape="airplane" size="32"></clr-icon>
</a>
<span class="tooltip-content">Form Extension</span>
</a>
</h3>
<div class="modal-body">
<form [formGroup]="entryForm">
<div class="clr-row" style="height: fit-content;">
<div class="clr-col-sm-12">
<label> Name</label>
<input class="clr-input" type="text" formControlName="name" />
</div>
<div class="clr-col-sm-12">
<label> Description</label>
<textarea cols="10" rows="2" formControlName="description" placeholder="Textarea"> </textarea>
</div>
<div class="clr-col-sm-12">
<label> Technolgy Stack</label>
<input class="clr-input" type="text" formControlName="techstack" />
</div>
<div class="clr-col-sm-12">
<label> type</label>
<input class="clr-input" type="text" formControlName="type" />
</div>
<div class="clr-col-sm-12">
<label> Active</label>
<input type="checkbox" formControlName="active" clrToggle />
</div>
</div>
<!-- form code start -->
<div *ngIf="checkFormCode">
<h4 style="font-weight: 300;display: inline;">Extension</h4>
<br>
<hr>
<div class="clr-row">
<div class="clr-col-4" *ngFor="let field of additionalFieldsFromBackend">
<ng-container *ngIf="field.formCode === formcode" [ngSwitch]="field.fieldType">
<!-- Text Input --> <label *ngSwitchCase="'text'">{{ field.fieldName }}</label>
<input *ngSwitchCase="'text'" [type]="field.fieldType" [formControlName]="field.extValue"
class="clr-input" />
<!-- Date Input --> <label *ngSwitchCase="'date'">{{ field.fieldName }}</label>
<input *ngSwitchCase="'date'" [type]="field.fieldType" [formControlName]="field.extValue"
class="clr-input" />
<!-- Textarea --> <label *ngSwitchCase="'textarea'">{{ field.fieldName }}</label>
<textarea *ngSwitchCase="'textarea'" [formControlName]="field.extValue" col="10" row="2"></textarea>
<!-- Checkbox --> <label *ngSwitchCase="'checkbox'">{{ field.fieldName }}</label><br>
<input *ngSwitchCase="'checkbox'" [type]="field.fieldType" [formControlName]="field.extValue"
class="clr-checkbox" />
</ng-container>
</div>
</div>
</div>
<!-- form code end -->
<div class="modal-footer">
<button type="button" class="btn btn-outline" (click)="modalAdd = false">Cancel</button>
<button type="submit" class="btn btn-primary" (click)="onSubmit()">ADD</button>
</div>
</form>
</div>
</clr-modal>
<!-- htmlpopup -->

View File

@ -0,0 +1,78 @@
//@import "../../../../assets/scss/var";
.s-info-bar {
display: flex;
flex-direction: row;
justify-content: space-between;
button {
outline: none;
}
}
.delete,.heading{
text-align: center;
color: red;
}
.entry-pg {
width: 750px;
}
.button1::after {
content: none;
}
.button1:hover::after {
content: "ADD ROWS";
}
.section {
background-color: #dddddd;
height: 40px;
}
.section p {
//color: white;
padding: 10px;
font-size: 18px;
}
.clr-input {
color: #212529;
border: 1px solid #ced4da;
border-radius: 0.25rem;
padding: 0.75rem 0.75rem;
margin-top: 3px;
width: 100%;
margin-bottom: 10px;
}
.clr-file {
color: #212529;
border: 1px solid #ced4da;
border-radius: 0.25rem;
//padding: 0.6rem 0.75rem;
margin-top: 3px;
width: 100%;
margin-bottom: 10px;
}
.center {
text-align: center;
}
select{
width: 100%;
margin-top: 3px;
padding: 5px 5px;
border: 1px solid #ccc;
border-radius: 4px;
}
input[type=text],[type=date],[type=number],textarea {
width: 100%;
padding: 15px 15px;
background-color:rgb(255, 255, 255);
// margin: 8px 0;
display: inline-block;
border: 1px solid #ccc;
border-radius: 4px;
box-sizing: border-box;
}
.error_mess {
color: red;
}

View File

@ -0,0 +1,232 @@
import { Component, OnInit } from '@angular/core';
import { ToastrService } from 'ngx-toastr';
import { AlertService } from 'src/app/services/alert.service';
import { Dlf_headerservice } from './Dlf_header.service';
import { AbstractControl, FormArray, FormBuilder, FormGroup, Validators, ValidationErrors } from '@angular/forms';
import { ExtensionService } from 'src/app/services/fnd/extension.service';
import { DashboardContentModel2 } from 'src/app/models/builder/dashboard';
import { Dlf_headercardvariable } from './Dlf_header_cardvariable';
import { UserInfoService } from 'src/app/services/user-info.service';
import { ActivatedRoute, Router } from '@angular/router';
declare var JsBarcode: any;
@Component({
selector: 'app-Dlf_header',
templateUrl: './Dlf_header.component.html',
styleUrls: ['./Dlf_header.component.scss']
})
export class Dlf_headerComponent implements OnInit {
cardButton = Dlf_headercardvariable.cardButton;
cardmodeldata = Dlf_headercardvariable.cardmodeldata;
public dashboardArray: DashboardContentModel2[];
isCardview = Dlf_headercardvariable.cardButton;
cardmodal; changeView() {
this.isCardview = !this.isCardview;
}
beforeText(fieldtext: string): string { // Extract the text before the first '<'
const index = fieldtext.indexOf('<');
return index !== -1 ? fieldtext.substring(0, index) : fieldtext;
}
afterText(fieldtext: string): string { // Extract the text after the last '>'
const index = fieldtext.lastIndexOf('>');
return index !== -1 ? fieldtext.substring(index + 1) : '';
}
transform(fieldtext: string): string {
const match = fieldtext.match(/<([^>]*)>/);
return match ? match[1] : ''; // Extract the text between '<' and '>'
}
userrole;
rowSelected: any = {};
modaldelete = false;
modalEdit = false;
modalAdd = false;
public entryForm: FormGroup;
loading = false;
product;
modalOpenedforNewLine = false;
newLine: any;
additionalFieldsFromBackend: any[] = [];
formcode = 'Dlf_header_formCode'
tableName = 'Dlf_header'; checkFormCode; selected: any[] = []; constructor(
private extensionService: ExtensionService,
private userInfoService: UserInfoService,
private mainService: Dlf_headerservice,
private alertService: AlertService,
private toastr: ToastrService,
private _fb: FormBuilder,
private router: Router,
private route: ActivatedRoute,
) { }
// component button
ngOnInit(): void {
if (this.cardmodeldata !== '') {
this.cardmodal = JSON.parse(this.cardmodeldata);
this.dashboardArray = this.cardmodal.dashboard.slice();
console.log(this.dashboardArray)
}
this.userrole = this.userInfoService.getRoles();
this.getData();
this.entryForm = this._fb.group({
name: [null],
description: [null],
active: [false],
type: [null],
}); // component_button200
// form code start
this.extensionService.getJsonObjectsByFormCodeList(this.formcode).subscribe(data => {
console.log(data);
const jsonArray = data.map((str) => JSON.parse(str));
this.additionalFieldsFromBackend = jsonArray;
this.checkFormCode = this.additionalFieldsFromBackend.some(field => field.formCode === "Dlf_header_formCode");
console.log(this.checkFormCode);
console.log(this.additionalFieldsFromBackend);
if (this.additionalFieldsFromBackend && this.additionalFieldsFromBackend.length > 0) {
this.additionalFieldsFromBackend.forEach(field => {
if (field.formCode === this.formcode) {
if (!this.entryForm.contains(field.extValue)) {
// Add the control only if it doesn't exist in the form
this.entryForm.addControl(field.extValue, this._fb.control(field.fieldValue));
}
}
});
}
});
console.log(this.entryForm.value);
// form code end
}
error;
getData() {
this.mainService.getAll().subscribe((data) => {
console.log(data);
this.product = data;
if (this.product.length == 0) {
this.error = "No Data Available"
}
}, (error) => {
console.log(error);
if (error) {
this.error = "Server Error";
}
});
}
onEdit(row) {
this.rowSelected = row;
this.modalEdit = true;
}
onDelete(row) {
this.rowSelected = row;
this.modaldelete = true;
}
delete(id) {
this.modaldelete = false;
console.log("in delete " + id);
this.mainService.delete(id).subscribe(
(data) => {
console.log(data);
this.ngOnInit();
if (data) { this.toastr.success('Deleted successfully'); }
});
}
onUpdate(id) {
this.modalEdit = false;
//console.log("in update");
console.log("id " + id);
console.log(this.rowSelected);
//console.log("out update");
this.mainService.update(id, this.rowSelected).subscribe(
(data) => {
console.log(data);
if (data || data.status >= 200 && data.status <= 299) {
this.toastr.success("Update Successfully");
}
setTimeout(() => {
this.ngOnInit();
}, 500);
}, (error) => {
console.log(error);
if (error.status >= 200 && error.status <= 299) {
// this.toastr.success("update Succesfully");
}
if (error.status >= 400 && error.status <= 499) {
this.toastr.error("Not Updated");
}
if (error.status >= 500 && error.status <= 599) {
this.toastr.error("Not Updated");
}
});
setTimeout(() => {
this.ngOnInit();
}, 500);
}
onCreate() {
this.modalAdd = false;
this.mainService.create(this.entryForm.value).subscribe(
(data) => {
console.log(data);
if (data || data.status >= 200 && data.status <= 299) {
this.toastr.success("Added Successfully");
}
setTimeout(() => {
this.ngOnInit();
}, 500);
}, (error) => {
console.log(error);
if (error.status >= 200 && error.status <= 299) {
// this.toastr.success("Added Succesfully");
}
if (error.status >= 400 && error.status <= 499) {
this.toastr.error("Not Added");
}
if (error.status >= 500 && error.status <= 599) {
this.toastr.error("Not Added");
}
});
setTimeout(() => {
this.ngOnInit();
}, 500);
}
goToAdd(row) {
this.modalAdd = true; this.submitted = false;
}
submitted = false;
onSubmit() {
console.log(this.entryForm.value);
this.submitted = true;
if (this.entryForm.invalid) {
return;
} this.onCreate();
}
rsModaldescription = false;
goToReplaceStringdescription(row) {
this.rowSelected = row; this.rsModaldescription = true;
}
// updateaction
goToDlfLine(id: any) {
this.router.navigate(["../Design_lbrary/" + id], { relativeTo: this.route })
}
}

View File

@ -0,0 +1,41 @@
import { Injectable } from '@angular/core';
import { Observable } from "rxjs";
import { HttpClient, HttpHeaders, HttpParams, } from "@angular/common/http";
import { ApiRequestService } from "src/app/services/api/api-request.service";
import { environment } from 'src/environments/environment';
@Injectable({
providedIn: 'root'
})
export class Dlf_headerservice{
private baseURL = "Dlf_header/Dlf_header" ; constructor(
private http: HttpClient,
private apiRequest: ApiRequestService,
) { }
getAll(page?: number, size?: number): Observable<any> {
return this.apiRequest.get(this.baseURL);
}
getById(id: number): Observable<any> {
const _http = this.baseURL + "/" + id;
return this.apiRequest.get(_http);
}
create(data: any): Observable<any> {
return this.apiRequest.post(this.baseURL, data);
}
update(id: number, data: any): Observable<any> {
const _http = this.baseURL + "/" + id;
return this.apiRequest.put(_http, data);
}
delete(id: number): Observable<any> {
const _http = this.baseURL + "/" + id;
return this.apiRequest.delete(_http);
}
// updateaction
}

View File

@ -0,0 +1,4 @@
export const Dlf_headercardvariable = {
"cardButton": false,
"cardmodeldata": ``
}

View File

@ -47,6 +47,11 @@ export class SiteTreeservice {
return this.apiRequest.get(_http);
}
getDesignLibraryByheader(headerId: number, operationType: string, fieldtype: string): Observable<any> {
const _http = "Design_lbrary/Design_lbrary/line/unique?headerId=" + headerId + "&operationType=" + operationType + "&fieldType=" + fieldtype;
return this.apiRequest.get(_http);
}
callLlm(data: any): Observable<any> {
return this.http.post(`${this.nodeURL}/chatMemory`, data);
}
@ -60,7 +65,7 @@ export class SiteTreeservice {
return this.apiRequest.get(`api/html/generate/html/id/` + id);
}
deployProj(data: any, projId: number): Observable<any> {
deployProj(projId: number, data: any): Observable<any> {
return this.apiRequest.post(`sureops/deploy?projId=` + projId, data);
}

View File

@ -121,7 +121,6 @@
</button>
<!-- <button (click)="uploadHtmlFiles(11096)" class="action-btn save-btn"> -->
<button (click)="createHtmlFiles()" class="action-btn save-btn">
💾 Save All HTML Files
</button>

View File

@ -385,10 +385,13 @@ HTML Only. No CSS.
return resolve(this.promptHashCache[hash]);
}
// const enhanced = await this.callLlm(enhancedPrompt);
// this.promptHashCache[hash] = enhanced;
const enhanced = await this.callLlm(enhancedPrompt);
resolve(baseJsonString);
console.log('enhanced prmpt ',enhanced);
this.promptHashCache[hash] = enhanced;
// resolve(baseJsonString);
resolve(this.promptHashCache[hash]);
} catch (err) {
console.error('❌ JSON parse error:', err);
resolve('{}');
@ -562,7 +565,7 @@ HTML Only. No CSS.
pageHtmlMap[pageName] = html;
}
this.siteTreeService.deployProj(pageHtmlMap, projId).subscribe(
this.siteTreeService.deployProj(projId,pageHtmlMap).subscribe(
(data) => {
console.log(data);
if (data || data.status >= 200 && data.status <= 299) {

View File

@ -91,6 +91,35 @@ export class TreeVisualizerComponent {
"Feature Section": "Choose a template to replace with uploaded data"
}
}`;
suffix1: string = `
🔁 You are a JSON structure generator for website page hierarchies.
You will return only a JSON object in a strictly hierarchical tree structure. Do not include any explanation, text, or markdown formatting like \`\`\`json — just return pure JSON only.
Each page should be a key. For subpages like "Login", "Projects", or "New Project", nest them under a "Children" key of their parent page.
Each page must include specific sections as keys (like "Navbar", "Header Section", "Feature Section" etc.) with either an empty object {} or a short description as the value.
Do not return any explanation, text, or markdown formatting only return the raw JSON object exactly in this format.
Do not include:
- Any explanation before or after the JSON
- Any markdown formatting like \`\`\` or json
- Any text like "Here is..." or "Please note..."
Output must look like this:
{
"Home": {
"Navbar": {},
"Header Section": "Intro...",
"Children": {
"Login": {
"Navbar": {},
"Header Section": "Login form...",
"Footer": {}
}
}
}
}`;
treeData: any = null;
rawInputText: string = `make a website , where we can login , sign up.
inside that there is a menu of icard where we can add a icard detail iacardname, description
@ -194,102 +223,73 @@ after click this icard inside we upload excel of student data, icard template, a
generateJson() {
console.log('genearte json start ')
const suffix1 = `
🔁 You are a JSON structure generator for website page hierarchies.
You will return only a JSON object in a strictly hierarchical tree structure. Do not include any explanation, text, or markdown formatting like \`\`\`json — just return pure JSON only.
Each page should be a key. For subpages like "Login", "Projects", or "New Project", nest them under a "Children" key of their parent page.
Each page must include specific sections as keys (like "Navbar", "Header Section", "Feature Section" etc.) with either an empty object {} or a short description as the value.
Do not return any explanation, text, or markdown formatting only return the raw JSON object exactly in this format.
Do not include:
- Any explanation before or after the JSON
- Any markdown formatting like \`\`\` or json
- Any text like "Here is..." or "Please note..."
Output must look like this:
{
"Home": {
"Navbar": {},
"Header Section": "Intro...",
"Children": {
"Login": {
"Navbar": {},
"Header Section": "Login form...",
"Footer": {}
}
}
}
}`;
const suffix = ` You are a JSON structure generator for website page hierarchies.
You are a JSON structure generator for website UI and sitemap hierarchy.
You are a JSON structure generator for website UI and sitemap hierarchy.
Generate a strictly hierarchical JSON tree that represents the entire page flow of a website. The root of the tree must always be the "Home" page. All other pages (like Login, Sign Up, Projects, Dashboard, etc.) must be nested as subpages using a "Children" key under their logical parent based on the described user flow not all pages should be flat or at root level.
Generate a strictly hierarchical JSON tree that represents the entire page flow of a website. The root of the tree must always be the "Home" page. All other pages (like Login, Sign Up, Projects, Dashboard, etc.) must be nested as subpages using a "Children" key under their logical parent based on the described user flow not all pages should be flat or at root level.
Each page must include meaningful UI sections as keys like "Navbar", "Header Section", "Feature Section", "Form Section", "Footer", etc.
Each section must include a short and clear description of its purpose or content to assist in frontend UI development.
Each page must include meaningful UI sections as keys like "Navbar", "Header Section", "Feature Section", "Form Section", "Footer", etc.
Each section must include a short and clear description of its purpose or content to assist in frontend UI development.
Analyze the flow implied in the prompt:
- Pages that are accessed after some action (e.g., "after login", "inside a project", "upon click") must be nested as children.
- Reuse common sections like "Navbar" or "Footer" wherever needed.
- Pages like Privacy Policy or Terms and Conditions can remain at root or in Footer reference if needed.
Analyze the flow implied in the prompt:
- Pages that are accessed after some action (e.g., "after login", "inside a project", "upon click") must be nested as children.
- Reuse common sections like "Navbar" or "Footer" wherever needed.
- Pages like Privacy Policy or Terms and Conditions can remain at root or in Footer reference if needed.
The following standard pages must always be included with detailed section-level breakdown:
The following standard pages must always be included with detailed section-level breakdown:
- **Home**: General overview of the website, with call-to-action, features, testimonials, and a footer.
- **About**: Brief company history, mission/vision, and team member highlights.
- **Services**: List of services offered, with description, icons, or pricing cards.
- **Contact**: Contact form (name, email, message), business info, phone, map.
- **FAQ**: Accordion or expandable list of common questions and answers.
- **Blog**: List of articles or posts, with title, thumbnail, and excerpt.
- **Login**: Form section with input fields for email/username and password, login button, forgot password link.
- **Sign Up**: Form section with full name, email, password, confirm password, sign-up button.
- **Privacy Policy**: Legal text describing how user data is handled.
- **Terms and Conditions**: Legal text outlining site usage policies.
- **Home**: General overview of the website, with call-to-action, features, testimonials, and a footer.
- **About**: Brief company history, mission/vision, and team member highlights.
- **Services**: List of services offered, with description, icons, or pricing cards.
- **Contact**: Contact form (name, email, message), business info, phone, map.
- **FAQ**: Accordion or expandable list of common questions and answers.
- **Blog**: List of articles or posts, with title, thumbnail, and excerpt.
- **Login**: Form section with input fields for email/username and password, login button, forgot password link.
- **Sign Up**: Form section with full name, email, password, confirm password, sign-up button.
- **Privacy Policy**: Legal text describing how user data is handled.
- **Terms and Conditions**: Legal text outlining site usage policies.
Do not include:
- Any explanation before or after the JSON
- Any markdown formatting like \`\`\` or json
- Any natural language response
- Return only pure JSON no explanation, no headings, no markdown formatting.
Do not include:
- Any explanation before or after the JSON
- Any markdown formatting like \`\`\` or json
- Any natural language response
- Return only pure JSON no explanation, no headings, no markdown formatting.
Output JSON example structure should look like this:
Output JSON example structure should look like this:
{
"Home": {
"Navbar": "Top navigation with logo, links to all main pages, and call-to-action button",
"Header Section": "Headline with subheading and call-to-action button",
"Feature Section": "Three features highlighted with icons and descriptions",
"Testimonial Section": "Customer reviews in carousel layout",
"Footer": "Footer with navigation links, social icons, and legal page links",
"Children": {
"About": {
"Header Section": "Intro about company mission and values",
"Team Section": "Photos and bios of core team members"
},
"Services": {
"Header Section": "List of core services offered",
"Pricing Section": "Cards with service pricing and features"
},
"Contact": {
"Header Section": "Contact form with name, email, and message fields",
"Map Section": "Google Maps iframe showing location"
},
...
{
"Home": {
"Navbar": "Top navigation with logo, links to all main pages, and call-to-action button",
"Header Section": "Headline with subheading and call-to-action button",
"Feature Section": "Three features highlighted with icons and descriptions",
"Testimonial Section": "Customer reviews in carousel layout",
"Footer": "Footer with navigation links, social icons, and legal page links",
"Children": {
"About": {
"Header Section": "Intro about company mission and values",
"Team Section": "Photos and bios of core team members"
},
"Services": {
"Header Section": "List of core services offered",
"Pricing Section": "Cards with service pricing and features"
},
"Contact": {
"Header Section": "Contact form with name, email, and message fields",
"Map Section": "Google Maps iframe showing location"
},
...
}
},
"Privacy Policy": {
"Content Section": "Full legal description of data usage and user rights"
},
"Terms and Conditions": {
"Content Section": "Rules and legal terms for using the site or service"
}
},
"Privacy Policy": {
"Content Section": "Full legal description of data usage and user rights"
},
"Terms and Conditions": {
"Content Section": "Rules and legal terms for using the site or service"
}
}`;
}`;
const payload = {
@ -302,29 +302,117 @@ Analyze the flow implied in the prompt:
this.siteTreeService.callLlm(payload).subscribe({
next: (res) => {
console.log('response ', res)
console.log('llm response ', res)
if (res && res.responseContent) {
this.inputJson = res.responseContent;
console.log('input json ', this.inputJson)
// this.inputJson = res.responseContent;
// console.log('input json ', this.inputJson)
// 🔁 Now call update API
const updatePayload = {
prompt: this.rawInputText + ' ',
model: this.inputJson // model format expected by backend
};
// const updatePayload = {
// prompt: this.rawInputText + ' ',
// model: this.inputJson // model format expected by backend
// console.log('payload : ', updatePayload);
console.log('payload : ', updatePayload);
this.siteTreeService.update(this.id, updatePayload).subscribe({
next: (resp) => {
console.log('✅ JSON updated on server:', resp);
},
error: (err) => {
console.error('❌ Failed to update JSON on server:', err);
alert('Update to server failed');
}
});
try {
let parsedJson = JSON.parse(res.responseContent); // Parse LLM JSON
const topLevelPages = Object.keys(parsedJson);
let pendingCalls = topLevelPages.length;
topLevelPages.forEach(pageName => {
this.siteTreeService.getDesignLibraryByheader(2, 'template 1', pageName).subscribe({
next: (designResponse) => {
if (designResponse && Object.keys(designResponse).length > 0) {
console.log(`✅ Replacing "${pageName}" with design library JSON that is : `, designResponse.htmljson);
// try {
// // Parse the stringified JSON if necessary
// let raw = designResponse.htmljson;
// // If it's a string, parse it
// const parsed = typeof raw === 'string' ? JSON.parse(`{${raw}}`) : raw;
// // Automatically extract the first keys value (usually same as pageName)
// const firstKey = Object.keys(parsed)[0];
// const extractedValue = parsed[firstKey];
// console.log(`✅ Extracted value for "${pageName}":`, extractedValue);
// // Replace just the content, not the outer key
// parsedJson[pageName] = extractedValue;
// console.log(`✅ after Replaced "${pageName}" jso is : `, parsedJson);
// } catch (parseErr) {
// console.warn(`⚠️ Could not parse design library JSON for "${pageName}". Keeping original.`);
// }
try {
let raw = designResponse.htmljson;
// Parse the raw string into object if necessary
const parsed = typeof raw === 'string' ? JSON.parse(`{${raw}}`) : raw;
// Extract the first keys value (actual page content)
const firstKey = Object.keys(parsed)[0];
const extractedValue = parsed[firstKey];
// Get existing Children (if any) before replacing
const existingPageData = parsedJson[pageName] || {};
const preservedChildren = existingPageData['Children'];
// Merge: use extractedValue + put Children back
parsedJson[pageName] = {
...extractedValue,
...(preservedChildren ? { Children: preservedChildren } : {})
};
console.log(`✅ Merged design + preserved Children for "${pageName}"`, parsedJson[pageName]);
} catch (parseErr) {
console.warn(`⚠️ Could not parse design library JSON for "${pageName}". Keeping original.`, parseErr);
}
} else {
console.log(` No design library found for "${pageName}", keeping original`);
}
checkAndUpload();
},
error: (err) => {
console.error(`❌ Error fetching design library for "${pageName}":`, err);
checkAndUpload(); // Still proceed
}
});
});
const checkAndUpload = () => {
pendingCalls--;
if (pendingCalls === 0) {
this.inputJson = JSON.stringify(parsedJson);
const updatePayload = {
prompt: this.rawInputText + ' ',
model: this.inputJson
};
console.log('✅ Final merged JSON ready:', updatePayload);
this.siteTreeService.update(this.id, updatePayload).subscribe({
next: (resp) => {
console.log('✅ JSON updated on server:', resp);
},
error: (err) => {
console.error('❌ Failed to update JSON on server:', err);
alert('Update to server failed');
}
});
}
};
} catch (err) {
console.error('❌ Failed to parse LLM JSON:', err);
alert('Invalid JSON received from LLM');
}
}
},
error: (err) => {
@ -334,7 +422,6 @@ Analyze the flow implied in the prompt:
});
}
fetchTreeById(id: number) {
this.siteTreeService.getById(id).subscribe({
next: (res) => {

View File

@ -99,6 +99,7 @@ import { TreeVisualizerComponent } from './fnd/SiteTreeBuilder/tree-visualizer.c
import { SiteTreeComponent } from './fnd/SiteTreeBuilder/SiteBuilderGrid/SiteTree.component';
import { EditstepperComponent } from './BuilderComponents/vpspack/Visa_application/VisaOrderWorkflow/editstepper.component';
import { Design_lbraryComponent } from './fnd/SiteTreeBuilder/Design_lbrary/Design_lbrary.component';
import { Dlf_headerComponent } from './fnd/SiteTreeBuilder/Dlf_header/Dlf_header.component';
@ -270,8 +271,11 @@ const routes: Routes = [
// buildercomponents
{ path: 'Dlf_header', component: Dlf_headerComponent },
// { path: 'Design_lbrary', component: Design_lbraryComponent },
{ path: 'Design_lbrary/:id', component: Design_lbraryComponent },
{path:'Design_lbrary',component:Design_lbraryComponent},
{ path: 'sitetree', component: SiteTreeComponent, },

View File

@ -126,6 +126,7 @@ import { SiteTreeComponent } from './fnd/SiteTreeBuilder/SiteBuilderGrid/SiteTre
import { TreeNodeComponent } from './fnd/SiteTreeBuilder/TreeNode/tree-node.component';
import { EditstepperComponent } from './BuilderComponents/vpspack/Visa_application/VisaOrderWorkflow/editstepper.component';
import { Design_lbraryComponent } from './fnd/SiteTreeBuilder/Design_lbrary/Design_lbrary.component';
import { Dlf_headerComponent } from './fnd/SiteTreeBuilder/Dlf_header/Dlf_header.component';
@NgModule({
@ -146,7 +147,7 @@ import { Design_lbraryComponent } from './fnd/SiteTreeBuilder/Design_lbrary/Desi
// buildercomponents
Dlf_headerComponent,
Design_lbraryComponent,
SiteTreeComponent,
EditstepperComponent,