build_app

This commit is contained in:
risadmin_prod 2025-06-14 10:54:45 +00:00
parent c09cb31eb1
commit 49a935f771
114 changed files with 14344 additions and 14 deletions

View File

@ -2,14 +2,14 @@
export const LoginEnvironment = {
"templateNo": "<templateNo>",
"loginHeading": "<loginHeading>",
"loginHeading2": "<loginHeading2>",
"isSignup": "<isSignup>",
"loginSignup": "<loginSignup> ",
"loginSignup2": "<loginSignup2>",
"loginForgotpass": "<loginForgotpass>",
"loginImage": "<loginImage>",
"loginImageURL": "<loginImageURL>"
"templateNo": "Template 1",
"loginHeading": "Welcome to",
"loginHeading2": "io8.dev",
"isSignup": "true",
"loginSignup": "Use your ID to sign in OR ",
"loginSignup2": "create one now",
"loginForgotpass": "FORGOT PASSWORD?",
"loginImage": "[]",
"loginImageURL": "null"
}

View File

@ -0,0 +1,385 @@
<ol class="breadcrumb breadcrumb-arrow font-trirong">
<li><a href="javascript://"> Ad6</a></li>
</ol>
<div class="dg-wrapper">
<div class="clr-row">
<div class="clr-col-8">
<h3>Ad6 </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>
<!-- 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>{{user. description }}</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>
<!-- // EDIT DATA......... -->
<clr-modal [(clrModalOpen)]="modalEdit" [clrModalSize]="'lg'" [clrModalStaticBackdrop]="true">
<h3 class="modal-title">Update Ad6
<!--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>
<input class="clr-input" type="text" [(ngModel)]="rowSelected.description" name="description" />
</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 Ad6
<!-- aeroplane icon -->
&nbsp; &nbsp; &nbsp; &nbsp;
<a *ngIf="userrole?.includes('ADMIN')" style="float: right;" href="javascript:void(0)" role="tooltip" aria-haspopup="true"
class="tooltip tooltip-sm tooltip-bottom-left">
<a id="build_extension" [routerLink]="['../extension/all']" [queryParams]="{ formCode: 'Ad6_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>
<input class="clr-input" type="text" formControlName="description" />
</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>
<!-- payment -->
<button type="submit" class="btn btn-primary" (click)="checkout()">Checkout</button>
<!-- payment -->
</div>
</form>
</div>
</clr-modal>
<!-- payment code start-->
<clr-modal [(clrModalOpen)]="checkoutModal" [clrModalSize]="'sm'" [clrModalStaticBackdrop]="true" style="height:200px;">
<h3 class="modal-title">Choose Payment Method</h3>
<div class="modal-body"><div class="clr-row">
<div class="clr-col-12">
<a (click)="paytmPay()" class="card clickable card-img" style="width:100px">
<img width="100" alt="Image" src="../../../../../../assets/images/icon/paytm1.png">
</a>
</div>
<div class="clr-col-12">
<a (click)="razorPay()" class="card clickable card-img" style="width:140px">
<img width="100" alt="Image" src="../../../../../../assets/images/icon/razorpay.png">
</a>
</div>
</div>
</div>
</clr-modal><!-- payment code end-->
<!-- htmlpopup -->

View File

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

View File

@ -0,0 +1,283 @@
import { Component, OnInit } from '@angular/core';
import { ToastrService } from 'ngx-toastr';
import { AlertService } from 'src/app/services/alert.service';
import { Ad6service} from './Ad6.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 { Ad6cardvariable } from './Ad6_cardvariable';
import { UserInfoService } from 'src/app/services/user-info.service';
declare var JsBarcode: any;
@Component({
selector: 'app-Ad6',
templateUrl: './Ad6.component.html',
styleUrls: ['./Ad6.component.scss']
})
export class Ad6Component implements OnInit {
cardButton = Ad6cardvariable.cardButton;
cardmodeldata = Ad6cardvariable.cardmodeldata;
public dashboardArray: DashboardContentModel2[];
isCardview = Ad6cardvariable.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 = 'Ad6_formCode'
tableName = 'Ad6'; checkFormCode; selected: any[] = []; constructor(
private extensionService: ExtensionService,
private userInfoService:UserInfoService,
private mainService:Ad6service,
private alertService: AlertService,
private toastr: ToastrService,
private _fb: FormBuilder,
) { }
// 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],
}); // 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 === "Ad6_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();
}
// payment code start
checkoutModal = false;
checkout(){ this.checkoutModal = true; }
paytmPay(){
this.checkoutModal = false; console.log('Paytm Payment started');
this.mainService.paytmPay(this.entryForm.value).subscribe(data=>{
console.log(data); this.onSubmit(); },(error)=>{
console.log(error); }); } orderData = {
amount: '', };
razorPay(){
this.checkoutModal = false;
this.orderData.amount = this.entryForm.value.amount;
console.log('Razorpay Payment started');
this.mainService.razorPay(this.orderData).subscribe(data=>{
console.log(data); this.onSubmit(); },(error)=>{
console.log(error); }); } // payment code end
// updateaction
}

View File

@ -0,0 +1,45 @@
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 Ad6service{
private baseURL = "Ad6/Ad6" ; 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);
}
// payment code start
paytmPay(data: any): Observable<any> {
const url = `payment/start`; return this.apiRequest.post(url, data);
}
razorPay(orderData: any): Observable<any> {
const url = `payment/razorpay/create-order`;
return this.apiRequest.post(url, orderData); } // payment code end
// updateaction
}

View File

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

View File

@ -0,0 +1,397 @@
<ol class="breadcrumb breadcrumb-arrow font-trirong">
<li><a href="javascript://"> Ad7</a></li>
</ol>
<div class="dg-wrapper">
<div class="clr-row">
<div class="clr-col-8">
<h3>Ad7 </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 -->
<!-- insert button -->
<button id="insert" class="btn btn-primary" (click)="goToInsertButton_Field2()">
<clr-icon shape="plus"></clr-icon>Insert Button_Field2
</button>
<!-- insert end -->
<!-- insert button -->
<button id="insert" class="btn btn-primary" (click)="goToInsertButton_Field()">
<clr-icon shape="plus"></clr-icon>Insert Button_Field
</button>
<!-- insert end -->
<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>
<!-- 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>
<!-- 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>
<!-- // EDIT DATA......... -->
<clr-modal [(clrModalOpen)]="modalEdit" [clrModalSize]="'lg'" [clrModalStaticBackdrop]="true">
<h3 class="modal-title">Update Ad7
<!--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>
<!-- 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 Ad7
<!-- aeroplane icon -->
&nbsp; &nbsp; &nbsp; &nbsp;
<a *ngIf="userrole?.includes('ADMIN')" style="float: right;" href="javascript:void(0)" role="tooltip" aria-haspopup="true"
class="tooltip tooltip-sm tooltip-bottom-left">
<a id="build_extension" [routerLink]="['../extension/all']" [queryParams]="{ formCode: 'Ad7_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>
<!-- 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 -->
<clr-modal [(clrModalOpen)]="modalInsertButton_Field2" [clrModalSize]="'xl'" [clrModalStaticBackdrop]="true">
<h3 class="modal-title">Insert Button_Field2</h3>
<div class="modal-body">
<form [formGroup]="insertFormButton_Field2" (ngSubmit)="onSubmitInsertButton_Field2()">
<div class="clr-row">
<div class="clr-col-md-4 clr-col-sm-12">
<label for="description">Description:</label>
<input type="text" id="description" formControlName="description" name="description" readonly class="clr-input">
</div>
<div class="clr-col-md-4 clr-col-sm-12">
<label for="name">Name:</label>
<input type="text" id="name" formControlName="name" name="name" placeholder="Enter Name" class="clr-input">
</div>
</div>
<br>
<div class="modal-footer">
<button type="button" class="btn btn-outline" (click)="modalInsertButton_Field2 = false">Cancel</button>
<button type="submit" class="btn btn-primary" >Insert</button>
</div>
</form>
</div>
</clr-modal>
<clr-modal [(clrModalOpen)]="modalInsertButton_Field" [clrModalSize]="'xl'" [clrModalStaticBackdrop]="true">
<h3 class="modal-title">Insert Button_Field</h3>
<div class="modal-body">
<form [formGroup]="insertFormButton_Field" (ngSubmit)="onSubmitInsertButton_Field()">
<div class="clr-row">
<div class="clr-col-md-4 clr-col-sm-12">
<label for="description">Description:</label>
<input type="text" id="description" formControlName="description" name="description" placeholder="Enter Description" class="clr-input">
</div>
<div class="clr-col-md-4 clr-col-sm-12">
<label for="name">Name:</label>
<input type="text" id="name" formControlName="name" name="name" readonly class="clr-input">
</div>
</div>
<br>
<div class="modal-footer">
<button type="button" class="btn btn-outline" (click)="modalInsertButton_Field = false">Cancel</button>
<button type="submit" class="btn btn-primary" >Insert</button>
</div>
</form>
</div>
</clr-modal>

View File

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

View File

@ -0,0 +1,351 @@
import { Component, OnInit } from '@angular/core';
import { ToastrService } from 'ngx-toastr';
import { AlertService } from 'src/app/services/alert.service';
import { Ad7service} from './Ad7.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 { Ad7cardvariable } from './Ad7_cardvariable';
import { UserInfoService } from 'src/app/services/user-info.service';
declare var JsBarcode: any;
@Component({
selector: 'app-Ad7',
templateUrl: './Ad7.component.html',
styleUrls: ['./Ad7.component.scss']
})
export class Ad7Component implements OnInit {
cardButton = Ad7cardvariable.cardButton;
cardmodeldata = Ad7cardvariable.cardmodeldata;
public dashboardArray: DashboardContentModel2[];
isCardview = Ad7cardvariable.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 = 'Ad7_formCode'
tableName = 'Ad7'; checkFormCode; selected: any[] = []; constructor(
private extensionService: ExtensionService,
private userInfoService:UserInfoService,
private mainService:Ad7service,
private alertService: AlertService,
private toastr: ToastrService,
private _fb: FormBuilder,
) { }
// component button
public insertFormButton_Field2: FormGroup;
public insertFormButton_Field: FormGroup;
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],
}); // component_button200
// inser code start
this.insertFormButton_Field2 = this._fb.group({
description: 'textarea',
name: '',
});
// insert code end
// inser code start
this.insertFormButton_Field = this._fb.group({
description: '',
name: 'text',
});
// insert code end
// 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 === "Ad7_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();
}
// updateaction
// insert button
modalInsertButton_Field2 = false;
goToInsertButton_Field2() {
this.modalInsertButton_Field2=true;
}
onSubmitInsertButton_Field2() {
console.log(this.insertFormButton_Field2.value);
this.submitted=true;
if (this.insertFormButton_Field2.invalid) {
return;
}
this.onInsertButton_Field2();
}
onInsertButton_Field2() {
this.modalInsertButton_Field2=false;
this.mainService.insertButton_Field2Support(this.insertFormButton_Field2.value).subscribe(data => {
console.log('After add',data)
if (data.status >=200 && data.status <=209) {
this.toastr.success('Added successfully');
}
if (data && data.id != null) {
this.toastr.success('Added successfully');
} this.ngOnInit();
},(error) => {
console.error(error);
if ( error.status >= 200 && error.status <= 299) {
this.toastr.success("Update Successfully");
}
if ( error.status >= 400 && error.status <= 499) {
this.toastr.error("Update Failed");
}
if ( error.status >= 500 && error.status <= 599) {
this.toastr.error("Server Error");
}
this.ngOnInit();
});
this.insertFormButton_Field2.reset();
}
// insert buuton code end
// insert button
modalInsertButton_Field = false;
goToInsertButton_Field() {
this.modalInsertButton_Field=true;
}
onSubmitInsertButton_Field() {
console.log(this.insertFormButton_Field.value);
this.submitted=true;
if (this.insertFormButton_Field.invalid) {
return;
}
this.onInsertButton_Field();
}
onInsertButton_Field() {
this.modalInsertButton_Field=false;
this.mainService.insertButton_FieldSupport(this.insertFormButton_Field.value).subscribe(data => {
console.log('After add',data)
if (data.status >=200 && data.status <=209) {
this.toastr.success('Added successfully');
}
if (data && data.id != null) {
this.toastr.success('Added successfully');
} this.ngOnInit();
},(error) => {
console.error(error);
if ( error.status >= 200 && error.status <= 299) {
this.toastr.success("Update Successfully");
}
if ( error.status >= 400 && error.status <= 499) {
this.toastr.error("Update Failed");
}
if ( error.status >= 500 && error.status <= 599) {
this.toastr.error("Server Error");
}
this.ngOnInit();
});
this.insertFormButton_Field.reset();
}
// insert buuton code end
}

View File

@ -0,0 +1,47 @@
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 Ad7service{
private baseURL = "Ad7/Ad7" ; 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
// insert button code start
insertButton_Field2Support(Support: any): Observable<any> {
return this.apiRequest.post(`ad7/ad7/Support_insert`, Support);
}
// insert button code start
insertButton_FieldSupport(Support: any): Observable<any> {
return this.apiRequest.post(`ad7/ad7/Support_insert`, Support);
}
}

View File

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

View File

@ -0,0 +1,477 @@
<ol class="breadcrumb breadcrumb-arrow font-trirong">
<li><a href="javascript://"> Ad8</a></li>
</ol>
<div class="dg-wrapper">
<div class="clr-row">
<div class="clr-col-8">
<h3>Ad8 </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>
<!-- 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>
<!-- 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>
<!-- // EDIT DATA......... -->
<clr-modal [(clrModalOpen)]="modalEdit" [clrModalSize]="'lg'" [clrModalStaticBackdrop]="true">
<h3 class="modal-title">Update Ad8
<!--update button -->
<!-- update button -->
<button id="Update" class="btn btn-primary" (click)="goToUpdateButtonUpdate()">
<clr-icon shape="plus"></clr-icon>Update ButtonUpdate
</button>
<!-- update end -->
</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>
<!-- one to many code start here -->
<div class="clr-row">
<div class="clr-col-lg-12">
<table class="table" style="width:100%;">
<thead>
<tr>
<th class="left" style="width:200px;">Description</th>
<th class="left" style="width:200px;">Name</th>
<th class="right" style="width:200px;">{{ components?.length >= 1 ? 'Actions' : '' }}</th>
</tr>
</thead>
<tbody>
<tr *ngFor="let component of components; let i = index">
<td class="left"> <input type="text" name="Description" [(ngModel)]="component.Description" [ngModelOptions]=" {standalone: true}" placeholder="Enter Description" class="clr-input">
</td>
<td class="left"> <input type="text" name="Name" [(ngModel)]="component.Name" [ngModelOptions]=" {standalone: true}" placeholder="Enter Name" class="clr-input">
</td>
<td> <a>
<clr-icon shape="trash" class="is-error" (click)="deleteRow(i)"></clr-icon>
</a> </td>
</tr>
</tbody>
<button type="button" class="btn btn-primary button1" (click)="oneditLines()" style="margin-left: 20px;">
<clr-icon shape="plus"></clr-icon> </button>
</table>
</div>
</div>
<!-- one to many code end here -->
<!-- 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 Ad8
<!-- aeroplane icon -->
&nbsp; &nbsp; &nbsp; &nbsp;
<a *ngIf="userrole?.includes('ADMIN')" style="float: right;" href="javascript:void(0)" role="tooltip" aria-haspopup="true"
class="tooltip tooltip-sm tooltip-bottom-left">
<a id="build_extension" [routerLink]="['../extension/all']" [queryParams]="{ formCode: 'Ad8_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>
<!-- one to many code start here -->
<div style="margin-top: 30px;"><h4 style="display: inline;">support </h4>
</div>
<hr>
<div class="clr-row">
<div class="clr-col-lg-12">
<table class="table" style="width:100%;" formArrayName="support">
<thead>
<tr>
<th class="left" style="width:125px;">Description</th>
<th class="left" style="width:125px;">Name</th>
<th class="right" style="width:125px;">{{ controls.length > 1 ? 'Actions' : '' }}</th>
</tr>
</thead>
<tbody>
<tr *ngFor="let item of controls; let i=index" [formGroupName]="i">
<td class="left"> <input type="text" formControlName="Description" placeholder="Enter Description" style="width:180px"
class="clr-input"> </td>
<td class="left"> <input type="text" formControlName="Name" placeholder="Enter Name" style="width:180px"
class="clr-input"> </td>
<td style="width:40px;">
<a *ngIf="controls.length > 1" (click)="onRemoveLines(i)"><clr-icon shape="trash" class="is-error"></clr-icon>
</a>
</td>
</tr>
</tbody>
<button type="button" class="btn btn-primary button1" (click)="onAddLines()" >
<clr-icon shape="plus"></clr-icon> </button>
</table>
</div>
</div>
<!-- one to many code end here -->
<!-- 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 -->
<clr-modal [(clrModalOpen)]="modalUpdateButtonUpdate" [clrModalSize]="'xl'" [clrModalStaticBackdrop]="true">
<h3 class="modal-title">Update ButtonUpdate</h3>
<div class="modal-body">
<form [formGroup]="UpdateFormButtonUpdate" (ngSubmit)="onSubmitUpdateButtonUpdate(rowSelected.id)">
<div class="clr-row">
<div class="clr-col-md-4 clr-col-sm-12">
<label for="description">Description:</label>
<input type="text" id="description" formControlName="description" name="description" placeholder="Enter Description" class="clr-input">
</div>
<div class="clr-col-md-4 clr-col-sm-12">
<label for="name">Name:</label>
<input type="text" id="name" formControlName="name" name="name" readonly class="clr-input">
</div>
</div>
<br>
<div class="modal-footer">
<button type="button" class="btn btn-outline" (click)="modalUpdateButtonUpdate = false">Cancel</button>
<button type="submit" class="btn btn-primary" >Update</button>
</div>
</form>
</div>
</clr-modal>

View File

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

View File

@ -0,0 +1,353 @@
import { Component, OnInit } from '@angular/core';
import { ToastrService } from 'ngx-toastr';
import { AlertService } from 'src/app/services/alert.service';
import { Ad8service} from './Ad8.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 { Ad8cardvariable } from './Ad8_cardvariable';
import { UserInfoService } from 'src/app/services/user-info.service';
declare var JsBarcode: any;
@Component({
selector: 'app-Ad8',
templateUrl: './Ad8.component.html',
styleUrls: ['./Ad8.component.scss']
})
export class Ad8Component implements OnInit {
cardButton = Ad8cardvariable.cardButton;
cardmodeldata = Ad8cardvariable.cardmodeldata;
public dashboardArray: DashboardContentModel2[];
isCardview = Ad8cardvariable.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 = 'Ad8_formCode'
tableName = 'Ad8'; checkFormCode; selected: any[] = []; constructor(
private extensionService: ExtensionService,
private userInfoService:UserInfoService,
private mainService:Ad8service,
private alertService: AlertService,
private toastr: ToastrService,
private _fb: FormBuilder,
) { }
// component button
public UpdateFormButtonUpdate: FormGroup;
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],
support: this._fb.array([this.initLinesForm()]),
}); // component_button200
// inser code start
this.UpdateFormButtonUpdate = this._fb.group({
description: '',
name: 'text',
});
// Update code end
// 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 === "Ad8_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
}
// one to many start
initLinesForm() { return this._fb.group({
Description: [null],
Name: [null],
}); }
get controls() {return (this.entryForm.get("support") as FormArray).controls; }
onAddLines() {
(<FormArray>this.entryForm.get("support")).push(this.initLinesForm()); }
onRemoveLines(index: number) {
(<FormArray>this.entryForm.get("support")).removeAt(index); }
oneditLines() { this.components.push({
Description: "",
Name: "",
}); }
deleteRow(index) {
this.components.splice(index, 1);
}
components;
// one to many 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.components = row.support;
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();
}
// updateaction
// update button
modalUpdateButtonUpdate = false;
goToUpdateButtonUpdate() {
this.modalUpdateButtonUpdate=true;
}
onSubmitUpdateButtonUpdate(id) {
console.log(this.UpdateFormButtonUpdate.value);
this.submitted=true;
if (this.UpdateFormButtonUpdate.invalid) {
return;
}
this.onUpdateButtonUpdate(id);
}
onUpdateButtonUpdate(id) {
this.modalUpdateButtonUpdate=false;
this.mainService.updateSupport(id,this.UpdateFormButtonUpdate.value).subscribe(data => {
console.log(data)
if (data.status >=200 && data.status <=209) {
this.toastr.success('Added successfully');
}
this.ngOnInit();
},(error) => {
console.error(error);
if ( error.status >= 200 && error.status <= 299) {
this.toastr.success("Update Successfully");
}
if ( error.status >= 400 && error.status <= 499) {
this.toastr.error("Update Failed");
}
if ( error.status >= 500 && error.status <= 599) {
this.toastr.error("Server Error");
}
this.ngOnInit();
});
this.UpdateFormButtonUpdate.reset();
}
// update buuton code end
}

