buid
This commit is contained in:
parent
4013e475cc
commit
f43ea4fa7f
@ -1,10 +1,10 @@
|
|||||||
import { Component, OnInit } from '@angular/core';
|
import { Component, OnInit } from '@angular/core';
|
||||||
import { Router } from '@angular/router';
|
import { Router } from '@angular/router';
|
||||||
import { LoginService } from '../../../services/api/login.service';
|
import { LoginService } from '../../../services/api/login.service';
|
||||||
import { ActivatedRoute} from '@angular/router';
|
import { ActivatedRoute } from '@angular/router';
|
||||||
import { HttpErrorResponse } from '@angular/common/http';
|
import { HttpErrorResponse } from '@angular/common/http';
|
||||||
import { ToastrService } from 'ngx-toastr';
|
import { ToastrService } from 'ngx-toastr';
|
||||||
import{environment} from 'src/environments/environment';
|
import { environment } from 'src/environments/environment';
|
||||||
// import { ExtendedLoginEnvironment, LoginEnvironment } from './login_environment';
|
// import { ExtendedLoginEnvironment, LoginEnvironment } from './login_environment';
|
||||||
//import { UserRegistrationService } from 'src/app/services/api/user-registration.service';
|
//import { UserRegistrationService } from 'src/app/services/api/user-registration.service';
|
||||||
import { LoginEnvironment } from './login_environment';
|
import { LoginEnvironment } from './login_environment';
|
||||||
@ -20,24 +20,6 @@ export class LoginPageComponent implements OnInit {
|
|||||||
loginEnvironment = LoginEnvironment;
|
loginEnvironment = LoginEnvironment;
|
||||||
showLogin2 = true;
|
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 = '';
|
email = '';
|
||||||
password = '';
|
password = '';
|
||||||
isError = false;
|
isError = false;
|
||||||
@ -46,7 +28,7 @@ export class LoginPageComponent implements OnInit {
|
|||||||
errMsg: string = '';
|
errMsg: string = '';
|
||||||
constructor(
|
constructor(
|
||||||
private router: Router,
|
private router: Router,
|
||||||
private route:ActivatedRoute,
|
private route: ActivatedRoute,
|
||||||
private loginService: LoginService,
|
private loginService: LoginService,
|
||||||
private toastr: ToastrService,
|
private toastr: ToastrService,
|
||||||
) { }
|
) { }
|
||||||
@ -98,9 +80,9 @@ export class LoginPageComponent implements OnInit {
|
|||||||
);
|
);
|
||||||
|
|
||||||
}
|
}
|
||||||
goaccount(){
|
goaccount() {
|
||||||
}
|
}
|
||||||
goforgotpass(){
|
goforgotpass() {
|
||||||
this.router.navigate(["../forgotpass"], { relativeTo: this.route });
|
this.router.navigate(["../forgotpass"], { relativeTo: this.route });
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -4,7 +4,7 @@ export const LoginEnvironment = {
|
|||||||
|
|
||||||
"templateNo": "Template 1",
|
"templateNo": "Template 1",
|
||||||
"loginHeading": "Welcome to",
|
"loginHeading": "Welcome to",
|
||||||
"loginHeading2": "io8.dev",
|
"loginHeading2": "Visa App",
|
||||||
"isSignup": "true",
|
"isSignup": "true",
|
||||||
"loginSignup": "Use your ID to sign in OR ",
|
"loginSignup": "Use your ID to sign in OR ",
|
||||||
"loginSignup2": "create one now",
|
"loginSignup2": "create one now",
|
||||||
|
|||||||
@ -1,4 +1,3 @@
|
|||||||
|
|
||||||
<ol class="breadcrumb breadcrumb-arrow font-trirong">
|
<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://" [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>
|
<li><a href="javascript://"><clr-icon shape="lock"></clr-icon>{{ 'SECURITY' | translate }}</a></li>
|
||||||
@ -6,17 +5,18 @@
|
|||||||
</ol>
|
</ol>
|
||||||
|
|
||||||
|
|
||||||
<!-- <div class="clr-row">
|
<!-- <div class="clr-row">
|
||||||
<div class="clr-col-12" style="text-align: right;">
|
<div class="clr-col-12" style="text-align: right;">
|
||||||
<button id="add" *ngIf="mcreate == 'true'" class="btn btn-primary" (click)="goToAdd()">
|
<button id="add" *ngIf="mcreate == 'true'" class="btn btn-primary" (click)="goToAdd()">
|
||||||
<clr-icon shape="plus"></clr-icon>ADD New
|
<clr-icon shape="plus"></clr-icon>ADD New
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</div> -->
|
</div> -->
|
||||||
<div class="clr-row" style="margin-top: 15px;">
|
<div class="clr-row" style="margin-top: 15px;">
|
||||||
<div class="clr-col">
|
<div class="clr-col">
|
||||||
<h3 style="font-weight: 300;display: inline;">{{ 'MENU_MAINTENANCE' | translate }} </h3>
|
<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>
|
<span class="label label-light-blue" style="display: inline;margin-left: 30px;">{{ 'MAIN_MENU' | translate
|
||||||
|
}}</span><br>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@ -36,7 +36,7 @@
|
|||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<!-- <table class="table">
|
<!-- <table class="table">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th>NO.</th>
|
<th>NO.</th>
|
||||||
@ -144,9 +144,10 @@
|
|||||||
|
|
||||||
</tbody>
|
</tbody>
|
||||||
</table> -->
|
</table> -->
|
||||||
<clr-datagrid [clrDgLoading]="loading" [(clrDgSelected)]="selected">
|
<clr-datagrid [clrDgLoading]="loading" [(clrDgSelected)]="selected">
|
||||||
<clr-dg-placeholder><ng-template #loadingSpinner><clr-spinner>{{'LOADING'|translate}} ... </clr-spinner></ng-template>
|
<clr-dg-placeholder><ng-template #loadingSpinner><clr-spinner>{{'LOADING'|translate}} ... </clr-spinner></ng-template>
|
||||||
<div *ngIf="error;else loadingSpinner">{{error}}</div></clr-dg-placeholder>
|
<div *ngIf="error;else loadingSpinner">{{error}}</div>
|
||||||
|
</clr-dg-placeholder>
|
||||||
<clr-dg-column [clrDgField]="''" style="max-width: 40px;">
|
<clr-dg-column [clrDgField]="''" style="max-width: 40px;">
|
||||||
<ng-container *clrDgHideableColumn="{hidden: false}"></ng-container>
|
<ng-container *clrDgHideableColumn="{hidden: false}"></ng-container>
|
||||||
</clr-dg-column>
|
</clr-dg-column>
|
||||||
@ -209,20 +210,24 @@
|
|||||||
|
|
||||||
<clr-dg-row *clrDgItems="let user of menus;let i = index" [clrDgItem]="user">
|
<clr-dg-row *clrDgItems="let user of menus;let i = index" [clrDgItem]="user">
|
||||||
<clr-dg-cell style="max-width: 40px;">
|
<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>
|
<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>
|
||||||
<clr-dg-cell >{{i+1}}</clr-dg-cell>
|
<clr-dg-cell>{{i+1}}</clr-dg-cell>
|
||||||
<clr-dg-cell>{{user.menuItemDesc}}</clr-dg-cell>
|
<clr-dg-cell>{{user.menuItemDesc}}</clr-dg-cell>
|
||||||
<clr-dg-cell >{{user.menuId}}</clr-dg-cell>
|
<clr-dg-cell>{{user.menuId}}</clr-dg-cell>
|
||||||
<clr-dg-cell >{{user.itemSeq}}</clr-dg-cell>
|
<clr-dg-cell>{{user.itemSeq}}</clr-dg-cell>
|
||||||
<clr-dg-cell > {{user.moduleName}} </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.main_menu_action_name}}</clr-dg-cell>
|
||||||
<clr-dg-cell >{{user.status}} </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><clr-icon shape="bullet-list" (click)="submenu(user.menuItemId)"
|
||||||
|
style="color: rgb(108, 108, 194);"></clr-icon> </clr-dg-cell>
|
||||||
<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>
|
<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>
|
<clr-signpost>
|
||||||
<span style="cursor: pointer;" clrSignpostTrigger><clr-icon shape="help" class="success" style="color: rgb(0, 130, 236);"></clr-icon></span>
|
<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>
|
<clr-signpost-content [clrPosition]="'left-middle'" *clrIfOpen>
|
||||||
<h5 style="margin-top: 0">{{'WHO_COLUMN'|translate}} </h5>
|
<h5 style="margin-top: 0">{{'WHO_COLUMN'|translate}} </h5>
|
||||||
<div>{{'ACCOUNT_ID'|translate}} <code class="clr-code">{{user.accountId}}</code></div>
|
<div>{{'ACCOUNT_ID'|translate}} <code class="clr-code">{{user.accountId}}</code></div>
|
||||||
@ -233,12 +238,9 @@
|
|||||||
</clr-signpost-content>
|
</clr-signpost-content>
|
||||||
</clr-signpost>
|
</clr-signpost>
|
||||||
</clr-dg-cell>
|
</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-row-detail *clrIfExpanded >
|
|
||||||
|
<clr-dg-row-detail *clrIfExpanded>
|
||||||
<table class="table">
|
<table class="table">
|
||||||
<tr>
|
<tr>
|
||||||
<td class="td-title">Menu Name: </td>
|
<td class="td-title">Menu Name: </td>
|
||||||
@ -255,17 +257,14 @@
|
|||||||
of {{pagination.totalItems}} users
|
of {{pagination.totalItems}} users
|
||||||
</clr-dg-pagination>
|
</clr-dg-pagination>
|
||||||
</clr-dg-footer>
|
</clr-dg-footer>
|
||||||
</clr-datagrid>
|
</clr-datagrid>
|
||||||
|
|
||||||
<clr-modal [(clrModalOpen)]="modalAdd" [clrModalSize]="'md'" [clrModalStaticBackdrop]="true">
|
<clr-modal [(clrModalOpen)]="modalAdd" [clrModalSize]="'md'" [clrModalStaticBackdrop]="true">
|
||||||
<h3 class="modal-title">Add Menu Maintenance</h3>
|
<h3 class="modal-title">Add Menu Maintenance</h3>
|
||||||
<div class="modal-body">
|
<div class="modal-body">
|
||||||
<form [formGroup]="entryForm" (ngSubmit)="onSubmit()">
|
<form [formGroup]="entryForm" (ngSubmit)="onSubmit()">
|
||||||
<div class="clr-row">
|
<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">
|
<div class="clr-col-sm-12">
|
||||||
<label for="name">Menu ID<span class="required-field">*</span></label>
|
<label for="name">Menu ID<span class="required-field">*</span></label>
|
||||||
<input type="text" class="clr-input" formControlName="menuId" name="menuId" [(ngModel)]="mainid" readonly>
|
<input type="text" class="clr-input" formControlName="menuId" name="menuId" [(ngModel)]="mainid" readonly>
|
||||||
@ -274,24 +273,28 @@
|
|||||||
<label for="name">Menu Item Name<span class="required-field">*</span></label>
|
<label for="name">Menu Item Name<span class="required-field">*</span></label>
|
||||||
<input type="text" class="clr-input" formControlName="menuItemDesc">
|
<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" class="error_mess">
|
||||||
<div *ngIf="submitted && entryForm.controls.menuItemDesc.errors.required" class="error_mess">*This field is Required</div>
|
<div *ngIf="submitted && entryForm.controls.menuItemDesc.errors.required" class="error_mess">*This field is
|
||||||
|
Required</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="clr-col-sm-12">
|
<div class="clr-col-sm-12">
|
||||||
<label for="tags">Sequence</label>
|
<label for="tags">Sequence</label>
|
||||||
<input type="text" class="clr-input" formControlName="itemSeq">
|
<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" class="error_mess">
|
||||||
<div *ngIf="submitted && entryForm.controls.itemSeq.errors.required" class="error_mess">*This field is Required</div>
|
<div *ngIf="submitted && entryForm.controls.itemSeq.errors.required" class="error_mess">*This field is
|
||||||
|
Required</div>
|
||||||
</div>
|
</div>
|
||||||
<div *ngIf="submitted && entryForm.controls.itemSeq.errors" class="error_mess">
|
<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 *ngIf="submitted && entryForm.controls.itemSeq.errors.pattern" class="error_mess">*Required Only Number
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="clr-col-sm-12">
|
<div class="clr-col-sm-12">
|
||||||
<label for="tags">Module Name</label>
|
<label for="tags">Module Name</label>
|
||||||
<input type="text" class="clr-input" formControlName="moduleName">
|
<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" class="error_mess">
|
||||||
<div *ngIf="submitted && entryForm.controls.moduleName.errors.required" class="error_mess">*This field is Required</div>
|
<div *ngIf="submitted && entryForm.controls.moduleName.errors.required" class="error_mess">*This field is
|
||||||
|
Required</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="clr-col-sm-12">
|
<div class="clr-col-sm-12">
|
||||||
@ -301,86 +304,52 @@
|
|||||||
<option value="Disable">Disable</option>
|
<option value="Disable">Disable</option>
|
||||||
</select>
|
</select>
|
||||||
<div *ngIf="submitted && entryForm.controls.status.errors" class="error_mess">
|
<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 *ngIf="submitted && entryForm.controls.status.errors.required" class="error_mess">*This field is
|
||||||
|
Required</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="clr-col-sm-12">
|
<div class="clr-col-sm-12">
|
||||||
<label for="tags">Menu Action Link</label>
|
<label for="tags">Menu Action Link</label>
|
||||||
<input type="text" class="clr-input" formControlName="main_menu_action_name">
|
<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" class="error_mess">
|
||||||
<div *ngIf="submitted && entryForm.controls.main_menu_action_name.errors.required" class="error_mess">*This field is Required</div>
|
<div *ngIf="submitted && entryForm.controls.main_menu_action_name.errors.required" class="error_mess">*This
|
||||||
|
field is Required</div>
|
||||||
</div>
|
</div>
|
||||||
<!-- <select NAME="menu_id" >
|
|
||||||
<option SELECTED >Home Menu
|
|
||||||
<OPTION >Home
|
|
||||||
<OPTION >Job
|
|
||||||
|
|
||||||
<OPTION > Job logs
|
|
||||||
<OPTION > Pending Jobs
|
|
||||||
<OPTION > Defined Jobs
|
|
||||||
<OPTION > Surewebsocket
|
|
||||||
|
|
||||||
<OPTION >Security
|
|
||||||
<OPTION > User Maintance
|
|
||||||
<OPTION > User Group Maintance
|
|
||||||
<OPTION > System parametrs
|
|
||||||
<OPTION > Menu access control
|
|
||||||
<OPTION > Menu Maintance
|
|
||||||
|
|
||||||
<OPTION >SureBoard
|
|
||||||
<OPTION > Road Map
|
|
||||||
<OPTION > Iteration Release
|
|
||||||
<OPTION > Milestone
|
|
||||||
<OPTION > Goal
|
|
||||||
<OPTION > Wbs Task Board
|
|
||||||
|
|
||||||
|
|
||||||
<OPTION >Projects
|
|
||||||
<OPTION > My projects
|
|
||||||
<OPTION > All Projects
|
|
||||||
<OPTION > Templates
|
|
||||||
<OPTION > Repositories
|
|
||||||
<OPTION > Recently Modify
|
|
||||||
<OPTION > Recently Archived
|
|
||||||
<OPTION > Shared with Me
|
|
||||||
<OPTION > My Fav
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</select> -->
|
|
||||||
</div>
|
</div>
|
||||||
<div class="clr-col-sm-12">
|
<div class="clr-col-sm-12">
|
||||||
<label for="tags">Menu Icon Name</label>
|
<label for="tags">Menu Icon Name</label>
|
||||||
<input type="text" class="clr-input" formControlName="main_menu_icon_name">
|
<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" class="error_mess">
|
||||||
<div *ngIf="submitted && entryForm.controls.main_menu_icon_name.errors.required" class="error_mess">*This field is Required</div>
|
<div *ngIf="submitted && entryForm.controls.main_menu_icon_name.errors.required" class="error_mess">*This
|
||||||
|
field is Required</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<br>
|
<br>
|
||||||
<div class="modal-footer">
|
<div class="modal-footer">
|
||||||
<button type="button" class="btn btn-outline" (click)="modalAdd = false">Cancel</button>
|
<button type="button" class="btn btn-outline" (click)="modalAdd = false">Cancel</button>
|
||||||
<button type="submit" class="btn btn-primary" >ADD</button>
|
<button type="submit" class="btn btn-primary">ADD</button>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</clr-modal>
|
</clr-modal>
|
||||||
|
|
||||||
<clr-modal [(clrModalOpen)]="modaldelete" [clrModalSize]="'lg'" [clrModalStaticBackdrop]="true">
|
<clr-modal [(clrModalOpen)]="modaldelete" [clrModalSize]="'lg'" [clrModalStaticBackdrop]="true">
|
||||||
|
|
||||||
<div class="modal-body" *ngIf="rowSelected.menuItemId">
|
<div class="modal-body" *ngIf="rowSelected.menuItemId">
|
||||||
<h1 class="delete">Are You Sure Want to delete?</h1>
|
<h1 class="delete">Are You Sure Want to delete?</h1>
|
||||||
<h2 class="heading">{{rowSelected.menuItemId}}</h2>
|
<h2 class="heading">{{rowSelected.menuItemId}}</h2>
|
||||||
<div class="modal-footer">
|
<div class="modal-footer">
|
||||||
<button type="button" class="btn btn-outline" (click)="modaldelete = false">Cancel</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>
|
<button type="submit" (click)="delete(rowSelected.menuItemId)" class="btn btn-primary">Delete</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</clr-modal>
|
</clr-modal>
|
||||||
|
|
||||||
|
|
||||||
<clr-modal [(clrModalOpen)]="modaledit" [clrModalSize]="'md'" [clrModalStaticBackdrop]="true">
|
<clr-modal [(clrModalOpen)]="modaledit" [clrModalSize]="'md'" [clrModalStaticBackdrop]="true">
|
||||||
<h3 class="modal-title">Update Menu Maintenance</h3>
|
<h3 class="modal-title">Update Menu Maintenance</h3>
|
||||||
<div class="modal-body" *ngIf="rowSelected.menuItemId">
|
<div class="modal-body" *ngIf="rowSelected.menuItemId">
|
||||||
<h2 class="heading">{{rowSelected.menuItemId}}</h2>
|
<h2 class="heading">{{rowSelected.menuItemId}}</h2>
|
||||||
@ -412,7 +381,8 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="clr-col-sm-12">
|
<div class="clr-col-sm-12">
|
||||||
<label for="tags">Menu Action Link</label>
|
<label for="tags">Menu Action Link</label>
|
||||||
<input type="text" class="clr-input" name="main_menu_action_name" [(ngModel)]="rowSelected.main_menu_action_name">
|
<input type="text" class="clr-input" name="main_menu_action_name"
|
||||||
|
[(ngModel)]="rowSelected.main_menu_action_name">
|
||||||
</div>
|
</div>
|
||||||
<div class="clr-col-sm-12">
|
<div class="clr-col-sm-12">
|
||||||
<label for="tags">Menu Icon Name </label>
|
<label for="tags">Menu Icon Name </label>
|
||||||
@ -422,20 +392,21 @@
|
|||||||
<br>
|
<br>
|
||||||
<div class="modal-footer">
|
<div class="modal-footer">
|
||||||
<button type="button" class="btn btn-outline" (click)="modaledit = false">Cancel</button>
|
<button type="button" class="btn btn-outline" (click)="modaledit = false">Cancel</button>
|
||||||
<button type="submit" class="btn btn-primary" >Update</button>
|
<button type="submit" class="btn btn-primary">Update</button>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</clr-modal>
|
</clr-modal>
|
||||||
|
|
||||||
|
|
||||||
<clr-modal [(clrModalOpen)]="modalCsv" [clrModalSize]="'sm'" [clrModalStaticBackdrop]="false">
|
<clr-modal [(clrModalOpen)]="modalCsv" [clrModalSize]="'sm'" [clrModalStaticBackdrop]="false">
|
||||||
<h3 class="modal-title">Import File</h3>
|
<h3 class="modal-title">Import File</h3>
|
||||||
<div class="modal-body">
|
<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">
|
<input type="file" name="file" class="file" (change)="selectFile($event)"
|
||||||
|
accept=".csv, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet, application/vnd.ms-excel">
|
||||||
</div>
|
</div>
|
||||||
<div class="modal-footer">
|
<div class="modal-footer">
|
||||||
<button class="btn btn-primary" type="button" [disabled]="!selectedFiles" (click)="saveCsv()">Import</button>
|
<button class="btn btn-primary" type="button" [disabled]="!selectedFiles" (click)="saveCsv()">Import</button>
|
||||||
</div>
|
</div>
|
||||||
</clr-modal>
|
</clr-modal>
|
||||||
@ -1,7 +1,7 @@
|
|||||||
import { Component, OnInit } from '@angular/core';
|
import { Component, OnInit } from '@angular/core';
|
||||||
import { FormBuilder, FormGroup, Validators } from '@angular/forms';
|
import { FormBuilder, FormGroup, Validators } from '@angular/forms';
|
||||||
import { ToastrService } from 'ngx-toastr';
|
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 { Rn_Main_Menu } from '../../../../models/builder/Rn_Main_Menu';
|
||||||
import { ActivatedRoute, Router } from '@angular/router';
|
import { ActivatedRoute, Router } from '@angular/router';
|
||||||
import { MenuGroupService } from 'src/app/services/admin/menu-group.service';
|
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 {
|
export class MenumaintanceComponent implements OnInit {
|
||||||
loading = false;
|
loading = false;
|
||||||
selected: any[] = [];
|
selected: any[] = [];
|
||||||
rowSelected :any= {};
|
rowSelected: any = {};
|
||||||
modaldelete=false;
|
modaldelete = false;
|
||||||
modalAdd= false;
|
modalAdd = false;
|
||||||
modaledit=false;
|
modaledit = false;
|
||||||
givendata;
|
givendata;
|
||||||
menus: Rn_Main_Menu[];
|
menus: Rn_Main_Menu[];
|
||||||
mainid=0;
|
mainid = 0;
|
||||||
public entryForm: FormGroup;
|
public entryForm: FormGroup;
|
||||||
mcreate;
|
mcreate;
|
||||||
mdelete;
|
mdelete;
|
||||||
medit;
|
medit;
|
||||||
showdata;
|
showdata;
|
||||||
error;
|
error;
|
||||||
submitted=false;
|
submitted = false;
|
||||||
constructor(private menuservice:MenumaintanceService,
|
constructor(private menuservice: MenumaintanceService,
|
||||||
private toastr:ToastrService,
|
private toastr: ToastrService,
|
||||||
private excel: ExcelService,
|
private excel: ExcelService,
|
||||||
private _fb: FormBuilder,
|
private _fb: FormBuilder,
|
||||||
private route:ActivatedRoute,
|
private route: ActivatedRoute,
|
||||||
private menuGroupService: MenuGroupService,
|
private menuGroupService: MenuGroupService,
|
||||||
private csvService: CsvService,
|
private csvService: CsvService,
|
||||||
private translate: TranslateService,
|
private translate: TranslateService,
|
||||||
@ -44,11 +44,11 @@ export class MenumaintanceComponent implements OnInit {
|
|||||||
ngOnInit(): void {
|
ngOnInit(): void {
|
||||||
this.showdata = this.menuGroupService.getdata();
|
this.showdata = this.menuGroupService.getdata();
|
||||||
console.log(this.showdata);
|
console.log(this.showdata);
|
||||||
this.mcreate=this.showdata.mcreate;
|
this.mcreate = this.showdata.mcreate;
|
||||||
console.log(this.mcreate);
|
console.log(this.mcreate);
|
||||||
this.mdelete=this.showdata.mdelete
|
this.mdelete = this.showdata.mdelete
|
||||||
console.log(this.mdelete);
|
console.log(this.mdelete);
|
||||||
this.medit=this.showdata.medit
|
this.medit = this.showdata.medit
|
||||||
console.log(this.medit);
|
console.log(this.medit);
|
||||||
|
|
||||||
// this.menuservice.getAll().subscribe((data) => {
|
// this.menuservice.getAll().subscribe((data) => {
|
||||||
@ -58,13 +58,13 @@ export class MenumaintanceComponent implements OnInit {
|
|||||||
|
|
||||||
this.entryForm = this._fb.group({
|
this.entryForm = this._fb.group({
|
||||||
// menuItemId:[null],
|
// menuItemId:[null],
|
||||||
menuId:[null],
|
menuId: [null],
|
||||||
menuItemDesc:['',[Validators.required]] ,
|
menuItemDesc: ['', [Validators.required]],
|
||||||
itemSeq:['',[Validators.required, Validators.pattern(/^-?(0|[1-9]\d*)?$/)]] ,
|
itemSeq: ['', [Validators.required, Validators.pattern(/^-?(0|[1-9]\d*)?$/)]],
|
||||||
moduleName:['',[Validators.required]] ,
|
moduleName: ['', [Validators.required]],
|
||||||
status:['',[Validators.required]] ,
|
status: ['', [Validators.required]],
|
||||||
main_menu_action_name:['',[Validators.required]],
|
main_menu_action_name: ['', [Validators.required]],
|
||||||
main_menu_icon_name:['',[Validators.required]]
|
main_menu_icon_name: ['', [Validators.required]]
|
||||||
});
|
});
|
||||||
this.getdata();
|
this.getdata();
|
||||||
}
|
}
|
||||||
@ -72,101 +72,100 @@ export class MenumaintanceComponent implements OnInit {
|
|||||||
switchLanguage(language: string) {
|
switchLanguage(language: string) {
|
||||||
this.translate.use(language);
|
this.translate.use(language);
|
||||||
}
|
}
|
||||||
getdata(){
|
getdata() {
|
||||||
this.menuservice.getByCurrentUserMenuGroupId1().subscribe(resp => {
|
this.menuservice.getByCurrentUserMenuGroupId1().subscribe(resp => {
|
||||||
this.menus = resp;
|
this.menus = resp;
|
||||||
console.log('menus: ', this.menus);
|
console.log('menus: ', this.menus);
|
||||||
if(this.menus.length==0){
|
if (this.menus.length == 0) {
|
||||||
this.error="No data Available";
|
this.error = "No data Available";
|
||||||
console.log(this.error)
|
console.log(this.error)
|
||||||
}
|
}
|
||||||
},(error) => {
|
}, (error) => {
|
||||||
console.log(error);
|
console.log(error);
|
||||||
if(error){
|
if (error) {
|
||||||
this.error="Server Error";
|
this.error = "Server Error";
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
onSubmit(){
|
onSubmit() {
|
||||||
this.submitted=true;
|
this.submitted = true;
|
||||||
if (this.entryForm.invalid) {
|
if (this.entryForm.invalid) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
this.menuservice.create1(this.entryForm.value).subscribe((data)=>{
|
this.menuservice.create1(this.entryForm.value).subscribe((data) => {
|
||||||
console.log(data);
|
console.log(data);
|
||||||
if (data) {
|
if (data) {
|
||||||
this.toastr.success('Added successfully');
|
this.toastr.success('Added successfully');
|
||||||
}
|
}
|
||||||
this.ngOnInit();
|
this.ngOnInit();
|
||||||
},
|
},
|
||||||
(error) => {
|
(error) => {
|
||||||
console.log('Error in adding data...',+error);
|
console.log('Error in adding data...', +error);
|
||||||
if(error){
|
if (error) {
|
||||||
this.toastr.error('Not added Data Getting Some Error');
|
this.toastr.error('Not added Data Getting Some Error');
|
||||||
}
|
}
|
||||||
this.getdata();
|
this.getdata();
|
||||||
});
|
});
|
||||||
this.modalAdd=false;
|
this.modalAdd = false;
|
||||||
}
|
}
|
||||||
goToAdd() {
|
goToAdd() {
|
||||||
this.modalAdd=true;
|
this.modalAdd = true;
|
||||||
}
|
}
|
||||||
submenu(id:any){
|
submenu(id: any) {
|
||||||
this.router.navigate(["../submenu/" +id], { relativeTo: this.route })
|
this.router.navigate(["../submenu/" + id], { relativeTo: this.route })
|
||||||
}
|
}
|
||||||
data:{};
|
data: {};
|
||||||
shrink(id:any,row){
|
shrink(id: any, row) {
|
||||||
this.rowSelected = row;
|
this.rowSelected = row;
|
||||||
console.log(this.rowSelected);
|
console.log(this.rowSelected);
|
||||||
if(this.rowSelected.subMenus!=0){
|
if (this.rowSelected.subMenus != 0) {
|
||||||
this.rowSelected.subMenus=[]
|
this.rowSelected.subMenus = []
|
||||||
}console.log(this.rowSelected);
|
} console.log(this.rowSelected);
|
||||||
this.menuservice.sink(id,this.rowSelected).subscribe((data)=>{
|
this.menuservice.sink(id, this.rowSelected).subscribe((data) => {
|
||||||
console.log(data);
|
console.log(data);
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
goToEdit(row) {
|
goToEdit(row) {
|
||||||
this.rowSelected = row;
|
this.rowSelected = row;
|
||||||
console.log(row)
|
console.log(row)
|
||||||
this.modaledit=true;
|
this.modaledit = true;
|
||||||
//this.router.navigate(["../edit/" + id], { relativeTo: this.route });
|
//this.router.navigate(["../edit/" + id], { relativeTo: this.route });
|
||||||
}
|
}
|
||||||
onDelete(row) {
|
onDelete(row) {
|
||||||
this.rowSelected = row;
|
this.rowSelected = row;
|
||||||
this.modaldelete=true;
|
this.modaldelete = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
delete(id)
|
delete(id) {
|
||||||
{
|
|
||||||
this.modaldelete = false;
|
this.modaldelete = false;
|
||||||
console.log("in delete "+id);
|
console.log("in delete " + id);
|
||||||
this.menuservice.delete1(id).subscribe((data)=>{
|
this.menuservice.delete1(id).subscribe((data) => {
|
||||||
console.log(data);
|
console.log(data);
|
||||||
this.toastr.success('Deleted successfully');
|
this.toastr.success('Deleted successfully');
|
||||||
this.ngOnInit();
|
this.ngOnInit();
|
||||||
},
|
},
|
||||||
(error) => {
|
(error) => {
|
||||||
console.log('Error in adding data...',+error);
|
console.log('Error in adding data...', +error);
|
||||||
if(error){
|
if (error) {
|
||||||
this.toastr.error('Not Deleted Data Getting Some Error');
|
this.toastr.error('Not Deleted Data Getting Some Error');
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
onUpdate(id){
|
onUpdate(id) {
|
||||||
this.modaledit=false;
|
this.modaledit = false;
|
||||||
this.menuservice.update1(id,this.rowSelected).subscribe((data)=>{
|
this.menuservice.update1(id, this.rowSelected).subscribe((data) => {
|
||||||
console.log(data);
|
console.log(data);
|
||||||
if (data) {
|
if (data) {
|
||||||
this.toastr.success('Updated successfully');
|
this.toastr.success('Updated successfully');
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
(error) => {
|
(error) => {
|
||||||
console.log('Error in adding data...',+error);
|
console.log('Error in adding data...', +error);
|
||||||
if(error){
|
if (error) {
|
||||||
this.toastr.error('Not updated Data Getting Some Error');
|
this.toastr.error('Not updated Data Getting Some Error');
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
onExport() {
|
onExport() {
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
import { Component, OnInit } from '@angular/core';
|
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 { Rn_Main_Menu } from '../../../../models/builder/Rn_Main_Menu';
|
||||||
import { ActivatedRoute, Router } from '@angular/router';
|
import { ActivatedRoute, Router } from '@angular/router';
|
||||||
import { AbstractControl, FormBuilder, FormGroup, Validators } from '@angular/forms';
|
import { AbstractControl, FormBuilder, FormGroup, Validators } from '@angular/forms';
|
||||||
@ -18,119 +18,118 @@ function numberValidator(control: AbstractControl): { [key: string]: any } | nul
|
|||||||
})
|
})
|
||||||
export class SubmenuComponent implements OnInit {
|
export class SubmenuComponent implements OnInit {
|
||||||
loading = false;
|
loading = false;
|
||||||
modalAdd= false;
|
modalAdd = false;
|
||||||
modaledit=false;
|
modaledit = false;
|
||||||
modaldelete=false;
|
modaldelete = false;
|
||||||
selected: any[] = [];
|
selected: any[] = [];
|
||||||
rowSelected :any= {};
|
rowSelected: any = {};
|
||||||
givendata;
|
givendata;
|
||||||
menus: Rn_Main_Menu[];
|
menus: Rn_Main_Menu[];
|
||||||
sub;
|
sub;
|
||||||
id;
|
id;
|
||||||
mainid;
|
mainid;
|
||||||
submitted=false;
|
submitted = false;
|
||||||
public entryForm: FormGroup;
|
public entryForm: FormGroup;
|
||||||
constructor(private menuservice:MenumaintanceService,
|
constructor(private menuservice: MenumaintanceService,
|
||||||
private toastr:ToastrService,
|
private toastr: ToastrService,
|
||||||
private _fb: FormBuilder,
|
private _fb: FormBuilder,
|
||||||
private route:ActivatedRoute,
|
private route: ActivatedRoute,
|
||||||
private router: Router,) { }
|
private router: Router,) { }
|
||||||
|
|
||||||
ngOnInit(): void {
|
ngOnInit(): void {
|
||||||
this.id = this.route.snapshot.params["id"];
|
this.id = this.route.snapshot.params["id"];
|
||||||
console.log("project mainmenu with id = ", this.id);
|
console.log("project mainmenu with id = ", this.id);
|
||||||
this.getById(this.id);
|
this.getById(this.id);
|
||||||
this.mainid=this.id
|
this.mainid = this.id
|
||||||
this.entryForm = this._fb.group({
|
this.entryForm = this._fb.group({
|
||||||
// menuItemId:[null],
|
// menuItemId:[null],
|
||||||
menuId:[this.mainid],
|
menuId: [this.mainid],
|
||||||
menuItemDesc:['',[Validators.required]] ,
|
menuItemDesc: ['', [Validators.required]],
|
||||||
// itemSeq:['',[Validators.required]] ,
|
// itemSeq:['',[Validators.required]] ,
|
||||||
// itemSeq: ['', [Validators.required, numberValidator]],
|
// itemSeq: ['', [Validators.required, numberValidator]],
|
||||||
itemSeq: ['', [Validators.required, Validators.pattern('^[0-9]*$')]],
|
itemSeq: ['', [Validators.required, Validators.pattern('^[0-9]*$')]],
|
||||||
moduleName:['',[Validators.required]] ,
|
moduleName: ['', [Validators.required]],
|
||||||
status:['',[Validators.required]] ,
|
status: ['', [Validators.required]],
|
||||||
main_menu_action_name:['',[Validators.required]]
|
main_menu_action_name: ['', [Validators.required]]
|
||||||
});
|
});
|
||||||
|
|
||||||
// this.getdata();
|
// this.getdata();
|
||||||
}
|
}
|
||||||
getById(id:any){
|
getById(id: any) {
|
||||||
this.menuservice.getbyid(id).subscribe((data)=>{
|
this.menuservice.getbyid(id).subscribe((data) => {
|
||||||
this.sub=data;
|
this.sub = data;
|
||||||
console.log(this.sub)
|
console.log(this.sub)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
getdata(){
|
getdata() {
|
||||||
this.menuservice.getByCurrentUserMenuGroupId1().subscribe(resp => {
|
this.menuservice.getByCurrentUserMenuGroupId1().subscribe(resp => {
|
||||||
this.menus = resp;
|
this.menus = resp;
|
||||||
console.log('menus: ', this.menus);
|
console.log('menus: ', this.menus);
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
goToAdd() {
|
goToAdd() {
|
||||||
this.modalAdd=true;
|
this.modalAdd = true;
|
||||||
}
|
}
|
||||||
onSubmit(){
|
onSubmit() {
|
||||||
this.submitted=true;
|
this.submitted = true;
|
||||||
if (this.entryForm.invalid) {
|
if (this.entryForm.invalid) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
this.menuservice.create1(this.entryForm.value).subscribe((data)=>{
|
this.menuservice.create1(this.entryForm.value).subscribe((data) => {
|
||||||
console.log(data);
|
console.log(data);
|
||||||
if (data) {
|
if (data) {
|
||||||
this.toastr.success('Added successfully');
|
this.toastr.success('Added successfully');
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
(error) => {
|
(error) => {
|
||||||
console.log('Error in adding data...',+error);
|
console.log('Error in adding data...', +error);
|
||||||
if(error){
|
if (error) {
|
||||||
this.toastr.error('Not added Data Getting Some Error');
|
this.toastr.error('Not added Data Getting Some Error');
|
||||||
}
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
this.modalAdd=false;
|
this.modalAdd = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
goToEdit(row) {
|
goToEdit(row) {
|
||||||
this.rowSelected = row;
|
this.rowSelected = row;
|
||||||
console.log(row)
|
console.log(row)
|
||||||
this.modaledit=true;
|
this.modaledit = true;
|
||||||
//this.router.navigate(["../edit/" + id], { relativeTo: this.route });
|
//this.router.navigate(["../edit/" + id], { relativeTo: this.route });
|
||||||
}
|
}
|
||||||
onDelete(row) {
|
onDelete(row) {
|
||||||
this.rowSelected = row;
|
this.rowSelected = row;
|
||||||
this.modaldelete=true;
|
this.modaldelete = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
delete(id)
|
delete(id) {
|
||||||
{
|
|
||||||
this.modaldelete = false;
|
this.modaldelete = false;
|
||||||
console.log("in delete "+id);
|
console.log("in delete " + id);
|
||||||
this.menuservice.delete1(id).subscribe((data)=>{
|
this.menuservice.delete1(id).subscribe((data) => {
|
||||||
console.log(data);
|
console.log(data);
|
||||||
if (data) {
|
if (data) {
|
||||||
this.toastr.success('Deleted successfully');
|
this.toastr.success('Deleted successfully');
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
(error) => {
|
(error) => {
|
||||||
console.log('Error in adding data...',+error);
|
console.log('Error in adding data...', +error);
|
||||||
if(error){
|
if (error) {
|
||||||
this.toastr.error('Not Deleted Data Getting Some Error');
|
this.toastr.error('Not Deleted Data Getting Some Error');
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
onUpdate(id){
|
onUpdate(id) {
|
||||||
this.modaledit=false;
|
this.modaledit = false;
|
||||||
this.menuservice.update1(id,this.rowSelected).subscribe((data)=>{
|
this.menuservice.update1(id, this.rowSelected).subscribe((data) => {
|
||||||
console.log(data);
|
console.log(data);
|
||||||
if (data) {
|
if (data) {
|
||||||
this.toastr.success('Updated successfully');
|
this.toastr.success('Updated successfully');
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
(error) => {
|
(error) => {
|
||||||
console.log('Error in adding data...',+error);
|
console.log('Error in adding data...', +error);
|
||||||
if(error){
|
if (error) {
|
||||||
this.toastr.error('Not updated Data Getting Some Error');
|
this.toastr.error('Not updated Data Getting Some Error');
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
@ -42,9 +42,7 @@
|
|||||||
</ng-container></clr-dg-column>
|
</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
|
<clr-dg-column [clrDgField]="'Type Render'"> <ng-container *clrDgHideableColumn="{hidden: false}"> Type Render
|
||||||
|
|
||||||
</ng-container></clr-dg-column>
|
</ng-container></clr-dg-column>
|
||||||
@ -88,12 +86,9 @@
|
|||||||
|
|
||||||
<clr-dg-cell>{{user.uitype }}</clr-dg-cell>
|
<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>{{user.typerender }}</clr-dg-cell>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<clr-dg-cell (click)="goToReplaceStringhtmljson (user.html)"
|
<clr-dg-cell (click)="goToReplaceStringhtmljson (user.html)"
|
||||||
style="cursor: pointer; align-items: center;"><clr-icon shape="details"></clr-icon>
|
style="cursor: pointer; align-items: center;"><clr-icon shape="details"></clr-icon>
|
||||||
</clr-dg-cell>
|
</clr-dg-cell>
|
||||||
@ -358,10 +353,7 @@
|
|||||||
<label>Type Render</label>
|
<label>Type Render</label>
|
||||||
<input class="clr-input" type="text" [(ngModel)]="rowSelected.typerender" name="typerender" />
|
<input class="clr-input" type="text" [(ngModel)]="rowSelected.typerender" name="typerender" />
|
||||||
</div>
|
</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">
|
<div class="clr-col-sm-12">
|
||||||
@ -481,11 +473,6 @@
|
|||||||
<input class="clr-input" type="text" formControlName="typerender" />
|
<input class="clr-input" type="text" formControlName="typerender" />
|
||||||
</div>
|
</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">
|
<div class="clr-col-sm-12">
|
||||||
<label> Active</label>
|
<label> Active</label>
|
||||||
<input type="checkbox" formControlName="active" clrToggle />
|
<input type="checkbox" formControlName="active" clrToggle />
|
||||||
|
|||||||
@ -10,6 +10,7 @@ import { UserInfoService } from 'src/app/services/user-info.service';
|
|||||||
import { SiteTreeservice } from '../SiteBuilderGrid/SiteTree.service';
|
import { SiteTreeservice } from '../SiteBuilderGrid/SiteTree.service';
|
||||||
import { COMMON_CSS } from '../WireframesUi/common-css';
|
import { COMMON_CSS } from '../WireframesUi/common-css';
|
||||||
import { Download_Css } from '../WireframesUi/download-css';
|
import { Download_Css } from '../WireframesUi/download-css';
|
||||||
|
import { ActivatedRoute } from '@angular/router';
|
||||||
// import { Download_Css } from '../WireframesUi/download-css';
|
// import { Download_Css } from '../WireframesUi/download-css';
|
||||||
declare var JsBarcode: any;
|
declare var JsBarcode: any;
|
||||||
@Component({
|
@Component({
|
||||||
@ -52,6 +53,7 @@ export class Design_lbraryComponent implements OnInit {
|
|||||||
newLine: any;
|
newLine: any;
|
||||||
additionalFieldsFromBackend: any[] = [];
|
additionalFieldsFromBackend: any[] = [];
|
||||||
formcode = 'Design_lbrary_formCode'
|
formcode = 'Design_lbrary_formCode'
|
||||||
|
headerId;
|
||||||
tableName = 'Design_lbrary'; checkFormCode; selected: any[] = []; constructor(
|
tableName = 'Design_lbrary'; checkFormCode; selected: any[] = []; constructor(
|
||||||
private extensionService: ExtensionService,
|
private extensionService: ExtensionService,
|
||||||
private userInfoService: UserInfoService,
|
private userInfoService: UserInfoService,
|
||||||
@ -60,10 +62,13 @@ export class Design_lbraryComponent implements OnInit {
|
|||||||
private toastr: ToastrService,
|
private toastr: ToastrService,
|
||||||
private _fb: FormBuilder,
|
private _fb: FormBuilder,
|
||||||
private siteTreeService: SiteTreeservice,
|
private siteTreeService: SiteTreeservice,
|
||||||
|
private route: ActivatedRoute,
|
||||||
|
|
||||||
) { }
|
) { }
|
||||||
// component button
|
// component button
|
||||||
ngOnInit(): void {
|
ngOnInit(): void {
|
||||||
|
this.headerId = this.route.snapshot.params["id"];
|
||||||
|
console.log("headerId : = ", this.headerId);
|
||||||
if (this.cardmodeldata !== '') {
|
if (this.cardmodeldata !== '') {
|
||||||
this.cardmodal = JSON.parse(this.cardmodeldata);
|
this.cardmodal = JSON.parse(this.cardmodeldata);
|
||||||
this.dashboardArray = this.cardmodal.dashboard.slice();
|
this.dashboardArray = this.cardmodal.dashboard.slice();
|
||||||
@ -85,11 +90,9 @@ export class Design_lbraryComponent implements OnInit {
|
|||||||
uitype: [null],
|
uitype: [null],
|
||||||
javacode: [null],
|
javacode: [null],
|
||||||
typerender: [null],
|
typerender: [null],
|
||||||
techstack: [null],
|
// techstack: [null],
|
||||||
html: [null],
|
html: [null],
|
||||||
|
hedaer_id: [this.headerId],
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}); // component_button200
|
}); // component_button200
|
||||||
// form code start
|
// 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
|
// form code end
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
error;
|
error;
|
||||||
getData() {
|
getData() {
|
||||||
this.mainService.getAll().subscribe((data) => {
|
this.mainService.getAll(this.headerId).subscribe((data) => {
|
||||||
console.log(data);
|
console.log('get all ', data);
|
||||||
this.product = data;
|
// this.product = data;
|
||||||
|
this.product = Array.isArray(data) ? data : [];
|
||||||
|
|
||||||
if (this.product.length == 0) {
|
if (this.product.length == 0) {
|
||||||
this.error = "No Data Available"
|
this.error = "No Data Available"
|
||||||
}
|
}
|
||||||
@ -156,19 +136,6 @@ export class Design_lbraryComponent implements OnInit {
|
|||||||
}
|
}
|
||||||
onEdit(row) {
|
onEdit(row) {
|
||||||
this.rowSelected = row;
|
this.rowSelected = row;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
this.modalEdit = true;
|
this.modalEdit = true;
|
||||||
}
|
}
|
||||||
onDelete(row) {
|
onDelete(row) {
|
||||||
@ -187,18 +154,6 @@ export class Design_lbraryComponent implements OnInit {
|
|||||||
}
|
}
|
||||||
onUpdate(id) {
|
onUpdate(id) {
|
||||||
this.modalEdit = false;
|
this.modalEdit = false;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//console.log("in update");
|
//console.log("in update");
|
||||||
console.log("id " + id);
|
console.log("id " + id);
|
||||||
console.log(this.rowSelected);
|
console.log(this.rowSelected);
|
||||||
@ -213,17 +168,6 @@ export class Design_lbraryComponent implements OnInit {
|
|||||||
this.ngOnInit();
|
this.ngOnInit();
|
||||||
}, 500);
|
}, 500);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}, (error) => {
|
}, (error) => {
|
||||||
console.log(error);
|
console.log(error);
|
||||||
if (error.status >= 200 && error.status <= 299) {
|
if (error.status >= 200 && error.status <= 299) {
|
||||||
@ -242,18 +186,6 @@ export class Design_lbraryComponent implements OnInit {
|
|||||||
}
|
}
|
||||||
onCreate() {
|
onCreate() {
|
||||||
this.modalAdd = false;
|
this.modalAdd = false;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
this.mainService.create(this.entryForm.value).subscribe(
|
this.mainService.create(this.entryForm.value).subscribe(
|
||||||
(data) => {
|
(data) => {
|
||||||
console.log(data);
|
console.log(data);
|
||||||
@ -264,17 +196,6 @@ export class Design_lbraryComponent implements OnInit {
|
|||||||
this.ngOnInit();
|
this.ngOnInit();
|
||||||
}, 500);
|
}, 500);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}, (error) => {
|
}, (error) => {
|
||||||
console.log(error);
|
console.log(error);
|
||||||
if (error.status >= 200 && error.status <= 299) {
|
if (error.status >= 200 && error.status <= 299) {
|
||||||
@ -294,17 +215,6 @@ export class Design_lbraryComponent implements OnInit {
|
|||||||
goToAdd(row) {
|
goToAdd(row) {
|
||||||
this.modalAdd = true; this.submitted = false;
|
this.modalAdd = true; this.submitted = false;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
submitted = false;
|
submitted = false;
|
||||||
onSubmit() {
|
onSubmit() {
|
||||||
@ -312,11 +222,11 @@ export class Design_lbraryComponent implements OnInit {
|
|||||||
this.submitted = true;
|
this.submitted = true;
|
||||||
if (this.entryForm.invalid) {
|
if (this.entryForm.invalid) {
|
||||||
return;
|
return;
|
||||||
} this.onCreate();
|
}
|
||||||
|
this.onCreate();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
rsModaldescription = false;
|
rsModaldescription = false;
|
||||||
goToReplaceStringdescription(row) {
|
goToReplaceStringdescription(row) {
|
||||||
this.rowSelected = row; this.rsModaldescription = true;
|
this.rowSelected = row; this.rsModaldescription = true;
|
||||||
|
|||||||
@ -6,13 +6,13 @@ import { environment } from 'src/environments/environment';
|
|||||||
@Injectable({
|
@Injectable({
|
||||||
providedIn: 'root'
|
providedIn: 'root'
|
||||||
})
|
})
|
||||||
export class Design_lbraryservice{
|
export class Design_lbraryservice {
|
||||||
private baseURL = "Design_lbrary/Design_lbrary" ; constructor(
|
private baseURL = "Design_lbrary/Design_lbrary"; constructor(
|
||||||
private http: HttpClient,
|
private http: HttpClient,
|
||||||
private apiRequest: ApiRequestService,
|
private apiRequest: ApiRequestService,
|
||||||
) { }
|
) { }
|
||||||
getAll(page?: number, size?: number): Observable<any> {
|
getAll(id: number, page?: number, size?: number): Observable<any> {
|
||||||
return this.apiRequest.get(this.baseURL);
|
return this.apiRequest.get(this.baseURL + "/line/" + id);
|
||||||
}
|
}
|
||||||
getById(id: number): Observable<any> {
|
getById(id: number): Observable<any> {
|
||||||
const _http = this.baseURL + "/" + id;
|
const _http = this.baseURL + "/" + id;
|
||||||
@ -41,5 +41,5 @@ export class Design_lbraryservice{
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
// updateaction
|
// updateaction
|
||||||
}
|
}
|
||||||
@ -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 -->
|
||||||
|
|
||||||
|
<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 -->
|
||||||
@ -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;
|
||||||
|
}
|
||||||
@ -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 })
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -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
|
||||||
|
}
|
||||||
@ -0,0 +1,4 @@
|
|||||||
|
export const Dlf_headercardvariable = {
|
||||||
|
"cardButton": false,
|
||||||
|
"cardmodeldata": ``
|
||||||
|
}
|
||||||
@ -47,6 +47,11 @@ export class SiteTreeservice {
|
|||||||
return this.apiRequest.get(_http);
|
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> {
|
callLlm(data: any): Observable<any> {
|
||||||
return this.http.post(`${this.nodeURL}/chatMemory`, data);
|
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);
|
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);
|
return this.apiRequest.post(`sureops/deploy?projId=` + projId, data);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -121,7 +121,6 @@
|
|||||||
</button>
|
</button>
|
||||||
<!-- <button (click)="uploadHtmlFiles(11096)" class="action-btn save-btn"> -->
|
<!-- <button (click)="uploadHtmlFiles(11096)" class="action-btn save-btn"> -->
|
||||||
<button (click)="createHtmlFiles()" class="action-btn save-btn">
|
<button (click)="createHtmlFiles()" class="action-btn save-btn">
|
||||||
|
|
||||||
💾 Save All HTML Files
|
💾 Save All HTML Files
|
||||||
</button>
|
</button>
|
||||||
|
|
||||||
|
|||||||
@ -385,10 +385,13 @@ HTML Only. No CSS.
|
|||||||
return resolve(this.promptHashCache[hash]);
|
return resolve(this.promptHashCache[hash]);
|
||||||
}
|
}
|
||||||
|
|
||||||
// const enhanced = await this.callLlm(enhancedPrompt);
|
const enhanced = await this.callLlm(enhancedPrompt);
|
||||||
// this.promptHashCache[hash] = enhanced;
|
|
||||||
|
|
||||||
resolve(baseJsonString);
|
console.log('enhanced prmpt ',enhanced);
|
||||||
|
this.promptHashCache[hash] = enhanced;
|
||||||
|
|
||||||
|
// resolve(baseJsonString);
|
||||||
|
resolve(this.promptHashCache[hash]);
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
console.error('❌ JSON parse error:', err);
|
console.error('❌ JSON parse error:', err);
|
||||||
resolve('{}');
|
resolve('{}');
|
||||||
@ -562,7 +565,7 @@ HTML Only. No CSS.
|
|||||||
pageHtmlMap[pageName] = html;
|
pageHtmlMap[pageName] = html;
|
||||||
}
|
}
|
||||||
|
|
||||||
this.siteTreeService.deployProj(pageHtmlMap, projId).subscribe(
|
this.siteTreeService.deployProj(projId,pageHtmlMap).subscribe(
|
||||||
(data) => {
|
(data) => {
|
||||||
console.log(data);
|
console.log(data);
|
||||||
if (data || data.status >= 200 && data.status <= 299) {
|
if (data || data.status >= 200 && data.status <= 299) {
|
||||||
|
|||||||
@ -91,6 +91,35 @@ export class TreeVisualizerComponent {
|
|||||||
"Feature Section": "Choose a template to replace with uploaded data"
|
"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;
|
treeData: any = null;
|
||||||
rawInputText: string = `make a website , where we can login , sign up.
|
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
|
inside that there is a menu of icard where we can add a icard detail iacardname, description
|
||||||
@ -194,73 +223,44 @@ after click this icard inside we upload excel of student data, icard template, a
|
|||||||
generateJson() {
|
generateJson() {
|
||||||
console.log('genearte json start ')
|
console.log('genearte json start ')
|
||||||
|
|
||||||
const suffix1 = `
|
const suffix = ` You are a JSON structure generator for website page hierarchies.
|
||||||
🔁 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.
|
You are a JSON structure generator for website UI and sitemap hierarchy.
|
||||||
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.
|
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.
|
||||||
Do not return any explanation, text, or markdown formatting — only return the raw JSON object exactly in this format.
|
|
||||||
|
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.
|
||||||
|
|
||||||
|
|
||||||
|
✅ 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.
|
||||||
|
|
||||||
❌ Do not include:
|
❌ Do not include:
|
||||||
- Any explanation before or after the JSON
|
- Any explanation before or after the JSON
|
||||||
- Any markdown formatting like \`\`\` or json
|
- Any markdown formatting like \`\`\` or json
|
||||||
- Any text like "Here is..." or "Please note..."
|
- Any natural language response
|
||||||
|
- Return only pure JSON — no explanation, no headings, no markdown formatting.
|
||||||
|
|
||||||
✅ Output must look like this:
|
|
||||||
|
✅ Output JSON example structure should 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.
|
|
||||||
|
|
||||||
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.
|
|
||||||
|
|
||||||
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:
|
|
||||||
|
|
||||||
- **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.
|
|
||||||
|
|
||||||
|
|
||||||
✅ Output JSON example structure should look like this:
|
|
||||||
|
|
||||||
{
|
|
||||||
"Home": {
|
"Home": {
|
||||||
"Navbar": "Top navigation with logo, links to all main pages, and call-to-action button",
|
"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",
|
"Header Section": "Headline with subheading and call-to-action button",
|
||||||
@ -289,7 +289,7 @@ Analyze the flow implied in the prompt:
|
|||||||
"Terms and Conditions": {
|
"Terms and Conditions": {
|
||||||
"Content Section": "Rules and legal terms for using the site or service"
|
"Content Section": "Rules and legal terms for using the site or service"
|
||||||
}
|
}
|
||||||
}`;
|
}`;
|
||||||
|
|
||||||
|
|
||||||
const payload = {
|
const payload = {
|
||||||
@ -302,20 +302,102 @@ Analyze the flow implied in the prompt:
|
|||||||
this.siteTreeService.callLlm(payload).subscribe({
|
this.siteTreeService.callLlm(payload).subscribe({
|
||||||
next: (res) => {
|
next: (res) => {
|
||||||
|
|
||||||
console.log('response ', res)
|
console.log('llm response ', res)
|
||||||
|
|
||||||
if (res && res.responseContent) {
|
if (res && res.responseContent) {
|
||||||
this.inputJson = res.responseContent;
|
// this.inputJson = res.responseContent;
|
||||||
console.log('input json ', this.inputJson)
|
// console.log('input json ', this.inputJson)
|
||||||
|
|
||||||
|
|
||||||
// 🔁 Now call update API
|
// 🔁 Now call update API
|
||||||
const updatePayload = {
|
// const updatePayload = {
|
||||||
prompt: this.rawInputText + ' ',
|
// prompt: this.rawInputText + ' ',
|
||||||
model: this.inputJson // model format expected by backend
|
// model: this.inputJson // model format expected by backend
|
||||||
|
// console.log('payload : ', updatePayload);
|
||||||
|
|
||||||
|
|
||||||
|
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 key’s 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 key’s 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('payload : ', updatePayload);
|
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({
|
this.siteTreeService.update(this.id, updatePayload).subscribe({
|
||||||
next: (resp) => {
|
next: (resp) => {
|
||||||
console.log('✅ JSON updated on server:', resp);
|
console.log('✅ JSON updated on server:', resp);
|
||||||
@ -326,6 +408,12 @@ Analyze the flow implied in the prompt:
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
};
|
||||||
|
} catch (err) {
|
||||||
|
console.error('❌ Failed to parse LLM JSON:', err);
|
||||||
|
alert('Invalid JSON received from LLM');
|
||||||
|
}
|
||||||
|
}
|
||||||
},
|
},
|
||||||
error: (err) => {
|
error: (err) => {
|
||||||
console.error('API Error:', err);
|
console.error('API Error:', err);
|
||||||
@ -334,7 +422,6 @@ Analyze the flow implied in the prompt:
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
fetchTreeById(id: number) {
|
fetchTreeById(id: number) {
|
||||||
this.siteTreeService.getById(id).subscribe({
|
this.siteTreeService.getById(id).subscribe({
|
||||||
next: (res) => {
|
next: (res) => {
|
||||||
|
|||||||
@ -99,6 +99,7 @@ import { TreeVisualizerComponent } from './fnd/SiteTreeBuilder/tree-visualizer.c
|
|||||||
import { SiteTreeComponent } from './fnd/SiteTreeBuilder/SiteBuilderGrid/SiteTree.component';
|
import { SiteTreeComponent } from './fnd/SiteTreeBuilder/SiteBuilderGrid/SiteTree.component';
|
||||||
import { EditstepperComponent } from './BuilderComponents/vpspack/Visa_application/VisaOrderWorkflow/editstepper.component';
|
import { EditstepperComponent } from './BuilderComponents/vpspack/Visa_application/VisaOrderWorkflow/editstepper.component';
|
||||||
import { Design_lbraryComponent } from './fnd/SiteTreeBuilder/Design_lbrary/Design_lbrary.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
|
// 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, },
|
{ path: 'sitetree', component: SiteTreeComponent, },
|
||||||
|
|
||||||
|
|||||||
@ -126,6 +126,7 @@ import { SiteTreeComponent } from './fnd/SiteTreeBuilder/SiteBuilderGrid/SiteTre
|
|||||||
import { TreeNodeComponent } from './fnd/SiteTreeBuilder/TreeNode/tree-node.component';
|
import { TreeNodeComponent } from './fnd/SiteTreeBuilder/TreeNode/tree-node.component';
|
||||||
import { EditstepperComponent } from './BuilderComponents/vpspack/Visa_application/VisaOrderWorkflow/editstepper.component';
|
import { EditstepperComponent } from './BuilderComponents/vpspack/Visa_application/VisaOrderWorkflow/editstepper.component';
|
||||||
import { Design_lbraryComponent } from './fnd/SiteTreeBuilder/Design_lbrary/Design_lbrary.component';
|
import { Design_lbraryComponent } from './fnd/SiteTreeBuilder/Design_lbrary/Design_lbrary.component';
|
||||||
|
import { Dlf_headerComponent } from './fnd/SiteTreeBuilder/Dlf_header/Dlf_header.component';
|
||||||
|
|
||||||
|
|
||||||
@NgModule({
|
@NgModule({
|
||||||
@ -146,7 +147,7 @@ import { Design_lbraryComponent } from './fnd/SiteTreeBuilder/Design_lbrary/Desi
|
|||||||
|
|
||||||
|
|
||||||
// buildercomponents
|
// buildercomponents
|
||||||
|
Dlf_headerComponent,
|
||||||
Design_lbraryComponent,
|
Design_lbraryComponent,
|
||||||
SiteTreeComponent,
|
SiteTreeComponent,
|
||||||
EditstepperComponent,
|
EditstepperComponent,
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user