View File

@ -0,0 +1,44 @@
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 Ad8service{
private baseURL = "Ad8/Ad8" ; 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
// update button code start
updateSupport(id: number,Support: any): Observable<any> {
return this.apiRequest.put(`Support/Support_update/`+ id, Support);
}
}

View File

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

View File

@ -0,0 +1,420 @@
<ol class="breadcrumb breadcrumb-arrow font-trirong">
<li><a href="javascript://"> Ad9</a></li>
</ol>
<div class="dg-wrapper">
<div class="clr-row">
<div class="clr-col-8">
<h3>Ad9 </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>
<!-- 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>
<!-- 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>
<!-- // EDIT DATA......... -->
<clr-modal [(clrModalOpen)]="modalEdit" [clrModalSize]="'lg'" [clrModalStaticBackdrop]="true">
<h3 class="modal-title">Update Ad9
<!--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> Approved Field Status</label>
<input id="name" class="clr-input" type="text" [(ngModel)]="rowSelected.approved_field_status" name="approved_field_status" />
</div>
</div>
<!-- approval code start-->
<div>
<div class="section">
<h6>Approval Hierarchy</h6>
</div>
<table class="table">
<thead>
<tr>
<th>No</th>
<th>Form Code</th>
<th>Document Seq</th>
<th>Approver</th>
<th>Action Type</th>
<th>Action Taken</th>
<th>Comments</th>
<th>Actioned At</th>
<th>Cancel</th>
</tr>
</thead>
<tbody>
<tr *ngFor="let data of serverData; let i=index">
<td style="width: 70px;"><input type="text" class="clr-input" value={{i+1}} name="id" readonly></td>
<td> <input type="text" class="clr-input" [(ngModel)]="data.formCode" [ngModelOptions]="{standalone:
true}" name="formCode"></td>
<td> <input type="text" class="clr-input" [(ngModel)]="data.documentSeq" [ngModelOptions]="{standalone:
true}" name="documentSeq"></td>
<td> <input type="text" class="clr-input" [(ngModel)]="data.approver" [ngModelOptions]="{standalone:
true}" name="approver"></td>
<td> <select name="actionType" [(ngModel)]="data.actionType" [ngModelOptions]="{standalone: true}">
<option>ApprovedBy</option>
<option>RecommendedBy</option>
<option>ActionBy</option>
</select></td>
<td> <input type="text" class="clr-input" name="actionTaken" [(ngModel)]="data.actionTaken"
[ngModelOptions]="{standalone: true}"></td>
<td> <input type="text" class="clr-input" [(ngModel)]="data.comments" [ngModelOptions]="{standalone:
true}" name="comments"></td>
<td> <input type="date" class="clr-input" [(ngModel)]="data.actionedAt" [ngModelOptions]="{standalone:
true}" name="actionedAt"></td>
<td> <a (click)="oneditRemoveLines(i)">
<clr-icon shape="trash" class="is-error"></clr-icon>
</a> </td>
</tr>
</tbody>
<button type="button" class="btn btn-primary button1" style="margin-left: 20px;" (click)="oneditAddLines()">
<clr-icon shape="plus"></clr-icon> </button>
</table>
</div>
<!-- approval end -->
<!-- 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 Ad9
<!-- aeroplane icon -->
&nbsp; &nbsp; &nbsp; &nbsp;
<a *ngIf="userrole?.includes('ADMIN')" style="float: right;" href="javascript:void(0)" role="tooltip" aria-haspopup="true"
class="tooltip tooltip-sm tooltip-bottom-left">
<a id="build_extension" [routerLink]="['../extension/all']" [queryParams]="{ formCode: 'Ad9_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> Approved Field status:</label>
<input class="clr-input" type="text" formControlName="approved_field_status" /> </div>
</div>
<!-- approval code start-->
<div>
<div class="section">
<h6>Approval Hierarchy</h6>
</div>
<table class="table">
<thead><tr> <th>No</th> <th>Form Code</th>
<th>Document Seq</th> <th>Approver</th>
<th>Comments</th> <th>Actioned At</th>
<th>Cancel</th>
</tr> </thead>
<tbody>
<tr *ngFor="let data of serverData; let i = index">
<td style="width: 70px;"><input type="text" class="clr-input" value={{i+1}} name="id" readonly></td>
<td> <input type="text" class="clr-input" [(ngModel)]="data.formCode" [ngModelOptions]="{standalone: true}"
name="formCode"></td>
<td> <input type="text" class="clr-input" [(ngModel)]="data.documentSeq" [ngModelOptions]="{standalone: true}"
name="documentSeq"></td>
<td> <input type="text" class="clr-input" [(ngModel)]="data.approver" [ngModelOptions]="{standalone: true}"
name="approver"></td>
<td> <input type="text" class="clr-input" [(ngModel)]="data.comments" [ngModelOptions]="{standalone: true}"
name="comments"></td>
<td> <input type="date" class="clr-input" [(ngModel)]="data.actionedAt" [ngModelOptions]="{standalone: true}"
name="actionedAt"></td>
<td><a (click)="onRemoveLines(i)">
<clr-icon shape="trash" class="is-error"></clr-icon>
</a></td>
</tr>
</tbody>
<button type="button" class="btn btn-primary button1" style="margin-left: 20px;" (click)="onAddLines()">
<clr-icon shape="plus"></clr-icon></button>
</table>
</div><!-- approval end -->
<!-- form code start -->
<div *ngIf="checkFormCode">
<h4 style="font-weight: 300;display: inline;">Extension</h4>
<br>
<hr>
<div class="clr-row">
<div class="clr-col-4" *ngFor="let field of additionalFieldsFromBackend">
<ng-container *ngIf="field.formCode === formcode" [ngSwitch]="field.fieldType">
<!-- Text Input --> <label *ngSwitchCase="'text'">{{ field.fieldName }}</label>
<input *ngSwitchCase="'text'" [type]="field.fieldType" [formControlName]="field.extValue"
class="clr-input" />
<!-- Date Input --> <label *ngSwitchCase="'date'">{{ field.fieldName }}</label>
<input *ngSwitchCase="'date'" [type]="field.fieldType" [formControlName]="field.extValue"
class="clr-input" />
<!-- Textarea --> <label *ngSwitchCase="'textarea'">{{ field.fieldName }}</label>
<textarea *ngSwitchCase="'textarea'" [formControlName]="field.extValue" col="10" row="2"></textarea>
<!-- Checkbox --> <label *ngSwitchCase="'checkbox'">{{ field.fieldName }}</label><br>
<input *ngSwitchCase="'checkbox'" [type]="field.fieldType" [formControlName]="field.extValue"
class="clr-checkbox" />
</ng-container>
</div>
</div>
</div>
<!-- form code end --> <div class="modal-footer">
<button type="button" class="btn btn-outline" (click)="modalAdd = false">Cancel</button>
<button type="submit" class="btn btn-primary" (click)="onSubmit()">ADD</button>
</div>
</form>
</div>
</clr-modal>
<!-- htmlpopup -->

View File

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

View File

@ -0,0 +1,277 @@
import { Component, OnInit } from '@angular/core';
import { ToastrService } from 'ngx-toastr';
import { AlertService } from 'src/app/services/alert.service';
import { Ad9service} from './Ad9.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 { Ad9cardvariable } from './Ad9_cardvariable';
import { UserInfoService } from 'src/app/services/user-info.service';
declare var JsBarcode: any;
@Component({
selector: 'app-Ad9',
templateUrl: './Ad9.component.html',
styleUrls: ['./Ad9.component.scss']
})
export class Ad9Component implements OnInit {
cardButton = Ad9cardvariable.cardButton;
cardmodeldata = Ad9cardvariable.cardmodeldata;
public dashboardArray: DashboardContentModel2[];
isCardview = Ad9cardvariable.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 = 'Ad9_formCode'
tableName = 'Ad9'; checkFormCode; selected: any[] = []; constructor(
private extensionService: ExtensionService,
private userInfoService:UserInfoService,
private mainService:Ad9service,
private alertService: AlertService,
private toastr: ToastrService,
private _fb: FormBuilder,
) { }
// 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],
approved_field_status : [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 === "Ad9_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
}
approved_field_tablename = 'Ad9'
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.serverData = [];
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);
// approve code
this.serverData = this.serverData.map((item) => {
item.tablename = this.approved_field_tablename;
return item;
}); this.serverData = this.serverData.map((item) => {
item.service_order_id = data.id;
return item; });
console.log(this.serverData);
this.serverData.forEach((item) => {
this.mainService.create_approved(item).subscribe(
(data) => { console.log(data); })
}) // approved code end
}, (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();
}
// approval code
serverData:any = [];
onAddLines() {
this.serverData.push({ formCode:"",
documentSeq:"",
approver:"",
actionType:"",
actionTaken:"",
comments:"",
actionedAt:"",
tablename:"",
service_order_id:"", }); }
onRemoveLines(index: number){
this.serverData.splice(index, 1);
}
oneditAddLines() {
this.serverData.push({
formCode:"", documentSeq:"", approver:"",
actionType:"", actionTaken:"", comments:"",
actionedAt:"", tablename:"",
service_order_id:"", }); }
oneditRemoveLines(index: number){ this.serverData.splice(index, 1);
} // approval code end
// updateaction
}

View File

@ -0,0 +1,40 @@
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 Ad9service{
private baseURL = "Ad9/Ad9" ; 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);
}
// approve code
create_approved(data: any): Observable<any> {
const _http = "billing/approval" + "/" + "add";
return this.apiRequest.post(_http, data); } // approved code end
// updateaction
}

View File

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

View File

@ -0,0 +1,766 @@
<ol class="breadcrumb breadcrumb-arrow font-trirong">
<li><a href="javascript://"> Adv3</a></li>
</ol>
<div class="dg-wrapper">
<div class="clr-row">
<div class="clr-col-8">
<h3>Adv3 </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]="' country'"> <ng-container *clrDgHideableColumn="{hidden: false}"> country
</ng-container></clr-dg-column>
<clr-dg-column [clrDgField]="' state'"> <ng-container *clrDgHideableColumn="{hidden: false}"> state
</ng-container></clr-dg-column>
<clr-dg-column [clrDgField]="' stmlit'"> <ng-container *clrDgHideableColumn="{hidden: false}"> stmlit
</ng-container></clr-dg-column>
<clr-dg-column [clrDgField]="' stmmlt2'"> <ng-container *clrDgHideableColumn="{hidden: false}"> stmmlt2
</ng-container></clr-dg-column>
<clr-dg-column [clrDgField]="' dy2'"> <ng-container *clrDgHideableColumn="{hidden: false}"> dy2
</ng-container></clr-dg-column>
<clr-dg-column [clrDgField]="' dy1'"> <ng-container *clrDgHideableColumn="{hidden: false}"> dy1
</ng-container></clr-dg-column>
<clr-dg-column [clrDgField]="' dymlti1'"> <ng-container *clrDgHideableColumn="{hidden: false}"> dymlti1
</ng-container></clr-dg-column>
<clr-dg-column [clrDgField]="' dymlt2'"> <ng-container *clrDgHideableColumn="{hidden: false}"> dymlt2
</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. country }}</clr-dg-cell>
<clr-dg-cell>{{user. state }}</clr-dg-cell>
<clr-dg-cell>{{user. stmlit }}</clr-dg-cell>
<clr-dg-cell>{{user. stmmlt2 }}</clr-dg-cell>
<clr-dg-cell>{{user. dy2name }}</clr-dg-cell>
<clr-dg-cell>{{user. dy1name }}</clr-dg-cell>
<clr-dg-cell>{{user. dymlti1 }}</clr-dg-cell>
<clr-dg-cell>{{user. dymlt2 }}</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>
<!-- // EDIT DATA......... -->
<clr-modal [(clrModalOpen)]="modalEdit" [clrModalSize]="'lg'" [clrModalStaticBackdrop]="true">
<h3 class="modal-title">Update Adv3
<!--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> country</label>
<select name="country" [(ngModel)]="rowSelected.country">
<option [value]="null">Selectcountry
</option>
<option> bharat </option>
<option> nepal </option>
</select> </div>
<div class="clr-col-sm-12">
<label> state</label>
<select name="state" [(ngModel)]="rowSelected.state">
<option [value]="null">Selectstate
</option>
<option> maharastra </option>
<option> bihar </option>
</select> </div>
<div class="clr-col-sm-12">
<label> stmlit</label>
<clr-combobox-container style="margin-top: 0; padding-top: 0;">
<clr-combobox [(ngModel)]="nodeEditPropertiesstmlit .editselectedAttributesstmlit" name="
editselectedAttributesstmlit" clrMulti="true">
<ng-container *clrOptionSelected="let selected">
{{selected}} </ng-container>
<clr-options>
<clr-option *clrOptionItems="let item of selectstmlit" [clrValue]=" item"> {{item}}
</clr-option> </clr-options>
</clr-combobox>
</clr-combobox-container>
</div>
<div class="clr-col-sm-12">
<label> stmmlt2</label>
<clr-combobox-container style="margin-top: 0; padding-top: 0;">
<clr-combobox [(ngModel)]="nodeEditPropertiesstmmlt2 .editselectedAttributesstmmlt2" name="
editselectedAttributesstmmlt2" clrMulti="true">
<ng-container *clrOptionSelected="let selected">
{{selected}} </ng-container>
<clr-options>
<clr-option *clrOptionItems="let item of selectstmmlt2" [clrValue]=" item"> {{item}}
</clr-option> </clr-options>
</clr-combobox>
</clr-combobox-container>
</div>
<div class="clr-col-sm-12">
<label>dy2</label>
<select name="dy2" [(ngModel)]="rowSelected.dy2">
<option [value]="null">Choose dy2</option>
<option *ngFor=" let item of selectdy2" [value]="item.id">{{item.Name }}</option> </select> </div>
<div class="clr-col-sm-12">
<label>dy1</label>
<select name="dy1" [(ngModel)]="rowSelected.dy1">
<option [value]="null">Choose dy1</option>
<option *ngFor=" let item of selectdy1" [value]="item.id">{{item.Name }}</option> </select> </div>
<div class="clr-col-sm-12">
<label> dymlti1</label>
<clr-combobox-container style="margin-top: 0; padding-top: 0;">
<clr-combobox [(ngModel)]="nodeEditPropertiesdymlti1.editselectedAttributesdymlti1" name="editselectedAttributesdymlti1" clrMulti="true" >
<ng-container *clrOptionSelected="let selected">
{{selected}} </ng-container>
<clr-options>
<clr-option *clrOptionItems="let item of selectdymlti1" [clrValue]="item.Name">{{item.Name}} </clr-option> </clr-options>
</clr-combobox>
</clr-combobox-container> </div>
<div class="clr-col-sm-12">
<label> dymlt2</label>
<clr-combobox-container style="margin-top: 0; padding-top: 0;">
<clr-combobox [(ngModel)]="nodeEditPropertiesdymlt2.editselectedAttributesdymlt2" name="editselectedAttributesdymlt2" clrMulti="true" >
<ng-container *clrOptionSelected="let selected">
{{selected}} </ng-container>
<clr-options>
<clr-option *clrOptionItems="let item of selectdymlt2" [clrValue]="item.Name">{{item.Name}} </clr-option> </clr-options>
</clr-combobox>
</clr-combobox-container> </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 Adv3
<!-- aeroplane icon -->
&nbsp; &nbsp; &nbsp; &nbsp;
<a *ngIf="userrole?.includes('ADMIN')" style="float: right;" href="javascript:void(0)" role="tooltip" aria-haspopup="true"
class="tooltip tooltip-sm tooltip-bottom-left">
<a id="build_extension" [routerLink]="['../extension/all']" [queryParams]="{ formCode: 'Adv3_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>country</label>
<select formControlName="country">
<option [value]="null">Select country </option>
<option> bharat </option>
<option> nepal </option>
</select></div>
<div class="clr-col-sm-12">
<label>state</label>
<select formControlName="state">
<option [value]="null">Select state </option>
<option> maharastra </option>
<option> bihar </option>
</select></div>
<div class="clr-col-sm-12">
<label>stmlit</label>
<clr-combobox-container style="margin-top: 0; padding-top: 0;">
<clr-combobox [(ngModel)]="nodeEditPropertiesstmlit.addselectedAttributesstmlit" formControlName="stmlit" clrMulti="true">
<ng-container *clrOptionSelected="let selected">
{{selected}} </ng-container>
<clr-options>
<clr-option *clrOptionItems="let item of selectstmlit" [clrValue]="item"> {{item}}
</clr-option> </clr-options>
</clr-combobox>
</clr-combobox-container> </div>
<div class="clr-col-sm-12">
<label>stmmlt2</label>
<clr-combobox-container style="margin-top: 0; padding-top: 0;">
<clr-combobox [(ngModel)]="nodeEditPropertiesstmmlt2.addselectedAttributesstmmlt2" formControlName="stmmlt2" clrMulti="true">
<ng-container *clrOptionSelected="let selected">
{{selected}} </ng-container>
<clr-options>
<clr-option *clrOptionItems="let item of selectstmmlt2" [clrValue]="item"> {{item}}
</clr-option> </clr-options>
</clr-combobox>
</clr-combobox-container> </div>
<div class="clr-col-sm-12">
<label> dy2</label>
<select formControlName="dy2">
<option [value]="null">Choose dy2</option>
<option *ngFor="let item of selectdy2" [value]="item.id">{{item.Name}}</option>
</select> </div>
<div class="clr-col-sm-12">
<label> dy1</label>
<select formControlName="dy1">
<option [value]="null">Choose dy1</option>
<option *ngFor="let item of selectdy1" [value]="item.id">{{item.Name}}</option>
</select> </div>
<div class="clr-col-sm-12">
<label>dymlti1</label>
<clr-combobox-container style="margin-top: 0; padding-top: 0;">
<clr-combobox [(ngModel)]="nodeEditPropertiesdymlti1.addselectedAttributesdymlti1" formControlName="dymlti1" clrMulti="true" >
<ng-container *clrOptionSelected="let selected">
{{selected}} </ng-container>
<clr-options>
<clr-option *clrOptionItems="let item of selectdymlti1" [clrValue]="item. Name"> {{item. Name}}</clr-option></clr-options>
</clr-combobox>
</clr-combobox-container> </div>
<div class="clr-col-sm-12">
<label>dymlt2</label>
<clr-combobox-container style="margin-top: 0; padding-top: 0;">
<clr-combobox [(ngModel)]="nodeEditPropertiesdymlt2.addselectedAttributesdymlt2" formControlName="dymlt2" clrMulti="true" >
<ng-container *clrOptionSelected="let selected">
{{selected}} </ng-container>
<clr-options>
<clr-option *clrOptionItems="let item of selectdymlt2" [clrValue]="item. Name"> {{item. Name}}</clr-option></clr-options>
</clr-combobox>
</clr-combobox-container> </div>
</div>
<!--Data grid field start-->
<div class="clr-row">
<div class="clr-col-6">
<h3> datagrid Field</h3>
<div style="max-width:fit-content; overflow-x:auto; max-height: 500px; overflow-y: auto;">
<table class="table">
<thead>
<tr>
<th *ngFor="let co of getHeadersdatagrid_field() let i=index">{{co}}</th>
</tr>
</thead>
<tbody>
<tr *ngFor="let item of rowsdatagrid_field?.slice()?.reverse()">
<td *ngFor="let key of getHeadersdatagrid_field()">{{item[key]}}</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<!--Data grid field end-->
<!--Data grid field start-->
<div class="clr-row">
<div class="clr-col-6">
<h3> datagrid Field2</h3>
<div style="max-width:fit-content; overflow-x:auto; max-height: 500px; overflow-y: auto;">
<table class="table">
<thead>
<tr>
<th *ngFor="let co of getHeadersdatagrid_field2() let i=index">{{co}}</th>
</tr>
</thead>
<tbody>
<tr *ngFor="let item of rowsdatagrid_field2?.slice()?.reverse()">
<td *ngFor="let key of getHeadersdatagrid_field2()">{{item[key]}}</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<!--Data grid field end-->
<!-- form code start -->
<div *ngIf="checkFormCode">
<h4 style="font-weight: 300;display: inline;">Extension</h4>
<br>
<hr>
<div class="clr-row">
<div class="clr-col-4" *ngFor="let field of additionalFieldsFromBackend">
<ng-container *ngIf="field.formCode === formcode" [ngSwitch]="field.fieldType">
<!-- Text Input --> <label *ngSwitchCase="'text'">{{ field.fieldName }}</label>
<input *ngSwitchCase="'text'" [type]="field.fieldType" [formControlName]="field.extValue"
class="clr-input" />
<!-- Date Input --> <label *ngSwitchCase="'date'">{{ field.fieldName }}</label>
<input *ngSwitchCase="'date'" [type]="field.fieldType" [formControlName]="field.extValue"
class="clr-input" />
<!-- Textarea --> <label *ngSwitchCase="'textarea'">{{ field.fieldName }}</label>
<textarea *ngSwitchCase="'textarea'" [formControlName]="field.extValue" col="10" row="2"></textarea>
<!-- Checkbox --> <label *ngSwitchCase="'checkbox'">{{ field.fieldName }}</label><br>
<input *ngSwitchCase="'checkbox'" [type]="field.fieldType" [formControlName]="field.extValue"
class="clr-checkbox" />
</ng-container>
</div>
</div>
</div>
<!-- form code end --> <div class="modal-footer">
<button type="button" class="btn btn-outline" (click)="modalAdd = false">Cancel</button>
<button type="submit" class="btn btn-primary" (click)="onSubmit()">ADD</button>
</div>
</form>
</div>
</clr-modal>
<!-- htmlpopup -->

View File

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

View File

@ -0,0 +1,556 @@
import { Component, OnInit } from '@angular/core';
import { ToastrService } from 'ngx-toastr';
import { AlertService } from 'src/app/services/alert.service';
import { Adv3service} from './Adv3.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 { Adv3cardvariable } from './Adv3_cardvariable';
import { UserInfoService } from 'src/app/services/user-info.service';
declare var JsBarcode: any;
@Component({
selector: 'app-Adv3',
templateUrl: './Adv3.component.html',
styleUrls: ['./Adv3.component.scss']
})
export class Adv3Component implements OnInit {
cardButton = Adv3cardvariable.cardButton;
cardmodeldata = Adv3cardvariable.cardmodeldata;
public dashboardArray: DashboardContentModel2[];
isCardview = Adv3cardvariable.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 = 'Adv3_formCode'
tableName = 'Adv3'; checkFormCode; selected: any[] = []; constructor(
private extensionService: ExtensionService,
private userInfoService:UserInfoService,
private mainService:Adv3service,
private alertService: AlertService,
private toastr: ToastrService,
private _fb: FormBuilder,
) { }
// 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({
country : [null],
state : [null],
stmlit : [null],
stmmlt2 : [null],
dy2 : [null],
dy1 : [null],
dymlti1 : [null],
dymlt2 : [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 === "Adv3_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
this.getalldy2();
this.getalldy1();
this.getalldymlti1();
this.getalldymlt2();
}
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.nodeEditPropertiesstmlit.editselectedAttributesstmlit = JSON.parse(this.rowSelected.stmlit );
this.nodeEditPropertiesstmmlt2.editselectedAttributesstmmlt2 = JSON.parse(this.rowSelected.stmmlt2 );
this.nodeEditPropertiesdymlti1.editselectedAttributesdymlti1 = JSON.parse(this.rowSelected.dymlti1 );
this.nodeEditPropertiesdymlt2.editselectedAttributesdymlt2 = JSON.parse(this.rowSelected.dymlt2 );
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;
this.rowSelected.stmlit = JSON.stringify(this.nodeEditPropertiesstmlit.editselectedAttributesstmlit );
this.rowSelected.stmmlt2 = JSON.stringify(this.nodeEditPropertiesstmmlt2.editselectedAttributesstmmlt2 );
this.rowSelected.dymlti1 = JSON.stringify(this.nodeEditPropertiesdymlti1.editselectedAttributesdymlti1 );
this.rowSelected.dymlt2 = JSON.stringify(this.nodeEditPropertiesdymlt2.editselectedAttributesdymlt2 );
//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.entryForm.value.stmlit = JSON.stringify(this.nodeEditPropertiesstmlit.addselectedAttributesstmlit );
this.entryForm.value.stmmlt2 = JSON.stringify(this.nodeEditPropertiesstmmlt2.addselectedAttributesstmmlt2 );
this.entryForm.value.dymlti1 = JSON.stringify(this.nodeEditPropertiesdymlti1.addselectedAttributesdymlti1 );
this.entryForm.value.dymlt2 = JSON.stringify(this.nodeEditPropertiesdymlt2.addselectedAttributesdymlt2 );
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; this.getdatagrid_fieldData();
this.getdatagrid_field2Data();
this.nodeEditPropertiesdymlti1.addselectedAttributesdymlti1 = ""
this.nodeEditPropertiesdymlt2.addselectedAttributesdymlt2 = ""
}
submitted = false;
onSubmit() {
console.log(this.entryForm.value);
this.submitted = true;
if (this.entryForm.invalid) {
return;
}this.onCreate();
}
//datagrid datagrid_field filed start
productdatagrid_field;
rowsdatagrid_field :any[];
getHeadersdatagrid_field () {
this.rowsdatagrid_field = this.productdatagrid_field;
let headers: string[] = [];
if(this.rowsdatagrid_field ) {
this.rowsdatagrid_field.forEach((value) => {
Object.keys(value).forEach((key) => {
if(!headers.find((header) => header == key)){
headers.push(key)
}
})
})
}
return headers;
}
//datagrid datagrid_field filed end
getdatagrid_fieldData() {
this.mainService.getdatagrid_fieldAll().subscribe((data) => {
console.log(data); this.productdatagrid_field = data;
});
}
//datagrid datagrid_field2 filed start
productdatagrid_field2;
rowsdatagrid_field2 :any[];
getHeadersdatagrid_field2 () {
this.rowsdatagrid_field2 = this.productdatagrid_field2;
let headers: string[] = [];
if(this.rowsdatagrid_field2 ) {
this.rowsdatagrid_field2.forEach((value) => {
Object.keys(value).forEach((key) => {
if(!headers.find((header) => header == key)){
headers.push(key)
}
})
})
}
return headers;
}
//datagrid datagrid_field2 filed end
getdatagrid_field2Data() {
this.mainService.getdatagrid_field2All().subscribe((data) => {
console.log(data); this.productdatagrid_field2 = data;
});
}
nodeEditPropertiesstmlit = { addselectedAttributesstmlit :"", editselectedAttributesstmlit :"" }
selectstmlit =[
'bihar',
'sikkim',
];
nodeEditPropertiesstmmlt2 = { addselectedAttributesstmmlt2 :"", editselectedAttributesstmmlt2 :"" }
selectstmmlt2 =[
'p2',
'p3',
'ap',
];
selectdy2 ;
getalldy2() {
this.mainService.getAlldy2().subscribe(data=>{
this.selectdy2 = data;
console.log(data);
},(error) => { console.log(error); }); }
selectdy1 ;
getalldy1() {
this.mainService.getAlldy1().subscribe(data=>{
this.selectdy1 = data;
console.log(data);
},(error) => { console.log(error); }); }
selectdymlti1;
getalldymlti1 () {
this.mainService.getAlldymlti1().subscribe(data=>{
this.selectdymlti1 = data;
console.log(data);
},(error) => { console.log(error); }); }
nodeEditPropertiesdymlti1 = { addselectedAttributesdymlti1:"", editselectedAttributesdymlti1 :"" }
selectdymlt2;
getalldymlt2 () {
this.mainService.getAlldymlt2().subscribe(data=>{
this.selectdymlt2 = data;
console.log(data);
},(error) => { console.log(error); }); }
nodeEditPropertiesdymlt2 = { addselectedAttributesdymlt2:"", editselectedAttributesdymlt2 :"" }
// updateaction
}

View File

@ -0,0 +1,63 @@
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 Adv3service{
private baseURL = "Adv3/Adv3" ; 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);
}
getdatagrid_fieldAll(page?: number, size?: number): Observable<any> {
return this.apiRequest.get("Listtest");
}
getdatagrid_field2All(page?: number, size?: number): Observable<any> {
return this.apiRequest.get("Listtest");
}
getAlldy2(): Observable<any> {
return this.apiRequest.get("Listtest_ListFilter1/Listtest_ListFilter1"); }
getAlldy1(): Observable<any> {
return this.apiRequest.get("Listtest_ListFilter1/Listtest_ListFilter1"); }
getAlldymlti1(): Observable<any> { return this.apiRequest.get("Listtest_ListFilter1/Listtest_ListFilter1"); }
getAlldymlt2(): Observable<any> { return this.apiRequest.get("Listtest_ListFilter1/Listtest_ListFilter1"); }
// updateaction
}

View File

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

View File

@ -0,0 +1,533 @@
<ol class="breadcrumb breadcrumb-arrow font-trirong">
<li><a href="javascript://"> Adv4</a></li>
</ol>
<div class="dg-wrapper">
<div class="clr-row">
<div class="clr-col-8">
<h3>Adv4 </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]="' atoc'"> <ng-container *clrDgHideableColumn="{hidden: false}"> atoc
</ng-container></clr-dg-column>
<clr-dg-column [clrDgField]="' atc2'"> <ng-container *clrDgHideableColumn="{hidden: false}"> atc2
</ng-container></clr-dg-column>
<clr-dg-column [clrDgField]="' atdy1'"> <ng-container *clrDgHideableColumn="{hidden: false}"> atdy1
</ng-container></clr-dg-column>
<clr-dg-column [clrDgField]="' atdy2'"> <ng-container *clrDgHideableColumn="{hidden: false}"> atdy2
</ng-container></clr-dg-column>
<clr-dg-column [clrDgField]="'support.Description'"> <ng-container *clrDgHideableColumn="{hidden: false}">Description</ng-container></clr-dg-column>
<clr-dg-column [clrDgField]="'support.Name'"> <ng-container *clrDgHideableColumn="{hidden: false}">Name</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. atocname }}</clr-dg-cell>
<clr-dg-cell>{{user. atc2name }}</clr-dg-cell>
<clr-dg-cell>{{user. atdy1 }}</clr-dg-cell>
<clr-dg-cell>{{user. atdy2 }}</clr-dg-cell>
<clr-dg-cell>{{user.support.Description}}</clr-dg-cell>
<clr-dg-cell>{{user.support.Name}}</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>
<!-- // EDIT DATA......... -->
<clr-modal [(clrModalOpen)]="modalEdit" [clrModalSize]="'lg'" [clrModalStaticBackdrop]="true">
<h3 class="modal-title">Update Adv4
<!--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> atoc</label>
<input type="text" list="atocconfig" class="clr-input" name="atoc" [(ngModel)]="rowSelected.atoc">
<datalist id="atocconfig">
<option *ngFor="let item of selectatoc" [value]="item.id">{{item.Name }}</option> </datalist> </div>
<div class="clr-col-sm-12">
<label> atc2</label>
<input type="text" list="atc2config" class="clr-input" name="atc2" [(ngModel)]="rowSelected.atc2">
<datalist id="atc2config">
<option *ngFor="let item of selectatc2" [value]="item.id">{{item.Name }}</option> </datalist> </div>
<div class="clr-col-sm-12">
<label> atdy1</label>
<clr-combobox-container style="margin-top: 0; padding-top: 0;">
<clr-combobox [(ngModel)]="nodeEditPropertiesatdy1.editselectedAttributesatdy1" name="editselectedAttributesatdy1" clrMulti="true" >
<ng-container *clrOptionSelected="let selected">
{{selected}} </ng-container>
<clr-options>
<clr-option *clrOptionItems="let item of selectatdy1" [clrValue]="item.Name">{{item.Name}} </clr-option> </clr-options>
</clr-combobox>
</clr-combobox-container> </div>
<div class="clr-col-sm-12">
<label> atdy2</label>
<clr-combobox-container style="margin-top: 0; padding-top: 0;">
<clr-combobox [(ngModel)]="nodeEditPropertiesatdy2.editselectedAttributesatdy2" name="editselectedAttributesatdy2" clrMulti="true" >
<ng-container *clrOptionSelected="let selected">
{{selected}} </ng-container>
<clr-options>
<clr-option *clrOptionItems="let item of selectatdy2" [clrValue]="item.Name">{{item.Name}} </clr-option> </clr-options>
</clr-combobox>
</clr-combobox-container> </div>
</div>
<div class="clr-col-md-4 clr-col-sm-12"> <label>Description</label>
<input class="clr-input" id="name" type="text" [(ngModel)]="rowSelected.support.Description" name="Description" />
</div>
<div class="clr-col-md-4 clr-col-sm-12"> <label>Name</label>
<input class="clr-input" id="name" type="text" [(ngModel)]="rowSelected.support.Name" name="Name" />
</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 Adv4
<!-- aeroplane icon -->
&nbsp; &nbsp; &nbsp; &nbsp;
<a *ngIf="userrole?.includes('ADMIN')" style="float: right;" href="javascript:void(0)" role="tooltip" aria-haspopup="true"
class="tooltip tooltip-sm tooltip-bottom-left">
<a id="build_extension" [routerLink]="['../extension/all']" [queryParams]="{ formCode: 'Adv4_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> atoc</label>
<input type="text" list="atocconfig" class="clr-input" formControlName="atoc">
<datalist id="atocconfig"> <option *ngFor="let item of selectatoc" [value]="item.id">{{item. Name }}</option> </datalist> </div>
<div class="clr-col-sm-12" >
<label> atc2</label>
<input type="text" list="atc2config" class="clr-input" formControlName="atc2">
<datalist id="atc2config"> <option *ngFor="let item of selectatc2" [value]="item.id">{{item. Name }}</option> </datalist> </div>
<div class="clr-col-sm-12">
<label>atdy1</label>
<clr-combobox-container style="margin-top: 0; padding-top: 0;">
<clr-combobox [(ngModel)]="nodeEditPropertiesatdy1.addselectedAttributesatdy1" formControlName="atdy1" clrMulti="true" >
<ng-container *clrOptionSelected="let selected">
{{selected}} </ng-container>
<clr-options>
<clr-option *clrOptionItems="let item of selectatdy1" [clrValue]="item. Name"> {{item. Name}}</clr-option></clr-options>
</clr-combobox>
</clr-combobox-container> </div>
<div class="clr-col-sm-12">
<label>atdy2</label>
<clr-combobox-container style="margin-top: 0; padding-top: 0;">
<clr-combobox [(ngModel)]="nodeEditPropertiesatdy2.addselectedAttributesatdy2" formControlName="atdy2" clrMulti="true" >
<ng-container *clrOptionSelected="let selected">
{{selected}} </ng-container>
<clr-options>
<clr-option *clrOptionItems="let item of selectatdy2" [clrValue]="item. Name"> {{item. Name}}</clr-option></clr-options>
</clr-combobox>
</clr-combobox-container> </div>
</div>
<div style="margin-top: 30px;">
<h4 style="display: inline;">support </h4> </div> <hr>
<div class="clr-row" formArrayName="support">
<div class="clr-col-md-4 clr-col-sm-12">
<label> Description</label>
<input class="clr-input" type="text" formControlName="Description" /> </div>
<div class="clr-col-md-4 clr-col-sm-12">
<label> Name</label>
<input class="clr-input" type="text" formControlName="Name" /> </div>
</div>
<!-- form code start -->
<div *ngIf="checkFormCode">
<h4 style="font-weight: 300;display: inline;">Extension</h4>
<br>
<hr>
<div class="clr-row">
<div class="clr-col-4" *ngFor="let field of additionalFieldsFromBackend">
<ng-container *ngIf="field.formCode === formcode" [ngSwitch]="field.fieldType">
<!-- Text Input --> <label *ngSwitchCase="'text'">{{ field.fieldName }}</label>
<input *ngSwitchCase="'text'" [type]="field.fieldType" [formControlName]="field.extValue"
class="clr-input" />
<!-- Date Input --> <label *ngSwitchCase="'date'">{{ field.fieldName }}</label>
<input *ngSwitchCase="'date'" [type]="field.fieldType" [formControlName]="field.extValue"
class="clr-input" />
<!-- Textarea --> <label *ngSwitchCase="'textarea'">{{ field.fieldName }}</label>
<textarea *ngSwitchCase="'textarea'" [formControlName]="field.extValue" col="10" row="2"></textarea>
<!-- Checkbox --> <label *ngSwitchCase="'checkbox'">{{ field.fieldName }}</label><br>
<input *ngSwitchCase="'checkbox'" [type]="field.fieldType" [formControlName]="field.extValue"
class="clr-checkbox" />
</ng-container>
</div>
</div>
</div>
<!-- form code end --> <div class="modal-footer">
<button type="button" class="btn btn-outline" (click)="modalAdd = false">Cancel</button>
<button type="submit" class="btn btn-primary" (click)="onSubmit()">ADD</button>
</div>
</form>
</div>
</clr-modal>
<!-- htmlpopup -->

View File

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

View File

@ -0,0 +1,349 @@
import { Component, OnInit } from '@angular/core';
import { ToastrService } from 'ngx-toastr';
import { AlertService } from 'src/app/services/alert.service';
import { Adv4service} from './Adv4.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 { Adv4cardvariable } from './Adv4_cardvariable';
import { UserInfoService } from 'src/app/services/user-info.service';
declare var JsBarcode: any;
@Component({
selector: 'app-Adv4',
templateUrl: './Adv4.component.html',
styleUrls: ['./Adv4.component.scss']
})
export class Adv4Component implements OnInit {
cardButton = Adv4cardvariable.cardButton;
cardmodeldata = Adv4cardvariable.cardmodeldata;
public dashboardArray: DashboardContentModel2[];
isCardview = Adv4cardvariable.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 = 'Adv4_formCode'
tableName = 'Adv4'; checkFormCode; selected: any[] = []; constructor(
private extensionService: ExtensionService,
private userInfoService:UserInfoService,
private mainService:Adv4service,
private alertService: AlertService,
private toastr: ToastrService,
private _fb: FormBuilder,
) { }
// 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({
atoc : [null],
atc2 : [null],
atdy1 : [null],
atdy2 : [null],
support: this.initLinesForm(),
}); // 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 === "Adv4_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
this.getallatoc();
this.getallatc2();
this.getallatdy1();
this.getallatdy2();
}
initLinesForm() { return this._fb.group({
Description: [null],
Name: [null],
}); }
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.nodeEditPropertiesatdy1.editselectedAttributesatdy1 = JSON.parse(this.rowSelected.atdy1 );
this.nodeEditPropertiesatdy2.editselectedAttributesatdy2 = JSON.parse(this.rowSelected.atdy2 );
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;
this.rowSelected.atdy1 = JSON.stringify(this.nodeEditPropertiesatdy1.editselectedAttributesatdy1 );
this.rowSelected.atdy2 = JSON.stringify(this.nodeEditPropertiesatdy2.editselectedAttributesatdy2 );
//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.entryForm.value.atdy1 = JSON.stringify(this.nodeEditPropertiesatdy1.addselectedAttributesatdy1 );
this.entryForm.value.atdy2 = JSON.stringify(this.nodeEditPropertiesatdy2.addselectedAttributesatdy2 );
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;
this.nodeEditPropertiesatdy1.addselectedAttributesatdy1 = ""
this.nodeEditPropertiesatdy2.addselectedAttributesatdy2 = ""
}
submitted = false;
onSubmit() {
console.log(this.entryForm.value);
this.submitted = true;
if (this.entryForm.invalid) {
return;
}this.onCreate();
}
selectatoc ;
getallatoc () {
this.mainService.getAllatoc().subscribe(data=>{
this.selectatoc = data; console.log(data);
},(error) => { console.log(error); }); }
selectatc2 ;
getallatc2 () {
this.mainService.getAllatc2().subscribe(data=>{
this.selectatc2 = data; console.log(data);
},(error) => { console.log(error); }); }
selectatdy1;
getallatdy1 () {
this.mainService.getAllatdy1().subscribe(data=>{
this.selectatdy1 = data;
console.log(data);
},(error) => { console.log(error); }); }
nodeEditPropertiesatdy1 = { addselectedAttributesatdy1:"", editselectedAttributesatdy1 :"" }
selectatdy2;
getallatdy2 () {
this.mainService.getAllatdy2().subscribe(data=>{
this.selectatdy2 = data;
console.log(data);
},(error) => { console.log(error); }); }
nodeEditPropertiesatdy2 = { addselectedAttributesatdy2:"", editselectedAttributesatdy2 :"" }
// updateaction
}

View File

@ -0,0 +1,43 @@
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 Adv4service{
private baseURL = "Adv4/Adv4" ; 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);
}
getAllatoc(): Observable<any> { return this.apiRequest.get("Listtest_ListFilter1/Listtest_ListFilter1"); }
getAllatc2(): Observable<any> { return this.apiRequest.get("Listtest_ListFilter1/Listtest_ListFilter1"); }
getAllatdy1(): Observable<any> { return this.apiRequest.get("Listtest_ListFilter1/Listtest_ListFilter1"); }
getAllatdy2(): Observable<any> { return this.apiRequest.get("Listtest_ListFilter1/Listtest_ListFilter1"); }
// updateaction
}

View File

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

View File

@ -0,0 +1,816 @@
<ol class="breadcrumb breadcrumb-arrow font-trirong">
<li><a href="javascript://"> Adv5</a></li>
</ol>
<div class="dg-wrapper">
<div class="clr-row">
<div class="clr-col-8">
<h3>Adv5 </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]="' age'"> <ng-container *clrDgHideableColumn="{hidden: false}"> age
</ng-container></clr-dg-column>
<clr-dg-column [clrDgField]="' age2'"> <ng-container *clrDgHideableColumn="{hidden: false}"> age2
</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>{{user. age }}</clr-dg-cell>
<clr-dg-cell>{{user. age2 }}</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>
<!-- // EDIT DATA......... -->
<clr-modal [(clrModalOpen)]="modalEdit" [clrModalSize]="'lg'" [clrModalStaticBackdrop]="true">
<h3 class="modal-title">Update Adv5
<!--update button -->
<button class="btn btn-icon btn-primary" (click)="openvalueListvalue_list_field('EDIT')">V</button>
<button class="btn btn-icon btn-primary" (click)="openvalueListvalue_list_field2('EDIT')">V</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>age</label>
<input id="name" class="clr-input" type="number" [(ngModel)]="rowSelected.age" name="age" />
</div>
<div class="clr-col-sm-12">
<label>age2</label>
<input id="name" class="clr-input" type="number" [(ngModel)]="rowSelected.age2" name="age2" />
</div>
<!-- calculated field start -->
<div class="clr-col-12 fieldWrapper">
<table class="table table-noborder">
<thead>
<tr>
<th> age</th>
<th> age2</th>
<th>Total</th>
</tr>
</thead>
<tbody>
<tr>
<td>
<input type="text" [(ngModel)]="additionage" [ngModelOptions]="{standalone: true}" name="age" (input)="onInputChangeaddition()" class="clr-input"/>
</td>
<td>
<input type="text" [(ngModel)]="additionage2" [ngModelOptions]="{standalone: true}" name="age2" (input)="onInputChangeaddition()" class="clr-input"/>
</td>
<td>
<input type="text" [(ngModel)]="additiontotal" [ngModelOptions]="{standalone: true}" name="total" class="clr-input" />
</td>
</tr>
</tbody> </table>
</div>
<!-- calculated field end -->
<!-- calculated field start -->
<div class="clr-col-12 fieldWrapper">
<table class="table table-noborder">
<thead>
<tr>
<th> age</th>
<th> age2</th>
<th>Total</th>
</tr>
</thead>
<tbody>
<tr>
<td>
<input type="text" [(ngModel)]="subtrationage" [ngModelOptions]="{standalone: true}" name="age" (input)="onInputChangesubtration()" class="clr-input"/>
</td>
<td>
<input type="text" [(ngModel)]="subtrationage2" [ngModelOptions]="{standalone: true}" name="age2" (input)="onInputChangesubtration()" class="clr-input"/>
</td>
<td>
<input type="text" [(ngModel)]="subtrationtotal" [ngModelOptions]="{standalone: true}" name="total" class="clr-input" />
</td>
</tr>
</tbody> </table>
</div>
<!-- calculated field end -->
</div>
<!-- one to many code start here -->
<div class="clr-row">
<div class="clr-col-lg-12">
<table class="table" style="width:100%;">
<thead>
<tr>
<th class="left" style="width:200px;">Description</th>
<th class="left" style="width:200px;">Name</th>
<th class="right" style="width:200px;">{{ components?.length >= 1 ? 'Actions' : '' }}</th>
</tr>
</thead>
<tbody>
<tr *ngFor="let component of components; let i = index">
<td class="left"> <input type="text" name="Description" [(ngModel)]="component.Description" [ngModelOptions]=" {standalone: true}" placeholder="Enter Description" class="clr-input">
</td>
<td class="left"> <input type="text" name="Name" [(ngModel)]="component.Name" [ngModelOptions]=" {standalone: true}" placeholder="Enter Name" class="clr-input">
</td>
<td> <a>
<clr-icon shape="trash" class="is-error" (click)="deleteRow(i)"></clr-icon>
</a> </td>
</tr>
</tbody>
<button type="button" class="btn btn-primary button1" (click)="oneditLines()" style="margin-left: 20px;">
<clr-icon shape="plus"></clr-icon> </button>
</table>
</div>
</div>
<!-- one to many code end here -->
<!-- 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 Adv5
<button class="btn btn-icon btn-primary" (click)="openvalueListvalue_list_field('ADD')">V</button>
<button class="btn btn-icon btn-primary" (click)="openvalueListvalue_list_field2('ADD')">V</button>
<!-- aeroplane icon -->
&nbsp; &nbsp; &nbsp; &nbsp;
<a *ngIf="userrole?.includes('ADMIN')" style="float: right;" href="javascript:void(0)" role="tooltip" aria-haspopup="true"
class="tooltip tooltip-sm tooltip-bottom-left">
<a id="build_extension" [routerLink]="['../extension/all']" [queryParams]="{ formCode: 'Adv5_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> age</label>
<input class="clr-input" type="number" formControlName="age" />
<div *ngIf="submitted && entryForm.controls.age.errors" class="error_mess">
<div *ngIf="submitted && entryForm.controls.age.errors.required" class="error_mess">*This field is Required</div>
</div>
</div>
<div class="clr-col-sm-12">
<label> age2</label>
<input class="clr-input" type="number" formControlName="age2" />
<div *ngIf="submitted && entryForm.controls.age2.errors" class="error_mess">
<div *ngIf="submitted && entryForm.controls.age2.errors.required" class="error_mess">*This field is Required</div>
</div>
</div>
<!-- calculated field start -->
<div class="clr-col-12 fieldWrapper">
<table class="table table-noborder">
<thead>
<tr>
<th> age </th>
<th> age2 </th>
<th>Total</th>
</tr>
</thead>
<tbody>
<tr>
<td>
<input type="text" [(ngModel)]="additionage" [ngModelOptions]="{standalone: true}" name="age" (input)="onInputChangeaddition()" class="clr-input" />
</td>
<td>
<input type="text" [(ngModel)]="additionage2" [ngModelOptions]="{standalone: true}" name="age2" (input)="onInputChangeaddition()" class="clr-input" />
</td>
<td>
<input type="text" [(ngModel)]="additiontotal" [ngModelOptions]="{standalone: true}" name="total" class="clr-input" />"
</td>
</tr>
</tbody>
</table>
</div>
<!-- calculated field end -->
<!-- calculated field start -->
<div class="clr-col-12 fieldWrapper">
<table class="table table-noborder">
<thead>
<tr>
<th> age </th>
<th> age2 </th>
<th>Total</th>
</tr>
</thead>
<tbody>
<tr>
<td>
<input type="text" [(ngModel)]="subtrationage" [ngModelOptions]="{standalone: true}" name="age" (input)="onInputChangesubtration()" class="clr-input" />
</td>
<td>
<input type="text" [(ngModel)]="subtrationage2" [ngModelOptions]="{standalone: true}" name="age2" (input)="onInputChangesubtration()" class="clr-input" />
</td>
<td>
<input type="text" [(ngModel)]="subtrationtotal" [ngModelOptions]="{standalone: true}" name="total" class="clr-input" />"
</td>
</tr>
</tbody>
</table>
</div>
<!-- calculated field end -->
</div>
<!-- one to many code start here -->
<div style="margin-top: 30px;"><h4 style="display: inline;">support </h4>
</div>
<hr>
<div class="clr-row">
<div class="clr-col-lg-12">
<table class="table" style="width:100%;" formArrayName="support">
<thead>
<tr>
<th class="left" style="width:125px;">Description</th>
<th class="left" style="width:125px;">Name</th>
<th class="right" style="width:125px;">{{ controls.length > 1 ? 'Actions' : '' }}</th>
</tr>
</thead>
<tbody>
<tr *ngFor="let item of controls; let i=index" [formGroupName]="i">
<td class="left"> <input type="text" formControlName="Description" placeholder="Enter Description" style="width:180px"
class="clr-input"> </td>
<td class="left"> <input type="text" formControlName="Name" placeholder="Enter Name" style="width:180px"
class="clr-input"> </td>
<td style="width:40px;">
<a *ngIf="controls.length > 1" (click)="onRemoveLines(i)"><clr-icon shape="trash" class="is-error"></clr-icon>
</a>
</td>
</tr>
</tbody>
<button type="button" class="btn btn-primary button1" (click)="onAddLines()" >
<clr-icon shape="plus"></clr-icon> </button>
</table>
</div>
</div>
<!-- one to many code end here -->
<!-- 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>
<!-- value List field start-->
<clr-modal [(clrModalOpen)]="valueListModalvalue_list_field" [clrModalSize]="'md'">
<h3 class="modal-title"><b>Select From value_list_field List:</b></h3>
<div class="modal-body">
<div class="clr-row">
<div class="clr-col-md-12 clr-col-sm-12" style="margin-top: 8px;">
<input id="data" type="text" placeholder="Enter search Criteria" class="clr-input" name="searchcusttextvalue_list_field" [(ngModel)]="searchcusttextvalue_list_field"> </div>
</div> <clr-datagrid [clrDgLoading]="loading">
<clr-dg-placeholder><clr-spinner [clrMedium]="true">Loading ...</clr-spinner></clr-dg-placeholder>
<clr-dg-column [clrDgField]="'age'"> <ng-container *clrDgHideableColumn="{hidden: false}">age</ng-container></clr-dg-column>
<clr-dg-row *clrDgItems="let user of product?.slice()?.reverse() | filter:searchcusttextvalue_list_field; let i = index " [clrDgItem]="user">
<clr-dg-cell (click)="getcustvalue_list_fieldID(user.id)" style="color: rgb(108, 108, 194); cursor:pointer;">{{user.age}}</clr-dg-cell>
</clr-dg-row> <clr-dg-footer>
<clr-dg-pagination #pagination [clrDgPageSize]="10">
<clr-dg-page-size [clrPageSizeOptions]="[10,20,50,100]">Record per page</clr-dg-page-size>
{{pagination.firstItem + 1}} - {{pagination.lastItem + 1}}
of {{pagination.totalItems}} Records </clr-dg-pagination>
</clr-dg-footer> </clr-datagrid> </div></clr-modal>
<!-- value List field end-->
<!-- value List field start-->
<clr-modal [(clrModalOpen)]="valueListModalvalue_list_field2" [clrModalSize]="'md'">
<h3 class="modal-title"><b>Select From value_list_field2 List:</b></h3>
<div class="modal-body">
<div class="clr-row">
<div class="clr-col-md-12 clr-col-sm-12" style="margin-top: 8px;">
<input id="data" type="text" placeholder="Enter search Criteria" class="clr-input" name="searchcusttextvalue_list_field2" [(ngModel)]="searchcusttextvalue_list_field2"> </div>
</div> <clr-datagrid [clrDgLoading]="loading">
<clr-dg-placeholder><clr-spinner [clrMedium]="true">Loading ...</clr-spinner></clr-dg-placeholder>
<clr-dg-column [clrDgField]="'name'"> <ng-container *clrDgHideableColumn="{hidden: false}">name</ng-container></clr-dg-column>
<clr-dg-column [clrDgField]="'age2'"> <ng-container *clrDgHideableColumn="{hidden: false}">age2</ng-container></clr-dg-column>
<clr-dg-column [clrDgField]="'age'"> <ng-container *clrDgHideableColumn="{hidden: false}">age</ng-container></clr-dg-column>
<clr-dg-row *clrDgItems="let user of product?.slice()?.reverse() | filter:searchcusttextvalue_list_field2; let i = index " [clrDgItem]="user">
<clr-dg-cell (click)="getcustvalue_list_field2ID(user.id)" style="color: rgb(108, 108, 194); cursor:pointer;">{{user.name}}</clr-dg-cell>
<clr-dg-cell (click)="getcustvalue_list_field2ID(user.id)" style="color: rgb(108, 108, 194); cursor:pointer;">{{user.age2}}</clr-dg-cell>
<clr-dg-cell (click)="getcustvalue_list_field2ID(user.id)" style="color: rgb(108, 108, 194); cursor:pointer;">{{user.age}}</clr-dg-cell>
</clr-dg-row> <clr-dg-footer>
<clr-dg-pagination #pagination [clrDgPageSize]="10">
<clr-dg-page-size [clrPageSizeOptions]="[10,20,50,100]">Record per page</clr-dg-page-size>
{{pagination.firstItem + 1}} - {{pagination.lastItem + 1}}
of {{pagination.totalItems}} Records </clr-dg-pagination>
</clr-dg-footer> </clr-datagrid> </div></clr-modal>
<!-- value List field end-->
<!-- htmlpopup -->

View File

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

View File

@ -0,0 +1,791 @@
import { Component, OnInit } from '@angular/core';
import { ToastrService } from 'ngx-toastr';
import { AlertService } from 'src/app/services/alert.service';
import { Adv5service} from './Adv5.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 { Adv5cardvariable } from './Adv5_cardvariable';
import { UserInfoService } from 'src/app/services/user-info.service';
declare var JsBarcode: any;
@Component({
selector: 'app-Adv5',
templateUrl: './Adv5.component.html',
styleUrls: ['./Adv5.component.scss']
})
export class Adv5Component implements OnInit {
cardButton = Adv5cardvariable.cardButton;
cardmodeldata = Adv5cardvariable.cardmodeldata;
public dashboardArray: DashboardContentModel2[];
isCardview = Adv5cardvariable.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 = 'Adv5_formCode'
tableName = 'Adv5'; checkFormCode; selected: any[] = []; constructor(
private extensionService: ExtensionService,
private userInfoService:UserInfoService,
private mainService:Adv5service,
private alertService: AlertService,
private toastr: ToastrService,
private _fb: FormBuilder,
) { }
// 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],
support: this._fb.array([this.initLinesForm()]),
age : [null,[Validators.required]],
age2 : [null,[Validators.required]],
}); // 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 === "Adv5_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
}
// one to many start
initLinesForm() { return this._fb.group({
Description: [null],
Name: [null],
}); }
get controls() {return (this.entryForm.get("support") as FormArray).controls; }
onAddLines() {
(<FormArray>this.entryForm.get("support")).push(this.initLinesForm()); }
onRemoveLines(index: number) {
(<FormArray>this.entryForm.get("support")).removeAt(index); }
oneditLines() { this.components.push({
Description: "",
Name: "",
}); }
deleteRow(index) {
this.components.splice(index, 1);
}
components;
// one to many 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.components = row.support;
//calculated field start
this.additionage= row.age;
this.additionage2= row.age2;
//calculated field end
//calculated field start
this.subtrationage= row.age;
this.subtrationage2= row.age2;
//calculated field end
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;
//calculated field start
this.rowSelected.age= this.additionage;
this.rowSelected.age2= this.additionage2;
this.onInputChangeaddition ();
//calculated field end
//calculated field start
this.rowSelected.age= this.subtrationage;
this.rowSelected.age2= this.subtrationage2;
this.onInputChangesubtration ();
//calculated field end
//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;
//calculated field start
this.entryForm.value.age = this.additionage ;
this.entryForm.value.age2 = this.additionage2 ;
//calculated field end
//calculated field start
this.entryForm.value.age = this.subtrationage ;
this.entryForm.value.age2 = this.subtrationage2 ;
//calculated field end
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;
//calculated field start
this.additionage = '';
this.additionage2 = '';
this.additiontotal = '';
//calculated field end
//calculated field start
this.subtrationage = '';
this.subtrationage2 = '';
this.subtrationtotal = '';
//calculated field end
}
submitted = false;
onSubmit() {
console.log(this.entryForm.value);
this.submitted = true;
if (this.entryForm.invalid) {
return;
}this.onCreate();
}
// calculated field code start
additionage;
additionage2;
additiontotal ;
additioncalculateOperators = "Addition"
onInputChangeaddition() {
const lastObj = 0
const lastObjstring = ''
const age= this.additionage|| '';
const ageValue = parseFloat(this.additionage) || 0;
const age2= this.additionage2|| '';
const age2Value = parseFloat(this.additionage2) || 0;
if (this.additioncalculateOperators =="Addition") {
this.additiontotal = (
ageValue +
age2Value +
lastObj).toString();
}
if (this.additioncalculateOperators == "Subtraction") {
this.additiontotal = (
ageValue -
age2Value -
lastObj).toString();
}
if (this.additioncalculateOperators =="Multiplication") {
this.additiontotal = (
ageValue *
age2Value *
lastObj).toString();
}
if (this.additioncalculateOperators =="Division") {
this.additiontotal = (
ageValue /
age2Value /
lastObj).toString();
}
if (this.additioncalculateOperators =="Concatination") {
this.additiontotal =
age+ ' '+
age2+ ' '+
lastObjstring
}
}
// calculated field code start
subtrationage;
subtrationage2;
subtrationtotal ;
subtrationcalculateOperators = "Multiplication"
onInputChangesubtration() {
const lastObj = 0
const lastObjstring = ''
const age= this.subtrationage|| '';
const ageValue = parseFloat(this.subtrationage) || 0;
const age2= this.subtrationage2|| '';
const age2Value = parseFloat(this.subtrationage2) || 0;
if (this.subtrationcalculateOperators =="Addition") {
this.subtrationtotal = (
ageValue +
age2Value +
lastObj).toString();
}
if (this.subtrationcalculateOperators == "Subtraction") {
this.subtrationtotal = (
ageValue -
age2Value -
lastObj).toString();
}
if (this.subtrationcalculateOperators =="Multiplication") {
this.subtrationtotal = (
ageValue *
age2Value *
lastObj).toString();
}
if (this.subtrationcalculateOperators =="Division") {
this.subtrationtotal = (
ageValue /
age2Value /
lastObj).toString();
}
if (this.subtrationcalculateOperators =="Concatination") {
this.subtrationtotal =
age+ ' '+
age2+ ' '+
lastObjstring
}
}
//Value List field start
valuelistMode;
searchcusttextvalue_list_field :any;
valueListModalvalue_list_field :boolean=false;
openvalueListvalue_list_field(mode){
this.valueListModalvalue_list_field=!this.valueListModalvalue_list_field ;
this.valuelistMode = mode; }
customerdatavalue_list_field ;
cutomererror;
clickedID:number;
getcustvalue_list_fieldID(id:number){
this.clickedID=id;
console.log("clicked by id"+ id);
this.mainService.getById(id).subscribe((data) => { console.log(data);
if(this.valuelistMode == "ADD"){
this.entryForm.get('age').setValue(data.age);
}else if(this.valuelistMode == "EDIT"){
this.rowSelected.age= data. age
} }); this.valueListModalvalue_list_field =false;
} //value List field end
//Value List field start
valuelistMode;
searchcusttextvalue_list_field2 :any;
valueListModalvalue_list_field2 :boolean=false;
openvalueListvalue_list_field2(mode){
this.valueListModalvalue_list_field2=!this.valueListModalvalue_list_field2 ;
this.valuelistMode = mode; }
customerdatavalue_list_field2 ;
cutomererror;
clickedID:number;
getcustvalue_list_field2ID(id:number){
this.clickedID=id;
console.log("clicked by id"+ id);
this.mainService.getById(id).subscribe((data) => { console.log(data);
if(this.valuelistMode == "ADD"){
this.entryForm.get('name').setValue(data.name);
this.entryForm.get('age2').setValue(data.age2);
this.entryForm.get('age').setValue(data.age);
}else if(this.valuelistMode == "EDIT"){
this.rowSelected.name= data. name
this.rowSelected.age2= data. age2
this.rowSelected.age= data. age
} }); this.valueListModalvalue_list_field2 =false;
} //value List field end
// updateaction
}

View File

@ -0,0 +1,49 @@
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 Adv5service{
private baseURL = "Adv5/Adv5" ; constructor(
private http: HttpClient,
private apiRequest: ApiRequestService,
) { }
getAll(page?: number, size?: number): Observable<any> {
return this.apiRequest.get(this.baseURL);
}
getById(id: number): Observable<any> {
const _http = this.baseURL + "/" + id;
return this.apiRequest.get(_http);
}
create(data: any): Observable<any> {
return this.apiRequest.post(this.baseURL, data);
}
update(id: number, data: any): Observable<any> {
const _http = this.baseURL + "/" + id;
return this.apiRequest.put(_http, data);
}
delete(id: number): Observable<any> {
const _http = this.baseURL + "/" + id;
return this.apiRequest.delete(_http);
}
// updateaction
}

View File

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

View File

@ -0,0 +1,349 @@
<ol class="breadcrumb breadcrumb-arrow font-trirong">
<li><a href="javascript://"> Listtest</a></li>
</ol>
<div class="dg-wrapper">
<div class="clr-row">
<div class="clr-col-8">
<h3>Listtest </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>
<!-- 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>
<!-- 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 Listtest
<!--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>
<!-- 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 Listtest
<!-- aeroplane icon -->
&nbsp; &nbsp; &nbsp; &nbsp;
<a *ngIf="userrole?.includes('ADMIN')" style="float: right;" href="javascript:void(0)" role="tooltip" aria-haspopup="true"
class="tooltip tooltip-sm tooltip-bottom-left">
<a id="build_extension" [routerLink]="['../extension/all']" [queryParams]="{ formCode: 'Listtest_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>
<!-- form code start -->
<div *ngIf="checkFormCode">
<h4 style="font-weight: 300;display: inline;">Extension</h4>
<br>
<hr>
<div class="clr-row">
<div class="clr-col-4" *ngFor="let field of additionalFieldsFromBackend">
<ng-container *ngIf="field.formCode === formcode" [ngSwitch]="field.fieldType">
<!-- Text Input --> <label *ngSwitchCase="'text'">{{ field.fieldName }}</label>
<input *ngSwitchCase="'text'" [type]="field.fieldType" [formControlName]="field.extValue"
class="clr-input" />
<!-- Date Input --> <label *ngSwitchCase="'date'">{{ field.fieldName }}</label>
<input *ngSwitchCase="'date'" [type]="field.fieldType" [formControlName]="field.extValue"
class="clr-input" />
<!-- Textarea --> <label *ngSwitchCase="'textarea'">{{ field.fieldName }}</label>
<textarea *ngSwitchCase="'textarea'" [formControlName]="field.extValue" col="10" row="2"></textarea>
<!-- Checkbox --> <label *ngSwitchCase="'checkbox'">{{ field.fieldName }}</label><br>
<input *ngSwitchCase="'checkbox'" [type]="field.fieldType" [formControlName]="field.extValue"
class="clr-checkbox" />
</ng-container>
</div>
</div>
</div>
<!-- form code end --> <div class="modal-footer">
<button type="button" class="btn btn-outline" (click)="modalAdd = false">Cancel</button>
<button type="submit" class="btn btn-primary" (click)="onSubmit()">ADD</button>
</div>
</form>
</div>
</clr-modal>
<!-- htmlpopup -->

View File

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

View File

@ -0,0 +1,246 @@
import { Component, OnInit } from '@angular/core';
import { ToastrService } from 'ngx-toastr';
import { AlertService } from 'src/app/services/alert.service';
import { Listtestservice} from './Listtest.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 { Listtestcardvariable } from './Listtest_cardvariable';
import { UserInfoService } from 'src/app/services/user-info.service';
declare var JsBarcode: any;
@Component({
selector: 'app-Listtest',
templateUrl: './Listtest.component.html',
styleUrls: ['./Listtest.component.scss']
})
export class ListtestComponent implements OnInit {
cardButton = Listtestcardvariable.cardButton;
cardmodeldata = Listtestcardvariable.cardmodeldata;
public dashboardArray: DashboardContentModel2[];
isCardview = Listtestcardvariable.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 = 'Listtest_formCode'
tableName = 'Listtest'; checkFormCode; selected: any[] = []; constructor(
private extensionService: ExtensionService,
private userInfoService:UserInfoService,
private mainService:Listtestservice,
private alertService: AlertService,
private toastr: ToastrService,
private _fb: FormBuilder,
) { }
// 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],
}); // 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 === "Listtest_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
}

View File

@ -0,0 +1,37 @@
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 Listtestservice{
private baseURL = "Listtest/Listtest" ; constructor(
private http: HttpClient,
private apiRequest: ApiRequestService,
) { }
getAll(page?: number, size?: number): Observable<any> {
return this.apiRequest.get(this.baseURL);
}
getById(id: number): Observable<any> {
const _http = this.baseURL + "/" + id;
return this.apiRequest.get(_http);
}
create(data: any): Observable<any> {
return this.apiRequest.post(this.baseURL, data);
}
update(id: number, data: any): Observable<any> {
const _http = this.baseURL + "/" + id;
return this.apiRequest.put(_http, data);
}
delete(id: number): Observable<any> {
const _http = this.baseURL + "/" + id;
return this.apiRequest.delete(_http);
}
// updateaction
}

View File

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

View File

@ -0,0 +1,349 @@
<ol class="breadcrumb breadcrumb-arrow font-trirong">
<li><a href="javascript://"> Support</a></li>
</ol>
<div class="dg-wrapper">
<div class="clr-row">
<div class="clr-col-8">
<h3>Support </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>
<!-- 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>
<!-- 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 Support
<!--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>
<!-- 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 Support
<!-- aeroplane icon -->
&nbsp; &nbsp; &nbsp; &nbsp;
<a *ngIf="userrole?.includes('ADMIN')" style="float: right;" href="javascript:void(0)" role="tooltip" aria-haspopup="true"
class="tooltip tooltip-sm tooltip-bottom-left">
<a id="build_extension" [routerLink]="['../extension/all']" [queryParams]="{ formCode: 'Support_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>
<!-- form code start -->
<div *ngIf="checkFormCode">
<h4 style="font-weight: 300;display: inline;">Extension</h4>
<br>
<hr>
<div class="clr-row">
<div class="clr-col-4" *ngFor="let field of additionalFieldsFromBackend">
<ng-container *ngIf="field.formCode === formcode" [ngSwitch]="field.fieldType">
<!-- Text Input --> <label *ngSwitchCase="'text'">{{ field.fieldName }}</label>
<input *ngSwitchCase="'text'" [type]="field.fieldType" [formControlName]="field.extValue"
class="clr-input" />
<!-- Date Input --> <label *ngSwitchCase="'date'">{{ field.fieldName }}</label>
<input *ngSwitchCase="'date'" [type]="field.fieldType" [formControlName]="field.extValue"
class="clr-input" />
<!-- Textarea --> <label *ngSwitchCase="'textarea'">{{ field.fieldName }}</label>
<textarea *ngSwitchCase="'textarea'" [formControlName]="field.extValue" col="10" row="2"></textarea>
<!-- Checkbox --> <label *ngSwitchCase="'checkbox'">{{ field.fieldName }}</label><br>
<input *ngSwitchCase="'checkbox'" [type]="field.fieldType" [formControlName]="field.extValue"
class="clr-checkbox" />
</ng-container>
</div>
</div>
</div>
<!-- form code end --> <div class="modal-footer">
<button type="button" class="btn btn-outline" (click)="modalAdd = false">Cancel</button>
<button type="submit" class="btn btn-primary" (click)="onSubmit()">ADD</button>
</div>
</form>
</div>
</clr-modal>
<!-- htmlpopup -->

View File

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

View File

@ -0,0 +1,246 @@
import { Component, OnInit } from '@angular/core';
import { ToastrService } from 'ngx-toastr';
import { AlertService } from 'src/app/services/alert.service';
import { Supportservice} from './Support.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 { Supportcardvariable } from './Support_cardvariable';
import { UserInfoService } from 'src/app/services/user-info.service';
declare var JsBarcode: any;
@Component({
selector: 'app-Support',
templateUrl: './Support.component.html',
styleUrls: ['./Support.component.scss']
})
export class SupportComponent implements OnInit {
cardButton = Supportcardvariable.cardButton;
cardmodeldata = Supportcardvariable.cardmodeldata;
public dashboardArray: DashboardContentModel2[];
isCardview = Supportcardvariable.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 = 'Support_formCode'
tableName = 'Support'; checkFormCode; selected: any[] = []; constructor(
private extensionService: ExtensionService,
private userInfoService:UserInfoService,
private mainService:Supportservice,
private alertService: AlertService,
private toastr: ToastrService,
private _fb: FormBuilder,
) { }
// 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],
}); // 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 === "Support_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
}

View File

@ -0,0 +1,37 @@
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 Supportservice{
private baseURL = "Support/Support" ; constructor(
private http: HttpClient,
private apiRequest: ApiRequestService,
) { }
getAll(page?: number, size?: number): Observable<any> {
return this.apiRequest.get(this.baseURL);
}
getById(id: number): Observable<any> {
const _http = this.baseURL + "/" + id;
return this.apiRequest.get(_http);
}
create(data: any): Observable<any> {
return this.apiRequest.post(this.baseURL, data);
}
update(id: number, data: any): Observable<any> {
const _http = this.baseURL + "/" + id;
return this.apiRequest.put(_http, data);
}
delete(id: number): Observable<any> {
const _http = this.baseURL + "/" + id;
return this.apiRequest.delete(_http);
}
// updateaction
}

View File

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

View File

@ -0,0 +1,388 @@
<ol class="breadcrumb breadcrumb-arrow font-trirong">
<li><a href="javascript://"> Test</a></li>
</ol>
<div class="dg-wrapper">
<div class="clr-row">
<div class="clr-col-8">
<h3>Test </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]="'password_field'"> <ng-container *clrDgHideableColumn="{hidden: false}">Password Field
</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. password_field }}</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 Test
<!--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> Password Field</label><br>
<div><input [type]="newpHidepassword_field ? 'password': 'text'" class="clr-input" style="width: 93% !important;" [(ngModel)]="rowSelected.password_field" name="password_field">&nbsp;
<clr-icon [attr.shape]="newIconpassword_field" (click)="newShapeChangerpassword_field()"></clr-icon></div>
</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 Test
<!-- aeroplane icon -->
&nbsp; &nbsp; &nbsp; &nbsp;
<a *ngIf="userrole?.includes('ADMIN')" style="float: right;" href="javascript:void(0)" role="tooltip" aria-haspopup="true"
class="tooltip tooltip-sm tooltip-bottom-left">
<a id="build_extension" [routerLink]="['../extension/all']" [queryParams]="{ formCode: 'Test_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>Password Field</label><br>
<div><input class="clr-input" style="width: 93% !important;" [type]="newaddpHidepassword_field ? 'password': 'text'" formControlName="password_field" autocomplete >&nbsp;
<clr-icon [attr.shape]="newaddIconpassword_field" (click)="newaddChangerpassword_field()"></clr-icon></div>
</div>
<div class="clr-col-sm-12">
<label>Confirm Password Field</label><br>
<input type="password" class="clr-input" formControlName="confirmpassword_field" autocomplete >
<div *ngIf="entryForm.controls.confirmpassword_field.errors" class="error_mess">
<div *ngIf="entryForm.controls.confirmpassword_field.errors.confirmedpassword_fieldValidator" class="error_mess">* Password and Confirm Password must be match.</div>
</div>
</div>
</div>
<!-- form code start -->
<div *ngIf="checkFormCode">
<h4 style="font-weight: 300;display: inline;">Extension</h4>
<br>
<hr>
<div class="clr-row">
<div class="clr-col-4" *ngFor="let field of additionalFieldsFromBackend">
<ng-container *ngIf="field.formCode === formcode" [ngSwitch]="field.fieldType">
<!-- Text Input --> <label *ngSwitchCase="'text'">{{ field.fieldName }}</label>
<input *ngSwitchCase="'text'" [type]="field.fieldType" [formControlName]="field.extValue"
class="clr-input" />
<!-- Date Input --> <label *ngSwitchCase="'date'">{{ field.fieldName }}</label>
<input *ngSwitchCase="'date'" [type]="field.fieldType" [formControlName]="field.extValue"
class="clr-input" />
<!-- Textarea --> <label *ngSwitchCase="'textarea'">{{ field.fieldName }}</label>
<textarea *ngSwitchCase="'textarea'" [formControlName]="field.extValue" col="10" row="2"></textarea>
<!-- Checkbox --> <label *ngSwitchCase="'checkbox'">{{ field.fieldName }}</label><br>
<input *ngSwitchCase="'checkbox'" [type]="field.fieldType" [formControlName]="field.extValue"
class="clr-checkbox" />
</ng-container>
</div>
</div>
</div>
<!-- form code end --> <div class="modal-footer">
<button type="button" class="btn btn-outline" (click)="modalAdd = false">Cancel</button>
<button type="submit" class="btn btn-primary" (click)="onSubmit()">ADD</button>
</div>
</form>
</div>
</clr-modal>
<!-- htmlpopup -->

View File

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

View File

@ -0,0 +1,298 @@
import { Component, OnInit } from '@angular/core';
import { ToastrService } from 'ngx-toastr';
import { AlertService } from 'src/app/services/alert.service';
import { Testservice} from './Test.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 { Testcardvariable } from './Test_cardvariable';
import { UserInfoService } from 'src/app/services/user-info.service';
declare var JsBarcode: any;
@Component({
selector: 'app-Test',
templateUrl: './Test.component.html',
styleUrls: ['./Test.component.scss']
})
export class TestComponent implements OnInit {
cardButton = Testcardvariable.cardButton;
cardmodeldata = Testcardvariable.cardmodeldata;
public dashboardArray: DashboardContentModel2[];
isCardview = Testcardvariable.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 = 'Test_formCode'
tableName = 'Test'; checkFormCode; selected: any[] = []; constructor(
private extensionService: ExtensionService,
private userInfoService:UserInfoService,
private mainService:Testservice,
private alertService: AlertService,
private toastr: ToastrService,
private _fb: FormBuilder,
) { }
// 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],
password_field : [null],
confirmpassword_field : [null],
}, {
validator: Confirmedpassword_fieldValidator('password_field', 'confirmpassword_field')
}); // 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 === "Test_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; }
newpHidepassword_field: boolean = true;
newIconpassword_field: string = "eye";
newShapeChangerpassword_field() {
this.newpHidepassword_field = !this.newpHidepassword_field;
if(this.newpHidepassword_field){
this.newIconpassword_field = 'eye' } else { this.newIconpassword_field = 'eye-hide' }
}
newaddpHidepassword_field: boolean = true;
newaddIconpassword_field: string = "eye";
newaddChangerpassword_field() { this.newaddpHidepassword_field = !this.newaddpHidepassword_field;
if(this.newaddpHidepassword_field){ this.newaddIconpassword_field = 'eye' } else {
this.newaddIconpassword_field = 'eye-hide' } }
// updateaction
}
export function Confirmedpassword_fieldValidator(controlName: string, matchingControlName: string){
return (formGroup: FormGroup) => {
const control = formGroup.controls[controlName];
const matchingControl = formGroup.controls[matchingControlName];
if (matchingControl.errors && !matchingControl.errors.confirmedpassword_fieldValidator) {
return;
}
if (control.value !== matchingControl.value) {
matchingControl.setErrors({ confirmedpassword_fieldValidator: true });
} else {
matchingControl.setErrors(null);
}
}
}

View File

@ -0,0 +1,39 @@
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 Testservice{
private baseURL = "Test/Test" ; constructor(
private http: HttpClient,
private apiRequest: ApiRequestService,
) { }
getAll(page?: number, size?: number): Observable<any> {
return this.apiRequest.get(this.baseURL);
}
getById(id: number): Observable<any> {
const _http = this.baseURL + "/" + id;
return this.apiRequest.get(_http);
}
create(data: any): Observable<any> {
return this.apiRequest.post(this.baseURL, data);
}
update(id: number, data: any): Observable<any> {
const _http = this.baseURL + "/" + id;
return this.apiRequest.put(_http, data);
}
delete(id: number): Observable<any> {
const _http = this.baseURL + "/" + id;
return this.apiRequest.delete(_http);
}
// updateaction
}

View File

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

View File

@ -1,3 +1,13 @@
import { ListtestComponent } from './BuilderComponents/angulardatatype/Listtest/Listtest.component';
import { TestComponent } from './BuilderComponents/angulardatatype/Test/Test.component';
import { Ad9Component } from './BuilderComponents/angulardatatype/Ad9/Ad9.component';
import { Ad8Component } from './BuilderComponents/angulardatatype/Ad8/Ad8.component';
import { Ad7Component } from './BuilderComponents/angulardatatype/Ad7/Ad7.component';
import { Ad6Component } from './BuilderComponents/angulardatatype/Ad6/Ad6.component';
import { Adv5Component } from './BuilderComponents/angulardatatype/Adv5/Adv5.component';
import { Adv4Component } from './BuilderComponents/angulardatatype/Adv4/Adv4.component';
import { SupportComponent } from './BuilderComponents/angulardatatype/Support/Support.component';
import { Adv3Component } from './BuilderComponents/angulardatatype/Adv3/Adv3.component';
import { SequencegenaratorComponent } from './fnd/sequencegenarator/sequencegenarator.component';
import { Component, NgModule } from '@angular/core';
@ -256,6 +266,36 @@ const routes: Routes = [
// buildercomponents
{path:'Listtest',component:ListtestComponent},
{path:'Test',component:TestComponent},
{path:'Ad9',component:Ad9Component},
{path:'Ad8',component:Ad8Component},
{path:'Ad7',component:Ad7Component},
{path:'Ad6',component:Ad6Component},
{path:'Adv5',component:Adv5Component},
{path:'Adv4',component:Adv4Component},
{path:'Support',component:SupportComponent},
{path:'Adv3',component:Adv3Component},

View File

@ -1,3 +1,13 @@
import { ListtestComponent } from './BuilderComponents/angulardatatype/Listtest/Listtest.component';
import { TestComponent } from './BuilderComponents/angulardatatype/Test/Test.component';
import { Ad9Component } from './BuilderComponents/angulardatatype/Ad9/Ad9.component';
import { Ad8Component } from './BuilderComponents/angulardatatype/Ad8/Ad8.component';
import { Ad7Component } from './BuilderComponents/angulardatatype/Ad7/Ad7.component';
import { Ad6Component } from './BuilderComponents/angulardatatype/Ad6/Ad6.component';
import { Adv5Component } from './BuilderComponents/angulardatatype/Adv5/Adv5.component';
import { Adv4Component } from './BuilderComponents/angulardatatype/Adv4/Adv4.component';
import { SupportComponent } from './BuilderComponents/angulardatatype/Support/Support.component';
import { Adv3Component } from './BuilderComponents/angulardatatype/Adv3/Adv3.component';
import { CommonModule } from '@angular/common';
@ -129,6 +139,36 @@ import { Stepper_workflowComponent } from './BuilderComponents/stepperworkflow/S
// buildercomponents
ListtestComponent,
TestComponent,
Ad9Component,
Ad8Component,
Ad7Component,
Ad6Component,
Adv5Component,
Adv4Component,
SupportComponent,
Adv3Component,

View File

@ -226,10 +226,46 @@
"MENU_ACTION_LINK": "Menu Action Link",
"STATUS": "Status",
"SUB_MENU": "Sub Menu",
"Active": "Active",
"datagrid_Field2": "datagrid_Field2",
"country": "country",
"Dynamic": "Dynamic",
"Description": "Description",
"Fileupload_Field": "Fileupload_Field",
"Test22": "Test22",
"Test11": "Test11",
"Name": "Name"
"Support": "Support",
"description": "description",
"Value_List_Field": "Value_List_Field",
"Value_List_Field2": "Value_List_Field2",
"Button_Field2": "Button_Field2",
"Listtest": "Listtest",
"Name": "Name",
"atc2": "atc2",
"Checkout_Field": "Checkout_Field",
"OneToOne": "OneToOne",
"Ad6": "Ad6",
"Ad8": "Ad8",
"Ad7": "Ad7",
"Test": "Test",
"subtration": "subtration",
"Ad9": "Ad9",
"stmmlt2": "stmmlt2",
"state": "state",
"Adv5": "Adv5",
"Adv4": "Adv4",
"Adv3": "Adv3",
"addition": "addition",
"atdy1": "atdy1",
"OneToManyExtension": "OneToManyExtension",
"atdy2": "atdy2",
"atoc": "atoc",
"ButtonUpdate": "ButtonUpdate",
"datagrid_Field": "datagrid_Field",
"dymlt2": "dymlt2",
"dymlti1": "dymlti1",
"Approved_Field": "Approved_Field",
"stmlit": "stmlit",
"dy2": "dy2",
"Password_Field": "Password_Field",
"dy1": "dy1",
"age": "age",
"age2": "age2",
"Button_Field": "Button_Field"
}

View File

@ -69,6 +69,36 @@ public class BuilderService {
executeDump(true);
// ADD OTHER SERVICE
addCustomMenu( "Listtest","Listtest", "Transcations");
addCustomMenu( "Test","Test", "Transcations");
addCustomMenu( "Ad9","Ad9", "Transcations");
addCustomMenu( "Ad8","Ad8", "Transcations");
addCustomMenu( "Ad7","Ad7", "Transcations");
addCustomMenu( "Ad6","Ad6", "Transcations");
addCustomMenu( "Adv5","Adv5", "Transcations");
addCustomMenu( "Adv4","Adv4", "Transcations");
addCustomMenu( "Support","Support", "Transcations");
addCustomMenu( "Adv3","Adv3", "Transcations");
System.out.println("dashboard and menu inserted...");

View File

@ -0,0 +1,99 @@
package com.realnet.angulardatatype.Controllers;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import com.fasterxml.jackson.core.JsonProcessingException;
import org.springframework.web.bind.annotation.CrossOrigin;
import com.fasterxml.jackson.databind.JsonMappingException;
import com.realnet.config.EmailService;
import com.realnet.users.entity1.AppUser;
import com.realnet.users.service1.AppUserServiceImpl;
import com.fasterxml.jackson.databind.ObjectMapper;
import org.springframework.data.domain.*;
import com.realnet.fnd.response.EntityResponse;
import org.springframework.http.*;
import org.springframework.beans.factory.annotation.*;
import com.realnet.angulardatatype.Entity.Ad6;
import com.realnet.angulardatatype.Services.Ad6Service ;
@RequestMapping(value = "/Ad6")
@CrossOrigin("*")
@RestController
public class Ad6Controller {
@Autowired
private Ad6Service Service;
@Value("${projectPath}")
private String projectPath;
@PostMapping("/Ad6")
public Ad6 Savedata(@RequestBody Ad6 data) {
Ad6 save = Service.Savedata(data) ;
System.out.println("data saved..." + save);
return save;
}
@PutMapping("/Ad6/{id}")
public Ad6 update(@RequestBody Ad6 data,@PathVariable Integer id ) {
Ad6 update = Service.update(data,id);
System.out.println("data update..." + update);
return update;
}
// get all with pagination
@GetMapping("/Ad6/getall/page")
public Page<Ad6> getall(@RequestParam(value = "page", required = false) Integer page,
@RequestParam(value = "size", required = false) Integer size) {
Pageable paging = PageRequest.of(page, size);
Page<Ad6> get = Service.getAllWithPagination(paging);
return get;
}
@GetMapping("/Ad6")
public List<Ad6> getdetails() {
List<Ad6> get = Service.getdetails();
return get;
}
// get all without authentication
@GetMapping("/token/Ad6")
public List<Ad6> getallwioutsec() {
List<Ad6> get = Service.getdetails();
return get;
}
@GetMapping("/Ad6/{id}")
public Ad6 getdetailsbyId(@PathVariable Integer id ) {
Ad6 get = Service.getdetailsbyId(id);
return get;
}
@DeleteMapping("/Ad6/{id}")
public ResponseEntity<?> delete_by_id(@PathVariable Integer id ) {
Service.delete_by_id(id);
return new ResponseEntity<>(new EntityResponse("Deleted"), HttpStatus.OK);
}
}

View File

@ -0,0 +1,98 @@
package com.realnet.angulardatatype.Controllers;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import com.fasterxml.jackson.core.JsonProcessingException;
import org.springframework.web.bind.annotation.CrossOrigin;
import com.fasterxml.jackson.databind.JsonMappingException;
import com.realnet.config.EmailService;
import com.realnet.users.entity1.AppUser;
import com.realnet.users.service1.AppUserServiceImpl;
import com.fasterxml.jackson.databind.ObjectMapper;
import org.springframework.data.domain.*;
import com.realnet.fnd.response.EntityResponse;
import org.springframework.http.*;
import org.springframework.beans.factory.annotation.*;
import com.realnet.angulardatatype.Entity.Ad7;
import com.realnet.angulardatatype.Services.Ad7Service ;
import com.realnet.angulardatatype.Entity.Support;
@RequestMapping(value = "/Ad7")
@CrossOrigin("*")
@RestController
public class Ad7Controller {
@Autowired
private Ad7Service Service;
@Value("${projectPath}")
private String projectPath;
@PostMapping("/Ad7")
public Ad7 Savedata(@RequestBody Ad7 data) {
Ad7 save = Service.Savedata(data) ;
System.out.println("data saved..." + save);
return save;
}
@PutMapping("/Ad7/{id}")
public Ad7 update(@RequestBody Ad7 data,@PathVariable Integer id ) {
Ad7 update = Service.update(data,id);
System.out.println("data update..." + update);
return update;
}
// get all with pagination
@GetMapping("/Ad7/getall/page")
public Page<Ad7> getall(@RequestParam(value = "page", required = false) Integer page,
@RequestParam(value = "size", required = false) Integer size) {
Pageable paging = PageRequest.of(page, size);
Page<Ad7> get = Service.getAllWithPagination(paging);
return get;
}
@GetMapping("/Ad7")
public List<Ad7> getdetails() {
List<Ad7> get = Service.getdetails();
return get;
}
// get all without authentication
@GetMapping("/token/Ad7")
public List<Ad7> getallwioutsec() {
List<Ad7> get = Service.getdetails();
return get;
}
@GetMapping("/Ad7/{id}")
public Ad7 getdetailsbyId(@PathVariable Integer id ) {
Ad7 get = Service.getdetailsbyId(id);
return get;
}
@DeleteMapping("/Ad7/{id}")
public ResponseEntity<?> delete_by_id(@PathVariable Integer id ) {
Service.delete_by_id(id);
return new ResponseEntity<>(new EntityResponse("Deleted"), HttpStatus.OK);
}
@PostMapping("/Ad7/Support_insert")
public Support insertSupport(@RequestBody Support data) {
Support insertaction = Service.insertSupport(data);
return insertaction;
}
}

View File

@ -0,0 +1,107 @@
package com.realnet.angulardatatype.Controllers;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import com.fasterxml.jackson.core.JsonProcessingException;
import org.springframework.web.bind.annotation.CrossOrigin;
import com.fasterxml.jackson.databind.JsonMappingException;
import com.realnet.config.EmailService;
import com.realnet.users.entity1.AppUser;
import com.realnet.users.service1.AppUserServiceImpl;
import com.fasterxml.jackson.databind.ObjectMapper;
import org.springframework.data.domain.*;
import com.realnet.fnd.response.EntityResponse;
import org.springframework.http.*;
import org.springframework.beans.factory.annotation.*;
import com.realnet.angulardatatype.Entity.Ad8;
import com.realnet.angulardatatype.Services.Ad8Service ;
import com.realnet.angulardatatype.Entity.Support;
@RequestMapping(value = "/Ad8")
@CrossOrigin("*")
@RestController
public class Ad8Controller {
@Autowired
private Ad8Service Service;
@Value("${projectPath}")
private String projectPath;
@PostMapping("/Ad8")
public Ad8 Savedata(@RequestBody Ad8 data) {
Ad8 save = Service.Savedata(data) ;
System.out.println("data saved..." + save);
return save;
}
@PutMapping("/Ad8/{id}")
public Ad8 update(@RequestBody Ad8 data,@PathVariable Integer id ) {
Ad8 update = Service.update(data,id);
System.out.println("data update..." + update);
return update;
}
// get all with pagination
@GetMapping("/Ad8/getall/page")
public Page<Ad8> getall(@RequestParam(value = "page", required = false) Integer page,
@RequestParam(value = "size", required = false) Integer size) {
Pageable paging = PageRequest.of(page, size);
Page<Ad8> get = Service.getAllWithPagination(paging);
return get;
}
@GetMapping("/Ad8")
public List<Ad8> getdetails() {
List<Ad8> get = Service.getdetails();
return get;
}
// get all without authentication
@GetMapping("/token/Ad8")
public List<Ad8> getallwioutsec() {
List<Ad8> get = Service.getdetails();
return get;
}
@GetMapping("/Ad8/{id}")
public Ad8 getdetailsbyId(@PathVariable Integer id ) {
Ad8 get = Service.getdetailsbyId(id);
return get;
}
@DeleteMapping("/Ad8/{id}")
public ResponseEntity<?> delete_by_id(@PathVariable Integer id ) {
Service.delete_by_id(id);
return new ResponseEntity<>(new EntityResponse("Deleted"), HttpStatus.OK);
}
@PutMapping("/Ad8/Support_update/{id}")
public ResponseEntity<?> updateSupport(@PathVariable Integer id, @RequestBody Support data) {
ResponseEntity<?> update = Service.updateSupport(id, data);
System.out.println(update + " updateed");
return update;
}
}

View File

@ -0,0 +1,91 @@
package com.realnet.angulardatatype.Controllers;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import com.fasterxml.jackson.core.JsonProcessingException;
import org.springframework.web.bind.annotation.CrossOrigin;
import com.fasterxml.jackson.databind.JsonMappingException;
import com.realnet.config.EmailService;
import com.realnet.users.entity1.AppUser;
import com.realnet.users.service1.AppUserServiceImpl;
import com.fasterxml.jackson.databind.ObjectMapper;
import org.springframework.data.domain.*;
import com.realnet.fnd.response.EntityResponse;
import org.springframework.http.*;
import org.springframework.beans.factory.annotation.*;
import com.realnet.angulardatatype.Entity.Ad9;
import com.realnet.angulardatatype.Services.Ad9Service ;
@RequestMapping(value = "/Ad9")
@CrossOrigin("*")
@RestController
public class Ad9Controller {
@Autowired
private Ad9Service Service;
@Value("${projectPath}")
private String projectPath;
@PostMapping("/Ad9")
public Ad9 Savedata(@RequestBody Ad9 data) {
Ad9 save = Service.Savedata(data) ;
System.out.println("data saved..." + save);
return save;
}
@PutMapping("/Ad9/{id}")
public Ad9 update(@RequestBody Ad9 data,@PathVariable Integer id ) {
Ad9 update = Service.update(data,id);
System.out.println("data update..." + update);
return update;
}
// get all with pagination
@GetMapping("/Ad9/getall/page")
public Page<Ad9> getall(@RequestParam(value = "page", required = false) Integer page,
@RequestParam(value = "size", required = false) Integer size) {
Pageable paging = PageRequest.of(page, size);
Page<Ad9> get = Service.getAllWithPagination(paging);
return get;
}
@GetMapping("/Ad9")
public List<Ad9> getdetails() {
List<Ad9> get = Service.getdetails();
return get;
}
// get all without authentication
@GetMapping("/token/Ad9")
public List<Ad9> getallwioutsec() {
List<Ad9> get = Service.getdetails();
return get;
}
@GetMapping("/Ad9/{id}")
public Ad9 getdetailsbyId(@PathVariable Integer id ) {
Ad9 get = Service.getdetailsbyId(id);
return get;
}
@DeleteMapping("/Ad9/{id}")
public ResponseEntity<?> delete_by_id(@PathVariable Integer id ) {
Service.delete_by_id(id);
return new ResponseEntity<>(new EntityResponse("Deleted"), HttpStatus.OK);
}
}

View File

@ -0,0 +1,163 @@
package com.realnet.angulardatatype.Controllers;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import com.fasterxml.jackson.core.JsonProcessingException;
import org.springframework.web.bind.annotation.CrossOrigin;
import com.fasterxml.jackson.databind.JsonMappingException;
import com.realnet.config.EmailService;
import com.realnet.users.entity1.AppUser;
import com.realnet.users.service1.AppUserServiceImpl;
import com.fasterxml.jackson.databind.ObjectMapper;
import org.springframework.data.domain.*;
import com.realnet.fnd.response.EntityResponse;
import org.springframework.http.*;
import org.springframework.beans.factory.annotation.*;
import com.realnet.angulardatatype.Entity.Adv3;
import com.realnet.angulardatatype.Services.Adv3Service ;
@RequestMapping(value = "/Adv3")
@CrossOrigin("*")
@RestController
public class Adv3Controller {
@Autowired
private Adv3Service Service;
@Value("${projectPath}")
private String projectPath;
@PostMapping("/Adv3")
public Adv3 Savedata(@RequestBody Adv3 data) {
Adv3 save = Service.Savedata(data) ;
System.out.println("data saved..." + save);
return save;
}
@PutMapping("/Adv3/{id}")
public Adv3 update(@RequestBody Adv3 data,@PathVariable Integer id ) {
Adv3 update = Service.update(data,id);
System.out.println("data update..." + update);
return update;
}
// get all with pagination
@GetMapping("/Adv3/getall/page")
public Page<Adv3> getall(@RequestParam(value = "page", required = false) Integer page,
@RequestParam(value = "size", required = false) Integer size) {
Pageable paging = PageRequest.of(page, size);
Page<Adv3> get = Service.getAllWithPagination(paging);
return get;
}
@GetMapping("/Adv3")
public List<Adv3> getdetails() {
List<Adv3> get = Service.getdetails();
return get;
}
// get all without authentication
@GetMapping("/token/Adv3")
public List<Adv3> getallwioutsec() {
List<Adv3> get = Service.getdetails();
return get;
}
@GetMapping("/Adv3/{id}")
public Adv3 getdetailsbyId(@PathVariable Integer id ) {
Adv3 get = Service.getdetailsbyId(id);
return get;
}
@DeleteMapping("/Adv3/{id}")
public ResponseEntity<?> delete_by_id(@PathVariable Integer id ) {
Service.delete_by_id(id);
return new ResponseEntity<>(new EntityResponse("Deleted"), HttpStatus.OK);
}
}

View File

@ -0,0 +1,115 @@
package com.realnet.angulardatatype.Controllers;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import com.fasterxml.jackson.core.JsonProcessingException;
import org.springframework.web.bind.annotation.CrossOrigin;
import com.fasterxml.jackson.databind.JsonMappingException;
import com.realnet.config.EmailService;
import com.realnet.users.entity1.AppUser;
import com.realnet.users.service1.AppUserServiceImpl;
import com.fasterxml.jackson.databind.ObjectMapper;
import org.springframework.data.domain.*;
import com.realnet.fnd.response.EntityResponse;
import org.springframework.http.*;
import org.springframework.beans.factory.annotation.*;
import com.realnet.angulardatatype.Entity.Adv4;
import com.realnet.angulardatatype.Services.Adv4Service ;
@RequestMapping(value = "/Adv4")
@CrossOrigin("*")
@RestController
public class Adv4Controller {
@Autowired
private Adv4Service Service;
@Value("${projectPath}")
private String projectPath;
@PostMapping("/Adv4")
public Adv4 Savedata(@RequestBody Adv4 data) {
Adv4 save = Service.Savedata(data) ;
System.out.println("data saved..." + save);
return save;
}
@PutMapping("/Adv4/{id}")
public Adv4 update(@RequestBody Adv4 data,@PathVariable Integer id ) {
Adv4 update = Service.update(data,id);
System.out.println("data update..." + update);
return update;
}
// get all with pagination
@GetMapping("/Adv4/getall/page")
public Page<Adv4> getall(@RequestParam(value = "page", required = false) Integer page,
@RequestParam(value = "size", required = false) Integer size) {
Pageable paging = PageRequest.of(page, size);
Page<Adv4> get = Service.getAllWithPagination(paging);
return get;
}
@GetMapping("/Adv4")
public List<Adv4> getdetails() {
List<Adv4> get = Service.getdetails();
return get;
}
// get all without authentication
@GetMapping("/token/Adv4")
public List<Adv4> getallwioutsec() {
List<Adv4> get = Service.getdetails();
return get;
}
@GetMapping("/Adv4/{id}")
public Adv4 getdetailsbyId(@PathVariable Integer id ) {
Adv4 get = Service.getdetailsbyId(id);
return get;
}
@DeleteMapping("/Adv4/{id}")
public ResponseEntity<?> delete_by_id(@PathVariable Integer id ) {
Service.delete_by_id(id);
return new ResponseEntity<>(new EntityResponse("Deleted"), HttpStatus.OK);
}
}

View File

@ -0,0 +1,139 @@
package com.realnet.angulardatatype.Controllers;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import com.fasterxml.jackson.core.JsonProcessingException;
import org.springframework.web.bind.annotation.CrossOrigin;
import com.fasterxml.jackson.databind.JsonMappingException;
import com.realnet.config.EmailService;
import com.realnet.users.entity1.AppUser;
import com.realnet.users.service1.AppUserServiceImpl;
import com.fasterxml.jackson.databind.ObjectMapper;
import org.springframework.data.domain.*;
import com.realnet.fnd.response.EntityResponse;
import org.springframework.http.*;
import org.springframework.beans.factory.annotation.*;
import com.realnet.angulardatatype.Entity.Adv5;
import com.realnet.angulardatatype.Services.Adv5Service ;
@RequestMapping(value = "/Adv5")
@CrossOrigin("*")
@RestController
public class Adv5Controller {
@Autowired
private Adv5Service Service;
@Value("${projectPath}")
private String projectPath;
@PostMapping("/Adv5")
public Adv5 Savedata(@RequestBody Adv5 data) {
Adv5 save = Service.Savedata(data) ;
System.out.println("data saved..." + save);
return save;
}
@PutMapping("/Adv5/{id}")
public Adv5 update(@RequestBody Adv5 data,@PathVariable Integer id ) {
Adv5 update = Service.update(data,id);
System.out.println("data update..." + update);
return update;
}
// get all with pagination
@GetMapping("/Adv5/getall/page")
public Page<Adv5> getall(@RequestParam(value = "page", required = false) Integer page,
@RequestParam(value = "size", required = false) Integer size) {
Pageable paging = PageRequest.of(page, size);
Page<Adv5> get = Service.getAllWithPagination(paging);
return get;
}
@GetMapping("/Adv5")
public List<Adv5> getdetails() {
List<Adv5> get = Service.getdetails();
return get;
}
// get all without authentication
@GetMapping("/token/Adv5")
public List<Adv5> getallwioutsec() {
List<Adv5> get = Service.getdetails();
return get;
}
@GetMapping("/Adv5/{id}")
public Adv5 getdetailsbyId(@PathVariable Integer id ) {
Adv5 get = Service.getdetailsbyId(id);
return get;
}
@DeleteMapping("/Adv5/{id}")
public ResponseEntity<?> delete_by_id(@PathVariable Integer id ) {
Service.delete_by_id(id);
return new ResponseEntity<>(new EntityResponse("Deleted"), HttpStatus.OK);
}
}

View File

@ -0,0 +1,91 @@
package com.realnet.angulardatatype.Controllers;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import com.fasterxml.jackson.core.JsonProcessingException;
import org.springframework.web.bind.annotation.CrossOrigin;
import com.fasterxml.jackson.databind.JsonMappingException;
import com.realnet.config.EmailService;
import com.realnet.users.entity1.AppUser;
import com.realnet.users.service1.AppUserServiceImpl;
import com.fasterxml.jackson.databind.ObjectMapper;
import org.springframework.data.domain.*;
import com.realnet.fnd.response.EntityResponse;
import org.springframework.http.*;
import org.springframework.beans.factory.annotation.*;
import com.realnet.angulardatatype.Entity.Listtest;
import com.realnet.angulardatatype.Services.ListtestService ;
@RequestMapping(value = "/Listtest")
@CrossOrigin("*")
@RestController
public class ListtestController {
@Autowired
private ListtestService Service;
@Value("${projectPath}")
private String projectPath;
@PostMapping("/Listtest")
public Listtest Savedata(@RequestBody Listtest data) {
Listtest save = Service.Savedata(data) ;
System.out.println("data saved..." + save);
return save;
}
@PutMapping("/Listtest/{id}")
public Listtest update(@RequestBody Listtest data,@PathVariable Integer id ) {
Listtest update = Service.update(data,id);
System.out.println("data update..." + update);
return update;
}
// get all with pagination
@GetMapping("/Listtest/getall/page")
public Page<Listtest> getall(@RequestParam(value = "page", required = false) Integer page,
@RequestParam(value = "size", required = false) Integer size) {
Pageable paging = PageRequest.of(page, size);
Page<Listtest> get = Service.getAllWithPagination(paging);
return get;
}
@GetMapping("/Listtest")
public List<Listtest> getdetails() {
List<Listtest> get = Service.getdetails();
return get;
}
// get all without authentication
@GetMapping("/token/Listtest")
public List<Listtest> getallwioutsec() {
List<Listtest> get = Service.getdetails();
return get;
}
@GetMapping("/Listtest/{id}")
public Listtest getdetailsbyId(@PathVariable Integer id ) {
Listtest get = Service.getdetailsbyId(id);
return get;
}
@DeleteMapping("/Listtest/{id}")
public ResponseEntity<?> delete_by_id(@PathVariable Integer id ) {
Service.delete_by_id(id);
return new ResponseEntity<>(new EntityResponse("Deleted"), HttpStatus.OK);
}
}

View File

@ -0,0 +1,24 @@
package com.realnet.angulardatatype.Controllers;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import com.realnet.angulardatatype.Entity.Listtest_ListFilter1;
import com.realnet.angulardatatype.Services.Listtest_ListFilter1Service ;
@RequestMapping(value = "/Listtest_ListFilter1")
@RestController
public class Listtest_ListFilter1Controller {
@Autowired
private Listtest_ListFilter1Service Service;
@GetMapping("/Listtest_ListFilter1")
public List<Listtest_ListFilter1> getlist() {
List<Listtest_ListFilter1> get = Service.getlistbuilder();
return get;
}
@GetMapping("/Listtest_ListFilter11")
public List<Listtest_ListFilter1> getlistwithparam( ) {
List<Listtest_ListFilter1> get = Service.getlistbuilderparam( );
return get;
}
}

View File

@ -0,0 +1,91 @@
package com.realnet.angulardatatype.Controllers;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import com.fasterxml.jackson.core.JsonProcessingException;
import org.springframework.web.bind.annotation.CrossOrigin;
import com.fasterxml.jackson.databind.JsonMappingException;
import com.realnet.config.EmailService;
import com.realnet.users.entity1.AppUser;
import com.realnet.users.service1.AppUserServiceImpl;
import com.fasterxml.jackson.databind.ObjectMapper;
import org.springframework.data.domain.*;
import com.realnet.fnd.response.EntityResponse;
import org.springframework.http.*;
import org.springframework.beans.factory.annotation.*;
import com.realnet.angulardatatype.Entity.Support;
import com.realnet.angulardatatype.Services.SupportService ;
@RequestMapping(value = "/Support")
@CrossOrigin("*")
@RestController
public class SupportController {
@Autowired
private SupportService Service;
@Value("${projectPath}")
private String projectPath;
@PostMapping("/Support")
public Support Savedata(@RequestBody Support data) {
Support save = Service.Savedata(data) ;
System.out.println("data saved..." + save);
return save;
}
@PutMapping("/Support/{id}")
public Support update(@RequestBody Support data,@PathVariable Integer id ) {
Support update = Service.update(data,id);
System.out.println("data update..." + update);
return update;
}
// get all with pagination
@GetMapping("/Support/getall/page")
public Page<Support> getall(@RequestParam(value = "page", required = false) Integer page,
@RequestParam(value = "size", required = false) Integer size) {
Pageable paging = PageRequest.of(page, size);
Page<Support> get = Service.getAllWithPagination(paging);
return get;
}
@GetMapping("/Support")
public List<Support> getdetails() {
List<Support> get = Service.getdetails();
return get;
}
// get all without authentication
@GetMapping("/token/Support")
public List<Support> getallwioutsec() {
List<Support> get = Service.getdetails();
return get;
}
@GetMapping("/Support/{id}")
public Support getdetailsbyId(@PathVariable Integer id ) {
Support get = Service.getdetailsbyId(id);
return get;
}
@DeleteMapping("/Support/{id}")
public ResponseEntity<?> delete_by_id(@PathVariable Integer id ) {
Service.delete_by_id(id);
return new ResponseEntity<>(new EntityResponse("Deleted"), HttpStatus.OK);
}
}

View File

@ -0,0 +1,21 @@
package com.realnet.angulardatatype.Controllers;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.http.*;
import com.realnet.angulardatatype.Entity.Support;
import com.realnet.angulardatatype.Services.SupportInsertService1;
@RequestMapping(value = "/Support")
@RestController
public class SupportInsertController1{
@Autowired
private SupportInsertService1 Service;
@PostMapping("/Support_insert")
public ResponseEntity<?> insert(@RequestBody Support support) {
Support insertaction = Service.insertaction(support);
return new ResponseEntity<>(insertaction, HttpStatus.OK);
}
}

View File

@ -0,0 +1,22 @@
package com.realnet.angulardatatype.Controllers;
import java.util.List;
import org.springframework.http.ResponseEntity;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import com.realnet.angulardatatype.Entity.Support;
import com.realnet.angulardatatype.Services.SupportUpdateService1 ;
@RequestMapping(value = "/Support")
@RestController
public class SupportUpdateController1{
@Autowired
private SupportUpdateService1 Service;
@PutMapping("/Support_update/{id}")
public ResponseEntity<?> update(@PathVariable Integer id,@RequestBody Support support) {
ResponseEntity<?> update = Service.updateaction(id,support );
System.out.println(update+" updateed");
return update;
}
}

View File

@ -0,0 +1,99 @@
package com.realnet.angulardatatype.Controllers;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import com.fasterxml.jackson.core.JsonProcessingException;
import org.springframework.web.bind.annotation.CrossOrigin;
import com.fasterxml.jackson.databind.JsonMappingException;
import com.realnet.config.EmailService;
import com.realnet.users.entity1.AppUser;
import com.realnet.users.service1.AppUserServiceImpl;
import com.fasterxml.jackson.databind.ObjectMapper;
import org.springframework.data.domain.*;
import com.realnet.fnd.response.EntityResponse;
import org.springframework.http.*;
import org.springframework.beans.factory.annotation.*;
import com.realnet.angulardatatype.Entity.Test;
import com.realnet.angulardatatype.Services.TestService ;
@RequestMapping(value = "/Test")
@CrossOrigin("*")
@RestController
public class TestController {
@Autowired
private TestService Service;
@Value("${projectPath}")
private String projectPath;
@PostMapping("/Test")
public Test Savedata(@RequestBody Test data) {
Test save = Service.Savedata(data) ;
System.out.println("data saved..." + save);
return save;
}
@PutMapping("/Test/{id}")
public Test update(@RequestBody Test data,@PathVariable Integer id ) {
Test update = Service.update(data,id);
System.out.println("data update..." + update);
return update;
}
// get all with pagination
@GetMapping("/Test/getall/page")
public Page<Test> getall(@RequestParam(value = "page", required = false) Integer page,
@RequestParam(value = "size", required = false) Integer size) {
Pageable paging = PageRequest.of(page, size);
Page<Test> get = Service.getAllWithPagination(paging);
return get;
}
@GetMapping("/Test")
public List<Test> getdetails() {
List<Test> get = Service.getdetails();
return get;
}
// get all without authentication
@GetMapping("/token/Test")
public List<Test> getallwioutsec() {
List<Test> get = Service.getdetails();
return get;
}
@GetMapping("/Test/{id}")
public Test getdetailsbyId(@PathVariable Integer id ) {
Test get = Service.getdetailsbyId(id);
return get;
}
@DeleteMapping("/Test/{id}")
public ResponseEntity<?> delete_by_id(@PathVariable Integer id ) {
Service.delete_by_id(id);
return new ResponseEntity<>(new EntityResponse("Deleted"), HttpStatus.OK);
}
}

View File

@ -0,0 +1,99 @@
package com.realnet.angulardatatype.Controllers;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import com.fasterxml.jackson.core.JsonProcessingException;
import org.springframework.web.bind.annotation.CrossOrigin;
import com.fasterxml.jackson.databind.JsonMappingException;
import com.realnet.config.EmailService;
import com.realnet.users.entity1.AppUser;
import com.realnet.users.service1.AppUserServiceImpl;
import com.fasterxml.jackson.databind.ObjectMapper;
import org.springframework.data.domain.*;
import com.realnet.fnd.response.EntityResponse;
import org.springframework.http.*;
import org.springframework.beans.factory.annotation.*;
import com.realnet.angulardatatype.Entity.Ad6;
import com.realnet.angulardatatype.Services.Ad6Service ;
@RequestMapping(value = "/token/Ad6")
@CrossOrigin("*")
@RestController
public class tokenFree_Ad6Controller {
@Autowired
private Ad6Service Service;
@Value("${projectPath}")
private String projectPath;
@PostMapping("/Ad6")
public Ad6 Savedata(@RequestBody Ad6 data) {
Ad6 save = Service.Savedata(data) ;
System.out.println("data saved..." + save);
return save;
}
@PutMapping("/Ad6/{id}")
public Ad6 update(@RequestBody Ad6 data,@PathVariable Integer id ) {
Ad6 update = Service.update(data,id);
System.out.println("data update..." + update);
return update;
}
// get all with pagination
@GetMapping("/Ad6/getall/page")
public Page<Ad6> getall(@RequestParam(value = "page", required = false) Integer page,
@RequestParam(value = "size", required = false) Integer size) {
Pageable paging = PageRequest.of(page, size);
Page<Ad6> get = Service.getAllWithPagination(paging);
return get;
}
@GetMapping("/Ad6")
public List<Ad6> getdetails() {
List<Ad6> get = Service.getdetails();
return get;
}
// get all without authentication
@GetMapping("/token/Ad6")
public List<Ad6> getallwioutsec() {
List<Ad6> get = Service.getdetails();
return get;
}
@GetMapping("/Ad6/{id}")
public Ad6 getdetailsbyId(@PathVariable Integer id ) {
Ad6 get = Service.getdetailsbyId(id);
return get;
}
@DeleteMapping("/Ad6/{id}")
public ResponseEntity<?> delete_by_id(@PathVariable Integer id ) {
Service.delete_by_id(id);
return new ResponseEntity<>(new EntityResponse("Deleted"), HttpStatus.OK);
}
}

View File

@ -0,0 +1,98 @@
package com.realnet.angulardatatype.Controllers;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import com.fasterxml.jackson.core.JsonProcessingException;
import org.springframework.web.bind.annotation.CrossOrigin;
import com.fasterxml.jackson.databind.JsonMappingException;
import com.realnet.config.EmailService;
import com.realnet.users.entity1.AppUser;
import com.realnet.users.service1.AppUserServiceImpl;
import com.fasterxml.jackson.databind.ObjectMapper;
import org.springframework.data.domain.*;
import com.realnet.fnd.response.EntityResponse;
import org.springframework.http.*;
import org.springframework.beans.factory.annotation.*;
import com.realnet.angulardatatype.Entity.Ad7;
import com.realnet.angulardatatype.Services.Ad7Service ;
import com.realnet.angulardatatype.Entity.Support;
@RequestMapping(value = "/token/Ad7")
@CrossOrigin("*")
@RestController
public class tokenFree_Ad7Controller {
@Autowired
private Ad7Service Service;
@Value("${projectPath}")
private String projectPath;
@PostMapping("/Ad7")
public Ad7 Savedata(@RequestBody Ad7 data) {
Ad7 save = Service.Savedata(data) ;
System.out.println("data saved..." + save);
return save;
}
@PutMapping("/Ad7/{id}")
public Ad7 update(@RequestBody Ad7 data,@PathVariable Integer id ) {
Ad7 update = Service.update(data,id);
System.out.println("data update..." + update);
return update;
}
// get all with pagination
@GetMapping("/Ad7/getall/page")
public Page<Ad7> getall(@RequestParam(value = "page", required = false) Integer page,
@RequestParam(value = "size", required = false) Integer size) {
Pageable paging = PageRequest.of(page, size);
Page<Ad7> get = Service.getAllWithPagination(paging);
return get;
}
@GetMapping("/Ad7")
public List<Ad7> getdetails() {
List<Ad7> get = Service.getdetails();
return get;
}
// get all without authentication
@GetMapping("/token/Ad7")
public List<Ad7> getallwioutsec() {
List<Ad7> get = Service.getdetails();
return get;
}
@GetMapping("/Ad7/{id}")
public Ad7 getdetailsbyId(@PathVariable Integer id ) {
Ad7 get = Service.getdetailsbyId(id);
return get;
}
@DeleteMapping("/Ad7/{id}")
public ResponseEntity<?> delete_by_id(@PathVariable Integer id ) {
Service.delete_by_id(id);
return new ResponseEntity<>(new EntityResponse("Deleted"), HttpStatus.OK);
}
@PostMapping("/Ad7/Support_insert")
public Support insertSupport(@RequestBody Support data) {
Support insertaction = Service.insertSupport(data);
return insertaction;
}
}

View File

@ -0,0 +1,107 @@
package com.realnet.angulardatatype.Controllers;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import com.fasterxml.jackson.core.JsonProcessingException;
import org.springframework.web.bind.annotation.CrossOrigin;
import com.fasterxml.jackson.databind.JsonMappingException;
import com.realnet.config.EmailService;
import com.realnet.users.entity1.AppUser;
import com.realnet.users.service1.AppUserServiceImpl;
import com.fasterxml.jackson.databind.ObjectMapper;
import org.springframework.data.domain.*;
import com.realnet.fnd.response.EntityResponse;
import org.springframework.http.*;
import org.springframework.beans.factory.annotation.*;
import com.realnet.angulardatatype.Entity.Ad8;
import com.realnet.angulardatatype.Services.Ad8Service ;
import com.realnet.angulardatatype.Entity.Support;
@RequestMapping(value = "/token/Ad8")
@CrossOrigin("*")
@RestController
public class tokenFree_Ad8Controller {
@Autowired
private Ad8Service Service;
@Value("${projectPath}")
private String projectPath;
@PostMapping("/Ad8")
public Ad8 Savedata(@RequestBody Ad8 data) {
Ad8 save = Service.Savedata(data) ;
System.out.println("data saved..." + save);
return save;
}
@PutMapping("/Ad8/{id}")
public Ad8 update(@RequestBody Ad8 data,@PathVariable Integer id ) {
Ad8 update = Service.update(data,id);
System.out.println("data update..." + update);
return update;
}
// get all with pagination
@GetMapping("/Ad8/getall/page")
public Page<Ad8> getall(@RequestParam(value = "page", required = false) Integer page,
@RequestParam(value = "size", required = false) Integer size) {
Pageable paging = PageRequest.of(page, size);
Page<Ad8> get = Service.getAllWithPagination(paging);
return get;
}
@GetMapping("/Ad8")
public List<Ad8> getdetails() {
List<Ad8> get = Service.getdetails();
return get;
}
// get all without authentication
@GetMapping("/token/Ad8")
public List<Ad8> getallwioutsec() {
List<Ad8> get = Service.getdetails();
return get;
}
@GetMapping("/Ad8/{id}")
public Ad8 getdetailsbyId(@PathVariable Integer id ) {
Ad8 get = Service.getdetailsbyId(id);
return get;
}
@DeleteMapping("/Ad8/{id}")
public ResponseEntity<?> delete_by_id(@PathVariable Integer id ) {
Service.delete_by_id(id);
return new ResponseEntity<>(new EntityResponse("Deleted"), HttpStatus.OK);
}
@PutMapping("/Ad8/Support_update/{id}")
public ResponseEntity<?> updateSupport(@PathVariable Integer id, @RequestBody Support data) {
ResponseEntity<?> update = Service.updateSupport(id, data);
System.out.println(update + " updateed");
return update;
}
}

View File

@ -0,0 +1,91 @@
package com.realnet.angulardatatype.Controllers;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import com.fasterxml.jackson.core.JsonProcessingException;
import org.springframework.web.bind.annotation.CrossOrigin;
import com.fasterxml.jackson.databind.JsonMappingException;
import com.realnet.config.EmailService;
import com.realnet.users.entity1.AppUser;
import com.realnet.users.service1.AppUserServiceImpl;
import com.fasterxml.jackson.databind.ObjectMapper;
import org.springframework.data.domain.*;
import com.realnet.fnd.response.EntityResponse;
import org.springframework.http.*;
import org.springframework.beans.factory.annotation.*;
import com.realnet.angulardatatype.Entity.Ad9;
import com.realnet.angulardatatype.Services.Ad9Service ;
@RequestMapping(value = "/token/Ad9")
@CrossOrigin("*")
@RestController
public class tokenFree_Ad9Controller {
@Autowired
private Ad9Service Service;
@Value("${projectPath}")
private String projectPath;
@PostMapping("/Ad9")
public Ad9 Savedata(@RequestBody Ad9 data) {
Ad9 save = Service.Savedata(data) ;
System.out.println("data saved..." + save);
return save;
}
@PutMapping("/Ad9/{id}")
public Ad9 update(@RequestBody Ad9 data,@PathVariable Integer id ) {
Ad9 update = Service.update(data,id);
System.out.println("data update..." + update);
return update;
}
// get all with pagination
@GetMapping("/Ad9/getall/page")
public Page<Ad9> getall(@RequestParam(value = "page", required = false) Integer page,
@RequestParam(value = "size", required = false) Integer size) {
Pageable paging = PageRequest.of(page, size);
Page<Ad9> get = Service.getAllWithPagination(paging);
return get;
}
@GetMapping("/Ad9")
public List<Ad9> getdetails() {
List<Ad9> get = Service.getdetails();
return get;
}
// get all without authentication
@GetMapping("/token/Ad9")
public List<Ad9> getallwioutsec() {
List<Ad9> get = Service.getdetails();
return get;
}
@GetMapping("/Ad9/{id}")
public Ad9 getdetailsbyId(@PathVariable Integer id ) {
Ad9 get = Service.getdetailsbyId(id);
return get;
}
@DeleteMapping("/Ad9/{id}")
public ResponseEntity<?> delete_by_id(@PathVariable Integer id ) {
Service.delete_by_id(id);
return new ResponseEntity<>(new EntityResponse("Deleted"), HttpStatus.OK);
}
}

View File

@ -0,0 +1,163 @@
package com.realnet.angulardatatype.Controllers;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import com.fasterxml.jackson.core.JsonProcessingException;
import org.springframework.web.bind.annotation.CrossOrigin;
import com.fasterxml.jackson.databind.JsonMappingException;
import com.realnet.config.EmailService;
import com.realnet.users.entity1.AppUser;
import com.realnet.users.service1.AppUserServiceImpl;
import com.fasterxml.jackson.databind.ObjectMapper;
import org.springframework.data.domain.*;
import com.realnet.fnd.response.EntityResponse;
import org.springframework.http.*;
import org.springframework.beans.factory.annotation.*;
import com.realnet.angulardatatype.Entity.Adv3;
import com.realnet.angulardatatype.Services.Adv3Service ;
@RequestMapping(value = "/token/Adv3")
@CrossOrigin("*")
@RestController
public class tokenFree_Adv3Controller {
@Autowired
private Adv3Service Service;
@Value("${projectPath}")
private String projectPath;
@PostMapping("/Adv3")
public Adv3 Savedata(@RequestBody Adv3 data) {
Adv3 save = Service.Savedata(data) ;
System.out.println("data saved..." + save);
return save;
}
@PutMapping("/Adv3/{id}")
public Adv3 update(@RequestBody Adv3 data,@PathVariable Integer id ) {
Adv3 update = Service.update(data,id);
System.out.println("data update..." + update);
return update;
}
// get all with pagination
@GetMapping("/Adv3/getall/page")
public Page<Adv3> getall(@RequestParam(value = "page", required = false) Integer page,
@RequestParam(value = "size", required = false) Integer size) {
Pageable paging = PageRequest.of(page, size);
Page<Adv3> get = Service.getAllWithPagination(paging);
return get;
}
@GetMapping("/Adv3")
public List<Adv3> getdetails() {
List<Adv3> get = Service.getdetails();
return get;
}
// get all without authentication
@GetMapping("/token/Adv3")
public List<Adv3> getallwioutsec() {
List<Adv3> get = Service.getdetails();
return get;
}
@GetMapping("/Adv3/{id}")
public Adv3 getdetailsbyId(@PathVariable Integer id ) {
Adv3 get = Service.getdetailsbyId(id);
return get;
}
@DeleteMapping("/Adv3/{id}")
public ResponseEntity<?> delete_by_id(@PathVariable Integer id ) {
Service.delete_by_id(id);
return new ResponseEntity<>(new EntityResponse("Deleted"), HttpStatus.OK);
}
}

View File

@ -0,0 +1,115 @@
package com.realnet.angulardatatype.Controllers;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import com.fasterxml.jackson.core.JsonProcessingException;
import org.springframework.web.bind.annotation.CrossOrigin;
import com.fasterxml.jackson.databind.JsonMappingException;
import com.realnet.config.EmailService;
import com.realnet.users.entity1.AppUser;
import com.realnet.users.service1.AppUserServiceImpl;
import com.fasterxml.jackson.databind.ObjectMapper;
import org.springframework.data.domain.*;
import com.realnet.fnd.response.EntityResponse;
import org.springframework.http.*;
import org.springframework.beans.factory.annotation.*;
import com.realnet.angulardatatype.Entity.Adv4;
import com.realnet.angulardatatype.Services.Adv4Service ;
@RequestMapping(value = "/token/Adv4")
@CrossOrigin("*")
@RestController
public class tokenFree_Adv4Controller {
@Autowired
private Adv4Service Service;
@Value("${projectPath}")
private String projectPath;
@PostMapping("/Adv4")
public Adv4 Savedata(@RequestBody Adv4 data) {
Adv4 save = Service.Savedata(data) ;
System.out.println("data saved..." + save);
return save;
}
@PutMapping("/Adv4/{id}")
public Adv4 update(@RequestBody Adv4 data,@PathVariable Integer id ) {
Adv4 update = Service.update(data,id);
System.out.println("data update..." + update);
return update;
}
// get all with pagination
@GetMapping("/Adv4/getall/page")
public Page<Adv4> getall(@RequestParam(value = "page", required = false) Integer page,
@RequestParam(value = "size", required = false) Integer size) {
Pageable paging = PageRequest.of(page, size);
Page<Adv4> get = Service.getAllWithPagination(paging);
return get;
}
@GetMapping("/Adv4")
public List<Adv4> getdetails() {
List<Adv4> get = Service.getdetails();
return get;
}
// get all without authentication
@GetMapping("/token/Adv4")
public List<Adv4> getallwioutsec() {
List<Adv4> get = Service.getdetails();
return get;
}
@GetMapping("/Adv4/{id}")
public Adv4 getdetailsbyId(@PathVariable Integer id ) {
Adv4 get = Service.getdetailsbyId(id);
return get;
}
@DeleteMapping("/Adv4/{id}")
public ResponseEntity<?> delete_by_id(@PathVariable Integer id ) {
Service.delete_by_id(id);
return new ResponseEntity<>(new EntityResponse("Deleted"), HttpStatus.OK);
}
}

View File

@ -0,0 +1,139 @@
package com.realnet.angulardatatype.Controllers;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import com.fasterxml.jackson.core.JsonProcessingException;
import org.springframework.web.bind.annotation.CrossOrigin;
import com.fasterxml.jackson.databind.JsonMappingException;
import com.realnet.config.EmailService;
import com.realnet.users.entity1.AppUser;
import com.realnet.users.service1.AppUserServiceImpl;
import com.fasterxml.jackson.databind.ObjectMapper;
import org.springframework.data.domain.*;
import com.realnet.fnd.response.EntityResponse;
import org.springframework.http.*;
import org.springframework.beans.factory.annotation.*;
import com.realnet.angulardatatype.Entity.Adv5;
import com.realnet.angulardatatype.Services.Adv5Service ;
@RequestMapping(value = "/token/Adv5")
@CrossOrigin("*")
@RestController
public class tokenFree_Adv5Controller {
@Autowired
private Adv5Service Service;
@Value("${projectPath}")
private String projectPath;
@PostMapping("/Adv5")
public Adv5 Savedata(@RequestBody Adv5 data) {
Adv5 save = Service.Savedata(data) ;
System.out.println("data saved..." + save);
return save;
}
@PutMapping("/Adv5/{id}")
public Adv5 update(@RequestBody Adv5 data,@PathVariable Integer id ) {
Adv5 update = Service.update(data,id);
System.out.println("data update..." + update);
return update;
}
// get all with pagination
@GetMapping("/Adv5/getall/page")
public Page<Adv5> getall(@RequestParam(value = "page", required = false) Integer page,
@RequestParam(value = "size", required = false) Integer size) {
Pageable paging = PageRequest.of(page, size);
Page<Adv5> get = Service.getAllWithPagination(paging);
return get;
}
@GetMapping("/Adv5")
public List<Adv5> getdetails() {
List<Adv5> get = Service.getdetails();
return get;
}
// get all without authentication
@GetMapping("/token/Adv5")
public List<Adv5> getallwioutsec() {
List<Adv5> get = Service.getdetails();
return get;
}
@GetMapping("/Adv5/{id}")
public Adv5 getdetailsbyId(@PathVariable Integer id ) {
Adv5 get = Service.getdetailsbyId(id);
return get;
}
@DeleteMapping("/Adv5/{id}")
public ResponseEntity<?> delete_by_id(@PathVariable Integer id ) {
Service.delete_by_id(id);
return new ResponseEntity<>(new EntityResponse("Deleted"), HttpStatus.OK);
}
}

View File

@ -0,0 +1,91 @@
package com.realnet.angulardatatype.Controllers;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import com.fasterxml.jackson.core.JsonProcessingException;
import org.springframework.web.bind.annotation.CrossOrigin;
import com.fasterxml.jackson.databind.JsonMappingException;
import com.realnet.config.EmailService;
import com.realnet.users.entity1.AppUser;
import com.realnet.users.service1.AppUserServiceImpl;
import com.fasterxml.jackson.databind.ObjectMapper;
import org.springframework.data.domain.*;
import com.realnet.fnd.response.EntityResponse;
import org.springframework.http.*;
import org.springframework.beans.factory.annotation.*;
import com.realnet.angulardatatype.Entity.Listtest;
import com.realnet.angulardatatype.Services.ListtestService ;
@RequestMapping(value = "/token/Listtest")
@CrossOrigin("*")
@RestController
public class tokenFree_ListtestController {
@Autowired
private ListtestService Service;
@Value("${projectPath}")
private String projectPath;
@PostMapping("/Listtest")
public Listtest Savedata(@RequestBody Listtest data) {
Listtest save = Service.Savedata(data) ;
System.out.println("data saved..." + save);
return save;
}
@PutMapping("/Listtest/{id}")
public Listtest update(@RequestBody Listtest data,@PathVariable Integer id ) {
Listtest update = Service.update(data,id);
System.out.println("data update..." + update);
return update;
}
// get all with pagination
@GetMapping("/Listtest/getall/page")
public Page<Listtest> getall(@RequestParam(value = "page", required = false) Integer page,
@RequestParam(value = "size", required = false) Integer size) {
Pageable paging = PageRequest.of(page, size);
Page<Listtest> get = Service.getAllWithPagination(paging);
return get;
}
@GetMapping("/Listtest")
public List<Listtest> getdetails() {
List<Listtest> get = Service.getdetails();
return get;
}
// get all without authentication
@GetMapping("/token/Listtest")
public List<Listtest> getallwioutsec() {
List<Listtest> get = Service.getdetails();
return get;
}
@GetMapping("/Listtest/{id}")
public Listtest getdetailsbyId(@PathVariable Integer id ) {
Listtest get = Service.getdetailsbyId(id);
return get;
}
@DeleteMapping("/Listtest/{id}")
public ResponseEntity<?> delete_by_id(@PathVariable Integer id ) {
Service.delete_by_id(id);
return new ResponseEntity<>(new EntityResponse("Deleted"), HttpStatus.OK);
}
}

View File

@ -0,0 +1,24 @@
package com.realnet.angulardatatype.Controllers;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import com.realnet.angulardatatype.Entity.Listtest_ListFilter1;
import com.realnet.angulardatatype.Services.Listtest_ListFilter1Service ;
@RequestMapping(value = "/token/Listtest_ListFilter1")
@RestController
public class tokenFree_Listtest_ListFilter1Controller {
@Autowired
private Listtest_ListFilter1Service Service;
@GetMapping("/Listtest_ListFilter1")
public List<Listtest_ListFilter1> getlist() {
List<Listtest_ListFilter1> get = Service.getlistbuilder();
return get;
}
@GetMapping("/Listtest_ListFilter11")
public List<Listtest_ListFilter1> getlistwithparam( ) {
List<Listtest_ListFilter1> get = Service.getlistbuilderparam( );
return get;
}
}

View File

@ -0,0 +1,91 @@
package com.realnet.angulardatatype.Controllers;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import com.fasterxml.jackson.core.JsonProcessingException;
import org.springframework.web.bind.annotation.CrossOrigin;
import com.fasterxml.jackson.databind.JsonMappingException;
import com.realnet.config.EmailService;
import com.realnet.users.entity1.AppUser;
import com.realnet.users.service1.AppUserServiceImpl;
import com.fasterxml.jackson.databind.ObjectMapper;
import org.springframework.data.domain.*;
import com.realnet.fnd.response.EntityResponse;
import org.springframework.http.*;
import org.springframework.beans.factory.annotation.*;
import com.realnet.angulardatatype.Entity.Support;
import com.realnet.angulardatatype.Services.SupportService ;
@RequestMapping(value = "/token/Support")
@CrossOrigin("*")
@RestController
public class tokenFree_SupportController {
@Autowired
private SupportService Service;
@Value("${projectPath}")
private String projectPath;
@PostMapping("/Support")
public Support Savedata(@RequestBody Support data) {
Support save = Service.Savedata(data) ;
System.out.println("data saved..." + save);
return save;
}
@PutMapping("/Support/{id}")
public Support update(@RequestBody Support data,@PathVariable Integer id ) {
Support update = Service.update(data,id);
System.out.println("data update..." + update);
return update;
}
// get all with pagination
@GetMapping("/Support/getall/page")
public Page<Support> getall(@RequestParam(value = "page", required = false) Integer page,
@RequestParam(value = "size", required = false) Integer size) {
Pageable paging = PageRequest.of(page, size);
Page<Support> get = Service.getAllWithPagination(paging);
return get;
}
@GetMapping("/Support")
public List<Support> getdetails() {
List<Support> get = Service.getdetails();
return get;
}
// get all without authentication
@GetMapping("/token/Support")
public List<Support> getallwioutsec() {
List<Support> get = Service.getdetails();
return get;
}
@GetMapping("/Support/{id}")
public Support getdetailsbyId(@PathVariable Integer id ) {
Support get = Service.getdetailsbyId(id);
return get;
}
@DeleteMapping("/Support/{id}")
public ResponseEntity<?> delete_by_id(@PathVariable Integer id ) {
Service.delete_by_id(id);
return new ResponseEntity<>(new EntityResponse("Deleted"), HttpStatus.OK);
}
}

View File

@ -0,0 +1,99 @@
package com.realnet.angulardatatype.Controllers;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import com.fasterxml.jackson.core.JsonProcessingException;
import org.springframework.web.bind.annotation.CrossOrigin;
import com.fasterxml.jackson.databind.JsonMappingException;
import com.realnet.config.EmailService;
import com.realnet.users.entity1.AppUser;
import com.realnet.users.service1.AppUserServiceImpl;
import com.fasterxml.jackson.databind.ObjectMapper;
import org.springframework.data.domain.*;
import com.realnet.fnd.response.EntityResponse;
import org.springframework.http.*;
import org.springframework.beans.factory.annotation.*;
import com.realnet.angulardatatype.Entity.Test;
import com.realnet.angulardatatype.Services.TestService ;
@RequestMapping(value = "/token/Test")
@CrossOrigin("*")
@RestController
public class tokenFree_TestController {
@Autowired
private TestService Service;
@Value("${projectPath}")
private String projectPath;
@PostMapping("/Test")
public Test Savedata(@RequestBody Test data) {
Test save = Service.Savedata(data) ;
System.out.println("data saved..." + save);
return save;
}
@PutMapping("/Test/{id}")
public Test update(@RequestBody Test data,@PathVariable Integer id ) {
Test update = Service.update(data,id);
System.out.println("data update..." + update);
return update;
}
// get all with pagination
@GetMapping("/Test/getall/page")
public Page<Test> getall(@RequestParam(value = "page", required = false) Integer page,
@RequestParam(value = "size", required = false) Integer size) {
Pageable paging = PageRequest.of(page, size);
Page<Test> get = Service.getAllWithPagination(paging);
return get;
}
@GetMapping("/Test")
public List<Test> getdetails() {
List<Test> get = Service.getdetails();
return get;
}
// get all without authentication
@GetMapping("/token/Test")
public List<Test> getallwioutsec() {
List<Test> get = Service.getdetails();
return get;
}
@GetMapping("/Test/{id}")
public Test getdetailsbyId(@PathVariable Integer id ) {
Test get = Service.getdetailsbyId(id);
return get;
}
@DeleteMapping("/Test/{id}")
public ResponseEntity<?> delete_by_id(@PathVariable Integer id ) {
Service.delete_by_id(id);
return new ResponseEntity<>(new EntityResponse("Deleted"), HttpStatus.OK);
}
}

View File

@ -0,0 +1,32 @@
package com.realnet.angulardatatype.Entity;
import lombok.*;
import com.realnet.WhoColumn.Entity.Extension;
import javax.persistence.*;
import java.time.LocalDateTime;
import java.util.*;
@Entity
@Data
public class Ad6 extends Extension {
/**
*
*/
private static final long serialVersionUID = 1L;
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Integer id;
private String name;
private String description;
}

View File

@ -0,0 +1,28 @@
package com.realnet.angulardatatype.Entity;
import lombok.*;
import com.realnet.WhoColumn.Entity.Extension;
import javax.persistence.*;
import java.time.LocalDateTime;
import java.util.*;
@Entity
@Data
public class Ad7 extends Extension {
/**
*
*/
private static final long serialVersionUID = 1L;
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Integer id;
private String name;
}

View File

@ -0,0 +1,33 @@
package com.realnet.angulardatatype.Entity;
import lombok.*;
import com.realnet.WhoColumn.Entity.Extension;
import javax.persistence.*;
import java.time.LocalDateTime;
import java.util.*;
import com.realnet.angulardatatype.Entity.Support;
@Entity
@Data
public class Ad8 extends Extension {
/**
*
*/
private static final long serialVersionUID = 1L;
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Integer id;
private String name;
@OneToMany( cascade=CascadeType.ALL)
private List<Support> support = new ArrayList<>();
}

View File

@ -0,0 +1,28 @@
package com.realnet.angulardatatype.Entity;
import lombok.*;
import com.realnet.WhoColumn.Entity.Extension;
import javax.persistence.*;
import java.time.LocalDateTime;
import java.util.*;
@Entity
@Data
public class Ad9 extends Extension {
/**
*
*/
private static final long serialVersionUID = 1L;
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Integer id;
private String name;
private String approved_field_status;
}

View File

@ -0,0 +1,66 @@
package com.realnet.angulardatatype.Entity;
import lombok.*;
import com.realnet.WhoColumn.Entity.Extension;
import javax.persistence.*;
import java.time.LocalDateTime;
import java.util.*;
@Entity
@Data
public class Adv3 extends Extension {
/**
*
*/
private static final long serialVersionUID = 1L;
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Integer id;
private String country;
private String state;
private String stmlit;
private String stmmlt2;
private Integer dy2;
private String dy2name;
private Integer dy1;
private String dy1name;
private String dymlti1;
private String dymlt2;
}

View File

@ -0,0 +1,43 @@
package com.realnet.angulardatatype.Entity;
import lombok.*;
import com.realnet.WhoColumn.Entity.Extension;
import javax.persistence.*;
import java.time.LocalDateTime;
import java.util.*;
import com.realnet.angulardatatype.Entity.Support;
@Entity
@Data
public class Adv4 extends Extension {
/**
*
*/
private static final long serialVersionUID = 1L;
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Integer id;
private Integer atoc;
private String atoctypename;
private Integer atc2;
private String atc2typename;
private String atdy1;
private String atdy2;
@OneToOne( cascade=CascadeType.ALL)
private Support support;
}

View File

@ -0,0 +1,53 @@
package com.realnet.angulardatatype.Entity;
import lombok.*;
import com.realnet.WhoColumn.Entity.Extension;
import javax.persistence.*;
import java.time.LocalDateTime;
import java.util.*;
import com.realnet.angulardatatype.Entity.Support;
@Entity
@Data
public class Adv5 extends Extension {
/**
*
*/
private static final long serialVersionUID = 1L;
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Integer id;
private String name;
@OneToMany( cascade=CascadeType.ALL)
private List<Support> support = new ArrayList<>();
private int age;
private int age2;
private String addition;
private String subtration;
}

View File

@ -0,0 +1,29 @@
package com.realnet.angulardatatype.Entity;
import lombok.*;
import com.realnet.WhoColumn.Entity.Extension;
import javax.persistence.*;
import java.time.LocalDateTime;
import java.util.*;
@Entity
@Data
public class Listtest extends Extension {
/**
*
*/
private static final long serialVersionUID = 1L;
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Integer id;
private String name;
@Column(length = 2000)
private String description;
}

View File

@ -0,0 +1,14 @@
package com.realnet.angulardatatype.Entity;
import lombok.*;
import javax.persistence.*;
import java.time.LocalDateTime;
import java.util.*;
@Data
public class Listtest_ListFilter1 {
private Integer id;
private String name;
}

View File

@ -0,0 +1,29 @@
package com.realnet.angulardatatype.Entity;
import lombok.*;
import com.realnet.WhoColumn.Entity.Extension;
import javax.persistence.*;
import java.time.LocalDateTime;
import java.util.*;
@Entity
@Data
public class Support extends Extension {
/**
*
*/
private static final long serialVersionUID = 1L;
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Integer id;
private String name;
@Column(length = 2000)
private String description;
}

View File

@ -0,0 +1,35 @@
package com.realnet.angulardatatype.Entity;
import lombok.*;
import com.realnet.WhoColumn.Entity.Extension;
import javax.persistence.*;
import java.time.LocalDateTime;
import java.util.*;
@Entity
@Data
public class Test extends Extension {
/**
*
*/
private static final long serialVersionUID = 1L;
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Integer id;
private String name;
@Column(length = 2000)
private String description;
private String password_field;
@Transient
private String confirmpassword_field;
}

View File

@ -0,0 +1,30 @@
package com.realnet.angulardatatype.Repository;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;
import java.util.*;
import com.realnet.angulardatatype.Entity.Ad6;
@Repository
public interface Ad6Repository extends JpaRepository<Ad6, Integer> {
@Query(value = "select * from ad6 where created_by=?1", nativeQuery = true)
List<Ad6> findAll(Long creayedBy);
@Query(value = "select * from ad6 where created_by=?1", nativeQuery = true)
Page<Ad6> findAll(Pageable page, Long creayedBy);
}

View File

@ -0,0 +1,28 @@
package com.realnet.angulardatatype.Repository;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;
import java.util.*;
import com.realnet.angulardatatype.Entity.Ad7;
@Repository
public interface Ad7Repository extends JpaRepository<Ad7, Integer> {
@Query(value = "select * from ad7 where created_by=?1", nativeQuery = true)
List<Ad7> findAll(Long creayedBy);
@Query(value = "select * from ad7 where created_by=?1", nativeQuery = true)
Page<Ad7> findAll(Pageable page, Long creayedBy);
}

View File

@ -0,0 +1,30 @@
package com.realnet.angulardatatype.Repository;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;
import java.util.*;
import com.realnet.angulardatatype.Entity.Ad8;
@Repository
public interface Ad8Repository extends JpaRepository<Ad8, Integer> {
@Query(value = "select * from ad8 where created_by=?1", nativeQuery = true)
List<Ad8> findAll(Long creayedBy);
@Query(value = "select * from ad8 where created_by=?1", nativeQuery = true)
Page<Ad8> findAll(Pageable page, Long creayedBy);
}

View File

@ -0,0 +1,28 @@
package com.realnet.angulardatatype.Repository;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;
import java.util.*;
import com.realnet.angulardatatype.Entity.Ad9;
@Repository
public interface Ad9Repository extends JpaRepository<Ad9, Integer> {
@Query(value = "select * from ad9 where created_by=?1", nativeQuery = true)
List<Ad9> findAll(Long creayedBy);
@Query(value = "select * from ad9 where created_by=?1", nativeQuery = true)
Page<Ad9> findAll(Pageable page, Long creayedBy);
}

View File

@ -0,0 +1,46 @@
package com.realnet.angulardatatype.Repository;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;
import java.util.*;
import com.realnet.angulardatatype.Entity.Adv3;
@Repository
public interface Adv3Repository extends JpaRepository<Adv3, Integer> {
@Query(value = "select * from adv3 where created_by=?1", nativeQuery = true)
List<Adv3> findAll(Long creayedBy);
@Query(value = "select * from adv3 where created_by=?1", nativeQuery = true)
Page<Adv3> findAll(Pageable page, Long creayedBy);
}

View File

@ -0,0 +1,34 @@
package com.realnet.angulardatatype.Repository;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;
import java.util.*;
import com.realnet.angulardatatype.Entity.Adv4;
@Repository
public interface Adv4Repository extends JpaRepository<Adv4, Integer> {
@Query(value = "select * from adv4 where created_by=?1", nativeQuery = true)
List<Adv4> findAll(Long creayedBy);
@Query(value = "select * from adv4 where created_by=?1", nativeQuery = true)
Page<Adv4> findAll(Pageable page, Long creayedBy);
}

View File

@ -0,0 +1,40 @@
package com.realnet.angulardatatype.Repository;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;
import java.util.*;
import com.realnet.angulardatatype.Entity.Adv5;
@Repository
public interface Adv5Repository extends JpaRepository<Adv5, Integer> {
@Query(value = "select * from adv5 where created_by=?1", nativeQuery = true)
List<Adv5> findAll(Long creayedBy);
@Query(value = "select * from adv5 where created_by=?1", nativeQuery = true)
Page<Adv5> findAll(Pageable page, Long creayedBy);
}

View File

@ -0,0 +1,28 @@
package com.realnet.angulardatatype.Repository;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;
import java.util.*;
import com.realnet.angulardatatype.Entity.Listtest;
@Repository
public interface ListtestRepository extends JpaRepository<Listtest, Integer> {
@Query(value = "select * from listtest where created_by=?1", nativeQuery = true)
List<Listtest> findAll(Long creayedBy);
@Query(value = "select * from listtest where created_by=?1", nativeQuery = true)
Page<Listtest> findAll(Pageable page, Long creayedBy);
}

View File

@ -0,0 +1,28 @@
package com.realnet.angulardatatype.Repository;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;
import java.util.*;
import com.realnet.angulardatatype.Entity.Support;
@Repository
public interface SupportRepository extends JpaRepository<Support, Integer> {
@Query(value = "select * from support where created_by=?1", nativeQuery = true)
List<Support> findAll(Long creayedBy);
@Query(value = "select * from support where created_by=?1", nativeQuery = true)
Page<Support> findAll(Pageable page, Long creayedBy);
}

View File

@ -0,0 +1,30 @@
package com.realnet.angulardatatype.Repository;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;
import java.util.*;
import com.realnet.angulardatatype.Entity.Test;
@Repository
public interface TestRepository extends JpaRepository<Test, Integer> {
@Query(value = "select * from test where created_by=?1", nativeQuery = true)
List<Test> findAll(Long creayedBy);
@Query(value = "select * from test where created_by=?1", nativeQuery = true)
Page<Test> findAll(Pageable page, Long creayedBy);
}

Some files were not shown because too many files have changed in this diff Show More